Source

cl-taglib / cl-taglib.lisp

Diff from to

cl-taglib.lisp

 (defcfun (file-audioproperties "taglib_file_audioproperties") :pointer
   (file :pointer))
 
-(defcfun (file-save "taglib_file_save") :boolean
+(defcfun (tagfile-save "taglib_file_save") :boolean
   (file :pointer))
 
 (defmacro with-tag-file ((var path) &body body)
 (tag-accessor-for :genre :string)
 (tag-accessor-for :year :uint)
 (tag-accessor-for :track :uint)
+
+(defmacro audio-reader-for (slot)
+  (let ((function-name (intern (concatenate 'string "AUDIO-" (string slot))))
+	(foreign-name (string-downcase (concatenate 'string "taglib_audioproperties_" (string slot)))))
+    `(defcfun (,function-name ,foreign-name) :int
+       (audio :pointer))))
+
+(audio-reader-for :length)
+(audio-reader-for :bitrate)
+(audio-reader-for :samplerate)
+(audio-reader-for :channels)