|
@@ -75,6 +75,7 @@ is > 0 and < (sizeof *ID3V1-GENRES*)"
|
|
|
(defgeneric title (stream))
|
|
(defgeneric title (stream))
|
|
|
(defgeneric writer (stream))
|
|
(defgeneric writer (stream))
|
|
|
(defgeneric year (stream))
|
|
(defgeneric year (stream))
|
|
|
|
|
+(defgeneric original-date (stream) (:method ((object t)) nil))
|
|
|
|
|
|
|
|
(defgeneric show-tags (file &key &allow-other-keys))
|
|
(defgeneric show-tags (file &key &allow-other-keys))
|
|
|
|
|
|
|
@@ -92,9 +93,8 @@ is > 0 and < (sizeof *ID3V1-GENRES*)"
|
|
|
(defmethod album ((me id3:mp3-file))
|
|
(defmethod album ((me id3:mp3-file))
|
|
|
(declare #.utils:*standard-optimize-settings*)
|
|
(declare #.utils:*standard-optimize-settings*)
|
|
|
|
|
|
|
|
- (let ((frames (id3:get-frames me '("TAL" "TALB"))))
|
|
|
|
|
|
|
+ (let ((frames (id3:get-frames me '("TALB" "TAL"))))
|
|
|
(when frames
|
|
(when frames
|
|
|
- (assert (= 1 (length frames)) () "There can be only one album tag")
|
|
|
|
|
(return-from album (id3:info (first frames)))))
|
|
(return-from album (id3:info (first frames)))))
|
|
|
(if (id3:v21-tag-header (id3:id3-header me))
|
|
(if (id3:v21-tag-header (id3:id3-header me))
|
|
|
(id3:album (id3:v21-tag-header (id3:id3-header me)))
|
|
(id3:album (id3:v21-tag-header (id3:id3-header me)))
|
|
@@ -105,7 +105,6 @@ is > 0 and < (sizeof *ID3V1-GENRES*)"
|
|
|
|
|
|
|
|
(let ((frames (id3:get-frames me '("TP1" "TPE1"))))
|
|
(let ((frames (id3:get-frames me '("TP1" "TPE1"))))
|
|
|
(when frames
|
|
(when frames
|
|
|
- (assert (= 1 (length frames)) () "There can be only one artist tag")
|
|
|
|
|
(return-from artist (id3:info (first frames)))))
|
|
(return-from artist (id3:info (first frames)))))
|
|
|
(if (id3:v21-tag-header (id3:id3-header me))
|
|
(if (id3:v21-tag-header (id3:id3-header me))
|
|
|
(id3:artist (id3:v21-tag-header (id3:id3-header me)))
|
|
(id3:artist (id3:v21-tag-header (id3:id3-header me)))
|
|
@@ -132,7 +131,6 @@ is > 0 and < (sizeof *ID3V1-GENRES*)"
|
|
|
|
|
|
|
|
(let ((frames (id3:get-frames me '("TRD" "TDRC"))))
|
|
(let ((frames (id3:get-frames me '("TRD" "TDRC"))))
|
|
|
(when frames
|
|
(when frames
|
|
|
- (assert (= 1 (length frames)) () "There can be only one year tag")
|
|
|
|
|
(return-from year (id3:info (first frames)))))
|
|
(return-from year (id3:info (first frames)))))
|
|
|
(if (id3:v21-tag-header (id3:id3-header me))
|
|
(if (id3:v21-tag-header (id3:id3-header me))
|
|
|
(id3:year (id3:v21-tag-header (id3:id3-header me)))
|
|
(id3:year (id3:v21-tag-header (id3:id3-header me)))
|
|
@@ -143,7 +141,6 @@ is > 0 and < (sizeof *ID3V1-GENRES*)"
|
|
|
|
|
|
|
|
(let ((frames (id3:get-frames me '("TT2" "TIT2"))))
|
|
(let ((frames (id3:get-frames me '("TT2" "TIT2"))))
|
|
|
(when frames
|
|
(when frames
|
|
|
- (assert (= 1 (length frames)) () "There can be only one title tag")
|
|
|
|
|
(return-from title (id3:info (first frames)))))
|
|
(return-from title (id3:info (first frames)))))
|
|
|
(if (id3:v21-tag-header (id3:id3-header me))
|
|
(if (id3:v21-tag-header (id3:id3-header me))
|
|
|
(id3:title (id3:v21-tag-header (id3:id3-header me)))
|
|
(id3:title (id3:v21-tag-header (id3:id3-header me)))
|
|
@@ -190,7 +187,6 @@ is > 0 and < (sizeof *ID3V1-GENRES*)"
|
|
|
|
|
|
|
|
(let ((frames (id3:get-frames me '("TP2" "TPE2"))))
|
|
(let ((frames (id3:get-frames me '("TP2" "TPE2"))))
|
|
|
(when frames
|
|
(when frames
|
|
|
- (assert (= 1 (length frames)) () "There can be only one album-artist tag")
|
|
|
|
|
(return-from album-artist (id3:info (first frames)))))
|
|
(return-from album-artist (id3:info (first frames)))))
|
|
|
nil)
|
|
nil)
|
|
|
|
|
|
|
@@ -199,7 +195,6 @@ is > 0 and < (sizeof *ID3V1-GENRES*)"
|
|
|
|
|
|
|
|
(let ((frames (id3:get-frames me '("TCM" "TCOM"))))
|
|
(let ((frames (id3:get-frames me '("TCM" "TCOM"))))
|
|
|
(when frames
|
|
(when frames
|
|
|
- (assert (= 1 (length frames)) () "There can be only one composer tag")
|
|
|
|
|
(return-from composer (id3:info (first frames)))))
|
|
(return-from composer (id3:info (first frames)))))
|
|
|
nil)
|
|
nil)
|
|
|
|
|
|
|
@@ -208,7 +203,6 @@ is > 0 and < (sizeof *ID3V1-GENRES*)"
|
|
|
|
|
|
|
|
(let ((frames (id3:get-frames me '("TCR" "TCOP"))))
|
|
(let ((frames (id3:get-frames me '("TCR" "TCOP"))))
|
|
|
(when frames
|
|
(when frames
|
|
|
- (assert (= 1 (length frames)) () "There can be only one copyright tag")
|
|
|
|
|
(return-from copyright (id3:info (first frames)))))
|
|
(return-from copyright (id3:info (first frames)))))
|
|
|
nil)
|
|
nil)
|
|
|
|
|
|
|
@@ -217,7 +211,6 @@ is > 0 and < (sizeof *ID3V1-GENRES*)"
|
|
|
|
|
|
|
|
(let ((frames (id3:get-frames me '("TEN" "TENC"))))
|
|
(let ((frames (id3:get-frames me '("TEN" "TENC"))))
|
|
|
(when frames
|
|
(when frames
|
|
|
- (assert (= 1 (length frames)) () "There can be only one encoder tag")
|
|
|
|
|
(return-from encoder (id3:info (first frames)))))
|
|
(return-from encoder (id3:info (first frames)))))
|
|
|
nil)
|
|
nil)
|
|
|
|
|
|
|
@@ -226,7 +219,6 @@ is > 0 and < (sizeof *ID3V1-GENRES*)"
|
|
|
|
|
|
|
|
(let ((frames (id3:get-frames me '("TT1" "TTE1"))))
|
|
(let ((frames (id3:get-frames me '("TT1" "TTE1"))))
|
|
|
(when frames
|
|
(when frames
|
|
|
- (assert (= 1 (length frames)) () "There can be only one group tag")
|
|
|
|
|
(return-from groups (id3:info (first frames)))))
|
|
(return-from groups (id3:info (first frames)))))
|
|
|
nil)
|
|
nil)
|
|
|
|
|
|
|
@@ -235,7 +227,6 @@ is > 0 and < (sizeof *ID3V1-GENRES*)"
|
|
|
|
|
|
|
|
(let ((frames (id3:get-frames me '("ULT" "USLT"))))
|
|
(let ((frames (id3:get-frames me '("ULT" "USLT"))))
|
|
|
(when frames
|
|
(when frames
|
|
|
- (assert (= 1 (length frames)) () "There can be only one lyrics tag")
|
|
|
|
|
(return-from lyrics (id3:val (first frames)))))
|
|
(return-from lyrics (id3:val (first frames)))))
|
|
|
nil)
|
|
nil)
|
|
|
|
|
|
|
@@ -244,7 +235,6 @@ is > 0 and < (sizeof *ID3V1-GENRES*)"
|
|
|
|
|
|
|
|
(let ((frames (id3:get-frames me '("TCM" "TCOM"))))
|
|
(let ((frames (id3:get-frames me '("TCM" "TCOM"))))
|
|
|
(when frames
|
|
(when frames
|
|
|
- (assert (= 1 (length frames)) () "There can be only one composer tag")
|
|
|
|
|
(return-from writer (id3:info (first frames)))))
|
|
(return-from writer (id3:info (first frames)))))
|
|
|
nil)
|
|
nil)
|
|
|
|
|
|
|
@@ -261,7 +251,6 @@ is > 0 and < (sizeof *ID3V1-GENRES*)"
|
|
|
|
|
|
|
|
(let ((frames (id3:get-frames me '("TPA" "TPOS"))))
|
|
(let ((frames (id3:get-frames me '("TPA" "TPOS"))))
|
|
|
(when frames
|
|
(when frames
|
|
|
- (assert (= 1 (length frames)) () "There can be only one disk number tag")
|
|
|
|
|
(return-from disk (mk-lst (id3:info (first frames))))))
|
|
(return-from disk (mk-lst (id3:info (first frames))))))
|
|
|
nil)
|
|
nil)
|
|
|
|
|
|
|
@@ -270,7 +259,6 @@ is > 0 and < (sizeof *ID3V1-GENRES*)"
|
|
|
|
|
|
|
|
(let ((frames (id3:get-frames me '("TBP" "TBPM"))))
|
|
(let ((frames (id3:get-frames me '("TBP" "TBPM"))))
|
|
|
(when frames
|
|
(when frames
|
|
|
- (assert (= 1 (length frames)) () "There can be only one tempo tag")
|
|
|
|
|
(return-from tempo (id3:info (first frames)))))
|
|
(return-from tempo (id3:info (first frames)))))
|
|
|
nil)
|
|
nil)
|
|
|
|
|
|
|
@@ -288,10 +276,18 @@ is > 0 and < (sizeof *ID3V1-GENRES*)"
|
|
|
|
|
|
|
|
(let ((frames (id3:get-frames me '("TRK" "TRCK"))))
|
|
(let ((frames (id3:get-frames me '("TRK" "TRCK"))))
|
|
|
(when frames
|
|
(when frames
|
|
|
- (assert (= 1 (length frames)) () "There can be only one track number tag")
|
|
|
|
|
(return-from track (mk-lst (id3:info (first frames))))))
|
|
(return-from track (mk-lst (id3:info (first frames))))))
|
|
|
nil)
|
|
nil)
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+(defmethod original-date ((me id3:mp3-file))
|
|
|
|
|
+ (declare #.utils:*standard-optimize-settings*)
|
|
|
|
|
+
|
|
|
|
|
+ (let ((frames (id3:get-frames me '("TDOR" "TORY" "TOR"))))
|
|
|
|
|
+ (when frames
|
|
|
|
|
+ (return-from original-date (id3:info (first frames)))))
|
|
|
|
|
+ nil)
|
|
|
|
|
+
|
|
|
(defmethod show-tags ((me id3:mp3-file) &key (raw *raw-tags*))
|
|
(defmethod show-tags ((me id3:mp3-file) &key (raw *raw-tags*))
|
|
|
"Show the tags for an MP3. If RAW is non-nil, dump all the frames;
|
|
"Show the tags for an MP3. If RAW is non-nil, dump all the frames;
|
|
|
else, print out a subset."
|
|
else, print out a subset."
|