comparison data/fileio/OggVorbisFileReader.cpp @ 742:c10cb8782576 coreaudio_tests

Merge from branch "default"
author Chris Cannam
date Sun, 01 Jul 2012 11:53:00 +0100
parents 1424aa29ae95
children a299c4cec0f8
comparison
equal deleted inserted replaced
666:4efa7429cd85 742:c10cb8782576
48 m_decodeThread(0) 48 m_decodeThread(0)
49 { 49 {
50 m_channelCount = 0; 50 m_channelCount = 0;
51 m_fileRate = 0; 51 m_fileRate = 0;
52 52
53 // std::cerr << "OggVorbisFileReader::OggVorbisFileReader(" << m_path.toLocal8Bit().data() << "): now have " << (++instances) << " instances" << std::endl; 53 // SVDEBUG << "OggVorbisFileReader::OggVorbisFileReader(" << m_path.toLocal8Bit().data() << "): now have " << (++instances) << " instances" << endl;
54 54
55 Profiler profiler("OggVorbisFileReader::OggVorbisFileReader", true); 55 Profiler profiler("OggVorbisFileReader::OggVorbisFileReader", true);
56 56
57 QFileInfo info(m_path); 57 QFileInfo info(m_path);
58 m_fileSize = info.size(); 58 m_fileSize = info.size();
100 } 100 }
101 } 101 }
102 102
103 OggVorbisFileReader::~OggVorbisFileReader() 103 OggVorbisFileReader::~OggVorbisFileReader()
104 { 104 {
105 // std::cerr << "OggVorbisFileReader::~OggVorbisFileReader(" << m_path.toLocal8Bit().data() << "): now have " << (--instances) << " instances" << std::endl; 105 // SVDEBUG << "OggVorbisFileReader::~OggVorbisFileReader(" << m_path.toLocal8Bit().data() << "): now have " << (--instances) << " instances" << endl;
106 if (m_decodeThread) { 106 if (m_decodeThread) {
107 m_cancelled = true; 107 m_cancelled = true;
108 m_decodeThread->wait(); 108 m_decodeThread->wait();
109 delete m_decodeThread; 109 delete m_decodeThread;
110 } 110 }
169 void *data) 169 void *data)
170 { 170 {
171 OggVorbisFileReader *reader = (OggVorbisFileReader *)data; 171 OggVorbisFileReader *reader = (OggVorbisFileReader *)data;
172 172
173 if (!reader->m_commentsRead) { 173 if (!reader->m_commentsRead) {
174 { 174 const FishSoundComment *comment;
175 const FishSoundComment *comment = fish_sound_comment_first_byname 175 comment = fish_sound_comment_first_byname(fs, "TITLE");
176 (fs, "TITLE"); 176 if (comment && comment->value) {
177 if (comment && comment->value) { 177 reader->m_title = QString::fromUtf8(comment->value);
178 reader->m_title = QString::fromUtf8(comment->value); 178 }
179 } 179 comment = fish_sound_comment_first_byname(fs, "ARTIST");
180 } 180 if (comment && comment->value) {
181 { 181 reader->m_maker = QString::fromUtf8(comment->value);
182 const FishSoundComment *comment = fish_sound_comment_first_byname 182 }
183 (fs, "ARTIST"); 183 comment = fish_sound_comment_first(fs);
184 if (comment && comment->value) { 184 while (comment) {
185 reader->m_maker = QString::fromUtf8(comment->value); 185 reader->m_tags[QString::fromUtf8(comment->name).toUpper()] =
186 } 186 QString::fromUtf8(comment->value);
187 comment = fish_sound_comment_next(fs, comment);
187 } 188 }
188 reader->m_commentsRead = true; 189 reader->m_commentsRead = true;
189 } 190 }
190 191
191 if (reader->m_channelCount == 0) { 192 if (reader->m_channelCount == 0) {