Music Player Daemon - Commands This document is intended for client developers, not end users. Format: ------- If arguments contain spaces, they should be surrounded by double quotation marks, ". command ... explanation: w/ arg1 and arg2 All data between the client and server is encoded in UTF-8. (Note, that in UTF-8 all standard ansi characters, 0-127, are the same as a standard ansi encoding. Also, no ansi character appears in any multi-byte characters. So, you can use standard C functions like strlen, and strcpy just fine with UTF-8 encoded strings. For example: "OK\n" encoded in UTF-8 is simply "OK\n". For more information on UTF=8: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 ) Command Completion: ------------------- A command returns "OK\n" on completion or "ACK some error\n" on failure. These denote the end of command execution. Commands: --------- add add the file _path_ to the playlist (directories add recursively) _path_ can also be a single file increments playlist version by for each song added clear clears the current playlist increments playlist version by 1 clearerror clear the current error message in status (this is also accomplished by any command that starts playback) close close the connection with the MPD crossfade sets crossfading between songs delete delete _song_ from playlist increments playlist version by 1 find finds songs in the db that are exactly _what_ _type_ should be "album", "artist", or "title" _what_ is what to find kill kill MPD list list all tags of _type_ _type_ should be "album" or "artist" _arg1_ is an optional parameter when type is album, this specifies to list albums by a artist, where artist is specified with arg1 listall lists all songs and directories in _path_ (recursively) _path_ is optional and maybe a directory or path listallinfo same as listall command, except it also returns metadata info in the same format as lsinfo load loads the playlist _name_.m3u from the playlist directory increments playlist version by the number of songs added lsinfo list contents of _directory_, from the db. _directory_ is optional move move song at _from_ to _to_ in the playlist increments playlist version by 1 next plays next song in playlist pause toggle pause/resume playing _pause_ is optional and should be 0 or 1 password this is used for authentication with the server. _password_ is simply the plaintext password ping does nothing but return "OK" play begin playing playlist at song number _song_, _song_ is optional playlist displays the current playlist NOTE: do not use this, instead use 'playlistinfo' playlistinfo displays information about the current playlist previous plays previous song in playlist random set random state to _state_, _state_ should be 0 or 1 repeat set repeat state to _state_, _state_ should be 0 or 1 rm removes the playlist .m3u from the playlist directory save saves the current playlist to _name_.m3u in the playlist directory search same as "find" but searches for any song that contain _what_ search is not case sensitive seek seeks to the position _time_ (in seconds) of entry _song_ in the playlist setvol set volume to _vol_ _vol_ the range of volume is 0-100 shuffle shuffles the current playlist increments playlist version by 1 stats display stats artists: number of artists albums: number of albums songs: number of songs uptime: daemon uptime in seconds db_playtime: sum of all song times in db db_update: last db update in UNIX time playtime: time length of music played status reports current status of player, and volume level. volume: (0-100). repeat: (0 or 1) playlist: (31-bit unsigned integer, the playlist version number) playlistlength: (integer, the length of the playlist) state: ("play", "stop", or "pause") song: (current song playing/paused, playlist song number) time: :