tamanaco;324992 Wrote: 
> I now tell her to press the Sleep button and select Suspend to SN, wait
> until she sees the SN "Now Playing" and then press the Power button to
> turn the SB3 off. Not optimal, but she's ok with it.

With the SN automation in SC7, it should be possible for the plugin to
ensure that the player was also "off" after switching to SN.

gharris999 Wrote: 
> Longer term, I'd like to implement PeterW's sleep-hold code for this
> purpose. (Note to self: go out and swipe a clever-er brain so that I
> can understand his perl code.) 

Ouch. You probably meant that as self-deprecating humor but it makes me
think I didn't write good code! Yeah, I didn't comment that Perl code
very well, and the big block of code in mapKeyHold() that looks at
@maps is quite cryptic, mostly because the $client->irmaps structure is
pretty complex.

Main thing you need to do is lift newPlayerCheck() and mapKeyHold(),
change the 'modefunction_PLUGIN...' string in newPlayerCheck(), define
$aqKey, and in initPlugin() add the line
Slim::Control::Request::subscribe( \&newPlayerCheck,
[['client']],[['new']]);

If the key mapping for your plugin is conditional, you can add another
condition in newPlayerCheck()'s if () statement.

I don't have any "undo" code, so if the user wanted to map to a
different key's .hold action, or wanted to disable key mapping, that
would require a restart of the SC instance. 'undo' code is feasible, I
just didn't bother writing it.


-- 
peterw

http://www.tux.org/~peterw/
free plugins: http://www.tux.org/~peterw/#slim
AllQuiet BlankSaver ContextMenu FuzzyTime PlayLog
PowerCenter/BottleRocket 
SaverSwitcher SettingsManager SleepFade StatusFirst SyncOptions
VolumeLock
------------------------------------------------------------------------
peterw's Profile: http://forums.slimdevices.com/member.php?userid=2107
View this thread: http://forums.slimdevices.com/showthread.php?t=48521

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

Reply via email to