I'm trying to tweak the behaviour of the Jivelite ScreenSavers applet to make it more appropriate for a device that only controls other players connected to LMS. I've built Jivelite for use on a Joggler (see 'Jivelite on a Joggler' (https://forums.slimdevices.com/showthread.php?110040-Jivelite-on-a-Joggler)), which is a touchscreen device. I've been posting about this issue in that thread, but I don't think it's necessarily a Joggler-specific issue, so I'm posting here in the hope of getting wider input.
My use case is probably self-evident: Since my build of Jivelite does not include Squeezelite (no need for it), there is no 'local' player, and hence no 'while off' screen saver. The only way to make a clock screensaver appear is to pause the currently selected player, and if that player happens to be in a synced group then playback stops everywhere. My intended behaviour is to allow the 'when off' screensaver to activate when the currently selected player is powered off. I'd also like to be able to touch the screen to wake it, and select a different player, without the currently selected player being powered up. I'm making progress (see 'here' (https://forums.slimdevices.com/showthread.php?110040-Jivelite-on-a-Joggler&p=932941&viewfull=1#post932941)), but I'm stuck on a specific issue, so I'm hoping someone can help. I'd also appreciate thoughts on my 'intended behaviour', and whether there's an easier way to achieve this. Here's what I've done so far. 1) I commented out the check on whether there's a local player. Code: -------------------- -- only present a WHEN OFF option when there is a local player present -- if Player:getLocalPlayer() then menu:addItem( { text = self:string("SCREENSAVER_WHEN_OFF"), weight = 2, sound = "WINDOWSHOW", callback = function(event, menu_item) self:screensaverSetting(menu_item, "whenOff") end } ) -- end -------------------- This meant that the 'whenOff' screensaver option is now available on my player-less Joggler. And it seems to work as expected. However, while the 'whenOff' screensaver is displaying, touchscreen events are ignored, so it's not possible to touch the screen to wake the Joggler. 2) I fixed this behaviour by commenting out the code that prevents processing of the mouse event: Code: -------------------- if event:getType() == EVENT_MOUSE_PRESS or event:getType() == EVENT_MOUSE_HOLD or event:getType() == EVENT_MOUSE_DRAG then if self.mouseAllowed then log:debug("'Per window' mouse event allowed to pass through") -- return EVENT_UNUSED end end log:debug("Closing screensaver event=", event:tostring()) self:deactivateScreensaver() -------------------- So now I can touch the screen to deactivate the 'whileOff' screensaver, but in doing so it also powers up the currently selected player. That's not always desirable, e.g. if it's a Radio in a bedroom. 3) I fixed this behaviour by commenting out the code that powers up the player. Code: -------------------- if not self:isSoftPowerOn() then -- jiveMain:setSoftPowerState("on") end -------------------- So now I'm very nearly there. The issue I now have, that I'd appreciate help with, is that when I switch players, the 'whenOff' screen saver appears to continue to respond to the power state of the previously selected player, i.e. I touch the screen to wake the Joggler, select a different player that is NOT powered off, but the 'whenOff' screensaver continues to activate because the previous player is still powered off. If I cycle the power on the 'new' player, then the behaviour of the 'whenOff' screensaver is corrected. I'm guessing I need to update the screensaver code to listen for the power status of the new player somehow, but I'm at a loss as to how to do this. The odd thing is that the 'when stopped' screensaver DOES appear to respond to the new player's status. ------------------------------------------------------------------------ chill's Profile: http://forums.slimdevices.com/member.php?userid=10839 View this thread: http://forums.slimdevices.com/showthread.php?t=110135 _______________________________________________ unix mailing list unix@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/unix