From cfb20fe3cbfb3306eaa99397d27f36f09513bea1 Mon Sep 17 00:00:00 2001 From: lordmulder Date: Wed, 9 Feb 2011 23:36:17 +0100 Subject: [PATCH] Added support for custom encoder parameters. --- etc/Translation/Blank.ts | 24 +++ etc/Translation/LameXP_DE.ts | 24 +++ etc/Translation/LameXP_ES.ts | 24 +++ etc/Translation/LameXP_FR.ts | 24 +++ etc/Translation/LameXP_IT.ts | 24 +++ gui/MainWindow.ui | 313 +++++++++++++++++++++++++++++++++- res/localization/LameXP_DE.qm | Bin 50724 -> 51339 bytes src/Config.h | 2 +- src/Dialog_MainWindow.cpp | 44 ++++- src/Dialog_MainWindow.h | 5 +- src/Dialog_Processing.cpp | 4 + src/Encoder_AAC.cpp | 2 + src/Encoder_Abstract.cpp | 2 + src/Encoder_Abstract.h | 2 + src/Encoder_FLAC.cpp | 2 + src/Encoder_MP3.cpp | 2 + src/Encoder_Vorbis.cpp | 2 + src/Model_Settings.cpp | 8 + src/Model_Settings.h | 4 + 19 files changed, 499 insertions(+), 13 deletions(-) diff --git a/etc/Translation/Blank.ts b/etc/Translation/Blank.ts index eb31a961..48d9f74d 100644 --- a/etc/Translation/Blank.ts +++ b/etc/Translation/Blank.ts @@ -581,6 +581,30 @@ Adjust Bass (dB): + + Custom Encoder Parameters + + + + LAME: + + + + OggEnc2: + + + + Nero AAC: + + + + FLAC: + + + + Warning: Custom parameters won't be checked at all. Use them at your own risk !!! + + Reset Advanced Options diff --git a/etc/Translation/LameXP_DE.ts b/etc/Translation/LameXP_DE.ts index 63b6389e..a28e5aa2 100644 --- a/etc/Translation/LameXP_DE.ts +++ b/etc/Translation/LameXP_DE.ts @@ -1122,6 +1122,30 @@ The LameXP shell integration has been re-enabled. Die LameXP Shell-Integration wurde wieder aktiviert. + + Custom Encoder Parameters + Benutzerdefinierte Parameter + + + LAME: + + + + OggEnc2: + + + + Nero AAC: + + + + FLAC: + + + + Warning: Custom parameters won't be checked at all. Use them at your own risk !!! + Achtung: Benutzerdefinierte Parameter werden nicht überprüft. Benutzung auf eigene Gefahr !!! + MetaInfo diff --git a/etc/Translation/LameXP_ES.ts b/etc/Translation/LameXP_ES.ts index c1bbb895..cc3599a2 100644 --- a/etc/Translation/LameXP_ES.ts +++ b/etc/Translation/LameXP_ES.ts @@ -1122,6 +1122,30 @@ The LameXP shell integration has been re-enabled. Menú contextual de LameXP habilitado. + + Custom Encoder Parameters + + + + LAME: + + + + OggEnc2: + + + + Nero AAC: + + + + FLAC: + + + + Warning: Custom parameters won't be checked at all. Use them at your own risk !!! + + MetaInfo diff --git a/etc/Translation/LameXP_FR.ts b/etc/Translation/LameXP_FR.ts index 5709a676..1012d7b7 100644 --- a/etc/Translation/LameXP_FR.ts +++ b/etc/Translation/LameXP_FR.ts @@ -1124,6 +1124,30 @@ Votre dossier TEMP est situé ici: The LameXP shell integration has been re-enabled. + + Custom Encoder Parameters + + + + LAME: + + + + OggEnc2: + + + + Nero AAC: + + + + FLAC: + + + + Warning: Custom parameters won't be checked at all. Use them at your own risk !!! + + MetaInfo diff --git a/etc/Translation/LameXP_IT.ts b/etc/Translation/LameXP_IT.ts index c5272c8b..43a46f16 100644 --- a/etc/Translation/LameXP_IT.ts +++ b/etc/Translation/LameXP_IT.ts @@ -1122,6 +1122,30 @@ The LameXP shell integration has been re-enabled. + + Custom Encoder Parameters + + + + LAME: + + + + OggEnc2: + + + + Nero AAC: + + + + FLAC: + + + + Warning: Custom parameters won't be checked at all. Use them at your own risk !!! + + MetaInfo diff --git a/gui/MainWindow.ui b/gui/MainWindow.ui index 78b9fb86..041030bf 100644 --- a/gui/MainWindow.ui +++ b/gui/MainWindow.ui @@ -94,6 +94,12 @@ :/icons/add.png:/icons/add.png + + + 16 + 16 + + @@ -111,6 +117,12 @@ :/icons/delete.png:/icons/delete.png + + + 16 + 16 + + @@ -128,6 +140,12 @@ :/icons/bin.png:/icons/bin.png + + + 16 + 16 + + @@ -155,6 +173,12 @@ :/icons/arrow_up.png:/icons/arrow_up.png + + + 16 + 16 + + @@ -166,6 +190,12 @@ :/icons/arrow_down.png:/icons/arrow_down.png + + + 16 + 16 + + @@ -212,6 +242,12 @@ :/icons/zoom.png:/icons/zoom.png + + + 16 + 16 + + @@ -317,6 +353,12 @@ :/icons/house.png:/icons/house.png + + + 16 + 16 + + @@ -334,6 +376,12 @@ :/icons/music.png:/icons/music.png + + + 16 + 16 + + @@ -351,6 +399,12 @@ :/icons/monitor.png:/icons/monitor.png + + + 16 + 16 + + @@ -381,6 +435,12 @@ :/icons/folder_add.png:/icons/folder_add.png + + + 16 + 16 + + @@ -502,6 +562,12 @@ :/icons/table_edit.png:/icons/table_edit.png + + + 16 + 16 + + @@ -548,6 +614,12 @@ :/icons/bomb.png:/icons/bomb.png + + + 16 + 16 + + @@ -985,8 +1057,8 @@ 0 0 - 602 - 609 + 604 + 812 @@ -1894,12 +1966,6 @@ - - - 20 - 20 - - @@ -1907,6 +1973,12 @@ :/icons/cross.png:/icons/cross.png + + + 16 + 16 + + @@ -1946,6 +2018,199 @@ + + + + + 50 + false + + + + Custom Encoder Parameters + + + + + + + + + Lucida Console + + + + + + + + + Lucida Console + + + + + + + + + Lucida Console + + + + + + + + + Lucida Console + + + + + + + + LAME: + + + + + + + OggEnc2: + + + + + + + Nero AAC: + + + + + + + FLAC: + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 8 + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 8 + + + + + + + + + + + 18 + 16777215 + + + + + + + :/icons/error.png + + + + + + + Warning: Custom parameters won't be checked at all. Use them at your own risk !!! + + + + + + + + + + 0 + 2 + + + + + 16777215 + 2 + + + + + + + + + + + + @@ -1987,6 +2252,12 @@ :/icons/bomb.png:/icons/bomb.png + + + 16 + 16 + + @@ -2047,6 +2318,12 @@ :/icons/play.png:/icons/play.png + + + 16 + 16 + + @@ -2077,6 +2354,12 @@ :/icons/information.png:/icons/information.png + + + 16 + 16 + + @@ -2107,6 +2390,12 @@ :/icons/door_in.png:/icons/door_in.png + + + 16 + 16 + + @@ -2493,6 +2782,14 @@ + + + + + + + + diff --git a/res/localization/LameXP_DE.qm b/res/localization/LameXP_DE.qm index 4e15fc7851488cb8e126c65cd909bd3dad3a144c..d23f4466f2a80c407914a9abe335123b58d5c0f0 100644 GIT binary patch delta 3660 zcmbtXXINBc7Jg^u-aGBij3QPd3>LtKibe%15=BrEu^}irz|f=!3}RUsVjvcfA`(Fp zq*!7>QDYJnD=~?hu(mW4H6+m}*{B%TJh5e8B)j|U?|pdSc)$C7=R4;;?|IL4TfQo< zSXJa`p9Ekm(En3F90?R@X{Q03p8!kyLwvdlu$L`?Vc|(&d?5P1 z;SAK|VyJ%vFf0-NZ*2s&nlP!)abTS{0#5Y;_PZgl9}jx3MBuPeU`?MkTXnw8);VCZ zn83guVRAH+D9^#vv$;T_AA&9GfZ)prJ@*k1or=&4<*?)MS%jTp#BqNjTueJz%BPX=ZmMrPMnfgPz>pIim>y@t(e8-ZRf z*xHRY=3VS=7(wLnQ2+T&2Cx(7AM%_!9@nOIvjfFh3Q^64RGY$~%mUO_DIAZx14G&= zI%hWl2L>p{zS|dg$3ZbgQ~@KlD;CVI0~A9Qmf$XcYnq~{ndhq?DJq}UFcF*LYT1v# zq@9YdZxE@Vk&0{AiEJ;M;=29};BZv&c*IelZj$10qJ1BbP@-&KLTf5gc7LS^&<;^{ zFDHa^yDEFn%H)Mlm6J@5fXo18Y{m)TLzOZ`YzCBbmFu(&EFw=?IW8U;dPBJ@{|T_6 zQCaKUl{Jr2z8}?t=L(d!ddCsj*V}BtYGrdExf6F(`P{ykk!g#Y6yLW>dFl6UwlzeB%}i?J{QDR ze{-t@=`|*>C{i#!2q2kVgmx{PfeMu{!NZ#+$rUE}_y7mj+lARH{|5MtXtQ-Eg+!+y zVE!#3Eu$DXCJS$v{s4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@!VS$&||mpa@=xYNT%^xTo9l88Sgt1F`K*b-2ew*_Xkya za~>G)qIP~`i=riNR=wqGzX#L>txEm#M(# zt<;Ha2yFz^#VbSE@jx}L%S2%6ay9e)4?tfxbzQ_EYM_Z)IC2B2NK*^5Ny*Frb=&Uu zz}kK4K|dmqJxx7iyO>Xi?bYKlJNv<;o@?w6H14Thx>v=Ij|=KGr-rPfNWGa>0C-iZ zcl_pa+_tJu)^NN$g4O4))W8bWByFewH+i76 zooQpqU0QD~(-HeZa{9ZeJnJIoypQR;Mh!H6ZmMYP26S9)s`d(?V^D;2=E~Te zF-|*?XQ6@QYqz2~uBKq^sfC5CchFuY)un+2m<<>CJa(74kyAB&#o65P)I>VsC3E*Q zBHZ;Sb7b}f8rEZT)LK$yE2uP6H~cjE$DB3Tfy+ZNuTiK8yW!>ndtMxwXFgDG7T0YD z^Un@PfWbxP^XvZrT9=vcPwdMtq4DM?R$kC4)cm0f4W{Koi{rv5;0u3C8>iMRq?@Ik z&5cXVWNANwzw<1%boDDIMLw3^1J1yNhGCY`SHgI~m<(@|gDs((Wq#9-%j%IODUh0T z_}P*@Es=f$ORjwxMSRn;F)@T1DzQ{Go(oK9XnAnw9P9D5JTi9z=6YFPeO`wRdstp& z@!T?RtNB0?`^vR8i%Z}NIAnF&yPQ*~Sl!+e2&IK}X#J^l_(#@|@Ei1_wRNmf`Fw#t ztuYhYaz)&;j?1wFT)wu(h92if>`CjabZT@&2kV?gZ%LuMHLp2=2rIR2JsrU5TVmZ4 zPbrLZvX(EIM-A__9$Vj>%T=;o*+oMg=w|&*urN<=>&^ZAy*9^sZ(1^qHZ>O5D?b!? yb)$@CmKJ48v`UwisChecked() != m_settings->bitrateManagementEnabled()) checkBoxBitrateManagement->click(); while(checkBoxNeroAAC2PassMode->isChecked() != m_settings->neroAACEnable2Pass()) checkBoxNeroAAC2PassMode->click(); while(checkBoxNormalizationFilter->isChecked() != m_settings->normalizationFilterEnabled()) checkBoxNormalizationFilter->click(); + lineEditCustomParamLAME->setText(m_settings->customParametersLAME()); + lineEditCustomParamOggEnc->setText(m_settings->customParametersOggEnc()); + lineEditCustomParamNeroAAC->setText(m_settings->customParametersNeroAAC()); + lineEditCustomParamFLAC->setText(m_settings->customParametersFLAC()); connect(sliderLameAlgoQuality, SIGNAL(valueChanged(int)), this, SLOT(updateLameAlgoQuality(int))); connect(checkBoxBitrateManagement, SIGNAL(clicked(bool)), this, SLOT(bitrateManagementEnabledChanged(bool))); connect(spinBoxBitrateManagementMin, SIGNAL(valueChanged(int)), this, SLOT(bitrateManagementMinChanged(int))); @@ -230,10 +234,15 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S connect(spinBoxToneAdjustBass, SIGNAL(valueChanged(double)), this, SLOT(toneAdjustBassChanged(double))); connect(spinBoxToneAdjustTreble, SIGNAL(valueChanged(double)), this, SLOT(toneAdjustTrebleChanged(double))); connect(buttonToneAdjustReset, SIGNAL(clicked()), this, SLOT(toneAdjustTrebleReset())); + connect(lineEditCustomParamLAME, SIGNAL(editingFinished()), this, SLOT(customParamsChanged())); + connect(lineEditCustomParamOggEnc, SIGNAL(editingFinished()), this, SLOT(customParamsChanged())); + connect(lineEditCustomParamNeroAAC, SIGNAL(editingFinished()), this, SLOT(customParamsChanged())); + connect(lineEditCustomParamFLAC, SIGNAL(editingFinished()), this, SLOT(customParamsChanged())); connect(buttonResetAdvancedOptions, SIGNAL(clicked()), this, SLOT(resetAdvancedOptionsButtonClicked())); updateLameAlgoQuality(sliderLameAlgoQuality->value()); toneAdjustTrebleChanged(spinBoxToneAdjustTreble->value()); toneAdjustBassChanged(spinBoxToneAdjustBass->value()); + customParamsChanged(); //Activate file menu actions connect(actionOpenFolder, SIGNAL(triggered()), this, SLOT(openFolderActionActivated())); @@ -1822,7 +1831,7 @@ void MainWindow::toneAdjustTrebleChanged(double value) /* * Tone adjustment has been reset */ -void MainWindow::toneAdjustTrebleReset() +void MainWindow::toneAdjustTrebleReset(void) { spinBoxToneAdjustBass->setValue(m_settings->toneAdjustBassDefault()); spinBoxToneAdjustTreble->setValue(m_settings->toneAdjustTrebleDefault()); @@ -1830,10 +1839,36 @@ void MainWindow::toneAdjustTrebleReset() toneAdjustTrebleChanged(spinBoxToneAdjustTreble->value()); } +/* + * Custom encoder parameters changed + */ +void MainWindow::customParamsChanged(void) +{ + lineEditCustomParamLAME->setText(lineEditCustomParamLAME->text().simplified()); + lineEditCustomParamOggEnc->setText(lineEditCustomParamOggEnc->text().simplified()); + lineEditCustomParamNeroAAC->setText(lineEditCustomParamNeroAAC->text().simplified()); + lineEditCustomParamFLAC->setText(lineEditCustomParamFLAC->text().simplified()); + + bool customParamsUsed = false; + if(!lineEditCustomParamLAME->text().isEmpty()) customParamsUsed = true; + if(!lineEditCustomParamOggEnc->text().isEmpty()) customParamsUsed = true; + if(!lineEditCustomParamNeroAAC->text().isEmpty()) customParamsUsed = true; + if(!lineEditCustomParamFLAC->text().isEmpty()) customParamsUsed = true; + + labelCustomParamsIcon->setVisible(customParamsUsed); + labelCustomParamsText->setVisible(customParamsUsed); + labelCustomParamsSpacer->setVisible(customParamsUsed); + + m_settings->customParametersLAME(lineEditCustomParamLAME->text()); + m_settings->customParametersOggEnc(lineEditCustomParamOggEnc->text()); + m_settings->customParametersNeroAAC(lineEditCustomParamNeroAAC->text()); + m_settings->customParametersFLAC(lineEditCustomParamFLAC->text()); +} + /* * Reset all advanced options to their defaults */ -void MainWindow::resetAdvancedOptionsButtonClicked() +void MainWindow::resetAdvancedOptionsButtonClicked(void) { sliderLameAlgoQuality->setValue(m_settings->lameAlgoQualityDefault()); spinBoxBitrateManagementMin->setValue(m_settings->bitrateManagementMinRateDefault()); @@ -1847,6 +1882,11 @@ void MainWindow::resetAdvancedOptionsButtonClicked() while(checkBoxBitrateManagement->isChecked() != m_settings->bitrateManagementEnabledDefault()) checkBoxBitrateManagement->click(); while(checkBoxNeroAAC2PassMode->isChecked() != m_settings->neroAACEnable2PassDefault()) checkBoxNeroAAC2PassMode->click(); while(checkBoxNormalizationFilter->isChecked() != m_settings->normalizationFilterEnabledDefault()) checkBoxNormalizationFilter->click(); + lineEditCustomParamLAME->setText(m_settings->customParametersLAMEDefault()); + lineEditCustomParamOggEnc->setText(m_settings->customParametersOggEncDefault()); + lineEditCustomParamNeroAAC->setText(m_settings->customParametersNeroAACDefault()); + lineEditCustomParamFLAC->setText(m_settings->customParametersFLACDefault()); + customParamsChanged(); scrollArea->verticalScrollBar()->setValue(0); } diff --git a/src/Dialog_MainWindow.h b/src/Dialog_MainWindow.h index 2088b50a..4da643e4 100644 --- a/src/Dialog_MainWindow.h +++ b/src/Dialog_MainWindow.h @@ -91,8 +91,9 @@ private slots: void normalizationMaxVolumeChanged(double volume); void toneAdjustBassChanged(double value); void toneAdjustTrebleChanged(double value); - void toneAdjustTrebleReset(); - void resetAdvancedOptionsButtonClicked(); + void toneAdjustTrebleReset(void); + void customParamsChanged(void); + void resetAdvancedOptionsButtonClicked(void); void sourceModelChanged(void); void metaTagsEnabledChanged(void); void playlistEnabledChanged(void); diff --git a/src/Dialog_Processing.cpp b/src/Dialog_Processing.cpp index 5870cc7d..9e04d544 100644 --- a/src/Dialog_Processing.cpp +++ b/src/Dialog_Processing.cpp @@ -464,6 +464,7 @@ void ProcessingDialog::startNextJob(void) nativeResampling = true; } mp3Encoder->setChannelMode(m_settings->lameChannelMode()); + mp3Encoder->setCustomParams(m_settings->customParametersLAME()); encoder = mp3Encoder; } break; @@ -481,6 +482,7 @@ void ProcessingDialog::startNextJob(void) vorbisEncoder->setSamplingRate(SettingsModel::samplingRates[m_settings->samplingRate()]); nativeResampling = true; } + vorbisEncoder->setCustomParams(m_settings->customParametersOggEnc()); encoder = vorbisEncoder; } break; @@ -491,6 +493,7 @@ void ProcessingDialog::startNextJob(void) aacEncoder->setRCMode(m_settings->compressionRCMode()); aacEncoder->setEnable2Pass(m_settings->neroAACEnable2Pass()); aacEncoder->setProfile(m_settings->neroAACProfile()); + aacEncoder->setCustomParams(m_settings->customParametersNeroAAC()); encoder = aacEncoder; } break; @@ -499,6 +502,7 @@ void ProcessingDialog::startNextJob(void) FLACEncoder *flacEncoder = new FLACEncoder(); flacEncoder->setBitrate(m_settings->compressionBitrate()); flacEncoder->setRCMode(m_settings->compressionRCMode()); + flacEncoder->setCustomParams(m_settings->customParametersFLAC()); encoder = flacEncoder; } break; diff --git a/src/Encoder_AAC.cpp b/src/Encoder_AAC.cpp index 4a6dc90d..7ad1f96e 100644 --- a/src/Encoder_AAC.cpp +++ b/src/Encoder_AAC.cpp @@ -89,6 +89,8 @@ bool AACEncoder::encode(const QString &sourceFile, const AudioFileModel &metaInf break; } + if(!m_configCustomParams.isEmpty()) args << m_configCustomParams.split(" ", QString::SkipEmptyParts); + args << "-if" << QDir::toNativeSeparators(sourceFile); args << "-of" << QDir::toNativeSeparators(outputFile); diff --git a/src/Encoder_Abstract.cpp b/src/Encoder_Abstract.cpp index ff93b2ef..c092e73b 100644 --- a/src/Encoder_Abstract.cpp +++ b/src/Encoder_Abstract.cpp @@ -27,6 +27,7 @@ AbstractEncoder::AbstractEncoder(void) { m_configBitrate = 0; m_configRCMode = 0; + m_configCustomParams.clear(); } AbstractEncoder::~AbstractEncoder(void) @@ -39,6 +40,7 @@ AbstractEncoder::~AbstractEncoder(void) void AbstractEncoder::setBitrate(int bitrate) { m_configBitrate = max(0, bitrate); } void AbstractEncoder::setRCMode(int mode) { m_configRCMode = max(0, mode); } +void AbstractEncoder::setCustomParams(const QString &customParams) { m_configCustomParams = customParams; } /* * Default implementation diff --git a/src/Encoder_Abstract.h b/src/Encoder_Abstract.h index 161b4b92..924701c3 100644 --- a/src/Encoder_Abstract.h +++ b/src/Encoder_Abstract.h @@ -45,8 +45,10 @@ public: //Common setter methods void setBitrate(int bitrate); void setRCMode(int mode); + void setCustomParams(const QString &customParams); protected: int m_configBitrate; int m_configRCMode; + QString m_configCustomParams; }; diff --git a/src/Encoder_FLAC.cpp b/src/Encoder_FLAC.cpp index fdfd4fc3..a68ff1f4 100644 --- a/src/Encoder_FLAC.cpp +++ b/src/Encoder_FLAC.cpp @@ -62,6 +62,8 @@ bool FLACEncoder::encode(const QString &sourceFile, const AudioFileModel &metaIn //args << "--tv" << QString().sprintf("Encoder=LameXP v%d.%02d.%04d [%s]", lamexp_version_major(), lamexp_version_minor(), lamexp_version_build(), lamexp_version_release()); + if(!m_configCustomParams.isEmpty()) args << m_configCustomParams.split(" ", QString::SkipEmptyParts); + args << "-f" << "-o" << QDir::toNativeSeparators(outputFile); args << QDir::toNativeSeparators(sourceFile); diff --git a/src/Encoder_MP3.cpp b/src/Encoder_MP3.cpp index 4105f3d4..94260205 100644 --- a/src/Encoder_MP3.cpp +++ b/src/Encoder_MP3.cpp @@ -120,6 +120,8 @@ bool MP3Encoder::encode(const QString &sourceFile, const AudioFileModel &metaInf //args << "--tv" << QString().sprintf("Encoder=LameXP v%d.%02d.%04d [%s]", lamexp_version_major(), lamexp_version_minor(), lamexp_version_build(), lamexp_version_release()); + if(!m_configCustomParams.isEmpty()) args << m_configCustomParams.split(" ", QString::SkipEmptyParts); + args << QDir::toNativeSeparators(sourceFile); args << QDir::toNativeSeparators(outputFile); diff --git a/src/Encoder_Vorbis.cpp b/src/Encoder_Vorbis.cpp index e6d8caad..388a9faa 100644 --- a/src/Encoder_Vorbis.cpp +++ b/src/Encoder_Vorbis.cpp @@ -93,6 +93,8 @@ bool VorbisEncoder::encode(const QString &sourceFile, const AudioFileModel &meta //args << "--tv" << QString().sprintf("Encoder=LameXP v%d.%02d.%04d [%s]", lamexp_version_major(), lamexp_version_minor(), lamexp_version_build(), lamexp_version_release()); + if(!m_configCustomParams.isEmpty()) args << m_configCustomParams.split(" ", QString::SkipEmptyParts); + args << "-o" << QDir::toNativeSeparators(outputFile); args << QDir::toNativeSeparators(sourceFile); diff --git a/src/Model_Settings.cpp b/src/Model_Settings.cpp index d5dfdfee..039c549d 100644 --- a/src/Model_Settings.cpp +++ b/src/Model_Settings.cpp @@ -64,6 +64,10 @@ static const char *g_settingsId_normalizationFilterEnabled = "AdvancedOptions/Vo static const char *g_settingsId_normalizationFilterMaxVolume = "AdvancedOptions/VolumeNormalization/MaxVolume"; static const char *g_settingsId_toneAdjustBass = "AdvancedOptions/ToneAdjustment/Bass"; static const char *g_settingsId_toneAdjustTreble = "AdvancedOptions/ToneAdjustment/Treble"; +static const char *g_settingsId_customParametersLAME = "AdvancedOptions/CustomParameters/LAME"; +static const char *g_settingsId_customParametersOggEnc = "AdvancedOptions/CustomParameters/OggEnc"; +static const char *g_settingsId_customParametersNeroAAC = "AdvancedOptions/CustomParameters/NeroAAC"; +static const char *g_settingsId_customParametersFLAC = "AdvancedOptions/CustomParameters/FLAC"; //Macros #define MAKE_OPTION1(OPT,DEF) \ @@ -233,3 +237,7 @@ 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()); diff --git a/src/Model_Settings.h b/src/Model_Settings.h index 81aa925c..655324e5 100644 --- a/src/Model_Settings.h +++ b/src/Model_Settings.h @@ -96,6 +96,10 @@ public: MAKE_OPTION_DEC1(normalizationFilterMaxVolume); MAKE_OPTION_DEC1(toneAdjustBass); MAKE_OPTION_DEC1(toneAdjustTreble); + MAKE_OPTION_DEC2(customParametersLAME); + MAKE_OPTION_DEC2(customParametersOggEnc); + MAKE_OPTION_DEC2(customParametersNeroAAC); + MAKE_OPTION_DEC2(customParametersFLAC); //Misc void validate(void);