From 725f0bd17945de99f325040a8d8cf6abc0206dde Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Wed, 4 Jan 2006 22:49:00 +0000 Subject: emms-playing-time: Make sure that we don't start more than one timer instance. darcs-hash:20060104224902-1bfb2-46604a22db0c34bd3fd5c9bf8b3d4cf6581361f0.gz --- emms-playing-time.el | 10 ++++++---- 1 file 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." -- cgit v1.2.3