diff options
author | Michael Olson <mwolson@gnu.org> | 2006-07-30 22:31:00 +0000 |
---|---|---|
committer | Michael Olson <mwolson@gnu.org> | 2006-07-30 22:31:00 +0000 |
commit | f7d41460d9077b0c553d63f17c702c659e3d53ee (patch) | |
tree | f878e98a27fc6362df83a379759e1ae71484dd87 | |
parent | aa9c184f2e41d831bed2c209112f4299ce27f58a (diff) |
emms-player-mpd: Add support for updating MusicPD's database and improve documentation.
darcs-hash:20060730223147-1bfb2-5e323fa65ecb32976db21c07a96143d36d65d7e8.gz
-rw-r--r-- | emms-player-mpd.el | 32 | ||||
-rw-r--r-- | emms.texinfo | 36 |
2 files changed, 62 insertions, 6 deletions
diff --git a/emms-player-mpd.el b/emms-player-mpd.el index 143f9bf..bf36757 100644 --- a/emms-player-mpd.el +++ b/emms-player-mpd.el @@ -1107,7 +1107,10 @@ The track should be an alist as per `emms-player-mpd-get-alist'." "Dump all MusicPD data from DIR into the EMMS cache. This is useful to do when you have recently acquired new music." (interactive - (list (read-string "Directory: "))) + (list (if emms-player-mpd-music-directory + (read-directory-name "Directory: " + emms-player-mpd-music-directory) + (read-string "Directory: ")))) (unless (string= dir "") (setq dir (emms-player-mpd-get-mpd-filename dir))) (if emms-cache-set-function @@ -1132,6 +1135,33 @@ order to prime the cache." (interactive) (emms-cache-set-from-mpd-directory "")) +;;; Updating tracks + +(defun emms-player-mpd-update-directory (dir) + "Cause the tracks in DIR to be updated in the MusicPD database." + (interactive + (list (if emms-player-mpd-music-directory + (read-directory-name "Directory: " + emms-player-mpd-music-directory) + (read-string "Directory: ")))) + (unless (string= dir "") + (setq dir (emms-player-mpd-get-mpd-filename dir))) + (emms-player-mpd-send + (concat "update " dir) nil + (lambda (closure response) + (let ((id (cdr (assoc "updating_db" + (emms-player-mpd-get-alist + (emms-player-mpd-parse-response response)))))) + (if id + (message "Updating DB with ID %s" id) + (message "Could not update the DB")))))) + +(defun emms-player-mpd-update-all () + "Cause all tracks in the MusicPD music directory to be updated in +the MusicPD database." + (interactive) + (emms-player-mpd-update-directory "")) + (provide 'emms-player-mpd) ;;; emms-player-mpd.el ends here diff --git a/emms.texinfo b/emms.texinfo index 5e9b897..9fe99d3 100644 --- a/emms.texinfo +++ b/emms.texinfo @@ -1150,7 +1150,7 @@ following. @item optional crossfade @end itemize -@subsubheading Setup +@subheading Setup To load `emms-player-mpd' invoke: @@ -1196,7 +1196,7 @@ sufficient for most uses. You can set @var{emms-player-mpd-sync-playlist} to nil if your master EMMS playlist contains only stored playlists. -@subsubheading Commands provided +@subheading Commands provided @defun emms-player-mpd-connect Connect to MusicPD and retrieve its current playlist. Afterward, the @@ -1215,16 +1215,42 @@ differs from @command{emms-show} in that it asks MusicPD for the current track, rather than Emms. @end defun -@defun emms-player-mpd-volume-change amount +@subsubheading Updating the MusicPD database + +@defun emms-player-mpd-update-directory dir +Cause the tracks in DIR to be updated in the MusicPD database. +@end defun + +@defun emms-player-mpd-update-all +Cause all tracks in the MusicPD music directory to be updated in +the MusicPD database. +@end defun + +@subsubheading emms-cache.el integration + +@defun 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. +@end defun + +@defun 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. +@end defun + +@subsubheading emms-volume.el integration + +@defun emms-volume-mpd-change amount Change volume up or down by AMOUNT, depending on whether it is positive or negative. @end defun -@defun emms-player-mpd-volume-up +@defun emms-volume-mpd-raise Increase the volume. @end defun -@defun emms-player-mpd-volume-down +@defun emms-volume-mpd-lower Decrease the volume. @end defun |