aboutsummaryrefslogtreecommitdiff
path: root/emms-playing-time.el
diff options
context:
space:
mode:
Diffstat (limited to 'emms-playing-time.el')
-rw-r--r--emms-playing-time.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/emms-playing-time.el b/emms-playing-time.el
index 36090e0..ad2da90 100644
--- a/emms-playing-time.el
+++ b/emms-playing-time.el
@@ -69,6 +69,8 @@ should enable `emms-playing-time-display-p' first, though."
(defvar emms-playing-time-string "")
+(defvar emms-playing-time-display-timer nil)
+
(defun emms-playing-time-start ()
"Get ready for display playing time."
(setq emms-playing-time 0)
@@ -81,13 +83,15 @@ should enable `emms-playing-time-display-p' first, though."
(progn
(setq emms-playing-time-string "")
(force-mode-line-update)))
- (cancel-function-timers 'emms-playing-time-display))
+ (emms-cancel-timer emms-playing-time-display-timer)
+ (setq emms-playing-time-display-timer nil))
(defun emms-playing-time-pause ()
"Pause playing time."
(if emms-player-paused-p
(emms-playing-time-stop)
- (run-at-time t 1 'emms-playing-time-display)))
+ (setq emms-playing-time-display-timer
+ (run-at-time t 1 'emms-playing-time-display))))
(defun emms-playing-time-seek (sec)
"Seek forward or backward SEC playing time."