diff options
-rw-r--r-- | lisp/emms-player-mpd.el | 2 | ||||
-rw-r--r-- | lisp/emms.el | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/lisp/emms-player-mpd.el b/lisp/emms-player-mpd.el index 98d44d0..7efe13f 100644 --- a/lisp/emms-player-mpd.el +++ b/lisp/emms-player-mpd.el @@ -430,6 +430,7 @@ The list will be in reverse order." 'file)) (track (emms-track type file))) (emms-info-mpd track song-info) + (run-hook-with-args 'emms-track-info-filters track) (setq tracks (cons track tracks))))))) (funcall (car closure) (cdr closure) tracks))) @@ -1052,6 +1053,7 @@ positive or negative." (emms-track-set track 'type 'file)) (emms-track-set track 'name file) (emms-info-mpd track info) + (run-hook-with-args 'emms-track-info-filters track) (setq track-desc (emms-track-description track)) (when (and (stringp track-desc) (not (string= track-desc ""))) (setq desc (if desc diff --git a/lisp/emms.el b/lisp/emms.el index 100e9e8..1d8e827 100644 --- a/lisp/emms.el +++ b/lisp/emms.el @@ -176,8 +176,16 @@ This can be used to initialize tracks with various info." :group 'emms :type 'hook) +(defcustom emms-track-info-filters nil + "*List of functions to call when a track changes data, before updating +the display. +These functions are passed the track as an argument." + :group 'emms + :type 'hook) + (defcustom emms-track-updated-functions nil - "*List of functions to call when a track changes data. + "*List of functions to call when a track changes data, after updating +the display. These functions are passed the track as an argument." :group 'emms :type 'hook) @@ -588,6 +596,7 @@ a description into a playlist buffer." (defun emms-track-updated (track) "Information in TRACK got updated." + (run-hook-with-args 'emms-track-info-filters track) (emms-playlist-track-updated track) (run-hook-with-args 'emms-track-updated-functions track)) |