Author: titmuss
Date: Sun Jan 27 13:23:52 2008
New Revision: 1653
URL: http://svn.slimdevices.com?rev=1653&root=Jive&view=rev
Log:
[EMAIL PROTECTED] (orig r1648): titmuss | 2008-01-27 20:53:07 +0000
Bug: 6419
Description:
Fix volume control when a popup (f.e. a show briefly) is displayed on the
screen.
Fix volume control so that transport keys (f.e. pause) can be used while the
volume is
displayed on the screen.
Modified:
trunk/ (props changed)
trunk/jive/src/pkg/jive/share/applets/SlimBrowser/Volume.lua
trunk/jive/src/pkg/jive/share/jive/slim/Player.lua
Propchange: trunk/
------------------------------------------------------------------------------
--- svk:merge (original)
+++ svk:merge Sun Jan 27 13:23:52 2008
@@ -1,3 +1,3 @@
-bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/7.0:1647
+bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/7.0:1648
bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/SN:1083
bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/scrolling:1378
Modified: trunk/jive/src/pkg/jive/share/applets/SlimBrowser/Volume.lua
URL:
http://svn.slimdevices.com/trunk/jive/src/pkg/jive/share/applets/SlimBrowser/Volume.lua?rev=1653&root=Jive&r1=1652&r2=1653&view=diff
==============================================================================
--- trunk/jive/src/pkg/jive/share/applets/SlimBrowser/Volume.lua (original)
+++ trunk/jive/src/pkg/jive/share/applets/SlimBrowser/Volume.lua Sun Jan 27
13:23:52 2008
@@ -59,7 +59,11 @@
end
-- we need a local copy of the volume
- self.volume = self.player:getVolume() or 0
+ self.volume = self.player:getVolume()
+ if not self.volume then
+ -- don't show the popup if the player state is not loaded
+ return
+ end
local popup = Popup("volumePopup")
popup:setAutoHide(false)
@@ -189,17 +193,30 @@
elseif type == EVENT_KEY_PRESS then
local keycode = event:getKeycode()
- if keycode == KEY_GO then
+ -- GO closes the volume popup
+ if keycode & KEY_GO ~= 0 then
self.popup:showBriefly(0)
return EVENT_CONSUME
end
- -- we're only interested in volume keys
- if keycode & (KEY_VOLUME_UP|KEY_VOLUME_DOWN) ~=
(KEY_VOLUME_UP|KEY_VOLUME_DOWN) then
- return EVENT_CONSUME
- end
-
- _updateVolume(self, self.volume >= 0)
+ -- volume + and - for mute
+ if keycode & (KEY_VOLUME_UP|KEY_VOLUME_DOWN) ==
(KEY_VOLUME_UP|KEY_VOLUME_DOWN) then
+ _updateVolume(self, self.volume >= 0)
+ return EVENT_CONSUME
+ end
+
+ -- any other keys forward to the lower window
+ if keycode & (KEY_VOLUME_UP|KEY_VOLUME_DOWN) == 0 then
+ local lower = self.popup:getLowerWindow()
+ if lower then
+ Framework:dispatchEvent(lower, event)
+ end
+
+ self.popup:showBriefly(0)
+ return EVENT_CONSUME
+ end
+
+ return EVENT_CONSUME
else
local keycode = event:getKeycode()
Modified: trunk/jive/src/pkg/jive/share/jive/slim/Player.lua
URL:
http://svn.slimdevices.com/trunk/jive/src/pkg/jive/share/jive/slim/Player.lua?rev=1653&root=Jive&r1=1652&r2=1653&view=diff
==============================================================================
--- trunk/jive/src/pkg/jive/share/jive/slim/Player.lua (original)
+++ trunk/jive/src/pkg/jive/share/jive/slim/Player.lua Sun Jan 27 13:23:52 2008
@@ -52,7 +52,7 @@
local debug = require("jive.utils.debug")
local log = require("jive.utils.log").logger("player")
-local EVENT_KEY_PRESS = jive.ui.EVENT_KEY_PRESS
+local EVENT_KEY_ALL = jive.ui.EVENT_KEY_ALL
local EVENT_SCROLL = jive.ui.EVENT_SCROLL
local EVENT_CONSUME = jive.ui.EVENT_CONSUME
@@ -581,7 +581,7 @@
})
self.currentSong.window:addWidget(group)
- self.currentSong.window:addListener(EVENT_KEY_PRESS | EVENT_SCROLL,
+ self.currentSong.window:addListener(EVENT_KEY_ALL | EVENT_SCROLL,
function(event)
local prev = self.currentSong.window:getLowerWindow()
if prev then
_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins