From 6c43678b7f426c3d8bf1fd498decc1447587766e Mon Sep 17 00:00:00 2001 From: lordmulder Date: Sat, 22 Jan 2011 22:19:20 +0100 Subject: [PATCH] Added more advanced options: MP3 channel mode, sampling rate, Nero AAC profile, Nero AAC 2-Pass mode. --- etc/NSIS/setup.nsi | 5 +- etc/Translation/Blank.ts | 112 ++++- etc/Translation/LameXP_DE.ts | 88 ++++ etc/Translation/LameXP_ES.ts | 88 ++++ etc/Translation/LameXP_FR.ts | 88 ++++ etc/Translation/LameXP_IT.ts | 88 ++++ gui/MainWindow.ui | 943 ++++++++++++++++++++++++----------- src/Config.h | 2 +- src/Dialog_MainWindow.cpp | 54 ++ src/Dialog_MainWindow.h | 4 + src/Model_Settings.cpp | 9 + src/Model_Settings.h | 6 +- 12 files changed, 1188 insertions(+), 299 deletions(-) diff --git a/etc/NSIS/setup.nsi b/etc/NSIS/setup.nsi index 5c5c9099..f8a251ea 100644 --- a/etc/NSIS/setup.nsi +++ b/etc/NSIS/setup.nsi @@ -445,7 +445,10 @@ Function CheckForUpdate IfFileExists "$INSTDIR\*.*" +2 Return - IfFileExists "$INSTDIR\LameXP.exe" EnableUpdateMode + StrCmp "$EXEDIR" "$INSTDIR" 0 +2 + Return + + IfFileExists "$INSTDIR\LameXP.exe" +2 Return EnableUpdateMode: diff --git a/etc/Translation/Blank.ts b/etc/Translation/Blank.ts index 85558098..6a1cbb85 100644 --- a/etc/Translation/Blank.ts +++ b/etc/Translation/Blank.ts @@ -401,18 +401,6 @@ Advanced Options - - LAME Algorithm Quality - - - - Faster Processing - - - - Better quality - - Bitrate Management (LAME and OggEnc2) @@ -429,6 +417,106 @@ Maximum (kbps): + + LAME Algorithm Quality + + + + Faster Processing + + + + Better quality + + + + Channel Mode / Sampling Rate + + + + Auto Select (Default) + + + + Joint Stereo + + + + Forced Joint Stereo + + + + Simple + + + + Dual Mono + + + + Mono + + + + MP3 Channel Mode: + + + + 16.000 + + + + 22.050 + + + + 24.000 + + + + 32.000 + + + + 44.100 + + + + 48.000 + + + + Sampling Rate (Hz): + + + + Nero AAC Options + + + + Enable 2-Pass Processing (ABR Mode) + + + + Select AAC Profile: + + + + Auto (Recommended) + + + + Enforce LC-AAC + + + + Enforce HE-AAC (AAC + SBR) + + + + Enforce HE-AAC v2 (AAC +SBR + PS) + + Encode Now! diff --git a/etc/Translation/LameXP_DE.ts b/etc/Translation/LameXP_DE.ts index e47f569b..4265c893 100644 --- a/etc/Translation/LameXP_DE.ts +++ b/etc/Translation/LameXP_DE.ts @@ -942,6 +942,94 @@ Maximum (kbps): Maximum (kbps): + + Channel Mode / Sampling Rate + + + + Auto Select (Default) + + + + Joint Stereo + + + + Forced Joint Stereo + + + + Simple + + + + Dual Mono + + + + Mono + + + + MP3 Channel Mode: + + + + 16.000 + + + + 22.050 + + + + 24.000 + + + + 32.000 + + + + 44.100 + + + + 48.000 + + + + Sampling Rate (Hz): + + + + Nero AAC Options + + + + Enable 2-Pass Processing (ABR Mode) + + + + Select AAC Profile: + + + + Auto (Recommended) + + + + Enforce LC-AAC + + + + Enforce HE-AAC (AAC + SBR) + + + + Enforce HE-AAC v2 (AAC +SBR + PS) + + MetaInfo diff --git a/etc/Translation/LameXP_ES.ts b/etc/Translation/LameXP_ES.ts index 63f03e9d..74d1865d 100644 --- a/etc/Translation/LameXP_ES.ts +++ b/etc/Translation/LameXP_ES.ts @@ -942,6 +942,94 @@ Maximum (kbps): + + Channel Mode / Sampling Rate + + + + Auto Select (Default) + + + + Joint Stereo + + + + Forced Joint Stereo + + + + Simple + + + + Dual Mono + + + + Mono + + + + MP3 Channel Mode: + + + + 16.000 + + + + 22.050 + + + + 24.000 + + + + 32.000 + + + + 44.100 + + + + 48.000 + + + + Sampling Rate (Hz): + + + + Nero AAC Options + + + + Enable 2-Pass Processing (ABR Mode) + + + + Select AAC Profile: + + + + Auto (Recommended) + + + + Enforce LC-AAC + + + + Enforce HE-AAC (AAC + SBR) + + + + Enforce HE-AAC v2 (AAC +SBR + PS) + + MetaInfo diff --git a/etc/Translation/LameXP_FR.ts b/etc/Translation/LameXP_FR.ts index de4113e1..e11d975a 100644 --- a/etc/Translation/LameXP_FR.ts +++ b/etc/Translation/LameXP_FR.ts @@ -946,6 +946,94 @@ Votre dossier TEMP est situĂ© ici: Maximum (kbps): + + Channel Mode / Sampling Rate + + + + Auto Select (Default) + + + + Joint Stereo + + + + Forced Joint Stereo + + + + Simple + + + + Dual Mono + + + + Mono + + + + MP3 Channel Mode: + + + + 16.000 + + + + 22.050 + + + + 24.000 + + + + 32.000 + + + + 44.100 + + + + 48.000 + + + + Sampling Rate (Hz): + + + + Nero AAC Options + + + + Enable 2-Pass Processing (ABR Mode) + + + + Select AAC Profile: + + + + Auto (Recommended) + + + + Enforce LC-AAC + + + + Enforce HE-AAC (AAC + SBR) + + + + Enforce HE-AAC v2 (AAC +SBR + PS) + + MetaInfo diff --git a/etc/Translation/LameXP_IT.ts b/etc/Translation/LameXP_IT.ts index 702a4557..efbc123e 100644 --- a/etc/Translation/LameXP_IT.ts +++ b/etc/Translation/LameXP_IT.ts @@ -942,6 +942,94 @@ Maximum (kbps): + + Channel Mode / Sampling Rate + + + + Auto Select (Default) + + + + Joint Stereo + + + + Forced Joint Stereo + + + + Simple + + + + Dual Mono + + + + Mono + + + + MP3 Channel Mode: + + + + 16.000 + + + + 22.050 + + + + 24.000 + + + + 32.000 + + + + 44.100 + + + + 48.000 + + + + Sampling Rate (Hz): + + + + Nero AAC Options + + + + Enable 2-Pass Processing (ABR Mode) + + + + Select AAC Profile: + + + + Auto (Recommended) + + + + Enforce LC-AAC + + + + Enforce HE-AAC (AAC + SBR) + + + + Enforce HE-AAC v2 (AAC +SBR + PS) + + MetaInfo diff --git a/gui/MainWindow.ui b/gui/MainWindow.ui index dfc051aa..0a3b7e4f 100644 --- a/gui/MainWindow.ui +++ b/gui/MainWindow.ui @@ -7,7 +7,7 @@ 0 0 667 - 459 + 407 @@ -970,290 +970,664 @@ - - - - - - 50 - false - - - - LAME Algorithm Quality - - - - - - - - 4 - - - 1 - - - 3 - - - Qt::Horizontal - - - QSlider::TicksBelow - - - 1 - - - - - - - Qt::Horizontal - - - QSizePolicy::Maximum - - - - 10 - 20 - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 10 - 20 - - - - - - - - Faster Processing - - - - - - - - 75 - true - - - - (VALUE) - - - Qt::AlignCenter - - - - - - - Better quality - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 8 - - - - - - - - - - - - - - - Qt::Vertical + + + true - - QSizePolicy::Expanding - - - - 20 - 40 - - - - - - - - - 50 - false - - - - Bitrate Management (LAME and OggEnc2) - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 10 - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 10 - - - - - - - - Enable Bitrate Management - - - - - - - false - - - 32 - - - 500 - - - 500 - - - - - - - false - - - 32 - - - 500 - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 8 - 20 - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 8 - 20 - - - - - - - - false - - - Minimum (kbps): - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - false - - - Maximum (kbps): - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - + + + + 0 + 0 + 604 + 399 + + + + + + + + + + 50 + false + + + + Bitrate Management (LAME and OggEnc2) + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 10 + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 10 + + + + + + + + Enable Bitrate Management + + + + + + + false + + + 32 + + + 500 + + + 500 + + + + + + + false + + + 32 + + + 500 + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + + + + + false + + + Minimum (kbps): + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + false + + + Maximum (kbps): + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + + + + 50 + false + + + + LAME Algorithm Quality + + + + + + + + Qt::Horizontal + + + QSizePolicy::Maximum + + + + 10 + 20 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + + + + + Faster Processing + + + + + + + + 75 + true + + + + (VALUE) + + + Qt::AlignCenter + + + + + + + Better quality + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 8 + + + + + + + + 4 + + + 1 + + + 3 + + + Qt::Horizontal + + + QSlider::TicksBelow + + + 1 + + + + + + + + + + + + + 50 + false + + + + Channel Mode / Sampling Rate + + + + + + + + + Auto Select (Default) + + + + + Joint Stereo + + + + + Forced Joint Stereo + + + + + Simple + + + + + Dual Mono + + + + + Mono + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + + + + + MP3 Channel Mode: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 8 + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 8 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + Auto Select (Default) + + + + + 16.000 + + + + + 22.050 + + + + + 24.000 + + + + + 32.000 + + + + + 44.100 + + + + + 48.000 + + + + + + + + Sampling Rate (Hz): + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + + + + 50 + false + + + + Nero AAC Options + + + + + + + + Enable 2-Pass Processing (ABR Mode) + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + + + + + Qt::Horizontal + + + + 73 + 20 + + + + + + + + Select AAC Profile: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + Auto (Recommended) + + + + + Enforce LC-AAC + + + + + Enforce HE-AAC (AAC + SBR) + + + + + Enforce HE-AAC v2 (AAC +SBR + PS) + + + + + + + + Qt::Horizontal + + + + 75 + 20 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 13 + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 13 + + + + + + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 20 + 40 + + + + + + @@ -1701,6 +2075,7 @@ + diff --git a/src/Config.h b/src/Config.h index a4f824f8..10832090 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 246 +#define VER_LAMEXP_BUILD 249 #define VER_LAMEXP_SUFFIX Beta-1 /* diff --git a/src/Dialog_MainWindow.cpp b/src/Dialog_MainWindow.cpp index f72bb1fb..4cef99db 100644 --- a/src/Dialog_MainWindow.cpp +++ b/src/Dialog_MainWindow.cpp @@ -216,11 +216,19 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S sliderLameAlgoQuality->setValue(m_settings->lameAlgoQuality()); spinBoxBitrateManagementMin->setValue(m_settings->bitrateManagementMinRate()); spinBoxBitrateManagementMax->setValue(m_settings->bitrateManagementMaxRate()); + comboBoxMP3ChannelMode->setCurrentIndex(m_settings->lameChannelMode()); + comboBoxSamplingRate->setCurrentIndex(m_settings->samplingRate()); + comboBoxNeroAACProfile->setCurrentIndex(m_settings->neroAACProfile()); while(checkBoxBitrateManagement->isChecked() != m_settings->bitrateManagementEnabled()) checkBoxBitrateManagement->click(); + while(checkBoxNeroAAC2PassMode->isChecked() != m_settings->neroAACEnable2Pass()) checkBoxNeroAAC2PassMode->click(); 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))); connect(spinBoxBitrateManagementMax, SIGNAL(valueChanged(int)), this, SLOT(bitrateManagementMaxChanged(int))); + connect(comboBoxMP3ChannelMode, SIGNAL(currentIndexChanged(int)), this, SLOT(channelModeChanged(int))); + connect(comboBoxSamplingRate, SIGNAL(currentIndexChanged(int)), this, SLOT(samplingRateChanged(int))); + connect(checkBoxNeroAAC2PassMode, SIGNAL(clicked(bool)), this, SLOT(neroAAC2PassChanged(bool))); + connect(comboBoxNeroAACProfile, SIGNAL(currentIndexChanged(int)), this, SLOT(neroAACProfileChanged(int))); updateLameAlgoQuality(sliderLameAlgoQuality->value()); //Activate file menu actions @@ -447,19 +455,34 @@ void MainWindow::changeEvent(QEvent *e) { if(e->type() == QEvent::LanguageChange) { + int comboBoxIndex[3]; + + //Backup combobox indices + comboBoxIndex[0] = comboBoxMP3ChannelMode->currentIndex(); + comboBoxIndex[1] = comboBoxSamplingRate->currentIndex(); + comboBoxIndex[2] = comboBoxNeroAACProfile->currentIndex(); + + //Re.translate from UIC Ui::MainWindow::retranslateUi(this); + //Restore combobox indices + comboBoxMP3ChannelMode->setCurrentIndex(comboBoxIndex[0]); + comboBoxSamplingRate->setCurrentIndex(comboBoxIndex[1]); + comboBoxNeroAACProfile->setCurrentIndex(comboBoxIndex[2]); + if(lamexp_version_demo()) { setWindowTitle(QString("%1 [%2]").arg(windowTitle(), tr("DEMO VERSION"))); } + //Manual re-translate m_dropNoteLabel->setText(QString("» %1 «").arg(tr("You can drop in audio files here!"))); m_showDetailsContextAction->setText(tr("Show Details")); m_previewContextAction->setText(tr("Open File in External Application")); m_findFileContextAction->setText(tr("Browse File Location")); m_showFolderContextAction->setText(tr("Browse Selected Folder")); + //Force GUI update m_metaInfoModel->clearData(); updateEncoder(m_settings->compressionEncoder()); updateLameAlgoQuality(sliderLameAlgoQuality->value()); @@ -1633,6 +1656,37 @@ void MainWindow::bitrateManagementMaxChanged(int value) } } +/* + * Channel mode has changed + */ +void MainWindow::channelModeChanged(int value) +{ + if(value >= 0) m_settings->lameChannelMode(value); +} + +/* + * Sampling rate has changed + */ +void MainWindow::samplingRateChanged(int value) +{ + if(value >= 0) m_settings->samplingRate(value); +} + +/* + * Nero AAC 2-Pass mode changed + */ +void MainWindow::neroAAC2PassChanged(bool checked) +{ + m_settings->neroAACEnable2Pass(checked); +} + +/* + * Nero AAC profile mode changed + */ +void MainWindow::neroAACProfileChanged(int value) +{ + if(value >= 0) m_settings->neroAACProfile(value); +} /* * Model reset diff --git a/src/Dialog_MainWindow.h b/src/Dialog_MainWindow.h index 2154d131..8c574e7c 100644 --- a/src/Dialog_MainWindow.h +++ b/src/Dialog_MainWindow.h @@ -83,6 +83,10 @@ private slots: void bitrateManagementEnabledChanged(bool checked); void bitrateManagementMinChanged(int value); void bitrateManagementMaxChanged(int value); + void samplingRateChanged(int value); + void channelModeChanged(int value); + void neroAACProfileChanged(int value); + void neroAAC2PassChanged(bool checked); void sourceModelChanged(void); void metaTagsEnabledChanged(void); void playlistEnabledChanged(void); diff --git a/src/Model_Settings.cpp b/src/Model_Settings.cpp index 32657e4b..aaf23bb8 100644 --- a/src/Model_Settings.cpp +++ b/src/Model_Settings.cpp @@ -51,9 +51,13 @@ static const char *g_settingsId_wmaDecoderNotificationsEnabled = "Flags/EnableWm static const char *g_settingsId_dropBoxWidgetEnabled = "Flags/EnableDropBoxWidget"; static const char *g_settingsId_currentLanguage = "Localization/Language"; static const char *g_settingsId_lameAlgoQuality = "AdvancedOptions/LAME/AlgorithmQuality"; +static const char *g_settingsId_lameChannelMode = "AdvancedOptions/LAME/ChannelMode"; static const char *g_settingsId_bitrateManagementEnabled = "AdvancedOptions/BitrateManagement/Enabled"; static const char *g_settingsId_bitrateManagementMinRate = "AdvancedOptions/BitrateManagement/MinRate"; static const char *g_settingsId_bitrateManagementMaxRate = "AdvancedOptions/BitrateManagement/MaxRate"; +static const char *g_settingsId_samplingRate = "AdvancedOptions/Common/Resampling"; +static const char *g_settingsId_neroAACEnable2Pass = "AdvancedOptions/NeroAAC/Enable2Pass"; +static const char *g_settingsId_neroAACProfile = "AdvancedOptions/NeroAAC/ForceProfile"; //Macros #define MAKE_OPTION1(OPT,DEF) \ @@ -70,6 +74,7 @@ void SettingsModel::OPT(bool value) { m_settings->setValue(g_settingsId_##OPT, v //LUT const int SettingsModel::mp3Bitrates[15] = {32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, -1}; +const int SettingsModel::samplingRates[7] = {16000, 22050, 24000, 32000, 44100, 48000, -1}; //////////////////////////////////////////////////////////// // Constructor @@ -191,6 +196,10 @@ MAKE_OPTION3(wmaDecoderNotificationsEnabled, true) MAKE_OPTION3(dropBoxWidgetEnabled, true) 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) diff --git a/src/Model_Settings.h b/src/Model_Settings.h index e17e8910..f7f669bc 100644 --- a/src/Model_Settings.h +++ b/src/Model_Settings.h @@ -60,6 +60,7 @@ public: //Consts static const int mp3Bitrates[15]; + static const int samplingRates[7]; //Getters & setters MAKE_OPTION_DEC1(licenseAccepted); @@ -80,10 +81,13 @@ public: MAKE_OPTION_DEC3(dropBoxWidgetEnabled) MAKE_OPTION_DEC2(currentLanguage); MAKE_OPTION_DEC1(lameAlgoQuality); + MAKE_OPTION_DEC1(lameChannelMode); MAKE_OPTION_DEC3(bitrateManagementEnabled); MAKE_OPTION_DEC1(bitrateManagementMinRate); MAKE_OPTION_DEC1(bitrateManagementMaxRate); - + MAKE_OPTION_DEC1(samplingRate) + MAKE_OPTION_DEC3(neroAACEnable2Pass) + MAKE_OPTION_DEC1(neroAACProfile) //Misc void validate(void);