comparison data/model/test/MockWaveModel.cpp @ 1091:bdebff3265ae simple-fft-model

Simplest naive FFTModel implementation (+ fill in tests)
author Chris Cannam
date Fri, 12 Jun 2015 18:08:57 +0100
parents 5fab8e4f5f19
children 4d9816ba0ebe
comparison
equal deleted inserted replaced
1090:420fc961c0c4 1091:bdebff3265ae
28 MockWaveModel::getData(int channel, sv_frame_t start, sv_frame_t count, 28 MockWaveModel::getData(int channel, sv_frame_t start, sv_frame_t count,
29 float *buffer) const 29 float *buffer) const
30 { 30 {
31 sv_frame_t i = 0; 31 sv_frame_t i = 0;
32 32
33 cerr << "MockWaveModel::getData(" << channel << "," << start << "," << count << "): "; 33 // cerr << "MockWaveModel::getData(" << channel << "," << start << "," << count << "): ";
34 34
35 while (i < count) { 35 while (i < count) {
36 sv_frame_t idx = start + i; 36 sv_frame_t idx = start + i;
37 if (!in_range_for(m_data[channel], idx)) break; 37 if (!in_range_for(m_data[channel], idx)) break;
38 buffer[i] = m_data[channel][idx]; 38 buffer[i] = m_data[channel][idx];
39 cerr << buffer[i] << " "; 39 // cerr << buffer[i] << " ";
40 ++i; 40 ++i;
41 } 41 }
42 42
43 cerr << endl; 43 // cerr << endl;
44 44
45 return i; 45 return i;
46 } 46 }
47 47
48 sv_frame_t 48 sv_frame_t