emms-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [emms-help] emms-info


From: Ulrik Jensen
Subject: Re: [emms-help] emms-info
Date: Wed, 24 Mar 2004 19:17:09 +0100
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux)

Hey

Xavier Maillard <address@hidden> writes:
> No error but no tags :) I just have the filename.

Looking over your configuration, you're missing this:

(setq emms-track-description-function
      'emms-info-file-info-song-artist)

Also, I've just fixed some possibly occuring bugs in ogg-comment.el and
emms-info-ogg.el. Please update your EMMS, and your setup (easiest by
using emms-setup from emms-default.el), and see if the problem still
occurs.

As an example, here's my current EMMS setup (which requires a very new
CVS, but works brilliantly.)

;; TerryP's EMMS-setup
(add-to-list 'load-path "~/elisp/emms/")
(require 'emms-default)
(emms-setup 'cvs "~/mp3/" "~/.giFT/completed/")

;; Set up additional EMMS-variables.
(setq emms-pbi-playlist-entry-max-length 30
      emms-track-description-function 'emms-info-file-info-song-artist
      emms-pbi-track-description-function 'my-emms-info-description
      emms-playlist-shuffle-function 'identity)

(defun my-emms-info-cut-off (string at)
  "Cut off STRING at AT chars, and return it."
  (if (> (length string) at)
      (concat (erc-trim-string (substring string 0 (- at 2))) "..")
    (erc-trim-string string)))

(defun my-emms-info-description (track)
  "Create my own kind of description for a track."
  (let* ((info (or (emms-info-get track) (make-emms-info :title "" :artist "" 
:album "")))
         (title (emms-info-title info))
         (artist (emms-info-artist info))
         (album (emms-info-album info))
         (maxlength emms-pbi-playlist-entry-max-length))
    (if (and (and title (> (length title) 0))
               (and artist (> (length artist) 0)))
        (progn 
          ;; We have both artist and title.
          (when (and maxlength (< maxlength (+ (length title) (length artist) 
2)))
            (when (> (length title) (- maxlength (/ maxlength 2) 1))
              (setq title (concat (my-emms-info-cut-off title (- maxlength (/ 
maxlength 2) 1)))))
            (when (> (length artist) (- (/ maxlength 2) 2))
              (setq artist (my-emms-info-cut-off artist (- (/ maxlength 2) 
2)))))
          ;; output in format:
          (concat artist " - " title))
      ;; else, use the short filename
      (file-name-nondirectory (file-name-sans-extension (emms-track-name 
track))))))

(global-set-key (kbd "<pause>") 'emms-pbi-popup-playlist)

-- 
Ulrik Jensen -- address@hidden -- http://www.terryp.tk





reply via email to

[Prev in Thread] Current Thread [Next in Thread]