comparison data/model/test/MockWaveModel.h @ 1599:ce185d4dd408 bqaudiostream

Merge from default branch
author Chris Cannam
date Wed, 23 Jan 2019 14:43:43 +0000
parents c01cbe41aeb5
children 82d03c9661f9
comparison
equal deleted inserted replaced
1598:d2555df635ec 1599:ce185d4dd408
35 public: 35 public:
36 /** One Sort per channel! Length is in samples, and is in addition 36 /** One Sort per channel! Length is in samples, and is in addition
37 * to "pad" number of zero samples at the start and end */ 37 * to "pad" number of zero samples at the start and end */
38 MockWaveModel(std::vector<Sort> sorts, int length, int pad); 38 MockWaveModel(std::vector<Sort> sorts, int length, int pad);
39 39
40 virtual float getValueMinimum() const { return -1.f; } 40 float getValueMinimum() const override { return -1.f; }
41 virtual float getValueMaximum() const { return 1.f; } 41 float getValueMaximum() const override { return 1.f; }
42 virtual int getChannelCount() const { return int(m_data.size()); } 42 int getChannelCount() const override { return int(m_data.size()); }
43 43
44 virtual floatvec_t getData(int channel, sv_frame_t start, sv_frame_t count) const; 44 floatvec_t getData(int channel, sv_frame_t start, sv_frame_t count) const override;
45 virtual std::vector<floatvec_t> getMultiChannelData(int fromchannel, int tochannel, sv_frame_t start, sv_frame_t count) const; 45 std::vector<floatvec_t> getMultiChannelData(int fromchannel, int tochannel, sv_frame_t start, sv_frame_t count) const override;
46 46
47 virtual bool canPlay() const { return true; } 47 bool canPlay() const override { return true; }
48 virtual QString getDefaultPlayClipId() const { return ""; } 48 QString getDefaultPlayClipId() const override { return ""; }
49 49
50 virtual sv_frame_t getStartFrame() const { return 0; } 50 sv_frame_t getStartFrame() const override { return 0; }
51 virtual sv_frame_t getEndFrame() const { return m_data[0].size(); } 51 sv_frame_t getEndFrame() const override { return m_data[0].size(); }
52 virtual sv_samplerate_t getSampleRate() const { return 44100; } 52 sv_samplerate_t getSampleRate() const override { return 44100; }
53 virtual bool isOK() const { return true; } 53 bool isOK() const override { return true; }
54 54
55 QString getTypeName() const { return tr("Mock Wave"); } 55 QString getTypeName() const override { return tr("Mock Wave"); }
56 56
57 private: 57 private:
58 std::vector<std::vector<float> > m_data; 58 std::vector<std::vector<float> > m_data;
59 std::vector<float> generate(Sort sort, int length, int pad) const; 59 std::vector<float> generate(Sort sort, int length, int pad) const;
60 }; 60 };