Author: sin <email@example.com>
Date: Sat, 27 Dec 2014 23:15:14 +0000
|M||PROTOCOL|| | ||75||+++++++++++++++++++++++++++++++++++++++++++++++++++------------------------|
1 file changed, 51 insertions(+), 24 deletions(-)
diff --git a/PROTOCOL b/PROTOCOL
@@ -1,58 +1,85 @@
-At the moment only single argument commands are supported.
-output + OK on success, ERR descriptive error message on error.
- -> songid: playlist songid of the current song stopped on or playing
- -> state: play, stop or pause
- -> volume: 0-100
- -> elapsed: total time elapsed within current song
- -> duration: total song duration in seconds
- -> random: 1 if random mode is set 0 otherwise
- -> repeat: 1 if repeat mode is set 0 otherwise
- -> single: 1 if single mode is set 0 otherwise
+NOTE: All commands will return some optional output followed by OK on success or
+ERR followed by an error message on failure.
+Select random playback mode. By default the daemon is in a repeat mode where it cycles
+through the playlist endlessly.
+Set repeat mode. Just cycle through the playlist.
+Set single mode. Play one song, then stop.
+Set the output volume. This is applied equally to all outputs.
+Play next song.
+Pause currently playing song.
+Play the song with the given ID or the current song if no ID is provided.
+When the playlist gets populated initially, the first song added is the current song.
+A song ID is just a unique integer identifying the song. ID rolls back at 0 when
+the playlist is cleared.
+Play previous song.
+Add a file to the playlist. Directories are not handled.
+Clear playlist and stop playback. The next file added will have a song ID
+equal to 0.
+Delete the song with the given ID or the currently selected song.
+Dump the current playlist. The output has the following form:
+"%d: %s\n", id, filepath
+Search for a song matching the given regex. At the moment it will only
+consider file names.
+Force the daemon to close the client connection.
+Kill the daemon.
+The daemon will reply with pong.
+Number of seconds the daemon has been running.
+The sad protocol version.
+Query state information from the daemon. The optional argument [state]
+identifies what information should be returned. If not specified, all of the
+state information is returned. The format of the reply is:
+"%s: %s", statevar, infomsg
+ random: 1 if random mode is set 0 otherwise
+ repeat: 1 if repeat mode is set 0 otherwise
+ single: 1 if single mode is set 0 otherwise
+ songid: playlist songid of the current song stopped on or playing
+ playback: either play, stop or pause
+ volume: 0-100
+ elapsed: total time elapsed within current song in seconds
+ duration: total song duration in seconds