Author: ayoung
Date: Tue Feb 23 02:08:22 2010
New Revision: 8550

URL: http://svn.slimdevices.com/jive?rev=8550&view=rev
Log:
Fixed bug 15239: Alarm starts with loud volume, then drops to the alarm 
starting volume 
Only update volume state variable for the LocalPlayer->Playback upon receiving 
a playerStatus
update and leave all server-initiated actual volume changes to Slimproto 'audg' 
packets. 

Modified:
    7.5/trunk/squeezeplay/src/squeezeplay/share/jive/audio/Playback.lua
    7.5/trunk/squeezeplay/src/squeezeplay/share/jive/slim/LocalPlayer.lua
    7.5/trunk/squeezeplay/src/squeezeplay/share/jive/slim/Player.lua

Modified: 7.5/trunk/squeezeplay/src/squeezeplay/share/jive/audio/Playback.lua
URL: 
http://svn.slimdevices.com/jive/7.5/trunk/squeezeplay/src/squeezeplay/share/jive/audio/Playback.lua?rev=8550&r1=8549&r2=8550&view=diff
==============================================================================
--- 7.5/trunk/squeezeplay/src/squeezeplay/share/jive/audio/Playback.lua 
(original)
+++ 7.5/trunk/squeezeplay/src/squeezeplay/share/jive/audio/Playback.lua Tue Feb 
23 02:08:22 2010
@@ -765,11 +765,13 @@
        _defaultVolumeToGain = value
 end
 
-function setVolume(self, volume)
+function setVolume(self, volume, stateOnly)
        log:debug("setVolume: ", volume)
 
        self.volume = volume
-       self:_setGain(self:_getGainFromVolume(volume))
+       if (not stateOnly) then
+               self:_setGain(self:_getGainFromVolume(volume))
+       end
 end
 
 
@@ -803,13 +805,13 @@
                end
 
                self:_stopPauseAndStopTimers()
-       ----NOTE: not using server value for self.volume, because fades come in 
through the audg mechanism. Instead, wait for the player status before
-       ---- setting the locally held self.volume. This could cause a case 
where remote ui changes volume and the local volume isn't seen as right until 
playerstatus completes 
---             --for now only using the translated volume value, not 
converting gain to a local value
---             if self.volume ~= volume then
---                     log:warn("new volume set from server: ", volume)
---                     self.volume = volume
---             end
+               
+               -- NOTE: not using server value for self.volume, because fades 
come in through the audg mechanism.
+               -- Instead, wait for the player status before setting the 
locally held self.volume.
+               -- This could cause a case where a remote UI changes volume and
+               -- the local volume isn't seen as right until playerstatus 
completes.
+               -- Also, during a fade, the displayed volume will be the 
eventual volume for fade-in
+               -- and the initial volume for fade-out. 
        end
 
        log:debug("gainL, gainR: ", data.gainL, " ", data.gainR)

Modified: 7.5/trunk/squeezeplay/src/squeezeplay/share/jive/slim/LocalPlayer.lua
URL: 
http://svn.slimdevices.com/jive/7.5/trunk/squeezeplay/src/squeezeplay/share/jive/slim/LocalPlayer.lua?rev=8550&r1=8549&r2=8550&view=diff
==============================================================================
--- 7.5/trunk/squeezeplay/src/squeezeplay/share/jive/slim/LocalPlayer.lua 
(original)
+++ 7.5/trunk/squeezeplay/src/squeezeplay/share/jive/slim/LocalPlayer.lua Tue 
Feb 23 02:08:22 2010
@@ -290,12 +290,12 @@
        return Player.volume(self, vol, send)
 end
 
-function volumeLocal(self, vol, updateSequenceNumber)
+function volumeLocal(self, vol, updateSequenceNumber, stateOnly)
        --sometime we want to update the sequence number directly, like when 
there is no server connection and volume is changed
        if updateSequenceNumber then
                self:incrementSequenceNumber()
        end
-       self.playback:setVolume(vol)
+       self.playback:setVolume(vol, stateOnly)
 end
 
 

Modified: 7.5/trunk/squeezeplay/src/squeezeplay/share/jive/slim/Player.lua
URL: 
http://svn.slimdevices.com/jive/7.5/trunk/squeezeplay/src/squeezeplay/share/jive/slim/Player.lua?rev=8550&r1=8549&r2=8550&view=diff
==============================================================================
--- 7.5/trunk/squeezeplay/src/squeezeplay/share/jive/slim/Player.lua (original)
+++ 7.5/trunk/squeezeplay/src/squeezeplay/share/jive/slim/Player.lua Tue Feb 23 
02:08:22 2010
@@ -1291,7 +1291,11 @@
                                        --When muted, server sends a 0 vol, 
ignore it
                                        self.state["mixer volume"] = 
oldState["mixer volume"] 
                                else
-                                       self:volumeLocal(serverVolume)
+                                       -- only persist the state here - the 
actual volume is changed with audg
+                                       -- (we are effectively casting a Player 
to a LocalPlayer here, on the basis of useSequenceNumber;
+                                       -- knowing this, we could just do: 
self.playback:setVolume(vol, stateOnly) but that would
+                                       -- be breaking the encapsulation even 
more)
+                                       self:volumeLocal(serverVolume, false, 
true)
                                end
                        end
                else

_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/jive-checkins

Reply via email to