Mercurial > hg > svcore
diff data/model/test/MockWaveModel.cpp @ 1365:3382d914e110
Merge from branch 3.0-integration
author | Chris Cannam |
---|---|
date | Fri, 13 Jan 2017 10:29:44 +0000 |
parents | 54af1e21705c |
children | 48e9f538e6e9 c0f69bddea12 |
line wrap: on
line diff
--- a/data/model/test/MockWaveModel.cpp Mon Nov 21 16:32:58 2016 +0000 +++ b/data/model/test/MockWaveModel.cpp Fri Jan 13 10:29:44 2017 +0000 @@ -26,40 +26,39 @@ } } -sv_frame_t -MockWaveModel::getData(int channel, sv_frame_t start, sv_frame_t count, - float *buffer) const +floatvec_t +MockWaveModel::getData(int channel, sv_frame_t start, sv_frame_t count) const { sv_frame_t i = 0; - cerr << "MockWaveModel::getData(" << channel << "," << start << "," << count << "): "; +// cerr << "MockWaveModel::getData(" << channel << "," << start << "," << count << "): "; + floatvec_t data; + while (i < count) { sv_frame_t idx = start + i; if (!in_range_for(m_data[channel], idx)) break; - buffer[i] = m_data[channel][idx]; - cerr << buffer[i] << " "; + data.push_back(m_data[channel][idx]); +// cerr << data[i] << " "; ++i; } - cerr << endl; +// cerr << endl; - return i; + return data; } -sv_frame_t +vector<floatvec_t> MockWaveModel::getMultiChannelData(int fromchannel, int tochannel, - sv_frame_t start, sv_frame_t count, - float **buffers) const + sv_frame_t start, sv_frame_t count) const { - sv_frame_t min = count; - + vector<floatvec_t> data(tochannel - fromchannel + 1); + for (int c = fromchannel; c <= tochannel; ++c) { - sv_frame_t n = getData(c, start, count, buffers[c]); - if (n < min) min = n; + data.push_back(getData(c, start, count)); } - return min; + return data; } vector<float>