Mercurial > hg > svcore
comparison data/fileio/CodedAudioFileReader.cpp @ 843:e802e550a1f2
Drop std:: from cout, cerr, endl -- pull these in through Debug.h
author | Chris Cannam |
---|---|
date | Tue, 26 Nov 2013 13:35:08 +0000 |
parents | a43acbe3988f |
children | f5cd33909744 |
comparison
equal
deleted
inserted
replaced
842:23d3a6eca5c3 | 843:e802e550a1f2 |
---|---|
61 delete m_cacheFileReader; | 61 delete m_cacheFileReader; |
62 delete[] m_cacheWriteBuffer; | 62 delete[] m_cacheWriteBuffer; |
63 | 63 |
64 if (m_cacheFileName != "") { | 64 if (m_cacheFileName != "") { |
65 if (!QFile(m_cacheFileName).remove()) { | 65 if (!QFile(m_cacheFileName).remove()) { |
66 std::cerr << "WARNING: CodedAudioFileReader::~CodedAudioFileReader: Failed to delete cache file \"" << m_cacheFileName << "\"" << std::endl; | 66 cerr << "WARNING: CodedAudioFileReader::~CodedAudioFileReader: Failed to delete cache file \"" << m_cacheFileName << "\"" << endl; |
67 } | 67 } |
68 } | 68 } |
69 | 69 |
70 delete m_resampler; | 70 delete m_resampler; |
71 delete[] m_resampleBuffer; | 71 delete[] m_resampleBuffer; |
95 QMutexLocker locker(&m_cacheMutex); | 95 QMutexLocker locker(&m_cacheMutex); |
96 | 96 |
97 SVDEBUG << "CodedAudioFileReader::initialiseDecodeCache: file rate = " << m_fileRate << endl; | 97 SVDEBUG << "CodedAudioFileReader::initialiseDecodeCache: file rate = " << m_fileRate << endl; |
98 | 98 |
99 if (m_fileRate == 0) { | 99 if (m_fileRate == 0) { |
100 std::cerr << "CodedAudioFileReader::initialiseDecodeCache: ERROR: File sample rate unknown (bug in subclass implementation?)" << std::endl; | 100 cerr << "CodedAudioFileReader::initialiseDecodeCache: ERROR: File sample rate unknown (bug in subclass implementation?)" << endl; |
101 throw FileOperationFailed("(coded file)", "File sample rate unknown (bug in subclass implementation?)"); | 101 throw FileOperationFailed("(coded file)", "File sample rate unknown (bug in subclass implementation?)"); |
102 } | 102 } |
103 if (m_sampleRate == 0) { | 103 if (m_sampleRate == 0) { |
104 m_sampleRate = m_fileRate; | 104 m_sampleRate = m_fileRate; |
105 SVDEBUG << "CodedAudioFileReader::initialiseDecodeCache: rate (from file) = " << m_fileRate << endl; | 105 SVDEBUG << "CodedAudioFileReader::initialiseDecodeCache: rate (from file) = " << m_fileRate << endl; |
144 // information here | 144 // information here |
145 | 145 |
146 m_cacheFileReader = new WavFileReader(m_cacheFileName); | 146 m_cacheFileReader = new WavFileReader(m_cacheFileName); |
147 | 147 |
148 if (!m_cacheFileReader->isOK()) { | 148 if (!m_cacheFileReader->isOK()) { |
149 std::cerr << "ERROR: CodedAudioFileReader::initialiseDecodeCache: Failed to construct WAV file reader for temporary file: " << m_cacheFileReader->getError() << std::endl; | 149 cerr << "ERROR: CodedAudioFileReader::initialiseDecodeCache: Failed to construct WAV file reader for temporary file: " << m_cacheFileReader->getError() << endl; |
150 delete m_cacheFileReader; | 150 delete m_cacheFileReader; |
151 m_cacheFileReader = 0; | 151 m_cacheFileReader = 0; |
152 m_cacheMode = CacheInMemory; | 152 m_cacheMode = CacheInMemory; |
153 sf_close(m_cacheFileWritePtr); | 153 sf_close(m_cacheFileWritePtr); |
154 } | 154 } |
155 | 155 |
156 } else { | 156 } else { |
157 std::cerr << "CodedAudioFileReader::initialiseDecodeCache: failed to open cache file \"" << m_cacheFileName << "\" (" << m_channelCount << " channels, sample rate " << m_sampleRate << " for writing, falling back to in-memory cache" << std::endl; | 157 cerr << "CodedAudioFileReader::initialiseDecodeCache: failed to open cache file \"" << m_cacheFileName << "\" (" << m_channelCount << " channels, sample rate " << m_sampleRate << " for writing, falling back to in-memory cache" << endl; |
158 m_cacheMode = CacheInMemory; | 158 m_cacheMode = CacheInMemory; |
159 } | 159 } |
160 | 160 |
161 } catch (DirectoryCreationFailed f) { | 161 } catch (DirectoryCreationFailed f) { |
162 std::cerr << "CodedAudioFileReader::initialiseDecodeCache: failed to create temporary directory! Falling back to in-memory cache" << std::endl; | 162 cerr << "CodedAudioFileReader::initialiseDecodeCache: failed to create temporary directory! Falling back to in-memory cache" << endl; |
163 m_cacheMode = CacheInMemory; | 163 m_cacheMode = CacheInMemory; |
164 } | 164 } |
165 } | 165 } |
166 | 166 |
167 if (m_cacheMode == CacheInMemory) { | 167 if (m_cacheMode == CacheInMemory) { |
264 QMutexLocker locker(&m_cacheMutex); | 264 QMutexLocker locker(&m_cacheMutex); |
265 | 265 |
266 Profiler profiler("CodedAudioFileReader::finishDecodeCache", true); | 266 Profiler profiler("CodedAudioFileReader::finishDecodeCache", true); |
267 | 267 |
268 if (!m_initialised) { | 268 if (!m_initialised) { |
269 std::cerr << "WARNING: CodedAudioFileReader::finishDecodeCache: Cache was never initialised!" << std::endl; | 269 cerr << "WARNING: CodedAudioFileReader::finishDecodeCache: Cache was never initialised!" << endl; |
270 return; | 270 return; |
271 } | 271 } |
272 | 272 |
273 // if (m_cacheWriteBufferIndex > 0) { | 273 // if (m_cacheWriteBufferIndex > 0) { |
274 pushBuffer(m_cacheWriteBuffer, | 274 pushBuffer(m_cacheWriteBuffer, |