Mercurial > hg > svcore
comparison data/model/WritableWaveFileModel.h @ 1038:cc27f35aa75c cxx11
Introducing the signed 64-bit frame index type, and fixing build failures from inclusion of -Wconversion with -Werror. Not finished yet.
author | Chris Cannam |
---|---|
date | Tue, 03 Mar 2015 15:18:24 +0000 |
parents | 59e7fe1b1003 |
children | a1cd5abcb38b |
comparison
equal
deleted
inserted
replaced
1037:bf0e5944289b | 1038:cc27f35aa75c |
---|---|
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 |
35 * progress of this file, if it has a known end point, and should | 35 * progress of this file, if it has a known end point, and should |
36 * call setCompletion(100) when the file has been written. | 36 * call setCompletion(100) when the file has been written. |
37 */ | 37 */ |
38 virtual bool addSamples(float **samples, int count); | 38 virtual bool addSamples(float **samples, sv_frame_t count); |
39 | 39 |
40 bool isOK() const; | 40 bool isOK() const; |
41 bool isReady(int *) const; | 41 bool isReady(int *) const; |
42 | 42 |
43 virtual void setCompletion(int completion); // percentage | 43 virtual void setCompletion(int completion); // percentage |
46 const ZoomConstraint *getZoomConstraint() const { | 46 const ZoomConstraint *getZoomConstraint() const { |
47 static PowerOfSqrtTwoZoomConstraint zc; | 47 static PowerOfSqrtTwoZoomConstraint zc; |
48 return &zc; | 48 return &zc; |
49 } | 49 } |
50 | 50 |
51 int 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 int 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; } |
59 | 59 |
60 virtual int getStartFrame() const { return m_startFrame; } | 60 virtual sv_frame_t getStartFrame() const { return m_startFrame; } |
61 virtual int getEndFrame() const { return m_startFrame + getFrameCount(); } | 61 virtual sv_frame_t getEndFrame() const { return m_startFrame + getFrameCount(); } |
62 | 62 |
63 void setStartFrame(int startFrame); | 63 void setStartFrame(sv_frame_t startFrame); |
64 | 64 |
65 virtual int getData(int channel, int start, int count, | 65 virtual sv_frame_t getData(int channel, sv_frame_t start, sv_frame_t count, |
66 float *buffer) const; | 66 float *buffer) const; |
67 | 67 |
68 virtual int getData(int channel, int start, int count, | 68 virtual sv_frame_t getData(int channel, sv_frame_t start, sv_frame_t count, |
69 double *buffer) const; | 69 double *buffer) const; |
70 | 70 |
71 virtual int getData(int fromchannel, int tochannel, | 71 virtual sv_frame_t getData(int fromchannel, int tochannel, |
72 int start, int count, | 72 sv_frame_t start, sv_frame_t count, |
73 float **buffer) const; | 73 float **buffer) const; |
74 | 74 |
75 virtual int getSummaryBlockSize(int desired) const; | 75 virtual int getSummaryBlockSize(int desired) const; |
76 | 76 |
77 virtual void getSummaries(int channel, int start, int count, | 77 virtual void getSummaries(int channel, sv_frame_t start, sv_frame_t count, |
78 RangeBlock &ranges, int &blockSize) const; | 78 RangeBlock &ranges, int &blockSize) const; |
79 | 79 |
80 virtual Range getSummary(int channel, int start, int count) const; | 80 virtual Range getSummary(int channel, sv_frame_t start, sv_frame_t count) const; |
81 | 81 |
82 QString getTypeName() const { return tr("Writable Wave File"); } | 82 QString getTypeName() const { return tr("Writable Wave File"); } |
83 | 83 |
84 virtual void toXml(QTextStream &out, | 84 virtual void toXml(QTextStream &out, |
85 QString indent = "", | 85 QString indent = "", |
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 int m_sampleRate; |
93 int m_channels; | 93 int m_channels; |
94 int m_frameCount; | 94 sv_frame_t m_frameCount; |
95 int m_startFrame; | 95 sv_frame_t m_startFrame; |
96 int m_completion; | 96 int m_completion; |
97 }; | 97 }; |
98 | 98 |
99 #endif | 99 #endif |
100 | 100 |