comparison base/Preferences.cpp @ 1868:44dba7cd9ec3

Add record-mono preference
author Chris Cannam
date Tue, 16 Jun 2020 15:15:57 +0100
parents 70e172e6cc59
children
comparison
equal deleted inserted replaced
1867:2654bf447a84 1868:44dba7cd9ec3
42 m_windowType(HanningWindow), 42 m_windowType(HanningWindow),
43 m_runPluginsInProcess(true), 43 m_runPluginsInProcess(true),
44 m_omitRecentTemps(true), 44 m_omitRecentTemps(true),
45 m_tempDirRoot(""), 45 m_tempDirRoot(""),
46 m_fixedSampleRate(0), 46 m_fixedSampleRate(0),
47 m_recordMono(false),
47 m_resampleOnLoad(false), 48 m_resampleOnLoad(false),
48 m_gapless(true), 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),
65 (settings.value("property-box-layout", int(VerticallyStacked)).toInt()); 66 (settings.value("property-box-layout", int(VerticallyStacked)).toInt());
66 m_windowType = WindowType 67 m_windowType = WindowType
67 (settings.value("window-type", int(HanningWindow)).toInt()); 68 (settings.value("window-type", int(HanningWindow)).toInt());
68 m_runPluginsInProcess = settings.value("run-vamp-plugins-in-process", true).toBool(); 69 m_runPluginsInProcess = settings.value("run-vamp-plugins-in-process", true).toBool();
69 m_fixedSampleRate = settings.value("fixed-sample-rate", 0).toDouble(); 70 m_fixedSampleRate = settings.value("fixed-sample-rate", 0).toDouble();
71 m_recordMono = settings.value("record-mono", false).toBool();
70 m_resampleOnLoad = settings.value("resample-on-load", false).toBool(); 72 m_resampleOnLoad = settings.value("resample-on-load", false).toBool();
71 m_gapless = settings.value("gapless", true).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());
98 props.push_back("Tuning Frequency"); 100 props.push_back("Tuning Frequency");
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");
105 props.push_back("Record Mono");
103 props.push_back("Resample On Load"); 106 props.push_back("Resample On Load");
104 props.push_back("Use Gapless Mode"); 107 props.push_back("Use Gapless Mode");
105 props.push_back("Normalise Audio"); 108 props.push_back("Normalise Audio");
106 props.push_back("Fixed Sample Rate"); 109 props.push_back("Fixed Sample Rate");
107 props.push_back("Temporary Directory Root"); 110 props.push_back("Temporary Directory Root");
139 return tr("Normalise audio signal when reading from audio file"); 142 return tr("Normalise audio signal when reading from audio file");
140 } 143 }
141 if (name == "Omit Temporaries from Recent Files") { 144 if (name == "Omit Temporaries from Recent Files") {
142 return tr("Omit temporaries from Recent Files menu"); 145 return tr("Omit temporaries from Recent Files menu");
143 } 146 }
147 if (name == "Record Mono") {
148 return tr("Mix recorded channels to mono");
149 }
144 if (name == "Resample On Load") { 150 if (name == "Resample On Load") {
145 return tr("Resample mismatching files on import"); 151 return tr("Resample mismatching files on import");
146 } 152 }
147 if (name == "Use Gapless Mode") { 153 if (name == "Use Gapless Mode") {
148 return tr("Load mp3 files in gapless mode"); 154 return tr("Load mp3 files in gapless mode");
197 } 203 }
198 if (name == "Normalise Audio") { 204 if (name == "Normalise Audio") {
199 return ToggleProperty; 205 return ToggleProperty;
200 } 206 }
201 if (name == "Omit Temporaries from Recent Files") { 207 if (name == "Omit Temporaries from Recent Files") {
208 return ToggleProperty;
209 }
210 if (name == "Record Mono") {
202 return ToggleProperty; 211 return ToggleProperty;
203 } 212 }
204 if (name == "Resample On Load") { 213 if (name == "Resample On Load") {
205 return ToggleProperty; 214 return ToggleProperty;
206 } 215 }
550 emit propertyChanged("Temporary Directory Root"); 559 emit propertyChanged("Temporary Directory Root");
551 } 560 }
552 } 561 }
553 562
554 void 563 void
564 Preferences::setRecordMono(bool mono)
565 {
566 if (m_recordMono != mono) {
567 m_recordMono = mono;
568 QSettings settings;
569 settings.beginGroup("Preferences");
570 settings.setValue("record-mono", mono);
571 settings.endGroup();
572 emit propertyChanged("Record Mono");
573 }
574 }
575
576 void
555 Preferences::setResampleOnLoad(bool resample) 577 Preferences::setResampleOnLoad(bool resample)
556 { 578 {
557 if (m_resampleOnLoad != resample) { 579 if (m_resampleOnLoad != resample) {
558 m_resampleOnLoad = resample; 580 m_resampleOnLoad = resample;
559 QSettings settings; 581 QSettings settings;