# HG changeset patch # User Chris Cannam # Date 1269276061 0 # Node ID 7feec7756b41f2ded0585fe2f404214c975ac189 # Parent a4b8ad0f1a8f62f90cb79c40090cfeb46641aa59 * Bit more work on track composer identification diff -r a4b8ad0f1a8f -r 7feec7756b41 data/fileio/OggVorbisFileReader.cpp --- 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; } diff -r a4b8ad0f1a8f -r 7feec7756b41 data/fileio/OggVorbisFileReader.h --- 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 &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;