2

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.

xuhdev
  • 1,839
  • 13
  • 26

2 Answers2

3

You can display some text (something looks like process bar) in the echo area to indicate the music has been played after seeking:

enter image description here

(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.

xuchunyang
  • 14,302
  • 1
  • 18
  • 39
0

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! ;-)

ebpa
  • 7,319
  • 26
  • 53