comparison 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
comparison
equal deleted inserted replaced
860:4a5d144bd5d0 869:6c08e99ca0f3
97 cpc->addItem(tr("Pitch")); // ColumnPitch 97 cpc->addItem(tr("Pitch")); // ColumnPitch
98 cpc->addItem(tr("Label")); // ColumnLabel 98 cpc->addItem(tr("Label")); // ColumnLabel
99 cpc->setCurrentIndex(int(m_format.getColumnPurpose(i))); 99 cpc->setCurrentIndex(int(m_format.getColumnPurpose(i)));
100 100
101 for (int j = 0; j < example.size() && j < 6; ++j) { 101 for (int j = 0; j < example.size() && j < 6; ++j) {
102 if (i >= example[j].size()) {
103 continue;
104 }
102 QLabel *label = new QLabel; 105 QLabel *label = new QLabel;
103 label->setTextFormat(Qt::PlainText); 106 label->setTextFormat(Qt::PlainText);
104 QString text = TextAbbrev::abbreviate(example[j][i], 35); 107 QString text = TextAbbrev::abbreviate(example[j][i], 35);
105 label->setText(text); 108 label->setText(text);
106 label->setFont(fp); 109 label->setFont(fp);
116 119
117 layout->addWidget(new QLabel(tr("Timing is specified:")), row, 0); 120 layout->addWidget(new QLabel(tr("Timing is specified:")), row, 0);
118 121
119 m_timingTypeCombo = new QComboBox; 122 m_timingTypeCombo = new QComboBox;
120 m_timingTypeCombo->addItem(tr("Explicitly, in seconds")); 123 m_timingTypeCombo->addItem(tr("Explicitly, in seconds"));
124 m_timingTypeCombo->addItem(tr("Explicitly, in milliseconds"));
121 m_timingTypeCombo->addItem(tr("Explicitly, in audio sample frames")); 125 m_timingTypeCombo->addItem(tr("Explicitly, in audio sample frames"));
122 m_timingTypeCombo->addItem(tr("Implicitly: rows are equally spaced in time")); 126 m_timingTypeCombo->addItem(tr("Implicitly: rows are equally spaced in time"));
123 layout->addWidget(m_timingTypeCombo, row++, 1, 1, 2); 127 layout->addWidget(m_timingTypeCombo, row++, 1, 1, 2);
124 connect(m_timingTypeCombo, SIGNAL(activated(int)), 128 connect(m_timingTypeCombo, SIGNAL(activated(int)),
125 this, SLOT(timingTypeChanged(int))); 129 this, SLOT(timingTypeChanged(int)));
126 m_timingTypeCombo->setCurrentIndex 130 m_timingTypeCombo->setCurrentIndex
127 (m_format.getTimingType() == CSVFormat::ExplicitTiming ? 131 (m_format.getTimingType() == CSVFormat::ExplicitTiming ?
128 m_format.getTimeUnits() == CSVFormat::TimeSeconds ? 0 : 1 : 2); 132 m_format.getTimeUnits() == CSVFormat::TimeSeconds ? 0 : 2 : 3);
129 133
130 m_sampleRateLabel = new QLabel(tr("Audio sample rate (Hz):")); 134 m_sampleRateLabel = new QLabel(tr("Audio sample rate (Hz):"));
131 layout->addWidget(m_sampleRateLabel, row, 0); 135 layout->addWidget(m_sampleRateLabel, row, 0);
132 136
133 int sampleRates[] = { 137 int sampleRates[] = {
238 m_windowSizeLabel->setEnabled(false); 242 m_windowSizeLabel->setEnabled(false);
239 break; 243 break;
240 244
241 case 1: 245 case 1:
242 m_format.setTimingType(CSVFormat::ExplicitTiming); 246 m_format.setTimingType(CSVFormat::ExplicitTiming);
247 m_format.setTimeUnits(CSVFormat::TimeMilliseconds);
248 m_sampleRateCombo->setEnabled(true);
249 m_sampleRateLabel->setEnabled(true);
250 m_windowSizeCombo->setEnabled(false);
251 m_windowSizeLabel->setEnabled(false);
252 break;
253
254 case 2:
255 m_format.setTimingType(CSVFormat::ExplicitTiming);
243 m_format.setTimeUnits(CSVFormat::TimeAudioFrames); 256 m_format.setTimeUnits(CSVFormat::TimeAudioFrames);
244 m_sampleRateCombo->setEnabled(true); 257 m_sampleRateCombo->setEnabled(true);
245 m_sampleRateLabel->setEnabled(true); 258 m_sampleRateLabel->setEnabled(true);
246 m_windowSizeCombo->setEnabled(false); 259 m_windowSizeCombo->setEnabled(false);
247 m_windowSizeLabel->setEnabled(false); 260 m_windowSizeLabel->setEnabled(false);
248 break; 261 break;
249 262
250 case 2: 263 case 3:
251 m_format.setTimingType(CSVFormat::ImplicitTiming); 264 m_format.setTimingType(CSVFormat::ImplicitTiming);
252 m_format.setTimeUnits(CSVFormat::TimeWindows); 265 m_format.setTimeUnits(CSVFormat::TimeWindows);
253 m_sampleRateCombo->setEnabled(true); 266 m_sampleRateCombo->setEnabled(true);
254 m_sampleRateLabel->setEnabled(true); 267 m_sampleRateLabel->setEnabled(true);
255 m_windowSizeCombo->setEnabled(true); 268 m_windowSizeCombo->setEnabled(true);