diff options
author | Damien Elmes <emms@repose.cx> | 2006-07-10 18:04:00 +0000 |
---|---|---|
committer | Damien Elmes <emms@repose.cx> | 2006-07-10 18:04:00 +0000 |
commit | 868d5b3bca32f05f90d88c3698324ae6e7d0d3f3 (patch) | |
tree | a454574e40b4fd9cb9b28c37e50374b4712f481f | |
parent | fb513e62baf6c8d7355be9aa4ebfa7ceab55ef61 (diff) |
browser: add next/previous filter support
darcs-hash:20060710180451-4e3e3-4b6b2a89bd865f0490b0f7c38b91ea9b383ca895.gz
-rw-r--r-- | emms-browser.el | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/emms-browser.el b/emms-browser.el index b656934..51e3e1f 100644 --- a/emms-browser.el +++ b/emms-browser.el @@ -102,7 +102,7 @@ ;; ;; Set "all" as the default filter ;; (emms-browser-set-filter (assoc "all" emms-browser-filters)) -;; ;; show all files (no streamlists,etc) +;; ;; show all files (no streamlists, etc) ;; (emms-browser-make-filter ;; "all-files" (emms-browser-filter-only-type 'file)) @@ -281,6 +281,8 @@ Use nil for no sorting." (define-key map (kbd "s s") 'emms-browser-search-by-names) (define-key map (kbd "W A") 'emms-browser-lookup-artist-on-wikipedia) (define-key map (kbd "W a") 'emms-browser-lookup-album-on-wikipedia) + (define-key map (kbd "M->") 'emms-browser-next-filter) + (define-key map (kbd "M-<") 'emms-browser-previous-filter) map) "Keymap for `emms-browser-mode'.") @@ -1499,11 +1501,28 @@ This does not refresh the current buffer." (defun emms-browser-refilter (filter) "Filter and render the top-level tracks." - (interactive) (emms-browser-set-filter filter) (emms-browse-by (or emms-browser-top-level-type emms-browser-default-browse-type))) +(defun emms-browser-next-filter (&optional reverse) + "Redisplay with the next filter." + (interactive) + (let* ((list (if reverse + (reverse emms-browser-filters) + emms-browser-filters)) + (key emms-browser-current-filter-name) + (next (cadr (member (assoc key list) list)))) + ;; wrapped + (unless next + (setq next (car list))) + (emms-browser-refilter next))) + +(defun emms-browser-previous-filter () + "Redisplay with the previous filter." + (interactive) + (emms-browser-next-filter t)) + (defun emms-browser-filter-only-dir (path) "Generate a function which checks if a track is in path. If the track is not in path, return t." |