aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Olson <mwolson@gnu.org>2006-08-11 18:48:00 +0000
committerMichael Olson <mwolson@gnu.org>2006-08-11 18:48:00 +0000
commitedbaced4c24d099692a525580d4bf853712b1bdc (patch)
treed05a8e04035dc511c95bd4585349192890862afb
parent936e11ed52318d04470867b33d1128632f439354 (diff)
emms-player-mpd: Make supported formats regexp customizable.
darcs-hash:20060811184859-1bfb2-bec436303736ffda13cfffeb7a0eea38de054894.gz
-rw-r--r--emms-player-mpd.el54
1 files changed, 30 insertions, 24 deletions
diff --git a/emms-player-mpd.el b/emms-player-mpd.el
index 681cb07..80c0449 100644
--- a/emms-player-mpd.el
+++ b/emms-player-mpd.el
@@ -103,6 +103,29 @@
(require 'emms-player-simple)
(require 'emms-source-playlist) ; for emms-source-file-parse-playlist
+(defgroup emms-player-mpd nil
+ "EMMS player for MusicPD."
+ :group 'emms-player
+ :prefix "emms-player-mpd-")
+
+(defcustom emms-player-mpd (emms-player 'emms-player-mpd-start
+ 'emms-player-mpd-stop
+ 'emms-player-mpd-playable-p)
+ "*Parameters for the MusicPD player."
+ :type '(cons symbol alist)
+ :group 'emms-player-mpd)
+
+(defcustom emms-player-mpd-music-directory nil
+ "The value of 'music_directory' in your MusicPD configuration file.
+You need this if your playlists use absolute file names, otherwise
+leave it set to nil."
+ ;; The :format part ensures that entering directories happens on the
+ ;; next line, where there is more space to work with
+ :type '(choice :format "%{%t%}:\n %[Value Menu%] %v"
+ (const nil)
+ directory)
+ :group 'emms-player-mpd)
+
(defun emms-player-mpd-get-supported-regexp ()
"Returns a regexp of file extensions that MusicPD supports,
or nil if we cannot figure it out."
@@ -126,34 +149,17 @@ or nil if we cannot figure it out."
"\\|")
"\\)\\'"))))
-(defvar emms-player-mpd-supported-regexp
+(defcustom emms-player-mpd-supported-regexp
;; Use a sane default, just in case
(or (emms-player-mpd-get-supported-regexp)
(concat "\\`http://\\|"
"\\.\\(m3u\\|ogg\\|flac\\|mp3\\|wav\\|mod\\|au\\|aiff\\)\\'"))
- "Formats supported by MusicPD Client.")
-
-(defgroup emms-player-mpd nil
- "EMMS player for MusicPD."
- :group 'emms-player
- :prefix "emms-player-mpd-")
-
-(defcustom emms-player-mpd (emms-player 'emms-player-mpd-start
- 'emms-player-mpd-stop
- 'emms-player-mpd-playable-p)
- "*Parameters for the MusicPD player."
- :type '(cons symbol alist)
- :group 'emms-player-mpd)
-
-(defcustom emms-player-mpd-music-directory nil
- "The value of 'music_directory' in your MusicPD configuration file.
-You need this if your playlists use absolute file names, otherwise
-leave it set to nil."
- ;; The :format part ensures that entering directories happens on the
- ;; next line, where there is more space to work with
- :type '(choice :format "%{%t%}:\n %[Value Menu%] %v"
- (const nil)
- directory)
+ "Formats supported by MusicPD Client."
+ :type 'regexp
+ :set (function
+ (lambda (sym value)
+ (set sym value)
+ (emms-player-set emms-player-mpd 'regex value)))
:group 'emms-player-mpd)
(defcustom emms-player-mpd-connect-function 'open-network-stream