aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwilliam.xwl <william.xwl>2005-09-22 13:13:00 +0000
committerwilliam.xwl <mwolson@gnu.org>2005-09-22 13:13:00 +0000
commitcd4d94affea79510389155df0ca486e3822b6c04 (patch)
tree1acd9525cb67d242d63f5a463ab118cd5de86e67
parent79e95d09f9aa7467252f06af52f2455d0575c20d (diff)
emms-playing-time.el: Updated the playing-time retrieval method, so as
to be able to display playing-time again. darcs-hash:20050922131319-e8fe6-31a021162b338fa900f3f04916b3232ba75c6efe.gz
-rw-r--r--emms-playing-time.el20
1 files changed, 10 insertions, 10 deletions
diff --git a/emms-playing-time.el b/emms-playing-time.el
index ec7d281..2506e08 100644
--- a/emms-playing-time.el
+++ b/emms-playing-time.el
@@ -101,22 +101,22 @@ e.g., display 02:37 instead of 02:37/05:49.")
(setq emms-playing-time (1+ emms-playing-time))
(let* ((min (/ emms-playing-time 60))
(sec (% emms-playing-time 60))
- ;; How to adapt `emms-info-format-info' here?
- (struct
- (emms-info-get (emms-playlist-selected-track)))
- (total-min-only
- (when struct (emms-info-playing-time-min struct)))
- (total-sec-only
- (when struct (emms-info-playing-time-sec struct))))
+ (total-playing-time
+ (or (string-to-int
+ (emms-track-get
+ (emms-playlist-current-selected-track)
+ 'info-playing-time))
+ 0))
+ (total-min-only (/ total-playing-time 60))
+ (total-sec-only (% total-playing-time 60)))
(setq emms-playing-time-string
(format
emms-playing-time-display-format
(replace-regexp-in-string
" " "0"
(if (or emms-playing-time-display-short-p
- ;; unable to get total time info
- (not total-min-only)
- (not total-sec-only))
+ ;; unable to get total playing-time
+ (eq total-playing-time 0))
(format "%2d:%2d" min sec)
(format "%2d:%2d/%2s:%2s"
min sec total-min-only total-sec-only)))))