1 ///////////////////////////////////////////////////////////////////////////////
2 // LameXP - Audio Encoder Front-End
3 // Copyright (C) 2004-2015 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 int OPT(void) const; \
35 void OPT(int value); \
36 int 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 unsigned int OPT(void) const; \
50 void OPT(unsigned int value); \
51 unsigned int OPT##Default(void);
53 ///////////////////////////////////////////////////////////////////////////////
86 Overwrite_KeepBoth = 0,
87 Overwrite_SkipFile = 1,
88 Overwrite_Replaces = 2
100 static const int samplingRates[8];
103 LAMEXP_MAKE_OPTION_I(aacEncProfile)
104 LAMEXP_MAKE_OPTION_I(aftenAudioCodingMode)
105 LAMEXP_MAKE_OPTION_I(aftenDynamicRangeCompression)
106 LAMEXP_MAKE_OPTION_I(aftenExponentSearchSize)
107 LAMEXP_MAKE_OPTION_B(aftenFastBitAllocation)
108 LAMEXP_MAKE_OPTION_B(antivirNotificationsEnabled)
109 LAMEXP_MAKE_OPTION_B(autoUpdateCheckBeta)
110 LAMEXP_MAKE_OPTION_B(autoUpdateEnabled)
111 LAMEXP_MAKE_OPTION_S(autoUpdateLastCheck)
112 LAMEXP_MAKE_OPTION_B(bitrateManagementEnabled)
113 LAMEXP_MAKE_OPTION_I(bitrateManagementMaxRate)
114 LAMEXP_MAKE_OPTION_I(bitrateManagementMinRate)
115 LAMEXP_MAKE_OPTION_I(compressionAbrBitrateAacEnc)
116 LAMEXP_MAKE_OPTION_I(compressionAbrBitrateAften)
117 LAMEXP_MAKE_OPTION_I(compressionAbrBitrateDcaEnc)
118 LAMEXP_MAKE_OPTION_I(compressionAbrBitrateFLAC)
119 LAMEXP_MAKE_OPTION_I(compressionAbrBitrateLAME)
120 LAMEXP_MAKE_OPTION_I(compressionAbrBitrateMacEnc)
121 LAMEXP_MAKE_OPTION_I(compressionAbrBitrateOggEnc)
122 LAMEXP_MAKE_OPTION_I(compressionAbrBitrateOpusEnc)
123 LAMEXP_MAKE_OPTION_I(compressionAbrBitrateWave)
124 LAMEXP_MAKE_OPTION_I(compressionCbrBitrateAacEnc)
125 LAMEXP_MAKE_OPTION_I(compressionCbrBitrateAften)
126 LAMEXP_MAKE_OPTION_I(compressionCbrBitrateDcaEnc)
127 LAMEXP_MAKE_OPTION_I(compressionCbrBitrateFLAC)
128 LAMEXP_MAKE_OPTION_I(compressionCbrBitrateLAME)
129 LAMEXP_MAKE_OPTION_I(compressionCbrBitrateMacEnc)
130 LAMEXP_MAKE_OPTION_I(compressionCbrBitrateOggEnc)
131 LAMEXP_MAKE_OPTION_I(compressionCbrBitrateOpusEnc)
132 LAMEXP_MAKE_OPTION_I(compressionCbrBitrateWave)
133 LAMEXP_MAKE_OPTION_I(compressionEncoder)
134 LAMEXP_MAKE_OPTION_I(compressionRCModeAacEnc)
135 LAMEXP_MAKE_OPTION_I(compressionRCModeAften)
136 LAMEXP_MAKE_OPTION_I(compressionRCModeDcaEnc)
137 LAMEXP_MAKE_OPTION_I(compressionRCModeFLAC)
138 LAMEXP_MAKE_OPTION_I(compressionRCModeLAME)
139 LAMEXP_MAKE_OPTION_I(compressionRCModeMacEnc)
140 LAMEXP_MAKE_OPTION_I(compressionRCModeOggEnc)
141 LAMEXP_MAKE_OPTION_I(compressionRCModeOpusEnc)
142 LAMEXP_MAKE_OPTION_I(compressionRCModeWave)
143 LAMEXP_MAKE_OPTION_I(compressionVbrQualityAacEnc)
144 LAMEXP_MAKE_OPTION_I(compressionVbrQualityAften)
145 LAMEXP_MAKE_OPTION_I(compressionVbrQualityDcaEnc)
146 LAMEXP_MAKE_OPTION_I(compressionVbrQualityFLAC)
147 LAMEXP_MAKE_OPTION_I(compressionVbrQualityLAME)
148 LAMEXP_MAKE_OPTION_I(compressionVbrQualityMacEnc)
149 LAMEXP_MAKE_OPTION_I(compressionVbrQualityOggEnc)
150 LAMEXP_MAKE_OPTION_I(compressionVbrQualityOpusEnc)
151 LAMEXP_MAKE_OPTION_I(compressionVbrQualityWave)
152 LAMEXP_MAKE_OPTION_B(createPlaylist)
153 LAMEXP_MAKE_OPTION_S(currentLanguage)
154 LAMEXP_MAKE_OPTION_S(currentLanguageFile)
155 LAMEXP_MAKE_OPTION_S(customParametersAacEnc)
156 LAMEXP_MAKE_OPTION_S(customParametersAften)
157 LAMEXP_MAKE_OPTION_S(customParametersDcaEnc)
158 LAMEXP_MAKE_OPTION_S(customParametersFLAC)
159 LAMEXP_MAKE_OPTION_S(customParametersLAME)
160 LAMEXP_MAKE_OPTION_S(customParametersMacEnc)
161 LAMEXP_MAKE_OPTION_S(customParametersOggEnc)
162 LAMEXP_MAKE_OPTION_S(customParametersOpusEnc)
163 LAMEXP_MAKE_OPTION_S(customParametersWave)
164 LAMEXP_MAKE_OPTION_S(customTempPath)
165 LAMEXP_MAKE_OPTION_B(customTempPathEnabled)
166 LAMEXP_MAKE_OPTION_B(dropBoxWidgetEnabled)
167 LAMEXP_MAKE_OPTION_I(dropBoxWidgetPositionX)
168 LAMEXP_MAKE_OPTION_I(dropBoxWidgetPositionY)
169 LAMEXP_MAKE_OPTION_S(favoriteOutputFolders)
170 LAMEXP_MAKE_OPTION_B(forceStereoDownmix)
171 LAMEXP_MAKE_OPTION_B(hibernateComputer)
172 LAMEXP_MAKE_OPTION_I(interfaceStyle)
173 LAMEXP_MAKE_OPTION_I(lameAlgoQuality)
174 LAMEXP_MAKE_OPTION_I(lameChannelMode)
175 LAMEXP_MAKE_OPTION_I(licenseAccepted)
176 LAMEXP_MAKE_OPTION_U(maximumInstances)
177 LAMEXP_MAKE_OPTION_U(metaInfoPosition)
178 LAMEXP_MAKE_OPTION_S(mostRecentInputPath)
179 LAMEXP_MAKE_OPTION_B(neroAACEnable2Pass)
180 LAMEXP_MAKE_OPTION_B(neroAacNotificationsEnabled)
181 LAMEXP_MAKE_OPTION_B(normalizationFilterEnabled)
182 LAMEXP_MAKE_OPTION_B(normalizationFilterDynamic)
183 LAMEXP_MAKE_OPTION_B(normalizationFilterCoupled)
184 LAMEXP_MAKE_OPTION_I(normalizationFilterMaxVolume)
185 LAMEXP_MAKE_OPTION_I(normalizationFilterSize)
186 LAMEXP_MAKE_OPTION_I(opusComplexity)
187 LAMEXP_MAKE_OPTION_B(opusDisableResample)
188 LAMEXP_MAKE_OPTION_I(opusFramesize)
189 LAMEXP_MAKE_OPTION_I(opusOptimizeFor)
190 LAMEXP_MAKE_OPTION_S(outputDir)
191 LAMEXP_MAKE_OPTION_B(outputToSourceDir)
192 LAMEXP_MAKE_OPTION_I(overwriteMode)
193 LAMEXP_MAKE_OPTION_B(prependRelativeSourcePath)
194 LAMEXP_MAKE_OPTION_B(renameOutputFilesEnabled)
195 LAMEXP_MAKE_OPTION_S(renameOutputFilesPattern)
196 LAMEXP_MAKE_OPTION_I(samplingRate)
197 LAMEXP_MAKE_OPTION_B(shellIntegrationEnabled)
198 LAMEXP_MAKE_OPTION_B(slowStartup)
199 LAMEXP_MAKE_OPTION_B(soundsEnabled)
200 LAMEXP_MAKE_OPTION_I(toneAdjustBass)
201 LAMEXP_MAKE_OPTION_I(toneAdjustTreble)
202 LAMEXP_MAKE_OPTION_B(writeMetaTags)
209 SettingsModel(const SettingsModel &other) {}
210 SettingsModel &operator=(const SettingsModel &other) { return *this; }
212 QString initDirectory(const QString &path) const;
213 QString defaultLanguage(void) const;
214 QString defaultDirectory(void) const;
216 SettingsCache *m_configCache;
218 mutable QMutex m_defaultLangLock;
219 mutable QScopedPointer<QString> m_defaultLanguage;
222 ///////////////////////////////////////////////////////////////////////////////
224 #undef LAMEXP_MAKE_OPTION_I
225 #undef LAMEXP_MAKE_OPTION_S
226 #undef LAMEXP_MAKE_OPTION_B
227 #undef LAMEXP_MAKE_OPTION_U