OSDN Git Service

Switched the method of how the Designer UI file is used in the DropBox class to ...
[lamexp/LameXP.git] / src / Model_Settings.cpp
index c191460..b1403a8 100644 (file)
@@ -1,6 +1,6 @@
 ///////////////////////////////////////////////////////////////////////////////
 // LameXP - Audio Encoder Front-End
-// Copyright (C) 2004-2011 LoRd_MuldeR <MuldeR2@GMX.de>
+// Copyright (C) 2004-2012 LoRd_MuldeR <MuldeR2@GMX.de>
 //
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
 #include <QDir>
 #include <QStringList>
 #include <QLocale>
+#include <QRegExp>
 
 
 ////////////////////////////////////////////////////////////
 //Macros
 ////////////////////////////////////////////////////////////
 
-#define MAKE_OPTION1(OPT,DEF) \
+#define LAMEXP_MAKE_OPTION_I(OPT,DEF) \
 int SettingsModel::OPT(void) { return m_settings->value(g_settingsId_##OPT, DEF).toInt(); } \
 void SettingsModel::OPT(int value) { m_settings->setValue(g_settingsId_##OPT, value); } \
 int SettingsModel::OPT##Default(void) { return DEF; }
 
-#define MAKE_OPTION2(OPT,DEF) \
+#define LAMEXP_MAKE_OPTION_S(OPT,DEF) \
 QString SettingsModel::OPT(void) { return m_settings->value(g_settingsId_##OPT, DEF).toString().trimmed(); } \
 void SettingsModel::OPT(const QString &value) { m_settings->setValue(g_settingsId_##OPT, value); } \
 QString SettingsModel::OPT##Default(void) { return DEF; }
 
-#define MAKE_OPTION3(OPT,DEF) \
+#define LAMEXP_MAKE_OPTION_B(OPT,DEF) \
 bool SettingsModel::OPT(void) { return m_settings->value(g_settingsId_##OPT, DEF).toBool(); } \
 void SettingsModel::OPT(bool value) { m_settings->setValue(g_settingsId_##OPT, value); } \
 bool SettingsModel::OPT##Default(void) { return DEF; }
 
-#define MAKE_OPTION4(OPT,DEF) \
+#define LAMEXP_MAKE_OPTION_U(OPT,DEF) \
 unsigned int SettingsModel::OPT(void) { return m_settings->value(g_settingsId_##OPT, DEF).toUInt(); } \
 void SettingsModel::OPT(unsigned int value) { m_settings->setValue(g_settingsId_##OPT, value); } \
 unsigned int SettingsModel::OPT##Default(void) { return DEF; }
 
-#define MAKE_ID(DEC,STR) static const char *g_settingsId_##DEC = STR
+#define LAMEXP_MAKE_ID(DEC,STR) static const char *g_settingsId_##DEC = STR
+#define REMOVE_GROUP(OBJ,ID) OBJ->beginGroup(ID); OBJ->remove(""); OBJ->endGroup();
 
 ////////////////////////////////////////////////////////////
 //Constants
 ////////////////////////////////////////////////////////////
 
 //Setting ID's
-MAKE_ID(versionNumber, "VersionNumber");
-MAKE_ID(licenseAccepted, "LicenseAccepted");
-MAKE_ID(interfaceStyle, "InterfaceStyle");
-MAKE_ID(compressionEncoder, "Compression/Encoder");
-MAKE_ID(compressionRCMode, "Compression/RCMode");
-MAKE_ID(compressionBitrate, "Compression/Bitrate");
-MAKE_ID(outputDir, "OutputDirectory/SelectedPath");
-MAKE_ID(outputToSourceDir, "OutputDirectory/OutputToSourceFolder");
-MAKE_ID(prependRelativeSourcePath, "OutputDirectory/PrependRelativeSourcePath");
-MAKE_ID(writeMetaTags, "Flags/WriteMetaTags");
-MAKE_ID(createPlaylist, "Flags/AutoCreatePlaylist");
-MAKE_ID(autoUpdateLastCheck, "AutoUpdate/LastCheck");
-MAKE_ID(autoUpdateEnabled, "AutoUpdate/Enabled");
-MAKE_ID(soundsEnabled, "Flags/EnableSounds");
-MAKE_ID(neroAacNotificationsEnabled, "Flags/EnableNeroAacNotifications");
-MAKE_ID(wmaDecoderNotificationsEnabled, "Flags/EnableWmaDecoderNotifications");
-MAKE_ID(dropBoxWidgetEnabled, "Flags/EnableDropBoxWidget");
-MAKE_ID(shellIntegrationEnabled, "Flags/EnableShellIntegration");
-MAKE_ID(currentLanguage, "Localization/Language");
-MAKE_ID(lameAlgoQuality, "AdvancedOptions/LAME/AlgorithmQuality");
-MAKE_ID(lameChannelMode, "AdvancedOptions/LAME/ChannelMode");
-MAKE_ID(bitrateManagementEnabled, "AdvancedOptions/BitrateManagement/Enabled");
-MAKE_ID(bitrateManagementMinRate, "AdvancedOptions/BitrateManagement/MinRate");
-MAKE_ID(bitrateManagementMaxRate, "AdvancedOptions/BitrateManagement/MaxRate");
-MAKE_ID(samplingRate, "AdvancedOptions/Common/Resampling");
-MAKE_ID(neroAACEnable2Pass, "AdvancedOptions/NeroAAC/Enable2Pass");
-MAKE_ID(neroAACProfile, "AdvancedOptions/NeroAAC/ForceProfile");
-MAKE_ID(normalizationFilterEnabled, "AdvancedOptions/VolumeNormalization/Enabled");
-MAKE_ID(normalizationFilterMaxVolume, "AdvancedOptions/VolumeNormalization/MaxVolume");
-MAKE_ID(toneAdjustBass, "AdvancedOptions/ToneAdjustment/Bass");
-MAKE_ID(toneAdjustTreble, "AdvancedOptions/ToneAdjustment/Treble");
-MAKE_ID(customParametersLAME, "AdvancedOptions/CustomParameters/LAME");
-MAKE_ID(customParametersOggEnc, "AdvancedOptions/CustomParameters/OggEnc");
-MAKE_ID(customParametersNeroAAC, "AdvancedOptions/CustomParameters/NeroAAC");
-MAKE_ID(customParametersFLAC, "AdvancedOptions/CustomParameters/FLAC");
-MAKE_ID(metaInfoPosition, "MetaInformation/PlaylistPosition");
-MAKE_ID(maximumInstances, "AdvancedOptions/Threading/MaximumInstances");
-MAKE_ID(customTempPath, "AdvancedOptions/TempDirectory/CustomPath");
-MAKE_ID(customTempPathEnabled, "AdvancedOptions/TempDirectory/UseCustomPath");
+LAMEXP_MAKE_ID(versionNumber, "VersionNumber");
+LAMEXP_MAKE_ID(licenseAccepted, "LicenseAccepted");
+LAMEXP_MAKE_ID(interfaceStyle, "InterfaceStyle");
+LAMEXP_MAKE_ID(compressionEncoder, "Compression/Encoder");
+LAMEXP_MAKE_ID(compressionRCMode, "Compression/RCMode");
+LAMEXP_MAKE_ID(compressionBitrate, "Compression/Bitrate");
+LAMEXP_MAKE_ID(outputDir, "OutputDirectory/SelectedPath");
+LAMEXP_MAKE_ID(outputToSourceDir, "OutputDirectory/OutputToSourceFolder");
+LAMEXP_MAKE_ID(prependRelativeSourcePath, "OutputDirectory/PrependRelativeSourcePath");
+LAMEXP_MAKE_ID(favoriteOutputFolders, "OutputDirectory/Favorites");
+LAMEXP_MAKE_ID(mostRecentInputPath, "InputDirectory/MostRecentPath");
+LAMEXP_MAKE_ID(writeMetaTags, "Flags/WriteMetaTags");
+LAMEXP_MAKE_ID(createPlaylist, "Flags/AutoCreatePlaylist");
+LAMEXP_MAKE_ID(autoUpdateLastCheck, "AutoUpdate/LastCheck");
+LAMEXP_MAKE_ID(autoUpdateEnabled, "AutoUpdate/Enabled");
+LAMEXP_MAKE_ID(autoUpdateCheckBeta, "AutoUpdate/CheckForBetaVersions");
+LAMEXP_MAKE_ID(soundsEnabled, "Flags/EnableSounds");
+LAMEXP_MAKE_ID(neroAacNotificationsEnabled, "Flags/EnableNeroAacNotifications");
+LAMEXP_MAKE_ID(antivirNotificationsEnabled, "Flags/EnableAntivirusNotifications");
+LAMEXP_MAKE_ID(dropBoxWidgetEnabled, "Flags/EnableDropBoxWidget");
+LAMEXP_MAKE_ID(shellIntegrationEnabled, "Flags/EnableShellIntegration");
+LAMEXP_MAKE_ID(currentLanguage, "Localization/Language");
+LAMEXP_MAKE_ID(currentLanguageFile, "Localization/UseQMFile");
+LAMEXP_MAKE_ID(lameAlgoQuality, "AdvancedOptions/LAME/AlgorithmQuality");
+LAMEXP_MAKE_ID(lameChannelMode, "AdvancedOptions/LAME/ChannelMode");
+LAMEXP_MAKE_ID(forceStereoDownmix, "AdvancedOptions/StereoDownmix/Force");
+LAMEXP_MAKE_ID(bitrateManagementEnabled, "AdvancedOptions/BitrateManagement/Enabled");
+LAMEXP_MAKE_ID(bitrateManagementMinRate, "AdvancedOptions/BitrateManagement/MinRate");
+LAMEXP_MAKE_ID(bitrateManagementMaxRate, "AdvancedOptions/BitrateManagement/MaxRate");
+LAMEXP_MAKE_ID(aftenAudioCodingMode, "AdvancedOptions/Aften/AudioCodingMode");
+LAMEXP_MAKE_ID(aftenDynamicRangeCompression, "AdvancedOptions/Aften/DynamicRangeCompression");
+LAMEXP_MAKE_ID(aftenFastBitAllocation, "AdvancedOptions/Aften/FastBitAllocation");
+LAMEXP_MAKE_ID(aftenExponentSearchSize, "AdvancedOptions/Aften/ExponentSearchSize");
+LAMEXP_MAKE_ID(samplingRate, "AdvancedOptions/Common/Resampling");
+LAMEXP_MAKE_ID(neroAACEnable2Pass, "AdvancedOptions/AACEnc/Enable2Pass");
+LAMEXP_MAKE_ID(aacEncProfile, "AdvancedOptions/AACEnc/ForceProfile");
+LAMEXP_MAKE_ID(opusOptimizeFor, "AdvancedOptions/Opus/OptimizeForSignalType");
+LAMEXP_MAKE_ID(opusComplexity, "AdvancedOptions/Opus/EncodingComplexity");
+LAMEXP_MAKE_ID(opusFramesize, "AdvancedOptions/Opus/FrameSize");
+LAMEXP_MAKE_ID(normalizationFilterEnabled, "AdvancedOptions/VolumeNormalization/Enabled");
+LAMEXP_MAKE_ID(normalizationFilterMaxVolume, "AdvancedOptions/VolumeNormalization/MaxVolume");
+LAMEXP_MAKE_ID(normalizationFilterEqualizationMode, "AdvancedOptions/VolumeNormalization/EqualizationMode");
+LAMEXP_MAKE_ID(toneAdjustBass, "AdvancedOptions/ToneAdjustment/Bass");
+LAMEXP_MAKE_ID(toneAdjustTreble, "AdvancedOptions/ToneAdjustment/Treble");
+LAMEXP_MAKE_ID(customParametersLAME, "AdvancedOptions/CustomParameters/LAME");
+LAMEXP_MAKE_ID(customParametersOggEnc, "AdvancedOptions/CustomParameters/OggEnc");
+LAMEXP_MAKE_ID(customParametersAacEnc, "AdvancedOptions/CustomParameters/AacEnc");
+LAMEXP_MAKE_ID(customParametersAften, "AdvancedOptions/CustomParameters/Aften");
+LAMEXP_MAKE_ID(customParametersFLAC, "AdvancedOptions/CustomParameters/FLAC");
+LAMEXP_MAKE_ID(customParametersOpus, "AdvancedOptions/CustomParameters/OpusEnc");
+LAMEXP_MAKE_ID(renameOutputFilesEnabled, "AdvancedOptions/RenameOutputFiles/Enabled");
+LAMEXP_MAKE_ID(renameOutputFilesPattern, "AdvancedOptions/RenameOutputFiles/Pattern");
+LAMEXP_MAKE_ID(overwriteMode, "AdvancedOptions/OverwriteMode");
+LAMEXP_MAKE_ID(hibernateComputer, "AdvancedOptions/HibernateComputerOnShutdown");
+LAMEXP_MAKE_ID(metaInfoPosition, "MetaInformation/PlaylistPosition");
+LAMEXP_MAKE_ID(maximumInstances, "AdvancedOptions/Threading/MaximumInstances");
+LAMEXP_MAKE_ID(customTempPath, "AdvancedOptions/TempDirectory/CustomPath");
+LAMEXP_MAKE_ID(customTempPathEnabled, "AdvancedOptions/TempDirectory/UseCustomPath");
+LAMEXP_MAKE_ID(slowStartup, "Flags/SlowStartupDetected");
 
 //LUT
 const int SettingsModel::mp3Bitrates[15] = {32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, -1};
+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};
 const int SettingsModel::samplingRates[8] = {0, 16000, 22050, 24000, 32000, 44100, 48000, -1};
 
 ////////////////////////////////////////////////////////////
@@ -116,25 +139,61 @@ SettingsModel::SettingsModel(void)
 :
        m_defaultLanguage(NULL)
 {
-       QString configPath;
+       QString configPath = "LameXP.ini";
        
        if(!lamexp_portable_mode())
        {
-               QString dataPath = QDir(QDesktopServices::storageLocation(QDesktopServices::DataLocation)).canonicalPath();
-               if(dataPath.isEmpty()) dataPath = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
-               QDir(dataPath).mkpath(".");
-               configPath = QString("%1/config.ini").arg(dataPath);
+               QString dataPath = initDirectory(QDesktopServices::storageLocation(QDesktopServices::DataLocation));
+               if(!dataPath.isEmpty())
+               {
+                       configPath = QString("%1/config.ini").arg(QDir(dataPath).canonicalPath());
+               }
+               else
+               {
+                       qWarning("SettingsModel: DataLocation could not be initialized!");
+                       dataPath = initDirectory(QDesktopServices::storageLocation(QDesktopServices::HomeLocation));
+                       if(!dataPath.isEmpty())
+                       {
+                               configPath = QString("%1/LameXP.ini").arg(QDir(dataPath).canonicalPath());
+                       }
+               }
        }
        else
        {
                qDebug("LameXP is running in \"portable\" mode -> config in application dir!\n");
                QString appPath = QFileInfo(QApplication::applicationFilePath()).canonicalFilePath();
-               if(appPath.isEmpty()) appPath = QApplication::applicationFilePath();
-               configPath = QString("%1/%2.ini").arg(QFileInfo(appPath).absolutePath(), QFileInfo(appPath).completeBaseName());
+               if(appPath.isEmpty())
+               {
+                       appPath = QFileInfo(QApplication::applicationFilePath()).absoluteFilePath();
+               }
+               if(QFileInfo(appPath).exists() && QFileInfo(appPath).isFile())
+               {
+                       configPath = QString("%1/%2.ini").arg(QFileInfo(appPath).absolutePath(), QFileInfo(appPath).completeBaseName());
+               }
        }
 
        m_settings = new QSettings(configPath, QSettings::IniFormat);
-       m_settings->beginGroup(QString().sprintf("LameXP_%u%02u%05u", lamexp_version_major(), lamexp_version_minor(), lamexp_version_build()));
+       const QString groupKey = QString().sprintf("LameXP_%u%02u%05u", lamexp_version_major(), lamexp_version_minor(), lamexp_version_build());
+       QStringList childGroups = m_settings->childGroups();
+
+       while(!childGroups.isEmpty())
+       {
+               QString current = childGroups.takeFirst();
+               QRegExp filter("^LameXP_(\\d+)(\\d\\d)(\\d\\d\\d\\d\\d)$");
+               if(filter.indexIn(current) >= 0)
+               {
+                       bool ok = false;
+                       unsigned int temp = filter.cap(3).toUInt(&ok) + 10;
+                       if(ok && (temp >= lamexp_version_build()))
+                       {
+                               continue;
+                       }
+               }
+               qWarning("Deleting obsolete group from config: %s", current.toUtf8().constData());
+               REMOVE_GROUP(m_settings, current);
+       }
+
+       m_settings->beginGroup(groupKey);
        m_settings->setValue(g_settingsId_versionNumber, QApplication::applicationVersion());
        m_settings->sync();
 }
@@ -167,23 +226,65 @@ void SettingsModel::validate(void)
        
        if(!(lamexp_check_tool("neroAacEnc.exe") && lamexp_check_tool("neroAacDec.exe") && lamexp_check_tool("neroAacTag.exe")))
        {
-               if(this->compressionEncoder() == SettingsModel::AACEncoder)
+               if(!(lamexp_check_tool("fhgaacenc.exe") && lamexp_check_tool("enc_fhgaac.dll")))
                {
-                       qWarning("Nero encoder selected, but not available any more. Reverting to MP3!");
-                       this->compressionEncoder(SettingsModel::MP3Encoder);
+                       if(!(lamexp_check_tool("qaac.exe") && lamexp_check_tool("libsoxrate.dll")))
+                       {
+                               if(this->compressionEncoder() == SettingsModel::AACEncoder)
+                               {
+                                       qWarning("AAC encoder selected, but not available any more. Reverting to MP3!");
+                                       this->compressionEncoder(SettingsModel::MP3Encoder);
+                               }
+                       }
                }
        }
        
        if(this->outputDir().isEmpty() || !QFileInfo(this->outputDir()).isDir())
        {
-               this->outputDir(QDesktopServices::storageLocation(QDesktopServices::MusicLocation));
+               QString musicLocation = QDesktopServices::storageLocation(QDesktopServices::MusicLocation);
+               this->outputDir(musicLocation.isEmpty() ? QDesktopServices::storageLocation(QDesktopServices::HomeLocation) : musicLocation);
+       }
+
+       if(this->mostRecentInputPath().isEmpty() || !QFileInfo(this->mostRecentInputPath()).isDir())
+       {
+               QString musicLocation = QDesktopServices::storageLocation(QDesktopServices::MusicLocation);
+               this->outputDir(musicLocation.isEmpty() ? QDesktopServices::storageLocation(QDesktopServices::HomeLocation) : musicLocation);
+       }
+
+       if(!this->currentLanguageFile().isEmpty())
+       {
+               const QString qmPath = QFileInfo(this->currentLanguageFile()).canonicalFilePath();
+               if(qmPath.isEmpty() || (!(QFileInfo(qmPath).exists() && QFileInfo(qmPath).isFile() && (QFileInfo(qmPath).suffix().compare("qm", Qt::CaseInsensitive) == 0))))
+               {
+                       qWarning("Current language file missing, reverting to built-in translator!");
+                       this->currentLanguageFile(QString());
+               }
        }
 
        if(!lamexp_query_translations().contains(this->currentLanguage(), Qt::CaseInsensitive))
        {
                qWarning("Current language \"%s\" is unknown, reverting to default language!", this->currentLanguage().toLatin1().constData());
-                       this->currentLanguage(defaultLanguage());
+               this->currentLanguage(defaultLanguage());
        }
+
+       if(this->hibernateComputer())
+       {
+               if(!lamexp_is_hibernation_supported())
+               {
+                       this->hibernateComputer(false);
+               }
+       }
+
+       if(this->overwriteMode() < SettingsModel::Overwrite_KeepBoth || this->overwriteMode() > SettingsModel::Overwrite_Replaces)
+       {
+               this->overwriteMode(SettingsModel::Overwrite_KeepBoth);
+       }
+
+}
+
+void SettingsModel::syncNow(void)
+{
+       m_settings->sync();
 }
 
 ////////////////////////////////////////////////////////////
@@ -197,21 +298,42 @@ QString SettingsModel::defaultLanguage(void)
                return *m_defaultLanguage;
        }
        
-       //Check if we can use the default translation
+       //Detect system langauge
        QLocale systemLanguage= QLocale::system();
-       if(systemLanguage.language() == QLocale::English || systemLanguage.language() == QLocale::C)
+       qDebug("[Locale]");
+       qDebug("Language: %s (%d)", QLocale::languageToString(systemLanguage.language()).toUtf8().constData(), systemLanguage.language());
+       qDebug("Country is: %s (%d)", QLocale::countryToString(systemLanguage.country()).toUtf8().constData(), systemLanguage.country());
+       qDebug("Script is: %s (%d)\n", QLocale::scriptToString(systemLanguage.script()).toUtf8().constData(), systemLanguage.script());
+
+       //Check if we can use the default translation
+       if(systemLanguage.language() == QLocale::English /*|| systemLanguage.language() == QLocale::C*/)
        {
                m_defaultLanguage = new QString(LAMEXP_DEFAULT_LANGID);
                return LAMEXP_DEFAULT_LANGID;
        }
 
-       //Try to find a suitable translation for the user's system language
+       //Try to find a suitable translation for the user's system language *and* country
        QStringList languages = lamexp_query_translations();
        while(!languages.isEmpty())
        {
                QString currentLangId = languages.takeFirst();
                if(lamexp_translation_sysid(currentLangId) == systemLanguage.language())
                {
+                       if(lamexp_translation_country(currentLangId) == systemLanguage.country())
+                       {
+                               m_defaultLanguage = new QString(currentLangId);
+                               return currentLangId;
+                       }
+               }
+       }
+
+       //Try to find a suitable translation for the user's system language
+       languages = lamexp_query_translations();
+       while(!languages.isEmpty())
+       {
+               QString currentLangId = languages.takeFirst();
+               if(lamexp_translation_sysid(currentLangId) == systemLanguage.language())
+               {
                        m_defaultLanguage = new QString(currentLangId);
                        return currentLangId;
                }
@@ -222,45 +344,89 @@ QString SettingsModel::defaultLanguage(void)
        return LAMEXP_DEFAULT_LANGID;
 }
 
+QString SettingsModel::initDirectory(const QString &path)
+{
+       if(path.isEmpty())
+       {
+               return QString();
+       }
+
+       if(!QDir(path).exists())
+       {
+               for(int i = 0; i < 32; i++)
+               {
+                       if(QDir(path).mkpath(".")) break;
+                       Sleep(1);
+               }
+       }
+
+       if(!QDir(path).exists())
+       {
+               return QString();
+       }
+       
+       return QDir(path).canonicalPath();
+}
+
 ////////////////////////////////////////////////////////////
 // Getter and Setter
 ////////////////////////////////////////////////////////////
 
-MAKE_OPTION1(licenseAccepted, 0)
-MAKE_OPTION1(interfaceStyle, 0)
-MAKE_OPTION1(compressionEncoder, 0)
-MAKE_OPTION1(compressionRCMode, 0)
-MAKE_OPTION1(compressionBitrate, 7)
-MAKE_OPTION2(outputDir, QString())
-MAKE_OPTION3(outputToSourceDir, false)
-MAKE_OPTION3(prependRelativeSourcePath, false)
-MAKE_OPTION3(writeMetaTags, true)
-MAKE_OPTION3(createPlaylist, true)
-MAKE_OPTION2(autoUpdateLastCheck, "Never")
-MAKE_OPTION3(autoUpdateEnabled, true)
-MAKE_OPTION3(soundsEnabled, true)
-MAKE_OPTION3(neroAacNotificationsEnabled, true)
-MAKE_OPTION3(wmaDecoderNotificationsEnabled, true)
-MAKE_OPTION3(dropBoxWidgetEnabled, true)
-MAKE_OPTION3(shellIntegrationEnabled, !lamexp_portable_mode())
-MAKE_OPTION2(currentLanguage, defaultLanguage())
-MAKE_OPTION1(lameAlgoQuality, 3)
-MAKE_OPTION1(lameChannelMode, 0);
-MAKE_OPTION3(bitrateManagementEnabled, false)
-MAKE_OPTION1(bitrateManagementMinRate, 32)
-MAKE_OPTION1(bitrateManagementMaxRate, 500)
-MAKE_OPTION1(samplingRate, 0)
-MAKE_OPTION3(neroAACEnable2Pass, true)
-MAKE_OPTION1(neroAACProfile, 0)
-MAKE_OPTION3(normalizationFilterEnabled, false)
-MAKE_OPTION1(normalizationFilterMaxVolume, -50)
-MAKE_OPTION1(toneAdjustBass, 0)
-MAKE_OPTION1(toneAdjustTreble, 0)
-MAKE_OPTION2(customParametersLAME, QString());
-MAKE_OPTION2(customParametersOggEnc, QString());
-MAKE_OPTION2(customParametersNeroAAC, QString());
-MAKE_OPTION2(customParametersFLAC, QString());
-MAKE_OPTION4(metaInfoPosition, UINT_MAX);
-MAKE_OPTION4(maximumInstances, 0);
-MAKE_OPTION2(customTempPath, QDesktopServices::storageLocation(QDesktopServices::TempLocation));
-MAKE_OPTION3(customTempPathEnabled, false);
+LAMEXP_MAKE_OPTION_I(licenseAccepted, 0)
+LAMEXP_MAKE_OPTION_I(interfaceStyle, 0)
+LAMEXP_MAKE_OPTION_I(compressionEncoder, 0)
+LAMEXP_MAKE_OPTION_I(compressionRCMode, 0)
+LAMEXP_MAKE_OPTION_I(compressionBitrate, 7)
+LAMEXP_MAKE_OPTION_S(outputDir, QDesktopServices::storageLocation(QDesktopServices::MusicLocation))
+LAMEXP_MAKE_OPTION_B(outputToSourceDir, false)
+LAMEXP_MAKE_OPTION_B(prependRelativeSourcePath, false)
+LAMEXP_MAKE_OPTION_S(favoriteOutputFolders, QString());
+LAMEXP_MAKE_OPTION_B(writeMetaTags, true)
+LAMEXP_MAKE_OPTION_B(createPlaylist, true)
+LAMEXP_MAKE_OPTION_S(autoUpdateLastCheck, "Never")
+LAMEXP_MAKE_OPTION_B(autoUpdateEnabled, true)
+LAMEXP_MAKE_OPTION_B(autoUpdateCheckBeta, false)
+LAMEXP_MAKE_OPTION_B(soundsEnabled, true)
+LAMEXP_MAKE_OPTION_B(neroAacNotificationsEnabled, true)
+LAMEXP_MAKE_OPTION_B(antivirNotificationsEnabled, true)
+LAMEXP_MAKE_OPTION_B(dropBoxWidgetEnabled, true)
+LAMEXP_MAKE_OPTION_B(shellIntegrationEnabled, !lamexp_portable_mode())
+LAMEXP_MAKE_OPTION_S(currentLanguage, defaultLanguage())
+LAMEXP_MAKE_OPTION_S(currentLanguageFile, QString())
+LAMEXP_MAKE_OPTION_I(lameAlgoQuality, 3)
+LAMEXP_MAKE_OPTION_I(lameChannelMode, 0)
+LAMEXP_MAKE_OPTION_B(forceStereoDownmix, false)
+LAMEXP_MAKE_OPTION_B(bitrateManagementEnabled, false)
+LAMEXP_MAKE_OPTION_I(bitrateManagementMinRate, 32)
+LAMEXP_MAKE_OPTION_I(bitrateManagementMaxRate, 500)
+LAMEXP_MAKE_OPTION_I(samplingRate, 0)
+LAMEXP_MAKE_OPTION_B(neroAACEnable2Pass, true)
+LAMEXP_MAKE_OPTION_I(aacEncProfile, 0)
+LAMEXP_MAKE_OPTION_I(aftenAudioCodingMode, 0);
+LAMEXP_MAKE_OPTION_I(aftenDynamicRangeCompression, 5);
+LAMEXP_MAKE_OPTION_B(aftenFastBitAllocation, false);
+LAMEXP_MAKE_OPTION_I(aftenExponentSearchSize, 8);
+LAMEXP_MAKE_OPTION_I(opusOptimizeFor, 0);
+LAMEXP_MAKE_OPTION_I(opusComplexity, 10);
+LAMEXP_MAKE_OPTION_I(opusFramesize, 3);
+LAMEXP_MAKE_OPTION_B(normalizationFilterEnabled, false)
+LAMEXP_MAKE_OPTION_I(normalizationFilterMaxVolume, -50)
+LAMEXP_MAKE_OPTION_I(normalizationFilterEqualizationMode, 0);
+LAMEXP_MAKE_OPTION_I(toneAdjustBass, 0)
+LAMEXP_MAKE_OPTION_I(toneAdjustTreble, 0)
+LAMEXP_MAKE_OPTION_S(customParametersLAME, QString());
+LAMEXP_MAKE_OPTION_S(customParametersOggEnc, QString());
+LAMEXP_MAKE_OPTION_S(customParametersAacEnc, QString());
+LAMEXP_MAKE_OPTION_S(customParametersAften, QString());
+LAMEXP_MAKE_OPTION_S(customParametersFLAC, QString());
+LAMEXP_MAKE_OPTION_S(customParametersOpus, QString());
+LAMEXP_MAKE_OPTION_B(renameOutputFilesEnabled, false);
+LAMEXP_MAKE_OPTION_S(renameOutputFilesPattern, "[<TrackNo>] <Artist> - <Title>");
+LAMEXP_MAKE_OPTION_I(overwriteMode, Overwrite_KeepBoth);
+LAMEXP_MAKE_OPTION_U(metaInfoPosition, UINT_MAX);
+LAMEXP_MAKE_OPTION_U(maximumInstances, 0);
+LAMEXP_MAKE_OPTION_S(customTempPath, QDesktopServices::storageLocation(QDesktopServices::TempLocation));
+LAMEXP_MAKE_OPTION_B(customTempPathEnabled, false);
+LAMEXP_MAKE_OPTION_B(slowStartup, false);
+LAMEXP_MAKE_OPTION_S(mostRecentInputPath, QDesktopServices::storageLocation(QDesktopServices::MusicLocation));
+LAMEXP_MAKE_OPTION_B(hibernateComputer, false);