diff options
author | forcer <forcer> | 2005-09-26 01:28:00 +0000 |
---|---|---|
committer | forcer <mwolson@gnu.org> | 2005-09-26 01:28:00 +0000 |
commit | c6f371b13e0d9f50079d06f106aab704840db016 (patch) | |
tree | e6272a0a5c5bc106bb9f16cf2da73d6569543631 | |
parent | 7b5a900a765d928153125ad9bb5b164f1de4f6eb (diff) |
Update tracks with a specific function, and provide emms-track-updated-functions
darcs-hash:20050926012813-2189f-88b12a9350389bba0f12b3d3525b8eb14f066a37.gz
-rw-r--r-- | emms-info.el | 2 | ||||
-rw-r--r-- | emms.el | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/emms-info.el b/emms-info.el index f4f1888..97a1250 100644 --- a/emms-info.el +++ b/emms-info.el @@ -88,7 +88,7 @@ Return t when the track got changed." (run-hook-with-args 'emms-info-functions track) (emms-track-set track 'info-mtime file-mtime) - (emms-playlist-track-updated track) + (emms-track-updated track) (when emms-info-asynchronously (setq emms-info-asynchronous-tracks (1- emms-info-asynchronous-tracks)) (when (zerop emms-info-asynchronous-tracks) @@ -171,6 +171,12 @@ This can be used to initialize tracks with various info." :group 'emms :type 'hook) +(defcustom emms-track-updated-functions nil + "*List of functions to call when a track changes data. +These functions are passed the track as an argument." + :group 'emms + :type 'hook) + (defcustom emms-player-started-hook nil "*Hook run when an EMMS player starts playing." :group 'emms @@ -394,6 +400,11 @@ If there is no value, return DEFAULT (or nil, if not given)." This function uses `emms-track-description-function'." (funcall emms-track-description-function track)) +(defun emms-track-updated (track) + "Information in TRACK got updated." + (emms-playlist-track-updated track) + (run-hook-with-args 'emms-track-updated-functions track)) + (defun emms-track-simple-description (track) "Simple function to give a user-readable description of a track. If it's a file track, just return the file name. |