2010-11-12 19:02:01 +01:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// LameXP - Audio Encoder Front-End
|
2020-03-28 15:31:01 +01:00
|
|
|
// Copyright (C) 2004-2020 LoRd_MuldeR <MuldeR2@GMX.de>
|
2010-11-12 19:02:01 +01:00
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or modify
|
2020-03-28 15:31:01 +01:00
|
|
|
// it under the terms of the GNU GENERAL PUBLIC LICENSE as published by
|
2010-11-12 19:02:01 +01:00
|
|
|
// the Free Software Foundation; either version 2 of the License, or
|
2020-03-28 15:31:01 +01:00
|
|
|
// (at your option) any later version; always including the non-optional
|
|
|
|
// LAMEXP GNU GENERAL PUBLIC LICENSE ADDENDUM. See "License.txt" file!
|
2010-11-12 19:02:01 +01:00
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License along
|
|
|
|
// with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
//
|
|
|
|
// http://www.gnu.org/licenses/gpl-2.0.txt
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include "Model_Settings.h"
|
|
|
|
|
2014-11-25 02:14:42 +01:00
|
|
|
//Internal
|
2010-11-12 19:02:01 +01:00
|
|
|
#include "Global.h"
|
2014-01-19 17:33:39 +01:00
|
|
|
#include "Registry_Encoder.h"
|
2010-11-12 19:02:01 +01:00
|
|
|
|
2014-11-25 02:14:42 +01:00
|
|
|
//MUtils
|
|
|
|
#include <MUtils/Global.h>
|
2014-12-20 23:44:43 +01:00
|
|
|
#include <MUtils/Translation.h>
|
2014-11-30 21:32:23 +01:00
|
|
|
#include <MUtils/OSSupport.h>
|
2014-11-25 02:14:42 +01:00
|
|
|
|
|
|
|
//Qt
|
2010-11-12 19:02:01 +01:00
|
|
|
#include <QSettings>
|
|
|
|
#include <QDesktopServices>
|
|
|
|
#include <QApplication>
|
2010-11-20 02:14:22 +01:00
|
|
|
#include <QString>
|
|
|
|
#include <QFileInfo>
|
2011-01-24 00:04:07 +01:00
|
|
|
#include <QDir>
|
2010-12-30 16:12:21 +01:00
|
|
|
#include <QStringList>
|
2011-01-02 20:47:26 +01:00
|
|
|
#include <QLocale>
|
2011-03-05 17:43:57 +01:00
|
|
|
#include <QRegExp>
|
2013-01-18 01:08:58 +01:00
|
|
|
#include <QReadWriteLock>
|
|
|
|
#include <QReadLocker>
|
|
|
|
#include <QWriteLocker>
|
2013-07-14 17:13:01 +02:00
|
|
|
#include <QHash>
|
|
|
|
#include <QMutex>
|
|
|
|
#include <QSet>
|
2011-01-21 19:14:11 +01:00
|
|
|
|
2013-07-14 19:04:32 +02:00
|
|
|
////////////////////////////////////////////////////////////
|
2013-07-14 19:45:28 +02:00
|
|
|
// SettingsCache Class
|
2013-07-14 19:04:32 +02:00
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
class SettingsCache
|
|
|
|
{
|
|
|
|
public:
|
2014-12-20 23:44:43 +01:00
|
|
|
SettingsCache(QSettings *configFile)
|
|
|
|
:
|
|
|
|
m_configFile(configFile),
|
|
|
|
m_cache(new cache_data_t()),
|
|
|
|
m_cacheDirty(new string_set_t())
|
2013-07-14 19:04:32 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
~SettingsCache(void)
|
|
|
|
{
|
|
|
|
flushValues();
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void storeValue(const QString &key, const QVariant &value)
|
|
|
|
{
|
2014-12-20 23:44:43 +01:00
|
|
|
QWriteLocker writeLock(&m_cacheLock);
|
2013-07-14 19:04:32 +02:00
|
|
|
|
|
|
|
if(!m_cache->contains(key))
|
|
|
|
{
|
|
|
|
m_cache->insert(key, value);
|
|
|
|
m_cacheDirty->insert(key);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if(m_cache->value(key) != value)
|
|
|
|
{
|
|
|
|
m_cache->insert(key, value);
|
|
|
|
m_cacheDirty->insert(key);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
inline QVariant loadValue(const QString &key, const QVariant &defaultValue) const
|
|
|
|
{
|
2014-12-20 23:44:43 +01:00
|
|
|
QReadLocker readLock(&m_cacheLock);
|
|
|
|
|
|
|
|
if(m_cache->contains(key))
|
|
|
|
{
|
|
|
|
return m_cache->value(key, defaultValue);
|
|
|
|
}
|
|
|
|
|
|
|
|
readLock.unlock();
|
|
|
|
QWriteLocker writeLock(&m_cacheLock);
|
2013-07-14 19:04:32 +02:00
|
|
|
|
|
|
|
if(!m_cache->contains(key))
|
|
|
|
{
|
|
|
|
const QVariant storedValue = m_configFile->value(key, defaultValue);
|
|
|
|
m_cache->insert(key, storedValue);
|
|
|
|
}
|
|
|
|
|
|
|
|
return m_cache->value(key, defaultValue);
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void flushValues(void)
|
|
|
|
{
|
2014-12-20 23:44:43 +01:00
|
|
|
QWriteLocker writeLock(&m_cacheLock);
|
2013-07-14 19:04:32 +02:00
|
|
|
|
|
|
|
if(!m_cacheDirty->isEmpty())
|
|
|
|
{
|
|
|
|
QSet<QString>::ConstIterator iter;
|
|
|
|
for(iter = m_cacheDirty->constBegin(); iter != m_cacheDirty->constEnd(); iter++)
|
|
|
|
{
|
|
|
|
if(m_cache->contains(*iter))
|
|
|
|
{
|
|
|
|
m_configFile->setValue((*iter), m_cache->value(*iter));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-11-25 02:14:42 +01:00
|
|
|
qWarning("Could not find '%s' in cache, but it has been marked as dirty!", MUTILS_UTF8(*iter));
|
2013-07-14 19:04:32 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
m_configFile->sync();
|
|
|
|
m_cacheDirty->clear();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
2014-12-20 23:44:43 +01:00
|
|
|
typedef QSet<QString> string_set_t;
|
|
|
|
typedef QHash<QString, QVariant> cache_data_t;
|
|
|
|
|
|
|
|
QScopedPointer<QSettings> m_configFile;
|
|
|
|
QScopedPointer<cache_data_t> m_cache;
|
|
|
|
QScopedPointer<string_set_t> m_cacheDirty;
|
|
|
|
|
|
|
|
mutable QReadWriteLock m_cacheLock;
|
2013-07-14 19:04:32 +02:00
|
|
|
};
|
|
|
|
|
2011-02-10 16:08:03 +01:00
|
|
|
////////////////////////////////////////////////////////////
|
2013-07-14 19:45:28 +02:00
|
|
|
// Macros
|
2011-02-10 16:08:03 +01:00
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
|
2011-05-03 14:28:06 +02:00
|
|
|
#define LAMEXP_MAKE_OPTION_I(OPT,DEF) \
|
2017-10-13 17:28:39 +02:00
|
|
|
qint32 SettingsModel::OPT(void) const { return m_configCache->loadValue(g_settingsId_##OPT, (DEF)).toInt(); } \
|
|
|
|
void SettingsModel::OPT(const qint32 &value) { m_configCache->storeValue(g_settingsId_##OPT, value); } \
|
|
|
|
qint32 SettingsModel::OPT##Default(void) { return (DEF); }
|
2010-11-12 19:02:01 +01:00
|
|
|
|
2011-05-03 14:28:06 +02:00
|
|
|
#define LAMEXP_MAKE_OPTION_S(OPT,DEF) \
|
2013-07-14 19:04:32 +02:00
|
|
|
QString SettingsModel::OPT(void) const { return m_configCache->loadValue(g_settingsId_##OPT, (DEF)).toString().trimmed(); } \
|
|
|
|
void SettingsModel::OPT(const QString &value) { m_configCache->storeValue(g_settingsId_##OPT, value); } \
|
2013-07-14 17:13:01 +02:00
|
|
|
QString SettingsModel::OPT##Default(void) { return (DEF); }
|
2010-11-21 21:51:22 +01:00
|
|
|
|
2011-05-03 14:28:06 +02:00
|
|
|
#define LAMEXP_MAKE_OPTION_B(OPT,DEF) \
|
2013-07-14 19:04:32 +02:00
|
|
|
bool SettingsModel::OPT(void) const { return m_configCache->loadValue(g_settingsId_##OPT, (DEF)).toBool(); } \
|
|
|
|
void SettingsModel::OPT(bool value) { m_configCache->storeValue(g_settingsId_##OPT, value); } \
|
2013-07-14 17:13:01 +02:00
|
|
|
bool SettingsModel::OPT##Default(void) { return (DEF); }
|
2010-11-21 21:51:22 +01:00
|
|
|
|
2011-05-03 14:28:06 +02:00
|
|
|
#define LAMEXP_MAKE_OPTION_U(OPT,DEF) \
|
2017-10-13 17:28:39 +02:00
|
|
|
quint32 SettingsModel::OPT(void) const { return m_configCache->loadValue(g_settingsId_##OPT, (DEF)).toUInt(); } \
|
|
|
|
void SettingsModel::OPT(const quint32 &value) { m_configCache->storeValue(g_settingsId_##OPT, value); } \
|
|
|
|
quint32 SettingsModel::OPT##Default(void) { return (DEF); }
|
2011-02-10 16:08:03 +01:00
|
|
|
|
2011-05-03 14:28:06 +02:00
|
|
|
#define LAMEXP_MAKE_ID(DEC,STR) static const char *g_settingsId_##DEC = STR
|
2013-07-14 19:04:32 +02:00
|
|
|
|
|
|
|
#define REMOVE_GROUP(OBJ,ID) do \
|
|
|
|
{ \
|
|
|
|
OBJ->beginGroup(ID); \
|
|
|
|
OBJ->remove(""); \
|
|
|
|
OBJ->endGroup(); \
|
|
|
|
} \
|
|
|
|
while(0)
|
2011-02-10 16:08:03 +01:00
|
|
|
|
2019-10-26 21:59:27 +02:00
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
// Utility functions
|
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
static bool dir_exists(const QString &path)
|
|
|
|
{
|
|
|
|
const QFileInfo info(path);
|
|
|
|
return info.exists() && info.isDir();
|
|
|
|
}
|
|
|
|
|
|
|
|
static QString find_existing_ancestor(const QString &path)
|
|
|
|
{
|
|
|
|
for (QString parentPath = path; !parentPath.isEmpty(); parentPath = MUtils::parent_path(parentPath))
|
|
|
|
{
|
|
|
|
if (dir_exists(parentPath))
|
|
|
|
{
|
|
|
|
return parentPath; /*existing parent found*/
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return QString();
|
|
|
|
}
|
2013-07-09 22:34:06 +02:00
|
|
|
|
2011-02-10 16:08:03 +01:00
|
|
|
////////////////////////////////////////////////////////////
|
2013-07-14 19:45:28 +02:00
|
|
|
// Constants
|
2011-02-10 16:08:03 +01:00
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
//Setting ID's
|
2013-10-02 16:39:26 +02:00
|
|
|
LAMEXP_MAKE_ID(aacEncProfile, "AdvancedOptions/AACEnc/ForceProfile");
|
|
|
|
LAMEXP_MAKE_ID(aftenAudioCodingMode, "AdvancedOptions/Aften/AudioCodingMode");
|
2013-07-07 23:49:29 +02:00
|
|
|
LAMEXP_MAKE_ID(aftenDynamicRangeCompression, "AdvancedOptions/Aften/DynamicRangeCompression");
|
2013-10-02 16:39:26 +02:00
|
|
|
LAMEXP_MAKE_ID(aftenExponentSearchSize, "AdvancedOptions/Aften/ExponentSearchSize");
|
|
|
|
LAMEXP_MAKE_ID(aftenFastBitAllocation, "AdvancedOptions/Aften/FastBitAllocation");
|
|
|
|
LAMEXP_MAKE_ID(antivirNotificationsEnabled, "Flags/EnableAntivirusNotifications");
|
|
|
|
LAMEXP_MAKE_ID(autoUpdateCheckBeta, "AutoUpdate/CheckForBetaVersions");
|
|
|
|
LAMEXP_MAKE_ID(autoUpdateEnabled, "AutoUpdate/Enabled");
|
|
|
|
LAMEXP_MAKE_ID(autoUpdateLastCheck, "AutoUpdate/LastCheck");
|
|
|
|
LAMEXP_MAKE_ID(bitrateManagementEnabled, "AdvancedOptions/BitrateManagement/Enabled");
|
|
|
|
LAMEXP_MAKE_ID(bitrateManagementMaxRate, "AdvancedOptions/BitrateManagement/MaxRate");
|
|
|
|
LAMEXP_MAKE_ID(bitrateManagementMinRate, "AdvancedOptions/BitrateManagement/MinRate");
|
2013-10-03 15:56:10 +02:00
|
|
|
LAMEXP_MAKE_ID(compressionAbrBitrateAacEnc, "Compression/AbrTaretBitrate/AacEnc");
|
|
|
|
LAMEXP_MAKE_ID(compressionAbrBitrateAften, "Compression/AbrTaretBitrate/Aften");
|
|
|
|
LAMEXP_MAKE_ID(compressionAbrBitrateDcaEnc, "Compression/AbrTaretBitrate/DcaEnc");
|
|
|
|
LAMEXP_MAKE_ID(compressionAbrBitrateFLAC, "Compression/AbrTaretBitrate/FLAC");
|
|
|
|
LAMEXP_MAKE_ID(compressionAbrBitrateLAME, "Compression/AbrTaretBitrate/LAME");
|
2013-12-04 22:36:19 +01:00
|
|
|
LAMEXP_MAKE_ID(compressionAbrBitrateMacEnc, "Compression/AbrTaretBitrate/MacEnc");
|
2013-10-03 15:56:10 +02:00
|
|
|
LAMEXP_MAKE_ID(compressionAbrBitrateOggEnc, "Compression/AbrTaretBitrate/OggEnc");
|
|
|
|
LAMEXP_MAKE_ID(compressionAbrBitrateOpusEnc, "Compression/AbrTaretBitrate/OpusEnc");
|
|
|
|
LAMEXP_MAKE_ID(compressionAbrBitrateWave, "Compression/AbrTaretBitrate/Wave");
|
|
|
|
LAMEXP_MAKE_ID(compressionCbrBitrateAacEnc, "Compression/CbrTaretBitrate/AacEnc");
|
|
|
|
LAMEXP_MAKE_ID(compressionCbrBitrateAften, "Compression/CbrTaretBitrate/Aften");
|
|
|
|
LAMEXP_MAKE_ID(compressionCbrBitrateDcaEnc, "Compression/CbrTaretBitrate/DcaEnc");
|
|
|
|
LAMEXP_MAKE_ID(compressionCbrBitrateFLAC, "Compression/CbrTaretBitrate/FLAC");
|
|
|
|
LAMEXP_MAKE_ID(compressionCbrBitrateLAME, "Compression/CbrTaretBitrate/LAME");
|
2013-12-04 22:36:19 +01:00
|
|
|
LAMEXP_MAKE_ID(compressionCbrBitrateMacEnc, "Compression/CbrTaretBitrate/MacEnc");
|
2013-10-03 15:56:10 +02:00
|
|
|
LAMEXP_MAKE_ID(compressionCbrBitrateOggEnc, "Compression/CbrTaretBitrate/OggEnc");
|
|
|
|
LAMEXP_MAKE_ID(compressionCbrBitrateOpusEnc, "Compression/CbrTaretBitrate/OpusEnc");
|
|
|
|
LAMEXP_MAKE_ID(compressionCbrBitrateWave, "Compression/CbrTaretBitrate/Wave");
|
2013-10-02 16:39:26 +02:00
|
|
|
LAMEXP_MAKE_ID(compressionEncoder, "Compression/Encoder");
|
|
|
|
LAMEXP_MAKE_ID(compressionRCModeAacEnc, "Compression/RCMode/AacEnc");
|
|
|
|
LAMEXP_MAKE_ID(compressionRCModeAften, "Compression/RCMode/Aften");
|
|
|
|
LAMEXP_MAKE_ID(compressionRCModeDcaEnc, "Compression/RCMode/DcaEnc");
|
|
|
|
LAMEXP_MAKE_ID(compressionRCModeFLAC, "Compression/RCMode/FLAC");
|
|
|
|
LAMEXP_MAKE_ID(compressionRCModeLAME, "Compression/RCMode/LAME");
|
2013-12-04 22:36:19 +01:00
|
|
|
LAMEXP_MAKE_ID(compressionRCModeMacEnc, "Compression/RCMode/MacEnc");
|
2013-10-02 16:39:26 +02:00
|
|
|
LAMEXP_MAKE_ID(compressionRCModeOggEnc, "Compression/RCMode/OggEnc");
|
|
|
|
LAMEXP_MAKE_ID(compressionRCModeOpusEnc, "Compression/RCMode/OpusEnc");
|
|
|
|
LAMEXP_MAKE_ID(compressionRCModeWave, "Compression/RCMode/Wave");
|
2013-10-03 15:56:10 +02:00
|
|
|
LAMEXP_MAKE_ID(compressionVbrQualityAacEnc, "Compression/VbrQualityLevel/AacEnc");
|
|
|
|
LAMEXP_MAKE_ID(compressionVbrQualityAften, "Compression/VbrQualityLevel/Aften");
|
|
|
|
LAMEXP_MAKE_ID(compressionVbrQualityDcaEnc, "Compression/VbrQualityLevel/DcaEnc");
|
|
|
|
LAMEXP_MAKE_ID(compressionVbrQualityFLAC, "Compression/VbrQualityLevel/FLAC");
|
|
|
|
LAMEXP_MAKE_ID(compressionVbrQualityLAME, "Compression/VbrQualityLevel/LAME");
|
2013-12-04 22:36:19 +01:00
|
|
|
LAMEXP_MAKE_ID(compressionVbrQualityMacEnc, "Compression/VbrQualityLevel/MacEnc");
|
2013-10-03 15:56:10 +02:00
|
|
|
LAMEXP_MAKE_ID(compressionVbrQualityOggEnc, "Compression/VbrQualityLevel/OggEnc");
|
|
|
|
LAMEXP_MAKE_ID(compressionVbrQualityOpusEnc, "Compression/VbrQualityLevel/OpusEnc");
|
|
|
|
LAMEXP_MAKE_ID(compressionVbrQualityWave, "Compression/VbrQualityLevel/Wave");
|
2013-10-02 16:39:26 +02:00
|
|
|
LAMEXP_MAKE_ID(createPlaylist, "Flags/AutoCreatePlaylist");
|
|
|
|
LAMEXP_MAKE_ID(currentLanguage, "Localization/Language");
|
|
|
|
LAMEXP_MAKE_ID(currentLanguageFile, "Localization/UseQMFile");
|
|
|
|
LAMEXP_MAKE_ID(customParametersAacEnc, "AdvancedOptions/CustomParameters/AacEnc");
|
|
|
|
LAMEXP_MAKE_ID(customParametersAften, "AdvancedOptions/CustomParameters/Aften");
|
2013-10-03 17:01:37 +02:00
|
|
|
LAMEXP_MAKE_ID(customParametersDcaEnc, "AdvancedOptions/CustomParameters/DcaEnc");
|
2013-10-02 16:39:26 +02:00
|
|
|
LAMEXP_MAKE_ID(customParametersFLAC, "AdvancedOptions/CustomParameters/FLAC");
|
|
|
|
LAMEXP_MAKE_ID(customParametersLAME, "AdvancedOptions/CustomParameters/LAME");
|
2013-12-04 22:36:19 +01:00
|
|
|
LAMEXP_MAKE_ID(customParametersMacEnc, "AdvancedOptions/CustomParameters/MacEnc");
|
2013-10-02 16:39:26 +02:00
|
|
|
LAMEXP_MAKE_ID(customParametersOggEnc, "AdvancedOptions/CustomParameters/OggEnc");
|
2013-10-03 17:01:37 +02:00
|
|
|
LAMEXP_MAKE_ID(customParametersOpusEnc, "AdvancedOptions/CustomParameters/OpusEnc");
|
|
|
|
LAMEXP_MAKE_ID(customParametersWave, "AdvancedOptions/CustomParameters/Wave");
|
2013-10-02 16:39:26 +02:00
|
|
|
LAMEXP_MAKE_ID(customTempPath, "AdvancedOptions/TempDirectory/CustomPath");
|
|
|
|
LAMEXP_MAKE_ID(customTempPathEnabled, "AdvancedOptions/TempDirectory/UseCustomPath");
|
2013-11-02 01:07:23 +01:00
|
|
|
LAMEXP_MAKE_ID(dropBoxWidgetEnabled, "DropBoxWidget/Enabled");
|
|
|
|
LAMEXP_MAKE_ID(dropBoxWidgetPositionX, "DropBoxWidget/Position/X");
|
|
|
|
LAMEXP_MAKE_ID(dropBoxWidgetPositionY, "DropBoxWidget/Position/Y");
|
2013-10-02 16:39:26 +02:00
|
|
|
LAMEXP_MAKE_ID(favoriteOutputFolders, "OutputDirectory/Favorites");
|
|
|
|
LAMEXP_MAKE_ID(forceStereoDownmix, "AdvancedOptions/StereoDownmix/Force");
|
|
|
|
LAMEXP_MAKE_ID(hibernateComputer, "AdvancedOptions/HibernateComputerOnShutdown");
|
|
|
|
LAMEXP_MAKE_ID(interfaceStyle, "InterfaceStyle");
|
2015-11-07 21:39:33 +01:00
|
|
|
LAMEXP_MAKE_ID(keepOriginalDataTime, "AdvancedOptions/FileOperations/KeepOriginalDataTime");
|
2013-10-02 16:39:26 +02:00
|
|
|
LAMEXP_MAKE_ID(lameAlgoQuality, "AdvancedOptions/LAME/AlgorithmQuality");
|
|
|
|
LAMEXP_MAKE_ID(lameChannelMode, "AdvancedOptions/LAME/ChannelMode");
|
|
|
|
LAMEXP_MAKE_ID(licenseAccepted, "LicenseAccepted");
|
|
|
|
LAMEXP_MAKE_ID(maximumInstances, "AdvancedOptions/Threading/MaximumInstances");
|
|
|
|
LAMEXP_MAKE_ID(metaInfoPosition, "MetaInformation/PlaylistPosition");
|
|
|
|
LAMEXP_MAKE_ID(mostRecentInputPath, "InputDirectory/MostRecentPath");
|
|
|
|
LAMEXP_MAKE_ID(neroAACEnable2Pass, "AdvancedOptions/AACEnc/Enable2Pass");
|
|
|
|
LAMEXP_MAKE_ID(neroAacNotificationsEnabled, "Flags/EnableNeroAacNotifications");
|
|
|
|
LAMEXP_MAKE_ID(normalizationFilterEnabled, "AdvancedOptions/VolumeNormalization/Enabled");
|
2015-03-21 19:06:55 +01:00
|
|
|
LAMEXP_MAKE_ID(normalizationFilterDynamic, "AdvancedOptions/VolumeNormalization/UseDynAudNorm");
|
|
|
|
LAMEXP_MAKE_ID(normalizationFilterCoupled, "AdvancedOptions/VolumeNormalization/ChannelCoupling");
|
2013-07-07 23:49:29 +02:00
|
|
|
LAMEXP_MAKE_ID(normalizationFilterMaxVolume, "AdvancedOptions/VolumeNormalization/MaxVolume");
|
2015-03-21 19:06:55 +01:00
|
|
|
LAMEXP_MAKE_ID(normalizationFilterSize, "AdvancedOptions/VolumeNormalization/FilterLength");
|
2013-10-02 16:39:26 +02:00
|
|
|
LAMEXP_MAKE_ID(opusComplexity, "AdvancedOptions/Opus/EncodingComplexity");
|
|
|
|
LAMEXP_MAKE_ID(opusDisableResample, "AdvancedOptions/Opus/DisableResample");
|
|
|
|
LAMEXP_MAKE_ID(opusFramesize, "AdvancedOptions/Opus/FrameSize");
|
|
|
|
LAMEXP_MAKE_ID(opusOptimizeFor, "AdvancedOptions/Opus/OptimizeForSignalType");
|
|
|
|
LAMEXP_MAKE_ID(outputDir, "OutputDirectory/SelectedPath");
|
|
|
|
LAMEXP_MAKE_ID(outputToSourceDir, "OutputDirectory/OutputToSourceFolder");
|
2015-11-07 21:39:33 +01:00
|
|
|
LAMEXP_MAKE_ID(overwriteMode, "AdvancedOptions/FileOperations/OverwriteMode");
|
2013-10-02 16:39:26 +02:00
|
|
|
LAMEXP_MAKE_ID(prependRelativeSourcePath, "OutputDirectory/PrependRelativeSourcePath");
|
2015-05-09 23:33:07 +02:00
|
|
|
LAMEXP_MAKE_ID(renameFiles_regExpEnabled, "AdvancedOptions/RenameOutputFiles/RegExp/Enabled");
|
|
|
|
LAMEXP_MAKE_ID(renameFiles_regExpSearch, "AdvancedOptions/RenameOutputFiles/RegExp/SearchPattern");
|
|
|
|
LAMEXP_MAKE_ID(renameFiles_regExpReplace, "AdvancedOptions/RenameOutputFiles/RegExp/Replacement");
|
|
|
|
LAMEXP_MAKE_ID(renameFiles_renameEnabled, "AdvancedOptions/RenameOutputFiles/Rename/Enabled");
|
|
|
|
LAMEXP_MAKE_ID(renameFiles_renamePattern, "AdvancedOptions/RenameOutputFiles/Rename/Pattern");
|
2015-05-10 16:34:07 +02:00
|
|
|
LAMEXP_MAKE_ID(renameFiles_fileExtension, "AdvancedOptions/RenameOutputFiles/FileExtensions/Overwrite");
|
2013-10-02 16:39:26 +02:00
|
|
|
LAMEXP_MAKE_ID(samplingRate, "AdvancedOptions/Common/Resampling");
|
|
|
|
LAMEXP_MAKE_ID(shellIntegrationEnabled, "Flags/EnableShellIntegration");
|
|
|
|
LAMEXP_MAKE_ID(slowStartup, "Flags/SlowStartupDetected");
|
|
|
|
LAMEXP_MAKE_ID(soundsEnabled, "Flags/EnableSounds");
|
|
|
|
LAMEXP_MAKE_ID(toneAdjustBass, "AdvancedOptions/ToneAdjustment/Bass");
|
|
|
|
LAMEXP_MAKE_ID(toneAdjustTreble, "AdvancedOptions/ToneAdjustment/Treble");
|
|
|
|
LAMEXP_MAKE_ID(versionNumber, "VersionNumber");
|
|
|
|
LAMEXP_MAKE_ID(writeMetaTags, "Flags/WriteMetaTags");
|
2011-02-10 16:08:03 +01:00
|
|
|
|
2010-11-21 21:51:22 +01:00
|
|
|
//LUT
|
2011-01-23 02:19:18 +01:00
|
|
|
const int SettingsModel::samplingRates[8] = {0, 16000, 22050, 24000, 32000, 44100, 48000, -1};
|
2010-11-15 21:07:58 +01:00
|
|
|
|
2010-11-12 19:02:01 +01:00
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
// Constructor
|
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
SettingsModel::SettingsModel(void)
|
2014-12-20 23:44:43 +01:00
|
|
|
:
|
|
|
|
m_configCache(NULL)
|
2010-11-12 19:02:01 +01:00
|
|
|
{
|
2011-08-26 16:32:25 +02:00
|
|
|
QString configPath = "LameXP.ini";
|
2011-01-24 00:04:07 +01:00
|
|
|
|
2014-12-19 23:49:11 +01:00
|
|
|
if(!lamexp_version_portable())
|
2011-01-24 00:04:07 +01:00
|
|
|
{
|
2011-08-26 16:32:25 +02:00
|
|
|
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());
|
|
|
|
}
|
|
|
|
}
|
2011-01-24 00:04:07 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
qDebug("LameXP is running in \"portable\" mode -> config in application dir!\n");
|
|
|
|
QString appPath = QFileInfo(QApplication::applicationFilePath()).canonicalFilePath();
|
2011-08-26 16:32:25 +02:00
|
|
|
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());
|
|
|
|
}
|
2011-01-24 00:04:07 +01:00
|
|
|
}
|
|
|
|
|
2013-07-14 17:13:01 +02:00
|
|
|
//Create settings
|
2013-07-14 19:04:32 +02:00
|
|
|
QSettings *configFile = new QSettings(configPath, QSettings::IniFormat);
|
2013-05-02 23:00:26 +02:00
|
|
|
const QString groupKey = QString().sprintf("LameXP_%u%02u%05u", lamexp_version_major(), lamexp_version_minor(), lamexp_version_confg());
|
2015-10-24 15:27:51 +02:00
|
|
|
const QStringList childGroups = configFile->childGroups();
|
2011-03-05 17:43:57 +01:00
|
|
|
|
2013-07-14 17:13:01 +02:00
|
|
|
//Clean-up settings
|
2015-10-24 15:27:51 +02:00
|
|
|
if (!childGroups.empty())
|
2011-03-05 17:43:57 +01:00
|
|
|
{
|
2015-10-24 15:27:51 +02:00
|
|
|
static const int MAX_GROUPS = 3;
|
2011-03-05 17:43:57 +01:00
|
|
|
QRegExp filter("^LameXP_(\\d+)(\\d\\d)(\\d\\d\\d\\d\\d)$");
|
2015-10-24 15:27:51 +02:00
|
|
|
QStringList obsoleteGroups;
|
|
|
|
for (QStringList::ConstIterator iter = childGroups.constBegin(); iter != childGroups.constEnd(); iter++)
|
2011-03-05 17:43:57 +01:00
|
|
|
{
|
2015-10-24 15:27:51 +02:00
|
|
|
if (filter.indexIn(*iter) >= 0)
|
2011-03-05 17:43:57 +01:00
|
|
|
{
|
2015-10-24 15:27:51 +02:00
|
|
|
quint32 temp[3] = { 0, 0, 0 };
|
|
|
|
if (MUtils::regexp_parse_uint32(filter, temp, 3))
|
|
|
|
{
|
|
|
|
if ((temp[0] < lamexp_version_major()) || ((temp[0] == lamexp_version_major()) && ((temp[1] < lamexp_version_minor()) || ((temp[1] == lamexp_version_minor()) && (temp[2] < lamexp_version_confg())))))
|
|
|
|
{
|
|
|
|
obsoleteGroups.append(*iter);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (obsoleteGroups.count() > MAX_GROUPS)
|
|
|
|
{
|
|
|
|
qSort(obsoleteGroups);
|
|
|
|
for (int i = 0; i < MAX_GROUPS; i++)
|
|
|
|
{
|
|
|
|
obsoleteGroups.removeLast();
|
|
|
|
}
|
|
|
|
for (QStringList::ConstIterator iter = obsoleteGroups.constBegin(); iter != obsoleteGroups.constEnd(); iter++)
|
|
|
|
{
|
|
|
|
qWarning("Deleting obsolete group from config: %s", MUTILS_UTF8(*iter));
|
|
|
|
REMOVE_GROUP(configFile, (*iter));
|
2011-03-05 17:43:57 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-07-14 17:13:01 +02:00
|
|
|
//Setup settings
|
2013-07-14 19:04:32 +02:00
|
|
|
configFile->beginGroup(groupKey);
|
|
|
|
configFile->setValue(g_settingsId_versionNumber, QApplication::applicationVersion());
|
|
|
|
configFile->sync();
|
|
|
|
|
|
|
|
//Create the cache
|
|
|
|
m_configCache = new SettingsCache(configFile);
|
2010-11-12 19:02:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
// Destructor
|
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
SettingsModel::~SettingsModel(void)
|
|
|
|
{
|
2014-11-25 02:14:42 +01:00
|
|
|
MUTILS_DELETE(m_configCache);
|
2010-11-12 19:02:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
// Public Functions
|
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
|
2013-07-07 23:49:29 +02:00
|
|
|
#define CHECK_RCMODE(NAME) do\
|
|
|
|
{ \
|
|
|
|
if(this->compressionRCMode##NAME() < SettingsModel::VBRMode || this->compressionRCMode##NAME() >= SettingsModel::RCMODE_COUNT) \
|
|
|
|
{ \
|
|
|
|
this->compressionRCMode##NAME(SettingsModel::VBRMode); \
|
|
|
|
} \
|
|
|
|
} \
|
|
|
|
while(0)
|
|
|
|
|
2010-11-15 04:42:06 +01:00
|
|
|
void SettingsModel::validate(void)
|
|
|
|
{
|
2013-07-07 23:49:29 +02:00
|
|
|
if(this->compressionEncoder() < SettingsModel::MP3Encoder || this->compressionEncoder() >= SettingsModel::ENCODER_COUNT)
|
2010-11-15 04:42:06 +01:00
|
|
|
{
|
|
|
|
this->compressionEncoder(SettingsModel::MP3Encoder);
|
|
|
|
}
|
2010-12-30 16:12:21 +01:00
|
|
|
|
2013-07-07 23:49:29 +02:00
|
|
|
CHECK_RCMODE(LAME);
|
|
|
|
CHECK_RCMODE(OggEnc);
|
|
|
|
CHECK_RCMODE(AacEnc);
|
|
|
|
CHECK_RCMODE(Aften);
|
|
|
|
CHECK_RCMODE(OpusEnc);
|
2010-12-30 16:12:21 +01:00
|
|
|
|
2014-01-19 17:33:39 +01:00
|
|
|
if(EncoderRegistry::getAacEncoder() == AAC_ENCODER_NONE)
|
2010-11-15 04:42:06 +01:00
|
|
|
{
|
2014-01-19 17:33:39 +01:00
|
|
|
if(this->compressionEncoder() == SettingsModel::AACEncoder)
|
2010-12-03 23:01:17 +01:00
|
|
|
{
|
2014-01-19 17:33:39 +01:00
|
|
|
qWarning("AAC encoder selected, but not available any more. Reverting to MP3!");
|
|
|
|
this->compressionEncoder(SettingsModel::MP3Encoder);
|
2010-12-03 23:01:17 +01:00
|
|
|
}
|
2010-11-15 04:42:06 +01:00
|
|
|
}
|
2010-12-30 16:12:21 +01:00
|
|
|
|
2019-10-26 21:59:27 +02:00
|
|
|
if(this->outputDir().isEmpty() || (!dir_exists(this->outputDir())))
|
2010-11-20 02:14:22 +01:00
|
|
|
{
|
2019-10-26 21:59:27 +02:00
|
|
|
qWarning("Output directory not set yet or does NOT exist anymore -> resetting!");
|
|
|
|
const QString outputDir = find_existing_ancestor(this->outputDir());
|
|
|
|
this->outputDir((!outputDir.isEmpty()) ? outputDir : defaultDirectory());
|
2011-08-23 18:48:16 +02:00
|
|
|
}
|
|
|
|
|
2019-10-26 21:59:27 +02:00
|
|
|
if(this->mostRecentInputPath().isEmpty() || (!dir_exists(this->mostRecentInputPath())))
|
2011-08-23 18:48:16 +02:00
|
|
|
{
|
2019-10-26 21:59:27 +02:00
|
|
|
qWarning("Most recent input directory not set yet or does NOT exist anymore -> resetting!");
|
|
|
|
const QString inputPath = find_existing_ancestor(this->mostRecentInputPath());
|
|
|
|
this->mostRecentInputPath((!inputPath.isEmpty()) ? inputPath : defaultDirectory());
|
2010-11-20 02:14:22 +01:00
|
|
|
}
|
2010-12-30 16:12:21 +01:00
|
|
|
|
2012-10-14 22:21:57 +02:00
|
|
|
if(!this->currentLanguageFile().isEmpty())
|
|
|
|
{
|
|
|
|
const QString qmPath = QFileInfo(this->currentLanguageFile()).canonicalFilePath();
|
2012-10-15 00:41:38 +02:00
|
|
|
if(qmPath.isEmpty() || (!(QFileInfo(qmPath).exists() && QFileInfo(qmPath).isFile() && (QFileInfo(qmPath).suffix().compare("qm", Qt::CaseInsensitive) == 0))))
|
2012-10-14 22:21:57 +02:00
|
|
|
{
|
2012-10-15 00:41:38 +02:00
|
|
|
qWarning("Current language file missing, reverting to built-in translator!");
|
2012-10-14 22:21:57 +02:00
|
|
|
this->currentLanguageFile(QString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-12-20 23:44:43 +01:00
|
|
|
QStringList translations;
|
|
|
|
if(MUtils::Translation::enumerate(translations) > 0)
|
2010-12-30 16:12:21 +01:00
|
|
|
{
|
2014-12-20 23:44:43 +01:00
|
|
|
if(!translations.contains(this->currentLanguage(), Qt::CaseInsensitive))
|
|
|
|
{
|
|
|
|
qWarning("Current language \"%s\" is unknown, reverting to default language!", this->currentLanguage().toLatin1().constData());
|
|
|
|
this->currentLanguage(defaultLanguage());
|
|
|
|
}
|
2010-12-30 16:12:21 +01:00
|
|
|
}
|
2011-10-22 01:34:24 +02:00
|
|
|
|
|
|
|
if(this->hibernateComputer())
|
|
|
|
{
|
2014-12-04 00:02:42 +01:00
|
|
|
if(!MUtils::OS::is_hibernation_supported())
|
2011-10-22 01:34:24 +02:00
|
|
|
{
|
|
|
|
this->hibernateComputer(false);
|
|
|
|
}
|
|
|
|
}
|
2012-11-08 00:42:55 +01:00
|
|
|
|
|
|
|
if(this->overwriteMode() < SettingsModel::Overwrite_KeepBoth || this->overwriteMode() > SettingsModel::Overwrite_Replaces)
|
|
|
|
{
|
|
|
|
this->overwriteMode(SettingsModel::Overwrite_KeepBoth);
|
|
|
|
}
|
2010-11-15 04:42:06 +01:00
|
|
|
}
|
|
|
|
|
2012-10-10 23:01:58 +02:00
|
|
|
void SettingsModel::syncNow(void)
|
|
|
|
{
|
2013-07-14 19:04:32 +02:00
|
|
|
m_configCache->flushValues();
|
2012-10-10 23:01:58 +02:00
|
|
|
}
|
|
|
|
|
2013-07-14 19:45:28 +02:00
|
|
|
////////////////////////////////////////////////////////////
|
2011-01-02 01:09:05 +01:00
|
|
|
// Private Functions
|
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
|
2013-01-18 01:08:58 +01:00
|
|
|
QString SettingsModel::defaultLanguage(void) const
|
2011-01-02 01:09:05 +01:00
|
|
|
{
|
2014-12-20 23:44:43 +01:00
|
|
|
QMutexLocker lock(&m_defaultLangLock);
|
2013-07-14 19:04:32 +02:00
|
|
|
|
|
|
|
//Default already initialized?
|
2014-12-20 23:44:43 +01:00
|
|
|
if(!m_defaultLanguage.isNull())
|
2013-07-14 19:04:32 +02:00
|
|
|
{
|
|
|
|
return *m_defaultLanguage;
|
|
|
|
}
|
|
|
|
|
2011-12-19 17:26:20 +01:00
|
|
|
//Detect system langauge
|
2011-01-02 20:47:26 +01:00
|
|
|
QLocale systemLanguage= QLocale::system();
|
2011-12-19 17:26:20 +01:00
|
|
|
qDebug("[Locale]");
|
2014-11-25 02:14:42 +01:00
|
|
|
qDebug("Language: %s (%d)", MUTILS_UTF8(QLocale::languageToString(systemLanguage.language())), systemLanguage.language());
|
|
|
|
qDebug("Country is: %s (%d)", MUTILS_UTF8(QLocale::countryToString(systemLanguage.country())), systemLanguage.country());
|
|
|
|
qDebug("Script is: %s (%d)\n", MUTILS_UTF8(QLocale::scriptToString(systemLanguage.script())), systemLanguage.script());
|
2011-12-19 17:26:20 +01:00
|
|
|
|
|
|
|
//Check if we can use the default translation
|
2011-12-19 15:48:50 +01:00
|
|
|
if(systemLanguage.language() == QLocale::English /*|| systemLanguage.language() == QLocale::C*/)
|
2011-01-02 01:09:05 +01:00
|
|
|
{
|
2014-12-20 23:44:43 +01:00
|
|
|
m_defaultLanguage.reset(new QString(MUtils::Translation::DEFAULT_LANGID));
|
|
|
|
return MUtils::Translation::DEFAULT_LANGID;
|
2011-01-02 01:09:05 +01:00
|
|
|
}
|
|
|
|
|
2014-12-20 23:44:43 +01:00
|
|
|
QStringList languages;
|
|
|
|
if(MUtils::Translation::enumerate(languages) > 0)
|
2011-01-02 01:09:05 +01:00
|
|
|
{
|
2014-12-20 23:44:43 +01:00
|
|
|
//Try to find a suitable translation for the user's system language *and* country
|
|
|
|
for(QStringList::ConstIterator iter = languages.constBegin(); iter != languages.constEnd(); iter++)
|
2011-01-02 01:09:05 +01:00
|
|
|
{
|
2014-12-20 23:44:43 +01:00
|
|
|
if(MUtils::Translation::get_sysid(*iter) == systemLanguage.language())
|
2011-12-19 15:48:50 +01:00
|
|
|
{
|
2014-12-20 23:44:43 +01:00
|
|
|
if(MUtils::Translation::get_country(*iter) == systemLanguage.country())
|
|
|
|
{
|
|
|
|
m_defaultLanguage.reset(new QString(*iter));
|
|
|
|
return (*iter);
|
|
|
|
}
|
2011-12-19 15:48:50 +01:00
|
|
|
}
|
2011-01-02 01:09:05 +01:00
|
|
|
}
|
|
|
|
|
2014-12-20 23:44:43 +01:00
|
|
|
//Try to find a suitable translation for the user's system language
|
|
|
|
for(QStringList::ConstIterator iter = languages.constBegin(); iter != languages.constEnd(); iter++)
|
2011-12-19 17:26:20 +01:00
|
|
|
{
|
2014-12-20 23:44:43 +01:00
|
|
|
if(MUtils::Translation::get_sysid(*iter) == systemLanguage.language())
|
|
|
|
{
|
|
|
|
m_defaultLanguage.reset(new QString(*iter));
|
|
|
|
return (*iter);
|
|
|
|
}
|
2011-12-19 17:26:20 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-01-02 01:09:05 +01:00
|
|
|
//Fall back to the default translation
|
2014-12-20 23:44:43 +01:00
|
|
|
m_defaultLanguage.reset(new QString(MUtils::Translation::DEFAULT_LANGID));
|
|
|
|
return MUtils::Translation::DEFAULT_LANGID;
|
2011-01-02 01:09:05 +01:00
|
|
|
}
|
|
|
|
|
2013-07-09 22:34:06 +02:00
|
|
|
QString SettingsModel::defaultDirectory(void) const
|
|
|
|
{
|
|
|
|
QString defaultLocation = initDirectory(QDesktopServices::storageLocation(QDesktopServices::MusicLocation));
|
|
|
|
|
|
|
|
if(defaultLocation.isEmpty())
|
|
|
|
{
|
|
|
|
defaultLocation = initDirectory(QDesktopServices::storageLocation(QDesktopServices::HomeLocation));
|
|
|
|
|
|
|
|
if(defaultLocation.isEmpty())
|
|
|
|
{
|
|
|
|
defaultLocation = initDirectory(QDir::currentPath());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return defaultLocation;
|
|
|
|
}
|
|
|
|
|
|
|
|
QString SettingsModel::initDirectory(const QString &path) const
|
2011-08-26 16:32:25 +02:00
|
|
|
{
|
|
|
|
if(path.isEmpty())
|
|
|
|
{
|
|
|
|
return QString();
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!QDir(path).exists())
|
|
|
|
{
|
|
|
|
for(int i = 0; i < 32; i++)
|
|
|
|
{
|
|
|
|
if(QDir(path).mkpath(".")) break;
|
2014-11-30 21:32:23 +01:00
|
|
|
MUtils::OS::sleep_ms(1);
|
2011-08-26 16:32:25 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!QDir(path).exists())
|
|
|
|
{
|
|
|
|
return QString();
|
|
|
|
}
|
|
|
|
|
|
|
|
return QDir(path).canonicalPath();
|
|
|
|
}
|
|
|
|
|
2010-11-15 04:42:06 +01:00
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
// Getter and Setter
|
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
|
2013-07-07 23:49:29 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(aacEncProfile, 0)
|
|
|
|
LAMEXP_MAKE_OPTION_I(aftenAudioCodingMode, 0)
|
|
|
|
LAMEXP_MAKE_OPTION_I(aftenDynamicRangeCompression, 5)
|
|
|
|
LAMEXP_MAKE_OPTION_I(aftenExponentSearchSize, 8)
|
|
|
|
LAMEXP_MAKE_OPTION_B(aftenFastBitAllocation, false)
|
|
|
|
LAMEXP_MAKE_OPTION_B(antivirNotificationsEnabled, true)
|
|
|
|
LAMEXP_MAKE_OPTION_B(autoUpdateCheckBeta, false)
|
2014-12-19 23:49:11 +01:00
|
|
|
LAMEXP_MAKE_OPTION_B(autoUpdateEnabled, (!lamexp_version_portable()));
|
2013-07-07 23:49:29 +02:00
|
|
|
LAMEXP_MAKE_OPTION_S(autoUpdateLastCheck, "Never")
|
|
|
|
LAMEXP_MAKE_OPTION_B(bitrateManagementEnabled, false)
|
|
|
|
LAMEXP_MAKE_OPTION_I(bitrateManagementMaxRate, 500)
|
|
|
|
LAMEXP_MAKE_OPTION_I(bitrateManagementMinRate, 32)
|
2013-10-07 02:28:01 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionAbrBitrateAacEnc, 19)
|
2013-10-03 19:14:24 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionAbrBitrateAften, 17)
|
|
|
|
LAMEXP_MAKE_OPTION_I(compressionAbrBitrateDcaEnc, 13)
|
|
|
|
LAMEXP_MAKE_OPTION_I(compressionAbrBitrateFLAC, 5)
|
2013-10-03 15:56:10 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionAbrBitrateLAME, 10)
|
2013-12-04 22:36:19 +01:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionAbrBitrateMacEnc, 2)
|
2013-10-03 19:14:24 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionAbrBitrateOggEnc, 16)
|
|
|
|
LAMEXP_MAKE_OPTION_I(compressionAbrBitrateOpusEnc, 11)
|
2013-10-03 15:56:10 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionAbrBitrateWave, 0)
|
2013-10-07 02:28:01 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionCbrBitrateAacEnc, 19)
|
2013-10-03 19:14:24 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionCbrBitrateAften, 17)
|
|
|
|
LAMEXP_MAKE_OPTION_I(compressionCbrBitrateDcaEnc, 13)
|
|
|
|
LAMEXP_MAKE_OPTION_I(compressionCbrBitrateFLAC, 5)
|
2013-10-03 15:56:10 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionCbrBitrateLAME, 10)
|
2013-12-04 22:36:19 +01:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionCbrBitrateMacEnc, 2)
|
2013-10-03 19:14:24 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionCbrBitrateOggEnc, 16)
|
|
|
|
LAMEXP_MAKE_OPTION_I(compressionCbrBitrateOpusEnc, 11)
|
2013-10-03 15:56:10 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionCbrBitrateWave, 0)
|
2011-05-03 14:28:06 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionEncoder, 0)
|
2013-07-07 23:49:29 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionRCModeAacEnc, 0)
|
|
|
|
LAMEXP_MAKE_OPTION_I(compressionRCModeAften, 0)
|
2013-10-03 19:14:24 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionRCModeDcaEnc, 2)
|
2013-10-02 16:39:26 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionRCModeFLAC, 0)
|
2013-07-07 23:49:29 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionRCModeLAME, 0)
|
2013-12-04 22:36:19 +01:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionRCModeMacEnc, 0)
|
2013-07-07 23:49:29 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionRCModeOggEnc, 0)
|
|
|
|
LAMEXP_MAKE_OPTION_I(compressionRCModeOpusEnc, 0)
|
2013-10-03 19:14:24 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionRCModeWave, 2)
|
2013-10-03 15:56:10 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionVbrQualityAacEnc, 10)
|
2013-10-03 19:14:24 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionVbrQualityAften, 15)
|
|
|
|
LAMEXP_MAKE_OPTION_I(compressionVbrQualityDcaEnc, 13)
|
|
|
|
LAMEXP_MAKE_OPTION_I(compressionVbrQualityFLAC, 5)
|
2013-10-03 15:56:10 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionVbrQualityLAME, 7)
|
2013-12-04 22:36:19 +01:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionVbrQualityMacEnc, 2)
|
2013-10-03 19:14:24 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionVbrQualityOggEnc, 7)
|
|
|
|
LAMEXP_MAKE_OPTION_I(compressionVbrQualityOpusEnc, 11)
|
2013-10-03 15:56:10 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionVbrQualityWave, 0)
|
2011-05-03 14:28:06 +02:00
|
|
|
LAMEXP_MAKE_OPTION_B(createPlaylist, true)
|
|
|
|
LAMEXP_MAKE_OPTION_S(currentLanguage, defaultLanguage())
|
2012-10-14 22:21:57 +02:00
|
|
|
LAMEXP_MAKE_OPTION_S(currentLanguageFile, QString())
|
2013-07-07 23:49:29 +02:00
|
|
|
LAMEXP_MAKE_OPTION_S(customParametersAacEnc, QString())
|
|
|
|
LAMEXP_MAKE_OPTION_S(customParametersAften, QString())
|
2013-10-03 17:01:37 +02:00
|
|
|
LAMEXP_MAKE_OPTION_S(customParametersDcaEnc, QString())
|
2013-07-07 23:49:29 +02:00
|
|
|
LAMEXP_MAKE_OPTION_S(customParametersFLAC, QString())
|
|
|
|
LAMEXP_MAKE_OPTION_S(customParametersLAME, QString())
|
2013-12-04 22:36:19 +01:00
|
|
|
LAMEXP_MAKE_OPTION_S(customParametersMacEnc, QString())
|
2013-07-07 23:49:29 +02:00
|
|
|
LAMEXP_MAKE_OPTION_S(customParametersOggEnc, QString())
|
2013-10-03 17:01:37 +02:00
|
|
|
LAMEXP_MAKE_OPTION_S(customParametersOpusEnc, QString())
|
|
|
|
LAMEXP_MAKE_OPTION_S(customParametersWave, QString())
|
2013-07-07 23:49:29 +02:00
|
|
|
LAMEXP_MAKE_OPTION_S(customTempPath, QDesktopServices::storageLocation(QDesktopServices::TempLocation))
|
|
|
|
LAMEXP_MAKE_OPTION_B(customTempPathEnabled, false)
|
|
|
|
LAMEXP_MAKE_OPTION_B(dropBoxWidgetEnabled, true)
|
2013-11-02 01:07:23 +01:00
|
|
|
LAMEXP_MAKE_OPTION_I(dropBoxWidgetPositionX, -1)
|
|
|
|
LAMEXP_MAKE_OPTION_I(dropBoxWidgetPositionY, -1)
|
2013-07-07 23:49:29 +02:00
|
|
|
LAMEXP_MAKE_OPTION_S(favoriteOutputFolders, QString())
|
|
|
|
LAMEXP_MAKE_OPTION_B(forceStereoDownmix, false)
|
|
|
|
LAMEXP_MAKE_OPTION_B(hibernateComputer, false)
|
|
|
|
LAMEXP_MAKE_OPTION_I(interfaceStyle, 0)
|
2015-11-07 21:39:33 +01:00
|
|
|
LAMEXP_MAKE_OPTION_B(keepOriginalDataTime, false)
|
2013-03-13 22:59:54 +01:00
|
|
|
LAMEXP_MAKE_OPTION_I(lameAlgoQuality, 2)
|
2011-08-05 21:52:43 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(lameChannelMode, 0)
|
2013-07-07 23:49:29 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(licenseAccepted, 0)
|
|
|
|
LAMEXP_MAKE_OPTION_U(maximumInstances, 0)
|
|
|
|
LAMEXP_MAKE_OPTION_U(metaInfoPosition, UINT_MAX)
|
2013-07-09 22:34:06 +02:00
|
|
|
LAMEXP_MAKE_OPTION_S(mostRecentInputPath, defaultDirectory())
|
2011-05-03 14:28:06 +02:00
|
|
|
LAMEXP_MAKE_OPTION_B(neroAACEnable2Pass, true)
|
2013-07-07 23:49:29 +02:00
|
|
|
LAMEXP_MAKE_OPTION_B(neroAacNotificationsEnabled, true)
|
2011-05-03 14:28:06 +02:00
|
|
|
LAMEXP_MAKE_OPTION_B(normalizationFilterEnabled, false)
|
2015-03-21 19:06:55 +01:00
|
|
|
LAMEXP_MAKE_OPTION_B(normalizationFilterDynamic, false)
|
|
|
|
LAMEXP_MAKE_OPTION_B(normalizationFilterCoupled, true)
|
2011-05-03 14:28:06 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(normalizationFilterMaxVolume, -50)
|
2015-03-21 19:06:55 +01:00
|
|
|
LAMEXP_MAKE_OPTION_I(normalizationFilterSize, 31)
|
2013-07-07 23:49:29 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(opusComplexity, 10)
|
|
|
|
LAMEXP_MAKE_OPTION_B(opusDisableResample, false)
|
|
|
|
LAMEXP_MAKE_OPTION_I(opusFramesize, 3)
|
|
|
|
LAMEXP_MAKE_OPTION_I(opusOptimizeFor, 0)
|
2013-07-09 22:34:06 +02:00
|
|
|
LAMEXP_MAKE_OPTION_S(outputDir, defaultDirectory())
|
2013-07-07 23:49:29 +02:00
|
|
|
LAMEXP_MAKE_OPTION_B(outputToSourceDir, false)
|
|
|
|
LAMEXP_MAKE_OPTION_I(overwriteMode, Overwrite_KeepBoth)
|
|
|
|
LAMEXP_MAKE_OPTION_B(prependRelativeSourcePath, false)
|
2015-05-09 23:33:07 +02:00
|
|
|
LAMEXP_MAKE_OPTION_B(renameFiles_regExpEnabled, false)
|
|
|
|
LAMEXP_MAKE_OPTION_S(renameFiles_regExpSearch, QString())
|
|
|
|
LAMEXP_MAKE_OPTION_S(renameFiles_regExpReplace, QString())
|
|
|
|
LAMEXP_MAKE_OPTION_B(renameFiles_renameEnabled, false)
|
|
|
|
LAMEXP_MAKE_OPTION_S(renameFiles_renamePattern, "[<TrackNo>] <Artist> - <Title>")
|
2015-05-10 16:34:07 +02:00
|
|
|
LAMEXP_MAKE_OPTION_S(renameFiles_fileExtension, QString())
|
2013-07-07 23:49:29 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(samplingRate, 0)
|
2014-12-19 23:49:11 +01:00
|
|
|
LAMEXP_MAKE_OPTION_B(shellIntegrationEnabled, !lamexp_version_portable())
|
2013-07-07 23:49:29 +02:00
|
|
|
LAMEXP_MAKE_OPTION_B(slowStartup, false)
|
|
|
|
LAMEXP_MAKE_OPTION_B(soundsEnabled, true)
|
2011-05-03 14:28:06 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(toneAdjustBass, 0)
|
|
|
|
LAMEXP_MAKE_OPTION_I(toneAdjustTreble, 0)
|
2013-07-07 23:49:29 +02:00
|
|
|
LAMEXP_MAKE_OPTION_B(writeMetaTags, true)
|