Mercurial > hg > svgui
diff widgets/CSVFormatDialog.cpp @ 869:6c08e99ca0f3 tonioni
Merge from default branch
author | Chris Cannam |
---|---|
date | Mon, 10 Nov 2014 09:20:06 +0000 |
parents | d854c72dcaa1 |
children | 4a578a360011 |
line wrap: on
line diff
--- a/widgets/CSVFormatDialog.cpp Tue Sep 09 16:36:21 2014 +0100 +++ b/widgets/CSVFormatDialog.cpp Mon Nov 10 09:20:06 2014 +0000 @@ -99,6 +99,9 @@ cpc->setCurrentIndex(int(m_format.getColumnPurpose(i))); for (int j = 0; j < example.size() && j < 6; ++j) { + if (i >= example[j].size()) { + continue; + } QLabel *label = new QLabel; label->setTextFormat(Qt::PlainText); QString text = TextAbbrev::abbreviate(example[j][i], 35); @@ -118,6 +121,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 +129,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 +244,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 +260,7 @@ m_windowSizeLabel->setEnabled(false); break; - case 2: + case 3: m_format.setTimingType(CSVFormat::ImplicitTiming); m_format.setTimeUnits(CSVFormat::TimeWindows); m_sampleRateCombo->setEnabled(true);