comparison base/Preferences.cpp @ 1317:ea28ee929034 3.0-integration

Remove resampler quality option (#1760)
author Chris Cannam
date Mon, 05 Dec 2016 16:39:03 +0000
parents ff9697592bef
children 07f23b90701a
comparison
equal deleted inserted replaced
1316:a421e752d22c 1317:ea28ee929034
38 m_spectrogramSmoothing(SpectrogramInterpolated), 38 m_spectrogramSmoothing(SpectrogramInterpolated),
39 m_spectrogramXSmoothing(SpectrogramXInterpolated), 39 m_spectrogramXSmoothing(SpectrogramXInterpolated),
40 m_tuningFrequency(440), 40 m_tuningFrequency(440),
41 m_propertyBoxLayout(VerticallyStacked), 41 m_propertyBoxLayout(VerticallyStacked),
42 m_windowType(HanningWindow), 42 m_windowType(HanningWindow),
43 m_resampleQuality(1),
44 m_runPluginsInProcess(true), 43 m_runPluginsInProcess(true),
45 m_omitRecentTemps(true), 44 m_omitRecentTemps(true),
46 m_tempDirRoot(""), 45 m_tempDirRoot(""),
47 m_fixedSampleRate(0), 46 m_fixedSampleRate(0),
48 m_resampleOnLoad(false), 47 m_resampleOnLoad(false),
64 m_tuningFrequency = settings.value("tuning-frequency", 440.).toDouble(); 63 m_tuningFrequency = settings.value("tuning-frequency", 440.).toDouble();
65 m_propertyBoxLayout = PropertyBoxLayout 64 m_propertyBoxLayout = PropertyBoxLayout
66 (settings.value("property-box-layout", int(VerticallyStacked)).toInt()); 65 (settings.value("property-box-layout", int(VerticallyStacked)).toInt());
67 m_windowType = WindowType 66 m_windowType = WindowType
68 (settings.value("window-type", int(HanningWindow)).toInt()); 67 (settings.value("window-type", int(HanningWindow)).toInt());
69 m_resampleQuality = settings.value("resample-quality", 1).toInt();
70 m_runPluginsInProcess = settings.value("run-vamp-plugins-in-process", true).toBool(); 68 m_runPluginsInProcess = settings.value("run-vamp-plugins-in-process", true).toBool();
71 m_fixedSampleRate = settings.value("fixed-sample-rate", 0).toDouble(); 69 m_fixedSampleRate = settings.value("fixed-sample-rate", 0).toDouble();
72 m_resampleOnLoad = settings.value("resample-on-load", false).toBool(); 70 m_resampleOnLoad = settings.value("resample-on-load", false).toBool();
73 m_gapless = settings.value("gapless", true).toBool(); 71 m_gapless = settings.value("gapless", true).toBool();
74 m_normaliseAudio = settings.value("normalise-audio", false).toBool(); 72 m_normaliseAudio = settings.value("normalise-audio", false).toBool();
268 if (max) *max = int(BlackmanHarrisWindow); 266 if (max) *max = int(BlackmanHarrisWindow);
269 if (deflt) *deflt = int(HanningWindow); 267 if (deflt) *deflt = int(HanningWindow);
270 return int(m_windowType); 268 return int(m_windowType);
271 } 269 }
272 270
273 if (name == "Resample Quality") {
274 if (min) *min = 0;
275 if (max) *max = 2;
276 if (deflt) *deflt = 1;
277 return m_resampleQuality;
278 }
279
280 if (name == "Run Vamp Plugins In Process") { 271 if (name == "Run Vamp Plugins In Process") {
281 return m_runPluginsInProcess; 272 return m_runPluginsInProcess;
282 } 273 }
283 274
284 if (name == "Omit Temporaries from Recent Files") { 275 if (name == "Omit Temporaries from Recent Files") {
425 //!!! 416 //!!!
426 } else if (name == "Property Box Layout") { 417 } else if (name == "Property Box Layout") {
427 setPropertyBoxLayout(value == 0 ? VerticallyStacked : Layered); 418 setPropertyBoxLayout(value == 0 ? VerticallyStacked : Layered);
428 } else if (name == "Window Type") { 419 } else if (name == "Window Type") {
429 setWindowType(WindowType(value)); 420 setWindowType(WindowType(value));
430 } else if (name == "Resample Quality") {
431 setResampleQuality(value);
432 } else if (name == "Run Vamp Plugins In Process") { 421 } else if (name == "Run Vamp Plugins In Process") {
433 setRunPluginsInProcess(value ? true : false); 422 setRunPluginsInProcess(value ? true : false);
434 } else if (name == "Omit Temporaries from Recent Files") { 423 } else if (name == "Omit Temporaries from Recent Files") {
435 setOmitTempsFromRecentFiles(value ? true : false); 424 setOmitTempsFromRecentFiles(value ? true : false);
436 } else if (name == "Background Mode") { 425 } else if (name == "Background Mode") {
521 emit propertyChanged("Window Type"); 510 emit propertyChanged("Window Type");
522 } 511 }
523 } 512 }
524 513
525 void 514 void
526 Preferences::setResampleQuality(int q)
527 {
528 if (m_resampleQuality != q) {
529 m_resampleQuality = q;
530 QSettings settings;
531 settings.beginGroup("Preferences");
532 settings.setValue("resample-quality", q);
533 settings.endGroup();
534 emit propertyChanged("Resample Quality");
535 }
536 }
537
538 void
539 Preferences::setRunPluginsInProcess(bool run) 515 Preferences::setRunPluginsInProcess(bool run)
540 { 516 {
541 if (m_runPluginsInProcess != run) { 517 if (m_runPluginsInProcess != run) {
542 m_runPluginsInProcess = run; 518 m_runPluginsInProcess = run;
543 QSettings settings; 519 QSettings settings;