Mercurial > hg > svcore
comparison data/model/test/MockWaveModel.h @ 1088:5fab8e4f5f19
Start making the FFT model tests into proper tests
author | Chris Cannam |
---|---|
date | Fri, 12 Jun 2015 12:41:19 +0100 |
parents | 9f4505ac9072 |
children | 4d9816ba0ebe |
comparison
equal
deleted
inserted
replaced
1087:dcf54a6964d0 | 1088:5fab8e4f5f19 |
---|---|
31 class MockWaveModel : public DenseTimeValueModel | 31 class MockWaveModel : public DenseTimeValueModel |
32 { | 32 { |
33 Q_OBJECT | 33 Q_OBJECT |
34 | 34 |
35 public: | 35 public: |
36 /** One Sort per channel! Length is in samples */ | 36 /** One Sort per channel! Length is in samples, and is in addition |
37 MockWaveModel(std::vector<Sort> sorts, int length); | 37 * to "pad" number of zero samples at the start and end */ |
38 MockWaveModel(std::vector<Sort> sorts, int length, int pad); | |
38 | 39 |
39 virtual float getValueMinimum() const { return -1.f; } | 40 virtual float getValueMinimum() const { return -1.f; } |
40 virtual float getValueMaximum() const { return 1.f; } | 41 virtual float getValueMaximum() const { return 1.f; } |
41 virtual int getChannelCount() const { return int(m_data.size()); } | 42 virtual int getChannelCount() const { return int(m_data.size()); } |
42 | 43 |
56 | 57 |
57 QString getTypeName() const { return tr("Mock Wave"); } | 58 QString getTypeName() const { return tr("Mock Wave"); } |
58 | 59 |
59 private: | 60 private: |
60 std::vector<std::vector<float> > m_data; | 61 std::vector<std::vector<float> > m_data; |
61 std::vector<float> generate(Sort sort, int length) const; | 62 std::vector<float> generate(Sort sort, int length, int pad) const; |
62 }; | 63 }; |
63 | 64 |
64 #endif | 65 #endif |