diff data/model/WaveFileModel.cpp @ 1041:843f67be0ed9 cxx11

Replace the get*Frames calls in AudioFileReader with less stupid API
author Chris Cannam
date Wed, 04 Mar 2015 12:30:41 +0000
parents a1cd5abcb38b
children 16dc7307d43a
line wrap: on
line diff
--- a/data/model/WaveFileModel.cpp	Wed Mar 04 12:01:04 2015 +0000
+++ b/data/model/WaveFileModel.cpp	Wed Mar 04 12:30:41 2015 +0000
@@ -229,8 +229,7 @@
 
     int channels = getChannelCount();
 
-    SampleBlock frames(count * channels);
-    m_reader->getInterleavedFrames(start, count, frames);
+    SampleBlock frames = m_reader->getInterleavedFrames(start, count);
 
     sv_frame_t i = 0;
 
@@ -286,8 +285,7 @@
 
     int channels = getChannelCount();
 
-    SampleBlock frames(count * channels);
-    m_reader->getInterleavedFrames(start, count, frames);
+    SampleBlock frames = m_reader->getInterleavedFrames(start, count);
 
     sv_frame_t i = 0;
 
@@ -372,8 +370,7 @@
         return 0;
     }
 
-    SampleBlock frames(count * channels);
-    m_reader->getInterleavedFrames(start, count, frames);
+    SampleBlock frames = m_reader->getInterleavedFrames(start, count);
 
     sv_frame_t i = 0;
 
@@ -455,7 +452,7 @@
             m_lastDirectReadCount != count ||
             m_directRead.empty()) {
 
-            m_reader->getInterleavedFrames(start, count, m_directRead);
+            m_directRead = m_reader->getInterleavedFrames(start, count);
             m_lastDirectReadStart = start;
             m_lastDirectReadCount = count;
         }
@@ -709,7 +706,7 @@
 
             if (updating && (frame + readBlockSize > m_frameCount)) break;
 
-            m_model.m_reader->getInterleavedFrames(frame, readBlockSize, block);
+            block = m_model.m_reader->getInterleavedFrames(frame, readBlockSize);
 
 //            cerr << "block is " << block.size() << endl;