Usage Commands
raaapha edited this page Sep 27, 2013
·
2 revisions
As said above, you can use remotebox to control your Rhythmbox remotely through a TCP socket. Once the plugin is installed and Rhythmbox is running, a typical remote session might be as follows (using netcat as a client, assuming Rhythmbox us running locally and playing a file):
$ netcat localhost 30666
next # -> Client request
ok # -> remotebox response
prev
ok
vol
1.0
vol 0.3
ok
vol
0.3
pause
ok
goto file://path/to/a/file.mp3
ok
stop
ok
list # -> Request the list of all files on Rhythmbox library
... # -> Response is a xml-formatted string. See "Avaliable commands" for more information.
Request | Response | Explanation |
---|---|---|
play | `ok\n` | If there isn't any file selected, the response is `Error on play: no track selected!` |
pause | `ok\n` | |
stop | `ok\n` | |
next | `ok\n` | |
prev | `ok\n` | |
vol | `0.9\n` | The response is the current volume setting, a float point between 0.0 and 1.0 |
vol 0.7 | `ok\n` | Sets the volume to a float point between 0.0 and 1.0. If the requested setting is invalid, returns `Invalid volume setting.` |
goto file://path/to/a/file.mp3 | `ok\n` | Plays the specified file. If it doens't exist, return `` |
list | XML-formatted string containing base64 encoded information about the files on rhythmbox library. | See example below |
###Example of a xml-formatted file list in response to a list
request###
<xml version='1.0' encoding='utf-8'>
<tracks>
<track>
<artist>VGhlIEJlYXRsZXMK</artist>
<title>V2l0aCBhIGxpdHRsZSBoZWxwIGZyb20gbXkgZnJpZW5kcwo=</title>
<album>U2d0LiBQZXBwZXLigJlzIExvbmVseSBIZWFydHMgQ2x1YiBCYW5kCg==</album>
<url>ZmlsZTovL215L2F1ZGlvL2ZvbGRlci90aGUlMjBiZWF0bGVzJTIwLSUyMHdpd
GglMjBhJTIwbGl0dGxlJTIwaGVscCUyMGZyb20lMjBteSUyMGZyaWVuZHMubXAzCg==
</url>
</track>
<track>
<artist>VGhlIEJlYXRsZXMK</artist>
<title>THVjeSBpbiB0aGUgc2t5IHdpdGggZGlhbW9uZHMK</title>
<album>U2d0LiBQZXBwZXLigJlzIExvbmVseSBIZWFydHMgQ2x1YiBCYW5kCg==</album>
<url>ZmlsZTovL215L2F1ZGlvL2ZvbGRlci90aGUlMjBiZWF0bGVzJTIwLSUyMGx1Y
3klMjBpbiUyMHRoZSUyMHNreSUyMHdpdGglMjBkaWFtb25kcy5tcDMK
</url>
</track>
.
.
.
</tracks>
</xml>
The values in every field (<artist>
, <title>
, <album>
, <url>
) are base64 encoded uft8 strings. If we decode these fields, we get:
<xml version='1.0' encoding='utf-8'>
<tracks>
<track>
<artist>The Beatles</artist>
<title>With a little help from my friends</title>
<album>Sgt. Pepper’s Lonely Hearts Club Band</album>
<url>file://my/audio/folder/the%20beatles%20-%20with%20a%20little%20help%20from%20my%20friends.mp3</url>
</track>
<track>
<artist>The Beatles</artist>
<title>Lucy in the sky with diamonds</title>
<album>Sgt. Pepper’s Lonely Hearts Club Band</album>
<url>file://my/audio/folder/the%20beatles%20-%20lucy%20in%20the%20sky%20with%20diamonds.mp3</url>
</track>
.
.
.
</tracks>
</xml>