Author: titmuss
Date: Tue Jun 17 11:58:25 2008
New Revision: 2578
URL: http://svn.slimdevices.com?rev=2578&root=Jive&view=rev
Log:
Bug: 6683
Description:
Fix now playing when switching servers, or when the player disappears. This now
hides the now playing screen and correctly updates the now playing item on the
home
menu.
Fixed player mode notification, this got lost in the changes.
Modified:
7.1/branches/discovery-refactor/squeezeplay/src/squeezeplay/share/applets/NowPlaying/NowPlayingApplet.lua
7.1/branches/discovery-refactor/squeezeplay/src/squeezeplay/share/jive/slim/Player.lua
Modified:
7.1/branches/discovery-refactor/squeezeplay/src/squeezeplay/share/applets/NowPlaying/NowPlayingApplet.lua
URL:
http://svn.slimdevices.com/7.1/branches/discovery-refactor/squeezeplay/src/squeezeplay/share/applets/NowPlaying/NowPlayingApplet.lua?rev=2578&root=Jive&r1=2577&r2=2578&view=diff
==============================================================================
---
7.1/branches/discovery-refactor/squeezeplay/src/squeezeplay/share/applets/NowPlaying/NowPlayingApplet.lua
(original)
+++
7.1/branches/discovery-refactor/squeezeplay/src/squeezeplay/share/applets/NowPlaying/NowPlayingApplet.lua
Tue Jun 17 11:58:25 2008
@@ -168,16 +168,6 @@
end
end
-function notify_playerDelete(self, player)
- if player ~= self.player then
- return
- end
- -- player has left the building, close Now Playing browse window
- if self['browse'] and self['browse'].window then
- self['browse'].window:hide()
- end
-end
-
function notify_playerTrackChange(self, player, nowPlaying)
log:info("Notification received that track has changed")
@@ -224,6 +214,16 @@
self:_updateMode(mode)
end
+-- players gone, close now playing
+function notify_playerDelete(self, player)
+ if player ~= self.player then
+ return
+ end
+
+ self:free()
+end
+
+-- players changed, add playing menu
function notify_playerCurrent(self, player)
if self.player ~= player then
@@ -617,6 +617,16 @@
-- the screen can get loaded with two layouts, and by doing this
-- we force the recreation of the UI when re-entering the screen,
possibly in a different mode
log:info("NowPlaying.free()")
+
+ -- player has left the building, close Now Playing browse window
+ if self['browse'] and self['browse'].window then
+ self['browse'].window:hide()
+ end
+
+ if self['ss'] and self['ss'].window then
+ self['ss'].window:hide()
+ end
+
self.player = false
self['ss'] = nil
self['browse'] = nil
Modified:
7.1/branches/discovery-refactor/squeezeplay/src/squeezeplay/share/jive/slim/Player.lua
URL:
http://svn.slimdevices.com/7.1/branches/discovery-refactor/squeezeplay/src/squeezeplay/share/jive/slim/Player.lua?rev=2578&root=Jive&r1=2577&r2=2578&view=diff
==============================================================================
---
7.1/branches/discovery-refactor/squeezeplay/src/squeezeplay/share/jive/slim/Player.lua
(original)
+++
7.1/branches/discovery-refactor/squeezeplay/src/squeezeplay/share/jive/slim/Player.lua
Tue Jun 17 11:58:25 2008
@@ -766,6 +766,7 @@
end
-- update our state in one go
+ local oldState = self.state
self.state = event.data
-- used for calculating getTrackElapsed(), getTrackRemaining()
@@ -792,6 +793,10 @@
-- update track list
local nowPlaying = _whatsPlaying(event.data)
+
+ if self.state.mode ~= oldState.mode then
+ self.jnt:notify('playerModeChange', self, self.state.mode)
+ end
if self.nowPlaying ~= nowPlaying then
self.nowPlaying = nowPlaying
_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins