[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/listen ee88cbf3d9 01/12: Add: (listen-format-seconds)
From: |
ELPA Syncer |
Subject: |
[elpa] externals/listen ee88cbf3d9 01/12: Add: (listen-format-seconds) |
Date: |
Thu, 29 Feb 2024 12:58:31 -0500 (EST) |
branch: externals/listen
commit ee88cbf3d969e6fc958631db3d0587889c64ae50
Author: Adam Porter <adam@alphapapa.net>
Commit: Adam Porter <adam@alphapapa.net>
Add: (listen-format-seconds)
---
listen-lib.el | 4 ++++
listen.el | 12 +++++-------
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/listen-lib.el b/listen-lib.el
index 2afd109a1a..9b21af2591 100644
--- a/listen-lib.el
+++ b/listen-lib.el
@@ -77,6 +77,10 @@
(or listen-player
(setf listen-player (make-listen-player-vlc))))
+(defun listen-format-seconds (seconds)
+ "Return SECONDS formatted as an hour:minute:second-style duration."
+ (format-seconds "%h:%z%.2m:%.2s" seconds))
+
;;;; Methods
(cl-defmethod listen--running-p ((player listen-player))
diff --git a/listen.el b/listen.el
index afcc1407c2..b30bfc5bd3 100755
--- a/listen.el
+++ b/listen.el
@@ -195,9 +195,7 @@ command with completion."
(defun listen-mode-lighter ()
"Return lighter for `listen-mode'."
- (cl-labels ((format-time (seconds)
- (format-seconds "%h:%z%.2m:%.2s" seconds))
- (format-track ()
+ (cl-labels ((format-track ()
(when-let ((info (listen--info listen-player))
;; Sometimes when paused/stopped, the artist and/or
;; title are nil even if info isn't, so we must
@@ -218,11 +216,11 @@ command with completion."
(list (format-status) " " (format-track)
" ("
(pcase listen-lighter-format
- ('remaining (concat "-" (format-time (- (listen--length
listen-player)
-
(listen--elapsed listen-player)))))
- (_ (concat (format-time (listen--elapsed listen-player))
+ ('remaining (concat "-" (listen-format-seconds (-
(listen--length listen-player)
+
(listen--elapsed listen-player)))))
+ (_ (concat (listen-format-seconds (listen--elapsed
listen-player))
"/"
- (format-time (listen--length
listen-player)))))
+ (listen-format-seconds (listen--length
listen-player)))))
") ")
'("■ ")))))
- [elpa] externals/listen updated (33cc5e8766 -> c250f72f14), ELPA Syncer, 2024/02/29
- [elpa] externals/listen 569018b4eb 05/12: Change: (listen-library-taxy) Show duration with filename, ELPA Syncer, 2024/02/29
- [elpa] externals/listen ee88cbf3d9 01/12: Add: (listen-format-seconds),
ELPA Syncer <=
- [elpa] externals/listen d84783ae2d 04/12: Change: Use listen-queue-tracks-for, ELPA Syncer, 2024/02/29
- [elpa] externals/listen dec87e2b82 02/12: Add: Probe track duration with ffprobe, ELPA Syncer, 2024/02/29
- [elpa] externals/listen c0532bdbe9 03/12: Change: (listen-track) Rename length -> duration, ELPA Syncer, 2024/02/29
- [elpa] externals/listen f23fc0096a 07/12: Merge: Read track durations with ffprobe, ELPA Syncer, 2024/02/29
- [elpa] externals/listen 4c0c6cadba 08/12: Change: Bind "?" to listen menu in library and queue, ELPA Syncer, 2024/02/29
- [elpa] externals/listen ecf0264641 09/12: Fix: (listen-queue-transpose-forward) Keep point on track, ELPA Syncer, 2024/02/29
- [elpa] externals/listen 1a8c98f99c 06/12: Docs: Update readme, ELPA Syncer, 2024/02/29
- [elpa] externals/listen 6763d2f75f 10/12: Tidy: (listen-queue-transpose-forward) Use cl-rotatef, ELPA Syncer, 2024/02/29
- [elpa] externals/listen 32fcea9a9f 11/12: Fix: (listen) Autoload, ELPA Syncer, 2024/02/29
- [elpa] externals/listen c250f72f14 12/12: Tidy: Compiler warnings, ELPA Syncer, 2024/02/29