Mercurial > hg > svcore
comparison data/fileio/AudioFileReaderFactory.cpp @ 1359:1c9bbbb6116a 3.0-integration
Use W64 instead of WAV for decoded files; use Ogg reader in preference to WAV one for Ogg files (WAV reader works, via libsndfile, but doesn't load metadata); fix Ogg reader to use QFile open instead of non-Win32-compatible API; add more encoder tests, audio writer test, midi reader test
author | Chris Cannam |
---|---|
date | Tue, 10 Jan 2017 10:58:25 +0000 |
parents | c0fece5e7755 |
children | 70e172e6cc59 c8fad3c14a2b |
comparison
equal
deleted
inserted
replaced
1358:b7be05d57f0a | 1359:1c9bbbb6116a |
---|---|
124 SVDEBUG << "AudioFileReaderFactory: Checking whether any reader officially handles this source" << endl; | 124 SVDEBUG << "AudioFileReaderFactory: Checking whether any reader officially handles this source" << endl; |
125 } else { | 125 } else { |
126 SVDEBUG << "AudioFileReaderFactory: Source not officially handled by any reader, trying again with each reader in turn" | 126 SVDEBUG << "AudioFileReaderFactory: Source not officially handled by any reader, trying again with each reader in turn" |
127 << endl; | 127 << endl; |
128 } | 128 } |
129 | |
130 #ifdef HAVE_OGGZ | |
131 #ifdef HAVE_FISHSOUND | |
132 // If we have the "real" Ogg reader, use that first. Otherwise | |
133 // the WavFileReader will likely accept Ogg files (as | |
134 // libsndfile supports them) but it has no ability to return | |
135 // file metadata, so we get a slightly less useful result. | |
136 if (anyReader || OggVorbisFileReader::supports(source)) { | |
137 | |
138 reader = new OggVorbisFileReader | |
139 (source, decodeMode, cacheMode, targetRate, normalised, reporter); | |
140 | |
141 if (reader->isOK()) { | |
142 SVDEBUG << "AudioFileReaderFactory: Ogg file reader is OK, returning it" << endl; | |
143 return reader; | |
144 } else { | |
145 delete reader; | |
146 } | |
147 } | |
148 #endif | |
149 #endif | |
129 | 150 |
130 if (anyReader || WavFileReader::supports(source)) { | 151 if (anyReader || WavFileReader::supports(source)) { |
131 | 152 |
132 reader = new WavFileReader(source); | 153 reader = new WavFileReader(source); |
133 | 154 |
155 return reader; | 176 return reader; |
156 } else { | 177 } else { |
157 delete reader; | 178 delete reader; |
158 } | 179 } |
159 } | 180 } |
160 | |
161 #ifdef HAVE_OGGZ | |
162 #ifdef HAVE_FISHSOUND | |
163 if (anyReader || OggVorbisFileReader::supports(source)) { | |
164 | |
165 reader = new OggVorbisFileReader | |
166 (source, decodeMode, cacheMode, targetRate, normalised, reporter); | |
167 | |
168 if (reader->isOK()) { | |
169 SVDEBUG << "AudioFileReaderFactory: Ogg file reader is OK, returning it" << endl; | |
170 return reader; | |
171 } else { | |
172 delete reader; | |
173 } | |
174 } | |
175 #endif | |
176 #endif | |
177 | 181 |
178 #ifdef HAVE_MAD | 182 #ifdef HAVE_MAD |
179 if (anyReader || MP3FileReader::supports(source)) { | 183 if (anyReader || MP3FileReader::supports(source)) { |
180 | 184 |
181 MP3FileReader::GaplessMode gapless = | 185 MP3FileReader::GaplessMode gapless = |