Actually make RegExp-based file renaming work.
[LameXP.git] / src / Model_Settings.h
blob6b469c03f1a028a0dcf27f75ca25f613b2a8a6dc
1 ///////////////////////////////////////////////////////////////////////////////
2 // LameXP - Audio Encoder Front-End
3 // Copyright (C) 2004-2015 LoRd_MuldeR <MuldeR2@GMX.de>
4 //
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 ///////////////////////////////////////////////////////////////////////////////
23 #pragma once
25 #include <QMutex>
26 #include <QScopedPointer>
28 class QString;
29 class SettingsCache;
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 ///////////////////////////////////////////////////////////////////////////////
55 class SettingsModel
57 public:
58 SettingsModel(void);
59 ~SettingsModel(void);
61 //Enums
62 enum Encoder
64 MP3Encoder = 0,
65 VorbisEncoder = 1,
66 AACEncoder = 2,
67 AC3Encoder = 3,
68 FLACEncoder = 4,
69 OpusEncoder = 5,
70 DCAEncoder = 6,
71 MACEncoder = 7,
72 PCMEncoder = 8,
73 ENCODER_COUNT = 9
76 enum RCMode
78 VBRMode = 0,
79 ABRMode = 1,
80 CBRMode = 2,
81 RCMODE_COUNT = 3
84 enum Overwrite
86 Overwrite_KeepBoth = 0,
87 Overwrite_SkipFile = 1,
88 Overwrite_Replaces = 2
91 enum AACEncoderType
93 AAC_ENCODER_NONE = 0,
94 AAC_ENCODER_NERO = 1,
95 AAC_ENCODER_FHG = 2,
96 AAC_ENCODER_FDK = 3,
97 AAC_ENCODER_QAAC = 4,
100 //Consts
101 static const int samplingRates[8];
103 //Getters & setters
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_I(lameAlgoQuality)
175 LAMEXP_MAKE_OPTION_I(lameChannelMode)
176 LAMEXP_MAKE_OPTION_I(licenseAccepted)
177 LAMEXP_MAKE_OPTION_U(maximumInstances)
178 LAMEXP_MAKE_OPTION_U(metaInfoPosition)
179 LAMEXP_MAKE_OPTION_S(mostRecentInputPath)
180 LAMEXP_MAKE_OPTION_B(neroAACEnable2Pass)
181 LAMEXP_MAKE_OPTION_B(neroAacNotificationsEnabled)
182 LAMEXP_MAKE_OPTION_B(normalizationFilterEnabled)
183 LAMEXP_MAKE_OPTION_B(normalizationFilterDynamic)
184 LAMEXP_MAKE_OPTION_B(normalizationFilterCoupled)
185 LAMEXP_MAKE_OPTION_I(normalizationFilterMaxVolume)
186 LAMEXP_MAKE_OPTION_I(normalizationFilterSize)
187 LAMEXP_MAKE_OPTION_I(opusComplexity)
188 LAMEXP_MAKE_OPTION_B(opusDisableResample)
189 LAMEXP_MAKE_OPTION_I(opusFramesize)
190 LAMEXP_MAKE_OPTION_I(opusOptimizeFor)
191 LAMEXP_MAKE_OPTION_S(outputDir)
192 LAMEXP_MAKE_OPTION_B(outputToSourceDir)
193 LAMEXP_MAKE_OPTION_I(overwriteMode)
194 LAMEXP_MAKE_OPTION_B(prependRelativeSourcePath)
195 LAMEXP_MAKE_OPTION_B(renameFiles_regExpEnabled)
196 LAMEXP_MAKE_OPTION_S(renameFiles_regExpSearch)
197 LAMEXP_MAKE_OPTION_S(renameFiles_regExpReplace)
198 LAMEXP_MAKE_OPTION_B(renameFiles_renameEnabled)
199 LAMEXP_MAKE_OPTION_S(renameFiles_renamePattern)
200 LAMEXP_MAKE_OPTION_I(samplingRate)
201 LAMEXP_MAKE_OPTION_B(shellIntegrationEnabled)
202 LAMEXP_MAKE_OPTION_B(slowStartup)
203 LAMEXP_MAKE_OPTION_B(soundsEnabled)
204 LAMEXP_MAKE_OPTION_I(toneAdjustBass)
205 LAMEXP_MAKE_OPTION_I(toneAdjustTreble)
206 LAMEXP_MAKE_OPTION_B(writeMetaTags)
208 //Misc
209 void validate(void);
210 void syncNow(void);
212 private:
213 SettingsModel(const SettingsModel &other) {}
214 SettingsModel &operator=(const SettingsModel &other) { return *this; }
216 QString initDirectory(const QString &path) const;
217 QString defaultLanguage(void) const;
218 QString defaultDirectory(void) const;
220 SettingsCache *m_configCache;
222 mutable QMutex m_defaultLangLock;
223 mutable QScopedPointer<QString> m_defaultLanguage;
226 ///////////////////////////////////////////////////////////////////////////////
228 #undef LAMEXP_MAKE_OPTION_I
229 #undef LAMEXP_MAKE_OPTION_S
230 #undef LAMEXP_MAKE_OPTION_B
231 #undef LAMEXP_MAKE_OPTION_U