Mercurial > hg > svcore
comparison base/Preferences.cpp @ 933:d03b3d956358 warnfix_no_size_t
Merge from branch tony_integration
author | Chris Cannam |
---|---|
date | Wed, 18 Jun 2014 08:34:46 +0100 |
parents | 2896b8872834 |
children | 344c9ea90181 |
comparison
equal
deleted
inserted
replaced
932:e06f03013f46 | 933:d03b3d956358 |
---|---|
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_omitRecentTemps(true), | 44 m_omitRecentTemps(true), |
45 m_tempDirRoot(""), | 45 m_tempDirRoot(""), |
46 m_fixedSampleRate(0), | |
46 m_resampleOnLoad(false), | 47 m_resampleOnLoad(false), |
48 m_normaliseAudio(false), | |
47 m_viewFontSize(10), | 49 m_viewFontSize(10), |
48 m_backgroundMode(BackgroundFromTheme), | 50 m_backgroundMode(BackgroundFromTheme), |
49 m_timeToTextMode(TimeToTextMs), | 51 m_timeToTextMode(TimeToTextMs), |
50 m_octave(4), | 52 m_octave(4), |
51 m_showSplash(true) | 53 m_showSplash(true) |
60 m_propertyBoxLayout = PropertyBoxLayout | 62 m_propertyBoxLayout = PropertyBoxLayout |
61 (settings.value("property-box-layout", int(VerticallyStacked)).toInt()); | 63 (settings.value("property-box-layout", int(VerticallyStacked)).toInt()); |
62 m_windowType = WindowType | 64 m_windowType = WindowType |
63 (settings.value("window-type", int(HanningWindow)).toInt()); | 65 (settings.value("window-type", int(HanningWindow)).toInt()); |
64 m_resampleQuality = settings.value("resample-quality", 1).toInt(); | 66 m_resampleQuality = settings.value("resample-quality", 1).toInt(); |
67 m_fixedSampleRate = settings.value("fixed-sample-rate", 0).toInt(); | |
65 m_resampleOnLoad = settings.value("resample-on-load", false).toBool(); | 68 m_resampleOnLoad = settings.value("resample-on-load", false).toBool(); |
69 m_normaliseAudio = settings.value("normalise-audio", false).toBool(); | |
66 m_backgroundMode = BackgroundMode | 70 m_backgroundMode = BackgroundMode |
67 (settings.value("background-mode", int(BackgroundFromTheme)).toInt()); | 71 (settings.value("background-mode", int(BackgroundFromTheme)).toInt()); |
68 m_timeToTextMode = TimeToTextMode | 72 m_timeToTextMode = TimeToTextMode |
69 (settings.value("time-to-text-mode", int(TimeToTextMs)).toInt()); | 73 (settings.value("time-to-text-mode", int(TimeToTextMs)).toInt()); |
70 m_octave = (settings.value("octave-of-middle-c", 4)).toInt(); | 74 m_octave = (settings.value("octave-of-middle-c", 4)).toInt(); |
91 props.push_back("Property Box Layout"); | 95 props.push_back("Property Box Layout"); |
92 props.push_back("Window Type"); | 96 props.push_back("Window Type"); |
93 props.push_back("Resample Quality"); | 97 props.push_back("Resample Quality"); |
94 props.push_back("Omit Temporaries from Recent Files"); | 98 props.push_back("Omit Temporaries from Recent Files"); |
95 props.push_back("Resample On Load"); | 99 props.push_back("Resample On Load"); |
100 props.push_back("Normalise Audio"); | |
101 props.push_back("Fixed Sample Rate"); | |
96 props.push_back("Temporary Directory Root"); | 102 props.push_back("Temporary Directory Root"); |
97 props.push_back("Background Mode"); | 103 props.push_back("Background Mode"); |
98 props.push_back("Time To Text Mode"); | 104 props.push_back("Time To Text Mode"); |
99 props.push_back("Octave Numbering System"); | 105 props.push_back("Octave Numbering System"); |
100 props.push_back("View Font Size"); | 106 props.push_back("View Font Size"); |
121 return tr("Spectral analysis window shape"); | 127 return tr("Spectral analysis window shape"); |
122 } | 128 } |
123 if (name == "Resample Quality") { | 129 if (name == "Resample Quality") { |
124 return tr("Playback resampler type"); | 130 return tr("Playback resampler type"); |
125 } | 131 } |
132 if (name == "Normalise Audio") { | |
133 return tr("Normalise audio signal when reading from audio file"); | |
134 } | |
126 if (name == "Omit Temporaries from Recent Files") { | 135 if (name == "Omit Temporaries from Recent Files") { |
127 return tr("Omit temporaries from Recent Files menu"); | 136 return tr("Omit temporaries from Recent Files menu"); |
128 } | 137 } |
129 if (name == "Resample On Load") { | 138 if (name == "Resample On Load") { |
130 return tr("Resample mismatching files on import"); | 139 return tr("Resample mismatching files on import"); |
131 } | 140 } |
141 if (name == "Fixed Sample Rate") { | |
142 return tr("Single fixed sample rate to resample all files to"); | |
143 } | |
132 if (name == "Temporary Directory Root") { | 144 if (name == "Temporary Directory Root") { |
133 return tr("Location for cache file directory"); | 145 return tr("Location for cache file directory"); |
134 } | 146 } |
135 if (name == "Background Mode") { | 147 if (name == "Background Mode") { |
136 return tr("Background colour preference"); | 148 return tr("Background colour preference"); |
169 return ValueProperty; | 181 return ValueProperty; |
170 } | 182 } |
171 if (name == "Resample Quality") { | 183 if (name == "Resample Quality") { |
172 return ValueProperty; | 184 return ValueProperty; |
173 } | 185 } |
186 if (name == "Normalise Audio") { | |
187 return ToggleProperty; | |
188 } | |
174 if (name == "Omit Temporaries from Recent Files") { | 189 if (name == "Omit Temporaries from Recent Files") { |
175 return ToggleProperty; | 190 return ToggleProperty; |
176 } | 191 } |
177 if (name == "Resample On Load") { | 192 if (name == "Resample On Load") { |
178 return ToggleProperty; | 193 return ToggleProperty; |
194 } | |
195 if (name == "Fixed Sample Rate") { | |
196 return ValueProperty; | |
179 } | 197 } |
180 if (name == "Temporary Directory Root") { | 198 if (name == "Temporary Directory Root") { |
181 // It's an arbitrary string, we don't have a set of values for this | 199 // It's an arbitrary string, we don't have a set of values for this |
182 return InvalidProperty; | 200 return InvalidProperty; |
183 } | 201 } |
523 emit propertyChanged("Resample On Load"); | 541 emit propertyChanged("Resample On Load"); |
524 } | 542 } |
525 } | 543 } |
526 | 544 |
527 void | 545 void |
546 Preferences::setFixedSampleRate(int rate) | |
547 { | |
548 if (m_fixedSampleRate != rate) { | |
549 m_fixedSampleRate = rate; | |
550 QSettings settings; | |
551 settings.beginGroup("Preferences"); | |
552 settings.setValue("fixed-sample-rate", rate); | |
553 settings.endGroup(); | |
554 emit propertyChanged("Fixed Sample Rate"); | |
555 } | |
556 } | |
557 | |
558 void | |
559 Preferences::setNormaliseAudio(bool norm) | |
560 { | |
561 if (m_normaliseAudio != norm) { | |
562 m_normaliseAudio = norm; | |
563 QSettings settings; | |
564 settings.beginGroup("Preferences"); | |
565 settings.setValue("normalise-audio", norm); | |
566 settings.endGroup(); | |
567 emit propertyChanged("Normalise Audio"); | |
568 } | |
569 } | |
570 | |
571 void | |
528 Preferences::setBackgroundMode(BackgroundMode mode) | 572 Preferences::setBackgroundMode(BackgroundMode mode) |
529 { | 573 { |
530 if (m_backgroundMode != mode) { | 574 if (m_backgroundMode != mode) { |
531 | 575 |
532 m_backgroundMode = mode; | 576 m_backgroundMode = mode; |