emms-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [emms-help] Problem with Alsaplayer


From: Yoni Rabkin
Subject: Re: [emms-help] Problem with Alsaplayer
Date: Sat, 31 May 2008 09:32:20 +0300
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1 (gnu/linux)

"Alejandro Benitez" <address@hidden> writes:

> Hi,
>
> I had problems playing files with EMMS/Alsaplayer, getting the following 
> error:
>
> if: Don't know how to play track: (*track* (type . file) (name .
> "/home/john/sample.mp3") (info-mtime 18495 26588))
> EMMS: All track information loaded.
>
> I changed the following line in emms-player-simple.el
>
> (define-emms-simple-player alsaplayer '(file url)
>   (emms-player-simple-regexp ".ogg" ".mp3" ".wav" ".flac" ".pls"
> ".m3u" "http://";)
>   "alsaplayer" "--quiet" "--nosave" "\"--interface text\"")
>
> to the following:
>
> (define-emms-simple-player alsaplayer '(file url) (regexp-opt '(".ogg"
> ".mp3" ".wav" ".flac" ".pls" ".m3u" "http://";)) "alsaplayer" "--quiet"
> "--nosave" "\"--interface text\"")
>
> Now my EMMS can play files back again.
>
> What's wrong?

I'm on Emacs22.

The output of `emms-player-simple-regexp' is broken, What's the reason
for using `emms-player-simple-regexp'? What am I missing?

Here is a version of `emms-player-simple-regexp' which outputs an
equivalent (but not identical) regular expression to your `regexp-opt':

(defun emms-player-simple-regexp (&rest extensions)
  "Return a regexp matching all EXTENSIONS, case-insensitively."
  (concat "\\("
          (mapconcat (lambda (extension)
                       (mapconcat (lambda (char)
                                    (cond ((char-equal char ?.)
                                           "\\.")
                                          (t (let ((u (upcase char))
                                                   (d (downcase char)))
                                               (if (= u d)
                                                   (format "%c" char)
                                                 (format "[%c%c]" u d))))))
                                  extension
                                  ""))
                     extensions
                     "\\|")
          "\\)"))

-- 
   "Cut your own wood and it will warm you twice"




reply via email to

[Prev in Thread] Current Thread [Next in Thread]