OSDN Git Service

Fixed a copy&paste bug that cause the output directory to be reset when actually...
[lamexp/LameXP.git] / src / Model_Settings.cpp
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.
14 //
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.
18 //
19 // http://www.gnu.org/licenses/gpl-2.0.txt
20 ///////////////////////////////////////////////////////////////////////////////
21
22 #include "Model_Settings.h"
23
24 #include "Global.h"
25
26 #include <QSettings>
27 #include <QDesktopServices>
28 #include <QApplication>
29 #include <QString>
30 #include <QFileInfo>
31 #include <QDir>
32 #include <QStringList>
33 #include <QLocale>
34 #include <QRegExp>
35 #include <QReadWriteLock>
36 #include <QReadLocker>
37 #include <QWriteLocker>
38
39 ////////////////////////////////////////////////////////////
40 //Macros
41 ////////////////////////////////////////////////////////////
42
43 #define LAMEXP_MAKE_OPTION_I(OPT,DEF) \
44 int SettingsModel::OPT(void) const { return m_settings->value(g_settingsId_##OPT, DEF).toInt(); } \
45 void SettingsModel::OPT(int value) { m_settings->setValue(g_settingsId_##OPT, value); } \
46 int SettingsModel::OPT##Default(void) { return DEF; }
47
48 #define LAMEXP_MAKE_OPTION_S(OPT,DEF) \
49 QString SettingsModel::OPT(void) const { return m_settings->value(g_settingsId_##OPT, DEF).toString().trimmed(); } \
50 void SettingsModel::OPT(const QString &value) { m_settings->setValue(g_settingsId_##OPT, value); } \
51 QString SettingsModel::OPT##Default(void) { return DEF; }
52
53 #define LAMEXP_MAKE_OPTION_B(OPT,DEF) \
54 bool SettingsModel::OPT(void) const { return m_settings->value(g_settingsId_##OPT, DEF).toBool(); } \
55 void SettingsModel::OPT(bool value) { m_settings->setValue(g_settingsId_##OPT, value); } \
56 bool SettingsModel::OPT##Default(void) { return DEF; }
57
58 #define LAMEXP_MAKE_OPTION_U(OPT,DEF) \
59 unsigned int SettingsModel::OPT(void) const { return m_settings->value(g_settingsId_##OPT, DEF).toUInt(); } \
60 void SettingsModel::OPT(unsigned int value) { m_settings->setValue(g_settingsId_##OPT, value); } \
61 unsigned int SettingsModel::OPT##Default(void) { return DEF; }
62
63 #define LAMEXP_MAKE_ID(DEC,STR) static const char *g_settingsId_##DEC = STR
64 #define REMOVE_GROUP(OBJ,ID) OBJ->beginGroup(ID); OBJ->remove(""); OBJ->endGroup();
65
66 #define DIR_EXISTS(PATH) (QFileInfo(PATH).exists() && QFileInfo(PATH).isDir())
67
68 ////////////////////////////////////////////////////////////
69 //Constants
70 ////////////////////////////////////////////////////////////
71
72 //Setting ID's
73 LAMEXP_MAKE_ID(aacEncProfile, "AdvancedOptions/AACEnc/ForceProfile");
74 LAMEXP_MAKE_ID(aftenAudioCodingMode, "AdvancedOptions/Aften/AudioCodingMode");
75 LAMEXP_MAKE_ID(aftenDynamicRangeCompression, "AdvancedOptions/Aften/DynamicRangeCompression");
76 LAMEXP_MAKE_ID(aftenExponentSearchSize, "AdvancedOptions/Aften/ExponentSearchSize");
77 LAMEXP_MAKE_ID(aftenFastBitAllocation, "AdvancedOptions/Aften/FastBitAllocation");
78 LAMEXP_MAKE_ID(antivirNotificationsEnabled, "Flags/EnableAntivirusNotifications");
79 LAMEXP_MAKE_ID(autoUpdateCheckBeta, "AutoUpdate/CheckForBetaVersions");
80 LAMEXP_MAKE_ID(autoUpdateEnabled, "AutoUpdate/Enabled");
81 LAMEXP_MAKE_ID(autoUpdateLastCheck, "AutoUpdate/LastCheck");
82 LAMEXP_MAKE_ID(bitrateManagementEnabled, "AdvancedOptions/BitrateManagement/Enabled");
83 LAMEXP_MAKE_ID(bitrateManagementMaxRate, "AdvancedOptions/BitrateManagement/MaxRate");
84 LAMEXP_MAKE_ID(bitrateManagementMinRate, "AdvancedOptions/BitrateManagement/MinRate");
85 LAMEXP_MAKE_ID(compressionBitrateAacEnc, "Compression/Bitrate/AacEnc");
86 LAMEXP_MAKE_ID(compressionBitrateAften, "Compression/Bitrate/Aften");
87 LAMEXP_MAKE_ID(compressionBitrateDcaEnc, "Compression/Bitrate/DcaEnc");
88 LAMEXP_MAKE_ID(compressionBitrateLAME, "Compression/Bitrate/LAME");
89 LAMEXP_MAKE_ID(compressionBitrateOggEnc, "Compression/Bitrate/OggEnc");
90 LAMEXP_MAKE_ID(compressionBitrateOpusEnc, "Compression/Bitrate/OpusEnc");
91 LAMEXP_MAKE_ID(compressionEncoder, "Compression/Encoder");
92 LAMEXP_MAKE_ID(compressionRCModeAacEnc, "Compression/RCMode/AacEnc");
93 LAMEXP_MAKE_ID(compressionRCModeAften, "Compression/RCMode/Aften");
94 LAMEXP_MAKE_ID(compressionRCModeLAME, "Compression/RCMode/LAME");
95 LAMEXP_MAKE_ID(compressionRCModeOggEnc, "Compression/RCMode/OggEnc");
96 LAMEXP_MAKE_ID(compressionRCModeOpusEnc, "Compression/RCMode/OpusEnc");
97 LAMEXP_MAKE_ID(compressionVbrLevelAacEnc, "Compression/VbrLevel/AacEnc");
98 LAMEXP_MAKE_ID(compressionVbrLevelAften, "Compression/VbrLevel/Aften");
99 LAMEXP_MAKE_ID(compressionVbrLevelFLAC, "Compression/VbrLevel/FLAC");
100 LAMEXP_MAKE_ID(compressionVbrLevelLAME, "Compression/VbrLevel/LAME");
101 LAMEXP_MAKE_ID(compressionVbrLevelOggEnc, "Compression/VbrLevel/OggEnc");
102 LAMEXP_MAKE_ID(createPlaylist, "Flags/AutoCreatePlaylist");
103 LAMEXP_MAKE_ID(currentLanguage, "Localization/Language");
104 LAMEXP_MAKE_ID(currentLanguageFile, "Localization/UseQMFile");
105 LAMEXP_MAKE_ID(customParametersAacEnc, "AdvancedOptions/CustomParameters/AacEnc");
106 LAMEXP_MAKE_ID(customParametersAften, "AdvancedOptions/CustomParameters/Aften");
107 LAMEXP_MAKE_ID(customParametersFLAC, "AdvancedOptions/CustomParameters/FLAC");
108 LAMEXP_MAKE_ID(customParametersLAME, "AdvancedOptions/CustomParameters/LAME");
109 LAMEXP_MAKE_ID(customParametersOggEnc, "AdvancedOptions/CustomParameters/OggEnc");
110 LAMEXP_MAKE_ID(customParametersOpus, "AdvancedOptions/CustomParameters/OpusEnc");
111 LAMEXP_MAKE_ID(customTempPath, "AdvancedOptions/TempDirectory/CustomPath");
112 LAMEXP_MAKE_ID(customTempPathEnabled, "AdvancedOptions/TempDirectory/UseCustomPath");
113 LAMEXP_MAKE_ID(dropBoxWidgetEnabled, "Flags/EnableDropBoxWidget");
114 LAMEXP_MAKE_ID(favoriteOutputFolders, "OutputDirectory/Favorites");
115 LAMEXP_MAKE_ID(forceStereoDownmix, "AdvancedOptions/StereoDownmix/Force");
116 LAMEXP_MAKE_ID(hibernateComputer, "AdvancedOptions/HibernateComputerOnShutdown");
117 LAMEXP_MAKE_ID(interfaceStyle, "InterfaceStyle");
118 LAMEXP_MAKE_ID(lameAlgoQuality, "AdvancedOptions/LAME/AlgorithmQuality");
119 LAMEXP_MAKE_ID(lameChannelMode, "AdvancedOptions/LAME/ChannelMode");
120 LAMEXP_MAKE_ID(licenseAccepted, "LicenseAccepted");
121 LAMEXP_MAKE_ID(maximumInstances, "AdvancedOptions/Threading/MaximumInstances");
122 LAMEXP_MAKE_ID(metaInfoPosition, "MetaInformation/PlaylistPosition");
123 LAMEXP_MAKE_ID(mostRecentInputPath, "InputDirectory/MostRecentPath");
124 LAMEXP_MAKE_ID(neroAACEnable2Pass, "AdvancedOptions/AACEnc/Enable2Pass");
125 LAMEXP_MAKE_ID(neroAacNotificationsEnabled, "Flags/EnableNeroAacNotifications");
126 LAMEXP_MAKE_ID(normalizationFilterEnabled, "AdvancedOptions/VolumeNormalization/Enabled");
127 LAMEXP_MAKE_ID(normalizationFilterEqualizationMode, "AdvancedOptions/VolumeNormalization/EqualizationMode");
128 LAMEXP_MAKE_ID(normalizationFilterMaxVolume, "AdvancedOptions/VolumeNormalization/MaxVolume");
129 LAMEXP_MAKE_ID(opusComplexity, "AdvancedOptions/Opus/EncodingComplexity");
130 LAMEXP_MAKE_ID(opusDisableResample, "AdvancedOptions/Opus/DisableResample");
131 LAMEXP_MAKE_ID(opusFramesize, "AdvancedOptions/Opus/FrameSize");
132 LAMEXP_MAKE_ID(opusOptimizeFor, "AdvancedOptions/Opus/OptimizeForSignalType");
133 LAMEXP_MAKE_ID(outputDir, "OutputDirectory/SelectedPath");
134 LAMEXP_MAKE_ID(outputToSourceDir, "OutputDirectory/OutputToSourceFolder");
135 LAMEXP_MAKE_ID(overwriteMode, "AdvancedOptions/OverwriteMode");
136 LAMEXP_MAKE_ID(prependRelativeSourcePath, "OutputDirectory/PrependRelativeSourcePath");
137 LAMEXP_MAKE_ID(renameOutputFilesEnabled, "AdvancedOptions/RenameOutputFiles/Enabled");
138 LAMEXP_MAKE_ID(renameOutputFilesPattern, "AdvancedOptions/RenameOutputFiles/Pattern");
139 LAMEXP_MAKE_ID(samplingRate, "AdvancedOptions/Common/Resampling");
140 LAMEXP_MAKE_ID(shellIntegrationEnabled, "Flags/EnableShellIntegration");
141 LAMEXP_MAKE_ID(slowStartup, "Flags/SlowStartupDetected");
142 LAMEXP_MAKE_ID(soundsEnabled, "Flags/EnableSounds");
143 LAMEXP_MAKE_ID(toneAdjustBass, "AdvancedOptions/ToneAdjustment/Bass");
144 LAMEXP_MAKE_ID(toneAdjustTreble, "AdvancedOptions/ToneAdjustment/Treble");
145 LAMEXP_MAKE_ID(versionNumber, "VersionNumber");
146 LAMEXP_MAKE_ID(writeMetaTags, "Flags/WriteMetaTags");
147
148 //LUT
149 const int SettingsModel::mp3Bitrates[15] = {32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, -1};
150 const int SettingsModel::ac3Bitrates[20] = {32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 448, 512, 576, 640, -1};
151 const int SettingsModel::samplingRates[8] = {0, 16000, 22050, 24000, 32000, 44100, 48000, -1};
152
153 static QReadWriteLock s_lock;
154
155 ////////////////////////////////////////////////////////////
156 // Constructor
157 ////////////////////////////////////////////////////////////
158
159 SettingsModel::SettingsModel(void)
160 {
161         QString configPath = "LameXP.ini";
162         
163         if(!lamexp_portable_mode())
164         {
165                 QString dataPath = initDirectory(QDesktopServices::storageLocation(QDesktopServices::DataLocation));
166                 if(!dataPath.isEmpty())
167                 {
168                         configPath = QString("%1/config.ini").arg(QDir(dataPath).canonicalPath());
169                 }
170                 else
171                 {
172                         qWarning("SettingsModel: DataLocation could not be initialized!");
173                         dataPath = initDirectory(QDesktopServices::storageLocation(QDesktopServices::HomeLocation));
174                         if(!dataPath.isEmpty())
175                         {
176                                 configPath = QString("%1/LameXP.ini").arg(QDir(dataPath).canonicalPath());
177                         }
178                 }
179         }
180         else
181         {
182                 qDebug("LameXP is running in \"portable\" mode -> config in application dir!\n");
183                 QString appPath = QFileInfo(QApplication::applicationFilePath()).canonicalFilePath();
184                 if(appPath.isEmpty())
185                 {
186                         appPath = QFileInfo(QApplication::applicationFilePath()).absoluteFilePath();
187                 }
188                 if(QFileInfo(appPath).exists() && QFileInfo(appPath).isFile())
189                 {
190                         configPath = QString("%1/%2.ini").arg(QFileInfo(appPath).absolutePath(), QFileInfo(appPath).completeBaseName());
191                 }
192         }
193
194         m_settings = new QSettings(configPath, QSettings::IniFormat);
195         const QString groupKey = QString().sprintf("LameXP_%u%02u%05u", lamexp_version_major(), lamexp_version_minor(), lamexp_version_confg());
196         QStringList childGroups = m_settings->childGroups();
197
198         while(!childGroups.isEmpty())
199         {
200                 QString current = childGroups.takeFirst();
201                 QRegExp filter("^LameXP_(\\d+)(\\d\\d)(\\d\\d\\d\\d\\d)$");
202                 if(filter.indexIn(current) >= 0)
203                 {
204                         bool ok = false;
205                         unsigned int temp = filter.cap(3).toUInt(&ok) + 10;
206                         if(ok && (temp >= lamexp_version_confg()))
207                         {
208                                 continue;
209                         }
210                 }
211                 qWarning("Deleting obsolete group from config: %s", current.toUtf8().constData());
212                 REMOVE_GROUP(m_settings, current);
213         }
214
215         m_settings->beginGroup(groupKey);
216         m_settings->setValue(g_settingsId_versionNumber, QApplication::applicationVersion());
217         m_settings->sync();
218
219         const bool isDefined = m_settings->contains(g_settingsId_outputDir);
220         qWarning("Value '%s' is currently: %s\n", g_settingsId_outputDir, (isDefined ? "defined" : "un-defined"));
221         if(isDefined)
222         {
223                 qWarning("It's value is:\n%s\n", m_settings->value(g_settingsId_outputDir).toString().toUtf8().constData());
224         }
225         qWarning("Current output directory is:\n%s\n", outputDir().toUtf8().constData());
226 }
227
228 ////////////////////////////////////////////////////////////
229 // Destructor
230 ////////////////////////////////////////////////////////////
231
232 SettingsModel::~SettingsModel(void)
233 {
234         LAMEXP_DELETE(m_settings);
235         LAMEXP_DELETE(m_defaultLanguage);
236 }
237
238 ////////////////////////////////////////////////////////////
239 // Public Functions
240 ////////////////////////////////////////////////////////////
241
242 #define CHECK_RCMODE(NAME) do\
243 { \
244         if(this->compressionRCMode##NAME() < SettingsModel::VBRMode || this->compressionRCMode##NAME() >= SettingsModel::RCMODE_COUNT) \
245         { \
246                 this->compressionRCMode##NAME(SettingsModel::VBRMode); \
247         } \
248 } \
249 while(0)
250
251 void SettingsModel::validate(void)
252 {
253         if(this->compressionEncoder() < SettingsModel::MP3Encoder || this->compressionEncoder() >= SettingsModel::ENCODER_COUNT)
254         {
255                 this->compressionEncoder(SettingsModel::MP3Encoder);
256         }
257         
258         CHECK_RCMODE(LAME);
259         CHECK_RCMODE(OggEnc);
260         CHECK_RCMODE(AacEnc);
261         CHECK_RCMODE(Aften);
262         CHECK_RCMODE(OpusEnc);
263         
264         if(!(lamexp_check_tool("neroAacEnc.exe") && lamexp_check_tool("neroAacDec.exe") && lamexp_check_tool("neroAacTag.exe")))
265         {
266                 if(!(lamexp_check_tool("fhgaacenc.exe") && lamexp_check_tool("enc_fhgaac.dll")))
267                 {
268                         if(!(lamexp_check_tool("qaac.exe") && lamexp_check_tool("libsoxrate.dll")))
269                         {
270                                 if(this->compressionEncoder() == SettingsModel::AACEncoder)
271                                 {
272                                         qWarning("AAC encoder selected, but not available any more. Reverting to MP3!");
273                                         this->compressionEncoder(SettingsModel::MP3Encoder);
274                                 }
275                         }
276                 }
277         }
278         
279         if(this->outputDir().isEmpty() || (!DIR_EXISTS(this->outputDir())))
280         {
281                 qWarning("Output directory not set yet or does NOT exist anymore -> Resetting");
282                 this->outputDir(defaultDirectory());
283         }
284
285         if(this->mostRecentInputPath().isEmpty() || (!DIR_EXISTS(this->mostRecentInputPath())))
286         {
287                 qWarning("Most recent input directory not set yet or does NOT exist anymore -> Resetting");
288                 this->mostRecentInputPath(defaultDirectory());
289         }
290
291         if(!this->currentLanguageFile().isEmpty())
292         {
293                 const QString qmPath = QFileInfo(this->currentLanguageFile()).canonicalFilePath();
294                 if(qmPath.isEmpty() || (!(QFileInfo(qmPath).exists() && QFileInfo(qmPath).isFile() && (QFileInfo(qmPath).suffix().compare("qm", Qt::CaseInsensitive) == 0))))
295                 {
296                         qWarning("Current language file missing, reverting to built-in translator!");
297                         this->currentLanguageFile(QString());
298                 }
299         }
300
301         if(!lamexp_query_translations().contains(this->currentLanguage(), Qt::CaseInsensitive))
302         {
303                 qWarning("Current language \"%s\" is unknown, reverting to default language!", this->currentLanguage().toLatin1().constData());
304                 this->currentLanguage(defaultLanguage());
305         }
306
307         if(this->hibernateComputer())
308         {
309                 if(!lamexp_is_hibernation_supported())
310                 {
311                         this->hibernateComputer(false);
312                 }
313         }
314
315         if(this->overwriteMode() < SettingsModel::Overwrite_KeepBoth || this->overwriteMode() > SettingsModel::Overwrite_Replaces)
316         {
317                 this->overwriteMode(SettingsModel::Overwrite_KeepBoth);
318         }
319
320 }
321
322 void SettingsModel::syncNow(void)
323 {
324         m_settings->sync();
325 }
326
327 ////////////////////////////////////////////////////////////
328 // Private Functions
329 ////////////////////////////////////////////////////////////
330
331 QString *SettingsModel::m_defaultLanguage = NULL;
332
333 QString SettingsModel::defaultLanguage(void) const
334 {
335         QReadLocker readLock(&s_lock);
336         
337         if(m_defaultLanguage)
338         {
339                 return *m_defaultLanguage;
340         }
341         
342         //Acquire write lock now
343         readLock.unlock();
344         QWriteLocker writeLock(&s_lock);
345         
346         //Detect system langauge
347         QLocale systemLanguage= QLocale::system();
348         qDebug("[Locale]");
349         qDebug("Language: %s (%d)", QLocale::languageToString(systemLanguage.language()).toUtf8().constData(), systemLanguage.language());
350         qDebug("Country is: %s (%d)", QLocale::countryToString(systemLanguage.country()).toUtf8().constData(), systemLanguage.country());
351         qDebug("Script is: %s (%d)\n", QLocale::scriptToString(systemLanguage.script()).toUtf8().constData(), systemLanguage.script());
352
353         //Check if we can use the default translation
354         if(systemLanguage.language() == QLocale::English /*|| systemLanguage.language() == QLocale::C*/)
355         {
356                 m_defaultLanguage = new QString(LAMEXP_DEFAULT_LANGID);
357                 return LAMEXP_DEFAULT_LANGID;
358         }
359
360         //Try to find a suitable translation for the user's system language *and* country
361         QStringList languages = lamexp_query_translations();
362         while(!languages.isEmpty())
363         {
364                 QString currentLangId = languages.takeFirst();
365                 if(lamexp_translation_sysid(currentLangId) == systemLanguage.language())
366                 {
367                         if(lamexp_translation_country(currentLangId) == systemLanguage.country())
368                         {
369                                 m_defaultLanguage = new QString(currentLangId);
370                                 return currentLangId;
371                         }
372                 }
373         }
374
375         //Try to find a suitable translation for the user's system language
376         languages = lamexp_query_translations();
377         while(!languages.isEmpty())
378         {
379                 QString currentLangId = languages.takeFirst();
380                 if(lamexp_translation_sysid(currentLangId) == systemLanguage.language())
381                 {
382                         m_defaultLanguage = new QString(currentLangId);
383                         return currentLangId;
384                 }
385         }
386
387         //Fall back to the default translation
388         m_defaultLanguage = new QString(LAMEXP_DEFAULT_LANGID);
389         return LAMEXP_DEFAULT_LANGID;
390 }
391
392 QString SettingsModel::defaultDirectory(void) const
393 {
394         QString defaultLocation = initDirectory(QDesktopServices::storageLocation(QDesktopServices::MusicLocation));
395
396         if(defaultLocation.isEmpty())
397         {
398                 defaultLocation = initDirectory(QDesktopServices::storageLocation(QDesktopServices::HomeLocation));
399
400                 if(defaultLocation.isEmpty())
401                 {
402                         defaultLocation = initDirectory(QDir::currentPath());
403                 }
404         }
405
406         return defaultLocation;
407 }
408
409 QString SettingsModel::initDirectory(const QString &path) const
410 {
411         if(path.isEmpty())
412         {
413                 return QString();
414         }
415
416         if(!QDir(path).exists())
417         {
418                 for(int i = 0; i < 32; i++)
419                 {
420                         if(QDir(path).mkpath(".")) break;
421                         Sleep(1);
422                 }
423         }
424
425         if(!QDir(path).exists())
426         {
427                 return QString();
428         }
429         
430         return QDir(path).canonicalPath();
431 }
432
433 ////////////////////////////////////////////////////////////
434 // Getter and Setter
435 ////////////////////////////////////////////////////////////
436
437 LAMEXP_MAKE_OPTION_I(aacEncProfile, 0)
438 LAMEXP_MAKE_OPTION_I(aftenAudioCodingMode, 0)
439 LAMEXP_MAKE_OPTION_I(aftenDynamicRangeCompression, 5)
440 LAMEXP_MAKE_OPTION_I(aftenExponentSearchSize, 8)
441 LAMEXP_MAKE_OPTION_B(aftenFastBitAllocation, false)
442 LAMEXP_MAKE_OPTION_B(antivirNotificationsEnabled, true)
443 LAMEXP_MAKE_OPTION_B(autoUpdateCheckBeta, false)
444 LAMEXP_MAKE_OPTION_B(autoUpdateEnabled, true)
445 LAMEXP_MAKE_OPTION_S(autoUpdateLastCheck, "Never")
446 LAMEXP_MAKE_OPTION_B(bitrateManagementEnabled, false)
447 LAMEXP_MAKE_OPTION_I(bitrateManagementMaxRate, 500)
448 LAMEXP_MAKE_OPTION_I(bitrateManagementMinRate, 32)
449 LAMEXP_MAKE_OPTION_I(compressionBitrateAacEnc, 20)
450 LAMEXP_MAKE_OPTION_I(compressionBitrateAften, 15)
451 LAMEXP_MAKE_OPTION_I(compressionBitrateDcaEnc, 47)
452 LAMEXP_MAKE_OPTION_I(compressionBitrateLAME, 10)
453 LAMEXP_MAKE_OPTION_I(compressionBitrateOggEnc, 20)
454 LAMEXP_MAKE_OPTION_I(compressionBitrateOpusEnc, 16)
455 LAMEXP_MAKE_OPTION_I(compressionEncoder, 0)
456 LAMEXP_MAKE_OPTION_I(compressionRCModeAacEnc, 0)
457 LAMEXP_MAKE_OPTION_I(compressionRCModeAften, 0)
458 LAMEXP_MAKE_OPTION_I(compressionRCModeLAME, 0)
459 LAMEXP_MAKE_OPTION_I(compressionRCModeOggEnc, 0)
460 LAMEXP_MAKE_OPTION_I(compressionRCModeOpusEnc, 0)
461 LAMEXP_MAKE_OPTION_I(compressionVbrLevelAacEnc, 10)
462 LAMEXP_MAKE_OPTION_I(compressionVbrLevelAften, 8)
463 LAMEXP_MAKE_OPTION_I(compressionVbrLevelFLAC, 8)
464 LAMEXP_MAKE_OPTION_I(compressionVbrLevelLAME, 7)
465 LAMEXP_MAKE_OPTION_I(compressionVbrLevelOggEnc, 5)
466 LAMEXP_MAKE_OPTION_B(createPlaylist, true)
467 LAMEXP_MAKE_OPTION_S(currentLanguage, defaultLanguage())
468 LAMEXP_MAKE_OPTION_S(currentLanguageFile, QString())
469 LAMEXP_MAKE_OPTION_S(customParametersAacEnc, QString())
470 LAMEXP_MAKE_OPTION_S(customParametersAften, QString())
471 LAMEXP_MAKE_OPTION_S(customParametersFLAC, QString())
472 LAMEXP_MAKE_OPTION_S(customParametersLAME, QString())
473 LAMEXP_MAKE_OPTION_S(customParametersOggEnc, QString())
474 LAMEXP_MAKE_OPTION_S(customParametersOpus, QString())
475 LAMEXP_MAKE_OPTION_S(customTempPath, QDesktopServices::storageLocation(QDesktopServices::TempLocation))
476 LAMEXP_MAKE_OPTION_B(customTempPathEnabled, false)
477 LAMEXP_MAKE_OPTION_B(dropBoxWidgetEnabled, true)
478 LAMEXP_MAKE_OPTION_S(favoriteOutputFolders, QString())
479 LAMEXP_MAKE_OPTION_B(forceStereoDownmix, false)
480 LAMEXP_MAKE_OPTION_B(hibernateComputer, false)
481 LAMEXP_MAKE_OPTION_I(interfaceStyle, 0)
482 LAMEXP_MAKE_OPTION_I(lameAlgoQuality, 2)
483 LAMEXP_MAKE_OPTION_I(lameChannelMode, 0)
484 LAMEXP_MAKE_OPTION_I(licenseAccepted, 0)
485 LAMEXP_MAKE_OPTION_U(maximumInstances, 0)
486 LAMEXP_MAKE_OPTION_U(metaInfoPosition, UINT_MAX)
487 LAMEXP_MAKE_OPTION_S(mostRecentInputPath, defaultDirectory())
488 LAMEXP_MAKE_OPTION_B(neroAACEnable2Pass, true)
489 LAMEXP_MAKE_OPTION_B(neroAacNotificationsEnabled, true)
490 LAMEXP_MAKE_OPTION_B(normalizationFilterEnabled, false)
491 LAMEXP_MAKE_OPTION_I(normalizationFilterEqualizationMode, 0)
492 LAMEXP_MAKE_OPTION_I(normalizationFilterMaxVolume, -50)
493 LAMEXP_MAKE_OPTION_I(opusComplexity, 10)
494 LAMEXP_MAKE_OPTION_B(opusDisableResample, false)
495 LAMEXP_MAKE_OPTION_I(opusFramesize, 3)
496 LAMEXP_MAKE_OPTION_I(opusOptimizeFor, 0)
497 LAMEXP_MAKE_OPTION_S(outputDir, defaultDirectory())
498 LAMEXP_MAKE_OPTION_B(outputToSourceDir, false)
499 LAMEXP_MAKE_OPTION_I(overwriteMode, Overwrite_KeepBoth)
500 LAMEXP_MAKE_OPTION_B(prependRelativeSourcePath, false)
501 LAMEXP_MAKE_OPTION_B(renameOutputFilesEnabled, false)
502 LAMEXP_MAKE_OPTION_S(renameOutputFilesPattern, "[<TrackNo>] <Artist> - <Title>")
503 LAMEXP_MAKE_OPTION_I(samplingRate, 0)
504 LAMEXP_MAKE_OPTION_B(shellIntegrationEnabled, !lamexp_portable_mode())
505 LAMEXP_MAKE_OPTION_B(slowStartup, false)
506 LAMEXP_MAKE_OPTION_B(soundsEnabled, true)
507 LAMEXP_MAKE_OPTION_I(toneAdjustBass, 0)
508 LAMEXP_MAKE_OPTION_I(toneAdjustTreble, 0)
509 LAMEXP_MAKE_OPTION_B(writeMetaTags, true)