Mercurial > hg > svcore
comparison data/model/WritableWaveFileModel.h @ 1040:a1cd5abcb38b cxx11
Introduce and use a samplerate type
author | Chris Cannam |
---|---|
date | Wed, 04 Mar 2015 12:01:04 +0000 |
parents | cc27f35aa75c |
children | 0fd3661bcfff |
comparison
equal
deleted
inserted
replaced
1039:b14064bd1f97 | 1040:a1cd5abcb38b |
---|---|
24 class WritableWaveFileModel : public RangeSummarisableTimeValueModel | 24 class WritableWaveFileModel : public RangeSummarisableTimeValueModel |
25 { | 25 { |
26 Q_OBJECT | 26 Q_OBJECT |
27 | 27 |
28 public: | 28 public: |
29 WritableWaveFileModel(int sampleRate, int channels, QString path = ""); | 29 WritableWaveFileModel(sv_samplerate_t sampleRate, int channels, QString path = ""); |
30 ~WritableWaveFileModel(); | 30 ~WritableWaveFileModel(); |
31 | 31 |
32 /** | 32 /** |
33 * Call addSamples to append a block of samples to the end of the | 33 * Call addSamples to append a block of samples to the end of the |
34 * file. Caller should also call setCompletion to update the | 34 * file. Caller should also call setCompletion to update the |
48 return &zc; | 48 return &zc; |
49 } | 49 } |
50 | 50 |
51 sv_frame_t getFrameCount() const; | 51 sv_frame_t getFrameCount() const; |
52 int getChannelCount() const { return m_channels; } | 52 int getChannelCount() const { return m_channels; } |
53 int getSampleRate() const { return m_sampleRate; } | 53 sv_samplerate_t getSampleRate() const { return m_sampleRate; } |
54 | 54 |
55 virtual Model *clone() const; | 55 virtual Model *clone() const; |
56 | 56 |
57 float getValueMinimum() const { return -1.0f; } | 57 float getValueMinimum() const { return -1.0f; } |
58 float getValueMaximum() const { return 1.0f; } | 58 float getValueMaximum() const { return 1.0f; } |
87 | 87 |
88 protected: | 88 protected: |
89 WaveFileModel *m_model; | 89 WaveFileModel *m_model; |
90 WavFileWriter *m_writer; | 90 WavFileWriter *m_writer; |
91 WavFileReader *m_reader; | 91 WavFileReader *m_reader; |
92 int m_sampleRate; | 92 sv_samplerate_t m_sampleRate; |
93 int m_channels; | 93 int m_channels; |
94 sv_frame_t m_frameCount; | 94 sv_frame_t m_frameCount; |
95 sv_frame_t m_startFrame; | 95 sv_frame_t m_startFrame; |
96 int m_completion; | 96 int m_completion; |
97 }; | 97 }; |