changeset 633:7feec7756b41

* Bit more work on track composer identification
author Chris Cannam
date Mon, 22 Mar 2010 16:41:01 +0000
parents a4b8ad0f1a8f
children 773fc0e43feb
files data/fileio/OggVorbisFileReader.cpp data/fileio/OggVorbisFileReader.h
diffstat 2 files changed, 15 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/data/fileio/OggVorbisFileReader.cpp	Fri Mar 19 12:21:59 2010 +0000
+++ b/data/fileio/OggVorbisFileReader.cpp	Mon Mar 22 16:41:01 2010 +0000
@@ -171,19 +171,20 @@
     OggVorbisFileReader *reader = (OggVorbisFileReader *)data;
 
     if (!reader->m_commentsRead) {
-        {
-            const FishSoundComment *comment = fish_sound_comment_first_byname
-                (fs, "TITLE");
-            if (comment && comment->value) {
-                reader->m_title = QString::fromUtf8(comment->value);
-            }
+        const FishSoundComment *comment;
+        comment = fish_sound_comment_first_byname(fs, "TITLE");
+        if (comment && comment->value) {
+            reader->m_title = QString::fromUtf8(comment->value);
         }
-        {
-            const FishSoundComment *comment = fish_sound_comment_first_byname
-                (fs, "ARTIST");
-            if (comment && comment->value) {
-                reader->m_maker = QString::fromUtf8(comment->value);
-            }
+        comment = fish_sound_comment_first_byname(fs, "ARTIST");
+        if (comment && comment->value) {
+            reader->m_maker = QString::fromUtf8(comment->value);
+        }
+        comment = fish_sound_comment_first(fs);
+        while (comment) {
+            reader->m_tags[QString::fromUtf8(comment->name)] =
+                QString::fromUtf8(comment->value);
+            comment = fish_sound_comment_next(fs, comment);
         }
         reader->m_commentsRead = true;
     }
--- a/data/fileio/OggVorbisFileReader.h	Fri Mar 19 12:21:59 2010 +0000
+++ b/data/fileio/OggVorbisFileReader.h	Mon Mar 22 16:41:01 2010 +0000
@@ -51,6 +51,7 @@
     virtual QString getLocation() const { return m_source.getLocation(); }
     virtual QString getTitle() const { return m_title; }
     virtual QString getMaker() const { return m_maker; }
+    virtual TagMap getTags() const { return m_tags; }
     
     static void getSupportedExtensions(std::set<QString> &extensions);
     static bool supportsExtension(QString ext);
@@ -72,6 +73,7 @@
     QString m_error;
     QString m_title;
     QString m_maker;
+    TagMap m_tags;
 
     OGGZ *m_oggz;
     FishSound *m_fishSound;