From cd4d94affea79510389155df0ca486e3822b6c04 Mon Sep 17 00:00:00 2001 From: "william.xwl" Date: Thu, 22 Sep 2005 13:13:00 +0000 Subject: 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 --- emms-playing-time.el | 20 ++++++++++---------- 1 file 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))))) -- cgit v1.2.3