comparison data/model/WritableWaveFileModel.cpp @ 363:0e30c8ec15a0

* Add wave file model method for reading more than one channel at once, avoiding ludicrously expensive backward seeks and double-reads when playing multi-channel files or using them as inputs to feature extraction plugins
author Chris Cannam
date Thu, 24 Jan 2008 14:35:43 +0000
parents c324d410b096
children 166c22eff678
comparison
equal deleted inserted replaced
362:cc4eb32efc6c 363:0e30c8ec15a0
183 size_t 183 size_t
184 WritableWaveFileModel::getData(int channel, size_t start, size_t count, 184 WritableWaveFileModel::getData(int channel, size_t start, size_t count,
185 double *buffer) const 185 double *buffer) const
186 { 186 {
187 if (!m_model || m_model->getChannelCount() == 0) return 0; 187 if (!m_model || m_model->getChannelCount() == 0) return 0;
188 // std::cerr << "WritableWaveFileModel::getValues(" << channel << ", "
189 // << start << ", " << end << "): calling model" << std::endl;
190 return m_model->getData(channel, start, count, buffer); 188 return m_model->getData(channel, start, count, buffer);
191 } 189 }
190
191 size_t
192 WritableWaveFileModel::getData(size_t fromchannel, size_t tochannel,
193 size_t start, size_t count,
194 float **buffers) const
195 {
196 if (!m_model || m_model->getChannelCount() == 0) return 0;
197 return m_model->getData(fromchannel, tochannel, start, count, buffers);
198 }
192 199
193 void 200 void
194 WritableWaveFileModel::getSummaries(size_t channel, size_t start, size_t count, 201 WritableWaveFileModel::getSummaries(size_t channel, size_t start, size_t count,
195 RangeBlock &ranges, 202 RangeBlock &ranges,
196 size_t &blockSize) const 203 size_t &blockSize) const