I had a go at tweaking the screensaver applet this evening.  The issue
was that the screensaver was responding to the power state of the
-previous- player, rather than the current one - i.e. if I switched to a
player that was off, but the previous player was still on, I'd get the
'whenStopped' screensaver rather than the 'whenOff' screensaver (and
vice versa).  This could be fixed by power cycling the current player.

I've made a tweak that seems to fix this.  I commented out the line that
has my initials (CJH) and replaced it with the line below it.

Code:
--------------------
    function _getMode(self)
        local player = appletManager:callService("getCurrentPlayer")
        
  --CJH if not *self:isSoftPowerOn()* and System:hasSoftPower() then
        if not *player:isPowerOn()* and System:hasSoftPower() then
                return 'whenOff'
        else
                if player and player:getPlayMode() == "play" then
                        return 'whenPlaying'
                end
        end
        return 'whenStopped'
  end
  
--------------------


I must admit I don't understand what 'self' is referring to in this
function, but evidently 'self:isSoftPowerOn()' does not reflect the
power state of the current player after a change of player, whereas
'player:isPowerOn()' does.  I also don't know what
'System:hasSoftPower()' odes - what is the 'System' here?

If there's a better way, such as updating 'self' somehow, I'm all ears.


------------------------------------------------------------------------
chill's Profile: http://forums.slimdevices.com/member.php?userid=10839
View this thread: http://forums.slimdevices.com/showthread.php?t=110040

_______________________________________________
unix mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/unix

Reply via email to