Index: NowPlayingApplet.lua =================================================================== --- NowPlayingApplet.lua (revision 1) +++ NowPlayingApplet.lua (revision 23) @@ -101,12 +101,28 @@ local server = self.player:getSlimServer() local ARTWORK_SIZE = self:getSelectedStyleParam('artworkSize') + local LINE_SPACE = self:getSelectedStyleParam('itemheight') local iconId + local extraSpace = 4*LINE_SPACE if item then iconId = item["icon-id"] or item["icon"] + if LINE_SPACE then + if item["band"]=="" then extraSpace = extraSpace - LINE_SPACE end + if (item["artist"]=="" or item["artist"]=="No Artist") then extraSpace = extraSpace - LINE_SPACE end + if item["conductor"]=="" then extraSpace = extraSpace - LINE_SPACE end + else + extraSpace = 0 + end end + if LINE_SPACE then + local Iconsize = string.split("x",ARTWORK_SIZE) + Iconsize[1] = Iconsize[1] - extraSpace + Iconsize[2] = Iconsize[2] - extraSpace + ARTWORK_SIZE=Iconsize[1]..'x'..Iconsize[2] + end + if iconId then -- Fetch an image from SlimServer server:fetchArtwork(iconId, icon, ARTWORK_SIZE) @@ -876,6 +892,15 @@ local track = trackTable[1] local artist = trackTable[2] local album = trackTable[3] + local composer = trackTable[4] + local conductor = trackTable[5] + local band = trackTable[6] + if artist == "No Artist" then artist = '' end + log:debug('track = ',track) + log:debug('artist= ',artist) + log:debug('album = ',album) + log:debug('composer=',composer) + log:debug('band = ',band) local artistalbum = '' if artist ~= '' and album ~= '' then @@ -885,6 +910,27 @@ elseif album ~= '' then artistalbum = album end + local info0 = '' + local info2 = '' + local info3 = '' + local info4 = '' + info0 = album + if artist ~= '' then + info2 = artist + if band ~= '' then + info3 = band + if conductor ~= '' then + info4 = conductor + end + end + else + if band ~= '' then + info2 = band + if conductor ~= '' then + info3 = conductor + end + end + end if self.scrollSwitchTimer and self.scrollSwitchTimer:isRunning() then self.scrollSwitchTimer:stop() @@ -893,11 +939,24 @@ self.trackTitle:setValue(track) self.albumTitle:setValue(album) self.artistTitle:setValue(artist) + self.composerTitle:setValue(composer) + self.info0Title:setValue(info0) + self.info2Title:setValue(info2) + self.info3Title:setValue(info3) + self.info4Title:setValue(info4) self.artistalbumTitle:setValue(artistalbum) if self.scrollText then - self.trackTitle:animate(true) + self.trackTitle:animate(false) + self.info0Title:animate(true) + self.info2Title:animate(false) + self.info3Title:animate(false) + log:debug("animation set for info0Title") else self.trackTitle:animate(false) + self.info0Title:animate(false) + self.info2Title:animate(false) + self.info3Title:animate(false) + log:debug("animation off") end self.artistTitle:animate(false) self.albumTitle:animate(false) @@ -1323,7 +1382,7 @@ --local window = Window("text_list") self.windowStyle = self.selectedStyle if not self.windowStyle then - self.windowStyle = 'nowplaying' + self.windowStyle = 'nowplaying_classical' end local window = Window(self.windowStyle) @@ -1348,6 +1407,11 @@ self.albumTitle = Label('npalbum', "") self.artistTitle = Label('npartist', "") self.artistalbumTitle = Label('npartistalbum', "") + self.composerTitle = Label('npcomposer',"") + self.info0Title = Label('npinfo0',"") + self.info2Title = Label('npinfo2',"") + self.info3Title = Label('npinfo3',"") + self.info4Title = Label('npinfo4',"") local launchContextMenu = function() @@ -1372,36 +1436,94 @@ if not self.scrollSwitchTimer and self.scrollText then self:_addScrollSwitchTimer() - self.scrollSwitchTimer = Timer(3000, + self.scrollSwitchTimer = Timer(1000, function() - self.trackTitle:animate(true) + log:debug("setting scrollswitchtimer; start animation info0Title") + self.info0Title:animate(true) + self.albumTitle:animate(false) self.artistalbumTitle:animate(false) self.artistTitle:animate(false) - self.albumTitle:animate(false) + self.trackTitle:animate(false) + self.info2Title:animate(false) + self.info3Title:animate(false) end, true) end - self.trackTitle.textStopCallback = + self.info0Title.textStopCallback = function(label) if self.scrollSwitchTimer and not self.scrollSwitchTimer:isRunning() then - log:debug('trackTitle animation done, animate artistalbum/artistTitle') - self.artistalbumTitle:animate(true) - self.artistTitle:animate(true) - self.trackTitle:animate(false) + log:debug('info0Title animation done, animate trackTitle') + self.info0Title:animate(false) + self.albumTitle:animate(false) + self.artistalbumTitle:animate(false) + self.artistTitle:animate(false) + self.trackTitle:animate(true) + self.info2Title:animate(false) + self.info3Title:animate(false) end end + local hasArtistAlbum = jiveMain:getSkinParam("NOWPLAYING_TRACKINFO_LINES") == 2 if hasArtistAlbum then - self.artistalbumTitle.textStopCallback = + + self.trackTitle.textStopCallback = function(label) - self.artistalbumTitle:animate(false) - self.trackTitle:animate(false) - if self.scrollSwitchTimer and not self.scrollSwitchTimer:isRunning() and + if self.scrollSwitchTimer and not self.scrollSwitchTimer:isRunning() then + log:debug('trackTitle animation done, animate artistalbum') + self.info0Title:animate(false) + self.albumTitle:animate(false) + self.artistalbumTitle:animate(true) + self.artistTitle:animate(false) + self.trackTitle:animate(false) + self.info2Title:animate(false) + self.info3Title:animate(false) + end + end + + self.artistalbumTitle.textStopCallback = + function(label) + if self.scrollSwitchTimer and not self.scrollSwitchTimer:isRunning() then + log:debug('artistalbumTitle animation done, animate info2') + self.info0Title:animate(false) + self.albumTitle:animate(false) + self.artistalbumTitle:animate(false) + self.artistTitle:animate(false) + self.trackTitle:animate(false) + self.info2Title:animate(true) + self.info3Title:animate(false) + end + end + + self.info2Title.textStopCallback = + function(label) + if self.scrollSwitchTimer and not self.scrollSwitchTimer:isRunning() then + log:debug('info2Title animation done, animate info3') + self.info0Title:animate(false) + self.albumTitle:animate(false) + self.artistalbumTitle:animate(false) + self.artistTitle:animate(false) + self.trackTitle:animate(false) + self.info2Title:animate(false) + self.info3Title:animate(true) + end + end + + self.info3Title.textStopCallback = + function(label) + log:debug('info3Title animation done') + self.info0Title:animate(false) + self.albumTitle:animate(false) + self.artistalbumTitle:animate(false) + self.artistTitle:animate(false) + self.trackTitle:animate(false) + self.info2Title:animate(false) + self.info3Title:animate(false) + if self.scrollSwitchTimer and not self.scrollSwitchTimer:isRunning() and not self.scrollTextOnce then - log:debug('artistAlbum animation done, restarting timer') + log:debug('info3 animation done, restarting timer') self.scrollSwitchTimer:restart() end end @@ -1648,6 +1770,12 @@ window:addWidget(self.npartistGroup) window:addWidget(self.artistalbumTitle) window:addWidget(self.artworkGroup) + window:addWidget(self.composerTitle) + window:addWidget(self.info0Title) + window:addWidget(self.info2Title) + window:addWidget(self.info3Title) + window:addWidget(self.info4Title) + -- Visualizer: Only load if needed if (self.windowStyle == "nowplaying_spectrum_text") or (self.windowStyle == "nowplaying_vuanalog_text") then window:addWidget(self.visuGroup) @@ -1756,8 +1884,9 @@ self.nowPlayingScreenStyles = self:getNPStyles() if not self.selectedStyle then - self.selectedStyle = 'nowplaying' + self.selectedStyle = 'nowplaying_classical' end + local npWindow = self.window local lineInActive = appletManager:callService("isLineInActive") @@ -1872,10 +2001,13 @@ log:debug('Adding scrollSwitchTimer for scrolling text, self.scrollText: ', self.scrollText, ' self.scrollTextOnce: ', self.scrollTextOnce) self.scrollSwitchTimer = Timer(3000, function() - self.trackTitle:animate(true) + self.trackTitle:animate(false) + self.info0Title:animate(false) self.artistalbumTitle:animate(false) self.artistTitle:animate(false) self.albumTitle:animate(false) + self.info2Title:animate(false) + self.info3Title:animate(false) end, true ) @@ -1894,6 +2026,9 @@ table.insert(returnTable, _track.track) table.insert(returnTable, _track.artist) table.insert(returnTable, _track.album) + table.insert(returnTable, _track.composer) + table.insert(returnTable, _track.conductor) + table.insert(returnTable, _track.band) return returnTable else return _track.text or "\n\n\n"