OSDN Git Service

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