1 ///////////////////////////////////////////////////////////////////////////////
2 // LameXP - Audio Encoder Front-End
3 // Copyright (C) 2004-2019 LoRd_MuldeR <MuldeR2@GMX.de>
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version, but always including the *additional*
9 // restrictions defined in the "License.txt" file.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with this program; if not, write to the Free Software Foundation, Inc.,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 // http://www.gnu.org/licenses/gpl-2.0.txt
21 ///////////////////////////////////////////////////////////////////////////////
26 #include <QScopedPointer>
31 ///////////////////////////////////////////////////////////////////////////////
33 #define LAMEXP_MAKE_OPTION_I(OPT) \
34 qint32 OPT(void) const; \
35 void OPT(const qint32 &value); \
36 qint32 OPT##Default(void);
38 #define LAMEXP_MAKE_OPTION_S(OPT) \
39 QString OPT(void) const; \
40 void OPT(const QString &value); \
41 QString OPT##Default(void);
43 #define LAMEXP_MAKE_OPTION_B(OPT) \
44 bool OPT(void) const; \
45 void OPT(bool value); \
46 bool OPT##Default(void);
48 #define LAMEXP_MAKE_OPTION_U(OPT) \
49 quint32 OPT(void) const; \
50 void OPT(const quint32 &value); \
51 quint32 OPT##Default(void);
53 ///////////////////////////////////////////////////////////////////////////////
86 Overwrite_KeepBoth
= 0,
87 Overwrite_SkipFile
= 1,
88 Overwrite_Replaces
= 2
101 static const int samplingRates
[8];
104 LAMEXP_MAKE_OPTION_I(aacEncProfile
)
105 LAMEXP_MAKE_OPTION_I(aftenAudioCodingMode
)
106 LAMEXP_MAKE_OPTION_I(aftenDynamicRangeCompression
)
107 LAMEXP_MAKE_OPTION_I(aftenExponentSearchSize
)
108 LAMEXP_MAKE_OPTION_B(aftenFastBitAllocation
)
109 LAMEXP_MAKE_OPTION_B(antivirNotificationsEnabled
)
110 LAMEXP_MAKE_OPTION_B(autoUpdateCheckBeta
)
111 LAMEXP_MAKE_OPTION_B(autoUpdateEnabled
)
112 LAMEXP_MAKE_OPTION_S(autoUpdateLastCheck
)
113 LAMEXP_MAKE_OPTION_B(bitrateManagementEnabled
)
114 LAMEXP_MAKE_OPTION_I(bitrateManagementMaxRate
)
115 LAMEXP_MAKE_OPTION_I(bitrateManagementMinRate
)
116 LAMEXP_MAKE_OPTION_I(compressionAbrBitrateAacEnc
)
117 LAMEXP_MAKE_OPTION_I(compressionAbrBitrateAften
)
118 LAMEXP_MAKE_OPTION_I(compressionAbrBitrateDcaEnc
)
119 LAMEXP_MAKE_OPTION_I(compressionAbrBitrateFLAC
)
120 LAMEXP_MAKE_OPTION_I(compressionAbrBitrateLAME
)
121 LAMEXP_MAKE_OPTION_I(compressionAbrBitrateMacEnc
)
122 LAMEXP_MAKE_OPTION_I(compressionAbrBitrateOggEnc
)
123 LAMEXP_MAKE_OPTION_I(compressionAbrBitrateOpusEnc
)
124 LAMEXP_MAKE_OPTION_I(compressionAbrBitrateWave
)
125 LAMEXP_MAKE_OPTION_I(compressionCbrBitrateAacEnc
)
126 LAMEXP_MAKE_OPTION_I(compressionCbrBitrateAften
)
127 LAMEXP_MAKE_OPTION_I(compressionCbrBitrateDcaEnc
)
128 LAMEXP_MAKE_OPTION_I(compressionCbrBitrateFLAC
)
129 LAMEXP_MAKE_OPTION_I(compressionCbrBitrateLAME
)
130 LAMEXP_MAKE_OPTION_I(compressionCbrBitrateMacEnc
)
131 LAMEXP_MAKE_OPTION_I(compressionCbrBitrateOggEnc
)
132 LAMEXP_MAKE_OPTION_I(compressionCbrBitrateOpusEnc
)
133 LAMEXP_MAKE_OPTION_I(compressionCbrBitrateWave
)
134 LAMEXP_MAKE_OPTION_I(compressionEncoder
)
135 LAMEXP_MAKE_OPTION_I(compressionRCModeAacEnc
)
136 LAMEXP_MAKE_OPTION_I(compressionRCModeAften
)
137 LAMEXP_MAKE_OPTION_I(compressionRCModeDcaEnc
)
138 LAMEXP_MAKE_OPTION_I(compressionRCModeFLAC
)
139 LAMEXP_MAKE_OPTION_I(compressionRCModeLAME
)
140 LAMEXP_MAKE_OPTION_I(compressionRCModeMacEnc
)
141 LAMEXP_MAKE_OPTION_I(compressionRCModeOggEnc
)
142 LAMEXP_MAKE_OPTION_I(compressionRCModeOpusEnc
)
143 LAMEXP_MAKE_OPTION_I(compressionRCModeWave
)
144 LAMEXP_MAKE_OPTION_I(compressionVbrQualityAacEnc
)
145 LAMEXP_MAKE_OPTION_I(compressionVbrQualityAften
)
146 LAMEXP_MAKE_OPTION_I(compressionVbrQualityDcaEnc
)
147 LAMEXP_MAKE_OPTION_I(compressionVbrQualityFLAC
)
148 LAMEXP_MAKE_OPTION_I(compressionVbrQualityLAME
)
149 LAMEXP_MAKE_OPTION_I(compressionVbrQualityMacEnc
)
150 LAMEXP_MAKE_OPTION_I(compressionVbrQualityOggEnc
)
151 LAMEXP_MAKE_OPTION_I(compressionVbrQualityOpusEnc
)
152 LAMEXP_MAKE_OPTION_I(compressionVbrQualityWave
)
153 LAMEXP_MAKE_OPTION_B(createPlaylist
)
154 LAMEXP_MAKE_OPTION_S(currentLanguage
)
155 LAMEXP_MAKE_OPTION_S(currentLanguageFile
)
156 LAMEXP_MAKE_OPTION_S(customParametersAacEnc
)
157 LAMEXP_MAKE_OPTION_S(customParametersAften
)
158 LAMEXP_MAKE_OPTION_S(customParametersDcaEnc
)
159 LAMEXP_MAKE_OPTION_S(customParametersFLAC
)
160 LAMEXP_MAKE_OPTION_S(customParametersLAME
)
161 LAMEXP_MAKE_OPTION_S(customParametersMacEnc
)
162 LAMEXP_MAKE_OPTION_S(customParametersOggEnc
)
163 LAMEXP_MAKE_OPTION_S(customParametersOpusEnc
)
164 LAMEXP_MAKE_OPTION_S(customParametersWave
)
165 LAMEXP_MAKE_OPTION_S(customTempPath
)
166 LAMEXP_MAKE_OPTION_B(customTempPathEnabled
)
167 LAMEXP_MAKE_OPTION_B(dropBoxWidgetEnabled
)
168 LAMEXP_MAKE_OPTION_I(dropBoxWidgetPositionX
)
169 LAMEXP_MAKE_OPTION_I(dropBoxWidgetPositionY
)
170 LAMEXP_MAKE_OPTION_S(favoriteOutputFolders
)
171 LAMEXP_MAKE_OPTION_B(forceStereoDownmix
)
172 LAMEXP_MAKE_OPTION_B(hibernateComputer
)
173 LAMEXP_MAKE_OPTION_I(interfaceStyle
)
174 LAMEXP_MAKE_OPTION_B(keepOriginalDataTime
)
175 LAMEXP_MAKE_OPTION_I(lameAlgoQuality
)
176 LAMEXP_MAKE_OPTION_I(lameChannelMode
)
177 LAMEXP_MAKE_OPTION_I(licenseAccepted
)
178 LAMEXP_MAKE_OPTION_U(maximumInstances
)
179 LAMEXP_MAKE_OPTION_U(metaInfoPosition
)
180 LAMEXP_MAKE_OPTION_S(mostRecentInputPath
)
181 LAMEXP_MAKE_OPTION_B(neroAACEnable2Pass
)
182 LAMEXP_MAKE_OPTION_B(neroAacNotificationsEnabled
)
183 LAMEXP_MAKE_OPTION_B(normalizationFilterEnabled
)
184 LAMEXP_MAKE_OPTION_B(normalizationFilterDynamic
)
185 LAMEXP_MAKE_OPTION_B(normalizationFilterCoupled
)
186 LAMEXP_MAKE_OPTION_I(normalizationFilterMaxVolume
)
187 LAMEXP_MAKE_OPTION_I(normalizationFilterSize
)
188 LAMEXP_MAKE_OPTION_I(opusComplexity
)
189 LAMEXP_MAKE_OPTION_B(opusDisableResample
)
190 LAMEXP_MAKE_OPTION_I(opusFramesize
)
191 LAMEXP_MAKE_OPTION_I(opusOptimizeFor
)
192 LAMEXP_MAKE_OPTION_S(outputDir
)
193 LAMEXP_MAKE_OPTION_B(outputToSourceDir
)
194 LAMEXP_MAKE_OPTION_I(overwriteMode
)
195 LAMEXP_MAKE_OPTION_B(prependRelativeSourcePath
)
196 LAMEXP_MAKE_OPTION_B(renameFiles_regExpEnabled
)
197 LAMEXP_MAKE_OPTION_S(renameFiles_regExpSearch
)
198 LAMEXP_MAKE_OPTION_S(renameFiles_regExpReplace
)
199 LAMEXP_MAKE_OPTION_B(renameFiles_renameEnabled
)
200 LAMEXP_MAKE_OPTION_S(renameFiles_renamePattern
)
201 LAMEXP_MAKE_OPTION_S(renameFiles_fileExtension
)
202 LAMEXP_MAKE_OPTION_I(samplingRate
)
203 LAMEXP_MAKE_OPTION_B(shellIntegrationEnabled
)
204 LAMEXP_MAKE_OPTION_B(slowStartup
)
205 LAMEXP_MAKE_OPTION_B(soundsEnabled
)
206 LAMEXP_MAKE_OPTION_I(toneAdjustBass
)
207 LAMEXP_MAKE_OPTION_I(toneAdjustTreble
)
208 LAMEXP_MAKE_OPTION_B(writeMetaTags
)
215 SettingsModel(const SettingsModel
&other
) {}
216 SettingsModel
&operator=(const SettingsModel
&other
) { return *this; }
218 QString
initDirectory(const QString
&path
) const;
219 QString
defaultLanguage(void) const;
220 QString
defaultDirectory(void) const;
222 SettingsCache
*m_configCache
;
224 mutable QMutex m_defaultLangLock
;
225 mutable QScopedPointer
<QString
> m_defaultLanguage
;
228 ///////////////////////////////////////////////////////////////////////////////
230 #undef LAMEXP_MAKE_OPTION_I
231 #undef LAMEXP_MAKE_OPTION_S
232 #undef LAMEXP_MAKE_OPTION_B
233 #undef LAMEXP_MAKE_OPTION_U