Commit 68894e82 authored by Max Kellermann's avatar Max Kellermann

doc/index.rst: fix the converted protocol documentation

Fix links and lots of broken markup.
parent 937f49f1
================================ ================================
The Music Player Daemon protocol The Music Player Daemon protocol
================================ ================================
...@@ -22,9 +20,9 @@ respond with one or more lines, the last of which will be a ...@@ -22,9 +20,9 @@ respond with one or more lines, the last of which will be a
completion code. completion code.
When the client connects to the server, the server will answer When the client connects to the server, the server will answer
with the following line: with the following line::
CMDSYN: OK MPD version OK MPD version
where ``version`` is a version identifier such as where ``version`` is a version identifier such as
0.12.2. This version identifier is the version of the protocol 0.12.2. This version identifier is the version of the protocol
...@@ -34,7 +32,9 @@ retrieve this real version identifier from the connection.) ...@@ -34,7 +32,9 @@ retrieve this real version identifier from the connection.)
Requests Requests
======== ========
``COMMAND [ARG...]`` .. code-block:: none
COMMAND [ARG...]
If arguments contain spaces, they should be surrounded by double If arguments contain spaces, they should be surrounded by double
quotation marks. quotation marks.
...@@ -59,7 +59,9 @@ The nature of the error can be gleaned from the information ...@@ -59,7 +59,9 @@ The nature of the error can be gleaned from the information
that follows the ``ACK``. that follows the ``ACK``.
``ACK`` lines are of the form: ``ACK`` lines are of the form:
CMDSYN: ACK [error@command_listNum] {current_command} message_text\n .. code-block:: none
ACK [error@command_listNum] {current_command} message_text
These responses are generated by a call to These responses are generated by a call to
``commandError``. They contain four separate ``commandError``. They contain four separate
...@@ -69,37 +71,35 @@ terms. Let's look at each of them: ...@@ -69,37 +71,35 @@ terms. Let's look at each of them:
of the ``ACK_ERROR`` constants defined of the ``ACK_ERROR`` constants defined
in `src/protocol/Ack.hxx`. in `src/protocol/Ack.hxx`.
- ``command_listNum``: - ``command_listNum``: offset of the command that caused the error in
offset of the command that caused the error in a `Command List <command_lists>`. a :ref:`Command List <command_lists>`. An error will always cause a
An error will always cause a command list to terminate command list to terminate at the command that causes the error.
at the command that causes the error.
- ``current_command``: - ``current_command``: name of the command, in a :ref:`Command List
name of the command, in a `Command List <command_lists>`, <command_lists>`, that was executing when the error occurred.
that was executing when the error occurred.
- ``message_text``: - ``message_text``:
some (hopefully) informative text that describes the some (hopefully) informative text that describes the
nature of the error. nature of the error.
foo An example might help. Consider the following sequence
~~~ sent from the client to the server::
An example might help. Consider the following sequence
sent from the client to the server.
CMDSYN: command_list_begin volume 86 play 10240 status command_list_end command_list_begin
volume 86
play 10240
status
command_list_end
The server responds with: The server responds with::
``ACK \[50@1] {play} song doesn't exist: "10240"`` ACK [50@1] {play} song doesn't exist: "10240"
This tells us that the play command, which was the This tells us that the play command, which was the second in the list
second in the list (the first or only command is (the first or only command is numbered 0), failed with error 50. The
numbered 0), failed with error 50. The number 50 number 50 translates to ``ACK_ERROR_NO_EXIST`` -- the song doesn't
translates to ``ACK_ERROR_NO_EXIST``--the exist. This is reiterated by the message text which also tells us
song doesn't exist. This is reiterated by the message text which song doesn't exist.
which also tells us which song doesn't exist.
.. _command_lists: .. _command_lists:
...@@ -125,26 +125,24 @@ successful command executed in the command list. ...@@ -125,26 +125,24 @@ successful command executed in the command list.
Ranges Ranges
====== ======
Some commands (e.g. `delete` <command_delete>`) Some commands (e.g. :ref:`delete <command_delete>`) allow specifying a
allow specifying a range in the form range in the form ``START:END`` (the ``END`` item is not included in
*START:END* (the ``END`` the range, similar to ranges in the Python programming language). If
item is not included in the range, similar to ranges in the ``END`` is omitted, then the maximum possible value is assumed.
Python programming language). If ``END`` is
omitted, then the maximum possible value is assumed.
.. _filter_syntax: .. _filter_syntax:
Filters Filters
======= =======
All commands which search for songs (e.g. `find` <command_find>` and All commands which search for songs (e.g. :ref:`find <command_find>`
`searchadd` <command_searchadd>`) and :ref:`searchadd <command_searchadd>`) share a common filter
share a common filter syntax: syntax::
CMDSYN: find EXPRESSION find EXPRESSION
``EXPRESSION`` is a string enclosed in ``EXPRESSION`` is a string enclosed in parantheses which can be one
parantheses which can be one of: of:
- ``(TAG == 'VALUE')``: match a tag value. - ``(TAG == 'VALUE')``: match a tag value.
``(TAG != 'VALUE')``: mismatch a tag value. ``(TAG != 'VALUE')``: mismatch a tag value.
...@@ -182,9 +180,9 @@ parantheses which can be one of: ...@@ -182,9 +180,9 @@ parantheses which can be one of:
- ``(EXPRESSION1 AND EXPRESSION2 ...)``: combine two or - ``(EXPRESSION1 AND EXPRESSION2 ...)``: combine two or
more expressions with logical "and". more expressions with logical "and".
Prior to MPD 0.21, the syntax looked like this: Prior to MPD 0.21, the syntax looked like this::
CMDSYN: find TYPE VALUE find TYPE VALUE
.. _tags: .. _tags:
...@@ -194,6 +192,28 @@ Tags ...@@ -194,6 +192,28 @@ Tags
The following tags are supported by The following tags are supported by
``MPD``: ``MPD``:
* **artist**: the artist name. Its meaning is not well-defined; see "*composer*" and "*performer*" for more specific tags.
* **artistsort**: same as artist, but for sorting. This usually omits prefixes such as "The".
* **album**: the album name.
* **albumsort**: same as album, but for sorting.
* **albumartist**: on multi-artist albums, this is the artist name which shall be used for the whole album. The exact meaning of this tag is not well-defined.
* **albumartistsort**: same as albumartist, but for sorting.
* **title**: the song title.
* **track**: the decimal track number within the album.
* **name**: a name for this song. This is not the song title. The exact meaning of this tag is not well-defined. It is often used by badly configured internet radio stations with broken tags to squeeze both the artist name and the song title in one tag.
* **genre**: the music genre.
* **date**: the song's release date. This is usually a 4-digit year.
* **composer**: the artist who composed the song.
* **performer**: the artist who performed the song.
* **comment**: a human-readable comment about this song. The exact meaning of this tag is not well-defined.
* **disc**: the decimal disc number in a multi-disc album.
* **musicbrainz_artistid**: the artist id in the `MusicBrainz <https://picard.musicbrainz.org/docs/mappings/>`_ database.
* **musicbrainz_albumid**: the album id in the `MusicBrainz <https://picard.musicbrainz.org/docs/mappings/>`_ database.
* **musicbrainz_albumartistid**: the album artist id in the `MusicBrainz <https://picard.musicbrainz.org/docs/mappings/>`_ database.
* **musicbrainz_trackid**: the track id in the `MusicBrainz <https://picard.musicbrainz.org/docs/mappings/>`_ database.
* **musicbrainz_releasetrackid**: the release track id in the `MusicBrainz <https://picard.musicbrainz.org/docs/mappings/>`_ database.
* **musicbrainz_workid**: the work id in the `MusicBrainz <https://picard.musicbrainz.org/docs/mappings/>`_ database.
There can be multiple values for some of these tags. For There can be multiple values for some of these tags. For
example, ``MPD`` may return multiple example, ``MPD`` may return multiple
lines with a ``performer`` tag. A tag value is lines with a ``performer`` tag. A tag value is
...@@ -204,9 +224,8 @@ a UTF-8 string. ...@@ -204,9 +224,8 @@ a UTF-8 string.
Other Metadata Other Metadata
============== ==============
The response to `lsinfo` <command_lsinfo>` and The response to :ref:`lsinfo <command_lsinfo>` and similar commands
similar commands may contain `song may contain :ref:`song tags <tags>` and other metadata, specifically:
tags <tags>` and other metadata, specifically:
- ``duration``: the duration of the song in - ``duration``: the duration of the song in
seconds; may contain a fractional part. seconds; may contain a fractional part.
...@@ -215,22 +234,17 @@ tags <tags>` and other metadata, specifically: ...@@ -215,22 +234,17 @@ tags <tags>` and other metadata, specifically:
but as integer value. This is deprecated and is only here but as integer value. This is deprecated and is only here
for compatibility with older clients. Do not use. for compatibility with older clients. Do not use.
- ``Range``: if this is a queue item - ``Range``: if this is a queue item referring only to a portion of
referring only to a portion of the song file, then this the song file, then this attribute contains the time range in the
attribute contains the time range in the form form ``START-END`` or ``START-`` (open ended); both ``START`` and
*START-END* or ``END`` are time stamps within the song in seconds (may contain a
*START-* (open ended); both fractional part). Example: ``60-120`` plays only the second minute;
*START* and "``180`` skips the first three minutes.
*END* are time stamps within the song
in seconds (may contain a fractional part). Example:
"*60-120*" plays only the second
minute; "*180*" skips the first three
minutes.
- ``Format``: the audio format of the song - ``Format``: the audio format of the song
(or an approximation to a format supported by MPD and the (or an approximation to a format supported by MPD and the
decoder plugin being used). When playing this file, the decoder plugin being used). When playing this file, the
``audio`` value in the `status` <command_status>` ``audio`` value in the :ref:`status <command_status>`
response should be the same. response should be the same.
- ``Last-Modified``: the time stamp of the - ``Last-Modified``: the time stamp of the
...@@ -244,15 +258,14 @@ Recipes ...@@ -244,15 +258,14 @@ Recipes
Queuing Queuing
======= =======
Often, users run ``MPD`` with ``random`` enabled, but want to Often, users run ``MPD`` with :ref:`random <command_random>` enabled,
be able to insert songs "before" the rest of the playlist. but want to be able to insert songs "before" the rest of the playlist.
That is commonly called "queuing". That is commonly called "queuing".
``MPD`` implements this by allowing the client to specify a ``MPD`` implements this by allowing the client to specify a "priority"
"priority" for each song in the playlist (commands ``priod`` <command_prio>` and for each song in the playlist (commands :ref:`priod <command_prio>`
``priodid`` <command_prioid>`). A and :ref:`priodid <command_prioid>`). A higher priority means that
higher priority means that the song is going to be played the song is going to be played before the other songs.
before the other songs.
In "random" mode, ``MPD`` maintains an In "random" mode, ``MPD`` maintains an
internal randomized sequence of songs. In this sequence, internal randomized sequence of songs. In this sequence,
...@@ -284,24 +297,25 @@ Command reference ...@@ -284,24 +297,25 @@ Command reference
Querying ``MPD``'s status Querying ``MPD``'s status
================================ ================================
CMDSYN: clearerror :command:`clearerror`
Clears the current error message in status (this is also Clears the current error message in status (this is also
accomplished by any command that starts playback). accomplished by any command that starts playback).
CMDSYN: currentsong :command:`currentsong`
Displays the song info of the current song (same song that Displays the song info of the current song (same song that
is identified in status). is identified in status).
CMDSYN: idle SUBSYSTEMS .. _command_idle:
Introduced with
``MPD`` 0.14 :command:`idle [SUBSYSTEMS...]` [#since_0_14]_
Waits until there is a noteworthy change in one or more Waits until there is a noteworthy change in one or more
of ``MPD``'s subsystems. As soon of ``MPD``'s subsystems. As soon
as there is one, it lists all changed systems in a line as there is one, it lists all changed systems in a line
in the format ``changed: in the format ``changed:
SUBSYSTEM``, where SUBSYSTEM is one of the SUBSYSTEM``, where SUBSYSTEM is one of the
following: following:
- ``database``: the song database has been modified after `update` <command_update>`.
- ``database``: the song database has been modified after :ref:`update <command_update>`.
- ``update``: a database update has started or finished. If the database was modified during the update, the ``database`` event is also emitted. - ``update``: a database update has started or finished. If the database was modified during the update, the ``database`` event is also emitted.
- ``stored_playlist``: a stored playlist has been modified, renamed, created or deleted - ``stored_playlist``: a stored playlist has been modified, renamed, created or deleted
- ``playlist``: the current playlist has been modified - ``playlist``: the current playlist has been modified
...@@ -313,12 +327,13 @@ CMDSYN: idle SUBSYSTEMS ...@@ -313,12 +327,13 @@ CMDSYN: idle SUBSYSTEMS
- ``sticker``: the sticker database has been modified. - ``sticker``: the sticker database has been modified.
- ``subscription``: a client has subscribed or unsubscribed to a channel - ``subscription``: a client has subscribed or unsubscribed to a channel
- ``message``: a message was received on a channel this client is subscribed to; this event is only emitted when the queue is empty - ``message``: a message was received on a channel this client is subscribed to; this event is only emitted when the queue is empty
Change events accumulate, even while the connection is
not in "idle" mode; no events gets lost while the client Change events accumulate, even while the connection is not in
is doing something else with the connection. If an "idle" mode; no events gets lost while the client is doing
event had already occurred since the last call, the new something else with the connection. If an event had already
`idle` <command_idle>` occurred since the last call, the new :ref:`idle <command_idle>`
command will return immediately. command will return immediately.
While a client is waiting for `idle` While a client is waiting for `idle`
results, the server disables timeouts, allowing a client results, the server disables timeouts, allowing a client
to wait for events as long as mpd runs. The to wait for events as long as mpd runs. The
...@@ -332,24 +347,27 @@ CMDSYN: idle SUBSYSTEMS ...@@ -332,24 +347,27 @@ CMDSYN: idle SUBSYSTEMS
notifications when something changed in one of the notifications when something changed in one of the
specified subsytems. specified subsytems.
CMDSYN: status .. _command_status:
:command:`status`
Reports the current status of the player and the volume Reports the current status of the player and the volume
level. level.
- ``volume``: ``0-100`` or ``-1`` if the volume cannot be determined - ``volume``: ``0-100`` or ``-1`` if the volume cannot be determined
- ``repeat``: ``0`` or ``1`` - ``repeat``: ``0`` or ``1``
- ``random``: ``0`` or ``1`` - ``random``: ``0`` or ``1``
- ``single``: Introduced with ``MPD`` 0.15 (oneshot introduced with 0.20). ``0``, ``1``, or ``oneshot`` - ``single`` [#since_0_15]_: ``0``, ``1``, or ``oneshot`` [#since_0_20]_
- ``consume``: ``0`` or ``1`` - ``consume`` [#since_0_15]_: ``0`` or ``1``
- ``playlist``: 31-bit unsigned integer, the playlist version number - ``playlist``: 31-bit unsigned integer, the playlist version number
- ``playlistlength``: integer, the length of the playlist - ``playlistlength``: integer, the length of the playlist
- ``state``: ``play``, ``stop, or ``pause`` - ``state``: ``play``, ``stop, or ``pause``
- ``song``: playlist song number of the current song stopped on or playing - ``song``: playlist song number of the current song stopped on or playing
- ``songid``: playlist songid of the current song stopped on or playing - ``songid``: playlist songid of the current song stopped on or playing
- ``nextsong``: playlist song number of the next song to be played - ``nextsong`` [#since_0_15]_: playlist song number of the next song to be played
- ``nextsongid``: playlist songid of the next song to be played - ``nextsongid`` [#since_0_15]_: playlist songid of the next song to be played
- ``time``: total time elapsed (of current playing/paused song) - ``time``: total time elapsed (of current playing/paused song)
- ``elapsed``: Introduced with ``MPD`` 0.16. Total time elapsed within the current song, but with higher resolution. - ``elapsed`` [#since_0_16]_: Total time elapsed within the current song, but with higher resolution.
- ``duration``: Introduced with ``MPD`` 0.20. Duration of the current song in seconds. - ``duration`` [#since_0_20]_: Duration of the current song in seconds.
- ``bitrate``: instantaneous bitrate in kbps - ``bitrate``: instantaneous bitrate in kbps
- ``xfade``: ``crossfade`` in seconds - ``xfade``: ``crossfade`` in seconds
- ``mixrampdb``: ``mixramp`` threshold in dB - ``mixrampdb``: ``mixramp`` threshold in dB
...@@ -358,8 +376,9 @@ CMDSYN: status ...@@ -358,8 +376,9 @@ CMDSYN: status
- ``updating_db``: ``job id`` - ``updating_db``: ``job id``
- ``error``: if there is an error, returns message here - ``error``: if there is an error, returns message here
CMDSYN: stats :command:`stats`
Displays statistics. Displays statistics.
- ``artists``: number of artists - ``artists``: number of artists
- ``albums``: number of albums - ``albums``: number of albums
- ``songs``: number of songs - ``songs``: number of songs
...@@ -371,45 +390,48 @@ CMDSYN: stats ...@@ -371,45 +390,48 @@ CMDSYN: stats
Playback options Playback options
================ ================
CMDSYN: consume STATE :command:`consume {STATE}` [#since_0_15]_
Sets consume state to ``STATE``, Sets consume state to ``STATE``,
``STATE`` should be 0 or 1. ``STATE`` should be 0 or 1.
When consume is activated, each song played is removed from playlist. When consume is activated, each song played is removed from playlist.
CMDSYN: crossfade SECONDS :command:`crossfade {SECONDS}`
Sets crossfading between songs. Sets crossfading between songs.
CMDSYN: mixrampdb deciBels :command:`mixrampdb {deciBels}`
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 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
CMDSYN: mixrampdelay SECONDS :command:`mixrampdelay {SECONDS}`
Additional time subtracted from the overlap calculated by mixrampdb. A value of "nan" disables MixRamp overlapping and falls back to crossfading. Additional time subtracted from the overlap calculated by mixrampdb. A value of "nan" disables MixRamp overlapping and falls back to crossfading.
CMDSYN: random STATE .. _command_random:
:command:`random {STATE}`
Sets random state to ``STATE``, Sets random state to ``STATE``,
``STATE`` should be 0 or 1. ``STATE`` should be 0 or 1.
CMDSYN: repeat STATE :command:`repeat {STATE}`
Sets repeat state to ``STATE``, Sets repeat state to ``STATE``,
``STATE`` should be 0 or 1. ``STATE`` should be 0 or 1.
CMDSYN: setvol VOL .. _command_setvol:
:command:`setvol {VOL}`
Sets volume to ``VOL``, the range of Sets volume to ``VOL``, the range of
volume is 0-100. volume is 0-100.
CMDSYN: single STATE :command:`single {STATE}` [#since_0_15]_
Sets single state to ``STATE``, Sets single state to ``STATE``,
``STATE`` should be 0 or 1. ``STATE`` should be 0 or 1.
When single is activated, playback is stopped after current song, or When single is activated, playback is stopped after current song, or
song is repeated if the 'repeat' mode is enabled. song is repeated if the 'repeat' mode is enabled.
CMDSYN: replay_gain_mode MODE :command:`replay_gain_mode {MODE}` [#since_0_16]_
Sets the replay gain mode. One of Sets the replay gain mode. One of
*off*, ``off``,
*track*, ``track``,
*album*, ``album``,
*auto* ``auto``
added in ``MPD`` 0.16
. .
Changing the mode during playback may take several Changing the mode during playback may take several
seconds, because the new settings does not affect the seconds, because the new settings does not affect the
...@@ -417,145 +439,159 @@ CMDSYN: replay_gain_mode MODE ...@@ -417,145 +439,159 @@ CMDSYN: replay_gain_mode MODE
This command triggers the This command triggers the
``options`` idle event. ``options`` idle event.
CMDSYN: replay_gain_status :command:`replay_gain_status`
Prints replay gain options. Currently, only the Prints replay gain options. Currently, only the
variable ``replay_gain_mode`` is variable ``replay_gain_mode`` is
returned. returned.
CMDSYN: volume CHANGE :command:`volume {CHANGE}`
Changes volume by amount ``CHANGE``. Changes volume by amount ``CHANGE``.
.. note:: ``volume`` is deprecated, use ``setvol`` instead. Deprecated, use :ref:`setvol <command_setvol>` instead.
Controlling playback Controlling playback
==================== ====================
CMDSYN: next :command:`next`
Plays next song in the playlist. Plays next song in the playlist.
CMDSYN: pause PAUSE :command:`pause {PAUSE}`
Toggles pause/resumes playing, ``PAUSE`` is 0 or 1. Toggles pause/resumes playing, ``PAUSE`` is 0 or 1.
.. note:: The use of pause command w/o the PAUSE argument is deprecated.
CMDSYN: play SONGPOS The use of pause command without the PAUSE argument is deprecated.
:command:`play [SONGPOS]`
Begins playing the playlist at song number Begins playing the playlist at song number
``SONGPOS``. ``SONGPOS``.
CMDSYN: playid SONGID :command:`playid [SONGID]`
Begins playing the playlist at song Begins playing the playlist at song
``SONGID``. ``SONGID``.
CMDSYN: previous :command:`previous`
Plays previous song in the playlist. Plays previous song in the playlist.
CMDSYN: seek SONGPOS TIME :command:`seek {SONGPOS} {TIME}`
Seeks to the position ``TIME`` (in Seeks to the position ``TIME`` (in
seconds; fractions allowed) of entry seconds; fractions allowed) of entry
``SONGPOS`` in the playlist. ``SONGPOS`` in the playlist.
CMDSYN: seekid SONGID TIME :command:`seekid {SONGID} {TIME}`
Seeks to the position ``TIME`` (in Seeks to the position ``TIME`` (in
seconds; fractions allowed) of song seconds; fractions allowed) of song
``SONGID``. ``SONGID``.
CMDSYN: seekcur TIME :command:`seekcur {TIME}`
Seeks to the position ``TIME`` (in Seeks to the position ``TIME`` (in
seconds; fractions allowed) within the current song. If seconds; fractions allowed) within the current song. If
prefixed by '+' or '-', then the time is relative to the prefixed by ``+`` or ``-``, then the time is relative to the
current playing position. current playing position.
CMDSYN: stop :command:`stop`
Stops playing. Stops playing.
The current playlist The current playlist
==================== ====================
CMDSYN: add URI :command:`add {URI}`
Adds the file ``URI`` to the playlist Adds the file ``URI`` to the playlist
(directories add recursively). ``URI`` (directories add recursively). ``URI``
can also be a single file. can also be a single file.
CMDSYN: addid URI POSITION :command:`addid {URI} [POSITION]`
Adds a song to the playlist (non-recursive) and returns the song id. ``URI`` is always a single file or URL. For example: Adds a song to the playlist (non-recursive) and returns the
song id. ``URI`` is always a single file or URL. For example::
:: addid "foo.mp3"
addid "foo.mp3" Id: 999
Id: 999 OK
OK
CMDSYN: clear :command:`clear`
Clears the current playlist. Clears the current playlist.
CMDSYN: delete POS START:END .. _command_delete:
:command:`delete [{POS} | {START:END}]`
Deletes a song from the playlist. Deletes a song from the playlist.
CMDSYN: deleteid SONGID :command:`deleteid {SONGID}`
Deletes the song ``SONGID`` from the Deletes the song ``SONGID`` from the
playlist playlist
CMDSYN: move FROM START:END TO :command:`move {FROM} [{START:END} | {TO}]`
Moves the song at ``FROM`` or range of songs Moves the song at ``FROM`` or range of songs
at ``START:END`` to ``TO`` at ``START:END`` [#since_0_15]_ to ``TO``
in the playlist. in the playlist.
Ranges are supported since ``MPD`` 0.15
CMDSYN: moveid FROM TO :command:`moveid {FROM} {TO}`
Moves the song with ``FROM`` (songid) to Moves the song with ``FROM`` (songid) to
``TO`` (playlist index) in the ``TO`` (playlist index) in the
playlist. If ``TO`` is negative, it playlist. If ``TO`` is negative, it
is relative to the current song in the playlist (if is relative to the current song in the playlist (if
there is one). there is one).
CMDSYN: playlist :command:`playlist`
Displays the current playlist. Displays the current playlist.
.. note:: Do not use this, instead use `playlistinfo` <command_playlistinfo>`.
CMDSYN: playlistfind TAG NEEDLE Do not use this, instead use :ref:`playlistinfo
<command_playlistinfo>`.
:command:`playlistfind {TAG} {NEEDLE}`
Finds songs in the current playlist with strict Finds songs in the current playlist with strict
matching. matching.
CMDSYN: playlistid SONGID :command:`playlistid {SONGID}`
Displays a list of songs in the playlist. Displays a list of songs in the playlist.
``SONGID`` is optional and specifies a ``SONGID`` is optional and specifies a
single song to display info for. single song to display info for.
CMDSYN: playlistinfo SONGPOS START:END .. _command_playlistinfo:
:command:`playlistinfo [[SONGPOS] | [START:END]]`
Displays a list of all songs in the playlist, or if the optional Displays a list of all songs in the playlist, or if the optional
argument is given, displays information only for the song argument is given, displays information only for the song
``SONGPOS`` or the range of songs ``SONGPOS`` or the range of songs
``START:END`` ``START:END`` [#since_0_15]_
CMDSYN: playlistsearch TAG NEEDLE :command:`playlistsearch {TAG} {NEEDLE}`
Searches case-insensitively for partial matches in the Searches case-insensitively for partial matches in the
current playlist. current playlist.
CMDSYN: plchanges VERSION START:END :command:`plchanges {VERSION} [START:END]`
Displays changed songs currently in the playlist since Displays changed songs currently in the playlist since
``VERSION``. Start and end positions may ``VERSION``. Start and end positions may
be given to limit the output to changes in the given be given to limit the output to changes in the given
range. range.
To detect songs that were deleted at the end of the To detect songs that were deleted at the end of the
playlist, use playlistlength returned by status command. playlist, use playlistlength returned by status command.
CMDSYN: plchangesposid VERSION START:END :command:`plchangesposid {VERSION} [START:END]`
Displays changed songs currently in the playlist since Displays changed songs currently in the playlist since
``VERSION``. This function only ``VERSION``. This function only
returns the position and the id of the changed song, not returns the position and the id of the changed song, not
the complete metadata. This is more bandwidth efficient. the complete metadata. This is more bandwidth efficient.
To detect songs that were deleted at the end of the To detect songs that were deleted at the end of the
playlist, use playlistlength returned by status command. playlist, use playlistlength returned by status command.
CMDSYN: prio PRIORITY START:END .. _command_prio:
:command:`prio {PRIORITY} {START:END...}`
Set the priority of the specified songs. A higher Set the priority of the specified songs. A higher
priority means that it will be played first when priority means that it will be played first when
"random" mode is enabled. "random" mode is enabled.
A priority is an integer between 0 and 255. The default A priority is an integer between 0 and 255. The default
priority of new songs is 0. priority of new songs is 0.
CMDSYN: prioid PRIORITY ID .. _command_prioid:
Same as ``priod`` <command_prio>`,
:command:`prioid {PRIORITY} {ID...}`
Same as :ref:`priod <command_prio>`,
but address the songs with their id. but address the songs with their id.
CMDSYN: rangeid ID START:END :command:`rangeid {ID} {START:END}` [#since_0_19]_
Since ``MPD`` Since ``MPD``
0.19 Specifies the portion of the 0.19 Specifies the portion of the
song that shall be played. ``START`` and song that shall be played. ``START`` and
...@@ -565,27 +601,27 @@ CMDSYN: rangeid ID START:END ...@@ -565,27 +601,27 @@ CMDSYN: rangeid ID START:END
range, play everything". A song that is currently range, play everything". A song that is currently
playing cannot be manipulated this way. playing cannot be manipulated this way.
CMDSYN: shuffle START:END :command:`shuffle [START:END]`
Shuffles the current playlist. Shuffles the current playlist.
``START:END`` is optional and specifies ``START:END`` is optional and specifies
a range of songs. a range of songs.
CMDSYN: swap SONG1 SONG2 :command:`swap {SONG1} {SONG2}`
Swaps the positions of ``SONG1`` and Swaps the positions of ``SONG1`` and
``SONG2``. ``SONG2``.
CMDSYN: swapid SONG1 SONG2 :command:`swapid {SONG1} {SONG2}`
Swaps the positions of ``SONG1`` and Swaps the positions of ``SONG1`` and
``SONG2`` (both song ids). ``SONG2`` (both song ids).
CMDSYN: addtagid SONGID TAG VALUE :command:`addtagid {SONGID} {TAG} {VALUE}`
Adds a tag to the specified song. Editing song tags is Adds a tag to the specified song. Editing song tags is
only possible for remote songs. This change is only possible for remote songs. This change is
volatile: it may be overwritten by tags received from volatile: it may be overwritten by tags received from
the server, and the data is gone when the song gets the server, and the data is gone when the song gets
removed from the queue. removed from the queue.
CMDSYN: cleartagid SONGID TAG :command:`cleartagid {SONGID} [TAG]`
Removes tags from the specified song. If Removes tags from the specified song. If
``TAG`` is not specified, then all tag ``TAG`` is not specified, then all tag
values will be removed. Editing song tags is only values will be removed. Editing song tags is only
...@@ -604,15 +640,15 @@ run playlist plugins instead of the hard-coded simple ...@@ -604,15 +640,15 @@ run playlist plugins instead of the hard-coded simple
the music directory (relative path including the suffix) or the music directory (relative path including the suffix) or
remote playlists (absolute URI with a supported scheme). remote playlists (absolute URI with a supported scheme).
CMDSYN: listplaylist NAME :command:`listplaylist {NAME}`
Lists the songs in the playlist. Playlist plugins are Lists the songs in the playlist. Playlist plugins are
supported. supported.
CMDSYN: listplaylistinfo NAME :command:`listplaylistinfo {NAME}`
Lists the songs with metadata in the playlist. Playlist Lists the songs with metadata in the playlist. Playlist
plugins are supported. plugins are supported.
CMDSYN: listplaylists :command:`listplaylists`
Prints a list of the playlist directory. Prints a list of the playlist directory.
After each playlist name the server sends its last After each playlist name the server sends its last
modification time as attribute "Last-Modified" in ISO modification time as attribute "Last-Modified" in ISO
...@@ -620,78 +656,87 @@ CMDSYN: listplaylists ...@@ -620,78 +656,87 @@ CMDSYN: listplaylists
between clients and the server, clients should not between clients and the server, clients should not
compare this value with their local clock. compare this value with their local clock.
CMDSYN: load NAME START:END :command:`load {NAME} [START:END]`
Loads the playlist into the current queue. Playlist Loads the playlist into the current queue. Playlist
plugins are supported. A range may be specified to load plugins are supported. A range may be specified to load
only a part of the playlist. only a part of the playlist.
CMDSYN: playlistadd NAME URI :command:`playlistadd {NAME} {URI}`
Adds ``URI`` to the playlist Adds ``URI`` to the playlist
`NAME.m3u`. `NAME.m3u`.
`NAME.m3u` will be created if it does `NAME.m3u` will be created if it does
not exist. not exist.
CMDSYN: playlistclear NAME :command:`playlistclear {NAME}`
Clears the playlist `NAME.m3u`. Clears the playlist `NAME.m3u`.
CMDSYN: playlistdelete NAME SONGPOS :command:`playlistdelete {NAME} {SONGPOS}`
Deletes ``SONGPOS`` from the Deletes ``SONGPOS`` from the
playlist `NAME.m3u`. playlist `NAME.m3u`.
CMDSYN: playlistmove NAME FROM TO :command:`playlistmove {NAME} {FROM} {TO}`
Moves the song at position ``FROM`` in Moves the song at position ``FROM`` in
the playlist `NAME.m3u` to the the playlist `NAME.m3u` to the
position ``TO``. position ``TO``.
CMDSYN: rename NAME NEW_NAME :command:`rename {NAME} {NEW_NAME}`
Renames the playlist `NAME.m3u` to `NEW_NAME.m3u`. Renames the playlist `NAME.m3u` to `NEW_NAME.m3u`.
CMDSYN: rm NAME :command:`rm {NAME}`
Removes the playlist `NAME.m3u` from Removes the playlist `NAME.m3u` from
the playlist directory. the playlist directory.
CMDSYN: save NAME :command:`save {NAME}`
Saves the current playlist to Saves the current playlist to
`NAME.m3u` in the playlist directory. `NAME.m3u` in the playlist directory.
The music database The music database
================== ==================
CMDSYN: albumart URI OFFSET :command:`albumart {URI} {OFFSET}`
Searches the directory the file ``URI`` Searches the directory the file ``URI``
resides in and attempts to return a chunk of an album resides in and attempts to return a chunk of an album
art image file at offset ``OFFSET``. art image file at offset ``OFFSET``.
Uses the filename "cover" with any of ".png, .jpg, Uses the filename "cover" with any of ".png, .jpg,
.tiff, .bmp". .tiff, .bmp".
Returns the file size and actual number Returns the file size and actual number
of bytes read at the requested offset, followed of bytes read at the requested offset, followed
by the chunk requested as raw bytes, then a by the chunk requested as raw bytes, then a
newline and the completion code. newline and the completion code.
Example:
albumart Example::
size: 1024768
binary: 8192 albumart
<8192 bytes> size: 1024768
OK binary: 8192
<8192 bytes>
CMDSYN: count FILTER group GROUPTYPE OK
:command:`count {FILTER} [group {GROUPTYPE}]`
Count the number of songs and their total playtime in Count the number of songs and their total playtime in
the database matching ``FILTER`` (see the database matching ``FILTER`` (see
`Filters <filter_syntax>`). The :ref:`Filters <filter_syntax>`). The
following prints the number of songs whose title matches following prints the number of songs whose title matches
"Echoes": "Echoes"::
count title Echoes
count title Echoes
The *group* keyword may be used to The *group* keyword may be used to
group the results by a tag. The first following example group the results by a tag. The first following example
prints per-artist counts while the next prints the prints per-artist counts while the next prints the
number of songs whose title matches "Echoes" grouped by number of songs whose title matches "Echoes" grouped by
artist: artist::
count group artist
count title Echoes group artist count group artist
count title Echoes group artist
CMDSYN: find FILTER sort TYPE window START : END .. _command_find:
:command:`find {FILTER} [sort {TYPE}] [window {START:END}]`
Search the database for songs matching Search the database for songs matching
``FILTER`` (see `Filters <filter_syntax>`). ``FILTER`` (see :ref:`Filters <filter_syntax>`).
``sort`` sorts the result by the ``sort`` sorts the result by the
specified tag. The sort is descending if the tag is specified tag. The sort is descending if the tag is
prefixed with a minus ('-'). prefixed with a minus ('-').
...@@ -704,32 +749,43 @@ CMDSYN: find FILTER sort TYPE window START : END ...@@ -704,32 +749,43 @@ CMDSYN: find FILTER sort TYPE window START : END
"\*Sort" doesn't exist. "AlbumArtist" falls back to just "\*Sort" doesn't exist. "AlbumArtist" falls back to just
"Artist". The type "Last-Modified" can sort by file "Artist". The type "Last-Modified" can sort by file
modification time. modification time.
``window`` can be used to query only a ``window`` can be used to query only a
portion of the real response. The parameter is two portion of the real response. The parameter is two
zero-based record numbers; a start number and an end zero-based record numbers; a start number and an end
number. number.
CMDSYN: findadd FILTER .. _command_findadd:
:command:`findadd {FILTER}`
Search the database for songs matching Search the database for songs matching
``FILTER`` (see `Filters <filter_syntax>`) and add them to ``FILTER`` (see :ref:`Filters <filter_syntax>`) and add them to
the queue. Parameters have the same meaning as for the queue. Parameters have the same meaning as for
`find` <command_find>`. :ref:`find <command_find>`.
CMDSYN: list TYPE FILTER group GROUPTYPE .. _command_list:
:command:`list {TYPE} {FILTER} [group {GROUPTYPE}]`
Lists unique tags values of the specified type. Lists unique tags values of the specified type.
``TYPE`` can be any tag supported by ``TYPE`` can be any tag supported by
``MPD`` or ``MPD`` or
*file*. *file*.
Additional arguments may specify a `filter <filter_syntax>`.
Additional arguments may specify a :ref:`filter <filter_syntax>`.
The *group* keyword may be used The *group* keyword may be used
(repeatedly) to group the results by one or more tags. (repeatedly) to group the results by one or more tags.
The following example lists all album names, The following example lists all album names,
grouped by their respective (album) artist: grouped by their respective (album) artist::
list album group albumartist
list album group albumartist
.. _command_listall:
CMDSYN: listall URI :command:`listall [URI]`
Lists all songs and directories in Lists all songs and directories in
``URI``. ``URI``.
Do not use this command. Do not manage a client-side Do not use this command. Do not manage a client-side
copy of ``MPD``'s database. That copy of ``MPD``'s database. That
is fragile and adds huge overhead. It will break with is fragile and adds huge overhead. It will break with
...@@ -737,10 +793,13 @@ CMDSYN: listall URI ...@@ -737,10 +793,13 @@ CMDSYN: listall URI
``MPD`` whenever you need ``MPD`` whenever you need
something. something.
CMDSYN: listallinfo URI .. _command_listallinfo:
Same as `listall` <command_listall>`,
:command:`listallinfo [URI]`
Same as :ref:`listall <command_listall>`,
except it also returns metadata info in the same format except it also returns metadata info in the same format
as `lsinfo` <command_lsinfo>` as :ref:`lsinfo <command_lsinfo>`
Do not use this command. Do not manage a client-side Do not use this command. Do not manage a client-side
copy of ``MPD``'s database. That copy of ``MPD``'s database. That
is fragile and adds huge overhead. It will break with is fragile and adds huge overhead. It will break with
...@@ -748,7 +807,7 @@ CMDSYN: listallinfo URI ...@@ -748,7 +807,7 @@ CMDSYN: listallinfo URI
``MPD`` whenever you need ``MPD`` whenever you need
something. something.
CMDSYN: listfiles URI :command:`listfiles {URI}`
Lists the contents of the directory Lists the contents of the directory
``URI``, including files are not ``URI``, including files are not
recognized by ``MPD``. recognized by ``MPD``.
...@@ -758,72 +817,92 @@ CMDSYN: listfiles URI ...@@ -758,72 +817,92 @@ CMDSYN: listfiles URI
line for each directory entry with the prefix "file: " line for each directory entry with the prefix "file: "
or "directory: ", and may be followed by file attributes or "directory: ", and may be followed by file attributes
such as "Last-Modified" and "size". such as "Last-Modified" and "size".
For example, "smb://SERVER" returns a list of all shares For example, "smb://SERVER" returns a list of all shares
on the given SMB/CIFS server; "nfs://servername/path" on the given SMB/CIFS server; "nfs://servername/path"
obtains a directory listing from the NFS server. obtains a directory listing from the NFS server.
CMDSYN: lsinfo URI .. _command_lsinfo:
:command:`lsinfo {URI}`
Lists the contents of the directory Lists the contents of the directory
``URI``. The response contains records ``URI``. The response contains records
starting with ``file``, starting with ``file``,
``directory`` or ``directory`` or
``playlist``, each followed by metadata ``playlist``, each followed by metadata
(`tags <tags>` or `other metadata <other_metadata>`). (:ref:`tags <tags>` or :ref:`other metadata <other_metadata>`).
When listing the root directory, this currently returns When listing the root directory, this currently returns
the list of stored playlists. This behavior is the list of stored playlists. This behavior is
deprecated; use "listplaylists" instead. deprecated; use "listplaylists" instead.
This command may be used to list metadata of remote This command may be used to list metadata of remote
files (e.g. URI beginning with "http://" or "smb://"). files (e.g. URI beginning with "http://" or "smb://").
Clients that are connected via UNIX domain socket may Clients that are connected via UNIX domain socket may
use this command to read the tags of an arbitrary local use this command to read the tags of an arbitrary local
file (URI is an absolute path). file (URI is an absolute path).
CMDSYN: readcomments URI :command:`readcomments {URI}`
Read "comments" (i.e. key-value pairs) from the file Read "comments" (i.e. key-value pairs) from the file
specified by "URI". This "URI" can be a path relative specified by "URI". This "URI" can be a path relative
to the music directory or an absolute path. to the music directory or an absolute path.
This command may be used to list metadata of remote This command may be used to list metadata of remote
files (e.g. URI beginning with "http://" or "smb://"). files (e.g. URI beginning with "http://" or "smb://").
The response consists of lines in the form "KEY: VALUE". The response consists of lines in the form "KEY: VALUE".
Comments with suspicious characters (e.g. newlines) are Comments with suspicious characters (e.g. newlines) are
ignored silently. ignored silently.
The meaning of these depends on the codec, and not all The meaning of these depends on the codec, and not all
decoder plugins support it. For example, on Ogg files, decoder plugins support it. For example, on Ogg files,
this lists the Vorbis comments. this lists the Vorbis comments.
CMDSYN: search FILTER sort TYPE window START : END .. _command_search:
:command:`search {FILTER} [sort {TYPE}] [window {START:END}]`
Search the database for songs matching Search the database for songs matching
``FILTER`` (see `Filters <filter_syntax>`). Parameters ``FILTER`` (see :ref:`Filters <filter_syntax>`). Parameters
have the same meaning as for `find` <command_find>`, have the same meaning as for :ref:`find <command_find>`,
except that search is not case sensitive. except that search is not case sensitive.
CMDSYN: searchadd FILTER .. _command_searchadd:
:command:`searchadd {FILTER}`
Search the database for songs matching Search the database for songs matching
``FILTER`` (see `Filters <filter_syntax>`) and add them to ``FILTER`` (see :ref:`Filters <filter_syntax>`) and add them to
the queue. the queue.
Parameters have the same meaning as for `search` <command_search>`.
CMDSYN: searchaddpl NAME FILTER Parameters have the same meaning as for :ref:`search <command_search>`.
:command:`searchaddpl {NAME} {FILTER}`
Search the database for songs matching Search the database for songs matching
``FILTER`` (see `Filters <filter_syntax>`) and add them to ``FILTER`` (see :ref:`Filters <filter_syntax>`) and add them to
the playlist named ``NAME``. the playlist named ``NAME``.
If a playlist by that name doesn't exist it is created. If a playlist by that name doesn't exist it is created.
Parameters have the same meaning as for `search` <command_search>`.
CMDSYN: update URI Parameters have the same meaning as for :ref:`search <command_search>`.
.. _command_update:
:command:`update [URI]`
Updates the music database: find new files, remove Updates the music database: find new files, remove
deleted files, update modified files. deleted files, update modified files.
``URI`` is a particular directory or ``URI`` is a particular directory or
song/file to update. If you do not specify it, song/file to update. If you do not specify it,
everything is updated. everything is updated.
Prints "updating_db: JOBID" where
Prints ``updating_db: JOBID`` where
``JOBID`` is a positive number ``JOBID`` is a positive number
identifying the update job. You can read the current identifying the update job. You can read the current
job id in the `status` <command_status>` job id in the :ref:`status <command_status>`
response. response.
CMDSYN: rescan URI :command:`rescan [URI]`
Same as `update` <command_update>`, Same as :ref:`update <command_update>`,
but also rescans unmodified files. but also rescans unmodified files.
Mounts and neighbors Mounts and neighbors
...@@ -840,40 +919,46 @@ systems, but without cooperation from the kernel. No ...@@ -840,40 +919,46 @@ systems, but without cooperation from the kernel. No
superuser privileges are necessary, beause this mapping exists superuser privileges are necessary, beause this mapping exists
only inside the ``MPD`` process only inside the ``MPD`` process
CMDSYN: mount PATH URI .. _command_mount:
:command:`mount {PATH} {URI}`
Mount the specified remote storage URI at the given Mount the specified remote storage URI at the given
path. Example: path. Example::
mount foo nfs://192.168.1.4/export/mp3
mount foo nfs://192.168.1.4/export/mp3
:command:`unmount {PATH}`
Unmounts the specified path. Example::
CMDSYN: unmount PATH unmount foo
Unmounts the specified path. Example:
unmount foo
CMDSYN: listmounts :command:`listmounts`
Queries a list of all mounts. By default, this contains Queries a list of all mounts. By default, this contains
just the configured ``music_directory``. just the configured ``music_directory``.
Example: Example::
listmounts
mount: listmounts
storage: /home/foo/music mount:
mount: foo storage: /home/foo/music
storage: nfs://192.168.1.4/export/mp3 mount: foo
OK storage: nfs://192.168.1.4/export/mp3
OK
CMDSYN: listneighbors
:command:`listneighbors`
Queries a list of "neighbors" (e.g. accessible file Queries a list of "neighbors" (e.g. accessible file
servers on the local net). Items on that list may be servers on the local net). Items on that list may be
used with the `mount` <command_mount>` used with the :ref:`mount <command_mount>`
command. Example: command. Example::
listneighbors
neighbor: smb://FOO listneighbors
name: FOO (Samba 4.1.11-Debian) neighbor: smb://FOO
OK name: FOO (Samba 4.1.11-Debian)
OK
Stickers Stickers
======== ========
"Stickers" are pieces of "Stickers" [#since_0_15]_ are pieces of
information attached to existing information attached to existing
``MPD`` objects (e.g. song files, ``MPD`` objects (e.g. song files,
directories, albums). Clients can create arbitrary name/value directories, albums). Clients can create arbitrary name/value
...@@ -893,58 +978,60 @@ Objects which may have stickers are addressed by their object ...@@ -893,58 +978,60 @@ Objects which may have stickers are addressed by their object
type ("song" for song objects) and their URI (the path within type ("song" for song objects) and their URI (the path within
the database for songs). the database for songs).
CMDSYN: sticker get TYPE URI NAME :command:`sticker get {TYPE} {URI} {NAME}`
Reads a sticker value for the specified object. Reads a sticker value for the specified object.
CMDSYN: sticker set TYPE URI NAME VALUE :command:`sticker set {TYPE} {URI} {NAME} {VALUE}`
Adds a sticker value to the specified object. If a Adds a sticker value to the specified object. If a
sticker item with that name already exists, it is sticker item with that name already exists, it is
replaced. replaced.
CMDSYN: sticker delete TYPE URI NAME :command:`sticker delete {TYPE} {URI} [NAME]`
Deletes a sticker value from the specified object. If Deletes a sticker value from the specified object. If
you do not specify a sticker name, all sticker values you do not specify a sticker name, all sticker values
are deleted. are deleted.
CMDSYN: sticker list TYPE URI :command:`sticker list {TYPE} {URI}`
Lists the stickers for the specified object. Lists the stickers for the specified object.
CMDSYN: sticker find TYPE URI NAME :command:`sticker find {TYPE} {URI} {NAME}`
Searches the sticker database for stickers with the Searches the sticker database for stickers with the
specified name, below the specified directory (URI). specified name, below the specified directory (URI).
For each matching song, it prints the URI and that one For each matching song, it prints the URI and that one
sticker's value. sticker's value.
CMDSYN: sticker find TYPE URI NAME = VALUE :command:`sticker find {TYPE} {URI} {NAME} = {VALUE}`
Searches for stickers with the given value. Searches for stickers with the given value.
Other supported operators are: Other supported operators are:
"``<``", "``>``" "``<``", "``>``"
Connection settings Connection settings
=================== ===================
CMDSYN: close :command:`close`
Closes the connection to ``MPD``. Closes the connection to ``MPD``.
``MPD`` will try to send the ``MPD`` will try to send the
remaining output buffer before it actually closes the remaining output buffer before it actually closes the
connection, but that cannot be guaranteed. This command connection, but that cannot be guaranteed. This command
will not generate a response. will not generate a response.
CMDSYN: kill :command:`kill`
Kills ``MPD``. Kills ``MPD``.
CMDSYN: password PASSWORD :command:`password {PASSWORD}`
This is used for authentication with the server. This is used for authentication with the server.
``PASSWORD`` is simply the plaintext ``PASSWORD`` is simply the plaintext
password. password.
CMDSYN: ping :command:`ping`
Does nothing but return "OK". Does nothing but return "OK".
CMDSYN: tagtypes :command:`tagtypes`
Shows a list of available tag types. It is an Shows a list of available tag types. It is an
intersection of the ``metadata_to_use`` intersection of the ``metadata_to_use``
setting and this client's tag mask. setting and this client's tag mask.
About the tag mask: each client can decide to disable About the tag mask: each client can decide to disable
any number of tag types, which will be omitted from any number of tag types, which will be omitted from
responses to this client. That is a good idea, because responses to this client. That is a good idea, because
...@@ -952,22 +1039,22 @@ CMDSYN: tagtypes ...@@ -952,22 +1039,22 @@ CMDSYN: tagtypes
``tagtypes`` sub commands configure this ``tagtypes`` sub commands configure this
list. list.
CMDSYN: tagtypes disable NAME :command:`tagtypes disable {NAME...]`
Remove one or more tags from the list of tag types the Remove one or more tags from the list of tag types the
client is interested in. These will be omitted from client is interested in. These will be omitted from
responses to this client. responses to this client.
CMDSYN: tagtypes enable NAME :command:`tagtypes enable {NAME...}`
Re-enable one or more tags from the list of tag types Re-enable one or more tags from the list of tag types
for this client. These will no longer be hidden from for this client. These will no longer be hidden from
responses to this client. responses to this client.
CMDSYN: tagtypes clear :command:`tagtypes clear`
Clear the list of tag types this client is interested Clear the list of tag types this client is interested
in. This means that ``MPD`` will in. This means that ``MPD`` will
not send any tags to this client. not send any tags to this client.
CMDSYN: tagtypes all :command:`tagtypes all`
Announce that this client is interested in all tag Announce that this client is interested in all tag
types. This is the default setting for new clients. types. This is the default setting for new clients.
...@@ -979,32 +1066,34 @@ These commands allow a client to inspect and manage ...@@ -979,32 +1066,34 @@ These commands allow a client to inspect and manage
MPD process: it has separate queue, player and outputs. A MPD process: it has separate queue, player and outputs. A
client is assigned to one partition at a time. client is assigned to one partition at a time.
CMDSYN: partition NAME :command:`partition {NAME}`
Switch the client to a different partition. Switch the client to a different partition.
CMDSYN: listpartitions :command:`listpartitions`
Print a list of partitions. Each partition starts with Print a list of partitions. Each partition starts with
a ``partition`` keyword and the a ``partition`` keyword and the
partition's name, followed by information about the partition's name, followed by information about the
partition. partition.
CMDSYN: newpartition NAME :command:`newpartition {NAME}`
Create a new partition. Create a new partition.
Audio output devices Audio output devices
==================== ====================
CMDSYN: disableoutput ID :command:`disableoutput {ID}`
Turns an output off. Turns an output off.
CMDSYN: enableoutput ID :command:`enableoutput {ID}`
Turns an output on. Turns an output on.
CMDSYN: toggleoutput ID :command:`toggleoutput {ID}`
Turns an output on or off, depending on the current Turns an output on or off, depending on the current
state. state.
CMDSYN: outputs .. _command_outputs:
:command:`outputs`
Shows information about all outputs. Shows information about all outputs.
:: ::
...@@ -1017,48 +1106,49 @@ CMDSYN: outputs ...@@ -1017,48 +1106,49 @@ CMDSYN: outputs
OK OK
Return information: Return information:
- ``outputid``: ID of the output. May change between executions - ``outputid``: ID of the output. May change between executions
- ``outputname``: Name of the output. It can be any. - ``outputname``: Name of the output. It can be any.
- ``outputenabled``: Status of the output. 0 if disabled, 1 if enabled. - ``outputenabled``: Status of the output. 0 if disabled, 1 if enabled.
CMDSYN: outputset ID NAME VALUE :command:`outputset {ID} {NAME} {VALUE}`
Set a runtime attribute. These are specific to the Set a runtime attribute. These are specific to the
output plugin, and supported values are usually printed output plugin, and supported values are usually printed
in the `outputs` <command_outputs>` in the :ref:`outputs <command_outputs>`
response. response.
Reflection Reflection
========== ==========
CMDSYN: config :command:`config`
Dumps configuration values that may be interesting for Dumps configuration values that may be interesting for
the client. This command is only permitted to "local" the client. This command is only permitted to "local"
clients (connected via UNIX domain socket). clients (connected via UNIX domain socket).
The following response attributes are available: The following response attributes are available:
Name
Description
``music_directory``
The absolute path of the music directory.
CMDSYN: commands - ``music_directory``: The absolute path of the music directory.
:command:`commands`
Shows which commands the current user has access to. Shows which commands the current user has access to.
CMDSYN: notcommands :command:`notcommands`
Shows which commands the current user does not have Shows which commands the current user does not have
access to. access to.
CMDSYN: urlhandlers :command:`urlhandlers`
Gets a list of available URL handlers. Gets a list of available URL handlers.
CMDSYN: decoders :command:`decoders`
Print a list of decoder plugins, followed by their Print a list of decoder plugins, followed by their
supported suffixes and MIME types. Example response: supported suffixes and MIME types. Example response::
plugin: mad
suffix: mp3 plugin: mad
suffix: mp2 suffix: mp3
mime_type: audio/mpeg suffix: mp2
plugin: mpcdec mime_type: audio/mpeg
suffix: mpc plugin: mpcdec
suffix: mpc
Client to client Client to client
================ ================
...@@ -1070,31 +1160,39 @@ them will receive the messages which get sent to it. ...@@ -1070,31 +1160,39 @@ them will receive the messages which get sent to it.
Each time a client subscribes or unsubscribes, the global idle Each time a client subscribes or unsubscribes, the global idle
event ``subscription`` is generated. In event ``subscription`` is generated. In
conjunction with the `channels` <command_channels>` conjunction with the :ref:`channels <command_channels>`
command, this may be used to auto-detect clients providing command, this may be used to auto-detect clients providing
additional services. additional services.
New messages are indicated by the ``message`` New messages are indicated by the ``message``
idle event. idle event.
CMDSYN: subscribe NAME :command:`subscribe {NAME}`
Subscribe to a channel. The channel is created if it Subscribe to a channel. The channel is created if it
does not exist already. The name may consist of does not exist already. The name may consist of
alphanumeric ASCII characters plus underscore, dash, dot alphanumeric ASCII characters plus underscore, dash, dot
and colon. and colon.
CMDSYN: unsubscribe NAME :command:`unsubscribe {NAME}`
Unsubscribe from a channel. Unsubscribe from a channel.
CMDSYN: channels .. _command_channels:
:command:`channels`
Obtain a list of all channels. The response is a list Obtain a list of all channels. The response is a list
of "channel:" lines. of "channel:" lines.
CMDSYN: readmessages :command:`readmessages`
Reads messages for this client. The response is a list Reads messages for this client. The response is a list
of "channel:" and "message:" lines. of "channel:" and "message:" lines.
CMDSYN: sendmessage CHANNEL TEXT :command:`sendmessage {CHANNEL} {TEXT}`
Send a message to the specified channel. Send a message to the specified channel.
.. rubric:: Footnotes
.. [#since_0_14] Since :program:`MPD` 0.14
.. [#since_0_15] Since :program:`MPD` 0.15
.. [#since_0_16] Since :program:`MPD` 0.16
.. [#since_0_19] Since :program:`MPD` 0.20
.. [#since_0_20] Since :program:`MPD` 0.20
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment