Next: , Previous: Emms Mode Line, Up: Top


25 Music Player Daemon

Emms provides an interface to the Music Player Daemon(MusicPD) software. The package is called `emms-player-mpd' and is provided by the file emms-player-mpd.el.

The advantages of using MusicPD as an EMMS backend include the following.

Setup

To load `emms-player-mpd' invoke:

     (require 'emms-player-mpd)

Set the variables emms-player-mpd-server-name and emms-player-mpd-server-port to the location and port (respectively) of your MusicPD server. For example:

     (setq emms-player-mpd-server-name "localhost")
     (setq emms-player-mpd-server-port "6600")

If your MusicPD setup requires a password, you will to set emms-player-mpd-server-password as follows.

     (setq emms-player-mpd-server-password "mypassword")

To get track information from MusicPD, invoke the following:

     (add-to-list 'emms-info-functions 'emms-info-mpd)

Adding `emms-player-mpd' to your Emms player list is accomplished by invoking:

     (add-to-list 'emms-player-list 'emms-player-mpd)

If you use absolute file names in your m3u playlists (which is most likely), make sure you set emms-player-mpd-music-directory to the value of "music_directory" from your MusicPD config. There are additional options available as well, but the defaults should be sufficient for most uses.

You can set emms-player-mpd-sync-playlist to nil if your master EMMS playlist contains only stored playlists.

Commands provided

— Function: emms-player-mpd-connect

Connect to MusicPD and retrieve its current playlist. Afterward, the status of MusicPD will be tracked.

— Function: emms-player-mpd-disconnect

Terminate the MusicPD client process and disconnect from MusicPD.

— Function: emms-player-mpd-show &optional insertp

Describe the current EMMS track in the minibuffer. If INSERTP is non-nil, insert the description into the current buffer instead. This function uses emms-show-format to format the current track. It differs from emms-show in that it asks MusicPD for the current track, rather than Emms.

Updating the MusicPD database
— Function: emms-player-mpd-update-directory dir

Cause the tracks in DIR to be updated in the MusicPD database.

— Function: emms-player-mpd-update-all

Cause all tracks in the MusicPD music directory to be updated in the MusicPD database.

emms-cache.el integration
— Function: emms-cache-set-from-mpd-directory dir

Dump all MusicPD data from DIR into the EMMS cache. This is useful to do when you have recently acquired new music.

— Function: emms-cache-set-from-mpd-all

Dump all MusicPD data into the EMMS cache. This is useful to do once, just before using emms-browser.el, in order to prime the cache.

emms-volume.el integration

To activate this, add the following to your .emacs.

     (require 'emms-volume)
     (setq emms-volume-change-function 'emms-volume-mpd-change)