Mark VandenBrink пре 12 година
родитељ
комит
7ba5488cf3
4 измењених фајлова са 17 додато и 15 уклоњено
  1. 3 0
      abstract-tag.lisp
  2. 1 1
      id3.lisp
  3. 10 12
      m4a.lisp
  4. 3 2
      taglib-tests.lisp

+ 3 - 0
abstract-tag.lisp

@@ -6,6 +6,8 @@
   "Controls whether or not we print 'raw' tags (aka frames) or
 textual representation of tags")
 
+(declaim ((simple-array string (*)) *id3-genres*))
+
 (defparameter *id3v1-genres*
   #("Blues" "Classic Rock" "Country" "Dance" "Disco" "Funk" "Grunge"
     "Hip-Hop" "Jazz" "Metal" "New Age" "Oldies" "Other" "Pop" "R&B" "Rap"
@@ -47,6 +49,7 @@ Ignores case and returns first complete match"
   "Given N, a supposed ID3 genre, range check it to make sure it
 is > 0 and < (sizeof *ID3V1-GENRES*)"
   (declare #.utils:*standard-optimize-settings*)
+  (declare (fixnum n))
 
   (if (or (> n (1- (length *id3v1-genres*)))
             (< n 0))

+ 1 - 1
id3.lisp

@@ -163,7 +163,7 @@ is from the ID3 'spec'"
                                   ("WCOM" "Commercial information")
                                   ("WCOP" "Copyright/Legal information")
                                   ("WOAF" "Official audio file webpage")
-                                  ("WOAR" "Official artist/performer webpage")
+                                  ("WOAR" "Official artist/performer web page")
                                   ("WOAS" "Official audio source webpage")
                                   ("WORS" "Official internet radio station homepage")
                                   ("WPAY" "Payment")

+ 10 - 12
m4a.lisp

@@ -699,15 +699,13 @@ root.moov.trak.mdia.minf.stbl.mp4a, and root.moov.trak.mdia.minf.stbl.mp4a.esds"
 (defun map-mp4-atoms (m4a &key (func nil))
   "Visit each atom we found in M4A"
   (declare #.utils:*standard-optimize-settings*)
-  (let ((count 0))
-    (labels ((_internal-print (atom depth)
-               (format t "~vt~a~%" depth (vpprint atom nil))
-               (incf count)))
-      (when (null func)
-        (setf func #'_internal-print))
-      (tree:traverse
-       (m4a:mp4-atoms m4a)
-       (lambda (node depth)
-         (funcall func (tree:data node) depth))))
-    (when count
-      (format t "~:d atom~p found~%" count count))))
+
+  (labels ((_internal-print (atom depth)
+             (format t "~vt~a~%" depth (vpprint atom nil))))
+
+    (when (null func)
+      (setf func #'_internal-print))
+
+    (tree:traverse
+     (m4a:mp4-atoms m4a) (lambda (node depth)
+                           (funcall func (tree:data node) depth)))))

+ 3 - 2
taglib-tests.lisp

@@ -87,8 +87,8 @@
               1))))
 
 (defun get-stats (&optional (dir "/home/markv/Music/Queen"))
-
   "Gen up some interesting statistics on DIR"
+
   (let ((m4-ht (make-hash-table :test #'equalp))
         (m3-ht (make-hash-table :test #'equalp)))
     (do-audio-dir
@@ -101,7 +101,8 @@
                                        (insert-into-ht (id3:id f) m3-ht))))
           (m4a:mp4-file
            (m4a:map-mp4-atoms s
-                              :func (lambda (f)
+                              :func (lambda (f d)
+                                      (declare (ignore d))
                                       (insert-into-ht (m4a:atom-type f) m4-ht)))))))
     (format t "MP3 Stats:~%")
     (loop for key being the hash-keys of m3-ht