|
|
The remote interface is a simple socket interface that allows an external program to write to a specific port over TCP/IP and command SnackAmp to perform a command. The result of the command, including returned parameters, are always returned via the same socket. Therefore the protocol is to open a two-way socket on the specified port (defined in SnackAmp settings) and write a command to it, and read back a single line to see the results. You can try this out via telnet by writing the appropriate xmms_remote_* command in ASCII and seeing the returned result. Append any parameters to the command with spacing. Either "OK" or "ERROR" will be returned as the first token in the string, and in the case of an error the remaining string will be the error details. In the case of a valid returned result, the returned string (following the "OK") will be space delimited values in ASCII.
Subcommand | Parameters | Returns |
xmms_remote_get_info | None | rate, freq, channels as ASCII |
xmms_remote_get_output_time | None | returns time position of current track in milliseconds |
xmms_remote_get_playlist_pos | None | Index of current playlist position |
xmms_remote_get_playlist_file | None | Name of playlist track at some position |
xmms_remote_get_playlist_length | None | Number of tracks in the playlist |
xmms_remote_get_playlist_title | None | Name of current playlist track |
xmms_remote_is_running | None | Returns 1 or 0 if track is playing |
xmms_remote_set_playlist_pos | Integer | Sets the playlist position to some number. Does not play the track |
xmms_remote_play | None | Plays the current playlist selection |
xmms_remote_playlist_add | List of File Names | Appends the list of file names to the playlist (needs parsing) |
xmms_remote_set_main_volume | Real | Sets the volume to some number between 1-100.0 |
xmms_remote_get_main_volume | None | Returns the current volume value |
xmms_remote_stop | None | Stops playing of the current track |
xmms_remote_pause | None | Pauses playback of the current track |
xmms_remote_playlist_prev | None | Plays the previous track in the playlist |
xmms_remote_jump_to_time | Real | Positions the time offset of the current track to some real value (in decimal seconds) |
xmms_remote_get_playlist_time | None | Returns the duration of the current track in real seconds. |
xmms_remote_is_playing | None | Returns 1 or 0 if track is playing |
xmms_remote_quit | None | Exits the applications (not implemented) |