aboutsummaryrefslogtreecommitdiff
path: root/emms-playing-time.el
diff options
context:
space:
mode:
authorMichael Olson <mwolson@gnu.org>2006-01-04 22:49:00 +0000
committerMichael Olson <mwolson@gnu.org>2006-01-04 22:49:00 +0000
commit725f0bd17945de99f325040a8d8cf6abc0206dde (patch)
tree73d60022f6ebfd0f64aab4c6f6963f5f1f900592 /emms-playing-time.el
parent976d1266c71cf33ae0fa51b799e85b0465d58db2 (diff)
emms-playing-time: Make sure that we don't start more than one timer instance.
darcs-hash:20060104224902-1bfb2-46604a22db0c34bd3fd5c9bf8b3d4cf6581361f0.gz
Diffstat (limited to 'emms-playing-time.el')
-rw-r--r--emms-playing-time.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/emms-playing-time.el b/emms-playing-time.el
index ca39b08..2a5d914 100644
--- a/emms-playing-time.el
+++ b/emms-playing-time.el
@@ -74,8 +74,9 @@ should enable `emms-playing-time-display-p' first, though."
(defun emms-playing-time-start ()
"Get ready for display playing time."
(setq emms-playing-time 0)
- (setq emms-playing-time-display-timer
- (run-at-time t 1 'emms-playing-time-display)))
+ (unless emms-playing-time-display-timer
+ (setq emms-playing-time-display-timer
+ (run-at-time t 1 'emms-playing-time-display))))
(defun emms-playing-time-stop ()
"Remove playing time on the mode line."
@@ -91,8 +92,9 @@ should enable `emms-playing-time-display-p' first, though."
"Pause playing time."
(if emms-player-paused-p
(emms-playing-time-stop)
- (setq emms-playing-time-display-timer
- (run-at-time t 1 'emms-playing-time-display))))
+ (unless emms-playing-time-display-timer
+ (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."