comparison main/PreferencesDialog.cpp @ 32:e3b32dc5180b

* Make resampler quality configurable * Fall back to linear resampling when playing very fast * Switch off transient detection in time stretcher when playing very very fast
author Chris Cannam
date Thu, 21 Sep 2006 11:17:19 +0000
parents 8b34a6460545
children f3516e520652
comparison
equal deleted inserted replaced
31:37af203dbd15 32:e3b32dc5180b
92 frequency->setDecimals(2); 92 frequency->setDecimals(2);
93 93
94 connect(frequency, SIGNAL(valueChanged(double)), 94 connect(frequency, SIGNAL(valueChanged(double)),
95 this, SLOT(tuningFrequencyChanged(double))); 95 this, SLOT(tuningFrequencyChanged(double)));
96 96
97 QComboBox *resampleQuality = new QComboBox;
98
99 int rsq = prefs->getPropertyRangeAndValue("Resample Quality", &min, &max);
100 m_resampleQuality = rsq;
101
102 for (i = min; i <= max; ++i) {
103 resampleQuality->addItem(prefs->getPropertyValueLabel("Resample Quality", i));
104 }
105
106 resampleQuality->setCurrentIndex(rsq);
107
108 connect(resampleQuality, SIGNAL(currentIndexChanged(int)),
109 this, SLOT(resampleQualityChanged(int)));
110
97 int row = 0; 111 int row = 0;
98 112
99 subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel 113 subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel
100 ("Property Box Layout"))), 114 ("Property Box Layout"))),
101 row, 0); 115 row, 0);
103 117
104 subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel 118 subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel
105 ("Tuning Frequency"))), 119 ("Tuning Frequency"))),
106 row, 0); 120 row, 0);
107 subgrid->addWidget(frequency, row++, 1, 1, 2); 121 subgrid->addWidget(frequency, row++, 1, 1, 2);
122
123 subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel
124 ("Resample Quality"))),
125 row, 0);
126 subgrid->addWidget(resampleQuality, row++, 1, 1, 2);
108 127
109 subgrid->addWidget(new QLabel(prefs->getPropertyLabel 128 subgrid->addWidget(new QLabel(prefs->getPropertyLabel
110 ("Smooth Spectrogram")), 129 ("Smooth Spectrogram")),
111 row, 0, 1, 2); 130 row, 0, 1, 2);
112 subgrid->addWidget(smoothing, row++, 2); 131 subgrid->addWidget(smoothing, row++, 2);
166 m_tuningFrequency = freq; 185 m_tuningFrequency = freq;
167 m_applyButton->setEnabled(true); 186 m_applyButton->setEnabled(true);
168 } 187 }
169 188
170 void 189 void
190 PreferencesDialog::resampleQualityChanged(int q)
191 {
192 m_resampleQuality = q;
193 m_applyButton->setEnabled(true);
194 }
195
196 void
171 PreferencesDialog::okClicked() 197 PreferencesDialog::okClicked()
172 { 198 {
173 applyClicked(); 199 applyClicked();
174 accept(); 200 accept();
175 } 201 }
181 prefs->setWindowType(WindowType(m_windowType)); 207 prefs->setWindowType(WindowType(m_windowType));
182 prefs->setSmoothSpectrogram(m_smoothSpectrogram); 208 prefs->setSmoothSpectrogram(m_smoothSpectrogram);
183 prefs->setPropertyBoxLayout(Preferences::PropertyBoxLayout 209 prefs->setPropertyBoxLayout(Preferences::PropertyBoxLayout
184 (m_propertyLayout)); 210 (m_propertyLayout));
185 prefs->setTuningFrequency(m_tuningFrequency); 211 prefs->setTuningFrequency(m_tuningFrequency);
212 prefs->setResampleQuality(m_resampleQuality);
186 m_applyButton->setEnabled(false); 213 m_applyButton->setEnabled(false);
187 } 214 }
188 215
189 void 216 void
190 PreferencesDialog::cancelClicked() 217 PreferencesDialog::cancelClicked()