comparison base/Preferences.cpp @ 1225:ba16388b937d piper

Restore native-Vamp factory and make the choice between Piper and Native a preference
author Chris Cannam
date Fri, 21 Oct 2016 11:49:27 +0100
parents 26cf6d5251ec
children ff9697592bef
comparison
equal deleted inserted replaced
1224:ab050519c4ba 1225:ba16388b937d
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), 43 m_resampleQuality(1),
44 m_runPluginsInProcess(true),
44 m_omitRecentTemps(true), 45 m_omitRecentTemps(true),
45 m_tempDirRoot(""), 46 m_tempDirRoot(""),
46 m_fixedSampleRate(0), 47 m_fixedSampleRate(0),
47 m_resampleOnLoad(false), 48 m_resampleOnLoad(false),
48 m_normaliseAudio(false), 49 m_normaliseAudio(false),
63 m_propertyBoxLayout = PropertyBoxLayout 64 m_propertyBoxLayout = PropertyBoxLayout
64 (settings.value("property-box-layout", int(VerticallyStacked)).toInt()); 65 (settings.value("property-box-layout", int(VerticallyStacked)).toInt());
65 m_windowType = WindowType 66 m_windowType = WindowType
66 (settings.value("window-type", int(HanningWindow)).toInt()); 67 (settings.value("window-type", int(HanningWindow)).toInt());
67 m_resampleQuality = settings.value("resample-quality", 1).toInt(); 68 m_resampleQuality = settings.value("resample-quality", 1).toInt();
69 m_runPluginsInProcess = settings.value("run-vamp-plugins-in-process", true).toBool();
68 m_fixedSampleRate = settings.value("fixed-sample-rate", 0).toDouble(); 70 m_fixedSampleRate = settings.value("fixed-sample-rate", 0).toDouble();
69 m_resampleOnLoad = settings.value("resample-on-load", false).toBool(); 71 m_resampleOnLoad = settings.value("resample-on-load", false).toBool();
70 m_normaliseAudio = settings.value("normalise-audio", false).toBool(); 72 m_normaliseAudio = settings.value("normalise-audio", false).toBool();
71 m_backgroundMode = BackgroundMode 73 m_backgroundMode = BackgroundMode
72 (settings.value("background-mode", int(BackgroundFromTheme)).toInt()); 74 (settings.value("background-mode", int(BackgroundFromTheme)).toInt());
264 if (max) *max = 2; 266 if (max) *max = 2;
265 if (deflt) *deflt = 1; 267 if (deflt) *deflt = 1;
266 return m_resampleQuality; 268 return m_resampleQuality;
267 } 269 }
268 270
271 if (name == "Run Vamp Plugins In Process") {
272 return m_runPluginsInProcess;
273 }
274
269 if (name == "Omit Temporaries from Recent Files") { 275 if (name == "Omit Temporaries from Recent Files") {
270 if (deflt) *deflt = 1; 276 if (deflt) *deflt = 1;
271 return m_omitRecentTemps ? 1 : 0; 277 return m_omitRecentTemps ? 1 : 0;
272 } 278 }
273 279
412 setPropertyBoxLayout(value == 0 ? VerticallyStacked : Layered); 418 setPropertyBoxLayout(value == 0 ? VerticallyStacked : Layered);
413 } else if (name == "Window Type") { 419 } else if (name == "Window Type") {
414 setWindowType(WindowType(value)); 420 setWindowType(WindowType(value));
415 } else if (name == "Resample Quality") { 421 } else if (name == "Resample Quality") {
416 setResampleQuality(value); 422 setResampleQuality(value);
423 } else if (name == "Run Vamp Plugins In Process") {
424 setRunPluginsInProcess(value ? true : false);
417 } else if (name == "Omit Temporaries from Recent Files") { 425 } else if (name == "Omit Temporaries from Recent Files") {
418 setOmitTempsFromRecentFiles(value ? true : false); 426 setOmitTempsFromRecentFiles(value ? true : false);
419 } else if (name == "Background Mode") { 427 } else if (name == "Background Mode") {
420 setBackgroundMode(BackgroundMode(value)); 428 setBackgroundMode(BackgroundMode(value));
421 } else if (name == "Time To Text Mode") { 429 } else if (name == "Time To Text Mode") {
517 emit propertyChanged("Resample Quality"); 525 emit propertyChanged("Resample Quality");
518 } 526 }
519 } 527 }
520 528
521 void 529 void
530 Preferences::setRunPluginsInProcess(bool run)
531 {
532 if (m_runPluginsInProcess != run) {
533 m_runPluginsInProcess = run;
534 QSettings settings;
535 settings.beginGroup("Preferences");
536 settings.setValue("run-vamp-plugins-in-process", run);
537 settings.endGroup();
538 emit propertyChanged("Run Vamp Plugins In Process");
539 }
540 }
541
542 void
522 Preferences::setOmitTempsFromRecentFiles(bool omit) 543 Preferences::setOmitTempsFromRecentFiles(bool omit)
523 { 544 {
524 if (m_omitRecentTemps != omit) { 545 if (m_omitRecentTemps != omit) {
525 m_omitRecentTemps = omit; 546 m_omitRecentTemps = omit;
526 QSettings settings; 547 QSettings settings;