Mercurial > hg > svcore
comparison data/fileio/CoreAudioFileReader.cpp @ 749:0f8a6dda8ac1
Tidy
author | Chris Cannam |
---|---|
date | Mon, 03 Sep 2012 11:10:51 +0100 |
parents | c8ab5f63360d |
children | dc6c0e50724c |
comparison
equal
deleted
inserted
replaced
748:c8ab5f63360d | 749:0f8a6dda8ac1 |
---|---|
197 CoreAudioFileReader::cancelled() | 197 CoreAudioFileReader::cancelled() |
198 { | 198 { |
199 m_cancelled = true; | 199 m_cancelled = true; |
200 } | 200 } |
201 | 201 |
202 /* | |
203 void | |
204 CoreAudioFileReader::DecodeThread::run() | |
205 { | |
206 if (m_reader->m_cacheMode == CacheInTemporaryFile) { | |
207 m_reader->m_completion = 1; | |
208 m_reader->startSerialised("QuickTimeFileReader::Decode"); | |
209 } | |
210 | |
211 while (1) { | |
212 | |
213 UInt32 framesRead = m_reader->m_d->blockSize; | |
214 UInt32 extractionFlags = 0; | |
215 m_reader->m_d->err = MovieAudioExtractionFillBuffer | |
216 (m_reader->m_d->extractionSessionRef, &framesRead, | |
217 &m_reader->m_d->buffer, &extractionFlags); | |
218 if (m_reader->m_d->err) { | |
219 m_reader->m_error = QString("Error in QuickTime decoding: code %1") | |
220 .arg(m_reader->m_d->err); | |
221 break; | |
222 } | |
223 | |
224 // QuickTime buffers are interleaved unless specified otherwise | |
225 m_reader->addSamplesToDecodeCache(m_reader->m_d->data, framesRead); | |
226 | |
227 if (framesRead < m_reader->m_d->blockSize) break; | |
228 } | |
229 | |
230 m_reader->finishDecodeCache(); | |
231 | |
232 m_reader->m_d->err = MovieAudioExtractionEnd(m_reader->m_d->extractionSessionRef); | |
233 if (m_reader->m_d->err) { | |
234 m_reader->m_error = QString("Error ending QuickTime extraction session: code %1").arg(m_reader->m_d->err); | |
235 } | |
236 | |
237 m_reader->m_completion = 100; | |
238 m_reader->endSerialised(); | |
239 } | |
240 */ | |
241 | |
242 | |
243 void | 202 void |
244 CoreAudioFileReader::getSupportedExtensions(std::set<QString> &extensions) | 203 CoreAudioFileReader::getSupportedExtensions(std::set<QString> &extensions) |
245 { | 204 { |
246 extensions.insert("aiff"); | 205 extensions.insert("aiff"); |
247 extensions.insert("aif"); | 206 extensions.insert("aif"); |
248 extensions.insert("au"); | 207 extensions.insert("au"); |
249 extensions.insert("avi"); | |
250 extensions.insert("m4a"); | 208 extensions.insert("m4a"); |
251 extensions.insert("m4b"); | 209 extensions.insert("m4b"); |
252 extensions.insert("m4p"); | 210 extensions.insert("m4p"); |
253 extensions.insert("m4v"); | |
254 extensions.insert("mov"); | |
255 extensions.insert("mp3"); | 211 extensions.insert("mp3"); |
256 extensions.insert("mp4"); | 212 extensions.insert("mp4"); |
257 extensions.insert("wav"); | 213 extensions.insert("wav"); |
258 } | 214 } |
259 | 215 |
270 { | 226 { |
271 return (type == "audio/x-aiff" || | 227 return (type == "audio/x-aiff" || |
272 type == "audio/x-wav" || | 228 type == "audio/x-wav" || |
273 type == "audio/mpeg" || | 229 type == "audio/mpeg" || |
274 type == "audio/basic" || | 230 type == "audio/basic" || |
275 type == "audio/x-aac" || | 231 type == "audio/x-aac"); |
276 type == "video/mp4" || | |
277 type == "video/quicktime"); | |
278 } | 232 } |
279 | 233 |
280 bool | 234 bool |
281 CoreAudioFileReader::supports(FileSource &source) | 235 CoreAudioFileReader::supports(FileSource &source) |
282 { | 236 { |