comparison data/model/WritableWaveFileModel.h @ 929:59e7fe1b1003 warnfix_no_size_t

Unsigned removals and warning fixes in data/
author Chris Cannam
date Tue, 17 Jun 2014 14:33:42 +0100
parents 166c22eff678
children cc27f35aa75c
comparison
equal deleted inserted replaced
928:6a94bb528e9d 929:59e7fe1b1003
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(size_t sampleRate, size_t channels, QString path = ""); 29 WritableWaveFileModel(int 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
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, size_t count); 38 virtual bool addSamples(float **samples, int 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 size_t getFrameCount() const; 51 int getFrameCount() const;
52 size_t getChannelCount() const { return m_channels; } 52 int getChannelCount() const { return m_channels; }
53 size_t 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 size_t getStartFrame() const { return m_startFrame; } 60 virtual int getStartFrame() const { return m_startFrame; }
61 virtual size_t getEndFrame() const { return m_startFrame + getFrameCount(); } 61 virtual int getEndFrame() const { return m_startFrame + getFrameCount(); }
62 62
63 void setStartFrame(size_t startFrame); 63 void setStartFrame(int startFrame);
64 64
65 virtual size_t getData(int channel, size_t start, size_t count, 65 virtual int getData(int channel, int start, int count,
66 float *buffer) const; 66 float *buffer) const;
67 67
68 virtual size_t getData(int channel, size_t start, size_t count, 68 virtual int getData(int channel, int start, int count,
69 double *buffer) const; 69 double *buffer) const;
70 70
71 virtual size_t getData(size_t fromchannel, size_t tochannel, 71 virtual int getData(int fromchannel, int tochannel,
72 size_t start, size_t count, 72 int start, int count,
73 float **buffer) const; 73 float **buffer) const;
74 74
75 virtual size_t getSummaryBlockSize(size_t desired) const; 75 virtual int getSummaryBlockSize(int desired) const;
76 76
77 virtual void getSummaries(size_t channel, size_t start, size_t count, 77 virtual void getSummaries(int channel, int start, int count,
78 RangeBlock &ranges, size_t &blockSize) const; 78 RangeBlock &ranges, int &blockSize) const;
79 79
80 virtual Range getSummary(size_t channel, size_t start, size_t count) const; 80 virtual Range getSummary(int channel, int start, int 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 = "",
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 size_t m_sampleRate; 92 int m_sampleRate;
93 size_t m_channels; 93 int m_channels;
94 size_t m_frameCount; 94 int m_frameCount;
95 size_t m_startFrame; 95 int m_startFrame;
96 int m_completion; 96 int m_completion;
97 }; 97 };
98 98
99 #endif 99 #endif
100 100