Author: bklaas
Date: Fri Jul 25 13:00:26 2008
New Revision: 2745

URL: http://svn.slimdevices.com?rev=2745&root=Jive&view=rev
Log:
Bug: 8866
Description: revert NowPlayingApplet to support controller
for now, never show back arrow in DefaultSkin
add 'splitmenu' style, which in DefaultSkin is exactly the same as 'menu' style

Modified:
    
7.2/trunk/squeezeplay/src/squeezeplay/share/applets/DefaultSkin/DefaultSkinApplet.lua
    
7.2/trunk/squeezeplay/src/squeezeplay/share/applets/NowPlaying/NowPlayingApplet.lua
    7.2/trunk/squeezeplay/src/squeezeplay/share/jive/ui/HomeMenu.lua

Modified: 
7.2/trunk/squeezeplay/src/squeezeplay/share/applets/DefaultSkin/DefaultSkinApplet.lua
URL: 
http://svn.slimdevices.com/7.2/trunk/squeezeplay/src/squeezeplay/share/applets/DefaultSkin/DefaultSkinApplet.lua?rev=2745&root=Jive&r1=2744&r2=2745&view=diff
==============================================================================
--- 
7.2/trunk/squeezeplay/src/squeezeplay/share/applets/DefaultSkin/DefaultSkinApplet.lua
 (original)
+++ 
7.2/trunk/squeezeplay/src/squeezeplay/share/applets/DefaultSkin/DefaultSkinApplet.lua
 Fri Jul 25 13:00:26 2008
@@ -332,15 +332,20 @@
        s.title.border = 4
        s.title.position = LAYOUT_NORTH
        s.title.bgImg = titleBox
-       s.title.order = { "back", "text" }
+       --FIXME: bug 8866
+       --s.title.order = { "back", "text" }
+       s.title.order = { "text" }
        s.title.text = {}
        s.title.text.padding = { 10, 8, 8, 8 }
        s.title.text.align = "top-left"
        s.title.text.font = FONT_BOLD_18px
        s.title.text.fg = SELECT_COLOR
+--[[
+       --FIXME: bug 8866
        s.title.back = {}
        s.title.back.img = Surface:loadImage(imgpath .. "selection_left.png")
        s.title.back.align = "left"
+--]]
 
 --[[
        s.title.icon = {}
@@ -356,6 +361,9 @@
        s.menu.itemHeight = 27
        s.menu.fg = {0xbb, 0xbb, 0xbb }
        s.menu.font = FONT_BOLD_200px
+
+       -- s.splitmenu in default skin is a clone of s.menu
+       s.splitmenu = _uses(s.menu)
 
        -- menu item
        s.item = {}
@@ -784,7 +792,9 @@
        s.albumtitle = {}
        s.albumtitle.position = LAYOUT_NORTH
        s.albumtitle.bgImg = titleBox
-       s.albumtitle.order = { "back", "icon", "text" }
+       --FIXME: bug 8866
+       --s.albumtitle.order = { "back", "icon", "text" }
+       s.albumtitle.order = { "icon", "text" }
        s.albumtitle.w = screenWidth
        s.albumtitle.h = 60
        s.albumtitle.border = 4
@@ -805,9 +815,11 @@
        s.albumtitle.icon.align = "left"
        s.albumtitle.icon.img = Surface:loadImage(imgpath .. 
"menu_album_noartwork.png")
        s.albumtitle.icon.padding = { 9, 0, 0, 0 }
+--[[ FIXME: bug 8866
        s.albumtitle.back = {}
        s.albumtitle.back.img = Surface:loadImage(imgpath .. 
"selection_left.png")
        s.albumtitle.back.align = "left"
+--]]
 
 
        -- titles with mini icons
@@ -823,7 +835,8 @@
        s.minititle.text.align    = 'top-left'
        s.minititle.text.font     = FONT_BOLD_18px
        s.minititle.text.fg       = SELECT_COLOR
-       s.minititle.order         = { "back", "text", "icon" }
+-- FIXME: bug 8866
+       s.minititle.order         = { "text", "icon" }
        s.minititle.icon = {}
        s.minititle.icon.padding  = { 0, 0, 8, 0 }
        s.minititle.icon.align    = 'right'

Modified: 
7.2/trunk/squeezeplay/src/squeezeplay/share/applets/NowPlaying/NowPlayingApplet.lua
URL: 
http://svn.slimdevices.com/7.2/trunk/squeezeplay/src/squeezeplay/share/applets/NowPlaying/NowPlayingApplet.lua?rev=2745&root=Jive&r1=2744&r2=2745&view=diff
==============================================================================
--- 
7.2/trunk/squeezeplay/src/squeezeplay/share/applets/NowPlaying/NowPlayingApplet.lua
 (original)
+++ 
7.2/trunk/squeezeplay/src/squeezeplay/share/applets/NowPlaying/NowPlayingApplet.lua
 Fri Jul 25 13:00:26 2008
@@ -43,9 +43,16 @@
 module(..., Framework.constants)
 oo.class(_M, Applet)
 
+
+-- FIXME: Bug 8479. workaround: this is hardcoded for now
+local ARTWORK_SIZE = 154
+
+--[[ alternative skins
+local ARTWORK_SIZE = 190
 local ARTWORK_SIZE = 350
-
---local showProgressBar = true
+--]]
+
+local showProgressBar = true
 local modeTokens = {
        off   = "SCREENSAVER_OFF",
        play  = "SCREENSAVER_NOWPLAYING",
@@ -90,6 +97,15 @@
 
 local function _getIcon(self, item, icon, remote)
        local server = self.player:getSlimServer()
+
+       if windowStyle == 'ss' then
+               -- without drop shadow
+               ARTWORK_SIZE = 186
+               -- with drop shadow
+               --ARTWORK_SIZE = 172
+       else
+               ARTWORK_SIZE = 154
+       end
 
        if item and item["icon-id"] then
                -- Fetch an image from SlimServer
@@ -268,13 +284,13 @@
 
        if playerStatus.item_loop then
                local text = playerStatus.item_loop[1].text
---             local showProgressBar = true
+               local showProgressBar = true
                -- XXX: current_title of null is a function value??
                if playerStatus.remote == 1 and 
type(playerStatus.current_title) == 'string' then 
                        text = text .. "\n" .. playerStatus.current_title
                end
                if playerStatus.time == 0 then
---                     showProgressBar = false
+                       showProgressBar = false
                end
 
                local item = playerStatus.item_loop[1]
@@ -283,7 +299,8 @@
                        _getIcon(self, item, ws.artwork, playerStatus.remote)
 
                        self:_updateTrack(text, ws)
---                     self:_updateProgress(playerStatus, ws)
+                       self:_updateProgress(playerStatus, ws)
+                       self:_updatePlaylist(true, 
playerStatus.playlist_cur_index, playerStatus.playlist_tracks, ws)
                
                        -- preload artwork for next track
                        if playerStatus.item_loop[2] then
@@ -294,6 +311,7 @@
                if ws and ws.window then
                        _getIcon(self, nil, ws.artwork, nil)
                        self:_updateTrack("\n\n\n", ws)
+                       self:_updatePlaylist(false, 0, 0, ws)
                end
        end
 end
@@ -345,15 +363,23 @@
                strRemain = "-" .. _secondsToString(duration - elapsed)
        end
 
---[[
        self[windowStyle].progressGroup:setWidgetValue("elapsed", strElapsed)
        if showProgressBar then
                self[windowStyle].progressGroup:setWidgetValue("remain", 
strRemain)
                self[windowStyle].progressSlider:setValue(elapsed)
        end
---]]
-end
-
+end
+
+
+function _updatePlaylist(self, enabled, nr, count, ws)
+       if not ws then ws = self[windowStyle] end
+       if enabled == true and count and count > 1 then
+               nr = nr + 1
+               ws.titleGroup:setWidgetValue("playlist", 
self:string("SCREENSAVER_NOWPLAYING_OF", nr, count))
+       else 
+               ws.titleGroup:setWidgetValue("playlist", "")
+       end
+end
 
 function _updateMode(self, mode, ws)
        if not ws then 
@@ -402,7 +428,7 @@
        local playlistSize = self.player and self.player:getPlaylistSize()
 
        self[windowStyle].listeners[2] = window:addListener(
-               EVENT_KEY_PRESS,
+               EVENT_KEY_PRESS | EVENT_KEY_HOLD,
                function(event)
                        local type = event:getType()
                        local keyPress = event:getKeycode()
@@ -447,12 +473,10 @@
        local components = { 
                nptitle = "nptitle", 
                nptrack = "nptrack", 
-               leftarrow = 'leftarrow',
-               rightarrow = 'rightarrow',
---             progressB = "progressB", 
---             progress = "progress", 
---             progressNB = "progressNB",
-               npartwork = "npartwork",
+               progressB = "progressB", 
+               progress = "progress", 
+               progressNB = "progressNB",
+               npartwork = "npartwork" 
        }
        for k, v in pairs(components) do
                local new = windowStyle .. v
@@ -460,6 +484,7 @@
        end
        self[windowStyle].titleGroup = Group(components.nptitle, {
                                   title = Label("text", 
self:string("SCREENSAVER_NOWPLAYING")),
+                                  playlist = Label("playlist", "")
                           })
        
 
@@ -467,11 +492,7 @@
                                   text = Label("text", "\n\n\n")
                           })
        
-       self[windowStyle].leftArrow = Icon(components.leftarrow)
-       self[windowStyle].rightArrow = Icon(components.rightarrow)
-
-
---[[
+       
        if showProgressBar then
                self[windowStyle].progressSlider = Slider(components.progressB, 
0, 100, 0)
                self[windowStyle].progressSlider:addTimer(1000, function() 
self:_updatePosition() end)
@@ -485,9 +506,9 @@
                self[windowStyle].progressGroup = Group(components.progressNB, {
                                              elapsed = Label("text", "")
                                      })
-       end
-
---]]
+               self[windowStyle].progressGroup:addTimer(1000, function() 
self:_updatePosition() end)
+       end
+
        self[windowStyle].artwork = Icon("artwork")
        self[windowStyle].artworkGroup = Group(components.npartwork, {
                                     artwork = self[windowStyle].artwork    
@@ -498,9 +519,7 @@
        window:addWidget(self[windowStyle].titleGroup)
        window:addWidget(self[windowStyle].trackGroup)
        window:addWidget(self[windowStyle].artworkGroup)
-       window:addWidget(self[windowStyle].leftArrow)
-       window:addWidget(self[windowStyle].rightArrow)
---     window:addWidget(self[windowStyle].progressGroup)
+       window:addWidget(self[windowStyle].progressGroup)
 
        window:focusWidget(self[windowStyle].trackGroup)
        -- register window as a screensaver, unless we are explicitly not in 
that mode
@@ -570,7 +589,8 @@
                _getIcon(self, _thisTrack, self[windowStyle].artwork, 
playerStatus.remote)
                self:_updateMode(playerStatus.mode)
                self:_updateTrack(text)
---             self:_updateProgress(playerStatus)
+               self:_updateProgress(playerStatus)
+               self:_updatePlaylist(true, playerStatus.playlist_cur_index, 
playerStatus.playlist_tracks)
 
                -- preload artwork for next track
                if playerStatus.item_loop[2] then
@@ -583,6 +603,7 @@
                _getIcon(self, nil, playerStatus.artwork, nil) 
                self:_updateTrack("\n\n\n")
                self:_updateMode(playerStatus.mode)
+               self:_updatePlaylist(false, 0, 0)       
        end
 
        -- Initialize with current data from Player

Modified: 7.2/trunk/squeezeplay/src/squeezeplay/share/jive/ui/HomeMenu.lua
URL: 
http://svn.slimdevices.com/7.2/trunk/squeezeplay/src/squeezeplay/share/jive/ui/HomeMenu.lua?rev=2745&root=Jive&r1=2744&r2=2745&view=diff
==============================================================================
--- 7.2/trunk/squeezeplay/src/squeezeplay/share/jive/ui/HomeMenu.lua (original)
+++ 7.2/trunk/squeezeplay/src/squeezeplay/share/jive/ui/HomeMenu.lua Fri Jul 25 
13:00:26 2008
@@ -44,7 +44,7 @@
                customNodes = {},
        })
 
-       local menu = SimpleMenu("menu")
+       local menu = SimpleMenu("splitmenu")
        menu:setComparator(SimpleMenu.itemComparatorComplexWeightAlpha)
 
        -- home menu is not closeable

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

Reply via email to