comparison base/Preferences.cpp @ 1313:ff9697592bef 3.0-integration

Add gapless preference to prefs dialog; much work on audio read tests
author Chris Cannam
date Thu, 01 Dec 2016 17:45:40 +0000
parents ba16388b937d
children ea28ee929034
comparison
equal deleted inserted replaced
1312:079e553dc16e 1313:ff9697592bef
44 m_runPluginsInProcess(true), 44 m_runPluginsInProcess(true),
45 m_omitRecentTemps(true), 45 m_omitRecentTemps(true),
46 m_tempDirRoot(""), 46 m_tempDirRoot(""),
47 m_fixedSampleRate(0), 47 m_fixedSampleRate(0),
48 m_resampleOnLoad(false), 48 m_resampleOnLoad(false),
49 m_gapless(true),
49 m_normaliseAudio(false), 50 m_normaliseAudio(false),
50 m_viewFontSize(10), 51 m_viewFontSize(10),
51 m_backgroundMode(BackgroundFromTheme), 52 m_backgroundMode(BackgroundFromTheme),
52 m_timeToTextMode(TimeToTextMs), 53 m_timeToTextMode(TimeToTextMs),
53 m_showHMS(true), 54 m_showHMS(true),
67 (settings.value("window-type", int(HanningWindow)).toInt()); 68 (settings.value("window-type", int(HanningWindow)).toInt());
68 m_resampleQuality = settings.value("resample-quality", 1).toInt(); 69 m_resampleQuality = settings.value("resample-quality", 1).toInt();
69 m_runPluginsInProcess = settings.value("run-vamp-plugins-in-process", true).toBool(); 70 m_runPluginsInProcess = settings.value("run-vamp-plugins-in-process", true).toBool();
70 m_fixedSampleRate = settings.value("fixed-sample-rate", 0).toDouble(); 71 m_fixedSampleRate = settings.value("fixed-sample-rate", 0).toDouble();
71 m_resampleOnLoad = settings.value("resample-on-load", false).toBool(); 72 m_resampleOnLoad = settings.value("resample-on-load", false).toBool();
73 m_gapless = settings.value("gapless", true).toBool();
72 m_normaliseAudio = settings.value("normalise-audio", false).toBool(); 74 m_normaliseAudio = settings.value("normalise-audio", false).toBool();
73 m_backgroundMode = BackgroundMode 75 m_backgroundMode = BackgroundMode
74 (settings.value("background-mode", int(BackgroundFromTheme)).toInt()); 76 (settings.value("background-mode", int(BackgroundFromTheme)).toInt());
75 m_timeToTextMode = TimeToTextMode 77 m_timeToTextMode = TimeToTextMode
76 (settings.value("time-to-text-mode", int(TimeToTextMs)).toInt()); 78 (settings.value("time-to-text-mode", int(TimeToTextMs)).toInt());
99 props.push_back("Property Box Layout"); 101 props.push_back("Property Box Layout");
100 props.push_back("Window Type"); 102 props.push_back("Window Type");
101 props.push_back("Resample Quality"); 103 props.push_back("Resample Quality");
102 props.push_back("Omit Temporaries from Recent Files"); 104 props.push_back("Omit Temporaries from Recent Files");
103 props.push_back("Resample On Load"); 105 props.push_back("Resample On Load");
106 props.push_back("Use Gapless Mode");
104 props.push_back("Normalise Audio"); 107 props.push_back("Normalise Audio");
105 props.push_back("Fixed Sample Rate"); 108 props.push_back("Fixed Sample Rate");
106 props.push_back("Temporary Directory Root"); 109 props.push_back("Temporary Directory Root");
107 props.push_back("Background Mode"); 110 props.push_back("Background Mode");
108 props.push_back("Time To Text Mode"); 111 props.push_back("Time To Text Mode");
141 return tr("Omit temporaries from Recent Files menu"); 144 return tr("Omit temporaries from Recent Files menu");
142 } 145 }
143 if (name == "Resample On Load") { 146 if (name == "Resample On Load") {
144 return tr("Resample mismatching files on import"); 147 return tr("Resample mismatching files on import");
145 } 148 }
149 if (name == "Use Gapless Mode") {
150 return tr("Load mp3 files in gapless mode");
151 }
146 if (name == "Fixed Sample Rate") { 152 if (name == "Fixed Sample Rate") {
147 return tr("Single fixed sample rate to resample all files to"); 153 return tr("Single fixed sample rate to resample all files to");
148 } 154 }
149 if (name == "Temporary Directory Root") { 155 if (name == "Temporary Directory Root") {
150 return tr("Location for cache file directory"); 156 return tr("Location for cache file directory");
196 } 202 }
197 if (name == "Omit Temporaries from Recent Files") { 203 if (name == "Omit Temporaries from Recent Files") {
198 return ToggleProperty; 204 return ToggleProperty;
199 } 205 }
200 if (name == "Resample On Load") { 206 if (name == "Resample On Load") {
207 return ToggleProperty;
208 }
209 if (name == "Use Gapless Mode") {
201 return ToggleProperty; 210 return ToggleProperty;
202 } 211 }
203 if (name == "Fixed Sample Rate") { 212 if (name == "Fixed Sample Rate") {
204 return ValueProperty; 213 return ValueProperty;
205 } 214 }
580 emit propertyChanged("Resample On Load"); 589 emit propertyChanged("Resample On Load");
581 } 590 }
582 } 591 }
583 592
584 void 593 void
594 Preferences::setUseGaplessMode(bool gapless)
595 {
596 if (m_gapless != gapless) {
597 m_gapless = gapless;
598 QSettings settings;
599 settings.beginGroup("Preferences");
600 settings.setValue("gapless", gapless);
601 settings.endGroup();
602 emit propertyChanged("Use Gapless Mode");
603 }
604 }
605
606 void
585 Preferences::setFixedSampleRate(sv_samplerate_t rate) 607 Preferences::setFixedSampleRate(sv_samplerate_t rate)
586 { 608 {
587 if (m_fixedSampleRate != rate) { 609 if (m_fixedSampleRate != rate) {
588 m_fixedSampleRate = rate; 610 m_fixedSampleRate = rate;
589 QSettings settings; 611 QSettings settings;