diff widgets/ItemEditDialog.cpp @ 922:26da827e8fb5 tonioni

Merge from cxx11 branch
author Chris Cannam
date Mon, 23 Mar 2015 11:26:28 +0000
parents 4a578a360011
children 2564d0865feb
line wrap: on
line diff
--- a/widgets/ItemEditDialog.cpp	Mon Mar 23 10:04:51 2015 +0000
+++ b/widgets/ItemEditDialog.cpp	Mon Mar 23 11:26:28 2015 +0000
@@ -28,7 +28,7 @@
 #include <float.h> // for FLT_MIN/MAX
 
 
-ItemEditDialog::ItemEditDialog(int sampleRate, int options,
+ItemEditDialog::ItemEditDialog(sv_samplerate_t sampleRate, int options,
                                QString valueUnits, QWidget *parent) :
     QDialog(parent),
     m_sampleRate(sampleRate),
@@ -76,7 +76,7 @@
         m_frameTimeSpinBox->setSuffix(tr(" frames"));
         subgrid->addWidget(m_frameTimeSpinBox, subrow, 1, 1, 2);
         connect(m_frameTimeSpinBox, SIGNAL(valueChanged(int)),
-                this, SLOT(frameTimeChanged(int)));
+                this, SLOT(frameTimeChanged(sv_frame_t)));
 
         ++subrow;
 
@@ -107,7 +107,7 @@
         m_frameDurationSpinBox->setSuffix(tr(" frames"));
         subgrid->addWidget(m_frameDurationSpinBox, subrow, 1, 1, 2);
         connect(m_frameDurationSpinBox, SIGNAL(valueChanged(int)),
-                this, SLOT(frameDurationChanged(int)));
+                this, SLOT(frameDurationChanged(sv_frame_t)));
 
         ++subrow;
 
@@ -193,19 +193,19 @@
 }
 
 void
-ItemEditDialog::setFrameTime(int frame)
+ItemEditDialog::setFrameTime(sv_frame_t frame)
 {
     if (!m_frameTimeSpinBox) return;
 
     RealTime rt(RealTime::frame2RealTime(frame, m_sampleRate));
     m_realTimeSecsSpinBox->setValue(rt.sec);
     m_realTimeUSecsSpinBox->setValue(rt.usec());
-    m_frameTimeSpinBox->setValue(frame);
+    m_frameTimeSpinBox->setValue(int(frame));
     m_defaultFrame = frame;
     m_resetButton->setEnabled(false);
 }
 
-int
+sv_frame_t
 ItemEditDialog::getFrameTime() const
 {
     return m_frameTimeSpinBox->value();
@@ -224,19 +224,19 @@
 }
 
 void
-ItemEditDialog::setFrameDuration(int duration)
+ItemEditDialog::setFrameDuration(sv_frame_t duration)
 {
     if (!m_frameDurationSpinBox) return;
 
     RealTime rt(RealTime::frame2RealTime(duration, m_sampleRate));
     m_realDurationSecsSpinBox->setValue(rt.sec);
     m_realDurationUSecsSpinBox->setValue(rt.usec());
-    m_frameDurationSpinBox->setValue(duration);
+    m_frameDurationSpinBox->setValue(int(duration));
     m_defaultDuration = duration;
     m_resetButton->setEnabled(false);
 }
 
-int
+sv_frame_t
 ItemEditDialog::getFrameDuration() const
 {
     return m_frameDurationSpinBox->value();
@@ -267,7 +267,7 @@
 float
 ItemEditDialog::getValue() const
 {
-    return m_valueSpinBox->value();
+    return float(m_valueSpinBox->value());
 }
 
 void
@@ -287,7 +287,7 @@
 }
 
 void
-ItemEditDialog::frameTimeChanged(int i)
+ItemEditDialog::frameTimeChanged(sv_frame_t i)
 {
     m_realTimeSecsSpinBox->blockSignals(true);
     m_realTimeUSecsSpinBox->blockSignals(true);
@@ -306,8 +306,8 @@
 {
     RealTime rt = getRealTime();
     rt.sec = i;
-    int frame = RealTime::realTime2Frame(rt, m_sampleRate);
-    m_frameTimeSpinBox->setValue(frame);
+    sv_frame_t frame = RealTime::realTime2Frame(rt, m_sampleRate);
+    m_frameTimeSpinBox->setValue(int(frame));
     m_resetButton->setEnabled(true);
 }
 
@@ -316,13 +316,13 @@
 {
     RealTime rt = getRealTime();
     rt.nsec = i * 1000;
-    int frame = RealTime::realTime2Frame(rt, m_sampleRate);
-    m_frameTimeSpinBox->setValue(frame);
+    sv_frame_t frame = RealTime::realTime2Frame(rt, m_sampleRate);
+    m_frameTimeSpinBox->setValue(int(frame));
     m_resetButton->setEnabled(true);
 }
 
 void
-ItemEditDialog::frameDurationChanged(int i)
+ItemEditDialog::frameDurationChanged(sv_frame_t i)
 {
     m_realDurationSecsSpinBox->blockSignals(true);
     m_realDurationUSecsSpinBox->blockSignals(true);
@@ -341,8 +341,8 @@
 {
     RealTime rt = getRealDuration();
     rt.sec = i;
-    int frame = RealTime::realTime2Frame(rt, m_sampleRate);
-    m_frameDurationSpinBox->setValue(frame);
+    sv_frame_t frame = RealTime::realTime2Frame(rt, m_sampleRate);
+    m_frameDurationSpinBox->setValue(int(frame));
     m_resetButton->setEnabled(true);
 }
 
@@ -351,8 +351,8 @@
 {
     RealTime rt = getRealDuration();
     rt.nsec = i * 1000;
-    int frame = RealTime::realTime2Frame(rt, m_sampleRate);
-    m_frameDurationSpinBox->setValue(frame);
+    sv_frame_t frame = RealTime::realTime2Frame(rt, m_sampleRate);
+    m_frameDurationSpinBox->setValue(int(frame));
     m_resetButton->setEnabled(true);
 }