Squeezebox
Hier ist meine simple Umsetzung des Squeezebox-Http-Protokolls für Node-Blue. Umsetzung ist schon fast zuviel gesagt.
So sieht das Ding in Benutzung aus:
MAn füllt über die Template-Node folgende JSON-Struktur aus:
{
"p0": "",
"p1": "",
"p2": "",
"p3": "",
"p4": "",
"server": "",
"port": "",
"player": ""
}
Die Werte für p0 bis p4 sind der folgenden Tabelle zu entnehmen:
p0 | p1 | p2 | p3 | p4 | Description |
---|---|---|---|---|---|
play | Start the player playing | ||||
pause | (0,1,) | Pause/unpause player. p1=1 to pause, p1=0 to unpause, omit p1 to toggle | |||
stop | Stop the player | ||||
sleep | (0…n) | (Play for p1 seconds and then sleep | |||
playlist | play | Replace the current playlist with the song, playlist or directory specified by p2 | |||
playlist | add | Append the song, playlist or directory specified by p2 to the end of the current playlist | |||
playlist | insert | Insert the song, playlist or directory specified by p2 to be played immediately after the current song. | |||
playlist | resume | Replace the current playlist with the playlist specified by p2, starting at the song that was playing when the file was saved. (Resuming works only with M3U files saved with the playlist save command below.) Shortcut: use a bare playlist name (without leading directories or trailing .m3u suffix to load a playlist in the saved playlists folder. | |||
playlist | loadalbum | Replace the current playlist with all songs for a given genre, artist, and album. Use a value of “*” for p2, p3, or p4 as a wildcard. Note: the server’s cache must contain the items for this to work. | |||
playlist | save | Save a playlist file in the saved playlists directory. Accepts a playlist filename (without .m3u suffix) and saves in the top level of the playlists directory. | |||
playlist | addalbum | Add all songs for a given genre, artist, and album. Use a value of “*” for p2, p3, or p4 as a wildcard. Note: the server’s cache must contain the items for this to work. | |||
playlist | clear | Clear the current playlist | |||
playlist | repeat | (0,1,2,) | Change the repeat mode. p1=0 no repeat, stop at the end of the playlist, p1=1 repeat the current song, p1=2 repeat the entire playlist. Omit p1 to cycle through values. | ||
playlist | shuffle | (0,1,2,) | Shuffle the playlist. p1=0 no shuffle, p1=1 shuffle songs in the playlist, p1=2 shuffle albums in the playlist. Omit p1 to toggle shuffle mode. | ||
playlist | move | Move the song in the offset specified by p2 to the offset specified by p3 in the playlist. | |||
playlist | delete | Delete the song in the playlist at the offset specified by p2 | |||
playlist | jump | Make the song at the offset specified by p2 in the playlist the currently playing song | |||
mixer | volume | (0 … 100) | (-100 … +100) | ||
mixer | balance | (0 … 100) | (-100 … +100) | ||
mixer | base | (0 … 100) | (-100 … +100) | ||
mixer | treble | (0 … 100) | (-100 … +100) | ||
status | Return the current status of the player without any change. | ||||
display | Put text on the player’s display. line 1 is specified by p1, line 2 is specified by p2. The text is displayed for a number of seconds as specified by p3. If p3 is omitted, then a default time is used of approximately 1.5 seconds. | ||||
button |
|
Simulate a button press from the infrared remote, where is a function name per the Default.map file.
|
|||
rescan | Start a rescan of the music library | ||||
pref | Set the value of a preference. Use a value of “?” to get the value in the returned p2 header | ||||
pref | ? | Get the value of a preference. The value is returned in the returned p2 header | |||
playerpref | Set the value of a player specific preference. Use a value of “?” to get the value in the returned p2 header | ||||
playerpref | ? | Get the value of a player-specific preference. The value is returned in the returned p2 header | |||
debug | Set the value of a debugging variable, for example, set “d_ir” to “1” to have infrared debugging output. |
Der Subflow ist im Gegensatz dazu ziemlich einfach:
squeezebox.txt (619 Bytes)