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 4e15fc78..d23f4466 100644 Binary files a/res/localization/LameXP_DE.qm and b/res/localization/LameXP_DE.qm differ diff --git a/src/Config.h b/src/Config.h index 298a4bf1..37347154 100644 --- a/src/Config.h +++ b/src/Config.h @@ -25,7 +25,7 @@ #define VER_LAMEXP_MAJOR 4 #define VER_LAMEXP_MINOR_HI 0 #define VER_LAMEXP_MINOR_LO 0 -#define VER_LAMEXP_BUILD 298 +#define VER_LAMEXP_BUILD 300 #define VER_LAMEXP_SUFFIX Beta-4 /* diff --git a/src/Dialog_MainWindow.cpp b/src/Dialog_MainWindow.cpp index 0bbc7446..7b20ae50 100644 --- a/src/Dialog_MainWindow.cpp +++ b/src/Dialog_MainWindow.cpp @@ -217,6 +217,10 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S while(checkBoxBitrateManagement->isChecked() != 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);