diff options
author | Ye Wenbin <wenbinye@gmail.com> | 2008-05-03 15:09:00 +0000 |
---|---|---|
committer | Ye Wenbin <wenbinye@gmail.com> | 2008-05-03 15:09:00 +0000 |
commit | bbefa2ae801843625389a80b7b28c7e579fab96d (patch) | |
tree | deb2f5d286fa4043d02d2d1f698f7312197a60c7 /emms-tag-editor.el | |
parent | 84976d82cfda6fac3af21b1e1b0df81c2136c80b (diff) |
Get and set Flac file tags
darcs-hash:20080503150900-94065-f674212fe81666e233d381462fbe3bd1f67f9eae.gz
Diffstat (limited to 'emms-tag-editor.el')
-rw-r--r-- | emms-tag-editor.el | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/emms-tag-editor.el b/emms-tag-editor.el index 50c22eb..5f9d78e 100644 --- a/emms-tag-editor.el +++ b/emms-tag-editor.el @@ -76,6 +76,7 @@ (default (emms-tag-editor-make-format (remove 'info-date tags)))) `(("mp3" . ,default) ("ogg" . ,(emms-tag-editor-make-format (remove 'info-year tags))) + ("flac" . ,(emms-tag-editor-make-format (remove 'info-year tags))) ("default" . ,default))) "Format to use when inserting the track. The CAR part is the extension of the track name, and the CDR part @@ -123,7 +124,8 @@ See also `emms-tag-editor-default-parser'.") (info-year . "y") (info-genre . "g") (info-note . "c"))) - ("ogg" . emms-tag-editor-tag-ogg)) + ("ogg" . emms-tag-editor-tag-ogg) + ("flac" . emms-tag-editor-tag-flac)) "An alist used when committing changes to tags in files. If the external program sets tags by command line options one-by-one such as mp3info, then the list should like: @@ -134,6 +136,24 @@ should be given. See also `emms-tag-editor-tag-file' and `emms-tag-editor-tag-ogg'.") +(defun emms-tag-editor-tag-flac (track) + "Commit changes to an OGG file according to TRACK." + (require 'emms-info-metaflac) + (with-temp-buffer + (let (need val) + (mapc (lambda (tag) + (let ((info-tag (intern (concat "info-" tag)))) + (when (> (length (setq val (emms-track-get track info-tag))) 0) + (insert (upcase tag) "=" val "\n")))) + '("artist" "composer" "performer" "title" "album" "tracknumber" "date" "genre" "note")) + (when (buffer-string) + (funcall #'call-process-region (point-min) (point-max) + emms-info-metaflac-program-name nil + (get-buffer-create emms-tag-editor-log-buffer) + nil + "--import-tags-from=-" + (emms-track-name track)))))) + (defun emms-tag-editor-tag-ogg (track) "Commit changes to an OGG file according to TRACK." (let (args val) |