Author: titmuss
Date: Wed Oct 29 08:09:00 2008
New Revision: 3227

URL: http://svn.slimdevices.com?rev=3227&root=Jive&view=rev
Log:
 [EMAIL PROTECTED] (orig r3211):  tom | 2008-10-24 15:58:54 +0100
 drag works during mouse hold state
 [EMAIL PROTECTED] (orig r3212):  titmuss | 2008-10-24 21:01:13 +0100
 Bug: N/A
 Description:
 Plumbing for audio gain control on squeezeplay.
 
 
 [EMAIL PROTECTED] (orig r3213):  bklaas | 2008-10-24 22:56:16 +0100
 Bug: 8646, 9102
 Description: make date a subscription not a timed poll request to SC
 needs to be paired with SC >=r23685 for date subscription to work properly
 [EMAIL PROTECTED] (orig r3214):  adrian | 2008-10-26 14:25:27 +0000
 Bug: N/A
 Description: update installation applets to match SC change 23689.  This 
aligns the fields used by the three applets to allow common code on SC.
 
 [EMAIL PROTECTED] (orig r3215):  titmuss | 2008-10-26 20:17:07 +0000
 Bug: 9799
 Description:
 Reverting wlan module change, to see if this fixes bug 9799.
 
 
 [EMAIL PROTECTED] (orig r3216):  titmuss | 2008-10-26 20:20:22 +0000
 Bug: 9799
 Description:
 Reverting wlan module change, to see if this fixes bug 9799.
 
 
 [EMAIL PROTECTED] (orig r3217):  adrian | 2008-10-26 20:48:13 +0000
 Bug: N/A
 Description: At least VC++ Express is using this, so bump the version number 
to 7.3
 
 [EMAIL PROTECTED] (orig r3218):  adrian | 2008-10-26 22:02:47 +0000
 Bug: N/A
 Description: make applet work on windows - we can't use findFile to look for a 
directory on windows, so look for an actual file
 
 [EMAIL PROTECTED] (orig r3219):  adrian | 2008-10-26 22:23:46 +0000
 Bug: N/A
 Desciption: make applet work on windows
 
 [EMAIL PROTECTED] (orig r3220):  tom | 2008-10-27 16:21:08 +0000
 Bug 9627:
 Description: 
 Desktop now defaults to fullscreen skin
 [EMAIL PROTECTED] (orig r3221):  bklaas | 2008-10-28 15:04:05 +0000
 Bug: 9680
 Description: add five missing images, remove pointer to non-existent 
icon_check.png
 
 [EMAIL PROTECTED] (orig r3222):  tom | 2008-10-28 15:10:10 +0000
 Bug 9831:
 Description: 
 added keyboard shortcuts for hold actions
 [EMAIL PROTECTED] (orig r3223):  kdf | 2008-10-28 18:35:09 +0000
 Bug: n/a
 Description: fix typo
 [EMAIL PROTECTED] (orig r3224):  bklaas | 2008-10-29 04:35:47 +0000
 Bug: 8878
 Description: add playlistMode iconbar support.
 Add (unofficial) playlistMode icon for iconbar (needs a refresh from Noah).
 process playerstatus to update playlistMode icon accordingly.
 
 [EMAIL PROTECTED] (orig r3225):  titmuss | 2008-10-29 13:05:04 +0000
 Bug: N/A
 Description:
 Added volume control for alsa playback.
 Use real-time priority for audio thread for alsa playback (where possible).
 Tweaked buffer and period sizes for lower latency (for sound effects).
 
 
 [EMAIL PROTECTED] (orig r3226):  titmuss | 2008-10-29 14:48:13 +0000
 Bug: N/A
 Description:
 Mix sound effects in while playing back audio.
 
 

Added:
    
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/DefaultSkin/images/icon_playlistMode_on.png
   (with props)
    
7.4/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/FullscreenSkin/images/Screen_Formats/Popup_Menu/helpbox_b.png
   (with props)
    
7.4/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/FullscreenSkin/images/Screen_Formats/Popup_Menu/helpbox_bl.png
   (with props)
    
7.4/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/FullscreenSkin/images/Screen_Formats/Popup_Menu/helpbox_br.png
   (with props)
    
7.4/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/FullscreenSkin/images/Screen_Formats/Song_Progress_Bar/SP_Bar_Remote/rem_progbar_fill.png
   (with props)
    
7.4/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/FullscreenSkin/images/Screen_Formats/Song_Progress_Bar/SP_Bar_Remote/rem_progbar_fill_l.png
   (with props)
Modified:
    7.4/trunk/   (props changed)
    
7.4/trunk/squeezeos/poky/meta-squeezeos/packages/marvell-88W8686/files/gspi.ko
    
7.4/trunk/squeezeos/poky/meta-squeezeos/packages/marvell-88W8686/marvell-gspi-module-bin_1.0.bb
    7.4/trunk/squeezeplay/src/squeezeplay/VisualC/version.h
    
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/DefaultSkin/DefaultSkinApplet.lua
    
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SelectSkin/SelectSkinMeta.lua
    
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SetupAppletInstaller/SetupAppletInstallerApplet.lua
    
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SetupSoundEffects/SetupSoundEffectsApplet.lua
    
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SetupWallpaper/SetupWallpaperApplet.lua
    7.4/trunk/squeezeplay/src/squeezeplay/share/jive/Iconbar.lua
    7.4/trunk/squeezeplay/src/squeezeplay/share/jive/JiveMain.lua
    7.4/trunk/squeezeplay/src/squeezeplay/share/jive/audio/Playback.lua
    7.4/trunk/squeezeplay/src/squeezeplay/share/jive/slim/Player.lua
    7.4/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode.c
    7.4/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_alsa.c
    7.4/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_portaudio.c
    7.4/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_priv.h
    7.4/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_sample.c
    7.4/trunk/squeezeplay/src/squeezeplay/src/audio/fixed_math.h
    7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework.c
    
7.4/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/DesktopJive/DesktopJiveMeta.lua
    
7.4/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/FullscreenSkin/FullscreenSkinApplet.lua
    
7.4/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SqueezeboxJive/SqueezeboxJiveApplet.lua

Propchange: 7.4/trunk/
------------------------------------------------------------------------------
--- svk:merge (original)
+++ svk:merge Wed Oct 29 08:09:00 2008
@@ -2,7 +2,7 @@
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.1/branches/discovery-refactor:2596
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.1/trunk:2920
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.2/trunk:2921
-bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.3/trunk:3206
+bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.3/trunk:3226
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/7.0:2013
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/SN:1083
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/scrolling:1378

Modified: 
7.4/trunk/squeezeos/poky/meta-squeezeos/packages/marvell-88W8686/files/gspi.ko
URL: 
http://svn.slimdevices.com/7.4/trunk/squeezeos/poky/meta-squeezeos/packages/marvell-88W8686/files/gspi.ko?rev=3227&root=Jive&r1=3226&r2=3227&view=diff
==============================================================================
Binary files - no diff available.

Modified: 
7.4/trunk/squeezeos/poky/meta-squeezeos/packages/marvell-88W8686/marvell-gspi-module-bin_1.0.bb
URL: 
http://svn.slimdevices.com/7.4/trunk/squeezeos/poky/meta-squeezeos/packages/marvell-88W8686/marvell-gspi-module-bin_1.0.bb?rev=3227&root=Jive&r1=3226&r2=3227&view=diff
==============================================================================
--- 
7.4/trunk/squeezeos/poky/meta-squeezeos/packages/marvell-88W8686/marvell-gspi-module-bin_1.0.bb
 (original)
+++ 
7.4/trunk/squeezeos/poky/meta-squeezeos/packages/marvell-88W8686/marvell-gspi-module-bin_1.0.bb
 Wed Oct 29 08:09:00 2008
@@ -2,7 +2,7 @@
 SECTION = "base"
 LICENSE = "binary only"
 
-PR = "r1"
+PR = "r2"
 
 PROVIDES = "marvell-gspi-module"
 

Modified: 7.4/trunk/squeezeplay/src/squeezeplay/VisualC/version.h
URL: 
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/VisualC/version.h?rev=3227&root=Jive&r1=3226&r2=3227&view=diff
==============================================================================
--- 7.4/trunk/squeezeplay/src/squeezeplay/VisualC/version.h (original)
+++ 7.4/trunk/squeezeplay/src/squeezeplay/VisualC/version.h Wed Oct 29 08:09:00 
2008
@@ -1,2 +1,2 @@
 /* This file should be automatically generated with the SVN revision number, 
patches welcome */
-#define JIVE_VERSION "7.0.1 r0"
+#define JIVE_VERSION "7.3 r0"

Modified: 
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/DefaultSkin/DefaultSkinApplet.lua
URL: 
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/share/applets/DefaultSkin/DefaultSkinApplet.lua?rev=3227&root=Jive&r1=3226&r2=3227&view=diff
==============================================================================
--- 
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/DefaultSkin/DefaultSkinApplet.lua
 (original)
+++ 
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/DefaultSkin/DefaultSkinApplet.lua
 Wed Oct 29 08:09:00 2008
@@ -292,6 +292,14 @@
        s.iconRepeat0 = _icon(41, screenHeight - 30, "icon_repeat_off.png")
        s.iconRepeat1 = _icon(41, screenHeight - 30, "icon_repeat_song.png")
        s.iconRepeat2 = _icon(41, screenHeight - 30, "icon_repeat.png")
+
+       -- repeat off/repeat track/repeat playlist
+       s.iconPlaylistModeOFF = _icon(41, screenHeight - 30, 
"icon_repeat_off.png")
+       s.iconPlaylistMode0 = _icon(41, screenHeight - 30, 
"icon_repeat_off.png")
+
+       -- FIXME, needs official artwork
+       s.iconPlaylistMode1 = _icon(41, screenHeight - 30, 
"icon_playlistMode_on.png")
+       s.iconPlaylistMode2 = _icon(41, screenHeight - 30, "icon_repeat.png")
 
        -- shuffle off/shuffle album/shuffle playlist
        s.iconShuffleOFF = _icon(75, screenHeight - 30, "icon_shuffle_off.png")

Added: 
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/DefaultSkin/images/icon_playlistMode_on.png
URL: 
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/share/applets/DefaultSkin/images/icon_playlistMode_on.png?rev=3227&root=Jive&view=auto
==============================================================================
Binary file - no diff available.

Propchange: 
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/DefaultSkin/images/icon_playlistMode_on.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: 
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SelectSkin/SelectSkinMeta.lua
URL: 
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SelectSkin/SelectSkinMeta.lua?rev=3227&root=Jive&r1=3226&r2=3227&view=diff
==============================================================================
--- 
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SelectSkin/SelectSkinMeta.lua
 (original)
+++ 
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SelectSkin/SelectSkinMeta.lua
 Wed Oct 29 08:09:00 2008
@@ -36,9 +36,7 @@
 
 
 function defaultSettings(meta)
-       return { 
-               skin = "DefaultSkin",
-       }
+       return {}
 end
 
 
@@ -48,6 +46,10 @@
 
 
 function configureApplet(meta)
+       if (not meta:getSettings().skin) then
+               meta:getSettings().skin = jiveMain:getDefaultSkin()
+       end
+
        local skin = meta:getSettings().skin
        jiveMain:setSelectedSkin(skin)
 

Modified: 
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SetupAppletInstaller/SetupAppletInstallerApplet.lua
URL: 
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SetupAppletInstaller/SetupAppletInstallerApplet.lua?rev=3227&root=Jive&r1=3226&r2=3227&view=diff
==============================================================================
--- 
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SetupAppletInstaller/SetupAppletInstallerApplet.lua
 (original)
+++ 
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SetupAppletInstaller/SetupAppletInstallerApplet.lua
 Wed Oct 29 08:09:00 2008
@@ -20,7 +20,7 @@
 =cut
 --]]
 
-local next, pairs, type, package = next, pairs, type, package
+local next, pairs, type, package, string = next, pairs, type, package, string
 
 local oo               = require("loop.simple")
 local debug            = require("jive.utils.debug")
@@ -54,6 +54,8 @@
 local appletManager    = appletManager
 local jiveMain         = jiveMain
 local jnt              = jnt
+
+local JIVE_VERSION     = jive.JIVE_VERSION
 
 module(...)
 oo.class(_M, Applet)
@@ -86,7 +88,7 @@
                                end
                        end,
                        false,
-                       { "jiveapplets" }
+                       { "jiveapplets", "target:jive", "version:" .. 
string.match(JIVE_VERSION, "(%d%.%d)") }
                )
        end
 
@@ -107,6 +109,8 @@
        local installed = self:getSettings()
        local ip, port = self.server:getIpPort()
 
+       local arrow = string.char(0xE2, 0x86, 0x92)
+
        if data.item_loop then
 
                for _,entry in pairs(data.item_loop) do
@@ -121,26 +125,26 @@
                                url = entry.url
                        end
 
-                       if installed[entry.applet] then
-                               version = installed[entry.applet] .. " > " .. 
entry.version
-                               if entry.version > installed[entry.applet] then
-                                       self.todownload[entry.applet] = { url = 
url, ver = entry.version }
+                       if installed[entry.name] then
+                               version = installed[entry.name] .. arrow .. 
entry.version
+                               if entry.version > installed[entry.name] then
+                                       self.todownload[entry.name] = { url = 
url, ver = entry.version }
                                        check = true
                                end
                        else
                                version = entry.version
-                               self.todownload[entry.applet] = { url = url, 
ver = entry.version }
+                               self.todownload[entry.name] = { url = url, ver 
= entry.version }
                                check = true
                        end
                        
                        self.menu:addItem( {
-                               text = entry.name .. " [" .. version .. "]",
+                               text = entry.title .. " [" .. version .. "]",
                                icon = Checkbox("checkbox",
                                          function(object, isSelected)
                                                  if isSelected then
-                                                         
self.todownload[entry.applet] = { url = url, ver = entry.version }
+                                                         
self.todownload[entry.name] = { url = url, ver = entry.version }
                                                  else
-                                                         
self.todownload[entry.applet] = nil
+                                                         
self.todownload[entry.name] = nil
                                                  end
                                          end,
                                          check

Modified: 
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SetupSoundEffects/SetupSoundEffectsApplet.lua
URL: 
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SetupSoundEffects/SetupSoundEffectsApplet.lua?rev=3227&root=Jive&r1=3226&r2=3227&view=diff
==============================================================================
--- 
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SetupSoundEffects/SetupSoundEffectsApplet.lua
 (original)
+++ 
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SetupSoundEffects/SetupSoundEffectsApplet.lua
 Wed Oct 29 08:09:00 2008
@@ -18,7 +18,7 @@
 
 
 -- stuff we use
-local ipairs, pairs, tostring = ipairs, pairs, tostring
+local ipairs, pairs, tostring, string = ipairs, pairs, tostring, string
 
 local table           = require("table")
 
@@ -61,8 +61,8 @@
 module(...)
 oo.class(_M, Applet)
 
-
-local PATH = "applets/SetupSoundEffects/sounds/"
+local path = 
string.match(Framework:findFile("applets/SetupSoundEffects/sounds/bump.wav"), 
"(.*)bump.wav")
+log:info("path: ", path)
 
 local REFRESH_TIME = 300
 
@@ -353,27 +353,27 @@
        for _,v in pairs(custom) do
                menu:addItem({
                        weight = 10,
-                       text = v.name,
+                       text = v.title,
                        icon = RadioButton("radio",
                                                           group,
                                                           function()
-                                                                  local path = 
Framework:findFile(PATH) .. v.file
+                                                                  local path = 
path .. v.name
                                                                   local attr = 
lfs.attributes(path)
                                                                   if attr then
-                                                                          
log:info("setting ", v.file, " as active sound for ", sound)
-                                                                          
self:_setCustom(sound, v.file)
+                                                                          
log:info("setting ", v.name, " as active sound for ", sound)
+                                                                          
self:_setCustom(sound, v.name)
                                                                           
Framework:playSound(sound)
                                                                   end
                                                           end,
-                                                          settings["_CUSTOM"] 
~= nil and settings["_CUSTOM"][sound] == v.file
+                                                          settings["_CUSTOM"] 
~= nil and settings["_CUSTOM"][sound] == v.name
                                                   ),
                        focusGained = function()
-                                                         local path = 
Framework:findFile(PATH) .. v.file
+                                                         local path = path .. 
v.name
                                                          local attr = 
lfs.attributes(path)
                                                          if attr and os.time() 
- attr.modification < REFRESH_TIME then
-                                                                 
log:info("using local copy of: ", v.file)
+                                                                 
log:info("using local copy of: ", v.name)
                                                          else
-                                                                 
log:info("fetching: ", v.file)
+                                                                 
log:info("fetching: ", v.name)
                                                                  
self:_fetchFile(v.url, path, function() end)
                                                          end
                                                  end
@@ -453,7 +453,7 @@
        for k,v in pairs(sounds) do
                if sound == nil or sound == k then
                        local file = settings["_CUSTOM"] and 
settings["_CUSTOM"][k] or sounds[k]["default"]
-                       Framework:loadSound(k, PATH .. file, sounds[k]["chan"])
+                       Framework:loadSound(k,path .. file, sounds[k]["chan"])
 
                        local enabled = settings[k]
                        if enabled == nil then

Modified: 
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SetupWallpaper/SetupWallpaperApplet.lua
URL: 
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SetupWallpaper/SetupWallpaperApplet.lua?rev=3227&root=Jive&r1=3226&r2=3227&view=diff
==============================================================================
--- 
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SetupWallpaper/SetupWallpaperApplet.lua
 (original)
+++ 
7.4/trunk/squeezeplay/src/squeezeplay/share/applets/SetupWallpaper/SetupWallpaperApplet.lua
 Wed Oct 29 08:09:00 2008
@@ -21,7 +21,7 @@
 
 
 -- stuff we use
-local ipairs, pairs, type, print, tostring = ipairs, pairs, type, print, 
tostring
+local ipairs, pairs, type, print, tostring, string = ipairs, pairs, type, 
print, tostring, string
 
 local oo                     = require("loop.simple")
 local io                     = require("io")
@@ -90,11 +90,17 @@
 local authors = { "Chapple", "Scott Robinson", "Los Cardinalos", "Orin 
Optiglot", "Ryan McD", "Robbie Fisher" }
 
 local PREFIX = "applets/SetupWallpaper/wallpaper/"
+local prefix
 
 local REFRESH_TIME = 300 -- only fetch remote wallpapers while browsing if the 
file is older than this (seconds)
 
 function init(self)
        jnt:subscribe(self)
+
+       -- find where to store wallpapers
+       -- we need to look for an actual file here as findFile can't find 
directories on windows, so try a known wallpaper
+       prefix = string.match(Framework:findFile(PREFIX .. "sunrise.png"), 
"(.*)sunrise.png")
+       log:info("prefix: ", prefix)
 end
 
 -- notify_playerCurrent
@@ -225,41 +231,43 @@
 
        if data.item_loop then
                for _,entry in pairs(data.item_loop) do
-                       log:info("server wallpaper: ", entry.name)
+                       log:info("server wallpaper: ", entry.title)
                        self.menu:addItem(
                                {
                                        weight = 50,      
-                                       text = entry.name,
+                                       text = entry.title,
                                        icon = RadioButton("radio",
                                                                           
self.group,
                                                                           
function()
-                                                                               
   local path = Framework:findFile(PREFIX) .. entry.file
+                                                                               
   local path = prefix .. entry.name
                                                                                
   local attr = lfs.attributes(path)
                                                                                
   if attr then
-                                                                               
           self:setBackground(entry.file, self.currentPlayerId)
+                                                                               
           self:setBackground(entry.name, self.currentPlayerId)
                                                                                
   end
                                                                           end,
-                                                                          
wallpaper == entry.file
+                                                                          
wallpaper == entry.name
                                                                   ),
                                        focusGained = function()
-                                                                         local 
path = Framework:findFile(PREFIX) .. entry.file
+                                                                         local 
path = prefix .. entry.name
                                                                          local 
attr = lfs.attributes(path)
                                                                          if 
attr and os.time() - attr.modification < REFRESH_TIME then
-                                                                               
  log:info("using local copy of: ", entry.file)
-                                                                               
  self:showBackground(entry.file, self.currentPlayerId)
+                                                                               
  log:info("using local copy of: ", entry.name)
+                                                                               
  self:showBackground(entry.name, self.currentPlayerId)
                                                                          else
-                                                                               
  log:info("fetching: ", entry.file)
                                                                                
  local url
                                                                                
  if entry.relurl then
                                                                                
          url = 'http://' .. ip .. ':' .. port .. entry.relurl
                                                                                
  else
                                                                                
          url = entry.url
                                                                                
  end
-                                                                               
  self:_fetchFile(url, path, function() self:showBackground(entry.file, 
self.currentPlayerId) end)
+                                                                               
  self:_fetchFile(url, path, function() self:showBackground(entry.name, 
self.currentPlayerId) end)
                                                                          end
                                                                  end
                                }
                        )
+                       if wallpaper == entry.name then
+                               self.menu:setSelectedIndex(self.menu:numItems() 
- 1)
+                       end
                end
        end
 end
@@ -297,6 +305,8 @@
        if self.fetch[path] then
                log:warn("already fetching ", path, " not fetching again")
                return
+       else
+               log:info("fetching ", path, " ", url)
        end
        self.fetch[path] = 1
 
@@ -346,7 +356,7 @@
        end
        self.currentWallpaper = wallpaper
 
-       local srf = Tile:loadImage(PREFIX .. wallpaper)
+       local srf = Tile:loadImage(prefix .. wallpaper)
        if srf ~= nil then
                Framework:setBackground(srf)
        end

Modified: 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/Iconbar.lua
URL: 
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/share/jive/Iconbar.lua?rev=3227&root=Jive&r1=3226&r2=3227&view=diff
==============================================================================
--- 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/Iconbar.lua (original)
+++ 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/Iconbar.lua Wed Oct 29 
08:09:00 2008
@@ -55,6 +55,21 @@
 function setPlaymode(self, val)
        log:debug("Iconbar:setPlaymode(", val, ")")
        self.iconPlaymode:setStyle("iconPlaymode" .. string.upper((val or 
"OFF")))
+end
+
+--[[
+
+=head2 Iconbar:setPlaylistMode(val)
+
+Set the playlistmode of the iconbar. Values are nil (no mode), 1 for playlist 
mode and 2 for party mode.
+When not 1 or 2, setRepeat()
+
+=cut
+--]]
+function setPlaylistMode(self, val)
+       log:debug("Iconbar:setPlaylistMode(", val, ")")
+       -- FIXME: need new styles for playlist and party mode
+       self.iconPlaylistMode:setStyle("iconPlaylistMode" .. string.upper((val 
or "OFF")))
 end
 
 
@@ -168,6 +183,7 @@
                iconBackground = Label("iconBackground", ""),
                iconPlaymode = Icon("iconPlaymodeOFF"),
                iconRepeat = Icon("iconRepeatOFF"),
+               iconPlaylistMode = Icon("iconPlaylistModeOFF"),
                iconShuffle = Icon("iconShuffleOFF"),
                iconBattery = Icon("iconBatteryNONE"),
                iconWireless = Icon("iconWirelessNONE"),
@@ -180,6 +196,7 @@
        Framework:addWidget(obj.iconBackground)
        Framework:addWidget(obj.iconPlaymode)
        Framework:addWidget(obj.iconRepeat)
+       Framework:addWidget(obj.iconPlaylistMode)
        Framework:addWidget(obj.iconShuffle)
        Framework:addWidget(obj.iconBattery)
        Framework:addWidget(obj.iconWireless)

Modified: 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/JiveMain.lua
URL: 
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/share/jive/JiveMain.lua?rev=3227&root=Jive&r1=3226&r2=3227&view=diff
==============================================================================
--- 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/JiveMain.lua (original)
+++ 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/JiveMain.lua Wed Oct 29 
08:09:00 2008
@@ -98,26 +98,32 @@
 local _idTranslations = {}
        
 local keyboardShortcuts = {    
-       ["i"]  = KEY_UP,
-       ["k"]  = KEY_DOWN,
-       ["j"]  = KEY_LEFT,
-       ["l"]  = KEY_RIGHT,
-       ["h"]  = KEY_HOME,
-       ["p"]  = KEY_PLAY,
-       ["x"]  = KEY_PLAY,
-       ["c"]  = KEY_PAUSE,
-       [" "]  = KEY_PAUSE,
-       ["a"]  = KEY_ADD,
-       ["z"]  = KEY_REW,
-       ["<"]  = KEY_REW,
-       ["b"]  = KEY_FWD,
-       [">"]  = KEY_FWD,
-       ["+"]  = KEY_VOLUME_UP,
-       ["="]  = KEY_VOLUME_UP,
-       ["-"]  = KEY_VOLUME_DOWN,
-       ["\b"]  = KEY_BACK, -- BACKSPACE
-       ["\27"]  = KEY_BACK -- ESC
+       ["i"]  = { keyCode = KEY_UP,   event = EVENT_KEY_PRESS },
+       ["k"]  = { keyCode = KEY_DOWN, event = EVENT_KEY_PRESS },
+       ["j"]  = { keyCode = KEY_LEFT, event = EVENT_KEY_PRESS },
+       ["l"]  = { keyCode = KEY_RIGHT, event = EVENT_KEY_PRESS },
+       ["h"]  = { keyCode = KEY_HOME, event = EVENT_KEY_PRESS },
+       ["p"]  = { keyCode = KEY_PLAY, event = EVENT_KEY_PRESS },
+       ["P"]  = { keyCode = KEY_PLAY, event = EVENT_KEY_HOLD },
+       ["x"]  = { keyCode = KEY_PLAY, event = EVENT_KEY_PRESS },
+       ["c"]  = { keyCode = KEY_PAUSE, event = EVENT_KEY_PRESS },
+       [" "]  = { keyCode = KEY_PAUSE, event = EVENT_KEY_PRESS },
+       ["a"]  = { keyCode = KEY_ADD, event = EVENT_KEY_PRESS },
+       ["A"]  = { keyCode = KEY_ADD, event = EVENT_KEY_HOLD },
+       ["z"]  = { keyCode = KEY_REW, event = EVENT_KEY_PRESS },
+       ["Z"]  = { keyCode = KEY_REW, event = EVENT_KEY_HOLD },
+       ["<"]  = { keyCode = KEY_REW, event = EVENT_KEY_PRESS },
+       ["b"]  = { keyCode = KEY_FWD, event = EVENT_KEY_PRESS },
+       ["B"]  = { keyCode = KEY_FWD, event = EVENT_KEY_HOLD },
+       [">"]  = { keyCode = KEY_FWD, event = EVENT_KEY_PRESS },
+       ["+"]  = { keyCode = KEY_VOLUME_UP, event = EVENT_KEY_PRESS },
+       ["="]  = { keyCode = KEY_VOLUME_UP, event = EVENT_KEY_PRESS },
+       ["-"]  = { keyCode = KEY_VOLUME_DOWN, event = EVENT_KEY_PRESS },
+       ["\b"]  = { keyCode = KEY_BACK, event = EVENT_KEY_PRESS }, -- BACKSPACE
+       ["\27"]  = { keyCode = KEY_BACK, event = EVENT_KEY_PRESS } -- ESC
 }
+
+local _defaultSkin
 
 -- bring us to the home menu
 local function _homeHandler(event)
@@ -128,9 +134,9 @@
                
                log:debug("Keyboard entry: ", keyboardEntry)
                
-               local keyCode = keyboardShortcuts[keyboardEntry]
+               local keyCode = keyboardShortcuts[keyboardEntry].keyCode
                if (keyCode) then
-                       Framework:pushEvent(Event:new(EVENT_KEY_PRESS, keyCode))
+                       
Framework:pushEvent(Event:new(keyboardShortcuts[keyboardEntry].event, keyCode))
                end
                
                return EVENT_CONSUME
@@ -361,7 +367,7 @@
 
 function JiveMain:getSkinParam(key)
 
-       local skinName = self.selectedSkin or "DefaultSkin"
+       local skinName = self.selectedSkin or JiveMain:getDefaultSkin()
        
        if key and self.skinParams and self.skinParams[skinName] and 
self.skinParams[skinName][key] then
                return self.skinParams[skinName][key]
@@ -402,6 +408,14 @@
        obj[method](obj, jive.ui.style)
 end
 
+function JiveMain:setDefaultSkin(appletName)
+       log:debug("setDefaultSkin(", appletName, ")")
+       _defaultSkin = appletName
+end
+
+function JiveMain:getDefaultSkin()
+       return _defaultSkin or "DefaultSkin"
+end
 
 -----------------------------------------------------------------------------
 -- main()

Modified: 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/audio/Playback.lua
URL: 
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/share/jive/audio/Playback.lua?rev=3227&root=Jive&r1=3226&r2=3227&view=diff
==============================================================================
--- 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/audio/Playback.lua 
(original)
+++ 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/audio/Playback.lua Wed Oct 
29 08:09:00 2008
@@ -65,6 +65,14 @@
 
        obj.slimproto:subscribe("cont", function(_, data)
                return obj:_cont(data)
+       end)
+
+       obj.slimproto:subscribe("audg", function(_, data)
+               return obj:_audg(data)
+       end)
+
+       obj.slimproto:subscribe("aude", function(_, data)
+               return obj:_aude(data)
        end)
 
        obj.timer = Timer(100, function()
@@ -426,6 +434,16 @@
 end
 
 
+function _aude(self, data)
+        Decode:audioEnable(data.enable)
+end
+
+
+function _audg(self, data)
+        Decode:audioGain(data.gainL, data.gainR)
+end
+
+
 --[[
 
 =head1 LICENSE

Modified: 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/slim/Player.lua
URL: 
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/share/jive/slim/Player.lua?rev=3227&root=Jive&r1=3226&r2=3227&view=diff
==============================================================================
--- 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/slim/Player.lua (original)
+++ 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/slim/Player.lua Wed Oct 29 
08:09:00 2008
@@ -821,11 +821,18 @@
                -- set the playmode (nil, stop, play, pause)
                iconbar:setPlaymode(self.state["mode"])
                
-               -- set the repeat (nil, 0=off, 1=track, 2=playlist)
-               iconbar:setRepeat(self.state["playlist repeat"])
-       
                -- set the shuffle (nil, 0=off, 1=by song, 2=by album)
                iconbar:setShuffle(self.state["playlist shuffle"])
+
+               -- set the playlist mode (nil, 0=off, 1=playlist, 2=party)
+               if self.state['playlist mode'] and self.state['playlist mode'] 
> 0 then
+                       iconbar:setRepeat(0)
+                       iconbar:setPlaylistMode(self.state["playlist mode"])
+               else
+                       -- set the repeat (nil, 0=off, 1=track, 2=playlist)
+                       iconbar:setPlaylistMode(0)
+                       iconbar:setRepeat(self.state["playlist repeat"])
+               end
        end
 end
 

Modified: 7.4/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode.c
URL: 
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode.c?rev=3227&root=Jive&r1=3226&r2=3227&view=diff
==============================================================================
--- 7.4/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode.c (original)
+++ 7.4/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode.c Wed Oct 29 
08:09:00 2008
@@ -564,6 +564,27 @@
        return 1;
 }
 
+static int decode_audio_enable(lua_State *L) {
+       int enable;
+
+       enable = lua_toboolean(L, 2);
+
+       // FIXME
+
+       return 0;
+}
+
+static int decode_audio_gain(lua_State *L) {
+       s32_t lgain, rgain;
+
+       lgain = lua_tointeger(L, 2);
+       rgain = lua_tointeger(L, 3);
+
+       decode_audio->gain(lgain, rgain);
+
+       return 0;
+}
+
 static const struct luaL_Reg decode_f[] = {
        { "resume", decode_resume },
        { "pause", decode_pause },
@@ -574,6 +595,8 @@
        { "songEnded", decode_song_ended },
        { "status", decode_status },
        { "streamMetadata", decode_stream_metadata },
+       { "audioEnable", decode_audio_enable },
+       { "audioGain", decode_audio_gain },
        { NULL, NULL }
 };
 

Modified: 7.4/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_alsa.c
URL: 
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_alsa.c?rev=3227&root=Jive&r1=3226&r2=3227&view=diff
==============================================================================
--- 7.4/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_alsa.c 
(original)
+++ 7.4/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_alsa.c Wed 
Oct 29 08:09:00 2008
@@ -9,6 +9,7 @@
 #include "common.h"
 
 #include "audio/fifo.h"
+#include "audio/fixed_math.h"
 #include "audio/mqueue.h"
 #include "audio/decode/decode.h"
 #include "audio/decode/decode_priv.h"
@@ -16,6 +17,7 @@
 
 #ifdef HAVE_LIBASOUND
 
+#include <pthread.h>
 #include <alsa/asoundlib.h>
 
 /* Stream sample rate */
@@ -25,15 +27,19 @@
 
 /* alsa */
 static char *device = "default";
+//static char *device = "plughw:0,0";
 
 static snd_output_t *output;
 static snd_pcm_t *handle;
 static snd_pcm_hw_params_t *hwparams;
 
 static snd_pcm_sframes_t period_size;
-
-static SDL_Thread *audio_thread;
-
+static fft_fixed lgain, rgain;
+
+static pthread_t audio_thread;
+
+
+static void decode_alsa_gain(s32_t lgain, s32_t rgain);
 
 
 /*
@@ -55,22 +61,24 @@
        if (!(current_audio_state & DECODE_STATE_RUNNING)) {
                memset(outputArray, 0, len);
 
-               /* mix in sound effects */
-               decode_sample_mix(outputArray, len);
-
-               return;
+               goto mixin_effects;
        }
        
        if (add_silence_ms) {
                add_bytes = SAMPLES_TO_BYTES((u32_t)((add_silence_ms * 
current_sample_rate) / 1000));
-               if (add_bytes > len) add_bytes = len;
-               memset(outputBuffer, 0, add_bytes);
-               outputBuffer += add_bytes;
+               if (add_bytes > len) {
+                       add_bytes = len;
+               }
+               memset(outputArray, 0, add_bytes);
+               outputArray += add_bytes;
                len -= add_bytes;
                add_silence_ms -= (BYTES_TO_SAMPLES(add_bytes) * 1000) / 
current_sample_rate;
-               if (add_silence_ms < 2)
+               if (add_silence_ms < 2) {
                        add_silence_ms = 0;
-               if (!len) return;
+               }
+               if (!len) {
+                       goto mixin_effects;
+               }
        }
 
        bytes_used = fifo_bytes_used(&decode_fifo);
@@ -91,7 +99,7 @@
                memset(outputArray, 0, len);
                DEBUG_ERROR("Audio underrun: used 0 bytes");
 
-               return;
+               goto mixin_effects;
        }
 
        if (bytes_used < len) {
@@ -123,7 +131,8 @@
        }
 
        while (bytes_used) {
-               size_t wrap, bytes_write;
+               size_t wrap, bytes_write, samples_write;
+               sample_t *output_ptr, *decode_ptr;
 
                wrap = fifo_bytes_until_rptr_wrap(&decode_fifo);
 
@@ -132,7 +141,15 @@
                        bytes_write = wrap;
                }
 
-               memcpy(outputArray, decode_fifo_buf + decode_fifo.rptr, 
bytes_write);
+               samples_write = BYTES_TO_SAMPLES(bytes_write);
+
+               output_ptr = (sample_t *)outputArray;
+               decode_ptr = (sample_t *)(decode_fifo_buf + decode_fifo.rptr);
+               while (samples_write--) {
+                       *(output_ptr++) = fixed_mul(lgain, *(decode_ptr++));
+                       *(output_ptr++) = fixed_mul(rgain, *(decode_ptr++));
+               }
+
                fifo_rptr_incby(&decode_fifo, bytes_write);
                decode_elapsed_samples += BYTES_TO_SAMPLES(bytes_write);
 
@@ -145,6 +162,10 @@
                new_sample_rate = current_sample_rate;
        }
 
+ mixin_effects:
+       /* mix in sound effects */
+       decode_sample_mix(outputBuffer, SAMPLES_TO_BYTES(framesPerBuffer));
+
        return;
 }
 
@@ -152,17 +173,17 @@
 static int pcm_open() {
        int err, dir;
        snd_pcm_uframes_t size;
-       unsigned int buffer_time = 250000; // FIXME low latency
-       unsigned int period_time = buffer_time / 4;
+#define BUFFER_SIZE (8291 / 4)
+#define PERIOD_SIZE (BUFFER_SIZE / 8)
 
        /* Close existing pcm (if any) */
        if (handle) {
                if ((err = snd_pcm_drain(handle)) < 0) {
-                       DEBUG_ERROR("Drain error: %s", snd_strerror(err));
+                       DEBUG_ERROR("snd_pcm_drain error: %s", 
snd_strerror(err));
                }
 
                if ((err = snd_pcm_close(handle)) < 0) {
-                       DEBUG_ERROR("Drain error: %s", snd_strerror(err));
+                       DEBUG_ERROR("snd_pcm_close error: %s", 
snd_strerror(err));
                }
 
                handle = NULL;
@@ -216,13 +237,15 @@
        }
 
        /* set buffer and period times */
-       if ((err = snd_pcm_hw_params_set_buffer_time_near(handle, hwparams, 
&buffer_time, &dir)) < 0) {
-               DEBUG_ERROR("Unable to set  buffer time %s", snd_strerror(err));
-               return err;
-       }
-
-       if ((err = snd_pcm_hw_params_set_period_time_near(handle, hwparams, 
&period_time, &dir)) < 0) {
-               DEBUG_ERROR("Unable to set period time %s", snd_strerror(err));
+       size = BUFFER_SIZE;
+       if ((err = snd_pcm_hw_params_set_buffer_size_near(handle, hwparams, 
&size)) < 0) {
+               DEBUG_ERROR("Unable to set  buffer size %s", snd_strerror(err));
+               return err;
+       }
+
+       size = PERIOD_SIZE;
+       if ((err = snd_pcm_hw_params_set_period_size_near(handle, hwparams, 
&size, &dir)) < 0) {
+               DEBUG_ERROR("Unable to set period size %s", snd_strerror(err));
                return err;
        }
 
@@ -266,7 +289,7 @@
 }
 
 
-static int audio_thread_execute(void *unused) {
+static void *audio_thread_execute(void *unused) {
        snd_pcm_state_t state;
        const snd_pcm_channel_area_t *areas;
        snd_pcm_uframes_t offset;
@@ -285,7 +308,7 @@
                if (new_sample_rate) {
                        if ((err = pcm_open()) < 0) {
                                DEBUG_ERROR("Open failed: %s", 
snd_strerror(err));
-                               return -1;
+                               return (void *)-1;
                        }
                        first = 1;
                }
@@ -412,6 +435,8 @@
 
 static int decode_alsa_init(void) {
        int err;
+       pthread_attr_t thread_attr;
+       struct sched_param thread_param;
 
        if ((err = snd_output_stdio_attach(&output, stdout, 0)) < 0) {
                DEBUG_ERROR("Output failed: %s", snd_strerror(err));
@@ -425,8 +450,34 @@
        }
 
        /* start audio thread */
-       // XXXX fixme thread priority
-       audio_thread = SDL_CreateThread(audio_thread_execute, NULL);
+       if ((err = pthread_attr_init(&thread_attr)) != 0) {
+               DEBUG_ERROR("pthread_attr_init: %s", strerror(err));
+               return 0;
+       }
+
+       if ((err = pthread_attr_setdetachstate(&thread_attr, 
PTHREAD_CREATE_DETACHED)) != 0) {
+               DEBUG_ERROR("pthread_attr_setdetachstate: %s", strerror(err));
+               return 0;
+       }
+
+       if ((err = pthread_create(&audio_thread, &thread_attr, 
audio_thread_execute, NULL)) != 0) {
+               DEBUG_ERROR("pthread_create: %s", strerror(err));
+               return 0;
+       }
+
+       /* set realtime scheduler policy, with a high priority */
+       thread_param.sched_priority = sched_get_priority_max(SCHED_FIFO);
+
+       err = pthread_setschedparam(audio_thread, SCHED_FIFO, &thread_param);
+       if (err) {
+               if (err == EPERM) {
+                       DEBUG_ERROR("Can't set audio thread priority\n");
+               }
+               else {
+                       DEBUG_ERROR("pthread_create: %s", strerror(err));
+                       return 0;
+               }
+       }
 
        return 1;
 }
@@ -447,6 +498,13 @@
 }
 
 
+static void decode_alsa_gain(s32_t left_gain, s32_t right_gain)
+{
+       lgain = left_gain;
+       rgain = right_gain;
+}
+
+
 struct decode_audio decode_alsa = {
        decode_alsa_init,
        decode_alsa_start,
@@ -454,6 +512,7 @@
        decode_alsa_resume,
        decode_alsa_stop,
        decode_alsa_delay,
+       decode_alsa_gain,
 };
 
 #endif // HAVE_LIBASOUND

Modified: 
7.4/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_portaudio.c
URL: 
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_portaudio.c?rev=3227&root=Jive&r1=3226&r2=3227&view=diff
==============================================================================
--- 7.4/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_portaudio.c 
(original)
+++ 7.4/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_portaudio.c 
Wed Oct 29 08:09:00 2008
@@ -299,12 +299,20 @@
 }
 
 
+static void decode_portaudio_gain(s32_t lgain, s32_t rgain)
+{
+       printf("fixme gain %d,%d\n", lgain, rgain);
+}
+
+
 struct decode_audio decode_portaudio = {
        decode_portaudio_init,
        decode_portaudio_start,
        decode_portaudio_pause,
        decode_portaudio_resume,
        decode_portaudio_stop,
+       NULL,
+       decode_portaudio_gain,
 };
 
 #endif // HAVE_PORTAUDIO

Modified: 7.4/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_priv.h
URL: 
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_priv.h?rev=3227&root=Jive&r1=3226&r2=3227&view=diff
==============================================================================
--- 7.4/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_priv.h 
(original)
+++ 7.4/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_priv.h Wed 
Oct 29 08:09:00 2008
@@ -92,6 +92,7 @@
        void (*resume)(void);
        void (*stop)(void);
        u32_t (*delay)(void);
+       void (*gain)(s32_t lgain, s32_t rgain);
 };
 
 extern struct decode_audio decode_alsa;

Modified: 7.4/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_sample.c
URL: 
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_sample.c?rev=3227&root=Jive&r1=3226&r2=3227&view=diff
==============================================================================
--- 7.4/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_sample.c 
(original)
+++ 7.4/trunk/squeezeplay/src/squeezeplay/src/audio/decode/decode_sample.c Wed 
Oct 29 08:09:00 2008
@@ -7,6 +7,7 @@
 
 #include "common.h"
 #include "ui/jive.h"
+#include "audio/fixed_math.h"
 
 
 struct jive_sample {
@@ -21,10 +22,11 @@
 
 /* mixer channels */
 #define MAX_SAMPLES 2
-struct jive_sample *sample[MAX_SAMPLES];
+static struct jive_sample *sample[MAX_SAMPLES];
 
 #define MAXVOLUME 100
-int effect_volume = MAXVOLUME;
+static fft_fixed effect_gain = FIXED_ONE;
+static int effect_volume;
 
 
 static void sample_free(struct jive_sample *sample) {
@@ -44,6 +46,7 @@
        const Sint64 min_sample = -0x80000000LL;
        int i;
 
+       /* fixme: this crudely mixes the samples onto the buffer */
        for (i=0; i<MAX_SAMPLES; i++) {
                Sint32 *s, *d;
                size_t len;
@@ -61,17 +64,17 @@
                s = (Sint32 *) (sample[i]->data + sample[i]->pos);
                d = (Sint32 *) buffer;
                for (j=0; j<len>>2; j++) {
-                       Sint64 t = s[j];
-                       t = (t * effect_volume) / MAXVOLUME;
-                       t += d[j];
-
-                       if (t >= max_sample) {
-                               t = max_sample;
+                       Sint64 tmp = *(s++);
+                       tmp = fixed_mul(effect_gain, tmp);
+                       tmp += *d;
+
+                       if (tmp >= max_sample) {
+                               tmp = max_sample;
                        }
-                       else if (t <= min_sample) {
-                               t = min_sample;
+                       else if (tmp <= min_sample) {
+                               tmp = min_sample;
                        }
-                       d[j] = t;
+                       *(d++) = tmp;
                }
 
                sample[i]->pos += len;
@@ -253,12 +256,16 @@
         */
 
        effect_volume = lua_tointeger(L, 2);
-       //if (effect_volume > 0) {
-       //      open_audio();
-       //}
-       //else {
-       //      close_audio();
-       //}
+
+       if (effect_volume < 0) {
+               effect_volume = 0;
+       }
+       if (effect_volume > MAXVOLUME) {
+               effect_volume = MAXVOLUME;
+       }
+
+       effect_gain = fixed_div(s32_to_fixed(effect_volume),
+                               s32_to_fixed(MAXVOLUME));
 
        return 0;
 }

Modified: 7.4/trunk/squeezeplay/src/squeezeplay/src/audio/fixed_math.h
URL: 
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/src/audio/fixed_math.h?rev=3227&root=Jive&r1=3226&r2=3227&view=diff
==============================================================================
--- 7.4/trunk/squeezeplay/src/squeezeplay/src/audio/fixed_math.h (original)
+++ 7.4/trunk/squeezeplay/src/squeezeplay/src/audio/fixed_math.h Wed Oct 29 
08:09:00 2008
@@ -37,28 +37,28 @@
 #define FIXED_ONE 0x10000
 #define FIXED_FRAC_BITS 16
 
-inline s32_t fixed_to_s32(fft_fixed x) {
+static inline s32_t fixed_to_s32(fft_fixed x) {
        return x >> 16;
 }
 
-inline fft_fixed s32_to_fixed(s32_t x) {
+static inline fft_fixed s32_to_fixed(s32_t x) {
        return x << 16;
 }
 
-inline double fixed_to_double(fft_fixed x) {
+static inline double fixed_to_double(fft_fixed x) {
        return ((double)((x) / (double) (1L << 16)));
 }
 
-inline fft_fixed double_to_fixed(double x) {
+static inline fft_fixed double_to_fixed(double x) {
        return ((fft_fixed) ((x) * (double) (1L << 16) + 0.5));
 }
 
-inline fft_fixed fixed_mul(fft_fixed x, fft_fixed y) {
+static inline fft_fixed fixed_mul(fft_fixed x, fft_fixed y) {
        s64_t z = (s64_t)x * (s64_t)y;
        return (s32_t) (z >> 16);
 }
 
-inline fft_fixed fixed_div(fft_fixed x, fft_fixed y) {
+static inline fft_fixed fixed_div(fft_fixed x, fft_fixed y) {
        s64_t z = ((s64_t)x << 32);
        return (s32_t) ((z / y) >> 16);
 }

Modified: 7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework.c
URL: 
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework.c?rev=3227&root=Jive&r1=3226&r2=3227&view=diff
==============================================================================
--- 7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework.c (original)
+++ 7.4/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework.c Wed Oct 29 
08:09:00 2008
@@ -1060,7 +1060,7 @@
 
        case SDL_MOUSEMOTION:
                if (event->motion.state & SDL_BUTTON(1)) {
-                       if ( (mouse_state == MOUSE_STATE_DOWN
+                       if ( ( (mouse_state == MOUSE_STATE_DOWN || mouse_state 
== MOUSE_STATE_SENT)
                               && (abs(mouse_origin_x - event->motion.x) > 10
                                   || abs(mouse_origin_y - event->motion.y) > 
10))
                             || mouse_state == MOUSE_STATE_DRAG) {

Modified: 
7.4/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/DesktopJive/DesktopJiveMeta.lua
URL: 
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/DesktopJive/DesktopJiveMeta.lua?rev=3227&root=Jive&r1=3226&r2=3227&view=diff
==============================================================================
--- 
7.4/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/DesktopJive/DesktopJiveMeta.lua
 (original)
+++ 
7.4/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/DesktopJive/DesktopJiveMeta.lua
 Wed Oct 29 08:09:00 2008
@@ -89,6 +89,8 @@
 
        -- set uuid
        jnt:setUUID(settings.uuid, settings.mac)
+       
+       jiveMain:setDefaultSkin("FullscreenSkin")
 end
 
 

Modified: 
7.4/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/FullscreenSkin/FullscreenSkinApplet.lua
URL: 
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/FullscreenSkin/FullscreenSkinApplet.lua?rev=3227&root=Jive&r1=3226&r2=3227&view=diff
==============================================================================
--- 
7.4/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/FullscreenSkin/FullscreenSkinApplet.lua
 (original)
+++ 
7.4/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/FullscreenSkin/FullscreenSkinApplet.lua
 Wed Oct 29 08:09:00 2008
@@ -753,6 +753,7 @@
        s.albumtitle.icon.img = Surface:loadImage(imgpath .. 
"menu_album_noartwork_125.png")
        s.albumtitle.icon.padding = { 9, 0, 0, 0 }
        s.albumtitle.back = {}
+       s.albumtitle.back.padding = { 9, 0, 0, 0 }
        --FIXME, this path will likely change
        s.albumtitle.back.img = Surface:loadImage(imgpath .. 
"pointer_selector_L.png")
        s.albumtitle.back.align = "left"
@@ -954,9 +955,8 @@
                _uses(s.albumitem, {
                              order = { "icon", "text", "check" },
                              check = {
-                                     img = Surface:loadImage(imgpath .. 
"Icons/icon_check.png"),
+                                     img = Surface:loadImage(imgpath .. 
"Icons/icon_check_14x30.png"),
                                      align = "right"
-
                              }
                      })
 

Added: 
7.4/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/FullscreenSkin/images/Screen_Formats/Popup_Menu/helpbox_b.png
URL: 
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/FullscreenSkin/images/Screen_Formats/Popup_Menu/helpbox_b.png?rev=3227&root=Jive&view=auto
==============================================================================
Binary file - no diff available.

Propchange: 
7.4/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/FullscreenSkin/images/Screen_Formats/Popup_Menu/helpbox_b.png
------------------------------------------------------------------------------
    svn:executable = *

Propchange: 
7.4/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/FullscreenSkin/images/Screen_Formats/Popup_Menu/helpbox_b.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: 
7.4/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/FullscreenSkin/images/Screen_Formats/Popup_Menu/helpbox_bl.png
URL: 
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/FullscreenSkin/images/Screen_Formats/Popup_Menu/helpbox_bl.png?rev=3227&root=Jive&view=auto
==============================================================================
Binary file - no diff available.

Propchange: 
7.4/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/FullscreenSkin/images/Screen_Formats/Popup_Menu/helpbox_bl.png
------------------------------------------------------------------------------
    svn:executable = *

Propchange: 
7.4/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/FullscreenSkin/images/Screen_Formats/Popup_Menu/helpbox_bl.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: 
7.4/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/FullscreenSkin/images/Screen_Formats/Popup_Menu/helpbox_br.png
URL: 
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/FullscreenSkin/images/Screen_Formats/Popup_Menu/helpbox_br.png?rev=3227&root=Jive&view=auto
==============================================================================
Binary file - no diff available.

Propchange: 
7.4/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/FullscreenSkin/images/Screen_Formats/Popup_Menu/helpbox_br.png
------------------------------------------------------------------------------
    svn:executable = *

Propchange: 
7.4/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/FullscreenSkin/images/Screen_Formats/Popup_Menu/helpbox_br.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: 
7.4/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/FullscreenSkin/images/Screen_Formats/Song_Progress_Bar/SP_Bar_Remote/rem_progbar_fill.png
URL: 
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/FullscreenSkin/images/Screen_Formats/Song_Progress_Bar/SP_Bar_Remote/rem_progbar_fill.png?rev=3227&root=Jive&view=auto
==============================================================================
Binary file - no diff available.

Propchange: 
7.4/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/FullscreenSkin/images/Screen_Formats/Song_Progress_Bar/SP_Bar_Remote/rem_progbar_fill.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: 
7.4/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/FullscreenSkin/images/Screen_Formats/Song_Progress_Bar/SP_Bar_Remote/rem_progbar_fill_l.png
URL: 
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/FullscreenSkin/images/Screen_Formats/Song_Progress_Bar/SP_Bar_Remote/rem_progbar_fill_l.png?rev=3227&root=Jive&view=auto
==============================================================================
Binary file - no diff available.

Propchange: 
7.4/trunk/squeezeplay/src/squeezeplay_desktop/share/applets/FullscreenSkin/images/Screen_Formats/Song_Progress_Bar/SP_Bar_Remote/rem_progbar_fill_l.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: 
7.4/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SqueezeboxJive/SqueezeboxJiveApplet.lua
URL: 
http://svn.slimdevices.com/7.4/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SqueezeboxJive/SqueezeboxJiveApplet.lua?rev=3227&root=Jive&r1=3226&r2=3227&view=diff
==============================================================================
--- 
7.4/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SqueezeboxJive/SqueezeboxJiveApplet.lua
 (original)
+++ 
7.4/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SqueezeboxJive/SqueezeboxJiveApplet.lua
 Wed Oct 29 08:09:00 2008
@@ -259,7 +259,8 @@
 
 
 function notify_playerCurrent(self, player)
-       if not player then
+       -- if not passed a player, or if player hasn't change, exit
+       if not player or self.player == player then
                return
        end
 
@@ -270,40 +271,36 @@
                return
        end
 
-       if self.clockTimer then
-               self.clockTimer:stop()
-       end
-
        local sink = function(chunk, err)
                             if err then
                                     log:warn(err)
                                     return
                             end
-
+                               log:debug('Date being synched from player to 
controller: ', chunk.data.date)
                              self:setDate(chunk.data.date)
                     end
+
  
-       -- this is a background request
-       -- FIXME this should be a subscription
-       self.server:request(sink,
-                           player:getId(),
-                           { 'date' }
-                   )
-
-       -- start a recurring timer for synching to SC/SN
-       self.clockTimer = Timer(6000000, -- 1 hour
-               function()
-                       if self.player and self.server then
-                               self.server:request(sink,
-                                                   self.player:getId(),
-                                                   { 'date' }
-                                           )
-                       end
-               end,
-               false)
-       self.clockTimer:start()
-end
-
+       -- setup a once/hour
+        player:subscribe(
+                         '/slim/datestatus/' .. self.player:getId(),
+                         sink,
+                         self.player:getId(),
+                         { 'date', 'subscribe:3600' }
+       )
+
+end
+
+function notify_playerDelete(self, player)
+       if self.player ~= player then
+               return
+       end
+
+       log:warn('unsubscribing from datestatus/', self.player:getId())
+       self.player:unsubscribe('/slim/datestatus/' .. self.player:getId())
+       self.player = false
+
+end
 
 function setDate(self, date)
        -- matches date format 2007-09-08T20:40:42+00:00

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

Reply via email to