diff data/model/ReadOnlyWaveFileModel.cpp @ 1326:54af1e21705c 3.0-integration

Update to use bqvec allocator for float vectors
author Chris Cannam
date Tue, 13 Dec 2016 15:23:21 +0000
parents ff9697592bef
children d40246df828b
line wrap: on
line diff
--- a/data/model/ReadOnlyWaveFileModel.cpp	Tue Dec 13 12:03:48 2016 +0000
+++ b/data/model/ReadOnlyWaveFileModel.cpp	Tue Dec 13 15:23:21 2016 +0000
@@ -202,7 +202,7 @@
     return "";
 }
     
-vector<float>
+floatvec_t
 ReadOnlyWaveFileModel::getData(int channel, sv_frame_t start, sv_frame_t count) const
 {
     // Read directly from the file.  This is used for e.g. audio
@@ -236,12 +236,12 @@
         }
     }
 
-    vector<float> interleaved = m_reader->getInterleavedFrames(start, count);
+    floatvec_t interleaved = m_reader->getInterleavedFrames(start, count);
     if (channels == 1) return interleaved;
 
     sv_frame_t obtained = interleaved.size() / channels;
     
-    vector<float> result(obtained, 0.f);
+    floatvec_t result(obtained, 0.f);
     
     if (channel != -1) {
         // get a single channel
@@ -260,7 +260,7 @@
     return result;
 }
 
-vector<vector<float>>
+vector<floatvec_t>
 ReadOnlyWaveFileModel::getMultiChannelData(int fromchannel, int tochannel,
                                            sv_frame_t start, sv_frame_t count) const
 {
@@ -304,11 +304,11 @@
         }
     }
 
-    vector<float> interleaved = m_reader->getInterleavedFrames(start, count);
+    floatvec_t interleaved = m_reader->getInterleavedFrames(start, count);
     if (channels == 1) return { interleaved };
 
     sv_frame_t obtained = interleaved.size() / channels;
-    vector<vector<float>> result(reqchannels, vector<float>(obtained, 0.f));
+    vector<floatvec_t> result(reqchannels, floatvec_t(obtained, 0.f));
 
     for (int c = fromchannel; c <= tochannel; ++c) {
         int destc = c - fromchannel;
@@ -588,7 +588,7 @@
     
     sv_frame_t frame = 0;
     const sv_frame_t readBlockSize = 32768;
-    vector<float> block;
+    floatvec_t block;
 
     if (!m_model.isOK()) return;