comparison data/fileio/WavFileReader.cpp @ 1599:ce185d4dd408 bqaudiostream

Merge from default branch
author Chris Cannam
date Wed, 23 Jan 2019 14:43:43 +0000
parents f8e3dcbafb4d 70e172e6cc59
children 14747f24ad04
comparison
equal deleted inserted replaced
1598:d2555df635ec 1599:ce185d4dd408
26 using namespace std; 26 using namespace std;
27 27
28 WavFileReader::WavFileReader(FileSource source, 28 WavFileReader::WavFileReader(FileSource source,
29 bool fileUpdating, 29 bool fileUpdating,
30 Normalisation normalisation) : 30 Normalisation normalisation) :
31 m_file(0), 31 m_file(nullptr),
32 m_source(source), 32 m_source(source),
33 m_path(source.getLocalFilename()), 33 m_path(source.getLocalFilename()),
34 m_seekable(false), 34 m_seekable(false),
35 m_lastStart(0), 35 m_lastStart(0),
36 m_lastCount(0), 36 m_lastCount(0),
277 void 277 void
278 WavFileReader::getSupportedExtensions(set<QString> &extensions) 278 WavFileReader::getSupportedExtensions(set<QString> &extensions)
279 { 279 {
280 int count; 280 int count;
281 281
282 if (sf_command(0, SFC_GET_FORMAT_MAJOR_COUNT, &count, sizeof(count))) { 282 if (sf_command(nullptr, SFC_GET_FORMAT_MAJOR_COUNT, &count, sizeof(count))) {
283 extensions.insert("wav"); 283 extensions.insert("wav");
284 extensions.insert("aiff"); 284 extensions.insert("aiff");
285 extensions.insert("aifc"); 285 extensions.insert("aifc");
286 extensions.insert("aif"); 286 extensions.insert("aif");
287 return; 287 return;
288 } 288 }
289 289
290 SF_FORMAT_INFO info; 290 SF_FORMAT_INFO info;
291 for (int i = 0; i < count; ++i) { 291 for (int i = 0; i < count; ++i) {
292 info.format = i; 292 info.format = i;
293 if (!sf_command(0, SFC_GET_FORMAT_MAJOR, &info, sizeof(info))) { 293 if (!sf_command(nullptr, SFC_GET_FORMAT_MAJOR, &info, sizeof(info))) {
294 QString ext = QString(info.extension).toLower(); 294 QString ext = QString(info.extension).toLower();
295 extensions.insert(ext); 295 extensions.insert(ext);
296 if (ext == "oga") { 296 if (ext == "oga") {
297 // libsndfile is awfully proper, it says it only 297 // libsndfile is awfully proper, it says it only
298 // supports .oga but lots of Ogg audio files in the 298 // supports .oga but lots of Ogg audio files in the