Authors: Caolan McMahon (caolan@caolanmcmahon.com).
any_error() = mpd_error() | network_error()
filter() = {tagop, tag(), filter_op(), iolist()} | {fileeq, iolist()} | {base, iolist()} | {modified_since, iolist()} | {added_since, iolist()} | {audio_format_eq, iolist()} | {audio_format_match, iolist()} | {prio_ge, integer()} | {lnot, filter()} | {land, [filter()]}
A filter specification is a (potentially nested) construction of tuples consisting of several operators.
Operator | Protocol | Description |
---|---|---|
tagop | (TAG OP 'VALUE') | Checks the specified tag against the iolist using the specified operator. |
fileeq | (file == 'VALUE') | Match the full song URI |
base | (base 'VALUE') | Restrict the search to songs in the given directory. |
modified_since | (modified-since 'VALUE') | compares the file's time stamp with the given value (ISO-8601 or UNIX timestamp) |
added_since | (added-since 'VALUE') | compares the time stamp when the file was added (same format as modified-since) |
audio_format_eq | (AudioFormat == 'SAMPLERATE:BITS:CHANNELS') | Compares the audio format |
audio_format_match | (AudioFormat =~ 'SAMPLERATE:BITS:CHANNELS') | Matches the audio format (one or more of the attributes may be set to '*' for any) |
prio_ge | (prio >= 42) | compares the priority of queued songs |
lnot | (!(EXPRESSION)) | Logical negation of given filter |
land | (EXPRESSION1 AND EXPRESSION 2...) | Logical and of two or more filters |
filter_op() = generic_op() | ne | match | mismatch
Filter operators are used in filters of type tagop (see type filter()).
Operator | Protocol | Description |
---|---|---|
eq | == | Test for equality |
ne | != | Test for mismatching |
contains | contains | Test for substring in any location |
starts_with | starts_with | Test for substring at begin of value |
match | match | Test for regular expression |
mismatch | mismatch | Negate result of regular expression test |
generic_op() = eq | contains | starts_with
mpd_conn() = #mpd_conn{port = port(), version = string()}
mpd_error() = #mpd_error{errorid = string(), position = string(), description = string(), reason = string()}
network_error() = closed | inet:posix()
sort_option() = {sort, tag() | '-artist' | '-albumartist' | '-album' | '-title' | '-track' | '-genre' | '-disc' | '-date' | albumartistsort | titlesort | composersort | '-albumartistsort' | '-titlesort' | '-composersort'}
A '-' prefix to a sort option causes the order of results to be inverted
sticker_op() = generic_op() | lt | gt | str_eq | str_gt | str_lt
Sticker Operators follow slightly different interpretation compared to the ones used in filters. Additionally, only one sticker can be compared using an operator in a given sticker_find/7.
Operator | Protocol | Description |
---|---|---|
eq | eq | Test for numeric equality |
lt | lt | Test for numeric less than |
gt | gt | Test for numeric greater than |
contains | contains | Test for substring in any location |
starts_with | starts_with | Test for substring at begin of value |
str_eq | = | Test for string equality |
str_gt | > | Tests for lexicographical greater than |
str_lt | < | Tests for lexicographical lower than |
sticker_sort_option() = {sort, uri | value | value_int}
tag() = artist | albumartist | album | title | track | genre | disc | date
window_option() = {window, Start::integer(), End::integer()}
Certain MPD commands accept sort and window options to enforce a given output ordering for the results or that only a subset of the results is returned. When a command accepts this type as input, the empty list [] or a proplist with at most one sort and one window option can be provided to make use of this feature.
add/2 | Adds the file Uri to the playlist (directories add recursively). |
addid/2 | Adds a song to the playlist (non-recursive) and returns the song id. |
addid/3 | Adds a song to the playlist (non-recursive) and returns the song id. |
addid_relative/3 | Like addid, but always interprets Pos as an offset relative to the currently playing song. |
albumart/2 | Queries the album art for the given song and returns an iolist with the file contents. |
clear/1 | Clears the current playlist. |
clearerror/1 | Clears the current error message in status (this is also accomplished by any command that starts playback). |
close/1 | Closes the connection to MPD. |
command/2 | Same as calling command(C=#mpd_conn{}, Command, [], ?TIMEOUT). |
command/3 | Same as calling command(C=#mpd_conn{}, Command, Args, ?TIMEOUT). |
command/4 | Sends a command to the server and retreives the response. |
commandlist/2 | Same as calling commandlist(C=#mpd_conn{}, CommandList, ?TIMEOUT). |
commandlist/3 | To facilitate faster adding of files etc. |
commands/1 | Shows which commands the current user has access to. |
connect/0 | Attempts to connect using default settings. |
connect/2 | Connects to an MPD server and returns the connected socket and the version number of the server. |
connect/3 | Convenience function which connects to an MPD server using connect/2, then calls password/2. |
consume/2 | Sets consume state. |
count/2 | Counts the number of songs and their total playtime in the db matching the filter. |
count/3 | Counts the number of songs and their total playtime in the db matching value X for Tag exactly. |
count_group/3 | Counts the number of songs and their total playtime in the db for all songs matching the given filter and groups by the given tag. |
crossfade/2 | Sets crossfading between songs to Secs. |
currentsong/1 | Displays the song info of the current song (same song that is identified in status). |
delete/2 | Deletes the song from the playlist at position PlaylistPos. |
deleteid/2 | Deletes the song SongId from the playlist. |
deleteids/2 | Deletes the SongIds from the playlist, more efficient than multiple calls to deleteid. |
delpartition/2 | Delete a partition. |
disableoutput/2 | Turns off output with id OutputId. |
disconnect/1 | |
enableoutput/2 | Turns on output with id OutputId. |
find/2 | Finds songs in the db that match the given filter. |
find/3 | Finds songs in the db that are exactly What. |
find_ex/3 | Finds songs in the db that match the given filter optionally providing sort and window options. |
idle/1 | Waits until there is a noteworthy change in any of MPD's subsystems. |
idle/2 | Waits until there is a noteworthy change in one or more of MPD's subsystems. |
idle_receive/1 | Completes an idle command started with idle_send/2 by waiting for the response from MPD. |
idle_send/2 | Sends an idle command to MPD but does not wait for its response. |
kill/1 | Kills MPD. |
list/2 | Lists all values of the specified tag. |
list/3 | Lists all tags of type album. |
listall/1 | Lists all songs and directories. |
listall/2 | Lists all songs and directories in Uri. |
listallinfo/1 | Same as listall/1, except it also returns metadata info in the same format as lsinfo. |
listallinfo/2 | Same as listall/2, except it also returns metadata info in the same format as lsinfo. |
listpartitions/1 | Query the list of partitions. |
listplaylist/2 | Lists the files in the playlist Name.m3u. |
listplaylistinfo/2 | Lists the songs in the playlist Name.m3u. |
listplaylists/1 | Prints a list of the playlist directory. |
load/2 | Loads the playlist Name.m3u from the playlist directory and appends all tracks to the end of the current playlist. |
lsinfo/1 | Lists the contents of the root directory. |
lsinfo/2 | Lists the contents of the directory Uri. |
move/3 | Moves the songs in the range Start:End (referring to position in the playlist) to position To in the playlist. |
moveid/3 | Moves the song with From (songid) to To (playlist index) in the playlist. |
moveoutput/2 | Move an output to the current partition. |
newpartition/2 | Create a new partition. |
next/1 | Plays next song in the playlist. |
noidle/1 | Interrupts an ongoing idle call and makes it return. |
notcommands/1 | Shows which commands the current user does not have access to. |
outputs/1 | Shows information about all outputs. |
partition/2 | Switch the client to a different partition. |
password/2 | This is used for authentication with the server. |
pause/2 | Sets pause state. |
ping/1 | Does nothing but return ok. |
play/1 | Begins playling playlist. |
play/2 | Begins playling playlist at song number Pos. |
playid/1 | Begins playling playlist. |
playid/2 | Begins playling playlist at song with songid Id. |
playlist/1 | Displays the current playlist. |
playlistadd/3 | Adds URI to the playlist Name.m3u. |
playlistclear/2 | Clears the playlist Name.m3u. |
playlistdelete/3 | Deletes PlaylistPos from the playlist Name.m3u. |
playlistfind/3 | Finds songs in the current playlist with strict matching. |
playlistid/1 | Displays a list of songs in the playlist. |
playlistid/2 | Displays info for song in playlist with specified id. |
playlistinfo/1 | Displays a list of all songs in the playlist. |
playlistinfo/2 | Displays a list of songs between Start and End positions in the playlist (exclusive of end position). |
playlistmove/4 | Moves SongId in the playlist Name.m3u, to the postion PlaylistPos. |
playlistsearch/3 | Searches case-sensitively for partial matches in the current playlist. |
plchanges/2 | Displays changed songs currently in the playlist since Ver. |
plchangesposid/2 | Displays changed songs currently in the playlist since Ver. |
previous/1 | Plays previous song in the playlist. |
random/2 | Sets random state. |
readpicture/2 | Queries the picture for the given song and returns an iolist with the file contents. |
rename/3 | Renames the playlist Name.m3u to NewName.m3u. |
repeat/2 | Sets repeat state. |
rm/2 | Removes the playlist NAME.m3u from the playlist directory. |
save/2 | Saves the current playlist to Name.m3u in the playlist directory. |
search/2 | Searches songs in the db that match the given filter It is similar to find/2, but case-insensitive. |
search/3 | Searches for any song with a the specified tag's value containing What. |
seek/3 | Seeks to the position SeekSecs (in seconds) of entry PlaylistPos in the playlist. |
seekid/3 | Seeks to the position SeekSecs (in seconds) of song SongId. |
setvol/2 | Sets volume to Vol, the range of volume is 0-100. |
shuffle/1 | Shuffles the current playlist. |
shuffle/2 | Shuffles the songs between the Start and End positions in the current playlist. |
single/2 | Sets single state. |
stats/1 | Displays statistics. |
status/1 | Reports the current status of the player and the volume level. |
sticker_delete/3 | Delete all stickers associated to the given type and URI. |
sticker_delete/4 | Delete specific sticker by Type, URI and Name. |
sticker_find/4 | Search for stickers of the specified type and name below the specified URI prefix (can be empty to retrieve all stickers). |
sticker_find/7 | Like sticker_find/4 but additionally allows specifying exactly one operator to compare the sticker against and also offers search ordering and pagination capabilities. |
sticker_get/4 | Get value of specific sticker by Type, URI and Name. |
sticker_list/3 | Retrieve all stickers associated to the given type and URI. |
sticker_set/5 | Assign sticker value by Type, URI and Name. |
stop/1 | Stops playing. |
swap/3 | Swaps the positions of songs at PlaylistPos1 and PlaylistPos2. |
swapid/3 | Swaps the positions of songs SongId1 and SongId2. |
tagtypes/1 | Shows a list of available song metadata. |
toggleoutput/2 | Toggles output with id OutputId. |
update/1 | Updates the music database. |
update/2 | Updates the music database. |
urlhandlers/1 | Gets a list of available URL handlers. |
version/1 | Returns a string representing the MPD version number for Connection. |
add(C::mpd_conn(), Uri::string()) -> ok | {error, any_error()}
Adds the file Uri to the playlist (directories add recursively). Uri can also be a single file.
addid(C::mpd_conn(), Uri::string()) -> integer() | binary() | {error, any_error()}
Adds a song to the playlist (non-recursive) and returns the song id. Uri is always a single file or URL.
addid(C::mpd_conn(), Uri::string(), Pos::integer()) -> integer() | binary() | {error, any_error()}
Adds a song to the playlist (non-recursive) and returns the song id. Uri is always a single file or URL. Pos is the position in the playlist to add it, a negative number means it is relative to the currently playing song in the playlist (if there is one).
addid_relative(C::mpd_conn(), Uri::string(), Pos::integer()) -> integer() | binary() | {error, any_error()}
Like addid, but always interprets Pos as an offset relative to the currently playing song. Use Pos = 0 to add an entry right after the currently playing song.
albumart(C::mpd_conn(), URI::string()) -> {unknown, iolist()} | {error, any_error() | enosize}
Queries the album art for the given song and returns an iolist with the file contents.
The first part of a successful return value for this function is always 'unknown'. This could later be replaced by a MIME-type if MPD gains support for this.clear(C::mpd_conn()) -> ok | {error, any_error()}
Clears the current playlist.
clearerror(C::mpd_conn()) -> ok | {error, any_error()}
Clears the current error message in status (this is also accomplished by any command that starts playback).
close(C::mpd_conn()) -> ok
Closes the connection to MPD.
command(C::mpd_conn(), Command::string()) -> list() | {error, any_error()}
Same as calling command(C=#mpd_conn{}, Command, [], ?TIMEOUT)
command(C::mpd_conn(), Command::string(), Args::list()) -> list() | {error, any_error()}
Same as calling command(C=#mpd_conn{}, Command, Args, ?TIMEOUT)
command(C::mpd_conn(), Command::string(), Args::list(), Timeout::integer()) -> list() | {error, any_error()}
Sends a command to the server and retreives the response. You should not need to use this directly, apart from where parts of the API have not been implemented by this module
commandlist(C::mpd_conn(), CommandList::[{Command::iolist(), Args::[string()]}]) -> list() | {error, any_error()}
Same as calling commandlist(C=#mpd_conn{}, CommandList, ?TIMEOUT)
commandlist(C::mpd_conn(), CommandList::[{Command::iolist(), Args::[string()]}], Timeout::integer()) -> list() | {error, any_error()}
To facilitate faster adding of files etc. you can pass a list of commands all at once using a command list. The return value is whatever the return for a list of commands is. If a command fails, no more commands are executed and the appropriate mpd error is returned.
commands(C::mpd_conn()) -> [binary()] | {error, any_error()}
Shows which commands the current user has access to
connect() -> {ok, mpd_conn()} | {error, network_error()}
Attempts to connect using default settings. Same as calling connect("localhost", 6600).
connect(Addr::string(), Port::integer()) -> {ok, mpd_conn()} | {error, network_error()}
Connects to an MPD server and returns the connected socket and the version number of the server.
connect(Addr::string(), Port::integer(), Pass::string) -> {ok, mpd_conn()} | {error, any_error()}
Convenience function which connects to an MPD server using connect/2, then calls password/2.
consume(C::mpd_conn(), State::boolean()) -> ok | {error, mpd_version | any_error()}
Sets consume state. When consume is activated, each song played is removed from playlist. Available since MPD 0.15.
count(C::mpd_conn(), Filter::filter()) -> list() | {error, any_error()}
Counts the number of songs and their total playtime in the db matching the filter
count(C::mpd_conn(), Tag::tag(), X::string()) -> list() | {error, any_error()}
Counts the number of songs and their total playtime in the db matching value X for Tag exactly.
count_group(C::mpd_conn(), Tag::tag(), Filter::filter()) -> list() | {error, any_error()}
Counts the number of songs and their total playtime in the db for all songs matching the given filter and groups by the given tag.
Example: erlmpd:count_group(Conn, artist, {base, ""}). returns a list like this: [ [{'Artist',<<"Ace Of Base">>},{songs,13},{playtime,2944}], [{'Artist',<<"Adele">>},{songs,1},{playtime,286}], [{'Artist',<<"Alan Silvestri">>},{songs,1},{playtime,164}] ]crossfade(C::mpd_conn(), Secs::integer()) -> ok | {error, any_error()}
Sets crossfading between songs to Secs.
currentsong(C::mpd_conn()) -> list() | {error, any_error()}
Displays the song info of the current song (same song that is identified in status).
delete(C::mpd_conn(), PlaylistPos::integer()) -> ok | {error, any_error()}
Deletes the song from the playlist at position PlaylistPos.
deleteid(C::mpd_conn(), SongId::integer()) -> ok | {error, any_error()}
Deletes the song SongId from the playlist.
deleteids(C::mpd_conn(), SongIds::[integer()]) -> ok | {error, any_error()}
Deletes the SongIds from the playlist, more efficient than multiple calls to deleteid.
delpartition(C::mpd_conn(), Name::string()) -> ok | {error, any_error()}
Delete a partition. The partition must be empty (no connected clients and no associated outputs).
disableoutput(C::mpd_conn(), OutputId::integer()) -> ok | {error, any_error()}
Turns off output with id OutputId
disconnect(C::mpd_conn()) -> ok
enableoutput(C::mpd_conn(), OutputId::integer()) -> ok | {error, any_error()}
Turns on output with id OutputId
find(C::mpd_conn(), Filter::filter()) -> list() | {error, any_error()}
Finds songs in the db that match the given filter.
find(C::mpd_conn(), Tag::tag(), X::string()) -> list() | {error, any_error()}
Finds songs in the db that are exactly What. Tag should be album, artist, or title. X is what to find.
find_ex(C::mpd_conn(), Filter::filter(), Options::[window_option() | sort_option()]) -> list() | {error, any_error()}
Finds songs in the db that match the given filter optionally providing sort and window options.
idle(C::mpd_conn()) -> [atom()] | {error, mpd_version}
Waits until there is a noteworthy change in any of MPD's subsystems. Same as calling idle(C=#mpd_conn{}, []).
idle(C::mpd_conn(), Subsystems::[atom()]) -> [atom()] | {error, mpd_version | network_error()}
Waits until there is a noteworthy change in one or more of MPD's subsystems. As soon as there is one, it lists all changed subsystems where a subsystem is one of the following:
This call is equivalent to calling idle_send/2 and idle_receive/1 in sequence. See their respective documentations for why it might make sense to rely on those functions directly in certain cases.
Available since MPD 0.14.idle_receive(C::mpd_conn()) -> [atom()] | {error, network_error()}
Completes an idle command started with idle_send/2 by waiting for the response from MPD. Note that this wait is indefinite (no timeout)
idle_send(C::mpd_conn(), Subsystems::[atom()]) -> ok | {error, mpd_version | network_error()}
Sends an idle command to MPD but does not wait for its response. The next call to the API should be idle_receive/1 or noidle/1.
Having two separate functions in place of the convenience idle/2 allows keeping track of what is being sent over the TCP channel because that is what matters to MPD. Specifically, if you want to asynchronously cancel an idle command with noidle, you MUST ensure that idle_send/2 was called before the noidle! The best way to establish this is to assume that the idle command was sent as soon as idle_send/2 returns, thus the utility of this function.kill(C::mpd_conn()) -> ok
Kills MPD.
list(C::mpd_conn(), Tag::tag()) -> list() | {error, any_error()}
Lists all values of the specified tag.
list(C::mpd_conn(), X2::album, Artist::string()) -> list() | {error, any_error()}
Lists all tags of type album. Artist specifies the artist to list albums by.
listall(C::mpd_conn()) -> list() | {error, any_error()}
Lists all songs and directories.
listall(C::mpd_conn(), Uri::string()) -> list() | {error, any_error()}
Lists all songs and directories in Uri.
listallinfo(C::mpd_conn()) -> list() | {error, any_error()}
Same as listall/1, except it also returns metadata info in the same format as lsinfo.
listallinfo(C::mpd_conn(), Uri::string()) -> list() | {error, any_error()}
Same as listall/2, except it also returns metadata info in the same format as lsinfo.
listpartitions(C::mpd_conn()) -> [list()] | {error, any_error()}
Query the list of partitions. Returns a list of proplists each of which at least contain property partition to identify the name of the partition. Other properties may exist to contain information about the partition (as per the MPD protocol spec).
Example return value: [[{partition,<<"default">>}]]listplaylist(C::mpd_conn(), Name::string()) -> [binary()] | {error, any_error()}
Lists the files in the playlist Name.m3u.
listplaylistinfo(C::mpd_conn(), Name::string()) -> list() | {error, any_error()}
Lists the songs in the playlist Name.m3u.
listplaylists(C::mpd_conn()) -> list() | {error, any_error()}
Prints a list of the playlist directory. After each playlist name the server sends its last modification time as "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.
load(C::mpd_conn(), Name::string()) -> ok | {error, any_error()}
Loads the playlist Name.m3u from the playlist directory and appends all tracks to the end of the current playlist.
lsinfo(C::mpd_conn()) -> list() | {error, any_error()}
Lists the contents of the root directory. This currently returns the list of stored playlists. This behavior is deprecated; use listplaylists instead.
lsinfo(C::mpd_conn(), Uri::string()) -> list() | {error, any_error()}
Lists the contents of the directory Uri.
move(C::mpd_conn(), From::{Start::integer(), End::integer()} | (From::integer()), To::integer()) -> ok | {error, any_error()}
Moves the songs in the range Start:End (referring to position in the playlist) to position To in the playlist. Available since MPD 0.15.
moveid(C::mpd_conn(), From::integer(), To::integer()) -> ok | {error, any_error()}
Moves the song with From (songid) to To (playlist index) in the playlist. If To is negative, it is relative to the current song in the playlist (if there is one).
moveoutput(C::mpd_conn(), Name::string()) -> ok | {error, any_error()}
Move an output to the current partition. Unlike other output-control functions this one takes the name of the output rather than the ID.
newpartition(C::mpd_conn(), Name::string()) -> ok | {error, any_error()}
Create a new partition.
next(C::mpd_conn()) -> ok | {error, any_error()}
Plays next song in the playlist
noidle(C::mpd_conn()) -> ok | {error, network_error()}
Interrupts an ongoing idle call and makes it return. In order for this to work reliably, it must only be called after idle_send/2 has completed. Since it can be hard to ensure this ordering when using the idle/2 and idle/1 calls alone, users of this API function are advised to keep track of the state of the connection by using the more fine-grained idle invocations provided by the idle_send/2 and idle_receive/1 APIs.
notcommands(C::mpd_conn()) -> [binary()] | {error, any_error()}
Shows which commands the current user does not have access to
outputs(C::mpd_conn()) -> list() | {error, any_error()}
Shows information about all outputs.
partition(C::mpd_conn(), Name::string()) -> ok | {error, any_error()}
Switch the client to a different partition.
password(C::mpd_conn(), Password::string()) -> ok | {error, any_error()}
This is used for authentication with the server. Password is simply the plaintext password.
pause(C::mpd_conn(), X2::boolean()) -> ok | {error, any_error()}
Sets pause state. Toggles pause/resumes playing.
ping(C::mpd_conn()) -> ok | {error, any_error()}
Does nothing but return ok.
play(C::mpd_conn()) -> ok | {error, any_error()}
Begins playling playlist.
play(C::mpd_conn(), Pos::integer()) -> ok | {error, any_error()}
Begins playling playlist at song number Pos.
playid(C::mpd_conn()) -> ok | {error, any_error()}
Begins playling playlist.
playid(C::mpd_conn(), Id::integer()) -> ok | {error, any_error()}
Begins playling playlist at song with songid Id.
playlist(C::mpd_conn()) -> [binary()]
Displays the current playlist. Note: Do not use this, instead use playlistinfo.
playlistadd(C::mpd_conn(), Name::string(), Uri::string()) -> ok | {error, any_error()}
Adds URI to the playlist Name.m3u. Name.m3u will be created if it does not exist.
playlistclear(C::mpd_conn(), Name::string()) -> ok | {error, any_error()}
Clears the playlist Name.m3u.
playlistdelete(C::mpd_conn(), Name::string(), PlaylistPos::integer()) -> ok | {error, any_error()}
Deletes PlaylistPos from the playlist Name.m3u.
playlistfind(C::mpd_conn(), Tag::tag(), X::string()) -> list() | {error, any_error()}
Finds songs in the current playlist with strict matching. Tag can be artist | album | title | track | genre | disc | date ... consiting of an atom representing most song meta tags (including MUSICBRAINZ data)
playlistid(C::mpd_conn()) -> list() | {error, any_error()}
Displays a list of songs in the playlist.
playlistid(C::mpd_conn(), Id::integer()) -> list() | {error, any_error()}
Displays info for song in playlist with specified id.
playlistinfo(C::mpd_conn()) -> list() | {error, any_error()}
Displays a list of all songs in the playlist.
playlistinfo(C::mpd_conn(), PlaylistPos::{Start::integer(), End::integer()} | (PlaylistPos::integer())) -> list() | {error, any_error()}
Displays a list of songs between Start and End positions in the playlist (exclusive of end position). Available since MPD 0.15.
playlistmove(C::mpd_conn(), Name::string(), SongId::string(), PlaylistPos::integer()) -> ok | {error, any_error()}
Moves SongId in the playlist Name.m3u, to the postion PlaylistPos.
playlistsearch(C::mpd_conn(), Tag::tag(), X::string()) -> list() | {error, any_error()}
Searches case-sensitively for partial matches in the current playlist.
plchanges(C::mpd_conn(), Ver::integer()) -> list() | {error, any_error()}
Displays changed songs currently in the playlist since Ver. To detect songs that were deleted at the end of the playlist, use playlistlength returned by status command.
plchangesposid(C::mpd_conn(), Ver::integer()) -> list() | {error, any_error()}
Displays changed songs currently in the playlist since Ver. This function only returns the position and the id of the changed song, not the complete metadata. This is more bandwidth efficient. To detect songs that were deleted at the end of the playlist, use playlistlength returned by status command.
previous(C::mpd_conn()) -> ok | {error, any_error()}
Plays previous song in the playlist.
random(C::mpd_conn(), X2::boolean()) -> ok | {error, any_error()}
Sets random state.
readpicture(C::mpd_conn(), URI::string()) -> {unknown | binary(), iolist()} | {error, any_error() | enosize}
Queries the picture for the given song and returns an iolist with the file contents.
The first part of a successful return value for this function is either the atom unknown or a string with the MIME type of the file if this was provied by MPD.
Note that the iolist is empty in event that MPD doesn't have any album art associated to the given URI but the command executed syuccessfully.rename(C::mpd_conn(), Name::string(), NewName::string()) -> ok | {error, any_error()}
Renames the playlist Name.m3u to NewName.m3u.
repeat(C::mpd_conn(), X2::boolean()) -> ok | {error, any_error()}
Sets repeat state.
rm(C::mpd_conn(), Name::string()) -> ok | {error, any_error()}
Removes the playlist NAME.m3u from the playlist directory.
save(C::mpd_conn(), Name::string()) -> ok | {error, any_error()}
Saves the current playlist to Name.m3u in the playlist directory.
search(C::mpd_conn(), Filter::filter()) -> list() | {error, any_error()}
Searches songs in the db that match the given filter It is similar to find/2, but case-insensitive.
search(C::mpd_conn(), Tag::tag(), What::string()) -> list() | {error, any_error()}
Searches for any song with a the specified tag's value containing What.
seek(C::mpd_conn(), PlaylistPos::integer(), SeekSecs::integer()) -> ok | {error, any_error()}
Seeks to the position SeekSecs (in seconds) of entry PlaylistPos in the playlist.
seekid(C::mpd_conn(), SongId::integer(), SeekSecs::integer()) -> ok | {error, any_error()}
Seeks to the position SeekSecs (in seconds) of song SongId.
setvol(C::mpd_conn(), Vol::integer()) -> ok | {error, any_error()}
Sets volume to Vol, the range of volume is 0-100.
shuffle(C::mpd_conn()) -> ok | {error, any_error()}
Shuffles the current playlist.
shuffle(C::mpd_conn(), X2::{Start::integer(), End::integer()}) -> ok | {error, any_error()}
Shuffles the songs between the Start and End positions in the current playlist. Available since MPD 0.15.
single(C::mpd_conn(), State::boolean()) -> ok | {error, any_error()}
Sets single state. When single is activated, playback is stopped after current song, or song is repeated if the 'repeat' mode is enabled. Available since MPD 0.15.
stats(C::mpd_conn()) -> list() | {error, any_error()}
Displays statistics. Returns a proplist containing a subset of the following:
status(C::mpd_conn()) -> list() | {error, any_error()}
Reports the current status of the player and the volume level. Returns a proplist containing a subset of the following:
sticker_delete(C, Type, Uri) -> any()
Delete all stickers associated to the given type and URI.
sticker_delete(C, Type, Uri, Name) -> any()
Delete specific sticker by Type, URI and Name.
sticker_find(C::mpd_conn(), Type::string(), Uri::string(), Name::string()) -> [[{atom(), string()}]] | {error, any_error()}
Search for stickers of the specified type and name below the specified URI prefix (can be empty to retrieve all stickers).
Upon success, a list of property lists is returned. Each inner list contains one key (file) to identify the URI and all the associated key-value pairs as parsed from the stickers.sticker_find(C::mpd_conn(), Type::string(), Uri::string(), Name::string(), Op::sticker_op(), CompareValue::string(), Options::[window_option() | sticker_sort_option()]) -> [[{atom(), string()}]] | {error, any_error()}
Like sticker_find/4 but additionally allows specifying exactly one operator to compare the sticker against and also offers search ordering and pagination capabilities.
sticker_get(C::mpd_conn(), Type::string(), Uri::string(), Name::string()) -> string() | {error, any_error()}
Get value of specific sticker by Type, URI and Name.
sticker_list(C::mpd_conn(), Type::string(), Uri::string()) -> [{atom(), string()}] | {error, any_error()}
Retrieve all stickers associated to the given type and URI.
sticker_set(C::mpd_conn(), Type::string(), Uri::string(), Name::string(), Value::string()) -> ok | {error, any_error()}
Assign sticker value by Type, URI and Name.
stop(C::mpd_conn()) -> ok | {error, any_error()}
Stops playing.
swap(C::mpd_conn(), PlaylistPos1::integer(), PlaylistPos2::integer()) -> ok | {error, any_error()}
Swaps the positions of songs at PlaylistPos1 and PlaylistPos2.
swapid(C::mpd_conn(), SongId1::integer(), SongId2::integer()) -> ok | {error, any_error()}
Swaps the positions of songs SongId1 and SongId2.
tagtypes(C::mpd_conn()) -> [binary()] | {error, any_error()}
Shows a list of available song metadata.
toggleoutput(C::mpd_conn(), OutputId::integer()) -> ok | {error, any_error()}
Toggles output with id OutputId
update(C::mpd_conn()) -> integer() | {error, any_error()}
Updates the music database. Returns the job id requested for your update, which is displayed in status, while the requested update is happening.
update(C::mpd_conn(), Uri::string()) -> integer() | {error, any_error()}
Updates the music database. Uri is a particular directory or song/file to update. Returns the job id requested for your update, which is displayed in status, while the requested update is happening.
urlhandlers(C::mpd_conn()) -> [binary()] | {error, any_error()}
Gets a list of available URL handlers.
version(Connection::mpd_conn()) -> string()
Returns a string representing the MPD version number for Connection
Generated by EDoc