comparison data/model/WritableWaveFileModel.h @ 300:5877d68815c7

* Change WaveFileModel API from getValues(start,end) to getData(start,count). It's much less error-prone to pass in frame counts instead of start/end locations. Should have done this ages ago. This closes #1794563. * Add option to apply a transform to only the selection region, instead of the whole audio. * (to make the above work properly) Add start frame offset to wave models
author Chris Cannam
date Mon, 01 Oct 2007 13:48:38 +0000
parents 7b96b3bd4bae
children 700cd3350391 6f6ab834449d
comparison
equal deleted inserted replaced
299:576be0d0d218 300:5877d68815c7
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; }
59 59
60 virtual size_t getStartFrame() const { return 0; } 60 virtual size_t getStartFrame() const { return m_startFrame; }
61 virtual size_t getEndFrame() const { return getFrameCount(); } 61 virtual size_t getEndFrame() const { return m_startFrame + getFrameCount(); }
62 62
63 virtual size_t getValues(int channel, size_t start, size_t end, 63 void setStartFrame(size_t startFrame);
64 float *buffer) const;
65 64
66 virtual size_t getValues(int channel, size_t start, size_t end, 65 virtual size_t getData(int channel, size_t start, size_t count,
67 double *buffer) const; 66 float *buffer) const;
68 67
69 virtual void getRanges(size_t channel, size_t start, size_t end, 68 virtual size_t getData(int channel, size_t start, size_t count,
70 RangeBlock &ranges, size_t &blockSize) const; 69 double *buffer) const;
71 70
72 virtual Range getRange(size_t channel, size_t start, size_t end) const; 71 virtual void getSummaries(size_t channel, size_t start, size_t count,
72 RangeBlock &ranges, size_t &blockSize) const;
73
74 virtual Range getSummary(size_t channel, size_t start, size_t count) const;
73 75
74 virtual void toXml(QTextStream &out, 76 virtual void toXml(QTextStream &out,
75 QString indent = "", 77 QString indent = "",
76 QString extraAttributes = "") const; 78 QString extraAttributes = "") const;
77 79
80 WavFileWriter *m_writer; 82 WavFileWriter *m_writer;
81 WavFileReader *m_reader; 83 WavFileReader *m_reader;
82 size_t m_sampleRate; 84 size_t m_sampleRate;
83 size_t m_channels; 85 size_t m_channels;
84 size_t m_frameCount; 86 size_t m_frameCount;
87 size_t m_startFrame;
85 int m_completion; 88 int m_completion;
86 }; 89 };
87 90
88 #endif 91 #endif
89 92