comparison widgets/ItemEditDialog.cpp @ 807:e4773943c9c1 warnfix_no_size_t

More unsigned/long and warning fixes
author Chris Cannam
date Tue, 17 Jun 2014 15:55:27 +0100
parents b6397738444c
children 44675ab217a3
comparison
equal deleted inserted replaced
806:4c8ca536b54f 807:e4773943c9c1
26 #include <QDialogButtonBox> 26 #include <QDialogButtonBox>
27 27
28 #include <float.h> // for FLT_MIN/MAX 28 #include <float.h> // for FLT_MIN/MAX
29 29
30 30
31 ItemEditDialog::ItemEditDialog(size_t sampleRate, int options, 31 ItemEditDialog::ItemEditDialog(int sampleRate, int options,
32 QString valueUnits, QWidget *parent) : 32 QString valueUnits, QWidget *parent) :
33 QDialog(parent), 33 QDialog(parent),
34 m_sampleRate(sampleRate), 34 m_sampleRate(sampleRate),
35 m_frameTimeSpinBox(0), 35 m_frameTimeSpinBox(0),
36 m_realTimeSecsSpinBox(0), 36 m_realTimeSecsSpinBox(0),
48 QGroupBox *valueBox = 0; 48 QGroupBox *valueBox = 0;
49 QGridLayout *subgrid = 0; 49 QGridLayout *subgrid = 0;
50 50
51 int row = 0, subrow = 0; 51 int row = 0, subrow = 0;
52 52
53 size_t singleStep = RealTime::frame2RealTime(2, sampleRate).usec() - 1; 53 int singleStep = RealTime::frame2RealTime(2, sampleRate).usec() - 1;
54 54
55 if ((options & ShowTime) || (options & ShowDuration)) { 55 if ((options & ShowTime) || (options & ShowDuration)) {
56 56
57 timeBox = new QGroupBox; 57 timeBox = new QGroupBox;
58 timeBox->setTitle(tr("Timing")); 58 timeBox->setTitle(tr("Timing"));
188 connect(cancel, SIGNAL(clicked()), this, SLOT(reject())); 188 connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));
189 m_resetButton->setEnabled(false); 189 m_resetButton->setEnabled(false);
190 } 190 }
191 191
192 void 192 void
193 ItemEditDialog::setFrameTime(long frame) 193 ItemEditDialog::setFrameTime(int frame)
194 { 194 {
195 if (!m_frameTimeSpinBox) return; 195 if (!m_frameTimeSpinBox) return;
196 196
197 RealTime rt(RealTime::frame2RealTime(frame, m_sampleRate)); 197 RealTime rt(RealTime::frame2RealTime(frame, m_sampleRate));
198 m_realTimeSecsSpinBox->setValue(rt.sec); 198 m_realTimeSecsSpinBox->setValue(rt.sec);
200 m_frameTimeSpinBox->setValue(frame); 200 m_frameTimeSpinBox->setValue(frame);
201 m_defaultFrame = frame; 201 m_defaultFrame = frame;
202 m_resetButton->setEnabled(false); 202 m_resetButton->setEnabled(false);
203 } 203 }
204 204
205 long 205 int
206 ItemEditDialog::getFrameTime() const 206 ItemEditDialog::getFrameTime() const
207 { 207 {
208 return m_frameTimeSpinBox->value(); 208 return m_frameTimeSpinBox->value();
209 } 209 }
210 210
219 { 219 {
220 return RealTime::frame2RealTime(getFrameTime(), m_sampleRate); 220 return RealTime::frame2RealTime(getFrameTime(), m_sampleRate);
221 } 221 }
222 222
223 void 223 void
224 ItemEditDialog::setFrameDuration(long duration) 224 ItemEditDialog::setFrameDuration(int duration)
225 { 225 {
226 if (!m_frameDurationSpinBox) return; 226 if (!m_frameDurationSpinBox) return;
227 227
228 RealTime rt(RealTime::frame2RealTime(duration, m_sampleRate)); 228 RealTime rt(RealTime::frame2RealTime(duration, m_sampleRate));
229 m_realDurationSecsSpinBox->setValue(rt.sec); 229 m_realDurationSecsSpinBox->setValue(rt.sec);
231 m_frameDurationSpinBox->setValue(duration); 231 m_frameDurationSpinBox->setValue(duration);
232 m_defaultDuration = duration; 232 m_defaultDuration = duration;
233 m_resetButton->setEnabled(false); 233 m_resetButton->setEnabled(false);
234 } 234 }
235 235
236 long 236 int
237 ItemEditDialog::getFrameDuration() const 237 ItemEditDialog::getFrameDuration() const
238 { 238 {
239 return m_frameDurationSpinBox->value(); 239 return m_frameDurationSpinBox->value();
240 } 240 }
241 241
301 void 301 void
302 ItemEditDialog::realTimeSecsChanged(int i) 302 ItemEditDialog::realTimeSecsChanged(int i)
303 { 303 {
304 RealTime rt = getRealTime(); 304 RealTime rt = getRealTime();
305 rt.sec = i; 305 rt.sec = i;
306 size_t frame = RealTime::realTime2Frame(rt, m_sampleRate); 306 int frame = RealTime::realTime2Frame(rt, m_sampleRate);
307 m_frameTimeSpinBox->setValue(frame); 307 m_frameTimeSpinBox->setValue(frame);
308 m_resetButton->setEnabled(true); 308 m_resetButton->setEnabled(true);
309 } 309 }
310 310
311 void 311 void
312 ItemEditDialog::realTimeUSecsChanged(int i) 312 ItemEditDialog::realTimeUSecsChanged(int i)
313 { 313 {
314 RealTime rt = getRealTime(); 314 RealTime rt = getRealTime();
315 rt.nsec = i * 1000; 315 rt.nsec = i * 1000;
316 size_t frame = RealTime::realTime2Frame(rt, m_sampleRate); 316 int frame = RealTime::realTime2Frame(rt, m_sampleRate);
317 m_frameTimeSpinBox->setValue(frame); 317 m_frameTimeSpinBox->setValue(frame);
318 m_resetButton->setEnabled(true); 318 m_resetButton->setEnabled(true);
319 } 319 }
320 320
321 void 321 void
336 void 336 void
337 ItemEditDialog::realDurationSecsChanged(int i) 337 ItemEditDialog::realDurationSecsChanged(int i)
338 { 338 {
339 RealTime rt = getRealDuration(); 339 RealTime rt = getRealDuration();
340 rt.sec = i; 340 rt.sec = i;
341 size_t frame = RealTime::realTime2Frame(rt, m_sampleRate); 341 int frame = RealTime::realTime2Frame(rt, m_sampleRate);
342 m_frameDurationSpinBox->setValue(frame); 342 m_frameDurationSpinBox->setValue(frame);
343 m_resetButton->setEnabled(true); 343 m_resetButton->setEnabled(true);
344 } 344 }
345 345
346 void 346 void
347 ItemEditDialog::realDurationUSecsChanged(int i) 347 ItemEditDialog::realDurationUSecsChanged(int i)
348 { 348 {
349 RealTime rt = getRealDuration(); 349 RealTime rt = getRealDuration();
350 rt.nsec = i * 1000; 350 rt.nsec = i * 1000;
351 size_t frame = RealTime::realTime2Frame(rt, m_sampleRate); 351 int frame = RealTime::realTime2Frame(rt, m_sampleRate);
352 m_frameDurationSpinBox->setValue(frame); 352 m_frameDurationSpinBox->setValue(frame);
353 m_resetButton->setEnabled(true); 353 m_resetButton->setEnabled(true);
354 } 354 }
355 355
356 void 356 void