PDA

View Full Version : KidsPlay: redefine what the SB Receiver button does



peterw
2009-08-19, 20:38
By default, the button on a Squeezebox Receiver acts like Pause -- press once to pause, again to unpause. If a Receiver is synced with other players, this means that pressing its button makes the whole sync group go silent.

If you want to merely silence that one Receiver,
1) set your players' Synchronize settings to allow each player to power off separately
2) install KidsPlay (version 2.1.12 or newer)
3) define the Receiver Button as "button power_toggle"
4) in the Receiver's KidsPlay settings, for Boom/Receiver button behavior, choose "KidsPlay routine or normal action"

That's just a simple example; KidsPlay will let you program SqueezeCenter to run any sequence of CLI commands you want each time you press the Receiver's button.

http://www.tux.org/~peterw/slim/KidsPlay.html

-Peter

indifference_engine
2009-08-20, 08:54
That's really interesting! I was unaware the button did anything (except to find a network during startup).

Could KidsPlay be used to configure the button to move to the next track in the playlist? There's always a dodgy song that pops up now and then (esp with random playlists) and I can never find the SBC when I need it!

Actually, that's another idea: make the button do a "find handset" like on DECT phones. May require a companion SBC applet though.

peterw
2009-08-20, 14:25
Could KidsPlay be used to configure the button to move to the next track in the playlist? There's always a dodgy song that pops up now and then (esp with random playlists) and I can never find the SBC when I need it!

"playlist index +1" should do that. "button fwd" might also work.


Actually, that's another idea: make the button do a "find handset" like on DECT phones. May require a companion SBC applet though.

I think you're right about needing an applet. But you'd also need to consider the power saving behavior of the Controller; I think its power savings mode gets it to sleep soundly enough that it cannot be awoken by a remote system. :-( I don't know if you could sacrifice some battery life by writing applet code to make it wake up every N minutes to check if you're looking for it or not.

NikolajC
2009-08-20, 14:41
Sounds great. I'm using your excellent syncoptions as well to cancel sync when players are powered up. Would it be possible to use KidsPlay to do this:

Assume I only ever use one sync group. I want the receiver button and the boom button 6 to toggle sync on and off. Is that possible? Thanks in advance.

peterw
2009-08-20, 18:52
Sounds great. I'm using your excellent syncoptions as well to cancel sync when players are powered up. Would it be possible to use KidsPlay to do this:

Assume I only ever use one sync group. I want the receiver button and the boom button 6 to toggle sync on and off. Is that possible? Thanks in advance.

Not without someone doing some extra coding. :-( Sync and unsync aren't simple preferences, so right now you could only set up KidsPlay to do one or the other -- either unsync from the sync group ("sync -"), or make the other player sync up with what you're playing ("sync otherPlayerMACAddress" -- yes, your only choice is to "push" your playlist onto the other, not "pull" its playlist to you). I think the best fix would be something like the Synchronizer plugin exposing a new CLI command to let you toggle in/out of a predefined sync group.

NikolajC
2009-08-21, 00:44
Not without someone doing some extra coding. :-( Sync and unsync aren't simple preferences, so right now you could only set up KidsPlay to do one or the other -- either unsync from the sync group ("sync -"), or make the other player sync up with what you're playing ("sync otherPlayerMACAddress" -- yes, your only choice is to "push" your playlist onto the other, not "pull" its playlist to you). I think the best fix would be something like the Synchronizer plugin exposing a new CLI command to let you toggle in/out of a predefined sync group.

Thanks for your answer. Maybe I can make a big macro that syncs all my 4 players? Or can KidsPlay macros only be specific to a certain player?

peterw
2009-08-21, 06:18
Thanks for your answer. Maybe I can make a big macro that syncs all my 4 players?

It looks like Eric Kolding's Synchronizer plugin (http://www.koldware.com/SlimStuff/) might offer what you need for that. In order to support the Controller, the plugin implements a few CLI commands. Most interesting at first glance are "syncSyncToMe", which would make all players in your setup sync with the player whose button you pushed, and "syncSyncToSet" which appears to make your player sync to a predefined sync group. "syncSyncToSet" takes one argument, which appears to be the number of the sync group to join (where the groups are sorted alphabetically by name and the first is number 0) -- I think it'd be better for the argument to be the sync group name, but I suspect that Eric didn't expect anyone else to use his CLI commands. I think a small patch should allow Synchronizer to accept either name or number, so you could set up a KidsPlay macro without fear of it breaking each time you define a new group with the Synchronizer. Note: I have never used the Synchronizer, I'm just going from a quick look at the source code for version 0.9.4.

One remaining wrinkle that I would expect is controlling player power. If you have all players set to sync power when synced with others, they should all come to life after syncSyncToSet. Otherwise any player that's turned off will remain silent, even though it's synced (synced just means play the same thing IF you're turned on). I don't know if you can add four "macGoesHere power 1" commands to the KidsPlay macro to turn them all on. I expect you cannot -- KidsPlay executes commands in the context of the player where the button was pressed, and I expect that I'd need to modify KidsPlay to allow you to use commands that explicitly identified specific players. Not a big deal, it's just not there yet.

Oh, and thanks for the nice words about SyncOptions. :-)

peterw
2009-08-21, 21:46
One remaining wrinkle that I would expect is controlling player power. If you have all players set to sync power when synced with others, they should all come to life after syncSyncToSet. Otherwise any player that's turned off will remain silent, even though it's synced (synced just means play the same thing IF you're turned on). I don't know if you can add four "macGoesHere power 1" commands to the KidsPlay macro to turn them all on.

I just uploaded KidsPlay 2.2.0. There are now four different ways to specify macros should run on players other than the one where the button was pressed:
- "00:04:20:11:22:33: power 1" = turn on player with MAC 00:04:20:11:22:33
- "Kitchen: power 1" = turn on player named "Kitchen"
- "ALL: power 1" = turn on all players
- "OTHERS: power 1" = turn on all players except the one where the button was pressed (leave its power state unchanged)

So you might have a macro like


ALL: power 1; syncSyncToMe

to make all 4 players turn on, and make the other 3 players sync to the one where you pressed the button. Again, I still haven't tried Synchronizer, but that's what its syncSyncToMe command appears to do.

-Peter

NikolajC
2009-08-21, 23:49
I just uploaded KidsPlay 2.2.0. There are now four different ways to specify macros should run on players other than the one where the button was pressed...-Peter

Wow thanks Peter. As soon as I have a free moment I'll have a go at these. Excellent support there. Thanks again.

NikolajC
2009-08-22, 09:56
Had a go at it. The syncSyncToMe command seems to work just great as a KidsPlay macro. Now button 6 on my booms syncs everything up. Excellent :)

I could not however get the syncSyncToSet 0 command working after making a sync set called "all" in "The Synchronizer". But the other one will do just fine.