2008-11-19 21:16:19 +01:00
<?xml version='1.0' encoding="utf-8"?>
2016-04-22 10:04:29 +02:00
< !DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
2008-11-19 21:16:19 +01:00
<book >
<title > The Music Player Daemon protocol</title>
2014-09-02 13:50:47 +02:00
<chapter id= "syntax" >
2008-11-19 21:16:19 +01:00
<title > General protocol syntax</title>
<section >
2011-07-03 15:05:04 +02:00
<title > Protocol overview</title>
<para >
2014-10-10 23:22:37 +02:00
The <application > MPD</application> command protocol exchanges
line-based text records between client and server over TCP.
Once the client is connected to the server, they conduct a
conversation until the client closes the connection. The
conversation flow is always initiated by the client.
2011-07-03 15:05:04 +02:00
</para>
2008-11-19 21:16:19 +01:00
<para >
2011-07-03 15:05:04 +02:00
The client transmits a command sequence, terminated by the
newline character <constant > \n</constant> . The server will
respond with one or more lines, the last of which will be a
completion code.
</para>
<para >
When the client connects to the server, the server will answer
with the following line:
<synopsis > OK MPD version</synopsis>
where <varname > version</varname> is a version identifier such as
0.12.2. This version identifier is the version of the protocol
spoken, not the real version of the daemon. (There is no way to
retrieve this real version identifier from the connection.)
2008-11-19 21:16:19 +01:00
</para>
2011-07-03 15:05:04 +02:00
</section>
2014-09-02 13:50:47 +02:00
<section id= "request_syntax" >
2011-07-03 15:05:04 +02:00
<title > Requests</title>
2008-11-19 21:16:19 +01:00
<cmdsynopsis >
<command > COMMAND</command>
2008-11-20 08:59:54 +01:00
<arg rep= "repeat" > <replaceable > ARG</replaceable> </arg>
2008-11-19 21:16:19 +01:00
</cmdsynopsis>
2011-07-03 15:05:04 +02:00
<para >
If arguments contain spaces, they should be surrounded by double
quotation marks.
</para>
<para >
Argument strings are separated from the command and any other
arguments by linear white-space (' ' or '\t').
</para>
2008-11-19 21:16:19 +01:00
<para >
2008-11-20 22:16:54 +01:00
All data between the client and the server is encoded in
2017-02-08 11:21:43 +01:00
UTF-8.
2008-11-19 21:16:19 +01:00
</para>
</section>
2014-09-02 13:50:47 +02:00
<section id= "response_syntax" >
2008-11-19 21:16:19 +01:00
<title > Responses</title>
<para >
2011-07-03 15:05:04 +02:00
A command returns <returnvalue > OK</returnvalue> on completion or
<returnvalue > ACK some error</returnvalue> on failure. These
denote the end of command execution.
2008-11-19 21:16:19 +01:00
</para>
2011-07-03 15:05:04 +02:00
2014-09-02 13:50:47 +02:00
<section id= "failure_response_syntax" >
2011-07-03 15:05:04 +02:00
<title > Failure responses</title>
<para >
The nature of the error can be gleaned from the information
that follows the <returnvalue > ACK</returnvalue> .
<returnvalue > ACK</returnvalue> lines are of the form:
<synopsis > ACK [error@command_listNum] {current_command} message_text\n</synopsis>
These responses are generated by a call to
<function > commandError</function> . They contain four separate
terms. Let's look at each of them:
<itemizedlist >
<listitem >
<para >
<returnvalue > error</returnvalue> : numeric value of one
of the <constant > ACK_ERROR</constant> constants defined
in <filename > ack.h</filename> .
</para>
</listitem>
<listitem >
<para >
<returnvalue > command_listNum</returnvalue> :
offset of the command that caused the error in a <link
linkend="command_lists">Command List</link> .
An error will always cause a command list to terminate
at the command that causes the error.
</para>
</listitem>
<listitem >
<para >
<returnvalue > current_command</returnvalue> :
name of the command, in a <link
linkend="command_lists">Command List</link> ,
that was executing when the error occurred.
</para>
</listitem>
<listitem >
<para >
<returnvalue > message_text</returnvalue> :
some (hopefully) informative text that describes the
nature of the error.
</para>
</listitem>
</itemizedlist>
</para>
<example >
<title > foo</title>
<para >
An example might help. Consider the following sequence
sent from the client to the server.
<synopsis >
command_list_begin
volume 86
play 10240
status
command_list_end
</synopsis>
</para>
<para >
The server responds with:
<returnvalue >
ACK [50@1] {play} song doesn't exist: "10240"
</returnvalue>
</para>
<para >
This tells us that the play command, which was the
second in the list (the first or only command is
numbered 0), failed with error 50. The number 50
translates to <constant > ACK_ERROR_NO_EXIST</constant> --the
song doesn't exist. This is reiterated by the message text
which also tells us which song doesn't exist.
</para>
</example>
</section>
2008-11-19 21:16:19 +01:00
</section>
2011-07-03 15:05:04 +02:00
<section id= "command_lists" >
2008-11-19 21:16:19 +01:00
<title > Command lists</title>
<para >
2008-11-20 22:16:54 +01:00
To facilitate faster adding of files etc. you can pass a list
2008-11-19 21:16:19 +01:00
of commands all at once using a command list. The command
2009-06-09 09:17:22 +02:00
list begins with <command > command_list_begin</command> or
2008-11-19 21:16:19 +01:00
<command > command_list_ok_begin</command> and ends with
<command > command_list_end</command> .
</para>
<para >
2008-11-20 22:14:47 +01:00
It does not execute any commands until the list has ended.
The return value is whatever the return for a list of commands
is. On success for all commands,
<returnvalue > OK</returnvalue> is returned. If a command
fails, no more commands are executed and the appropriate
<returnvalue > ACK</returnvalue> error is returned. If
2009-06-09 09:19:42 +02:00
<command > command_list_ok_begin</command> is used,
2008-11-20 22:14:47 +01:00
<returnvalue > list_OK</returnvalue> is returned for each
2008-11-19 21:16:19 +01:00
successful command executed in the command list.
</para>
</section>
2009-10-18 01:24:49 +02:00
2014-09-02 13:50:47 +02:00
<section id= "range_syntax" >
2009-10-18 01:24:49 +02:00
<title > Ranges</title>
<para >
Some commands (e.g. <link
linkend="command_delete"><command > delete</command> </link> )
allow specifying a range in the form
<parameter > START:END</parameter> (the <varname > END</varname>
item is not included in the range, similar to ranges in the
Python programming language). If <varname > END</varname> is
omitted, then the maximum possible value is assumed.
</para>
</section>
2016-04-22 10:01:02 +02:00
<section id= "tags" >
<title > Tags</title>
<para >
The following tags are supported by
<application > MPD</application> :
</para>
<xi:include href= "include/tags.xml"
xmlns:xi="http://www.w3.org/2001/XInclude"/>
<para >
There can be multiple values for some of these tags. For
example, <application > MPD</application> may return multiple
lines with a <varname > performer</varname> tag. A tag value is
a UTF-8 string.
</para>
</section>
2008-11-19 21:16:19 +01:00
</chapter>
2014-09-02 13:50:47 +02:00
<chapter id= "recipes" >
2011-07-19 00:34:33 +02:00
<title > Recipes</title>
2014-09-02 13:50:47 +02:00
<section id= "queuing_recipe" >
2011-07-19 00:34:33 +02:00
<title > Queuing</title>
<para >
2014-10-10 23:22:37 +02:00
Often, users run <application > MPD</application> with "<link
2011-07-19 00:34:33 +02:00
linkend="command_random">random</link> " enabled, but want to
be able to insert songs "before" the rest of the playlist.
That is commonly called "queuing".
</para>
<para >
2014-10-10 23:22:37 +02:00
<application > MPD</application> implements this by allowing the client to specify a
2011-07-19 00:34:33 +02:00
"priority" for each song in the playlist (commands <link
linkend="command_prio"><command > prio</command> </link> and
<link
linkend="command_prioid"><command > prioid</command> </link> ). A
higher priority means that the song is going to be played
before the other songs.
</para>
<para >
2014-10-10 23:22:37 +02:00
In "random" mode, <application > MPD</application> maintains an
internal randomized sequence of songs. In this sequence,
songs with a higher priority come first, and all songs with
the same priority are shuffled (by default, all songs are
shuffled, because all have the same priority "0"). When you
increase the priority of a song, it is moved to the front of
the sequence according to its new priority, but always after
the current one. A song that has been played already (it's
"before" the current song in that sequence) will only be
scheduled for repeated playback if its priority has become
bigger than the priority of the current song. Decreasing the
2015-01-12 11:37:31 +01:00
priority of a song will move it farther to the end of the
2014-10-10 23:22:37 +02:00
sequence. Changing the priority of the current song has no
2014-11-26 08:54:16 +01:00
effect on the sequence. During playback, a song's priority is
reset to zero.
2011-07-19 00:34:33 +02:00
</para>
</section>
</chapter>
2014-09-02 13:50:47 +02:00
<chapter id= "command_reference" >
2008-11-19 21:16:19 +01:00
<title > Command reference</title>
<note >
<para >
2008-11-20 22:16:54 +01:00
For manipulating playlists and playing, there are two sets of
commands. One set uses the song id of a song in the playlist,
while another set uses the playlist position of the song. The
commands using song ids should be used instead of the commands
that manipulate and control playback based on playlist
position. Using song ids is a safer method when multiple
2014-10-10 23:22:37 +02:00
clients are interacting with <application > MPD</application> .
2008-11-19 21:16:19 +01:00
</para>
</note>
2014-09-02 13:50:47 +02:00
<section id= "status_commands" >
2014-10-10 23:22:37 +02:00
<title > Querying <application > MPD</application> 's status</title>
2008-11-19 21:16:19 +01:00
<variablelist >
<varlistentry id= "command_clearerror" >
<term >
<cmdsynopsis >
<command > clearerror</command>
</cmdsynopsis>
</term>
<listitem >
<para >
2008-11-20 22:16:54 +01:00
Clears the current error message in status (this is also
2008-11-19 21:16:19 +01:00
accomplished by any command that starts playback).
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_currentsong" >
<term >
<cmdsynopsis >
<command > currentsong</command>
</cmdsynopsis>
</term>
<listitem >
<para >
2008-11-20 22:16:54 +01:00
Displays the song info of the current song (same song that
2008-11-19 21:16:19 +01:00
is identified in status).
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_idle" >
<term >
<cmdsynopsis >
<command > idle</command>
2008-11-23 18:48:11 +01:00
<arg choice= "opt" rep= "repeat" > <replaceable > SUBSYSTEMS</replaceable> </arg>
2008-11-19 21:16:19 +01:00
</cmdsynopsis>
</term>
<listitem >
<para >
2014-10-10 23:22:37 +02:00
<footnote id= "since_0_14" > <simpara > Introduced with
<application > MPD</application> 0.14</simpara> </footnote>
2008-11-20 22:14:47 +01:00
Waits until there is a noteworthy change in one or more
2014-10-10 23:22:37 +02:00
of <application > MPD</application> 's subsystems. As soon
as there is one, it lists all changed systems in a line
in the format <returnvalue > changed:
SUBSYSTEM</returnvalue> , where SUBSYSTEM is one of the
following:
2008-11-19 21:16:19 +01:00
</para>
<itemizedlist >
<listitem >
<para >
<returnvalue > database</returnvalue> : the song database
2009-06-30 07:28:34 +02:00
has been modified after <command > update</command> .
2009-07-05 08:46:53 +02:00
</para>
</listitem>
<listitem >
<para >
<returnvalue > update</returnvalue> : a database update
has started or finished. If the database was
modified during the update, the
<returnvalue > database</returnvalue> event is also
emitted.
2008-11-19 21:16:19 +01:00
</para>
</listitem>
<listitem >
<para >
<returnvalue > stored_playlist</returnvalue> : a stored
playlist has been modified, renamed, created or
deleted
</para>
</listitem>
<listitem >
<para >
<returnvalue > playlist</returnvalue> : the current
playlist has been modified
</para>
</listitem>
<listitem >
<para >
<returnvalue > player</returnvalue> : the player has been
started, stopped or seeked
</para>
</listitem>
<listitem >
<para >
<returnvalue > mixer</returnvalue> : the volume has been
changed
</para>
</listitem>
<listitem >
<para >
2017-02-19 20:50:09 +01:00
<returnvalue > output</returnvalue> : an audio output
has been added, removed or modified (e.g. renamed,
enabled or disabled)
2008-11-19 21:16:19 +01:00
</para>
</listitem>
<listitem >
<para >
<returnvalue > options</returnvalue> : options like
2008-11-20 22:14:47 +01:00
<option > repeat</option> , <option > random</option> ,
2009-11-01 15:44:56 +01:00
<option > crossfade</option> , replay gain
2008-11-19 21:16:19 +01:00
</para>
</listitem>
2017-02-17 23:59:06 +01:00
<listitem >
<para >
<returnvalue > partition</returnvalue> : a partition
was added, removed or changed
</para>
</listitem>
2010-12-30 12:30:53 +01:00
<listitem >
<para >
<returnvalue > sticker</returnvalue> : the sticker database
has been modified.
</para>
</listitem>
2011-01-29 09:26:22 +01:00
<listitem >
<para >
<returnvalue > subscription</returnvalue> : a client
has subscribed or unsubscribed to a channel
</para>
</listitem>
<listitem >
<para >
<returnvalue > message</returnvalue> : a message was
received on a channel this client is subscribed to;
this event is only emitted when the queue is empty
</para>
</listitem>
2008-11-19 21:16:19 +01:00
</itemizedlist>
2017-07-21 09:51:43 +02:00
<para >
Change events accumulate, even while the connection is
not in "idle" mode; no events gets lost while the client
is doing something else with the connection. If an
event had already occurred since the last call, the new
<command > idle</command> command will return immediately.
</para>
2008-11-19 21:16:19 +01:00
<para >
2008-11-20 22:16:54 +01:00
While a client is waiting for <command > idle</command>
2008-11-19 21:16:19 +01:00
results, the server disables timeouts, allowing a client
to wait for events as long as mpd runs. The
<command > idle</command> command can be canceled by
sending the command <command > noidle</command> (no other
2014-10-10 23:22:37 +02:00
commands are allowed). <application > MPD</application>
will then leave <command > idle</command> mode and print
results immediately; might be empty at this time.
2008-11-19 21:16:19 +01:00
</para>
2008-11-23 18:48:11 +01:00
<para >
2014-10-10 23:22:37 +02:00
If the optional <varname > SUBSYSTEMS</varname> argument
is used, <application > MPD</application> will only send
notifications when something changed in one of the
specified subsytems.
2008-11-23 18:48:11 +01:00
</para>
2008-11-19 21:16:19 +01:00
</listitem>
</varlistentry>
<varlistentry id= "command_status" >
<term >
<cmdsynopsis >
<command > status</command>
</cmdsynopsis>
</term>
<listitem >
<para >
2008-11-20 22:18:50 +01:00
Reports the current status of the player and the volume
level.
2008-11-19 21:16:19 +01:00
</para>
2008-11-20 22:14:47 +01:00
<itemizedlist >
<listitem >
<para >
<varname > volume</varname> :
2017-09-04 08:15:41 +02:00
<returnvalue > 0-100</returnvalue> or
<returnvalue > -1</returnvalue> if the volume cannot
be determined
2008-11-20 22:14:47 +01:00
</para>
</listitem>
<listitem >
<para >
<varname > repeat</varname> :
<returnvalue > 0 or 1</returnvalue>
</para>
</listitem>
2010-08-09 08:22:18 +02:00
<listitem >
<para >
<varname > random</varname> :
<returnvalue > 0 or 1</returnvalue>
</para>
</listitem>
2009-03-27 14:42:55 +01:00
<listitem >
<para >
2009-03-27 15:28:49 +01:00
<varname > single</varname> :
2014-10-10 23:22:37 +02:00
<footnote id= "since_0_15" > <simpara > Introduced with <application > MPD</application> 0.15</simpara> </footnote>
2009-03-27 14:42:55 +01:00
<returnvalue > 0 or 1</returnvalue>
</para>
</listitem>
2009-03-30 00:01:02 +02:00
<listitem >
<para >
<varname > consume</varname> :
2009-06-02 20:47:00 +02:00
<footnoteref linkend= "since_0_15" />
2009-08-31 03:57:12 +02:00
<returnvalue > 0 or 1</returnvalue>
2009-03-30 00:01:02 +02:00
</para>
</listitem>
2008-11-20 22:14:47 +01:00
<listitem >
<para >
<varname > playlist</varname> :
<returnvalue > 31-bit unsigned integer, the playlist
version number</returnvalue>
</para>
</listitem>
<listitem >
<para >
<varname > playlistlength</varname> :
<returnvalue > integer, the length of the
playlist</returnvalue>
</para>
</listitem>
<listitem >
<para >
<varname > state</varname> :
<returnvalue > play, stop, or pause</returnvalue>
</para>
</listitem>
<listitem >
<para >
<varname > song</varname> :
2008-11-20 22:16:54 +01:00
<returnvalue > playlist song number of the current
song stopped on or playing
</returnvalue>
2008-11-20 22:14:47 +01:00
</para>
</listitem>
<listitem >
<para >
<varname > songid</varname> :
2008-11-20 22:16:54 +01:00
<returnvalue > playlist songid of the current song
stopped on or playing
</returnvalue>
2008-11-20 22:14:47 +01:00
</para>
</listitem>
2009-08-23 10:43:46 +02:00
<listitem >
<para >
<varname > nextsong</varname> :
<footnoteref linkend= "since_0_15" />
<returnvalue > playlist song number of the next
song to be played
</returnvalue>
</para>
</listitem>
<listitem >
<para >
<varname > nextsongid</varname> :
<footnoteref linkend= "since_0_15" />
<returnvalue > playlist songid of the next song
to be played
</returnvalue>
2008-11-20 22:14:47 +01:00
</para>
</listitem>
<listitem >
<para >
<varname > time</varname> :
2008-11-20 22:16:54 +01:00
<returnvalue > total time elapsed (of current
2008-11-20 22:14:47 +01:00
playing/paused song)</returnvalue>
</para>
</listitem>
2009-06-25 08:37:34 +02:00
<listitem >
<para >
<varname > elapsed</varname> :
2014-10-10 23:22:37 +02:00
<footnote id= "since_0_16" > <simpara > Introduced with <application > MPD</application> 0.16</simpara> </footnote>
2009-06-25 08:37:34 +02:00
<returnvalue >
Total time elapsed within the current song, but
with higher resolution.
</returnvalue>
</para>
</listitem>
2014-11-25 17:46:43 +01:00
<listitem >
<para >
<varname > duration</varname> :
<footnote id= "since_0_20" > <simpara > Introduced with <application > MPD</application> 0.20</simpara> </footnote>
<returnvalue >
Duration of the current song in seconds.
</returnvalue>
</para>
</listitem>
2008-11-20 22:14:47 +01:00
<listitem >
<para >
<varname > bitrate</varname> :
<returnvalue > instantaneous bitrate in
kbps</returnvalue>
</para>
</listitem>
<listitem >
<para >
<varname > xfade</varname> :
<returnvalue > crossfade in seconds</returnvalue>
</para>
</listitem>
2010-03-21 18:21:47 +01:00
<listitem >
<para >
<varname > mixrampdb</varname> :
<returnvalue > mixramp threshold in dB</returnvalue>
</para>
</listitem>
<listitem >
<para >
<varname > mixrampdelay</varname> :
<returnvalue > mixrampdelay in seconds</returnvalue>
</para>
</listitem>
2008-11-20 22:14:47 +01:00
<listitem >
<para >
<varname > audio</varname> :
2017-01-17 22:28:59 +01:00
<returnvalue >
The format emitted by the decoder plugin during
playback, format:
"<replaceable > samplerate:bits:channels</replaceable> ".
Check the user manual for a detailed explanation.
</returnvalue>
2008-11-20 22:14:47 +01:00
</para>
</listitem>
<listitem >
<para >
2012-07-08 09:19:12 +02:00
<varname > updating_db</varname> :
2008-11-20 22:14:47 +01:00
<returnvalue > job id</returnvalue>
</para>
</listitem>
<listitem >
<para >
<varname > error</varname> :
<returnvalue > if there is an error, returns message
here</returnvalue>
</para>
2008-11-19 21:16:19 +01:00
</listitem>
2008-11-20 22:14:47 +01:00
</itemizedlist>
2008-11-19 21:16:19 +01:00
</listitem>
</varlistentry>
<varlistentry id= "command_stats" >
<term >
<cmdsynopsis >
<command > stats</command>
</cmdsynopsis>
</term>
<listitem >
<para >
2008-11-20 22:16:54 +01:00
Displays statistics.
2008-11-19 21:16:19 +01:00
</para>
<itemizedlist >
<listitem >
<para >
<varname > artists</varname> : number of artists
</para>
</listitem>
<listitem >
<para >
2014-08-31 12:34:48 +02:00
<varname > albums</varname> : number of albums
</para>
</listitem>
<listitem >
<para >
<varname > songs</varname> : number of songs
2008-11-19 21:16:19 +01:00
</para>
</listitem>
<listitem >
<para >
<varname > uptime</varname> : daemon uptime in seconds
</para>
</listitem>
<listitem >
<para >
<varname > db_playtime</varname> : sum of all song
2008-11-20 22:16:54 +01:00
times in the db
2008-11-19 21:16:19 +01:00
</para>
</listitem>
<listitem >
<para >
<varname > db_update</varname> : last db update in UNIX
time
</para>
</listitem>
<listitem >
<para >
<varname > playtime</varname> : time length of music played
</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
</variablelist>
</section>
2014-09-02 13:50:47 +02:00
<section id= "playback_option_commands" >
2008-11-19 21:16:19 +01:00
<title > Playback options</title>
2009-04-07 04:22:46 +02:00
<variablelist >
2009-03-30 00:01:02 +02:00
<varlistentry id= "command_consume" >
<term >
<cmdsynopsis >
<command > consume</command>
<arg choice= "req" > <replaceable > STATE</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
2009-06-02 20:47:00 +02:00
<footnoteref linkend= "since_0_15" />
2009-03-30 00:01:02 +02:00
Sets consume state to <varname > STATE</varname> ,
<varname > STATE</varname> should be 0 or 1.
When consume is activated, each song played is removed from playlist.
</para>
</listitem>
</varlistentry>
2008-11-19 21:16:19 +01:00
<varlistentry id= "command_crossfade" >
<term >
<cmdsynopsis >
<command > crossfade</command>
<arg choice= "req" > <replaceable > SECONDS</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Sets crossfading between songs.
</para>
</listitem>
</varlistentry>
2010-03-21 18:21:47 +01:00
<varlistentry id= "command_mixrampdb" >
<term >
<cmdsynopsis >
<command > mixrampdb</command>
<arg choice= "req" > <replaceable > deciBels</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Sets the threshold at which songs will be overlapped. Like crossfading but doesn't fade the track volume, just overlaps. The songs need to have MixRamp tags added by an external tool. 0dB is the normalized maximum volume so use negative values, I prefer -17dB. In the absence of mixramp tags crossfading will be used. See http://sourceforge.net/projects/mixramp
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_mixrampdelay" >
<term >
<cmdsynopsis >
<command > mixrampdelay</command>
<arg choice= "req" > <replaceable > SECONDS</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Additional time subtracted from the overlap calculated by mixrampdb. A value of "nan" disables MixRamp overlapping and falls back to crossfading.
</para>
</listitem>
</varlistentry>
2008-11-19 21:16:19 +01:00
<varlistentry id= "command_random" >
<term >
<cmdsynopsis >
<command > random</command>
<arg choice= "req" > <replaceable > STATE</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
2008-11-20 22:16:54 +01:00
Sets random state to <varname > STATE</varname> ,
<varname > STATE</varname> should be 0 or 1.
2008-11-19 21:16:19 +01:00
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_repeat" >
<term >
<cmdsynopsis >
<command > repeat</command>
<arg choice= "req" > <replaceable > STATE</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
2008-11-20 22:16:54 +01:00
Sets repeat state to <varname > STATE</varname> ,
2008-11-19 21:16:19 +01:00
<varname > STATE</varname> should be 0 or 1.
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_setvol" >
<term >
<cmdsynopsis >
<command > setvol</command>
<arg choice= "req" > <replaceable > VOL</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
2008-11-20 22:16:54 +01:00
Sets volume to <varname > VOL</varname> , the range of
2008-11-19 21:16:19 +01:00
volume is 0-100.
</para>
2009-03-27 14:42:55 +01:00
</listitem>
</varlistentry>
2009-03-27 15:28:49 +01:00
<varlistentry id= "command_single" >
2009-03-27 14:42:55 +01:00
<term >
<cmdsynopsis >
2009-03-27 15:28:49 +01:00
<command > single</command>
2009-03-27 14:42:55 +01:00
<arg choice= "req" > <replaceable > STATE</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
2009-06-02 20:47:00 +02:00
<footnoteref linkend= "since_0_15" />
2009-03-27 15:28:49 +01:00
Sets single state to <varname > STATE</varname> ,
2009-03-27 14:42:55 +01:00
<varname > STATE</varname> should be 0 or 1.
2009-03-27 15:28:49 +01:00
When single is activated, playback is stopped after current song, or
song is repeated if the 'repeat' mode is enabled.
2009-03-27 14:42:55 +01:00
</para>
2008-11-19 21:16:19 +01:00
</listitem>
</varlistentry>
2009-10-17 22:58:19 +02:00
<varlistentry id= "command_replay_gain_mode" >
<term >
<cmdsynopsis >
<command > replay_gain_mode</command>
<arg choice= "req" > <replaceable > MODE</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Sets the replay gain mode. One of
<parameter > off</parameter> ,
<parameter > track</parameter> ,
2011-10-19 23:55:04 +02:00
<parameter > album</parameter> ,
<parameter > auto</parameter> <footnote
id="replay_gain_auto_since_0_16">
2014-10-10 23:22:37 +02:00
<simpara > added in <application > MPD</application> 0.16</simpara>
2011-10-19 23:55:04 +02:00
</footnote> .
2009-10-17 22:58:19 +02:00
</para>
<para >
Changing the mode during playback may take several
seconds, because the new settings does not affect the
buffered data.
</para>
2009-11-01 15:44:56 +01:00
<para >
This command triggers the
<returnvalue > options</returnvalue> idle event.
</para>
2009-10-17 22:58:19 +02:00
</listitem>
</varlistentry>
<varlistentry id= "command_replay_gain_status" >
<term >
<cmdsynopsis >
<command > replay_gain_status</command>
</cmdsynopsis>
</term>
<listitem >
<para >
Prints replay gain options. Currently, only the
variable <varname > replay_gain_mode</varname> is
returned.
</para>
</listitem>
</varlistentry>
2013-10-25 00:11:10 +02:00
<varlistentry id= "command_volume" >
<term >
<cmdsynopsis >
<command > volume</command>
<arg choice= "req" > <replaceable > CHANGE</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Changes volume by amount <varname > CHANGE</varname> .
</para>
<note >
<para >
<command > volume</command> is deprecated, use
<command > setvol</command> instead.
</para>
</note>
</listitem>
</varlistentry>
2008-11-19 21:16:19 +01:00
</variablelist>
</section>
2014-09-02 13:50:47 +02:00
<section id= "playback_commands" >
2008-11-19 21:16:19 +01:00
<title > Controlling playback</title>
<variablelist >
2008-11-20 22:18:50 +01:00
<varlistentry id= "command_next" >
2008-11-19 21:16:19 +01:00
<term >
<cmdsynopsis >
2008-11-20 22:18:50 +01:00
<command > next</command>
2008-11-19 21:16:19 +01:00
</cmdsynopsis>
</term>
<listitem >
<para >
2008-11-20 22:18:50 +01:00
Plays next song in the playlist.
2008-11-19 21:16:19 +01:00
</para>
</listitem>
</varlistentry>
2008-11-20 22:18:50 +01:00
<varlistentry id= "command_pause" >
2008-11-19 21:16:19 +01:00
<term >
<cmdsynopsis >
2008-11-20 22:18:50 +01:00
<command > pause</command>
<arg choice= "req" > <replaceable > PAUSE</replaceable> </arg>
2008-11-19 21:16:19 +01:00
</cmdsynopsis>
</term>
<listitem >
<para >
2008-11-20 22:18:50 +01:00
Toggles pause/resumes playing, <varname > PAUSE</varname> is 0 or 1.
2008-11-19 21:16:19 +01:00
</para>
2008-11-20 22:18:50 +01:00
<note >
<para >
The use of pause command w/o the PAUSE argument is
deprecated.
</para>
</note>
2008-11-19 21:16:19 +01:00
</listitem>
</varlistentry>
2008-11-20 22:18:50 +01:00
<varlistentry id= "command_play" >
2008-11-19 21:16:19 +01:00
<term >
<cmdsynopsis >
2008-11-20 22:18:50 +01:00
<command > play</command>
<arg > <replaceable > SONGPOS</replaceable> </arg>
2008-11-19 21:16:19 +01:00
</cmdsynopsis>
</term>
<listitem >
<para >
2008-11-20 22:18:50 +01:00
Begins playing the playlist at song number
<varname > SONGPOS</varname> .
2008-11-19 21:16:19 +01:00
</para>
</listitem>
</varlistentry>
2008-11-20 22:18:50 +01:00
<varlistentry id= "command_playid" >
2008-11-19 21:16:19 +01:00
<term >
<cmdsynopsis >
2008-11-20 22:18:50 +01:00
<command > playid</command>
<arg > <replaceable > SONGID</replaceable> </arg>
2008-11-19 21:16:19 +01:00
</cmdsynopsis>
</term>
<listitem >
<para >
2008-11-20 22:18:50 +01:00
Begins playing the playlist at song
<varname > SONGID</varname> .
2008-11-19 21:16:19 +01:00
</para>
</listitem>
</varlistentry>
2008-11-20 22:18:50 +01:00
<varlistentry id= "command_previous" >
2008-11-19 21:16:19 +01:00
<term >
<cmdsynopsis >
2008-11-20 22:18:50 +01:00
<command > previous</command>
2008-11-19 21:16:19 +01:00
</cmdsynopsis>
</term>
<listitem >
<para >
2008-11-20 22:18:50 +01:00
Plays previous song in the playlist.
2008-11-19 21:16:19 +01:00
</para>
</listitem>
</varlistentry>
2008-11-20 22:18:50 +01:00
2008-11-19 21:16:19 +01:00
<varlistentry id= "command_seek" >
<term >
<cmdsynopsis >
<command > seek</command>
<arg choice= "req" > <replaceable > SONGPOS</replaceable> </arg>
<arg choice= "req" > <replaceable > TIME</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Seeks to the position <varname > TIME</varname> (in
2014-08-29 23:46:38 +02:00
seconds; fractions allowed) of entry
<varname > SONGPOS</varname> in the playlist.
2008-11-19 21:16:19 +01:00
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_seekid" >
<term >
<cmdsynopsis >
<command > seekid</command>
<arg choice= "req" > <replaceable > SONGID</replaceable> </arg>
<arg choice= "req" > <replaceable > TIME</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Seeks to the position <varname > TIME</varname> (in
2014-08-29 23:46:38 +02:00
seconds; fractions allowed) of song
<varname > SONGID</varname> .
2008-11-19 21:16:19 +01:00
</para>
</listitem>
</varlistentry>
2011-12-24 11:20:02 +01:00
<varlistentry id= "command_seekcur" >
<term >
<cmdsynopsis >
<command > seekcur</command>
<arg choice= "req" > <replaceable > TIME</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
2014-08-29 23:46:38 +02:00
Seeks to the position <varname > TIME</varname> (in
seconds; fractions allowed) within the current song. If
prefixed by '+' or '-', then the time is relative to the
current playing position.
2011-12-24 11:20:02 +01:00
</para>
</listitem>
</varlistentry>
2008-11-19 21:16:19 +01:00
<varlistentry id= "command_stop" >
<term >
<cmdsynopsis >
<command > stop</command>
</cmdsynopsis>
</term>
<listitem >
<para >
2008-11-20 22:16:54 +01:00
Stops playing.
2008-11-19 21:16:19 +01:00
</para>
</listitem>
</varlistentry>
</variablelist>
</section>
2014-09-02 13:50:47 +02:00
<section id= "queue" >
2008-11-19 21:16:19 +01:00
<title > The current playlist</title>
<variablelist >
<varlistentry id= "command_add" >
<term >
<cmdsynopsis >
<command > add</command>
<arg choice= "req" > <replaceable > URI</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
2008-11-20 22:16:54 +01:00
Adds the file <varname > URI</varname> to the playlist
(directories add recursively). <varname > URI</varname>
can also be a single file.
2008-11-19 21:16:19 +01:00
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_addid" >
<term >
<cmdsynopsis >
<command > addid</command>
<arg choice= "req" > <replaceable > URI</replaceable> </arg>
<arg > <replaceable > POSITION</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Adds a song to the playlist (non-recursive) and returns the song id.
</para>
<para >
<varname > URI</varname> is always a single file or
2009-10-09 10:18:02 +02:00
URL. For example:
2008-11-19 21:16:19 +01:00
</para>
<screen >
addid "foo.mp3"
Id: 999
OK
</screen>
</listitem>
</varlistentry>
<varlistentry id= "command_clear" >
<term >
<cmdsynopsis >
<command > clear</command>
</cmdsynopsis>
</term>
<listitem >
<para >
Clears the current playlist.
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_delete" >
<term >
<cmdsynopsis >
<command > delete</command>
2009-10-18 01:24:22 +02:00
<group >
<arg choice= "req" > <replaceable > POS</replaceable> </arg>
<arg choice= "req" > <replaceable > START:END</replaceable> </arg>
</group>
2008-11-19 21:16:19 +01:00
</cmdsynopsis>
</term>
<listitem >
<para >
Deletes a song from the playlist.
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_deleteid" >
<term >
<cmdsynopsis >
<command > deleteid</command>
<arg choice= "req" > <replaceable > SONGID</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
2008-11-20 22:16:54 +01:00
Deletes the song <varname > SONGID</varname> from the
playlist
2008-11-19 21:16:19 +01:00
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_move" >
<term >
<cmdsynopsis >
<command > move</command>
2009-03-26 22:02:56 +01:00
<group >
<arg choice= "req" > <replaceable > FROM</replaceable> </arg>
<arg choice= "req" > <replaceable > START:END</replaceable> </arg>
</group>
2008-11-19 21:16:19 +01:00
<arg choice= "req" > <replaceable > TO</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
2009-03-26 22:02:56 +01:00
Moves the song at <varname > FROM</varname> or range of songs
at <varname > START:END</varname> to <varname > TO</varname>
in the playlist.
2009-06-02 20:47:00 +02:00
<footnote id= "range_since_0_15" >
2014-10-10 23:22:37 +02:00
<simpara > Ranges are supported since <application > MPD</application> 0.15</simpara>
2009-06-02 20:47:00 +02:00
</footnote>
2008-11-19 21:16:19 +01:00
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_moveid" >
<term >
<cmdsynopsis >
<command > moveid</command>
<arg choice= "req" > <replaceable > FROM</replaceable> </arg>
<arg choice= "req" > <replaceable > TO</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
2009-03-24 16:56:54 +01:00
Moves the song with <varname > FROM</varname> (songid) to
<varname > TO</varname> (playlist index) in the
2008-11-19 21:16:19 +01:00
playlist. If <varname > TO</varname> is negative, it
is relative to the current song in the playlist (if
there is one).
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_playlist" >
<term >
<cmdsynopsis >
<command > playlist</command>
</cmdsynopsis>
</term>
<listitem >
<para >
Displays the current playlist.
</para>
<note >
<para >
Do not use this, instead use <command > playlistinfo</command> .
</para>
</note>
</listitem>
</varlistentry>
2008-11-20 22:18:50 +01:00
<varlistentry id= "command_playlistfind" >
<term >
<cmdsynopsis >
<command > playlistfind</command>
<arg choice= "req" > <replaceable > TAG</replaceable> </arg>
<arg choice= "req" > <replaceable > NEEDLE</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Finds songs in the current playlist with strict
matching.
</para>
</listitem>
</varlistentry>
2008-11-19 21:16:19 +01:00
<varlistentry id= "command_playlistid" >
<term >
<cmdsynopsis >
<command > playlistid</command>
<arg choice= "req" > <replaceable > SONGID</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
2008-11-20 22:16:54 +01:00
Displays a list of songs in the playlist.
2008-11-19 21:16:19 +01:00
<varname > SONGID</varname> is optional and specifies a
single song to display info for.
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_playlistinfo" >
<term >
<cmdsynopsis >
<command > playlistinfo</command>
2009-03-26 15:47:51 +01:00
<group >
<arg > <replaceable > SONGPOS</replaceable> </arg>
<arg > <replaceable > START:END</replaceable> </arg>
</group>
2008-11-19 21:16:19 +01:00
</cmdsynopsis>
</term>
<listitem >
<para >
2009-03-26 15:47:51 +01:00
Displays a list of all songs in the playlist, or if the optional
argument is given, displays information only for the song
<varname > SONGPOS</varname> or the range of songs
<varname > START:END</varname>
2009-06-02 20:47:00 +02:00
<footnoteref linkend= "range_since_0_15" />
2008-11-19 21:16:19 +01:00
</para>
</listitem>
</varlistentry>
2008-11-20 22:18:50 +01:00
<varlistentry id= "command_playlistsearch" >
<term >
<cmdsynopsis >
<command > playlistsearch</command>
<arg choice= "req" > <replaceable > TAG</replaceable> </arg>
<arg choice= "req" > <replaceable > NEEDLE</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
2015-01-16 17:27:19 +01:00
Searches case-insensitively for partial matches in the
2008-11-20 22:18:50 +01:00
current playlist.
</para>
</listitem>
</varlistentry>
2008-11-19 21:16:19 +01:00
<varlistentry id= "command_plchanges" >
<term >
<cmdsynopsis >
<command > plchanges</command>
<arg choice= "req" > <replaceable > VERSION</replaceable> </arg>
2015-10-27 20:35:40 +01:00
<arg > <replaceable > START:END</replaceable> </arg>
2008-11-19 21:16:19 +01:00
</cmdsynopsis>
</term>
<listitem >
<para >
Displays changed songs currently in the playlist since
2015-10-27 20:35:40 +01:00
<varname > VERSION</varname> . Start and end positions may
be given to limit the output to changes in the given
range.
2008-11-19 21:16:19 +01:00
</para>
<para >
To detect songs that were deleted at the end of the
playlist, use playlistlength returned by status command.
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_plchangesposid" >
<term >
<cmdsynopsis >
<command > plchangesposid</command>
<arg choice= "req" > <replaceable > VERSION</replaceable> </arg>
2015-10-27 20:35:40 +01:00
<arg > <replaceable > START:END</replaceable> </arg>
2008-11-19 21:16:19 +01:00
</cmdsynopsis>
</term>
<listitem >
<para >
Displays changed songs currently in the playlist since
<varname > VERSION</varname> . This function only
returns the position and the id of the changed song, not
the complete metadata. This is more bandwidth efficient.
</para>
<para >
To detect songs that were deleted at the end of the
playlist, use playlistlength returned by status command.
</para>
</listitem>
</varlistentry>
2011-07-19 00:34:33 +02:00
<varlistentry id= "command_prio" >
<term >
<cmdsynopsis >
<command > prio</command>
<arg choice= "req" > <replaceable > PRIORITY</replaceable> </arg>
<arg choice= "req" rep= "repeat" > <replaceable > START:END</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Set the priority of the specified songs. A higher
priority means that it will be played first when
"random" mode is enabled.
</para>
<para >
A priority is an integer between 0 and 255. The default
priority of new songs is 0.
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_prioid" >
<term >
<cmdsynopsis >
<command > prioid</command>
<arg choice= "req" > <replaceable > PRIORITY</replaceable> </arg>
<arg choice= "req" rep= "repeat" > <replaceable > ID</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Same as <link
linkend="command_prio"><command > prio</command> </link> ,
but address the songs with their id.
</para>
</listitem>
</varlistentry>
2014-07-12 03:00:01 +02:00
<varlistentry id= "command_rangeid" >
<term >
<cmdsynopsis >
<command > rangeid</command>
<arg choice= "req" > <replaceable > ID</replaceable> </arg>
<arg choice= "req" > <replaceable > START:END</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
2014-10-10 23:22:37 +02:00
<footnote id= "since_0_19" > <simpara > Since <application > MPD</application>
2014-07-12 03:00:01 +02:00
0.19</simpara> </footnote> Specifies the portion of the
song that shall be played. <varname > START</varname> and
<varname > END</varname> are offsets in seconds
(fractional seconds allowed); both are optional.
Omitting both (i.e. sending just ":") means "remove the
range, play everything". A song that is currently
playing cannot be manipulated this way.
</para>
</listitem>
</varlistentry>
2008-11-19 21:16:19 +01:00
<varlistentry id= "command_shuffle" >
<term >
<cmdsynopsis >
<command > shuffle</command>
2009-03-26 15:47:51 +01:00
<arg > <replaceable > START:END</replaceable> </arg>
2008-11-19 21:16:19 +01:00
</cmdsynopsis>
</term>
<listitem >
<para >
Shuffles the current playlist.
2009-03-26 15:47:51 +01:00
<varname > START:END</varname> is optional and specifies
2009-02-13 10:38:32 +01:00
a range of songs.
2008-11-19 21:16:19 +01:00
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_swap" >
<term >
<cmdsynopsis >
<command > swap</command>
<arg choice= "req" > <replaceable > SONG1</replaceable> </arg>
<arg choice= "req" > <replaceable > SONG2</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
2008-11-20 22:16:54 +01:00
Swaps the positions of <varname > SONG1</varname> and
2008-11-19 21:16:19 +01:00
<varname > SONG2</varname> .
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_swapid" >
<term >
<cmdsynopsis >
<command > swapid</command>
<arg choice= "req" > <replaceable > SONG1</replaceable> </arg>
<arg choice= "req" > <replaceable > SONG2</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
2008-11-20 22:16:54 +01:00
Swaps the positions of <varname > SONG1</varname> and
2008-11-19 21:16:19 +01:00
<varname > SONG2</varname> (both song ids).
</para>
</listitem>
</varlistentry>
2013-12-02 12:00:32 +01:00
<varlistentry id= "command_addtagid" >
<term >
<cmdsynopsis >
<command > addtagid</command>
<arg choice= "req" > <replaceable > SONGID</replaceable> </arg>
<arg choice= "req" > <replaceable > TAG</replaceable> </arg>
<arg choice= "req" > <replaceable > VALUE</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Adds a tag to the specified song. Editing song tags is
only possible for remote songs. This change is
volatile: it may be overwritten by tags received from
the server, and the data is gone when the song gets
removed from the queue.
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_cleartagid" >
<term >
<cmdsynopsis >
<command > cleartagid</command>
<arg choice= "req" > <replaceable > SONGID</replaceable> </arg>
<arg choice= "opt" > <replaceable > TAG</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Removes tags from the specified song. If
<varname > TAG</varname> is not specified, then all tag
values will be removed. Editing song tags is only
possible for remote songs.
</para>
</listitem>
</varlistentry>
2008-11-19 21:16:19 +01:00
</variablelist>
</section>
2014-09-02 13:50:47 +02:00
<section id= "playlist_files" >
2008-11-19 21:16:19 +01:00
<title > Stored playlists</title>
2010-02-08 10:19:43 +01:00
<para >
Playlists are stored inside the configured playlist directory.
They are addressed with their file name (without the directory
and without the <filename > .m3u</filename> suffix).
</para>
<para >
Some of the commands described in this section can be used to
run playlist plugins instead of the hard-coded simple
<filename > m3u</filename> parser. They can access playlists in
the music directory (relative path including the suffix) or
remote playlists (absolute URI with a supported scheme).
</para>
2008-11-19 21:16:19 +01:00
<variablelist >
2008-11-20 22:18:50 +01:00
<varlistentry id= "command_listplaylist" >
2008-11-19 21:16:19 +01:00
<term >
<cmdsynopsis >
2008-11-20 22:18:50 +01:00
<command > listplaylist</command>
2008-11-19 21:16:19 +01:00
<arg choice= "req" > <replaceable > NAME</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
2010-02-08 10:19:43 +01:00
Lists the songs in the playlist. Playlist plugins are
supported.
2008-11-20 22:18:50 +01:00
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_listplaylistinfo" >
<term >
<cmdsynopsis >
<command > listplaylistinfo</command>
<arg choice= "req" > <replaceable > NAME</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
2010-02-08 10:19:43 +01:00
Lists the songs with metadata in the playlist. Playlist
plugins are supported.
2008-11-19 21:16:19 +01:00
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_listplaylists" >
<term >
<cmdsynopsis >
<command > listplaylists</command>
</cmdsynopsis>
</term>
<listitem >
<para >
Prints a list of the playlist directory.
</para>
<para >
2008-11-20 22:16:54 +01:00
After each playlist name the server sends its last
2008-11-19 21:16:19 +01:00
modification time as attribute "Last-Modified" in ISO
8601 format. To avoid problems due to clock differences
between clients and the server, clients should not
compare this value with their local clock.
</para>
</listitem>
</varlistentry>
2008-11-20 22:18:50 +01:00
<varlistentry id= "command_load" >
<term >
<cmdsynopsis >
<command > load</command>
<arg choice= "req" > <replaceable > NAME</replaceable> </arg>
2012-02-09 23:52:51 +01:00
<arg choice= "opt" > <replaceable > START:END</replaceable> </arg>
2008-11-20 22:18:50 +01:00
</cmdsynopsis>
</term>
<listitem >
<para >
2010-02-08 10:19:43 +01:00
Loads the playlist into the current queue. Playlist
2012-02-09 23:52:51 +01:00
plugins are supported. A range may be specified to load
only a part of the playlist.
2008-11-20 22:18:50 +01:00
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_playlistadd" >
<term >
<cmdsynopsis >
<command > playlistadd</command>
<arg choice= "req" > <replaceable > NAME</replaceable> </arg>
<arg choice= "req" > <replaceable > URI</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Adds <varname > URI</varname> to the playlist
<filename > NAME.m3u</filename> .
</para>
<para >
<filename > NAME.m3u</filename> will be created if it does
not exist.
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_playlistclear" >
<term >
<cmdsynopsis >
<command > playlistclear</command>
<arg choice= "req" > <replaceable > NAME</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Clears the playlist <filename > NAME.m3u</filename> .
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_playlistdelete" >
<term >
<cmdsynopsis >
<command > playlistdelete</command>
<arg choice= "req" > <replaceable > NAME</replaceable> </arg>
2008-12-24 23:54:09 +01:00
<arg choice= "req" > <replaceable > SONGPOS</replaceable> </arg>
2008-11-20 22:18:50 +01:00
</cmdsynopsis>
</term>
<listitem >
<para >
2008-12-24 23:54:09 +01:00
Deletes <varname > SONGPOS</varname> from the
2008-11-20 22:18:50 +01:00
playlist <filename > NAME.m3u</filename> .
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_playlistmove" >
<term >
<cmdsynopsis >
<command > playlistmove</command>
<arg choice= "req" > <replaceable > NAME</replaceable> </arg>
2015-08-23 15:20:14 +02:00
<arg choice= "req" > <replaceable > FROM</replaceable> </arg>
<arg choice= "req" > <replaceable > TO</replaceable> </arg>
2008-11-20 22:18:50 +01:00
</cmdsynopsis>
</term>
<listitem >
<para >
2015-08-23 15:20:14 +02:00
Moves the song at position <varname > FROM</varname> in
the playlist <filename > NAME.m3u</filename> to the
position <varname > TO</varname> .
2008-11-20 22:18:50 +01:00
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_rename" >
<term >
<cmdsynopsis >
<command > rename</command>
<arg choice= "req" > <replaceable > NAME</replaceable> </arg>
<arg choice= "req" > <replaceable > NEW_NAME</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Renames the playlist <filename > NAME.m3u</filename> to <filename > NEW_NAME.m3u</filename> .
</para>
</listitem>
</varlistentry>
2008-11-19 21:16:19 +01:00
<varlistentry id= "command_rm" >
<term >
<cmdsynopsis >
<command > rm</command>
<arg choice= "req" > <replaceable > NAME</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Removes the playlist <filename > NAME.m3u</filename> from
the playlist directory.
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_save" >
<term >
<cmdsynopsis >
<command > save</command>
<arg choice= "req" > <replaceable > NAME</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Saves the current playlist to
<filename > NAME.m3u</filename> in the playlist directory.
</para>
</listitem>
</varlistentry>
</variablelist>
</section>
2014-09-02 13:50:47 +02:00
<section id= "database" >
2008-11-19 21:16:19 +01:00
<title > The music database</title>
<variablelist >
2017-07-21 11:49:28 +02:00
<varlistentry id= "album_art" >
<term >
<cmdsynopsis >
<command > albumart</command>
<arg choice= "req" > <replaceable > URI</replaceable> </arg>
<arg choice= "req" > <replaceable > OFFSET</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Searches the directory the file <varname > URI</varname>
resides in and attempts to return a chunk of an album
art image file at offset <varname > OFFSET</varname> .
</para>
<para >
Uses the filename "cover" with any of ".png, .jpg,
.tiff, .bmp".
</para>
<para >
Returns the file size and actual number
of bytes read at the requested offset, followed
by the chunk requested as raw bytes, then a
newline and the completion code.
</para>
<para >
Example:
</para>
<programlisting > albumart
size: 1024768
binary: 8192
< 8192 bytes>
OK
</programlisting>
</listitem>
</varlistentry>
2014-04-26 23:15:31 +02:00
2008-11-20 22:18:50 +01:00
<varlistentry id= "command_count" >
<term >
<cmdsynopsis >
<command > count</command>
<arg choice= "req" > <replaceable > TAG</replaceable> </arg>
<arg choice= "req" > <replaceable > NEEDLE</replaceable> </arg>
2014-11-24 07:35:20 +01:00
<arg choice= "opt" > <replaceable > ...</replaceable> </arg>
2014-04-26 23:15:31 +02:00
<arg choice= "opt" > group</arg>
<arg choice= "opt" > <replaceable > GROUPTYPE</replaceable> </arg>
2008-11-20 22:18:50 +01:00
</cmdsynopsis>
</term>
<listitem >
<para >
Counts the number of songs and their total playtime in
the db matching <varname > TAG</varname> exactly.
</para>
2014-04-26 23:15:31 +02:00
<para >
The <parameter > group</parameter> keyword may be used to
group the results by a tag. The following prints
per-artist counts:
</para>
<programlisting > count group artist</programlisting>
2008-11-20 22:18:50 +01:00
</listitem>
</varlistentry>
2014-04-26 23:15:31 +02:00
2008-11-19 21:16:19 +01:00
<varlistentry id= "command_find" >
<term >
<cmdsynopsis >
<command > find</command>
<arg choice= "req" > <replaceable > TYPE</replaceable> </arg>
<arg choice= "req" > <replaceable > WHAT</replaceable> </arg>
2010-08-29 10:49:19 +02:00
<arg choice= "opt" > <replaceable > ...</replaceable> </arg>
2017-02-08 09:22:15 +01:00
<arg choice= "opt" > sort <replaceable > TYPE</replaceable> </arg>
2014-11-18 14:31:27 +01:00
<arg choice= "opt" > window <replaceable > START</replaceable> :<replaceable > END</replaceable> </arg>
2008-11-19 21:16:19 +01:00
</cmdsynopsis>
</term>
<listitem >
<para >
2008-11-20 22:16:54 +01:00
Finds songs in the db that are exactly
2010-08-29 10:49:19 +02:00
<varname > WHAT</varname> . <varname > TYPE</varname> can
2014-10-10 23:22:37 +02:00
be any tag supported by <application > MPD</application> , or one of the special
2014-08-11 22:38:53 +02:00
parameters:
</para>
<itemizedlist >
<listitem >
<para >
<parameter > any</parameter> checks all tag values
</para>
</listitem>
<listitem >
<para >
<parameter > file</parameter> checks the full path
(relative to the music directory)
</para>
</listitem>
<listitem >
<para >
<parameter > base</parameter> restricts the search to
songs in the given directory (also relative to the
music directory)
</para>
</listitem>
2014-08-11 22:08:26 +02:00
<listitem >
<para >
<parameter > modified-since</parameter> compares the
file's time stamp with the given value (ISO 8601 or
UNIX time stamp)
</para>
</listitem>
2014-08-11 22:38:53 +02:00
</itemizedlist>
<para >
<varname > WHAT</varname> is what to find.
2008-11-19 21:16:19 +01:00
</para>
2014-11-18 14:31:27 +01:00
2017-02-08 09:22:15 +01:00
<para >
<varname > sort</varname> sorts the result by the
specified tag. Without <varname > sort</varname> , the
order is undefined. Only the first tag value will be
used, if multiple of the same type exist. To sort by
"Artist", "Album" or "AlbumArtist", you should specify
"ArtistSort", "AlbumSort" or "AlbumArtistSort" instead.
These will automatically fall back to the former if
"*Sort" doesn't exist. "AlbumArtist" falls back to just
"Artist".
</para>
2014-11-18 14:31:27 +01:00
<para >
<varname > window</varname> can be used to query only a
portion of the real response. The parameter is two
zero-based record numbers; a start number and an end
number.
</para>
2008-11-19 21:16:19 +01:00
</listitem>
</varlistentry>
2009-08-25 13:43:22 +02:00
<varlistentry id= "command_findadd" >
<term >
<cmdsynopsis >
<command > findadd</command>
<arg choice= "req" > <replaceable > TYPE</replaceable> </arg>
<arg choice= "req" > <replaceable > WHAT</replaceable> </arg>
2010-08-29 10:49:19 +02:00
<arg choice= "opt" > <replaceable > ...</replaceable> </arg>
2009-08-25 13:43:22 +02:00
</cmdsynopsis>
</term>
<listitem >
<para >
Finds songs in the db that are exactly
<varname > WHAT</varname> and adds them to current playlist.
2010-08-29 10:49:19 +02:00
Parameters have the same meaning as for <command > find</command> .
2009-08-25 13:43:22 +02:00
</para>
</listitem>
</varlistentry>
2014-04-24 08:08:52 +02:00
2008-11-19 21:16:19 +01:00
<varlistentry id= "command_list" >
<term >
<cmdsynopsis >
<command > list</command>
<arg choice= "req" > <replaceable > TYPE</replaceable> </arg>
2014-04-24 08:08:52 +02:00
<arg choice= "opt" > <replaceable > FILTERTYPE</replaceable> </arg>
<arg choice= "opt" > <replaceable > FILTERWHAT</replaceable> </arg>
<arg choice= "opt" > <replaceable > ...</replaceable> </arg>
2014-04-24 10:20:24 +02:00
<arg choice= "opt" > group</arg>
<arg choice= "opt" > <replaceable > GROUPTYPE</replaceable> </arg>
<arg choice= "opt" > <replaceable > ...</replaceable> </arg>
2008-11-19 21:16:19 +01:00
</cmdsynopsis>
</term>
<listitem >
<para >
2014-04-24 08:08:52 +02:00
Lists unique tags values of the specified type.
2014-10-10 23:22:37 +02:00
<varname > TYPE</varname> can be any tag supported by
<application > MPD</application> or
2010-08-29 10:49:19 +02:00
<parameter > file</parameter> .
2008-11-19 21:16:19 +01:00
</para>
<para >
2014-04-24 08:08:52 +02:00
Additional arguments may specify a filter like the one
in the <link
linkend="command_find"><command > find</command>
command</link> .
2008-11-19 21:16:19 +01:00
</para>
2014-04-24 10:20:24 +02:00
<para >
The <parameter > group</parameter> keyword may be used
(repeatedly) to group the results by one or more tags.
The following example lists all album names,
grouped by their respective (album) artist:
</para>
<programlisting > list album group albumartist</programlisting>
2008-11-19 21:16:19 +01:00
</listitem>
</varlistentry>
2014-04-24 08:08:52 +02:00
2008-11-19 21:16:19 +01:00
<varlistentry id= "command_listall" >
<term >
<cmdsynopsis >
<command > listall</command>
<arg > <replaceable > URI</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Lists all songs and directories in
<varname > URI</varname> .
</para>
2014-04-29 10:31:14 +02:00
<para >
Do not use this command. Do not manage a client-side
2014-10-10 23:22:37 +02:00
copy of <application > MPD</application> 's database. That
is fragile and adds huge overhead. It will break with
large databases. Instead, query
<application > MPD</application> whenever you need
something.
2014-04-29 10:31:14 +02:00
</para>
2008-11-19 21:16:19 +01:00
</listitem>
</varlistentry>
<varlistentry id= "command_listallinfo" >
<term >
<cmdsynopsis >
<command > listallinfo</command>
<arg > <replaceable > URI</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Same as <command > listall</command> , except it also
returns metadata info in the same format as
<command > lsinfo</command> .
2014-04-29 10:31:14 +02:00
</para>
<para >
Do not use this command. Do not manage a client-side
2014-10-10 23:22:37 +02:00
copy of <application > MPD</application> 's database. That
is fragile and adds huge overhead. It will break with
large databases. Instead, query
<application > MPD</application> whenever you need
something.
2008-11-19 21:16:19 +01:00
</para>
</listitem>
</varlistentry>
2014-02-28 19:02:23 +01:00
<varlistentry id= "command_listfiles" >
<term >
<cmdsynopsis >
<command > listfiles</command>
<arg > <replaceable > URI</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Lists the contents of the directory
<varname > URI</varname> , including files are not
2014-10-10 23:22:37 +02:00
recognized by <application > MPD</application> .
<varname > URI</varname> can be a path relative to the
music directory or an URI understood by one of the
storage plugins. The response contains at least one
line for each directory entry with the prefix "file: "
or "directory: ", and may be followed by file attributes
such as "Last-Modified" and "size".
2014-02-28 19:02:23 +01:00
</para>
<para >
For example, "smb://SERVER" returns a list of all shares
on the given SMB/CIFS server; "nfs://servername/path"
obtains a directory listing from the NFS server.
</para>
</listitem>
</varlistentry>
2008-11-19 21:16:19 +01:00
<varlistentry id= "command_lsinfo" >
<term >
<cmdsynopsis >
<command > lsinfo</command>
<arg > <replaceable > URI</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
2008-11-20 22:16:54 +01:00
Lists the contents of the directory
<varname > URI</varname> .
2008-11-19 21:16:19 +01:00
</para>
<para >
When listing the root directory, this currently returns
the list of stored playlists. This behavior is
deprecated; use "listplaylists" instead.
</para>
2013-12-29 14:40:24 +01:00
<para >
This command may be used to list metadata of remote
files (e.g. URI beginning with "http://" or "smb://").
</para>
2012-03-06 21:35:05 +01:00
<para >
Clients that are connected via UNIX domain socket may
use this command to read the tags of an arbitrary local
2015-02-09 07:55:06 +01:00
file (URI is an absolute path).
2012-03-06 21:35:05 +01:00
</para>
2008-11-19 21:16:19 +01:00
</listitem>
</varlistentry>
2013-10-25 19:35:40 +02:00
<varlistentry id= "command_readcomments" >
<term >
<cmdsynopsis >
<command > readcomments</command>
<arg > <replaceable > URI</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Read "comments" (i.e. key-value pairs) from the file
specified by "URI". This "URI" can be a path relative
2015-02-09 07:55:06 +01:00
to the music directory or an absolute path.
2013-10-25 19:35:40 +02:00
</para>
2013-12-29 14:40:24 +01:00
<para >
This command may be used to list metadata of remote
files (e.g. URI beginning with "http://" or "smb://").
</para>
2013-10-25 19:35:40 +02:00
<para >
The response consists of lines in the form "KEY: VALUE".
Comments with suspicious characters (e.g. newlines) are
ignored silently.
</para>
<para >
The meaning of these depends on the codec, and not all
decoder plugins support it. For example, on Ogg files,
this lists the Vorbis comments.
</para>
</listitem>
</varlistentry>
2008-11-19 21:16:19 +01:00
<varlistentry id= "command_search" >
<term >
<cmdsynopsis >
<command > search</command>
<arg choice= "req" > <replaceable > TYPE</replaceable> </arg>
<arg choice= "req" > <replaceable > WHAT</replaceable> </arg>
2010-08-29 10:49:19 +02:00
<arg choice= "opt" > <replaceable > ...</replaceable> </arg>
2017-02-08 09:22:15 +01:00
<arg choice= "opt" > sort <replaceable > TYPE</replaceable> </arg>
2014-11-18 14:31:27 +01:00
<arg choice= "opt" > window <replaceable > START</replaceable> :<replaceable > END</replaceable> </arg>
2008-11-19 21:16:19 +01:00
</cmdsynopsis>
</term>
<listitem >
<para >
2008-11-20 22:16:54 +01:00
Searches for any song that contains
2010-08-29 10:49:19 +02:00
<varname > WHAT</varname> . Parameters have the same meaning
as for <command > find</command> , except that search is not
case sensitive.
2008-11-19 21:16:19 +01:00
</para>
</listitem>
</varlistentry>
2012-06-27 09:26:05 +02:00
<varlistentry id= "command_searchadd" >
<term >
<cmdsynopsis >
<command > searchadd</command>
<arg choice= "req" > <replaceable > TYPE</replaceable> </arg>
<arg choice= "req" > <replaceable > WHAT</replaceable> </arg>
<arg choice= "opt" > <replaceable > ...</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Searches for any song that contains <varname > WHAT</varname>
in tag <varname > TYPE</varname> and adds them to current playlist.
</para>
<para >
Parameters have the same meaning as for <command > find</command> ,
except that search is not case sensitive.
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_searchaddpl" >
<term >
<cmdsynopsis >
<command > searchaddpl</command>
<arg choice= "req" > <replaceable > NAME</replaceable> </arg>
<arg choice= "req" > <replaceable > TYPE</replaceable> </arg>
<arg choice= "req" > <replaceable > WHAT</replaceable> </arg>
<arg choice= "opt" > <replaceable > ...</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Searches for any song that contains <varname > WHAT</varname>
in tag <varname > TYPE</varname> and adds them to the playlist
named <varname > NAME</varname> .
</para>
<para >
If a playlist by that name doesn't exist it is created.
</para>
<para >
Parameters have the same meaning as for <command > find</command> ,
except that search is not case sensitive.
</para>
</listitem>
</varlistentry>
2008-11-19 21:16:19 +01:00
<varlistentry id= "command_update" >
<term >
<cmdsynopsis >
<command > update</command>
2009-09-10 19:54:15 +02:00
<arg choice= "opt" > <replaceable > URI</replaceable> </arg>
2008-11-19 21:16:19 +01:00
</cmdsynopsis>
</term>
<listitem >
<para >
2009-09-10 19:54:15 +02:00
Updates the music database: find new files, remove
deleted files, update modified files.
2008-11-19 21:16:19 +01:00
</para>
<para >
<varname > URI</varname> is a particular directory or
2009-09-10 19:54:15 +02:00
song/file to update. If you do not specify it,
everything is updated.
2008-11-19 21:16:19 +01:00
</para>
<para >
Prints "updating_db: JOBID" where
2009-09-10 19:54:15 +02:00
<varname > JOBID</varname> is a positive number
identifying the update job. You can read the current
job id in the <command > status</command> response.
2008-11-19 21:16:19 +01:00
</para>
</listitem>
</varlistentry>
2009-09-24 21:55:40 +02:00
<varlistentry id= "command_rescan" >
<term >
<cmdsynopsis >
<command > rescan</command>
<arg choice= "opt" > <replaceable > URI</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Same as <command > update</command> , but also rescans
unmodified files.
</para>
</listitem>
</varlistentry>
2008-11-19 21:16:19 +01:00
</variablelist>
</section>
2014-10-10 23:20:50 +02:00
<section id= "mount" >
<title > Mounts and neighbors</title>
<para >
A "storage" provides access to files in a directory tree. The
most basic storage plugin is the "local" storage plugin which
accesses the local file system, and there are plugins to
access NFS and SMB servers.
</para>
<para >
Multiple storages can be "mounted" together, similar to the
<application > mount</application> command on many operating
systems, but without cooperation from the kernel. No
superuser privileges are necessary, beause this mapping exists
only inside the <application > MPD</application> process
</para>
<variablelist >
<varlistentry id= "command_mount" >
<term >
<cmdsynopsis >
<command > mount</command>
<arg choice= "req" > <replaceable > PATH</replaceable> </arg>
<arg choice= "req" > <replaceable > URI</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Mount the specified remote storage URI at the given
path. Example:
</para>
<programlisting > mount foo nfs://192.168.1.4/export/mp3</programlisting>
</listitem>
</varlistentry>
<varlistentry id= "command_umount" >
<term >
<cmdsynopsis >
<command > unmount</command>
<arg choice= "req" > <replaceable > PATH</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Unmounts the specified path. Example:
</para>
<programlisting > unmount foo</programlisting>
</listitem>
</varlistentry>
<varlistentry id= "command_listmounts" >
<term >
<cmdsynopsis >
<command > listmounts</command>
</cmdsynopsis>
</term>
<listitem >
<para >
Queries a list of all mounts. By default, this contains
just the configured <varname > music_directory</varname> .
Example:
</para>
<programlisting > listmounts
mount:
storage: /home/foo/music
mount: foo
storage: nfs://192.168.1.4/export/mp3
OK
</programlisting>
</listitem>
</varlistentry>
<varlistentry id= "command_listneighbors" >
<term >
<cmdsynopsis >
<command > listneighbors</command>
</cmdsynopsis>
</term>
<listitem >
<para >
Queries a list of "neighbors" (e.g. accessible file
servers on the local net). Items on that list may be
used with the <link
linkend="command_mount"><command > mount</command> </link>
command. Example:
</para>
<programlisting > listneighbors
neighbor: smb://FOO
name: FOO (Samba 4.1.11-Debian)
OK
</programlisting>
</listitem>
</varlistentry>
</variablelist>
</section>
2014-09-02 13:50:47 +02:00
<section id= "stickers" >
2009-01-19 19:09:49 +01:00
<title > Stickers</title>
<para >
2009-06-02 20:47:00 +02:00
"Stickers"<footnoteref linkend= "since_0_15" /> are pieces of
2014-10-10 23:22:37 +02:00
information attached to existing
<application > MPD</application> objects (e.g. song files,
2009-06-02 20:47:00 +02:00
directories, albums). Clients can create arbitrary name/value
2014-10-10 23:22:37 +02:00
pairs. <application > MPD</application> itself does not assume
any special meaning in them.
2009-01-19 19:09:49 +01:00
</para>
<para >
The goal is to allow clients to share additional (possibly
dynamic) information about songs, which is neither stored on
the client (not available to other clients), nor stored in the
2014-10-10 23:22:37 +02:00
song files (<application > MPD</application> has no write
access).
2009-01-19 19:09:49 +01:00
</para>
<para >
Client developers should create a standard for common sticker
names, to ensure interoperability.
</para>
<para >
Objects which may have stickers are addressed by their object
type ("song" for song objects) and their URI (the path within
the database for songs).
</para>
<variablelist >
<varlistentry id= "command_sticker_get" >
<term >
<cmdsynopsis >
<command > sticker</command>
<arg choice= "plain" > get</arg>
<arg choice= "req" > <replaceable > TYPE</replaceable> </arg>
<arg choice= "req" > <replaceable > URI</replaceable> </arg>
<arg choice= "req" > <replaceable > NAME</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Reads a sticker value for the specified object.
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_sticker_set" >
<term >
<cmdsynopsis >
<command > sticker</command>
<arg choice= "plain" > set</arg>
<arg choice= "req" > <replaceable > TYPE</replaceable> </arg>
<arg choice= "req" > <replaceable > URI</replaceable> </arg>
<arg choice= "req" > <replaceable > NAME</replaceable> </arg>
<arg choice= "req" > <replaceable > VALUE</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Adds a sticker value to the specified object. If a
sticker item with that name already exists, it is
replaced.
</para>
</listitem>
</varlistentry>
2009-04-28 20:25:07 +02:00
<varlistentry id= "command_sticker_delete" >
<term >
<cmdsynopsis >
<command > sticker</command>
<arg choice= "plain" > delete</arg>
<arg choice= "req" > <replaceable > TYPE</replaceable> </arg>
<arg choice= "req" > <replaceable > URI</replaceable> </arg>
<arg choice= "opt" > <replaceable > NAME</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Deletes a sticker value from the specified object. If
you do not specify a sticker name, all sticker values
are deleted.
</para>
</listitem>
</varlistentry>
2009-03-03 07:49:23 +01:00
<varlistentry id= "command_sticker_list" >
<term >
<cmdsynopsis >
<command > sticker</command>
<arg choice= "plain" > list</arg>
<arg choice= "req" > <replaceable > TYPE</replaceable> </arg>
<arg choice= "req" > <replaceable > URI</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Lists the stickers for the specified object.
</para>
</listitem>
</varlistentry>
2009-04-01 18:53:02 +02:00
<varlistentry id= "command_sticker_find" >
<term >
<cmdsynopsis >
<command > sticker</command>
<arg choice= "plain" > find</arg>
<arg choice= "req" > <replaceable > TYPE</replaceable> </arg>
<arg choice= "req" > <replaceable > URI</replaceable> </arg>
<arg choice= "req" > <replaceable > NAME</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Searches the sticker database for stickers with the
specified name, below the specified directory (URI).
For each matching song, it prints the URI and that one
sticker's value.
</para>
</listitem>
</varlistentry>
2014-12-12 22:12:19 +01:00
<varlistentry id= "command_sticker_find_equals" >
<term >
<cmdsynopsis >
<command > sticker</command>
<arg choice= "plain" > find</arg>
<arg choice= "req" > <replaceable > TYPE</replaceable> </arg>
<arg choice= "req" > <replaceable > URI</replaceable> </arg>
<arg choice= "req" > <replaceable > NAME</replaceable> </arg>
<arg choice= "plain" > =</arg>
<arg choice= "req" > <replaceable > VALUE</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Searches for stickers with the given value.
</para>
2014-12-12 22:26:04 +01:00
<para >
Other supported operators are:
"<function > < </function> ", "<function > > </function> "
</para>
2014-12-12 22:12:19 +01:00
</listitem>
</varlistentry>
2009-01-19 19:09:49 +01:00
</variablelist>
</section>
2014-09-02 13:50:47 +02:00
<section id= "connection_commands" >
2008-11-19 21:16:19 +01:00
<title > Connection settings</title>
<variablelist >
<varlistentry id= "command_close" >
<term >
<cmdsynopsis >
<command > close</command>
</cmdsynopsis>
</term>
<listitem >
<para >
2014-10-10 23:22:37 +02:00
Closes the connection to <application > MPD</application> .
<application > MPD</application> will try to send the
2013-11-07 18:41:53 +01:00
remaining output buffer before it actually closes the
connection, but that cannot be guaranteed. This command
will not generate a response.
2008-11-19 21:16:19 +01:00
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_kill" >
<term >
<cmdsynopsis >
<command > kill</command>
</cmdsynopsis>
</term>
<listitem >
<para >
2014-10-10 23:22:37 +02:00
Kills <application > MPD</application> .
2008-11-19 21:16:19 +01:00
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_password" >
<term >
<cmdsynopsis >
<command > password</command>
<arg choice= "req" > <replaceable > PASSWORD</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
This is used for authentication with the server.
<varname > PASSWORD</varname> is simply the plaintext
password.
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_ping" >
<term >
<cmdsynopsis >
<command > ping</command>
</cmdsynopsis>
</term>
<listitem >
<para >
Does nothing but return "OK".
</para>
</listitem>
</varlistentry>
2017-02-07 16:52:59 +01:00
<varlistentry id= "command_tagtypes" >
<term >
<cmdsynopsis >
<command > tagtypes</command>
</cmdsynopsis>
</term>
<listitem >
<para >
Shows a list of available tag types. It is an
intersection of the <varname > metadata_to_use</varname>
setting and this client's tag mask.
</para>
<para >
About the tag mask: each client can decide to disable
any number of tag types, which will be omitted from
responses to this client. That is a good idea, because
it makes responses smaller. The following
<command > tagtypes</command> sub commands configure this
list.
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_tagtypes_disable" >
<term >
<cmdsynopsis >
<command > tagtypes</command>
<arg choice= "plain" > disable</arg>
<arg choice= "req" rep= "repeat" > <replaceable > NAME</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Remove one or more tags from the list of tag types the
client is interested in. These will be omitted from
responses to this client.
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_tagtypes_enable" >
<term >
<cmdsynopsis >
<command > tagtypes</command>
<arg choice= "plain" > enable</arg>
<arg choice= "req" rep= "repeat" > <replaceable > NAME</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Re-enable one or more tags from the list of tag types
for this client. These will no longer be hidden from
responses to this client.
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_tagtypes_clear" >
<term >
<cmdsynopsis >
<command > tagtypes</command>
<arg choice= "plain" > clear</arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Clear the list of tag types this client is interested
in. This means that <application > MPD</application> will
not send any tags to this client.
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_tagtypes_all" >
<term >
<cmdsynopsis >
<command > tagtypes</command>
<arg choice= "plain" > all</arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Announce that this client is interested in all tag
types. This is the default setting for new clients.
</para>
</listitem>
</varlistentry>
2008-11-19 21:16:19 +01:00
</variablelist>
</section>
2008-11-20 22:18:50 +01:00
2017-02-17 23:07:31 +01:00
<section id= "partition_commands" >
<title > Partition commands</title>
<para >
These commands allow a client to inspect and manage
"partitions". A partition is one frontend of a multi-player
MPD process: it has separate queue, player and outputs. A
client is assigned to one partition at a time.
</para>
<variablelist >
2017-02-20 12:37:14 +01:00
<varlistentry id= "command_partition" >
<term >
<cmdsynopsis >
<command > partition</command>
<arg choice= "req" > <replaceable > NAME</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Switch the client to a different partition.
</para>
</listitem>
</varlistentry>
2017-02-17 23:07:31 +01:00
<varlistentry id= "command_listpartitions" >
<term >
<cmdsynopsis >
<command > listpartitions</command>
</cmdsynopsis>
</term>
<listitem >
<para >
Print a list of partitions. Each partition starts with
a <varname > partition</varname> keyword and the
partition's name, followed by information about the
partition.
</para>
</listitem>
</varlistentry>
2017-02-17 23:38:30 +01:00
<varlistentry id= "command_newpartition" >
<term >
<cmdsynopsis >
<command > newpartition</command>
<arg choice= "req" > <replaceable > NAME</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Create a new partition.
</para>
</listitem>
</varlistentry>
2017-02-17 23:07:31 +01:00
</variablelist>
</section>
2014-09-02 13:50:47 +02:00
<section id= "output_commands" >
2008-11-20 22:18:50 +01:00
<title > Audio output devices</title>
<variablelist >
<varlistentry id= "command_disableoutput" >
<term >
<cmdsynopsis >
<command > disableoutput</command>
2011-10-19 23:32:19 +02:00
<arg choice= "req" > <replaceable > ID</replaceable> </arg>
2008-11-20 22:18:50 +01:00
</cmdsynopsis>
</term>
<listitem >
<para >
Turns an output off.
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_enableoutput" >
<term >
<cmdsynopsis >
<command > enableoutput</command>
2011-10-19 23:32:19 +02:00
<arg choice= "req" > <replaceable > ID</replaceable> </arg>
2008-11-20 22:18:50 +01:00
</cmdsynopsis>
</term>
<listitem >
<para >
Turns an output on.
</para>
</listitem>
</varlistentry>
2013-08-04 23:20:56 +02:00
<varlistentry id= "command_toggleoutput" >
<term >
<cmdsynopsis >
<command > toggleoutput</command>
<arg choice= "req" > <replaceable > ID</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Turns an output on or off, depending on the current
state.
</para>
</listitem>
</varlistentry>
2008-11-20 22:18:50 +01:00
<varlistentry id= "command_outputs" >
<term >
<cmdsynopsis >
<command > outputs</command>
</cmdsynopsis>
</term>
<listitem >
<para >
Shows information about all outputs.
</para>
2013-11-22 10:18:17 +01:00
<screen >
outputid: 0
outputname: My ALSA Device
outputenabled: 0
OK
</screen>
<para >
Return information:
</para>
<itemizedlist >
<listitem >
<para >
<varname > outputid</varname> : ID of the output. May change between executions
</para>
</listitem>
<listitem >
<para >
<varname > outputname</varname> : Name of the output. It can be any.
</para>
</listitem>
<listitem >
<para >
<varname > outputenabled</varname> : Status of the output. 0 if disabled, 1 if enabled.
</para>
</listitem>
</itemizedlist>
2008-11-20 22:18:50 +01:00
</listitem>
</varlistentry>
</variablelist>
</section>
2014-09-02 13:50:47 +02:00
<section id= "reflection_commands" >
2008-11-20 22:18:50 +01:00
<title > Reflection</title>
<variablelist >
2012-02-13 19:59:41 +01:00
<varlistentry id= "command_config" >
<term >
<cmdsynopsis >
<command > config</command>
</cmdsynopsis>
</term>
<listitem >
<para >
Dumps configuration values that may be interesting for
the client. This command is only permitted to "local"
clients (connected via UNIX domain socket).
</para>
<para >
The following response attributes are available:
</para>
<informaltable >
<tgroup cols= "2" >
<thead >
<row >
<entry >
Name
</entry>
<entry >
Description
</entry>
</row>
</thead>
<tbody >
<row >
<entry >
<varname > music_directory</varname>
</entry>
<entry >
The absolute path of the music directory.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</listitem>
</varlistentry>
2008-11-20 22:18:50 +01:00
<varlistentry id= "command_commands" >
<term >
<cmdsynopsis >
<command > commands</command>
</cmdsynopsis>
</term>
<listitem >
<para >
Shows which commands the current user has access to.
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_notcommands" >
<term >
<cmdsynopsis >
<command > notcommands</command>
</cmdsynopsis>
</term>
<listitem >
<para >
Shows which commands the current user does not have
access to.
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_urlhandlers" >
<term >
<cmdsynopsis >
<command > urlhandlers</command>
</cmdsynopsis>
</term>
<listitem >
<para >
Gets a list of available URL handlers.
</para>
</listitem>
</varlistentry>
2009-11-07 15:57:22 +01:00
<varlistentry id= "command_decoders" >
<term >
<cmdsynopsis >
<command > decoders</command>
</cmdsynopsis>
</term>
<listitem >
<para >
Print a list of decoder plugins, followed by their
supported suffixes and MIME types. Example response:
</para>
<programlisting > plugin: mad
suffix: mp3
suffix: mp2
mime_type: audio/mpeg
plugin: mpcdec
suffix: mpc</programlisting>
</listitem>
</varlistentry>
2008-11-20 22:18:50 +01:00
</variablelist>
</section>
2011-01-29 09:26:22 +01:00
2014-09-02 13:50:47 +02:00
<section id= "client_to_client" >
2011-01-29 09:26:22 +01:00
<title > Client to client</title>
<para >
Clients can communicate with each others over "channels". A
channel is created by a client subscribing to it. More than
one client can be subscribed to a channel at a time; all of
them will receive the messages which get sent to it.
</para>
<para >
Each time a client subscribes or unsubscribes, the global idle
event <varname > subscription</varname> is generated. In
conjunction with the <command > channels</command> command, this
may be used to auto-detect clients providing additional
services.
</para>
<para >
2012-02-15 21:17:19 +01:00
New messages are indicated by the <varname > message</varname>
2011-01-29 09:26:22 +01:00
idle event.
</para>
<variablelist >
<varlistentry id= "command_subscribe" >
<term >
<cmdsynopsis >
<command > subscribe</command>
<arg choice= "req" > <replaceable > NAME</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Subscribe to a channel. The channel is created if it
does not exist already. The name may consist of
alphanumeric ASCII characters plus underscore, dash, dot
and colon.
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_unsubscribe" >
<term >
<cmdsynopsis >
<command > unsubscribe</command>
<arg choice= "req" > <replaceable > NAME</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Unsubscribe from a channel.
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_channels" >
<term >
<cmdsynopsis >
<command > channels</command>
</cmdsynopsis>
</term>
<listitem >
<para >
Obtain a list of all channels. The response is a list
of "channel:" lines.
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_readmessages" >
<term >
<cmdsynopsis >
<command > readmessages</command>
</cmdsynopsis>
</term>
<listitem >
<para >
Reads messages for this client. The response is a list
of "channel:" and "message:" lines.
</para>
</listitem>
</varlistentry>
<varlistentry id= "command_sendmessage" >
<term >
<cmdsynopsis >
<command > sendmessage</command>
<arg choice= "req" > <replaceable > CHANNEL</replaceable> </arg>
<arg choice= "req" > <replaceable > TEXT</replaceable> </arg>
</cmdsynopsis>
</term>
<listitem >
<para >
Send a message to the specified channel.
</para>
</listitem>
</varlistentry>
</variablelist>
</section>
2008-11-19 21:16:19 +01:00
</chapter>
</book>