aboutsummaryrefslogtreecommitdiff
path: root/emms-playing-time.el
diff options
context:
space:
mode:
authorMichael Olson <mwolson@gnu.org>2006-07-02 01:21:00 +0000
committerMichael Olson <mwolson@gnu.org>2006-07-02 01:21:00 +0000
commit4a873b05b48e1b3bca23499494cff40bf6a3e74a (patch)
treeda2eee3e961a92200d3ddc3e92846f4d74deba8d /emms-playing-time.el
parentaccfde0f1a53e921406bb352fc5c3081ef9dbe97 (diff)
Allow player to set the exact elapsed time of a track. emms-player-mpd and emms-player-mpg321-remote both need this.
darcs-hash:20060702012131-1bfb2-3e6229d68adf0d78574e0fc6cd1c1a4438c870c3.gz
Diffstat (limited to 'emms-playing-time.el')
-rw-r--r--emms-playing-time.el12
1 files changed, 10 insertions, 2 deletions
diff --git a/emms-playing-time.el b/emms-playing-time.el
index 659e391..3176dcf 100644
--- a/emms-playing-time.el
+++ b/emms-playing-time.el
@@ -103,6 +103,12 @@ should enable `emms-playing-time-display-p' first, though."
(when (< emms-playing-time 0) ; back to start point
(setq emms-playing-time 0)))
+(defun emms-playing-time-set (sec)
+ "Set the playing time to SEC."
+ (setq emms-playing-time sec)
+ (when (< emms-playing-time 0) ; back to start point
+ (setq emms-playing-time 0)))
+
(defun emms-playing-time (arg)
"Turn on emms playing time if ARG is positive, off otherwise."
(interactive "p")
@@ -114,7 +120,8 @@ should enable `emms-playing-time-display-p' first, though."
(add-hook 'emms-player-stopped-hook 'emms-playing-time-stop)
(add-hook 'emms-player-finished-hook 'emms-playing-time-stop)
(add-hook 'emms-player-paused-hook 'emms-playing-time-pause)
- (add-hook 'emms-player-seeked-functions 'emms-playing-time-seek))
+ (add-hook 'emms-player-seeked-functions 'emms-playing-time-seek)
+ (add-hook 'emms-player-time-set-functions 'emms-playing-time-set))
(setq emms-playing-time-display-p nil)
(emms-playing-time-stop)
(emms-playing-time-restore-mode-line)
@@ -122,7 +129,8 @@ should enable `emms-playing-time-display-p' first, though."
(remove-hook 'emms-player-stopped-hook 'emms-playing-time-stop)
(remove-hook 'emms-player-finished-hook 'emms-playing-time-stop)
(remove-hook 'emms-player-paused-hook 'emms-playing-time-pause)
- (remove-hook 'emms-player-seeked-functions 'emms-playing-time-seek)))
+ (remove-hook 'emms-player-seeked-functions 'emms-playing-time-seek)
+ (remove-hook 'emms-player-time-set-functions 'emms-playing-time-set)))
;;;###autoload
(defun emms-playing-time-enable ()