diff options
author | Michael Olson <mwolson@gnu.org> | 2006-07-30 21:50:00 +0000 |
---|---|---|
committer | Michael Olson <mwolson@gnu.org> | 2006-07-30 21:50:00 +0000 |
commit | ab3184047fd4ff9373bacccd8f583674ba738849 (patch) | |
tree | 86b345def6ba9a977ebfdc26fce125a89c87e52f | |
parent | 9e243bd6c4fdc71083203116d98af41ba00851ea (diff) |
emms-player-mpd: Allow a password to be sent to the MusicPD server.
darcs-hash:20060730215000-1bfb2-492d75142915235bcc52d20e92d7d9973dfd8053.gz
-rw-r--r-- | emms-player-mpd.el | 21 | ||||
-rw-r--r-- | emms.texinfo | 7 |
2 files changed, 26 insertions, 2 deletions
diff --git a/emms-player-mpd.el b/emms-player-mpd.el index 650a9b1..143f9bf 100644 --- a/emms-player-mpd.el +++ b/emms-player-mpd.el @@ -23,7 +23,7 @@ ;;; Commentary: -;;; Benefits +;;; Benefits of MusicPD ;; MusicPD features crossfade, very little skipping, minor CPU usage, ;; many clients, many supported output formats, fast manipulation via @@ -67,6 +67,11 @@ ;; (setq emms-player-mpd-server-name "localhost") ;; (setq emms-player-mpd-server-port "6600") +;; If your MusicPD setup requires a password, you will need to do the +;; following. +;; +;; (setq emms-player-mpd-server-password "mypassword") + ;; To get track info from MusicPD, do the following. ;; ;; (add-to-list 'emms-info-functions 'emms-info-mpd) @@ -167,6 +172,12 @@ It should take same arguments as `open-network-stream' does." :type '(choice number string) :group 'emms-player-mpd) +(defcustom emms-player-mpd-server-password nil + "The port of the MusicPD server that we should connect to." + :type '(choice (const :tag "None" nil) + string) + :group 'emms-player-mpd) + (defcustom emms-player-mpd-check-interval 1 "How often to check to see whether MusicPD has advanced to the next song. This may be an integer or a floating point number. @@ -355,7 +366,13 @@ return at the end of a request.") (emms-player-mpd-tq-create emms-player-mpd-process)) (if (fboundp 'set-process-query-on-exit-flag) (set-process-query-on-exit-flag emms-player-mpd-process nil) - (process-kill-without-query emms-player-mpd-process)))) + (process-kill-without-query emms-player-mpd-process)) + ;; send password + (when (stringp emms-player-mpd-server-password) + (emms-player-mpd-tq-enqueue + emms-player-mpd-queue + (concat "password " emms-player-mpd-server-password "\n") + emms-player-mpd-status-regexp nil #'ignore)))) (defun emms-player-mpd-send (question closure fn) "Send the given QUESTION to the MusicPD server. diff --git a/emms.texinfo b/emms.texinfo index 6dcbdd3..5e9b897 100644 --- a/emms.texinfo +++ b/emms.texinfo @@ -1167,6 +1167,13 @@ Set the variables @var{emms-player-mpd-server-name} and (setq emms-player-mpd-server-port "6600") @end lisp +If your MusicPD setup requires a password, you will to set +@var{emms-player-mpd-server-password} as follows. + +@lisp +(setq emms-player-mpd-server-password "mypassword") +@end lisp + To get track information from MusicPD, invoke the following: @lisp |