This package is a minor mode for updating emms-mode-line-string
cyclically within specified width
with emms-playing-time-display
.
It is useful for long track titles.
- GNU Emacs 24 or later
- EMMS 4.0 or later
Tested with GNU Emacs 24.5 (emacs-mac-app @5.9_0), EMMS 4.0
(add-to-list 'load-path "/path/to/emms-mode-line-cycle")
(require 'emms-mode-line-cycle)
(emms-mode-line 1)
(emms-playing-time 1)
;; `emms-mode-line-cycle' can be used with emms-mode-line-icon.
(require 'emms-mode-line-icon)
(custom-set-variables '(emms-mode-line-cycle-use-icon-p t))
(emms-mode-line-cycle 1)
Default value is 16
. The width of emms-mode-line-format
isn’t included.
Default value is nil
. If it is non-nil, the title is rotated which is less than emms-mode-line-cycle-max-width
.
Default value is 2
. It is the number of space characters to add them to the current title.
If it is no-nil, emms-mode-line-icon-image-cache
is used like emms-mode-line-icon-function
.
This feature requires (require 'emms-mode-line-icon)
before (emms-mode-line-cycle 1)
This is used for getting the current track title before applying it to emms-mode-line-format
.
Default value is as follows like emms-mode-line-playlist-current
.
(lambda () (emms-track-description (emms-playlist-current-selected-track)))
Number of characters per emms-mode-line-cycle-update-mode-line-string
.
Default value is 1
.
This function returns a displayed title which is updated n
times.
If n
is nil, n
is set to 0
.
(require 'emms-mode-line-icon)
(emms-mode-line-cycle 1)
(custom-set-variables
'(emms-mode-line-cycle-max-width 15)
'(emms-mode-line-cycle-additional-space-num 4)
'(emms-mode-line-cycle-use-icon-p t)
'(emms-mode-line-format " [%s]")
'(emms-mode-line-cycle-any-width-p t)
'(emms-mode-line-cycle-velocity 2)
'(emms-mode-line-cycle-current-title-function
(lambda ()
(let ((track (emms-playlist-current-selected-track)))
(cl-case (emms-track-type track)
((streamlist)
(let ((stream-name (emms-stream-name
(emms-track-get track 'metadata))))
(if stream-name stream-name (emms-track-description track))))
((url) (emms-track-description track))
(t (file-name-nondirectory
(emms-track-description track)))))))
'(emms-mode-line-titlebar-function
(lambda ()
'(:eval
(when emms-player-playing-p
(format " %s %s"
(format emms-mode-line-format (emms-mode-line-cycle-get-title))
emms-playing-time-string))))))