# HG changeset patch # User Chris Cannam # Date 1412345367 -3600 # Node ID de9472751d315333c064a9128a35334009b21641 # Parent 3ca3b8fbbceee7a49a268d054e8ad28a171b940d Add milliseconds as CSV import timing option diff -r 3ca3b8fbbcee -r de9472751d31 widgets/CSVFormatDialog.cpp --- a/widgets/CSVFormatDialog.cpp Mon Sep 29 13:27:13 2014 +0100 +++ b/widgets/CSVFormatDialog.cpp Fri Oct 03 15:09:27 2014 +0100 @@ -118,6 +118,7 @@ m_timingTypeCombo = new QComboBox; m_timingTypeCombo->addItem(tr("Explicitly, in seconds")); + m_timingTypeCombo->addItem(tr("Explicitly, in milliseconds")); m_timingTypeCombo->addItem(tr("Explicitly, in audio sample frames")); m_timingTypeCombo->addItem(tr("Implicitly: rows are equally spaced in time")); layout->addWidget(m_timingTypeCombo, row++, 1, 1, 2); @@ -125,7 +126,7 @@ this, SLOT(timingTypeChanged(int))); m_timingTypeCombo->setCurrentIndex (m_format.getTimingType() == CSVFormat::ExplicitTiming ? - m_format.getTimeUnits() == CSVFormat::TimeSeconds ? 0 : 1 : 2); + m_format.getTimeUnits() == CSVFormat::TimeSeconds ? 0 : 2 : 3); m_sampleRateLabel = new QLabel(tr("Audio sample rate (Hz):")); layout->addWidget(m_sampleRateLabel, row, 0); @@ -240,6 +241,15 @@ case 1: m_format.setTimingType(CSVFormat::ExplicitTiming); + m_format.setTimeUnits(CSVFormat::TimeMilliseconds); + m_sampleRateCombo->setEnabled(true); + m_sampleRateLabel->setEnabled(true); + m_windowSizeCombo->setEnabled(false); + m_windowSizeLabel->setEnabled(false); + break; + + case 2: + m_format.setTimingType(CSVFormat::ExplicitTiming); m_format.setTimeUnits(CSVFormat::TimeAudioFrames); m_sampleRateCombo->setEnabled(true); m_sampleRateLabel->setEnabled(true); @@ -247,7 +257,7 @@ m_windowSizeLabel->setEnabled(false); break; - case 2: + case 3: m_format.setTimingType(CSVFormat::ImplicitTiming); m_format.setTimeUnits(CSVFormat::TimeWindows); m_sampleRateCombo->setEnabled(true);