diff options
-rw-r--r-- | lisp/emms-info-libtag.el | 42 | ||||
-rw-r--r-- | src/emms-print-metadata.c | 2 |
2 files changed, 39 insertions, 5 deletions
diff --git a/lisp/emms-info-libtag.el b/lisp/emms-info-libtag.el index ae416ff..7954ab2 100644 --- a/lisp/emms-info-libtag.el +++ b/lisp/emms-info-libtag.el @@ -43,18 +43,52 @@ ;; (setq emms-info-functions '(emms-info-libtag)) +;; You may have to compile the program from source. +;; Make sure that you have libtag installed. +;; In the EMMS source directory do +;; +;; make emms-print-metadata +;; +;; and copy src/emms-print-metadata to your PATH. + +;; If compilation fails and libtag is installed, you may have to +;; change the line +;; +;; #include <tag_c.h> +;; +;; to the correction location, e.g. +;; +;; #include <taglib/tag_c.h> + ;;; Code: (require 'emms-info) +(defgroup emms-info-libtag nil + "Options for EMMS." + :group 'emms-info) + (defvar emms-info-libtag-coding-system 'utf-8) -(defvar emms-info-libtag-program-name "emms-print-metadata") + +(defcustom emms-info-libtag-program-name "emms-print-metadata" + "Name of emms-info-libtag program." + :type '(string) + :group 'emms-info-libtag) + +(defcustom emms-info-libtag-known-extensions + (regexp-opt '("mp3" "mp4" "m4a" "ogg" "flac" "spx" "wma")) + "Regexp of known extensions compatible with `emms-info-libtag-program-name'. + +Case is irrelevant." + :type '(string) + :group 'emms-info-libtag) (defun emms-info-libtag (track) (when (and (eq 'file (emms-track-type track)) - (string-match - "\\.\\([Mm][Pp][34]\\|[Mm]4[aA]\\|[oO][gG][gG]\\|[fF][lL][aA][cC]\\|[sS][pP][xX]\\)\\'" - (emms-track-name track))) + (let ((case-fold-search t)) + (string-match + emms-info-libtag-known-extensions + (emms-track-name track)))) (with-temp-buffer (when (zerop (let ((coding-system-for-read 'utf-8)) diff --git a/src/emms-print-metadata.c b/src/emms-print-metadata.c index d22fe96..48f4904 100644 --- a/src/emms-print-metadata.c +++ b/src/emms-print-metadata.c @@ -33,7 +33,7 @@ main (int argc, char **argv) if (argc != 2) { - fprintf (stderr, "usage: emms-print-metadata file.{mp3,ogg,flac}\n"); + fprintf (stderr, "usage: emms-print-metadata file.{mp3,ogg,flac}\nother formats may work as well.\n"); exit (1); } |