Author: bklaas
Date: Tue Sep 14 12:52:57 2010
New Revision: 9114
URL: http://svn.slimdevices.com/jive?rev=9114&view=rev
Log:
Bug: 16448
Description: sent playerTrackChange notification when artwork link differs from
previous update
Modified:
7.6/trunk/squeezeplay/src/squeezeplay/share/jive/slim/Player.lua
Modified: 7.6/trunk/squeezeplay/src/squeezeplay/share/jive/slim/Player.lua
URL:
http://svn.slimdevices.com/jive/7.6/trunk/squeezeplay/src/squeezeplay/share/jive/slim/Player.lua?rev=9114&r1=9113&r2=9114&view=diff
==============================================================================
--- 7.6/trunk/squeezeplay/src/squeezeplay/share/jive/slim/Player.lua (original)
+++ 7.6/trunk/squeezeplay/src/squeezeplay/share/jive/slim/Player.lua Tue Sep 14
12:52:57 2010
@@ -268,6 +268,7 @@
-- returns the track_id from a playerstatus structure
local function _whatsPlaying(obj)
local whatsPlaying = nil
+ local artwork = nil
if obj.item_loop then
if obj.item_loop[1].params then
if obj.item_loop[1].params.track_id and not obj.remote
then
@@ -278,8 +279,9 @@
whatsPlaying = obj.item_loop[1].text
end
end
- end
- return whatsPlaying
+ artwork = obj.item_loop and obj.item_loop[1]["icon-id"] or
obj.item_loop[1].icon
+ end
+ return whatsPlaying, artwork
end
@@ -1230,7 +1232,7 @@
self:updatePlayerInfo(self.slimServer, playerInfo, useSequenceNumber,
isSequenceNumberInSync)
-- update track list
- local nowPlaying = _whatsPlaying(event.data)
+ local nowPlaying, artwork = _whatsPlaying(event.data)
if self.state.mode ~= oldState.mode then
-- self.mode is set immedidately by togglePause and stop
methods to give immediate user feedback in e.g. iconbar
@@ -1272,10 +1274,11 @@
self.jnt:notify('playerRepeatModeChange', self,
self.state['playlist repeat'])
end
- if self.nowPlaying ~= nowPlaying then
+ if self.nowPlaying ~= nowPlaying or self.nowPlayingArtwork ~= artwork
then
log:debug('notify_playerTrackChange')
self.nowPlaying = nowPlaying
- self.jnt:notify('playerTrackChange', self, nowPlaying)
+ self.nowPlayingArtwork = artwork
+ self.jnt:notify('playerTrackChange', self, nowPlaying, artwork)
end
if self.state.playlist_timestamp ~= oldState.playlist_timestamp then
_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/jive-checkins