[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emms-patches] [PATCH 1/2] New info symbols for tracks
From: |
Petteri Hintsanen |
Subject: |
[Emms-patches] [PATCH 1/2] New info symbols for tracks |
Date: |
Thu, 14 May 2015 00:11:02 +0300 |
Add support for info-albumartist, info-albumartistsort, info-artistsort,
info-originalyear and info-label.
---
lisp/emms-browser.el | 24 +++++++++++++++++++-----
lisp/emms-info-libtag.el | 4 ++--
lisp/emms-info.el | 9 +++++++--
3 files changed, 28 insertions(+), 9 deletions(-)
diff --git a/lisp/emms-browser.el b/lisp/emms-browser.el
index dab1428..138bc97 100644
--- a/lisp/emms-browser.el
+++ b/lisp/emms-browser.el
@@ -1,6 +1,6 @@
;;; emms-browser.el --- a track browser supporting covers and filtering
-;; Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2006, 2007, 2008, 2009, 2015 Free Software Foundation, Inc.
;; Author: Damien Elmes <address@hidden>
;; Keywords: emms, mp3, mpeg, multimedia
@@ -468,6 +468,9 @@ Called once for each directory."
(define-key map (kbd "b 4") 'emms-browse-by-year)
(define-key map (kbd "b 5") 'emms-browse-by-composer)
(define-key map (kbd "b 6") 'emms-browse-by-performer)
+ (define-key map (kbd "b 7") 'emms-browse-by-albumartist)
+ (define-key map (kbd "b 8") 'emms-browse-by-originalyear)
+ (define-key map (kbd "b 9") 'emms-browse-by-label)
(define-key map (kbd "s a") 'emms-browser-search-by-artist)
(define-key map (kbd "s c") 'emms-browser-search-by-composer)
(define-key map (kbd "s p") 'emms-browser-search-by-performer)
@@ -634,6 +637,9 @@ example function is `emms-browse-by-artist'."
(emms-browser-add-category "album" 'info-album)
(emms-browser-add-category "genre" 'info-genre)
(emms-browser-add-category "year" 'info-year)
+(emms-browser-add-category "albumartist" 'info-albumartist)
+(emms-browser-add-category "originalyear" 'info-originalyear)
+(emms-browser-add-category "label" 'info-label)
(defun emms-browser-get-track-field (track type)
"Return TYPE from TRACK.
@@ -734,12 +740,15 @@ browser, and hit 'b 1' to refresh.")))
"Return the next sensible mapping.
Eg. if CURRENT-MAPPING is currently 'info-artist, return 'info-album."
(cond
+ ((eq current-mapping 'info-albumartist) 'info-album)
((eq current-mapping 'info-artist) 'info-album)
((eq current-mapping 'info-composer) 'info-album)
((eq current-mapping 'info-performer) 'info-album)
((eq current-mapping 'info-album) 'info-title)
((eq current-mapping 'info-genre) 'info-artist)
- ((eq current-mapping 'info-year) 'info-artist)))
+ ((eq current-mapping 'info-year) 'info-artist)
+ ((eq current-mapping 'info-originalyear) 'info-artist)
+ ((eq current-mapping 'info-label) 'info-artist)))
(defun emms-browser-make-bdata-tree (type level tracks name)
"Build a tree of browser DB elements for tracks."
@@ -800,8 +809,8 @@ return an empty string."
tracknum)))))
(defun emms-browser-disc-number (track)
- "Return a string representation of a track number.
-The string will end in a space. If no track number is available,
+ "Return a string representation of a disc number.
+The string will end in a space. If no disc number is available,
return an empty string."
(let ((discnum (emms-track-get track 'info-discnumber)))
(if (or (not (stringp discnum)) (string= discnum "0"))
@@ -1735,8 +1744,10 @@ If > album level, most of the track data will not make
sense."
`(("i" . ,indent)
("n" . ,name)
("y" . ,(emms-track-get track 'info-year))
+ ("Y" . ,(emms-track-get track 'info-originalyear))
("A" . ,(emms-track-get track 'info-album))
("a" . ,(emms-track-get track 'info-artist))
+ ("b" . ,(emms-track-get track 'info-albumartist))
("C" . ,(emms-track-get track 'info-composer))
("p" . ,(emms-track-get track 'info-performer))
("t" . ,(emms-track-get track 'info-title))
@@ -1789,11 +1800,14 @@ If > album level, most of the track data will not make
sense."
(let* ((type (emms-browser-bdata-type bdata))
(name (cond
((or (eq type 'info-year)
- (eq type 'info-genre)) "year/genre")
+ (eq type 'info-originalyear)
+ (eq type 'info-genre)
+ (eq type 'info-label)) "year/genre")
((eq type 'info-artist) "artist")
((eq type 'info-composer) "composer")
((eq type 'info-performer) "performer")
((eq type 'info-album) "album")
+ ((eq type 'info-albumartist) "artist")
((eq type 'info-title) "track"))))
(intern
(concat "emms-browser-" name "-face"))))
diff --git a/lisp/emms-info-libtag.el b/lisp/emms-info-libtag.el
index 7954ab2..4e6ebeb 100644
--- a/lisp/emms-info-libtag.el
+++ b/lisp/emms-info-libtag.el
@@ -1,7 +1,7 @@
;;; emms-info-libtag.el --- Info-method for EMMS using libtag
;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008,
-;; 2009 Free Software Foundation, Inc.
+;; 2009, 2015 Free Software Foundation, Inc.
;; Authors: Ulrik Jensen <address@hidden>
;; Jorgen Schäfer <address@hidden>
@@ -101,7 +101,7 @@ Case is irrelevant."
(replace-match "" nil nil))
(goto-char (point-min))
(while (looking-at "^\\([^=\n]+\\)=\\(.*\\)$")
- (let ((name (intern-soft (match-string 1)))
+ (let ((name (intern (match-string 1)))
(value (match-string 2)))
(when (> (length value)
0)
diff --git a/lisp/emms-info.el b/lisp/emms-info.el
index cfc206b..d8e4cd4 100644
--- a/lisp/emms-info.el
+++ b/lisp/emms-info.el
@@ -1,6 +1,6 @@
;;; emms-info.el --- Retrieving track information
-;; Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation
Inc.
+;; Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2015 Free Software
Foundation Inc.
;; Author: Jorgen Schaefer <address@hidden>
@@ -29,7 +29,10 @@
;; The code will add info symbols to the track. The following symbols
;; are defined:
-;; info-artist - string naming the artist
+;; info-albumartist - string naming the album artist
+;; info-albumartistsort - string key for album artist collation
+;; info-artist - string naming the track artist
+;; info-artistsort - string key for artist collation
;; info-composer - string naming the composer
;; info-performer - string naming the performer
;; info-title - string naming the title of the song
@@ -37,8 +40,10 @@
;; info-tracknumber - string(?) naming the track number
;; info-discnumber - string naming the disc number
;; info-year - string naming the year
+;; info-originalyear - string naming the original release year
;; info-note - string of free-form entry
;; info-genre - string naming the genre
+;; info-label - string for the record labels
;; info-playing-time - number giving the seconds of playtime
;;; Code:
--
2.1.4
- [Emms-patches] [PATCH 1/2] New info symbols for tracks,
Petteri Hintsanen <=