2010-11-12 19:02:01 +01:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// LameXP - Audio Encoder Front-End
|
2017-03-12 12:12:49 +01:00
|
|
|
// Copyright (C) 2004-2017 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
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation; either version 2 of the License, or
|
2013-10-23 20:56:57 +02:00
|
|
|
// (at your option) any later version, but always including the *additional*
|
|
|
|
// restrictions defined in the "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
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2014-12-20 23:44:43 +01:00
|
|
|
#include <QMutex>
|
|
|
|
#include <QScopedPointer>
|
|
|
|
|
2010-11-20 02:14:22 +01:00
|
|
|
class QString;
|
2013-07-14 19:04:32 +02:00
|
|
|
class SettingsCache;
|
2010-11-12 19:02:01 +01:00
|
|
|
|
2011-02-10 16:08:03 +01:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2011-05-03 14:28:06 +02:00
|
|
|
#define LAMEXP_MAKE_OPTION_I(OPT) \
|
2013-01-18 01:08:58 +01:00
|
|
|
int OPT(void) const; \
|
2011-01-23 02:19:18 +01:00
|
|
|
void OPT(int value); \
|
|
|
|
int OPT##Default(void);
|
2010-11-21 21:51:22 +01:00
|
|
|
|
2011-05-03 14:28:06 +02:00
|
|
|
#define LAMEXP_MAKE_OPTION_S(OPT) \
|
2013-01-18 01:08:58 +01:00
|
|
|
QString OPT(void) const; \
|
2011-01-23 02:19:18 +01:00
|
|
|
void OPT(const QString &value); \
|
|
|
|
QString OPT##Default(void);
|
2010-11-21 21:51:22 +01:00
|
|
|
|
2011-05-03 14:28:06 +02:00
|
|
|
#define LAMEXP_MAKE_OPTION_B(OPT) \
|
2013-01-18 01:08:58 +01:00
|
|
|
bool OPT(void) const; \
|
2011-01-23 02:19:18 +01:00
|
|
|
void OPT(bool value); \
|
|
|
|
bool OPT##Default(void);
|
2010-11-15 04:42:06 +01:00
|
|
|
|
2011-05-03 14:28:06 +02:00
|
|
|
#define LAMEXP_MAKE_OPTION_U(OPT) \
|
2013-01-18 01:08:58 +01:00
|
|
|
unsigned int OPT(void) const; \
|
2011-02-10 16:08:03 +01:00
|
|
|
void OPT(unsigned int value); \
|
|
|
|
unsigned int OPT##Default(void);
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2010-11-12 19:02:01 +01:00
|
|
|
class SettingsModel
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SettingsModel(void);
|
|
|
|
~SettingsModel(void);
|
|
|
|
|
2010-11-15 04:42:06 +01:00
|
|
|
//Enums
|
|
|
|
enum Encoder
|
|
|
|
{
|
2013-12-04 22:36:19 +01:00
|
|
|
MP3Encoder = 0,
|
2010-11-15 04:42:06 +01:00
|
|
|
VorbisEncoder = 1,
|
2013-12-04 22:36:19 +01:00
|
|
|
AACEncoder = 2,
|
|
|
|
AC3Encoder = 3,
|
|
|
|
FLACEncoder = 4,
|
|
|
|
OpusEncoder = 5,
|
|
|
|
DCAEncoder = 6,
|
|
|
|
MACEncoder = 7,
|
|
|
|
PCMEncoder = 8,
|
|
|
|
ENCODER_COUNT = 9
|
2010-11-15 04:42:06 +01:00
|
|
|
};
|
2013-07-07 23:49:29 +02:00
|
|
|
|
2010-11-15 04:42:06 +01:00
|
|
|
enum RCMode
|
|
|
|
{
|
|
|
|
VBRMode = 0,
|
|
|
|
ABRMode = 1,
|
2013-07-07 23:49:29 +02:00
|
|
|
CBRMode = 2,
|
|
|
|
RCMODE_COUNT = 3
|
2010-11-15 04:42:06 +01:00
|
|
|
};
|
2013-07-07 23:49:29 +02:00
|
|
|
|
2012-11-08 00:42:55 +01:00
|
|
|
enum Overwrite
|
|
|
|
{
|
|
|
|
Overwrite_KeepBoth = 0,
|
|
|
|
Overwrite_SkipFile = 1,
|
|
|
|
Overwrite_Replaces = 2
|
|
|
|
};
|
2010-11-15 04:42:06 +01:00
|
|
|
|
2013-07-14 19:45:28 +02:00
|
|
|
enum AACEncoderType
|
|
|
|
{
|
|
|
|
AAC_ENCODER_NONE = 0,
|
|
|
|
AAC_ENCODER_NERO = 1,
|
|
|
|
AAC_ENCODER_FHG = 2,
|
2015-04-24 20:36:05 +02:00
|
|
|
AAC_ENCODER_FDK = 3,
|
|
|
|
AAC_ENCODER_QAAC = 4,
|
2013-07-14 19:45:28 +02:00
|
|
|
};
|
|
|
|
|
2010-11-15 21:07:58 +01:00
|
|
|
//Consts
|
2011-01-23 02:19:18 +01:00
|
|
|
static const int samplingRates[8];
|
2010-11-15 21:07:58 +01:00
|
|
|
|
2010-11-21 21:51:22 +01:00
|
|
|
//Getters & setters
|
2013-07-07 23:49:29 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(aacEncProfile)
|
|
|
|
LAMEXP_MAKE_OPTION_I(aftenAudioCodingMode)
|
|
|
|
LAMEXP_MAKE_OPTION_I(aftenDynamicRangeCompression)
|
|
|
|
LAMEXP_MAKE_OPTION_I(aftenExponentSearchSize)
|
|
|
|
LAMEXP_MAKE_OPTION_B(aftenFastBitAllocation)
|
|
|
|
LAMEXP_MAKE_OPTION_B(antivirNotificationsEnabled)
|
|
|
|
LAMEXP_MAKE_OPTION_B(autoUpdateCheckBeta)
|
|
|
|
LAMEXP_MAKE_OPTION_B(autoUpdateEnabled)
|
|
|
|
LAMEXP_MAKE_OPTION_S(autoUpdateLastCheck)
|
|
|
|
LAMEXP_MAKE_OPTION_B(bitrateManagementEnabled)
|
|
|
|
LAMEXP_MAKE_OPTION_I(bitrateManagementMaxRate)
|
|
|
|
LAMEXP_MAKE_OPTION_I(bitrateManagementMinRate)
|
2013-10-03 15:56:10 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionAbrBitrateAacEnc)
|
|
|
|
LAMEXP_MAKE_OPTION_I(compressionAbrBitrateAften)
|
|
|
|
LAMEXP_MAKE_OPTION_I(compressionAbrBitrateDcaEnc)
|
|
|
|
LAMEXP_MAKE_OPTION_I(compressionAbrBitrateFLAC)
|
|
|
|
LAMEXP_MAKE_OPTION_I(compressionAbrBitrateLAME)
|
2013-12-04 22:36:19 +01:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionAbrBitrateMacEnc)
|
2013-10-03 15:56:10 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionAbrBitrateOggEnc)
|
|
|
|
LAMEXP_MAKE_OPTION_I(compressionAbrBitrateOpusEnc)
|
|
|
|
LAMEXP_MAKE_OPTION_I(compressionAbrBitrateWave)
|
|
|
|
LAMEXP_MAKE_OPTION_I(compressionCbrBitrateAacEnc)
|
|
|
|
LAMEXP_MAKE_OPTION_I(compressionCbrBitrateAften)
|
|
|
|
LAMEXP_MAKE_OPTION_I(compressionCbrBitrateDcaEnc)
|
|
|
|
LAMEXP_MAKE_OPTION_I(compressionCbrBitrateFLAC)
|
|
|
|
LAMEXP_MAKE_OPTION_I(compressionCbrBitrateLAME)
|
2013-12-04 22:36:19 +01:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionCbrBitrateMacEnc)
|
2013-10-03 15:56:10 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionCbrBitrateOggEnc)
|
|
|
|
LAMEXP_MAKE_OPTION_I(compressionCbrBitrateOpusEnc)
|
|
|
|
LAMEXP_MAKE_OPTION_I(compressionCbrBitrateWave)
|
2013-07-07 23:49:29 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionEncoder)
|
|
|
|
LAMEXP_MAKE_OPTION_I(compressionRCModeAacEnc)
|
|
|
|
LAMEXP_MAKE_OPTION_I(compressionRCModeAften)
|
2013-10-02 16:39:26 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionRCModeDcaEnc)
|
|
|
|
LAMEXP_MAKE_OPTION_I(compressionRCModeFLAC)
|
2013-07-07 23:49:29 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionRCModeLAME)
|
2013-12-04 22:36:19 +01:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionRCModeMacEnc)
|
2013-07-07 23:49:29 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionRCModeOggEnc)
|
|
|
|
LAMEXP_MAKE_OPTION_I(compressionRCModeOpusEnc)
|
2013-10-02 16:39:26 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionRCModeWave)
|
2013-10-03 15:56:10 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionVbrQualityAacEnc)
|
|
|
|
LAMEXP_MAKE_OPTION_I(compressionVbrQualityAften)
|
|
|
|
LAMEXP_MAKE_OPTION_I(compressionVbrQualityDcaEnc)
|
|
|
|
LAMEXP_MAKE_OPTION_I(compressionVbrQualityFLAC)
|
|
|
|
LAMEXP_MAKE_OPTION_I(compressionVbrQualityLAME)
|
2013-12-04 22:36:19 +01:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionVbrQualityMacEnc)
|
2013-10-03 15:56:10 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(compressionVbrQualityOggEnc)
|
|
|
|
LAMEXP_MAKE_OPTION_I(compressionVbrQualityOpusEnc)
|
|
|
|
LAMEXP_MAKE_OPTION_I(compressionVbrQualityWave)
|
2013-07-07 23:49:29 +02:00
|
|
|
LAMEXP_MAKE_OPTION_B(createPlaylist)
|
|
|
|
LAMEXP_MAKE_OPTION_S(currentLanguage)
|
|
|
|
LAMEXP_MAKE_OPTION_S(currentLanguageFile)
|
|
|
|
LAMEXP_MAKE_OPTION_S(customParametersAacEnc)
|
|
|
|
LAMEXP_MAKE_OPTION_S(customParametersAften)
|
2013-10-03 17:01:37 +02:00
|
|
|
LAMEXP_MAKE_OPTION_S(customParametersDcaEnc)
|
2013-07-07 23:49:29 +02:00
|
|
|
LAMEXP_MAKE_OPTION_S(customParametersFLAC)
|
|
|
|
LAMEXP_MAKE_OPTION_S(customParametersLAME)
|
2013-12-04 22:36:19 +01:00
|
|
|
LAMEXP_MAKE_OPTION_S(customParametersMacEnc)
|
2013-07-07 23:49:29 +02:00
|
|
|
LAMEXP_MAKE_OPTION_S(customParametersOggEnc)
|
2013-10-03 17:01:37 +02:00
|
|
|
LAMEXP_MAKE_OPTION_S(customParametersOpusEnc)
|
|
|
|
LAMEXP_MAKE_OPTION_S(customParametersWave)
|
2013-07-07 23:49:29 +02:00
|
|
|
LAMEXP_MAKE_OPTION_S(customTempPath)
|
|
|
|
LAMEXP_MAKE_OPTION_B(customTempPathEnabled)
|
|
|
|
LAMEXP_MAKE_OPTION_B(dropBoxWidgetEnabled)
|
2013-11-02 01:07:23 +01:00
|
|
|
LAMEXP_MAKE_OPTION_I(dropBoxWidgetPositionX)
|
|
|
|
LAMEXP_MAKE_OPTION_I(dropBoxWidgetPositionY)
|
2013-07-07 23:49:29 +02:00
|
|
|
LAMEXP_MAKE_OPTION_S(favoriteOutputFolders)
|
|
|
|
LAMEXP_MAKE_OPTION_B(forceStereoDownmix)
|
|
|
|
LAMEXP_MAKE_OPTION_B(hibernateComputer)
|
|
|
|
LAMEXP_MAKE_OPTION_I(interfaceStyle)
|
2015-11-07 21:39:33 +01:00
|
|
|
LAMEXP_MAKE_OPTION_B(keepOriginalDataTime)
|
2013-07-07 23:49:29 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(lameAlgoQuality)
|
|
|
|
LAMEXP_MAKE_OPTION_I(lameChannelMode)
|
|
|
|
LAMEXP_MAKE_OPTION_I(licenseAccepted)
|
|
|
|
LAMEXP_MAKE_OPTION_U(maximumInstances)
|
|
|
|
LAMEXP_MAKE_OPTION_U(metaInfoPosition)
|
|
|
|
LAMEXP_MAKE_OPTION_S(mostRecentInputPath)
|
|
|
|
LAMEXP_MAKE_OPTION_B(neroAACEnable2Pass)
|
|
|
|
LAMEXP_MAKE_OPTION_B(neroAacNotificationsEnabled)
|
|
|
|
LAMEXP_MAKE_OPTION_B(normalizationFilterEnabled)
|
2015-03-21 19:06:55 +01:00
|
|
|
LAMEXP_MAKE_OPTION_B(normalizationFilterDynamic)
|
|
|
|
LAMEXP_MAKE_OPTION_B(normalizationFilterCoupled)
|
2013-07-07 23:49:29 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(normalizationFilterMaxVolume)
|
2015-03-21 19:06:55 +01:00
|
|
|
LAMEXP_MAKE_OPTION_I(normalizationFilterSize)
|
2013-07-07 23:49:29 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(opusComplexity)
|
|
|
|
LAMEXP_MAKE_OPTION_B(opusDisableResample)
|
|
|
|
LAMEXP_MAKE_OPTION_I(opusFramesize)
|
|
|
|
LAMEXP_MAKE_OPTION_I(opusOptimizeFor)
|
|
|
|
LAMEXP_MAKE_OPTION_S(outputDir)
|
|
|
|
LAMEXP_MAKE_OPTION_B(outputToSourceDir)
|
|
|
|
LAMEXP_MAKE_OPTION_I(overwriteMode)
|
|
|
|
LAMEXP_MAKE_OPTION_B(prependRelativeSourcePath)
|
2015-05-09 23:33:07 +02:00
|
|
|
LAMEXP_MAKE_OPTION_B(renameFiles_regExpEnabled)
|
|
|
|
LAMEXP_MAKE_OPTION_S(renameFiles_regExpSearch)
|
|
|
|
LAMEXP_MAKE_OPTION_S(renameFiles_regExpReplace)
|
|
|
|
LAMEXP_MAKE_OPTION_B(renameFiles_renameEnabled)
|
|
|
|
LAMEXP_MAKE_OPTION_S(renameFiles_renamePattern)
|
2015-05-10 16:34:07 +02:00
|
|
|
LAMEXP_MAKE_OPTION_S(renameFiles_fileExtension)
|
2013-07-07 23:49:29 +02:00
|
|
|
LAMEXP_MAKE_OPTION_I(samplingRate)
|
|
|
|
LAMEXP_MAKE_OPTION_B(shellIntegrationEnabled)
|
|
|
|
LAMEXP_MAKE_OPTION_B(slowStartup)
|
|
|
|
LAMEXP_MAKE_OPTION_B(soundsEnabled)
|
|
|
|
LAMEXP_MAKE_OPTION_I(toneAdjustBass)
|
|
|
|
LAMEXP_MAKE_OPTION_I(toneAdjustTreble)
|
|
|
|
LAMEXP_MAKE_OPTION_B(writeMetaTags)
|
2010-11-15 04:42:06 +01:00
|
|
|
|
2010-11-21 21:51:22 +01:00
|
|
|
//Misc
|
2010-11-15 04:42:06 +01:00
|
|
|
void validate(void);
|
2012-10-10 23:01:58 +02:00
|
|
|
void syncNow(void);
|
2013-07-14 19:45:28 +02:00
|
|
|
|
2010-11-12 19:02:01 +01:00
|
|
|
private:
|
2014-12-20 23:44:43 +01:00
|
|
|
SettingsModel(const SettingsModel &other) {}
|
|
|
|
SettingsModel &operator=(const SettingsModel &other) { return *this; }
|
2013-07-14 17:13:01 +02:00
|
|
|
|
2013-07-09 22:34:06 +02:00
|
|
|
QString initDirectory(const QString &path) const;
|
2013-01-18 01:08:58 +01:00
|
|
|
QString defaultLanguage(void) const;
|
2013-07-09 22:34:06 +02:00
|
|
|
QString defaultDirectory(void) const;
|
2013-07-14 19:04:32 +02:00
|
|
|
|
2014-12-20 23:44:43 +01:00
|
|
|
SettingsCache *m_configCache;
|
|
|
|
|
|
|
|
mutable QMutex m_defaultLangLock;
|
|
|
|
mutable QScopedPointer<QString> m_defaultLanguage;
|
2010-11-12 19:02:01 +01:00
|
|
|
};
|
2010-11-15 04:42:06 +01:00
|
|
|
|
2011-02-10 16:08:03 +01:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2011-05-03 14:28:06 +02:00
|
|
|
#undef LAMEXP_MAKE_OPTION_I
|
|
|
|
#undef LAMEXP_MAKE_OPTION_S
|
|
|
|
#undef LAMEXP_MAKE_OPTION_B
|
|
|
|
#undef LAMEXP_MAKE_OPTION_U
|