[Top][All Lists]

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

[emms-help] New features?

From: Lucas Bonnet
Subject: [emms-help] New features?
Date: Tue, 26 Jun 2007 23:41:43 +0200
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.51 (gnu/linux)


   I realize that it's a bit late for the V3 release, but I have a
feature I'd like to submit, so that it becomes part of EMMS. If you're
not using the browser (that's you, forcer :p), you may skip to the next

The browser offers a nice filter possibility, which I use quite
intensively, and you can navigate between filters with < and >. But
sometimes that's not fast enough, especially since a) the
filter I want is almost always the last one b) I have quite a big cache,
and it takes several *seconds* to swap it out.

So I had the idea to implement (yes, I wrote some elisp code, call the
newspapers) something a bit friendlier. Here's the whole code, awaiting
for your advice about how to write the same in 2 lines :

;; define some filters, change the paths, unless you've got an account
;; to my computer
(emms-browser-make-filter "Albums" (emms-browser-filter-only-dir 
(emms-browser-make-filter "Jazz" (emms-browser-filter-only-dir "/zic/Jazz/"))
(emms-browser-make-filter "All" (emms-browser-filter-only-dir "/zic/"))

;; I'm not sure I can produce something uglier than this right now
(defun my-emms-build-filter-list ()
  (let (( l (mapcar (lambda (el) (car el)) emms-browser-filters)))
    (mapcar (lambda (el)
              `(,el . ,el)) (reverse l))))

;; pop-up the list, move with <up>/<down>, select with RET
(defun my-emms-popup ()
  (funcall (intern
            (format "emms-browser-show-%s"
                    (x-popup-menu (list '(300 50) (selected-window))
                                  (list "Choose filter" (append (list "AAa")

;; bind, hook, etc.
(defun my-emms-browser-hook ()
  (local-set-key (kbd "C-c C-c") 'my-emms-popup))

(add-hook 'emms-browser-show-display-hook 'my-emms-browser-hook)


reply via email to

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