diff options
author | forcer <forcer> | 2005-09-14 11:19:00 +0000 |
---|---|---|
committer | forcer <mwolson@gnu.org> | 2005-09-14 11:19:00 +0000 |
commit | 935c96b110747ea774d6e9a8ddb8d4d73e93b58e (patch) | |
tree | 49f186b36f578ecfc368c8f20bd17209aa58b990 | |
parent | 427771f9061d95ce1394b63afcf2e3eb592d59d9 (diff) |
Add `emms-player-simple-regexp'. Also, use it as appropriate.
darcs-hash:20050914111945-2189f-41013fda35fa58bb063cd33673607d86cd15f3b5.gz
-rw-r--r-- | emms-player-simple.el | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/emms-player-simple.el b/emms-player-simple.el index 594765d..535807a 100644 --- a/emms-player-simple.el +++ b/emms-player-simple.el @@ -135,12 +135,33 @@ the specified PARAMS." (signal-process (get-process emms-player-simple-process-name) 'SIGCONT)) -(define-emms-simple-player mpg321 '(file url) "\\.[mM][pP][23]$" "mpg321") -(define-emms-simple-player ogg123 '(file) (regexp-opt '(".ogg" ".OGG" ".FLAC" ".flac")) "ogg123") -(define-emms-simple-player speexdec '(file) "\\.[sS][pP][xX]$" "speexdec") +(defun emms-player-simple-regexp (&rest extensions) + "Return a regexp matching all EXTENSIONS, case-insensitively." + (concat "\\.\\(" + (mapconcat (lambda (extension) + (mapconcat (lambda (char) + (let ((u (upcase char)) + (d (downcase char))) + (if (= u d) + (format "%c" char) + (format "[%c%c]" u d)))) + extension + "")) + extensions + "\\|") + "\\)\\'")) + +(define-emms-simple-player mpg321 '(file url) + (emms-player-simple-regexp "mp3" "mp2") + "mpg321") +(define-emms-simple-player ogg123 '(file) + (emms-player-simple-regexp "ogg" "flac") + "ogg123") +(define-emms-simple-player speexdec '(file) + (emms-player-simple-regexp "spx") + "speexdec") (define-emms-simple-player gstreamer '(file) - (regexp-opt '(".mp3" ".ogg" ".mod" ".flac" ".xm" ".it" ".ft" - ".MP3" ".OGG" ".MOD" ".FLAC" ".XM" ".IT" ".FT")) + (emms-player-simple-regexp "mp3" "ogg" "mod" "flac" "xm" "it" "ft") "gst-wrapper" "alsasink") (provide 'emms-player-simple) |