Properly detect Windows 8, now that Qt supports it officially.
[LameXP.git] / src / Model_Settings.h
blob0bf6a2c410469630fed439f0bdf120be6e0a0e76
1 ///////////////////////////////////////////////////////////////////////////////
2 // LameXP - Audio Encoder Front-End
3 // Copyright (C) 2004-2013 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.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License along
16 // with this program; if not, write to the Free Software Foundation, Inc.,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 // http://www.gnu.org/licenses/gpl-2.0.txt
20 ///////////////////////////////////////////////////////////////////////////////
22 #pragma once
24 class QString;
25 class SettingsCache;
27 ///////////////////////////////////////////////////////////////////////////////
29 #define LAMEXP_MAKE_OPTION_I(OPT) \
30 int OPT(void) const; \
31 void OPT(int value); \
32 int OPT##Default(void);
34 #define LAMEXP_MAKE_OPTION_S(OPT) \
35 QString OPT(void) const; \
36 void OPT(const QString &value); \
37 QString OPT##Default(void);
39 #define LAMEXP_MAKE_OPTION_B(OPT) \
40 bool OPT(void) const; \
41 void OPT(bool value); \
42 bool OPT##Default(void);
44 #define LAMEXP_MAKE_OPTION_U(OPT) \
45 unsigned int OPT(void) const; \
46 void OPT(unsigned int value); \
47 unsigned int OPT##Default(void);
49 ///////////////////////////////////////////////////////////////////////////////
51 class SettingsModel
53 public:
54 SettingsModel(void);
55 ~SettingsModel(void);
57 //Enums
58 enum Encoder
60 MP3Encoder = 0,
61 VorbisEncoder = 1,
62 AACEncoder = 2,
63 AC3Encoder = 3,
64 FLACEncoder = 4,
65 OpusEncoder = 5,
66 DCAEncoder = 6,
67 PCMEncoder = 7,
68 ENCODER_COUNT = 8
71 enum RCMode
73 VBRMode = 0,
74 ABRMode = 1,
75 CBRMode = 2,
76 RCMODE_COUNT = 3
79 enum Overwrite
81 Overwrite_KeepBoth = 0,
82 Overwrite_SkipFile = 1,
83 Overwrite_Replaces = 2
86 enum AACEncoderType
88 AAC_ENCODER_NONE = 0,
89 AAC_ENCODER_NERO = 1,
90 AAC_ENCODER_FHG = 2,
91 AAC_ENCODER_QAAC = 3,
94 //Consts
95 static const int samplingRates[8];
97 //Getters & setters
98 LAMEXP_MAKE_OPTION_I(aacEncProfile)
99 LAMEXP_MAKE_OPTION_I(aftenAudioCodingMode)
100 LAMEXP_MAKE_OPTION_I(aftenDynamicRangeCompression)
101 LAMEXP_MAKE_OPTION_I(aftenExponentSearchSize)
102 LAMEXP_MAKE_OPTION_B(aftenFastBitAllocation)
103 LAMEXP_MAKE_OPTION_B(antivirNotificationsEnabled)
104 LAMEXP_MAKE_OPTION_B(autoUpdateCheckBeta)
105 LAMEXP_MAKE_OPTION_B(autoUpdateEnabled)
106 LAMEXP_MAKE_OPTION_S(autoUpdateLastCheck)
107 LAMEXP_MAKE_OPTION_B(bitrateManagementEnabled)
108 LAMEXP_MAKE_OPTION_I(bitrateManagementMaxRate)
109 LAMEXP_MAKE_OPTION_I(bitrateManagementMinRate)
110 LAMEXP_MAKE_OPTION_I(compressionAbrBitrateAacEnc)
111 LAMEXP_MAKE_OPTION_I(compressionAbrBitrateAften)
112 LAMEXP_MAKE_OPTION_I(compressionAbrBitrateDcaEnc)
113 LAMEXP_MAKE_OPTION_I(compressionAbrBitrateFLAC)
114 LAMEXP_MAKE_OPTION_I(compressionAbrBitrateLAME)
115 LAMEXP_MAKE_OPTION_I(compressionAbrBitrateOggEnc)
116 LAMEXP_MAKE_OPTION_I(compressionAbrBitrateOpusEnc)
117 LAMEXP_MAKE_OPTION_I(compressionAbrBitrateWave)
118 LAMEXP_MAKE_OPTION_I(compressionCbrBitrateAacEnc)
119 LAMEXP_MAKE_OPTION_I(compressionCbrBitrateAften)
120 LAMEXP_MAKE_OPTION_I(compressionCbrBitrateDcaEnc)
121 LAMEXP_MAKE_OPTION_I(compressionCbrBitrateFLAC)
122 LAMEXP_MAKE_OPTION_I(compressionCbrBitrateLAME)
123 LAMEXP_MAKE_OPTION_I(compressionCbrBitrateOggEnc)
124 LAMEXP_MAKE_OPTION_I(compressionCbrBitrateOpusEnc)
125 LAMEXP_MAKE_OPTION_I(compressionCbrBitrateWave)
126 LAMEXP_MAKE_OPTION_I(compressionEncoder)
127 LAMEXP_MAKE_OPTION_I(compressionRCModeAacEnc)
128 LAMEXP_MAKE_OPTION_I(compressionRCModeAften)
129 LAMEXP_MAKE_OPTION_I(compressionRCModeDcaEnc)
130 LAMEXP_MAKE_OPTION_I(compressionRCModeFLAC)
131 LAMEXP_MAKE_OPTION_I(compressionRCModeLAME)
132 LAMEXP_MAKE_OPTION_I(compressionRCModeOggEnc)
133 LAMEXP_MAKE_OPTION_I(compressionRCModeOpusEnc)
134 LAMEXP_MAKE_OPTION_I(compressionRCModeWave)
135 LAMEXP_MAKE_OPTION_I(compressionVbrQualityAacEnc)
136 LAMEXP_MAKE_OPTION_I(compressionVbrQualityAften)
137 LAMEXP_MAKE_OPTION_I(compressionVbrQualityDcaEnc)
138 LAMEXP_MAKE_OPTION_I(compressionVbrQualityFLAC)
139 LAMEXP_MAKE_OPTION_I(compressionVbrQualityLAME)
140 LAMEXP_MAKE_OPTION_I(compressionVbrQualityOggEnc)
141 LAMEXP_MAKE_OPTION_I(compressionVbrQualityOpusEnc)
142 LAMEXP_MAKE_OPTION_I(compressionVbrQualityWave)
143 LAMEXP_MAKE_OPTION_B(createPlaylist)
144 LAMEXP_MAKE_OPTION_S(currentLanguage)
145 LAMEXP_MAKE_OPTION_S(currentLanguageFile)
146 LAMEXP_MAKE_OPTION_S(customParametersAacEnc)
147 LAMEXP_MAKE_OPTION_S(customParametersAften)
148 LAMEXP_MAKE_OPTION_S(customParametersDcaEnc)
149 LAMEXP_MAKE_OPTION_S(customParametersFLAC)
150 LAMEXP_MAKE_OPTION_S(customParametersLAME)
151 LAMEXP_MAKE_OPTION_S(customParametersOggEnc)
152 LAMEXP_MAKE_OPTION_S(customParametersOpusEnc)
153 LAMEXP_MAKE_OPTION_S(customParametersWave)
154 LAMEXP_MAKE_OPTION_S(customTempPath)
155 LAMEXP_MAKE_OPTION_B(customTempPathEnabled)
156 LAMEXP_MAKE_OPTION_B(dropBoxWidgetEnabled)
157 LAMEXP_MAKE_OPTION_S(favoriteOutputFolders)
158 LAMEXP_MAKE_OPTION_B(forceStereoDownmix)
159 LAMEXP_MAKE_OPTION_B(hibernateComputer)
160 LAMEXP_MAKE_OPTION_I(interfaceStyle)
161 LAMEXP_MAKE_OPTION_I(lameAlgoQuality)
162 LAMEXP_MAKE_OPTION_I(lameChannelMode)
163 LAMEXP_MAKE_OPTION_I(licenseAccepted)
164 LAMEXP_MAKE_OPTION_U(maximumInstances)
165 LAMEXP_MAKE_OPTION_U(metaInfoPosition)
166 LAMEXP_MAKE_OPTION_S(mostRecentInputPath)
167 LAMEXP_MAKE_OPTION_B(neroAACEnable2Pass)
168 LAMEXP_MAKE_OPTION_B(neroAacNotificationsEnabled)
169 LAMEXP_MAKE_OPTION_B(normalizationFilterEnabled)
170 LAMEXP_MAKE_OPTION_I(normalizationFilterEQMode)
171 LAMEXP_MAKE_OPTION_I(normalizationFilterMaxVolume)
172 LAMEXP_MAKE_OPTION_I(opusComplexity)
173 LAMEXP_MAKE_OPTION_B(opusDisableResample)
174 LAMEXP_MAKE_OPTION_I(opusFramesize)
175 LAMEXP_MAKE_OPTION_I(opusOptimizeFor)
176 LAMEXP_MAKE_OPTION_S(outputDir)
177 LAMEXP_MAKE_OPTION_B(outputToSourceDir)
178 LAMEXP_MAKE_OPTION_I(overwriteMode)
179 LAMEXP_MAKE_OPTION_B(prependRelativeSourcePath)
180 LAMEXP_MAKE_OPTION_B(renameOutputFilesEnabled)
181 LAMEXP_MAKE_OPTION_S(renameOutputFilesPattern)
182 LAMEXP_MAKE_OPTION_I(samplingRate)
183 LAMEXP_MAKE_OPTION_B(shellIntegrationEnabled)
184 LAMEXP_MAKE_OPTION_B(slowStartup)
185 LAMEXP_MAKE_OPTION_B(soundsEnabled)
186 LAMEXP_MAKE_OPTION_I(toneAdjustBass)
187 LAMEXP_MAKE_OPTION_I(toneAdjustTreble)
188 LAMEXP_MAKE_OPTION_B(writeMetaTags)
190 //Misc
191 void validate(void);
192 void syncNow(void);
194 private:
195 SettingsCache *m_configCache;
197 QString initDirectory(const QString &path) const;
198 QString defaultLanguage(void) const;
199 QString defaultDirectory(void) const;
201 static QString *m_defaultLanguage;
204 ///////////////////////////////////////////////////////////////////////////////
206 #undef LAMEXP_MAKE_OPTION_I
207 #undef LAMEXP_MAKE_OPTION_S
208 #undef LAMEXP_MAKE_OPTION_B
209 #undef LAMEXP_MAKE_OPTION_U