mopidy/mopidy — pull request #282 by trygveaa (2012-12-18 15:10:20+00:00)
Title: audio: Make get_volume able to return all levels 

If max volume on the selected track is below 100, each volume level in mopidy will not have a corresponding level on the track. That means that if I try to set the volume to e.g. 43, it may be set to 44, and the next time I get the volume I receive 44. If my applications changes the volume by one level at a time, it would try to set it to 43 again, and so it would be stuck on 44.

This commit stores the volume set, and when the volume is fetched, it checks if the stored value still corresponds to the value from the mixer. If it does, it returns the stored value. If not, it returns the value from the mixer.