Mercurial > hg > svcore
diff data/fileio/AudioFileReaderFactory.cpp @ 1206:659372323b45 tony-2.0-integration
Merge latest SV 3.0 branch code
author | Chris Cannam |
---|---|
date | Fri, 19 Aug 2016 15:58:57 +0100 |
parents | 6877f4200912 |
children | 13701ab9d2c7 |
line wrap: on
line diff
--- a/data/fileio/AudioFileReaderFactory.cpp Tue Oct 20 12:54:06 2015 +0100 +++ b/data/fileio/AudioFileReaderFactory.cpp Fri Aug 19 15:58:57 2016 +0100 @@ -29,6 +29,8 @@ #include <QFileInfo> #include <iostream> +//#define DEBUG_AUDIO_FILE_READER_FACTORY 1 + QString AudioFileReaderFactory::getKnownExtensions() { @@ -87,7 +89,9 @@ { QString err; - SVDEBUG << "AudioFileReaderFactory::createReader(\"" << source.getLocation() << "\"): Requested rate: " << targetRate << endl; +#ifdef DEBUG_AUDIO_FILE_READER_FACTORY + cerr << "AudioFileReaderFactory::createReader(\"" << source.getLocation() << "\"): Requested rate: " << targetRate << endl; +#endif if (!source.isOK()) { cerr << "AudioFileReaderFactory::createReader(\"" << source.getLocation() << "\": Failed to retrieve source (transmission error?): " << source.getErrorString() << endl; @@ -95,7 +99,7 @@ } if (!source.isAvailable()) { - SVDEBUG << "AudioFileReaderFactory::createReader(\"" << source.getLocation() << "\": Source not found" << endl; + cerr << "AudioFileReaderFactory::createReader(\"" << source.getLocation() << "\": Source not found" << endl; return 0; } @@ -139,8 +143,10 @@ (cacheMode == CodedAudioFileReader::CacheInMemory) || (targetRate != 0 && fileRate != targetRate))) { - SVDEBUG << "AudioFileReaderFactory::createReader: WAV file rate: " << reader->getSampleRate() << ", normalised " << normalised << ", seekable " << reader->isQuicklySeekable() << ", in memory " << (cacheMode == CodedAudioFileReader::CacheInMemory) << ", creating decoding reader" << endl; - +#ifdef DEBUG_AUDIO_FILE_READER_FACTORY + cerr << "AudioFileReaderFactory::createReader: WAV file rate: " << reader->getSampleRate() << ", normalised " << normalised << ", seekable " << reader->isQuicklySeekable() << ", in memory " << (cacheMode == CodedAudioFileReader::CacheInMemory) << ", creating decoding reader" << endl; +#endif + delete reader; reader = new DecodingWavFileReader (source, @@ -208,7 +214,9 @@ (cacheMode == CodedAudioFileReader::CacheInMemory) || (targetRate != 0 && fileRate != targetRate))) { - SVDEBUG << "AudioFileReaderFactory::createReader: WAV file rate: " << reader->getSampleRate() << ", normalised " << normalised << ", seekable " << reader->isQuicklySeekable() << ", in memory " << (cacheMode == CodedAudioFileReader::CacheInMemory) << ", creating decoding reader" << endl; +#ifdef DEBUG_AUDIO_FILE_READER_FACTORY + cerr << "AudioFileReaderFactory::createReader: WAV file rate: " << reader->getSampleRate() << ", normalised " << normalised << ", seekable " << reader->isQuicklySeekable() << ", in memory " << (cacheMode == CodedAudioFileReader::CacheInMemory) << ", creating decoding reader" << endl; +#endif delete reader; reader = new DecodingWavFileReader