aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorMichael Olson <mwolson@gnu.org>2008-09-20 10:33:29 -0700
committerMichael Olson <mwolson@gnu.org>2008-09-20 10:33:29 -0700
commitc5bf649d13f04bf2e22a548163b971f3fbf74b1b (patch)
tree7d48f10701f59c174967259c6edc0691b9ad72e6 /lisp
parentba8b47960a5722d28ada46d850a9272cd5482a66 (diff)
Clean up use of regexps to match supported tracks.
* lisp/emms-player-mpd.el (emms-player-mpd-supported-regexp): Use emms-player-simple-regexp. * lisp/emms-player-mplayer.el (mplayer): Ditto. (mplayer-playlist): Only match http:// at beginning of filename. * lisp/emms-player-simple.el (mikmod, alsaplayer): Don't put periods in extensions. Separate URLs from extensions. * lisp/emms-player-xine.el (xine): Use emms-player-simple-regexp. * lisp/emms-source-playlist.el (emms-source-playlist-parse-m3u) (emms-source-playlist-parse-pls): Make regexp easier to read.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/emms-player-mpd.el3
-rw-r--r--lisp/emms-player-mplayer.el12
-rw-r--r--lisp/emms-player-simple.el9
-rw-r--r--lisp/emms-player-xine.el10
-rw-r--r--lisp/emms-source-playlist.el4
5 files changed, 20 insertions, 18 deletions
diff --git a/lisp/emms-player-mpd.el b/lisp/emms-player-mpd.el
index 24a647c..948accb 100644
--- a/lisp/emms-player-mpd.el
+++ b/lisp/emms-player-mpd.el
@@ -164,7 +164,8 @@ or nil if we cannot figure it out."
;; Use a sane default, just in case
(or (emms-player-mpd-get-supported-regexp)
(concat "\\`http://\\|"
- "\\.\\(m3u\\|ogg\\|flac\\|mp3\\|wav\\|mod\\|au\\|aiff\\)\\'"))
+ (emms-player-simple-regexp
+ "m3u" "ogg" "flac" "mp3" "wav" "mod" "au" "aiff")))
"Formats supported by MusicPD."
:type 'regexp
:set (function
diff --git a/lisp/emms-player-mplayer.el b/lisp/emms-player-mplayer.el
index c8bf466..e172015 100644
--- a/lisp/emms-player-mplayer.el
+++ b/lisp/emms-player-mplayer.el
@@ -34,15 +34,15 @@
(require 'emms-player-simple)
(define-emms-simple-player mplayer '(file url)
- (mapconcat 'regexp-quote
- '(".ogg" ".mp3" ".wav" ".mpg" ".mpeg" ".wmv" ".wma"
- ".mov" ".avi" ".divx" ".ogm" ".asf" ".mkv" "http://" "mms://"
- ".rm" ".rmvb" ".mp4" ".flac" ".vob" ".m4a" ".ape")
- "\\|")
+ (concat "\\`\\(http\\|mms\\)://\\|"
+ (emms-player-simple-regexp
+ "ogg" "mp3" "wav" "mpg" "mpeg" "wmv" "wma"
+ "mov" "avi" "divx" "ogm" "asf" "mkv"
+ "rm" "rmvb" "mp4" "flac" "vob" "m4a" "ape"))
"mplayer" "-slave" "-quiet" "-really-quiet")
(define-emms-simple-player mplayer-playlist '(streamlist)
- "http://"
+ "\\`http://"
"mplayer" "-slave" "-quiet" "-really-quiet" "-playlist")
(emms-player-set emms-player-mplayer
diff --git a/lisp/emms-player-simple.el b/lisp/emms-player-simple.el
index 6286504..08b3b7d 100644
--- a/lisp/emms-player-simple.el
+++ b/lisp/emms-player-simple.el
@@ -175,9 +175,9 @@ PLAYER is the name of the current player."
(emms-player-simple-regexp "mp3" "ogg" "mod" "flac" "xm" "it" "ft")
"gst-wrapper" "alsasink")
(define-emms-simple-player mikmod '(file)
- (emms-player-simple-regexp ".669" ".amf" ".dsm" ".far" ".gdm" ".it"
- ".imf" ".mod" ".med" ".mtm" ".okt" ".s3m"
- ".stm" ".stx" ".ult" ".apun" ".xm" ".mod")
+ (emms-player-simple-regexp "669" "amf" "dsm" "far" "gdm" "it"
+ "imf" "mod" "med" "mtm" "okt" "s3m"
+ "stm" "stx" "ult" "apun" "xm" "mod")
"mikmod" "-q" "-p" "1" "-X")
(define-emms-simple-player timidity '(file)
(emms-player-simple-regexp "mid" "rmi" "rcp" "r36" "g18" "g36" "mfi")
@@ -186,7 +186,8 @@ PLAYER is the name of the current player."
(emms-player-simple-regexp "mid")
"fluidsynth" "-aalsa" "-in" "/media/music/sf/FluidR3-GM.SF2")
(define-emms-simple-player alsaplayer '(file url)
- (emms-player-simple-regexp ".ogg" ".mp3" ".wav" ".flac" ".pls" ".m3u" "http://")
+ (concat "\\`http://\\|"
+ (emms-player-simple-regexp "ogg" "mp3" "wav" "flac" "pls" "m3u"))
"alsaplayer" "--quiet" "--nosave" "\"--interface text\"")
(emms-player-set emms-player-alsaplayer
diff --git a/lisp/emms-player-xine.el b/lisp/emms-player-xine.el
index 715dec9..61fd11c 100644
--- a/lisp/emms-player-xine.el
+++ b/lisp/emms-player-xine.el
@@ -35,11 +35,11 @@
(require 'emms-player-simple)
(define-emms-simple-player xine '(file url)
- (mapconcat 'regexp-quote
- '(".ogg" ".mp3" ".wav" ".mpg" ".mpeg" ".wmv" ".wma"
- ".mov" ".avi" ".divx" ".ogm" ".asf" ".mkv" "http://" "mms://"
- ".rm" ".rmvb" ".mp4" ".flac" ".vob")
- "\\|")
+ (concat "\\`\\(http\\|mms\\)://\\|"
+ (emms-player-simple-regexp
+ "ogg" "mp3" "wav" "mpg" "mpeg" "wmv" "wma"
+ "mov" "avi" "divx" "ogm" "asf" "mkv"
+ "rm" "rmvb" "mp4" "flac" "vob"))
"xine" "--no-gui" "--no-logo" "--no-splash" "--no-reload" "--stdctl")
(emms-player-set emms-player-xine
diff --git a/lisp/emms-source-playlist.el b/lisp/emms-source-playlist.el
index 3db4ba2..6c580f3 100644
--- a/lisp/emms-source-playlist.el
+++ b/lisp/emms-source-playlist.el
@@ -265,7 +265,7 @@ detected and simply return non-nil always."
(defun emms-source-playlist-parse-m3u ()
"Parse the m3u playlist in the current buffer."
(mapcar (lambda (file)
- (if (string-match "\\`http://\\|\\`mms://" file)
+ (if (string-match "\\`\\(http\\|mms\\)://" file)
(emms-track 'url file)
(emms-track 'file file)))
(emms-source-playlist-m3u-files)))
@@ -333,7 +333,7 @@ OUT should be the buffer where tracks are stored in m3u format."
(defun emms-source-playlist-parse-pls ()
"Parse the pls playlist in the current buffer."
(mapcar (lambda (file)
- (if (string-match "\\`http://\\|\\`mms://" file)
+ (if (string-match "\\`\\(http\\|mms\\)://" file)
(emms-track 'url file)
(emms-track 'file file)))
(emms-source-playlist-pls-files)))