comparison data/model/WritableWaveFileModel.cpp @ 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 e802e550a1f2
children cd42620e3f40
comparison
equal deleted inserted replaced
928:6a94bb528e9d 929:59e7fe1b1003
28 #include <iostream> 28 #include <iostream>
29 #include <stdint.h> 29 #include <stdint.h>
30 30
31 //#define DEBUG_WRITABLE_WAVE_FILE_MODEL 1 31 //#define DEBUG_WRITABLE_WAVE_FILE_MODEL 1
32 32
33 WritableWaveFileModel::WritableWaveFileModel(size_t sampleRate, 33 WritableWaveFileModel::WritableWaveFileModel(int sampleRate,
34 size_t channels, 34 int channels,
35 QString path) : 35 QString path) :
36 m_model(0), 36 m_model(0),
37 m_writer(0), 37 m_writer(0),
38 m_reader(0), 38 m_reader(0),
39 m_sampleRate(sampleRate), 39 m_sampleRate(sampleRate),
84 return; 84 return;
85 } 85 }
86 m_model->setStartFrame(m_startFrame); 86 m_model->setStartFrame(m_startFrame);
87 87
88 connect(m_model, SIGNAL(modelChanged()), this, SIGNAL(modelChanged())); 88 connect(m_model, SIGNAL(modelChanged()), this, SIGNAL(modelChanged()));
89 connect(m_model, SIGNAL(modelChanged(size_t, size_t)), 89 connect(m_model, SIGNAL(modelChanged(int, int)),
90 this, SIGNAL(modelChanged(size_t, size_t))); 90 this, SIGNAL(modelChanged(int, int)));
91 } 91 }
92 92
93 WritableWaveFileModel::~WritableWaveFileModel() 93 WritableWaveFileModel::~WritableWaveFileModel()
94 { 94 {
95 delete m_model; 95 delete m_model;
96 delete m_writer; 96 delete m_writer;
97 delete m_reader; 97 delete m_reader;
98 } 98 }
99 99
100 void 100 void
101 WritableWaveFileModel::setStartFrame(size_t startFrame) 101 WritableWaveFileModel::setStartFrame(int startFrame)
102 { 102 {
103 m_startFrame = startFrame; 103 m_startFrame = startFrame;
104 if (m_model) m_model->setStartFrame(startFrame); 104 if (m_model) m_model->setStartFrame(startFrame);
105 } 105 }
106 106
107 bool 107 bool
108 WritableWaveFileModel::addSamples(float **samples, size_t count) 108 WritableWaveFileModel::addSamples(float **samples, int count)
109 { 109 {
110 if (!m_writer) return false; 110 if (!m_writer) return false;
111 111
112 #ifdef DEBUG_WRITABLE_WAVE_FILE_MODEL 112 #ifdef DEBUG_WRITABLE_WAVE_FILE_MODEL
113 // SVDEBUG << "WritableWaveFileModel::addSamples(" << count << ")" << endl; 113 // SVDEBUG << "WritableWaveFileModel::addSamples(" << count << ")" << endl;
160 if (completion == 100) { 160 if (completion == 100) {
161 if (m_reader) m_reader->updateDone(); 161 if (m_reader) m_reader->updateDone();
162 } 162 }
163 } 163 }
164 164
165 size_t 165 int
166 WritableWaveFileModel::getFrameCount() const 166 WritableWaveFileModel::getFrameCount() const
167 { 167 {
168 // SVDEBUG << "WritableWaveFileModel::getFrameCount: count = " << m_frameCount << endl; 168 // SVDEBUG << "WritableWaveFileModel::getFrameCount: count = " << m_frameCount << endl;
169 return m_frameCount; 169 return m_frameCount;
170 } 170 }
174 { 174 {
175 assert(0); //!!! 175 assert(0); //!!!
176 return 0; 176 return 0;
177 } 177 }
178 178
179 size_t 179 int
180 WritableWaveFileModel::getData(int channel, size_t start, size_t count, 180 WritableWaveFileModel::getData(int channel, int start, int count,
181 float *buffer) const 181 float *buffer) const
182 { 182 {
183 if (!m_model || m_model->getChannelCount() == 0) return 0; 183 if (!m_model || m_model->getChannelCount() == 0) return 0;
184 return m_model->getData(channel, start, count, buffer); 184 return m_model->getData(channel, start, count, buffer);
185 } 185 }
186 186
187 size_t 187 int
188 WritableWaveFileModel::getData(int channel, size_t start, size_t count, 188 WritableWaveFileModel::getData(int channel, int start, int count,
189 double *buffer) const 189 double *buffer) const
190 { 190 {
191 if (!m_model || m_model->getChannelCount() == 0) return 0; 191 if (!m_model || m_model->getChannelCount() == 0) return 0;
192 return m_model->getData(channel, start, count, buffer); 192 return m_model->getData(channel, start, count, buffer);
193 } 193 }
194 194
195 size_t 195 int
196 WritableWaveFileModel::getData(size_t fromchannel, size_t tochannel, 196 WritableWaveFileModel::getData(int fromchannel, int tochannel,
197 size_t start, size_t count, 197 int start, int count,
198 float **buffers) const 198 float **buffers) const
199 { 199 {
200 if (!m_model || m_model->getChannelCount() == 0) return 0; 200 if (!m_model || m_model->getChannelCount() == 0) return 0;
201 return m_model->getData(fromchannel, tochannel, start, count, buffers); 201 return m_model->getData(fromchannel, tochannel, start, count, buffers);
202 } 202 }
203 203
204 size_t 204 int
205 WritableWaveFileModel::getSummaryBlockSize(size_t desired) const 205 WritableWaveFileModel::getSummaryBlockSize(int desired) const
206 { 206 {
207 if (!m_model) return desired; 207 if (!m_model) return desired;
208 return m_model->getSummaryBlockSize(desired); 208 return m_model->getSummaryBlockSize(desired);
209 } 209 }
210 210
211 void 211 void
212 WritableWaveFileModel::getSummaries(size_t channel, size_t start, size_t count, 212 WritableWaveFileModel::getSummaries(int channel, int start, int count,
213 RangeBlock &ranges, 213 RangeBlock &ranges,
214 size_t &blockSize) const 214 int &blockSize) const
215 { 215 {
216 ranges.clear(); 216 ranges.clear();
217 if (!m_model || m_model->getChannelCount() == 0) return; 217 if (!m_model || m_model->getChannelCount() == 0) return;
218 m_model->getSummaries(channel, start, count, ranges, blockSize); 218 m_model->getSummaries(channel, start, count, ranges, blockSize);
219 } 219 }
220 220
221 WritableWaveFileModel::Range 221 WritableWaveFileModel::Range
222 WritableWaveFileModel::getSummary(size_t channel, size_t start, size_t count) const 222 WritableWaveFileModel::getSummary(int channel, int start, int count) const
223 { 223 {
224 if (!m_model || m_model->getChannelCount() == 0) return Range(); 224 if (!m_model || m_model->getChannelCount() == 0) return Range();
225 return m_model->getSummary(channel, start, count); 225 return m_model->getSummary(channel, start, count);
226 } 226 }
227 227