diff 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
line wrap: on
line diff
--- a/data/model/WritableWaveFileModel.cpp	Thu Jan 24 11:03:59 2008 +0000
+++ b/data/model/WritableWaveFileModel.cpp	Thu Jan 24 14:35:43 2008 +0000
@@ -185,11 +185,18 @@
                                double *buffer) const
 {
     if (!m_model || m_model->getChannelCount() == 0) return 0;
-//    std::cerr << "WritableWaveFileModel::getValues(" << channel << ", "
-//              << start << ", " << end << "): calling model" << std::endl;
     return m_model->getData(channel, start, count, buffer);
 }
 
+size_t
+WritableWaveFileModel::getData(size_t fromchannel, size_t tochannel,
+                               size_t start, size_t count,
+                               float **buffers) const
+{
+    if (!m_model || m_model->getChannelCount() == 0) return 0;
+    return m_model->getData(fromchannel, tochannel, start, count, buffers);
+}    
+
 void
 WritableWaveFileModel::getSummaries(size_t channel, size_t start, size_t count,
                                     RangeBlock &ranges,