comparison data/fileio/CoreAudioFileReader.cpp @ 847:2d53205f70cd tonioni

Merge from default branch
author Chris Cannam
date Tue, 26 Nov 2013 14:37:01 +0000
parents 54829c1e155e f5cd33909744
children f3cda3280398 59e7fe1b1003
comparison
equal deleted inserted replaced
841:226733f3cf3f 847:2d53205f70cd
75 75
76 m_d->buffer.mBuffers[0].mData = 0; 76 m_d->buffer.mBuffers[0].mData = 0;
77 77
78 Profiler profiler("CoreAudioFileReader::CoreAudioFileReader", true); 78 Profiler profiler("CoreAudioFileReader::CoreAudioFileReader", true);
79 79
80 SVDEBUG << "CoreAudioFileReader: path is \"" << m_path.toStdString() << "\"" << endl; 80 SVDEBUG << "CoreAudioFileReader: path is \"" << m_path << "\"" << endl;
81 81
82 QByteArray ba = m_path.toLocal8Bit(); 82 QByteArray ba = m_path.toLocal8Bit();
83 83
84 CFURLRef url = CFURLCreateFromFileSystemRepresentation 84 CFURLRef url = CFURLCreateFromFileSystemRepresentation
85 (kCFAllocatorDefault, 85 (kCFAllocatorDefault,
122 } 122 }
123 123
124 m_channelCount = m_d->asbd.mChannelsPerFrame; 124 m_channelCount = m_d->asbd.mChannelsPerFrame;
125 m_fileRate = m_d->asbd.mSampleRate; 125 m_fileRate = m_d->asbd.mSampleRate;
126 126
127 std::cerr << "CoreAudioReadStream: " << m_channelCount << " channels, " << m_fileRate << " Hz" << std::endl; 127 cerr << "CoreAudioReadStream: " << m_channelCount << " channels, " << m_fileRate << " Hz" << endl;
128 128
129 m_d->asbd.mFormatID = kAudioFormatLinearPCM; 129 m_d->asbd.mFormatID = kAudioFormatLinearPCM;
130 m_d->asbd.mFormatFlags = 130 m_d->asbd.mFormatFlags =
131 kAudioFormatFlagIsFloat | 131 kAudioFormatFlagIsFloat |
132 kAudioFormatFlagIsPacked | 132 kAudioFormatFlagIsPacked |
172 break; 172 break;
173 } 173 }
174 174
175 //!!! progress? 175 //!!! progress?
176 176
177 // std::cerr << "Read " << framesRead << " frames (block size " << m_d->blockSize << ")" << std::endl; 177 // cerr << "Read " << framesRead << " frames (block size " << m_d->blockSize << ")" << endl;
178 178
179 // buffers are interleaved unless specified otherwise 179 // buffers are interleaved unless specified otherwise
180 addSamplesToDecodeCache((float *)m_d->buffer.mBuffers[0].mData, framesRead); 180 addSamplesToDecodeCache((float *)m_d->buffer.mBuffers[0].mData, framesRead);
181 181
182 if (framesRead < m_d->blockSize) break; 182 if (framesRead < m_d->blockSize) break;
189 } 189 }
190 190
191 191
192 CoreAudioFileReader::~CoreAudioFileReader() 192 CoreAudioFileReader::~CoreAudioFileReader()
193 { 193 {
194 std::cerr << "CoreAudioFileReader::~CoreAudioFileReader" << std::endl; 194 cerr << "CoreAudioFileReader::~CoreAudioFileReader" << endl;
195 195
196 if (m_d->valid) { 196 if (m_d->valid) {
197 ExtAudioFileDispose(m_d->file); 197 ExtAudioFileDispose(m_d->file);
198 delete[] m_d->buffer.mBuffers[0].mData; 198 delete[] m_d->buffer.mBuffers[0].mData;
199 } 199 }