How can I have a progress bar so I can drag to specific point of a song in emms? With a progress bar, it gives a more straight sense on how much the music has been played.
2 Answers
You can display some text (something looks like process bar) in the echo area to indicate the music has been played after seeking:
(defun chunyang-emms-indicate-seek (_sec)
(let* ((total-playing-time (emms-track-get
(emms-playlist-current-selected-track)
'info-playing-time))
(elapsed/total (/ (* 100 emms-playing-time) total-playing-time)))
(with-temp-message (format "[%-100s] %2d%%"
(make-string elapsed/total ?=)
elapsed/total)
(sit-for 2))))
(add-hook 'emms-player-seeked-functions #'chunyang-emms-indicate-seek 'append)
BTW, Bongo (another music player for Emacs) provides similar function, but its looks more beautiful and more useful.

- 14,302
- 1
- 18
- 39
-
-
@xuhdev Bongo itself already has this feature, you don't need to do anything, just run `bongo-seek-forward` etc and take a look at the echo area. – xuchunyang Apr 23 '16 at 04:21
You should implement one! (AFAIK emms doesn't have progress bar)
emms provides the emms-playing-time
variable which gives you the time elapsed for the current track and you can find the track length with
(emms-track-get (emms-playlist-current-selected-track) 'info-playing-time)
(IMHO this should probably be exposed as an emms variable as well)
You can seek using the emms-seek-*
functions.
For the progress bar itself one package that comes to mind is neato-bar-graph (https://gitlab.com/RobertCochran/neato-graph-bar).
Maybe other users here can suggest other code you should look at.
I'm looking forward to using what you build! ;-)

- 7,319
- 26
- 53