### Mount Storage Example Source: https://github.com/musicplayerdaemon/mpc/blob/master/doc/index.md Examples demonstrating how to mount different types of storage. The first example shows mounting an NFS share, and the second shows mounting a udisks device. ```bash mpc mount server nfs://10.0.0.5/mp3 mpc mount stick udisks://by-id-ata-FOO-part2 ``` -------------------------------- ### Install mpc from Source using Meson and Ninja Source: https://github.com/musicplayerdaemon/mpc/blob/master/README.rst Steps to compile and install mpc from source. Requires a C99 compiler, libmpdclient 2.18, Meson 0.47, and Ninja. ```bash meson . output ``` ```bash ninja -C output ``` ```bash ninja -C output install ``` -------------------------------- ### Build and Install mpc Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Instructions for configuring, compiling, and installing the mpc command-line tool using Meson and Ninja. Options to disable features like documentation or iconv are shown. ```bash # Configure (Meson) meson setup build ``` ```bash # Compile ninja -C build ``` ```bash # Install to system sudo ninja -C build install ``` ```bash # Build with iconv disabled meson setup build -Diconv=disabled ``` ```bash # Build without documentation meson setup build -Ddocumentation=false ``` -------------------------------- ### List Neighbors Example Source: https://github.com/musicplayerdaemon/mpc/blob/master/doc/index.md Demonstrates listing automatically detected storages that can be mounted. This requires enabling neighbor plugins in mpd.conf. ```bash $ mpc listneighbors upnp://uuid:01234567-89ab-cdef-0123-456789abcdef/urn:schemas-upnp-org:service:ContentDirectory:1 udisks://by-id-dm-name-_dev_sdb3 udisks://by-id-ata-FOO-part2 ``` -------------------------------- ### Format current song with artist and title Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Use the `--format` option to specify how song information is displayed. This example shows how to display the artist and title of the currently playing song. ```bash mpc --format "%artist% - %title%" current ``` -------------------------------- ### Search Queue and Play Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Find a song in the current queue based on tags and start playing it immediately. Can search by any tag or specific tag types. ```bash # Search by any tag mpc searchplay "Coltrane" # Search by specific tag type mpc searchplay artist "Coltrane" album "A Love Supreme" ``` -------------------------------- ### Play song at queue position Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Start playback at a specific 1-based queue position. If no position is given, it resumes from the current position. ```bash mpc play 5 ``` -------------------------------- ### Control Replay Gain mode Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Get or set the Replay Gain mode to 'off', 'track', or 'album'. ```bash mpc replaygain ``` ```bash mpc replaygain track ``` ```bash mpc replaygain album ``` ```bash mpc replaygain off ``` -------------------------------- ### Manage Song Stickers Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Stickers are key/value metadata for songs, separate from audio tags. Use 'set', 'get', 'list', 'delete', or 'find' actions. ```bash # Set a sticker mpc sticker "Jazz/Miles Davis/so-what.flac" set rating 5 mpc sticker "Jazz/Miles Davis/so-what.flac" set lastplayed "2024-01-15" ``` ```bash # Get a sticker value mpc sticker "Jazz/Miles Davis/so-what.flac" get rating ``` ```bash # List all stickers on a song mpc sticker "Jazz/Miles Davis/so-what.flac" list ``` ```bash # Delete a sticker mpc sticker "Jazz/Miles Davis/so-what.flac" delete rating ``` ```bash # Find all songs under a directory that have the "rating" sticker mpc sticker "Jazz" find rating ``` -------------------------------- ### Sticker Commands Source: https://github.com/musicplayerdaemon/mpc/blob/master/doc/index.md Commands for getting, setting, listing, and deleting song stickers, as well as searching for stickers. ```APIDOC ## sticker set ### Description Sets the value of a sticker for a specific song file. ### Method sticker set ### Endpoint N/A (Command-line client) ### Parameters #### Path Parameters - **file** (string) - Required - The song file. - **key** (string) - Required - The name of the sticker. - **value** (string) - Required - The value to set for the sticker. ``` ```APIDOC ## sticker get ### Description Retrieves and prints the value of a sticker for a specific song file. ### Method sticker get ### Endpoint N/A (Command-line client) ### Parameters #### Path Parameters - **file** (string) - Required - The song file. - **key** (string) - Required - The name of the sticker to retrieve. ``` ```APIDOC ## sticker list ### Description Lists all stickers associated with a specific song file. ### Method sticker list ### Endpoint N/A (Command-line client) ### Parameters #### Path Parameters - **file** (string) - Required - The song file. ``` ```APIDOC ## sticker delete ### Description Deletes a specific sticker from a song file. ### Method sticker delete ### Endpoint N/A (Command-line client) ### Parameters #### Path Parameters - **file** (string) - Required - The song file. - **key** (string) - Required - The name of the sticker to delete. ``` ```APIDOC ## sticker find ### Description Searches for stickers with a specified name within a given directory and its subdirectories. ### Method sticker find ### Endpoint N/A (Command-line client) ### Parameters #### Path Parameters - **dir** (string) - Required - The directory to start the search from. - **key** (string) - Required - The name of the sticker to search for. ``` -------------------------------- ### Set and get crossfade duration Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Set the crossfade duration in seconds or print the current crossfade value. ```bash mpc crossfade 5 ``` ```bash mpc crossfade ``` -------------------------------- ### Toggle play/pause state Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Switches between playing and paused states. If the player is stopped, it starts playback from the beginning. ```bash mpc toggle ``` -------------------------------- ### Get current volume Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Prints the current volume level of the MPD server when executed without any arguments. ```bash mpc volume ``` -------------------------------- ### Get MPD Protocol Version Source: https://context7.com/musicplayerdaemon/mpc/llms.txt The 'version' command retrieves the MPD protocol version, not the MPD daemon's software version. ```bash mpc version ``` -------------------------------- ### List all mounts Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Displays a list of all currently configured storage mounts in MPD. ```bash mpc mount ``` -------------------------------- ### Database and Server Statistics with mpc stats Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Displays statistics about the music library database and server uptime. ```bash mpc stats ``` -------------------------------- ### List All Songs Recursively with mpc listall Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Lists every song path recursively below a given path or the entire library. Use --format to fetch full metadata. ```bash mpc listall ``` ```bash mpc listall "Jazz/Miles Davis" ``` ```bash mpc --format "%artist% - %title%" listall "Jazz" ``` -------------------------------- ### List available audio outputs Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Displays a list of all configured audio outputs, indicating whether each is enabled or disabled, along with its plugin and device information. ```bash mpc outputs ``` -------------------------------- ### List Discoverable Mounts Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Discovers and lists available storage devices that can be mounted. Requires neighbor plugins to be configured in mpd.conf. ```bash mpc listneighbors ``` -------------------------------- ### List Files and Directories with mpc ls Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Lists files and subdirectories within a given directory, defaulting to the root. Use --format to specify output. ```bash mpc ls ``` ```bash mpc ls "Jazz" ``` ```bash mpc ls "Jazz/Miles Davis" ``` ```bash mpc --format "%file%" ls "Jazz" ``` -------------------------------- ### Queue Commands Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Commands for managing the playback queue. ```APIDOC ## add — Add songs to the queue Adds one or more files, directories, or URLs to the end of the queue. Reads paths from stdin when piped. ### Usage ```bash # Add a single track mpc add "Jazz/Miles Davis/Kind of Blue/01 - So What.flac" # Add an entire album directory mpc add "Jazz/Miles Davis/Kind of Blue" # Add every song in the library mpc add / # Add via pipe from find/search results mpc search artist "Miles Davis" | mpc add ``` ``` ```APIDOC ## insert — Insert after the current song Works like `add` but places the new song(s) immediately after the currently playing track (after the queued song when in random mode). ### Usage ```bash mpc insert "Rock/Beatles/Abbey Road/07 - Here Comes The Sun.flac" ``` ``` ```APIDOC ## del — Remove songs from the queue Removes one or more songs by 1-based position or range. Position `0` removes the currently playing song. ### Usage ```bash # Remove position 3 mpc del 3 # Remove the currently playing song mpc del 0 # Remove a range (positions 2 through 5 inclusive) mpc del 2-5 ``` ``` ```APIDOC ## move / mv — Reorder the queue Moves the song at position `` to position `` (both 1-based). ### Usage ```bash mpc move 4 1 # bring track 4 to the top mpc mv 7 2 ``` ``` ```APIDOC ## crop — Remove all but the current song Deletes every queue entry except the currently playing song. ### Usage ```bash mpc crop ``` ``` ```APIDOC ## clear — Empty the queue Removes all songs from the queue. ### Usage ```bash mpc clear ``` ``` ```APIDOC ## shuffle — Randomize the queue Shuffles all songs in the current queue in place. ### Usage ```bash mpc shuffle ``` ``` ```APIDOC ## playlist — List queue contents Prints all songs in the current queue (or in a named stored playlist) using the current format. ### Usage ```bash # Print the current queue mpc playlist # Print a stored playlist named "chill" mpc playlist chill # Use a custom format mpc --format "%position%. %artist% - %title% (%time%)" playlist # Output: # 1. Miles Davis - So What (9:22) # 2. John Coltrane - A Love Supreme, Pt. 1 (7:04) ``` ``` ```APIDOC ## searchplay — Search queue and play Searches the current queue for a matching song and immediately begins playing it. ### Usage ```bash # Search by any tag mpc searchplay "Coltrane" # Search by specific tag type mpc searchplay artist "Coltrane" album "A Love Supreme" ``` ``` ```APIDOC ## prio — Set song priority Assigns a priority (0–255) to one or more queue positions. Higher priority songs are played first in random mode. ### Usage ```bash # Give position 3 the highest priority mpc prio 255 3 # Lower priority for positions 5 and 7 mpc prio 10 5 7 ``` ``` ```APIDOC ## current — Show the playing song Prints the currently playing or paused song according to the active format. With `--wait`, blocks until the song changes. ### Usage ```bash mpc current # Output: Miles Davis - So What # Block until the song changes, then print the new one mpc --wait current ``` ``` ```APIDOC ## queued — Show the next song Prints the song that will play next. ### Usage ```bash mpc queued # Output: John Coltrane - A Love Supreme ``` ``` -------------------------------- ### Manage MPD Partitions Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Commands to list, create, and delete MPD partitions. Partitions allow for separate playlist management or configurations. ```bash mpc partitions ``` ```bash mpc makepart kitchen bedroom ``` ```bash mpc delpart kitchen ``` -------------------------------- ### Mount Commands Source: https://github.com/musicplayerdaemon/mpc/blob/master/doc/index.md Commands for managing storage mounts, including listing, creating, and removing mounts. ```APIDOC ## mount ### Description Lists all currently configured storage mounts. ### Method mount ### Endpoint N/A (Command-line client) ``` ```APIDOC ## mount ### Description Creates a new storage mount, associating a mount path with a storage URI. ### Method mount ### Endpoint N/A (Command-line client) ### Parameters #### Path Parameters - **mount-path** (string) - Required - The path where the storage will be mounted. - **storage-uri** (string) - Required - The URI of the storage to mount (e.g., nfs://..., udisks://...). ``` ```APIDOC ## unmount ### Description Removes an existing storage mount. ### Method unmount ### Endpoint N/A (Command-line client) ### Parameters #### Path Parameters - **mount-path** (string) - Required - The path of the mount to remove. ``` ```APIDOC ## listneighbors ### Description Prints a list of automatically detected storages that can be mounted. Requires neighbor plugins to be enabled in mpd.conf. ### Method listneighbors ### Endpoint N/A (Command-line client) ``` -------------------------------- ### Show Next Song in Queue Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Print the title of the song that is scheduled to play next in the queue. ```bash mpc queued # Output: John Coltrane - A Love Supreme ``` -------------------------------- ### Set custom song format Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Use the --format flag to specify a custom format string for displaying song information. ```bash mpc --format "[[%artist% - ]%title%]|[%file%]" current ``` -------------------------------- ### Display All Known Tag Names with mpc tags Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Prints the complete list of tag names understood by mpc and MPD. ```bash mpc tags ``` -------------------------------- ### Skip to next or previous track Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Advance to the next track in the queue or go back to the previous track. ```bash mpc next ``` ```bash mpc prev ``` -------------------------------- ### Format playlist with multi-tag information Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Displays the song's position in the queue, artist, title, album, and duration. The duration is shown in M:SS format. ```bash mpc --format "%position%. %artist% - %title% [%album%] (%time%)" playlist ``` -------------------------------- ### Use abstract Linux socket for connection Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Connect to MPD using an abstract Linux socket path with the --host flag. ```bash mpc --host=@/run/mpd/socket status ``` -------------------------------- ### Use environment variables for MPD connection and format Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Configure MPD host, port, and output format using environment variables MPD_HOST, MPD_PORT, and MPC_FORMAT. The client will use these if flags are not provided. ```bash export MPD_HOST="mypassword@mpd.local" export MPD_PORT=6600 export MPC_FORMAT="%artist% – %title%" mpc current ``` -------------------------------- ### Enable an audio output by number or name Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Enables a specific audio output. You can refer to the output by its numerical index (1-based) or its name. ```bash mpc enable 1 ``` ```bash mpc disable "Bluetooth Speaker" ``` -------------------------------- ### Find and Add to Queue with mpc findadd Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Finds songs with exact tag matches and appends them to the current playback queue. ```bash mpc findadd artist "Miles Davis" ``` ```bash mpc findadd genre "Jazz" date "1959" ``` -------------------------------- ### Search and Add to Queue with mpc searchadd Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Appends songs to the current queue using substring matching for tag values. ```bash mpc searchadd artist "Davis" ``` -------------------------------- ### List All Stored Playlists Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Display the names of all `.m3u` playlists available in MPD's playlist directory. ```bash mpc lsplaylists # Output: # jazz-classics # workout # chill ``` -------------------------------- ### Add Songs to the Queue Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Add files, directories, or URLs to the end of the playback queue. Reads from stdin when piped. Use '/' to add all songs in the library. ```bash # Add a single track mpc add "Jazz/Miles Davis/Kind of Blue/01 - So What.flac" # Add an entire album directory mpc add "Jazz/Miles Davis/Kind of Blue" # Add every song in the library mpc add / # Add via pipe from find/search results mpc search artist "Miles Davis" | mpc add ``` -------------------------------- ### File Commands Source: https://github.com/musicplayerdaemon/mpc/blob/master/doc/index.md Commands for handling album art and embedded pictures from music files. ```APIDOC ## albumart ### Description Downloads the album art for a given song and outputs it to stdout. ### Method albumart ### Endpoint N/A (Command-line client) ### Parameters #### Path Parameters - **file** (string) - Required - The song file to get album art for. ``` ```APIDOC ## readpicture ### Description Downloads a picture embedded within a given song file and outputs it to stdout. ### Method readpicture ### Endpoint N/A (Command-line client) ### Parameters #### Path Parameters - **file** (string) - Required - The song file to read the embedded picture from. ``` -------------------------------- ### Control playback modes (repeat, random, single, consume) Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Toggle or set playback modes like repeat, random, single, and consume. 'single' and 'consume' also support 'once' for single-song operations. ```bash mpc random ``` ```bash mpc repeat on ``` ```bash mpc single once ``` ```bash mpc consume off ``` -------------------------------- ### Connect to remote MPD server with password Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Use the --host and --port flags to connect to a remote MPD server. A password can be included in the host string. ```bash mpc --host=secret@192.168.1.10 --port=6601 status ``` -------------------------------- ### CD-style previous track navigation Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Goes to the previous track only if less than 3 seconds have elapsed in the current track. Otherwise, it seeks to the beginning of the current track. ```bash mpc cdprev ``` -------------------------------- ### Enable mpc Bash-completion Source: https://github.com/musicplayerdaemon/mpc/blob/master/README.rst Copy the contents of mpc-bashrc to your ~/.bashrc file to enable tab-completion for mpc commands. ```bash cp mpc-bashrc ~/.bashrc ``` -------------------------------- ### Playlist Commands Source: https://github.com/musicplayerdaemon/mpc/blob/master/doc/index.md Commands for managing playlists, including loading, saving, listing, adding, removing, and renaming songs within playlists. ```APIDOC ## load ### Description Loads a file as the current playback queue. Supports loading a portion of a file using the --range option. ### Method load ### Endpoint N/A (Command-line client) ### Parameters #### Path Parameters - **file** (string) - Required - The file to load as a playlist. #### Query Parameters - **--range** (string) - Optional - Specifies a portion of the file to load. ``` ```APIDOC ## lsplaylists ### Description Lists all available playlists. ### Method lsplaylists ### Endpoint N/A (Command-line client) ``` ```APIDOC ## playlist [] ### Description Lists all songs in a specified playlist, or the current queue if no playlist is specified. ### Method playlist ### Endpoint N/A (Command-line client) ### Parameters #### Path Parameters - **playlist** (string) - Optional - The name of the playlist to list. ``` ```APIDOC ## rm ### Description Deletes a specific playlist file. ### Method rm ### Endpoint N/A (Command-line client) ### Parameters #### Path Parameters - **file** (string) - Required - The name of the playlist file to delete. ``` ```APIDOC ## save ### Description Saves the current playback queue as a playlist file. ### Method save ### Endpoint N/A (Command-line client) ### Parameters #### Path Parameters - **file** (string) - Required - The name of the file to save the playlist to. ``` ```APIDOC ## addplaylist ### Description Adds a song from the music database to a specified playlist. Creates the playlist if it does not exist. Can also read input from pipes. ### Method addplaylist ### Endpoint N/A (Command-line client) ### Parameters #### Path Parameters - **playlist** (string) - Required - The name of the playlist to add the song to. - **file** (string) - Required - The song to add. ``` ```APIDOC ## delplaylist ### Description Removes a song at a specific position from a playlist. Can also read input from pipes. ### Method delplaylist ### Endpoint N/A (Command-line client) ### Parameters #### Path Parameters - **playlist** (string) - Required - The name of the playlist. - **songpos** (integer) - Required - The position of the song to remove. ``` ```APIDOC ## moveplaylist ### Description Moves a song from one position to another within a playlist. ### Method moveplaylist ### Endpoint N/A (Command-line client) ### Parameters #### Path Parameters - **playlist** (string) - Required - The name of the playlist. - **from** (integer) - Required - The current position of the song. - **to** (integer) - Required - The new position for the song. ``` ```APIDOC ## renplaylist ### Description Renames an existing playlist. ### Method renplaylist ### Endpoint N/A (Command-line client) ### Parameters #### Path Parameters - **playlist** (string) - Required - The current name of the playlist. - **new playlist** (string) - Required - The new name for the playlist. ``` ```APIDOC ## clearplaylist ### Description Clears all songs from a specified playlist. ### Method clearplaylist ### Endpoint N/A (Command-line client) ### Parameters #### Path Parameters - **playlist** (string) - Required - The name of the playlist to clear. ``` -------------------------------- ### Save Current Queue as Playlist Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Save the current playback queue as a named `.m3u` playlist in MPD's playlist directory. ```bash mpc save my-playlist ``` -------------------------------- ### Database Commands Source: https://github.com/musicplayerdaemon/mpc/blob/master/doc/index.md Commands for interacting with the music database, including listing, searching, and updating music information. ```APIDOC ## listall [] ### Description Lists all songs in the music database, or a specific file if provided. ### Method listall ### Endpoint N/A (Command-line client) ### Parameters #### Path Parameters - **file** (string) - Optional - The specific file to list from the database. ``` ```APIDOC ## ls [] ### Description Lists all files and folders in a specified directory, or the music directory if none is provided. ### Method ls ### Endpoint N/A (Command-line client) ### Parameters #### Path Parameters - **directory** (string) - Optional - The directory to list contents from. ``` ```APIDOC ## lsdirs [] ### Description Lists subdirectories within a specified directory, or the main music directory if none is provided. ### Method lsdirs ### Endpoint N/A (Command-line client) ### Parameters #### Path Parameters - **directory** (string) - Optional - The directory to list subdirectories from. ``` ```APIDOC ## search [ ]... ### Description Searches for songs in the database based on specified tag types and queries (substring match). ### Method search ### Endpoint N/A (Command-line client) ### Parameters #### Path Parameters - **type** (string) - Required - The tag type to search (e.g., artist, album, title). - **query** (string) - Required - The search query for the specified tag type. - **[type] ** - Optional - Additional tag type and query pairs for refined searching. ``` ```APIDOC ## search ### Description Searches for songs using a filter expression. Supports complex boolean logic. Requires libmpdclient 2.16 and MPD 0.21. ### Method search ### Endpoint N/A (Command-line client) ### Parameters #### Path Parameters - **expression** (string) - Required - A filter expression (e.g., '((artist == "Kraftwerk") AND (title == "Metall auf Metall"))'). ``` ```APIDOC ## find [ ]... ### Description Finds songs in the database where tag values exactly match the provided queries. Similar to `search` but requires exact matches. ### Method find ### Endpoint N/A (Command-line client) ### Parameters #### Path Parameters - **type** (string) - Required - The tag type to search (e.g., artist, album, title). - **query** (string) - Required - The exact query for the specified tag type. - **[type] ** - Optional - Additional tag type and query pairs for refined searching. ``` ```APIDOC ## findadd [ ]... ### Description Finds songs in the database with exact tag matches and adds them to the current playback queue. ### Method findadd ### Endpoint N/A (Command-line client) ### Parameters #### Path Parameters - **type** (string) - Required - The tag type to search (e.g., artist, album, title). - **query** (string) - Required - The exact query for the specified tag type. - **[type] ** - Optional - Additional tag type and query pairs for refined searching. ``` ```APIDOC ## list [ ]... [group ]... ### Description Returns a list of tags of a specified type, optionally filtered by other tags and grouped by specified tags. ### Method list ### Endpoint N/A (Command-line client) ### Parameters #### Path Parameters - **type** (string) - Required - The tag type to list (e.g., album, artist). - **[type] ** - Optional - Additional tag types and queries to filter the results. - **group ** - Optional - One or more tag types to group the results by. ``` ```APIDOC ## tags ### Description Displays all MPD tags known by the mpc client. ### Method tags ### Endpoint N/A (Command-line client) ``` ```APIDOC ## stats ### Description Displays statistics about the Music Player Daemon. ### Method stats ### Endpoint N/A (Command-line client) ``` ```APIDOC ## update [--wait] [] ### Description Scans the music directory for updated files and updates the database. Optionally waits for the update to complete and can limit the scope to a specific path. ### Method update ### Endpoint N/A (Command-line client) ### Parameters #### Path Parameters - **path** (string) - Optional - The path within the music directory to limit the update scope. #### Query Parameters - **--wait** - Optional - Wait for the database update to finish. ``` ```APIDOC ## rescan [--wait] [] ### Description Rescans the music directory, including unmodified files, and updates the database. Optionally waits for completion and can limit the scope to a specific path. ### Method rescan ### Endpoint N/A (Command-line client) ### Parameters #### Path Parameters - **path** (string) - Optional - The path within the music directory to limit the rescan scope. #### Query Parameters - **--wait** - Optional - Wait for the database rescan to finish. ``` -------------------------------- ### Persist song format using environment variable Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Sets the `MPC_FORMAT` environment variable to define the default song format. Subsequent `mpc` commands will use this format unless overridden. ```bash export MPC_FORMAT="[[%artist% - ]%title%]|[%file%]" mpc current ``` -------------------------------- ### List all songs with tab-separated format Source: https://context7.com/musicplayerdaemon/mpc/llms.txt This command lists all songs in the library, formatting the output with artist, title, and album separated by tabs. The output is redirected to a TSV file. ```bash mpc --format "%artist%\t%title%\t%album%" listall > library.tsv ``` -------------------------------- ### Update Music Directory with Wait Source: https://github.com/musicplayerdaemon/mpc/blob/master/doc/index.md Scan the music directory for updated files and wait for the MPD update process to complete. The optional path parameter can limit the scope of the update. ```bash mpc update --wait [] ``` -------------------------------- ### Load Stored Playlist Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Load an entire `.m3u` playlist from MPD's playlist directory into the current queue. Supports loading a specific range of tracks using '--range'. ```bash # Load the entire "jazz-classics" playlist mpc load jazz-classics # Load only tracks 3–7 (0-based, end-exclusive) mpc --range=2:7 load jazz-classics ``` -------------------------------- ### Manage MPD Channels for Messaging Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Commands to list subscribed channels, send messages to channels, subscribe to receive messages, and wait for a single message. ```bash mpc channels ``` ```bash mpc sendmessage notifications "playback started" ``` ```bash mpc subscribe notifications ``` ```bash mpc waitmessage control ``` -------------------------------- ### Stored Playlist Commands Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Commands for managing stored playlists. ```APIDOC ## load — Load a stored playlist into the queue Loads an `.m3u` playlist from MPD's playlist directory. The `--range` option loads only a slice. ### Usage ```bash # Load the entire "jazz-classics" playlist mpc load jazz-classics # Load only tracks 3–7 (0-based, end-exclusive) mpc --range=2:7 load jazz-classics ``` ``` ```APIDOC ## save — Save the queue as a stored playlist ### Usage ```bash mpc save my-playlist ``` ``` ```APIDOC ## rm — Delete a stored playlist ### Usage ```bash mpc rm old-playlist ``` ``` ```APIDOC ## lsplaylists — List all stored playlists ### Usage ```bash mpc lsplaylists # Output: # jazz-classics # workout # chill ``` ``` ```APIDOC ## addplaylist — Add songs to a stored playlist Adds files to a named playlist (creates it if it does not exist). ### Usage ```bash mpc addplaylist favorites "Rock/Led Zeppelin/IV/01 - Black Dog.flac" # Pipe search results into a playlist mpc search genre "Blues" | mpc addplaylist blues-mix ``` ``` ```APIDOC ## delplaylist — Remove a song from a stored playlist Deletes the song at a 1-based position from the named playlist. ### Usage ```bash mpc delplaylist favorites 3 ``` ``` ```APIDOC ## moveplaylist — Reorder a stored playlist ### Usage ```bash mpc moveplaylist favorites 5 1 ``` ``` ```APIDOC ## renplaylist — Rename a stored playlist ### Usage ```bash mpc renplaylist old-name new-name ``` ``` ```APIDOC ## clearplaylist — Empty a stored playlist ### Usage ```bash mpc clearplaylist favorites ``` ``` -------------------------------- ### MixRamp Settings Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Configure MixRamp overlap level and extra delay for gapless transitions. ```APIDOC ## mixrampdb / mixrampdelay — MixRamp settings Configure the MixRamp overlap level (dB) and extra delay (seconds) for gapless transitions between songs that have embedded MixRamp tags. ### Usage ```bash mpc mixrampdb -17.0 # overlap songs at -17 dB mpc mixrampdelay 2.0 # add 2 seconds of extra delay mpc mixrampdb # print current mixrampdb mpc mixrampdelay # print current mixrampdelay ``` ``` -------------------------------- ### List Subdirectories with mpc lsdirs Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Lists only the subdirectories within a specified path. Defaults to the root directory. ```bash mpc lsdirs ``` ```bash mpc lsdirs "Jazz" ``` -------------------------------- ### List Queue Contents Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Display the songs in the current queue or a named stored playlist. Supports custom output formatting. ```bash # Print the current queue mpc playlist # Print a stored playlist named "chill" mpc playlist chill # Use a custom format mpc --format "%position%. %artist% - %title% (%time%)" playlist ``` -------------------------------- ### Enable Bash Tab Completion Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Source the provided bash completion script to enable tab completion for mpc commands, options, and arguments like playlist names and filenames. ```bash # System-wide sudo cp contrib/mpc-completion.bash /etc/bash_completion.d/mpc ``` ```bash # Per-user source contrib/mpc-completion.bash # or add to ~/.bashrc ``` ```bash # After sourcing, tab completion works for: mpc pl # → mpc play / mpc playlist mpc load # → lists stored playlists mpc add Jazz/ # → lists music directory entries under Jazz/ mpc search ar # → artist album ... ``` -------------------------------- ### Print Playback Status with mpc status Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Prints the current playback status. Can be customized with format strings to display specific status variables like state, time, volume, and audio format. ```bash mpc status ``` ```bash mpc status "%state%: %artist% - %title% (%percenttime%%)" ``` ```bash mpc status "%audioformat% — %kbitrate%kbps" ``` ```bash mpc status "[%state%] %currenttime% / %totaltime% (%percenttime%%%) — vol: %volume%" ``` -------------------------------- ### List Albums Grouped by Artist Source: https://github.com/musicplayerdaemon/mpc/blob/master/doc/index.md Retrieve a list of albums, grouped by artist, from the music database. This command allows for structured retrieval of tag information. ```bash mpc list album group artist ``` -------------------------------- ### Show Currently Playing Song Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Display information about the song that is currently playing or paused. Use '--wait' to block until the song changes. ```bash mpc current # Output: Miles Davis - So What # Block until the song changes, then print the new one mpc --wait current ``` -------------------------------- ### List Tag Values with mpc list Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Returns all unique values for a given tag type, with optional constraints and grouping. Use 'group' to organize results. ```bash mpc list artist ``` ```bash mpc list album artist "Miles Davis" ``` ```bash mpc list album group artist ``` ```bash mpc list genre ``` -------------------------------- ### Add Songs to a Stored Playlist Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Add specified files to a named playlist. Creates the playlist if it does not exist. Can also pipe search results into a playlist. ```bash mpc addplaylist favorites "Rock/Led Zeppelin/IV/01 - Black Dog.flac" # Pipe search results into a playlist mpc search genre "Blues" | mpc addplaylist blues-mix ``` -------------------------------- ### Reorder Songs in the Queue Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Move a song from one position to another within the queue. Positions are 1-based. ```bash mpc move 4 1 # bring track 4 to the top mpc mv 7 2 ``` -------------------------------- ### Shuffle the Queue Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Randomize the order of all songs currently in the playback queue. ```bash mpc shuffle ``` -------------------------------- ### Configure MixRamp Overlap and Delay Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Set the MixRamp overlap level in dB and the extra delay in seconds for gapless transitions. Use without arguments to print the current values. ```bash mpc mixrampdb -17.0 mpc mixrampdelay 2.0 mpc mixrampdb mpc mixrampdelay ``` -------------------------------- ### Update Music Library Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Use 'mpc update' to refresh the entire music library. 'mpc --wait rescan' performs a full rescan and waits for its completion. ```bash mpc --wait rescan ``` ```bash mpc update ``` -------------------------------- ### Rename a Stored Playlist Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Change the name of an existing `.m3u` playlist. ```bash mpc renplaylist old-name new-name ``` -------------------------------- ### Reorder Songs in a Stored Playlist Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Move a song from one position to another within a named playlist. ```bash mpc moveplaylist favorites 5 1 ``` -------------------------------- ### Move audio output to a specific partition Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Assigns a specified audio output to a particular MPD partition. This is useful for managing multiple audio configurations. ```bash mpc --partition mypart moveoutput "ALSA" ``` -------------------------------- ### Set Song Priority Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Assign a priority level (0-255) to songs in the queue. Higher priorities are favored in random playback mode. ```bash # Give position 3 the highest priority mpc prio 255 3 # Lower priority for positions 5 and 7 mpc prio 10 5 7 ``` -------------------------------- ### Extract Album Art and Embedded Pictures Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Use 'albumart' or 'readpicture' to extract image data from audio files. The binary data is written to standard output. ```bash # Extract album art to a file mpc albumart "Jazz/Miles Davis/Kind of Blue/01 - So What.flac" > cover.jpg ``` ```bash # Extract embedded picture (e.g., FLAC PICTURE block) mpc readpicture "Jazz/Miles Davis/Kind of Blue/01 - So What.flac" > embedded.jpg ``` ```bash # Display with an image viewer mpc albumart "$(mpc --format %file% current)" | feh - ``` -------------------------------- ### Exact-Match Search with mpc find Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Performs an exact-match search (case-insensitive) on specified tag values. ```bash mpc find artist "Miles Davis" ``` ```bash mpc find genre "Jazz" date "1959" ``` -------------------------------- ### Format playlist with conditional artist and title Source: https://context7.com/musicplayerdaemon/mpc/llms.txt This format string conditionally displays the artist and title only if both tags are present in the song's metadata. ```bash mpc --format "[%artist% & %title%]" playlist ``` -------------------------------- ### Toggle audio output state Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Switches the state of a specified audio output between enabled and disabled. Accepts output number or name. ```bash mpc toggleoutput 2 ``` ```bash mpc toggleoutput "Bluetooth Speaker" ``` -------------------------------- ### Unmount a Mount Point Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Removes a previously mounted storage device. Use the same identifier provided during the 'mount' command. ```bash mpc unmount server ``` -------------------------------- ### Insert Songs After Current Song Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Insert songs into the queue immediately after the currently playing track. If in random mode, it inserts after the currently queued song. ```bash mpc insert "Rock/Beatles/Abbey Road/07 - Here Comes The Sun.flac" ``` -------------------------------- ### Update Music Database Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Trigger a scan of the music directory to refresh the MPD database. 'update' skips unmodified files, while 'rescan' re-reads everything. Use '--wait' to block until completion. Can target specific subdirectories. ```bash # Update only a subdirectory mpc update "Jazz/Miles Davis" ``` -------------------------------- ### Pause playback Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Pauses the currently playing stream. If the player is already paused, this command does nothing. ```bash mpc pause ``` -------------------------------- ### Adjust volume relatively Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Increases or decreases the current volume by a specified percentage. Use '+' to raise and '-' to lower. ```bash mpc volume +10 ``` ```bash mpc volume -5 ``` -------------------------------- ### Enable/disable outputs selectively Source: https://context7.com/musicplayerdaemon/mpc/llms.txt The `only` keyword modifies the `enable` or `disable` command to affect all other outputs. `enable only 2` enables output 2 and disables all others. ```bash mpc enable only 2 ``` ```bash mpc disable only "ALSA" ``` -------------------------------- ### Set absolute volume Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Sets the MPD server's volume to a specific percentage (0-100). ```bash mpc volume 75 ``` -------------------------------- ### Crop Queue to Current Song Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Remove all songs from the queue except for the one that is currently playing. ```bash mpc crop ``` -------------------------------- ### Substring Search with mpc search Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Searches the database for songs whose tags contain a query string. Multiple type/query pairs are ANDed. Supports MPD filter expressions for advanced queries. ```bash mpc search any "Kind of Blue" ``` ```bash mpc search artist "Miles Davis" ``` ```bash mpc search artist "Miles Davis" album "Kind of Blue" ``` ```bash mpc search filename "so-what" ``` ```bash mpc search '((artist == "Miles Davis") AND (album == "Kind of Blue"))' ``` -------------------------------- ### Continuously Monitor MPD Events Source: https://context7.com/musicplayerdaemon/mpc/llms.txt The 'idleloop' command continuously monitors for MPD events, re-entering the idle state after each event. Useful for real-time updates. ```bash # Log all events mpc idleloop | while read -r event; echo "$(date '+%T') $event" done ``` ```bash # Watch only player events and update a display mpc idleloop player | while read -r _; mpc --format "%artist% - %title%" current > /tmp/nowplaying done ``` -------------------------------- ### Wait for MPD Events Source: https://context7.com/musicplayerdaemon/mpc/llms.txt The 'idle' command blocks until a specified MPD event occurs, then prints the event name and exits. Useful for triggering actions based on state changes. ```bash # Wait for any event mpc idle ``` ```bash # Wait only for player or mixer events mpc idle player mixer ``` ```bash # React to queue changes in a shell loop while mpc idle playlist; do echo "Queue changed, new contents:" mpc playlist done ``` -------------------------------- ### Search with Filter Expression Source: https://github.com/musicplayerdaemon/mpc/blob/master/doc/index.md Use a filter expression for advanced searching within song tags. This syntax is also compatible with 'find' and 'findadd' commands. Requires libmpdclient 2.16 and MPD 0.21. ```bash mpc search '((artist == "Kraftwerk") AND (title == "Metall auf Metall"))' ``` -------------------------------- ### Empty a Stored Playlist Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Remove all songs from a named `.m3u` playlist. ```bash mpc clearplaylist favorites ``` -------------------------------- ### Clear the Playback Queue Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Remove all songs from the current playback queue. ```bash mpc clear ``` -------------------------------- ### Seek across track boundaries Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Seek relative to the current playback position, potentially crossing into the next or previous track if the seek duration exceeds track boundaries. ```bash mpc seekthrough +5:00 ``` ```bash mpc seekthrough -2:30 ``` -------------------------------- ### Delete a Stored Playlist Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Remove a named `.m3u` playlist from MPD's playlist directory. ```bash mpc rm old-playlist ``` -------------------------------- ### Remove Songs from the Queue Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Delete songs from the queue by their 1-based position or a range. Position '0' removes the currently playing song. ```bash # Remove position 3 mpc del 3 # Remove the currently playing song mpc del 0 # Remove a range (positions 2 through 5 inclusive) mpc del 2-5 ``` -------------------------------- ### Stop playback Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Stops the current playback and resets the elapsed position of the song. ```bash mpc stop ``` -------------------------------- ### Seek within the current song Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Seek to a specific position within the current song using absolute time, relative time, or percentage. Supports HH:MM:SS format. ```bash mpc seek 1:30 ``` ```bash mpc seek +15 ``` ```bash mpc seek -30 ``` ```bash mpc seek 50% ``` ```bash mpc seek 0:02:00 ``` -------------------------------- ### Remove Song from Stored Playlist Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Delete a song from a named playlist by its 1-based position. ```bash mpc delplaylist favorites 3 ``` -------------------------------- ### Conditional pause for scripts Source: https://context7.com/musicplayerdaemon/mpc/llms.txt Pauses playback only if the player is currently in the playing state. Exits with code 127 if not playing, useful for preventing accidental resumes in scripts. ```bash mpc pause-if-playing || echo "Was not playing" ``` -------------------------------- ### Suppress status line with --quiet Source: https://context7.com/musicplayerdaemon/mpc/llms.txt The --quiet flag suppresses the status line that is typically printed after most commands. ```bash mpc --quiet next ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.