Skip to content

Commit

Permalink
Custom EMMS track info to show album, artist, title and duration in p…
Browse files Browse the repository at this point in the history
…laylist.
  • Loading branch information
Fidel Ramos committed Feb 21, 2011
1 parent 1ac8bd3 commit 35ea752
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions dot-emacs
Expand Up @@ -357,6 +357,23 @@
(emms-mode-line 1)
(emms-playing-time 1)

; Show "Album - Artist - Track name [Duration]" as track info
(defun my-emms-info-track-description (track)
"Return a description of the current track, including album,
artist, track name and total duration if available."
(let ((pmin (emms-track-get track 'info-playing-time-min))
(psec (emms-track-get track 'info-playing-time-sec))
(ptot (emms-track-get track 'info-playing-time))
(alb (emms-track-get track 'info-album))
(art (emms-track-get track 'info-artist))
(tit (emms-track-get track 'info-title)))
(if (and alb art tit)
(cond ((and pmin psec) (format "%s - %s - %s [%s:%s]" alb art tit pmin psec))
(ptot (format "%s - %s - %s [%s:%s]" alb art tit (/ ptot 60) (% ptot 60)))
(t (emms-track-simple-description track)))
(emms-track-simple-description track))))
(setq emms-track-description-function 'my-emms-info-track-description)

; Look for lyrics on Google
(defun emms-google-for-lyrics ()
(interactive)
Expand Down

0 comments on commit 35ea752

Please sign in to comment.