Added support for DynamicAudioNormalizer normalization filter.

This commit is contained in:
LoRd_MuldeR 2015-03-21 19:06:55 +01:00
parent 80995537c2
commit 5b1b612775
32 changed files with 1386 additions and 1311 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1309,7 +1309,7 @@
</message>
<message>
<source>Peak Volume (dB):</source>
<translation>Max. Lautstärke (dB):</translation>
<translation>Max. Pegel (dB):</translation>
</message>
<message>
<source>Reset Advanced Options </source>
@ -1707,22 +1707,6 @@
<source>Warning: Processing speed will be very slow. Please do &lt;u&gt;not&lt;/u&gt; complain about processing speed!</source>
<translation>Achtung: Die Geschwindigkeit wird sehr gering sein. Bitte &lt;u&gt;nicht&lt;/u&gt; über die Geschwindigkeit beschweren!</translation>
</message>
<message>
<source>Peak Level</source>
<translation>Max. Pegel</translation>
</message>
<message>
<source>RMS Level</source>
<translation>Max. Energie</translation>
</message>
<message>
<source>None</source>
<translation>Keiner</translation>
</message>
<message>
<source>Equalization Mode:</source>
<translation>Angleichungsmodus:</translation>
</message>
<message>
<source>DEMO VERSION</source>
<translation></translation>
@ -2006,6 +1990,18 @@
<source>LameXP User&apos;s Manual</source>
<translation>LameXP Benutzerhandbuch</translation>
</message>
<message>
<source>Enable Dynamic Normalization</source>
<translation>Dynamische Normalisierung</translation>
</message>
<message>
<source>Window Size:</source>
<translation>Fenstergröße:</translation>
</message>
<message>
<source>Enable channel-coupling, i.e. amplify all channels of a multi-channel file by the same amount</source>
<translation>Kanal-Kopplung aktivieren, d.h. alle Kanäle einer Mehrkanal-Datei um den gleichen Faktor verstärken</translation>
</message>
</context>
<context>
<name>MetaInfo</name>

View File

@ -31,7 +31,7 @@
<context>
<name>MainWindow</name>
<message numerus="yes">
<location filename="../../src/Dialog_MainWindow.cpp" line="806"/>
<location filename="../../src/Dialog_MainWindow.cpp" line="822"/>
<source>%n file(s) have been rejected, because read access was not granted!</source>
<translation>
<numerusform>%n file have been rejected, because read access was not granted!</numerusform>
@ -39,7 +39,7 @@
</translation>
</message>
<message numerus="yes">
<location filename="../../src/Dialog_MainWindow.cpp" line="810"/>
<location filename="../../src/Dialog_MainWindow.cpp" line="826"/>
<source>%n file(s) have been rejected, because they are dummy CDDA files!</source>
<translation>
<numerusform>%n file have been rejected, because they are dummy CDDA files!</numerusform>
@ -47,7 +47,7 @@
</translation>
</message>
<message numerus="yes">
<location filename="../../src/Dialog_MainWindow.cpp" line="814"/>
<location filename="../../src/Dialog_MainWindow.cpp" line="830"/>
<source>%n file(s) have been rejected, because they appear to be Cue Sheet images!</source>
<translation>
<numerusform>%n file have been rejected, because they appear to be Cue Sheet images!</numerusform>
@ -55,7 +55,7 @@
</translation>
</message>
<message numerus="yes">
<location filename="../../src/Dialog_MainWindow.cpp" line="818"/>
<location filename="../../src/Dialog_MainWindow.cpp" line="834"/>
<source>%n file(s) have been rejected, because the file format could not be recognized!</source>
<translation>
<numerusform>%n file have been rejected, because the file format could not be recognized!</numerusform>
@ -63,7 +63,7 @@
</translation>
</message>
<message numerus="yes">
<location filename="../../src/Dialog_MainWindow.cpp" line="3914"/>
<location filename="../../src/Dialog_MainWindow.cpp" line="3957"/>
<source>%n Instance(s)</source>
<translation>
<numerusform>%n Instance</numerusform>

View File

@ -1706,22 +1706,6 @@
<source>Warning: Processing speed will be very slow. Please do &lt;u&gt;not&lt;/u&gt; complain about processing speed!</source>
<translation>Aviso: ¡La velocidad de proceso será muy lenta. Por favor, &lt;u&gt;no&lt;/u&gt; se queje de la velocidad de proceso!</translation>
</message>
<message>
<source>Peak Level</source>
<translation>Nivel de pico</translation>
</message>
<message>
<source>RMS Level</source>
<translation>Nivel RMS</translation>
</message>
<message>
<source>None</source>
<translation>Ninguno</translation>
</message>
<message>
<source>Equalization Mode:</source>
<translation>Modo de equalización:</translation>
</message>
<message>
<source>DEMO VERSION</source>
<translation>VERSIÓN DEMO</translation>
@ -2005,6 +1989,18 @@
<source>LameXP User&apos;s Manual</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Enable Dynamic Normalization</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Window Size:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Enable channel-coupling, i.e. amplify all channels of a multi-channel file by the same amount</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MetaInfo</name>

View File

@ -1715,22 +1715,6 @@ Ouvrir le dossier récursivement...</translation>
<source>Warning: Processing speed will be very slow. Please do &lt;u&gt;not&lt;/u&gt; complain about processing speed!</source>
<translation>AVERTISSEMENT : La vitesse de traitement sera très lente. Veuillez &lt;u&gt;ne pas&lt;/u&gt; vous plaindre de la vitesse de traitement !</translation>
</message>
<message>
<source>Peak Level</source>
<translation>Niveau maximum</translation>
</message>
<message>
<source>RMS Level</source>
<translation>Niveau RMS</translation>
</message>
<message>
<source>None</source>
<translation>Aucun</translation>
</message>
<message>
<source>Equalization Mode:</source>
<translation>Mode d&apos;égalisation :</translation>
</message>
<message>
<source>DEMO VERSION</source>
<translation>VERSION DE DÉMONSTRATION</translation>
@ -2014,6 +1998,18 @@ Ouvrir le dossier récursivement...</translation>
<source>LameXP User&apos;s Manual</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Enable Dynamic Normalization</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Window Size:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Enable channel-coupling, i.e. amplify all channels of a multi-channel file by the same amount</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MetaInfo</name>

View File

@ -1707,22 +1707,6 @@
<source>Warning: Processing speed will be very slow. Please do &lt;u&gt;not&lt;/u&gt; complain about processing speed!</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Peak Level</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>RMS Level</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>None</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Equalization Mode:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>DEMO VERSION</source>
<translation type="unfinished"></translation>
@ -2006,6 +1990,18 @@
<source>LameXP User&apos;s Manual</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Enable Dynamic Normalization</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Window Size:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Enable channel-coupling, i.e. amplify all channels of a multi-channel file by the same amount</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MetaInfo</name>

View File

@ -1704,22 +1704,6 @@
<source>Warning: Processing speed will be very slow. Please do &lt;u&gt;not&lt;/u&gt; complain about processing speed!</source>
<translation type="unfinished">경고: 처리 . &lt;u&gt; &lt;/u&gt;!</translation>
</message>
<message>
<source>Peak Level</source>
<translation type="unfinished"> </translation>
</message>
<message>
<source>RMS Level</source>
<translation type="unfinished">RMS </translation>
</message>
<message>
<source>None</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Equalization Mode:</source>
<translation type="unfinished"> :</translation>
</message>
<message>
<source>DEMO VERSION</source>
<translation type="unfinished"> </translation>
@ -1998,6 +1982,18 @@
<source>LameXP User&apos;s Manual</source>
<translation type="unfinished">LameXP </translation>
</message>
<message>
<source>Enable Dynamic Normalization</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Window Size:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Enable channel-coupling, i.e. amplify all channels of a multi-channel file by the same amount</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MetaInfo</name>

File diff suppressed because it is too large Load Diff

View File

@ -1715,22 +1715,6 @@
<source>Warning: Processing speed will be very slow. Please do &lt;u&gt;not&lt;/u&gt; complain about processing speed!</source>
<translation>Предупреждение: Преобразование будет идти очень медленно!</translation>
</message>
<message>
<source>Peak Level</source>
<translation></translation>
</message>
<message>
<source>RMS Level</source>
<translation></translation>
</message>
<message>
<source>None</source>
<translation>Нет</translation>
</message>
<message>
<source>Equalization Mode:</source>
<translation>Режим эквалайзера:</translation>
</message>
<message>
<source>DEMO VERSION</source>
<translation>ДЕМО ВЕРСИЯ</translation>
@ -2019,6 +2003,18 @@
<source>LameXP User&apos;s Manual</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Enable Dynamic Normalization</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Window Size:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Enable channel-coupling, i.e. amplify all channels of a multi-channel file by the same amount</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MetaInfo</name>

File diff suppressed because it is too large Load Diff

View File

@ -1703,22 +1703,6 @@
<source>Warning: Processing speed will be very slow. Please do &lt;u&gt;not&lt;/u&gt; complain about processing speed!</source>
<translation>警告: 處理速度會很慢.請&lt;u&gt;&lt;/u&gt;!</translation>
</message>
<message>
<source>Peak Level</source>
<translation></translation>
</message>
<message>
<source>RMS Level</source>
<translation>RMS </translation>
</message>
<message>
<source>None</source>
<translation></translation>
</message>
<message>
<source>Equalization Mode:</source>
<translation>:</translation>
</message>
<message>
<source>DEMO VERSION</source>
<translation></translation>
@ -1997,6 +1981,18 @@
<source>LameXP User&apos;s Manual</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Enable Dynamic Normalization</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Window Size:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Enable channel-coupling, i.e. amplify all channels of a multi-channel file by the same amount</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MetaInfo</name>

View File

@ -1710,22 +1710,6 @@
<source>Warning: Processing speed will be very slow. Please do &lt;u&gt;not&lt;/u&gt; complain about processing speed!</source>
<translation>Попередження: Швидкість обробки буде дуже низькою. Будь ласка, &lt;u&gt;не&lt;/u&gt; жалійтеся потім на швидкість обробки!</translation>
</message>
<message>
<source>Peak Level</source>
<translation>Піковий рівень</translation>
</message>
<message>
<source>RMS Level</source>
<translation>Ефективний рівень</translation>
</message>
<message>
<source>None</source>
<translation>Не задано</translation>
</message>
<message>
<source>Equalization Mode:</source>
<translation>Режим балансування:</translation>
</message>
<message>
<source>DEMO VERSION</source>
<translation>ТЕСТОВА ВЕРСІЯ</translation>
@ -2014,6 +1998,18 @@
<source>LameXP User&apos;s Manual</source>
<translation>Інструкція користувача LameXP</translation>
</message>
<message>
<source>Enable Dynamic Normalization</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Window Size:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Enable channel-coupling, i.e. amplify all channels of a multi-channel file by the same amount</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MetaInfo</name>

View File

@ -1703,22 +1703,6 @@
<source>Warning: Processing speed will be very slow. Please do &lt;u&gt;not&lt;/u&gt; complain about processing speed!</source>
<translation>警告: 处理速度会很慢&lt;u&gt;&lt;/u&gt;!</translation>
</message>
<message>
<source>Peak Level</source>
<translation></translation>
</message>
<message>
<source>RMS Level</source>
<translation></translation>
</message>
<message>
<source>None</source>
<translation></translation>
</message>
<message>
<source>Equalization Mode:</source>
<translation>:</translation>
</message>
<message>
<source>DEMO VERSION</source>
<translation></translation>
@ -1997,6 +1981,18 @@
<source>LameXP User&apos;s Manual</source>
<translation>LameXP用户指南</translation>
</message>
<message>
<source>Enable Dynamic Normalization</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Window Size:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Enable channel-coupling, i.e. amplify all channels of a multi-channel file by the same amount</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MetaInfo</name>

View File

@ -1509,8 +1509,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>602</width>
<height>1750</height>
<width>613</width>
<height>1794</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_22">
@ -2261,7 +2261,7 @@
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_20">
<item row="1" column="1">
<widget class="QCheckBox" name="checkBoxNormalizationFilter">
<widget class="QCheckBox" name="checkBoxNormalizationFilterEnabled">
<property name="text">
<string>Enable Normalization Filter</string>
</property>
@ -2300,7 +2300,7 @@
</spacer>
</item>
<item row="1" column="4">
<widget class="QDoubleSpinBox" name="spinBoxNormalizationFilter">
<widget class="QDoubleSpinBox" name="spinBoxNormalizationFilterPeak">
<property name="enabled">
<bool>false</bool>
</property>
@ -2347,7 +2347,7 @@
</property>
</spacer>
</item>
<item row="4" column="1" colspan="5">
<item row="6" column="1" colspan="5">
<spacer name="verticalSpacer_12">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -2363,31 +2363,6 @@
</property>
</spacer>
</item>
<item row="3" column="4">
<widget class="QComboBox" name="comboBoxNormalizationMode">
<property name="enabled">
<bool>false</bool>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<item>
<property name="text">
<string>None</string>
</property>
</item>
<item>
<property name="text">
<string>Peak Level</string>
</property>
</item>
<item>
<property name="text">
<string>RMS Level</string>
</property>
</item>
</widget>
</item>
<item row="1" column="5">
<spacer name="horizontalSpacer_27">
<property name="orientation">
@ -2401,16 +2376,6 @@
</property>
</spacer>
</item>
<item row="3" column="3">
<widget class="QLabel" name="label_19">
<property name="text">
<string>Equalization Mode:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="2">
<spacer name="horizontalSpacer_28">
<property name="orientation">
@ -2440,6 +2405,74 @@
</property>
</spacer>
</item>
<item row="4" column="1" colspan="5">
<spacer name="verticalSpacer_38">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>6</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="checkBoxNormalizationFilterDynamic">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Enable Dynamic Normalization</string>
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QLabel" name="label_25">
<property name="text">
<string>Window Size:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="4">
<widget class="QSpinBox" name="spinBoxNormalizationFilterSize">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimum">
<number>3</number>
</property>
<property name="maximum">
<number>301</number>
</property>
<property name="singleStep">
<number>2</number>
</property>
<property name="value">
<number>31</number>
</property>
</widget>
</item>
<item row="5" column="1" colspan="5">
<widget class="QCheckBox" name="checkBoxNormalizationFilterCoupled">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Enable channel-coupling, i.e. amplify all channels of a multi-channel file by the same amount</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
@ -5230,9 +5263,9 @@
</hints>
</connection>
<connection>
<sender>checkBoxNormalizationFilter</sender>
<sender>checkBoxNormalizationFilterEnabled</sender>
<signal>clicked(bool)</signal>
<receiver>spinBoxNormalizationFilter</receiver>
<receiver>spinBoxNormalizationFilterPeak</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
@ -5374,9 +5407,9 @@
</hints>
</connection>
<connection>
<sender>checkBoxNormalizationFilter</sender>
<sender>checkBoxNormalizationFilterEnabled</sender>
<signal>clicked(bool)</signal>
<receiver>comboBoxNormalizationMode</receiver>
<receiver>checkBoxNormalizationFilterDynamic</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
@ -5389,5 +5422,21 @@
</hint>
</hints>
</connection>
<connection>
<sender>checkBoxNormalizationFilterEnabled</sender>
<signal>clicked(bool)</signal>
<receiver>checkBoxNormalizationFilterCoupled</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>141</x>
<y>175</y>
</hint>
<hint type="destinationlabel">
<x>328</x>
<y>250</y>
</hint>
</hints>
</connection>
</connections>
</ui>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -34,8 +34,8 @@
#define VER_LAMEXP_MINOR_HI 1
#define VER_LAMEXP_MINOR_LO 1
#define VER_LAMEXP_TYPE RC
#define VER_LAMEXP_PATCH 1
#define VER_LAMEXP_BUILD 1680
#define VER_LAMEXP_PATCH 3
#define VER_LAMEXP_BUILD 1688
#define VER_LAMEXP_CONFG 1558
///////////////////////////////////////////////////////////////////////////////

View File

@ -167,6 +167,11 @@ while(0)
#define SET_CHECKBOX_STATE(CHCKBX, STATE) do \
{ \
const bool isDisabled = (!(CHCKBX)->isEnabled()); \
if(isDisabled) \
{ \
(CHCKBX)->setEnabled(true); \
} \
if((CHCKBX)->isChecked() != (STATE)) \
{ \
(CHCKBX)->click(); \
@ -175,6 +180,10 @@ while(0)
{ \
qWarning("Warning: Failed to set checkbox " #CHCKBX " state!"); \
} \
if(isDisabled) \
{ \
(CHCKBX)->setEnabled(false); \
} \
} \
while(0)
@ -454,31 +463,34 @@ MainWindow::MainWindow(MUtils::IPCChannel *const ipcChannel, FileListModel *cons
ui->sliderLameAlgoQuality->setValue(m_settings->lameAlgoQuality());
if(m_settings->maximumInstances() > 0) ui->sliderMaxInstances->setValue(m_settings->maximumInstances());
ui->spinBoxBitrateManagementMin->setValue(m_settings->bitrateManagementMinRate());
ui->spinBoxBitrateManagementMax->setValue(m_settings->bitrateManagementMaxRate());
ui->spinBoxNormalizationFilter->setValue(static_cast<double>(m_settings->normalizationFilterMaxVolume()) / 100.0);
ui->spinBoxToneAdjustBass->setValue(static_cast<double>(m_settings->toneAdjustBass()) / 100.0);
ui->spinBoxToneAdjustTreble->setValue(static_cast<double>(m_settings->toneAdjustTreble()) / 100.0);
ui->spinBoxAftenSearchSize->setValue(m_settings->aftenExponentSearchSize());
ui->spinBoxOpusComplexity->setValue(m_settings->opusComplexity());
ui->spinBoxBitrateManagementMin ->setValue(m_settings->bitrateManagementMinRate());
ui->spinBoxBitrateManagementMax ->setValue(m_settings->bitrateManagementMaxRate());
ui->spinBoxNormalizationFilterPeak->setValue(static_cast<double>(m_settings->normalizationFilterMaxVolume()) / 100.0);
ui->spinBoxNormalizationFilterSize->setValue(m_settings->normalizationFilterSize());
ui->spinBoxToneAdjustBass ->setValue(static_cast<double>(m_settings->toneAdjustBass()) / 100.0);
ui->spinBoxToneAdjustTreble ->setValue(static_cast<double>(m_settings->toneAdjustTreble()) / 100.0);
ui->spinBoxAftenSearchSize ->setValue(m_settings->aftenExponentSearchSize());
ui->spinBoxOpusComplexity ->setValue(m_settings->opusComplexity());
ui->comboBoxMP3ChannelMode->setCurrentIndex(m_settings->lameChannelMode());
ui->comboBoxSamplingRate->setCurrentIndex(m_settings->samplingRate());
ui->comboBoxAACProfile->setCurrentIndex(m_settings->aacEncProfile());
ui->comboBoxAftenCodingMode->setCurrentIndex(m_settings->aftenAudioCodingMode());
ui->comboBoxAftenDRCMode->setCurrentIndex(m_settings->aftenDynamicRangeCompression());
ui->comboBoxNormalizationMode->setCurrentIndex(m_settings->normalizationFilterEQMode());
ui->comboBoxOpusFramesize->setCurrentIndex(m_settings->opusFramesize());
ui->comboBoxMP3ChannelMode ->setCurrentIndex(m_settings->lameChannelMode());
ui->comboBoxSamplingRate ->setCurrentIndex(m_settings->samplingRate());
ui->comboBoxAACProfile ->setCurrentIndex(m_settings->aacEncProfile());
ui->comboBoxAftenCodingMode ->setCurrentIndex(m_settings->aftenAudioCodingMode());
ui->comboBoxAftenDRCMode ->setCurrentIndex(m_settings->aftenDynamicRangeCompression());
ui->comboBoxOpusFramesize ->setCurrentIndex(m_settings->opusFramesize());
SET_CHECKBOX_STATE(ui->checkBoxBitrateManagement, m_settings->bitrateManagementEnabled());
SET_CHECKBOX_STATE(ui->checkBoxNeroAAC2PassMode, m_settings->neroAACEnable2Pass());
SET_CHECKBOX_STATE(ui->checkBoxAftenFastAllocation, m_settings->aftenFastBitAllocation());
SET_CHECKBOX_STATE(ui->checkBoxNormalizationFilter, m_settings->normalizationFilterEnabled());
SET_CHECKBOX_STATE(ui->checkBoxNormalizationFilterEnabled, m_settings->normalizationFilterEnabled());
SET_CHECKBOX_STATE(ui->checkBoxNormalizationFilterDynamic, m_settings->normalizationFilterDynamic());
SET_CHECKBOX_STATE(ui->checkBoxNormalizationFilterCoupled, m_settings->normalizationFilterCoupled());
SET_CHECKBOX_STATE(ui->checkBoxAutoDetectInstances, (m_settings->maximumInstances() < 1));
SET_CHECKBOX_STATE(ui->checkBoxUseSystemTempFolder, !m_settings->customTempPathEnabled());
SET_CHECKBOX_STATE(ui->checkBoxUseSystemTempFolder, (!m_settings->customTempPathEnabled()));
SET_CHECKBOX_STATE(ui->checkBoxRenameOutput, m_settings->renameOutputFilesEnabled());
SET_CHECKBOX_STATE(ui->checkBoxForceStereoDownmix, m_settings->forceStereoDownmix());
SET_CHECKBOX_STATE(ui->checkBoxOpusDisableResample, m_settings->opusDisableResample());
ui->checkBoxNeroAAC2PassMode->setEnabled(aacEncoder == SettingsModel::AAC_ENCODER_NERO);
ui->lineEditCustomParamLAME ->setText(EncoderRegistry::loadEncoderCustomParams(m_settings, SettingsModel::MP3Encoder));
@ -515,13 +527,16 @@ MainWindow::MainWindow(MUtils::IPCChannel *const ipcChannel, FileListModel *cons
connect(ui->comboBoxSamplingRate, SIGNAL(currentIndexChanged(int)), this, SLOT(samplingRateChanged(int)));
connect(ui->checkBoxNeroAAC2PassMode, SIGNAL(clicked(bool)), this, SLOT(neroAAC2PassChanged(bool)));
connect(ui->comboBoxAACProfile, SIGNAL(currentIndexChanged(int)), this, SLOT(neroAACProfileChanged(int)));
connect(ui->checkBoxNormalizationFilter, SIGNAL(clicked(bool)), this, SLOT(normalizationEnabledChanged(bool)));
connect(ui->checkBoxNormalizationFilterEnabled, SIGNAL(clicked(bool)), this, SLOT(normalizationEnabledChanged(bool)));
connect(ui->checkBoxNormalizationFilterDynamic, SIGNAL(clicked(bool)), this, SLOT(normalizationDynamicChanged(bool)));
connect(ui->checkBoxNormalizationFilterCoupled, SIGNAL(clicked(bool)), this, SLOT(normalizationCoupledChanged(bool)));
connect(ui->comboBoxAftenCodingMode, SIGNAL(currentIndexChanged(int)), this, SLOT(aftenCodingModeChanged(int)));
connect(ui->comboBoxAftenDRCMode, SIGNAL(currentIndexChanged(int)), this, SLOT(aftenDRCModeChanged(int)));
connect(ui->spinBoxAftenSearchSize, SIGNAL(valueChanged(int)), this, SLOT(aftenSearchSizeChanged(int)));
connect(ui->checkBoxAftenFastAllocation, SIGNAL(clicked(bool)), this, SLOT(aftenFastAllocationChanged(bool)));
connect(ui->spinBoxNormalizationFilter, SIGNAL(valueChanged(double)), this, SLOT(normalizationMaxVolumeChanged(double)));
connect(ui->comboBoxNormalizationMode, SIGNAL(currentIndexChanged(int)), this, SLOT(normalizationModeChanged(int)));
connect(ui->spinBoxNormalizationFilterPeak, SIGNAL(valueChanged(double)), this, SLOT(normalizationMaxVolumeChanged(double)));
connect(ui->spinBoxNormalizationFilterSize, SIGNAL(valueChanged(int)), this, SLOT(normalizationFilterSizeChanged(int)));
connect(ui->spinBoxNormalizationFilterSize, SIGNAL(editingFinished()), this, SLOT(normalizationFilterSizeFinished()));
connect(ui->spinBoxToneAdjustBass, SIGNAL(valueChanged(double)), this, SLOT(toneAdjustBassChanged(double)));
connect(ui->spinBoxToneAdjustTreble, SIGNAL(valueChanged(double)), this, SLOT(toneAdjustTrebleChanged(double)));
connect(ui->buttonToneAdjustReset, SIGNAL(clicked()), this, SLOT(toneAdjustTrebleReset()));
@ -544,7 +559,7 @@ MainWindow::MainWindow(MUtils::IPCChannel *const ipcChannel, FileListModel *cons
connect(ui->checkBoxForceStereoDownmix, SIGNAL(clicked(bool)), this, SLOT(forceStereoDownmixEnabledChanged(bool)));
connect(ui->comboBoxOpusFramesize, SIGNAL(currentIndexChanged(int)), this, SLOT(opusSettingsChanged()));
connect(ui->spinBoxOpusComplexity, SIGNAL(valueChanged(int)), this, SLOT(opusSettingsChanged()));
connect(ui->checkBoxOpusDisableResample, SIGNAL(clicked(bool)), SLOT(opusSettingsChanged()));
connect(ui->checkBoxOpusDisableResample, SIGNAL(clicked(bool)), this, SLOT(opusSettingsChanged()));
connect(m_overwriteButtonGroup, SIGNAL(buttonClicked(int)), this, SLOT(overwriteModeChanged(int)));
connect(m_evenFilterCustumParamsHelp, SIGNAL(eventOccurred(QWidget*, QEvent*)), this, SLOT(customParamsHelpRequested(QWidget*, QEvent*)));
@ -556,6 +571,7 @@ MainWindow::MainWindow(MUtils::IPCChannel *const ipcChannel, FileListModel *cons
updateMaximumInstances(ui->sliderMaxInstances->value());
toneAdjustTrebleChanged(ui->spinBoxToneAdjustTreble->value());
toneAdjustBassChanged(ui->spinBoxToneAdjustBass->value());
normalizationEnabledChanged(ui->checkBoxNormalizationFilterEnabled->isChecked());
customParamsChanged();
//--------------------------------
@ -1064,7 +1080,7 @@ void MainWindow::changeEvent(QEvent *e)
return;
}
int comboBoxIndex[8];
int comboBoxIndex[6];
//Backup combobox indices, as retranslateUi() resets
comboBoxIndex[0] = ui->comboBoxMP3ChannelMode->currentIndex();
@ -1072,9 +1088,7 @@ void MainWindow::changeEvent(QEvent *e)
comboBoxIndex[2] = ui->comboBoxAACProfile->currentIndex();
comboBoxIndex[3] = ui->comboBoxAftenCodingMode->currentIndex();
comboBoxIndex[4] = ui->comboBoxAftenDRCMode->currentIndex();
comboBoxIndex[5] = ui->comboBoxNormalizationMode->currentIndex();
comboBoxIndex[6] = 0; //comboBoxOpusOptimize->currentIndex();
comboBoxIndex[7] = ui->comboBoxOpusFramesize->currentIndex();
comboBoxIndex[5] = ui->comboBoxOpusFramesize->currentIndex();
//Re-translate from UIC
ui->retranslateUi(this);
@ -1085,9 +1099,7 @@ void MainWindow::changeEvent(QEvent *e)
ui->comboBoxAACProfile->setCurrentIndex(comboBoxIndex[2]);
ui->comboBoxAftenCodingMode->setCurrentIndex(comboBoxIndex[3]);
ui->comboBoxAftenDRCMode->setCurrentIndex(comboBoxIndex[4]);
ui->comboBoxNormalizationMode->setCurrentIndex(comboBoxIndex[5]);
//comboBoxOpusOptimize->setCurrentIndex(comboBoxIndex[6]);
ui->comboBoxOpusFramesize->setCurrentIndex(comboBoxIndex[7]);
ui->comboBoxOpusFramesize->setCurrentIndex(comboBoxIndex[5]);
//Update the window title
if(MUTILS_DEBUG)
@ -3739,6 +3751,16 @@ void MainWindow::opusSettingsChanged(void)
void MainWindow::normalizationEnabledChanged(bool checked)
{
m_settings->normalizationFilterEnabled(checked);
normalizationDynamicChanged(ui->checkBoxNormalizationFilterDynamic->isChecked());
}
/*
* Dynamic normalization enabled changed
*/
void MainWindow::normalizationDynamicChanged(bool checked)
{
ui->spinBoxNormalizationFilterSize->setEnabled(ui->checkBoxNormalizationFilterEnabled->isChecked() && checked);
m_settings->normalizationFilterDynamic(checked);
}
/*
@ -3752,9 +3774,30 @@ void MainWindow::normalizationMaxVolumeChanged(double value)
/*
* Normalization equalization mode changed
*/
void MainWindow::normalizationModeChanged(int mode)
void MainWindow::normalizationCoupledChanged(bool checked)
{
m_settings->normalizationFilterEQMode(mode);
m_settings->normalizationFilterCoupled(checked);
}
/*
* Normalization filter size changed
*/
void MainWindow::normalizationFilterSizeChanged(int value)
{
m_settings->normalizationFilterSize(value);
}
/*
* Normalization filter size editing finished
*/
void MainWindow::normalizationFilterSizeFinished(void)
{
const int value = ui->spinBoxNormalizationFilterSize->value();
if((value % 2) != 1)
{
bool rnd = MUtils::parity(MUtils::next_rand32());
ui->spinBoxNormalizationFilterSize->setValue(rnd ? value+1 : value-1);
}
}
/*
@ -4095,27 +4138,29 @@ void MainWindow::resetAdvancedOptionsButtonClicked(void)
{
PLAY_SOUND_OPTIONAL("blast", true);
ui->sliderLameAlgoQuality->setValue(m_settings->lameAlgoQualityDefault());
ui->spinBoxBitrateManagementMin->setValue(m_settings->bitrateManagementMinRateDefault());
ui->spinBoxBitrateManagementMax->setValue(m_settings->bitrateManagementMaxRateDefault());
ui->spinBoxNormalizationFilter->setValue(static_cast<double>(m_settings->normalizationFilterMaxVolumeDefault()) / 100.0);
ui->spinBoxToneAdjustBass->setValue(static_cast<double>(m_settings->toneAdjustBassDefault()) / 100.0);
ui->spinBoxToneAdjustTreble->setValue(static_cast<double>(m_settings->toneAdjustTrebleDefault()) / 100.0);
ui->spinBoxAftenSearchSize->setValue(m_settings->aftenExponentSearchSizeDefault());
ui->spinBoxOpusComplexity->setValue(m_settings->opusComplexityDefault());
ui->comboBoxMP3ChannelMode->setCurrentIndex(m_settings->lameChannelModeDefault());
ui->comboBoxSamplingRate->setCurrentIndex(m_settings->samplingRateDefault());
ui->comboBoxAACProfile->setCurrentIndex(m_settings->aacEncProfileDefault());
ui->comboBoxAftenCodingMode->setCurrentIndex(m_settings->aftenAudioCodingModeDefault());
ui->comboBoxAftenDRCMode->setCurrentIndex(m_settings->aftenDynamicRangeCompressionDefault());
ui->comboBoxNormalizationMode->setCurrentIndex(m_settings->normalizationFilterEQModeDefault());
ui->comboBoxOpusFramesize->setCurrentIndex(m_settings->opusFramesizeDefault());
ui->sliderLameAlgoQuality ->setValue(m_settings->lameAlgoQualityDefault());
ui->spinBoxBitrateManagementMin ->setValue(m_settings->bitrateManagementMinRateDefault());
ui->spinBoxBitrateManagementMax ->setValue(m_settings->bitrateManagementMaxRateDefault());
ui->spinBoxNormalizationFilterPeak->setValue(static_cast<double>(m_settings->normalizationFilterMaxVolumeDefault()) / 100.0);
ui->spinBoxNormalizationFilterSize->setValue(m_settings->normalizationFilterSizeDefault());
ui->spinBoxToneAdjustBass ->setValue(static_cast<double>(m_settings->toneAdjustBassDefault()) / 100.0);
ui->spinBoxToneAdjustTreble ->setValue(static_cast<double>(m_settings->toneAdjustTrebleDefault()) / 100.0);
ui->spinBoxAftenSearchSize ->setValue(m_settings->aftenExponentSearchSizeDefault());
ui->spinBoxOpusComplexity ->setValue(m_settings->opusComplexityDefault());
ui->comboBoxMP3ChannelMode ->setCurrentIndex(m_settings->lameChannelModeDefault());
ui->comboBoxSamplingRate ->setCurrentIndex(m_settings->samplingRateDefault());
ui->comboBoxAACProfile ->setCurrentIndex(m_settings->aacEncProfileDefault());
ui->comboBoxAftenCodingMode ->setCurrentIndex(m_settings->aftenAudioCodingModeDefault());
ui->comboBoxAftenDRCMode ->setCurrentIndex(m_settings->aftenDynamicRangeCompressionDefault());
ui->comboBoxOpusFramesize ->setCurrentIndex(m_settings->opusFramesizeDefault());
SET_CHECKBOX_STATE(ui->checkBoxBitrateManagement, m_settings->bitrateManagementEnabledDefault());
SET_CHECKBOX_STATE(ui->checkBoxNeroAAC2PassMode, m_settings->neroAACEnable2PassDefault());
SET_CHECKBOX_STATE(ui->checkBoxNormalizationFilter, m_settings->normalizationFilterEnabledDefault());
SET_CHECKBOX_STATE(ui->checkBoxNormalizationFilterEnabled, m_settings->normalizationFilterEnabledDefault());
SET_CHECKBOX_STATE(ui->checkBoxNormalizationFilterDynamic, m_settings->normalizationFilterDynamicDefault());
SET_CHECKBOX_STATE(ui->checkBoxNormalizationFilterCoupled, m_settings->normalizationFilterCoupledDefault());
SET_CHECKBOX_STATE(ui->checkBoxAutoDetectInstances, (m_settings->maximumInstancesDefault() < 1));
SET_CHECKBOX_STATE(ui->checkBoxUseSystemTempFolder, !m_settings->customTempPathEnabledDefault());
SET_CHECKBOX_STATE(ui->checkBoxUseSystemTempFolder, (!m_settings->customTempPathEnabledDefault()));
SET_CHECKBOX_STATE(ui->checkBoxAftenFastAllocation, m_settings->aftenFastBitAllocationDefault());
SET_CHECKBOX_STATE(ui->checkBoxRenameOutput, m_settings->renameOutputFilesEnabledDefault());
SET_CHECKBOX_STATE(ui->checkBoxForceStereoDownmix, m_settings->forceStereoDownmixDefault());

View File

@ -127,9 +127,12 @@ private slots:
void metaTagsEnabledChanged(void);
void neroAAC2PassChanged(bool checked);
void neroAACProfileChanged(int value);
void normalizationCoupledChanged(bool checked);
void normalizationDynamicChanged(bool checked);
void normalizationEnabledChanged(bool checked);
void normalizationFilterSizeChanged(int value);
void normalizationFilterSizeFinished(void);
void normalizationMaxVolumeChanged(double volume);
void normalizationModeChanged(int mode);
void notifyOtherInstance(void);
void openFolderActionActivated(void);
void opusSettingsChanged(void);

View File

@ -614,7 +614,7 @@ void ProcessingDialog::startNextJob(void)
}
if(m_settings->normalizationFilterEnabled())
{
thread->addFilter(new NormalizeFilter(m_settings->normalizationFilterMaxVolume(), m_settings->normalizationFilterEQMode()));
thread->addFilter(new NormalizeFilter(m_settings->normalizationFilterMaxVolume(), m_settings->normalizationFilterDynamic(), m_settings->normalizationFilterCoupled(), m_settings->normalizationFilterSize()));
}
if(m_settings->renameOutputFilesEnabled() && (!m_settings->renameOutputFilesPattern().simplified().isEmpty()))
{

View File

@ -26,6 +26,7 @@
#include "Global.h"
//MUtils
#include <MUtils/Global.h>
#include <MUtils/Exception.h>
//Qt
@ -33,17 +34,23 @@
#include <QProcess>
#include <QRegExp>
NormalizeFilter::NormalizeFilter(int peakVolume, int equalizationMode)
static double dbToLinear(const double &value)
{
return pow(10.0, value / 20.0);
}
NormalizeFilter::NormalizeFilter(const int &peakVolume, const bool &dnyAudNorm, const bool &channelsCoupled, const int &filterSize)
:
m_binary(lamexp_tools_lookup("sox.exe"))
m_binary(lamexp_tools_lookup("sox.exe")),
m_useDynAudNorm(dnyAudNorm),
m_peakVolume(qMin(-50, qMax(-3200, peakVolume))),
m_channelsCoupled(channelsCoupled),
m_filterLength(qBound(3, filterSize + (1 - (filterSize % 2)), 301))
{
if(m_binary.isEmpty())
{
MUTILS_THROW("Error initializing SoX filter. Tool 'sox.exe' is not registred!");
}
m_peakVolume = qMin(-50, qMax(-3200, peakVolume));
m_equalizationMode = qMin(2, qMax(0, equalizationMode));
}
NormalizeFilter::~NormalizeFilter(void)
@ -54,7 +61,6 @@ bool NormalizeFilter::apply(const QString &sourceFile, const QString &outputFile
{
QProcess process;
QStringList args;
QString eqMode = (m_equalizationMode == 0) ? "-n" : ((m_equalizationMode == 1) ? "-ne" : "-nb");
process.setWorkingDirectory(QFileInfo(outputFile).canonicalPath());
@ -62,8 +68,23 @@ bool NormalizeFilter::apply(const QString &sourceFile, const QString &outputFile
args << "--temp" << ".";
args << QDir::toNativeSeparators(sourceFile);
args << QDir::toNativeSeparators(outputFile);
if(!m_useDynAudNorm)
{
args << "gain";
args << eqMode << QString().sprintf("%.2f", static_cast<double>(m_peakVolume) / 100.0);
args << (m_channelsCoupled ? "-n" : "-nb");
args << QString().sprintf("%.2f", static_cast<double>(m_peakVolume) / 100.0);
}
else
{
args << "dynaudnorm";
args << "-p" << QString().sprintf("%.2f", qBound(0.1, dbToLinear(static_cast<double>(m_peakVolume) / 100.0), 1.0));
args << "-g" << QString().sprintf("%d", m_filterLength);
if(!m_channelsCoupled)
{
args << "-n";
}
}
if(!startProcess(process, m_binary, args))
{

View File

@ -27,13 +27,15 @@
class NormalizeFilter : public AbstractFilter
{
public:
NormalizeFilter(int peakVolume = -50, int equalizationMode = 0);
NormalizeFilter(const int &peakVolume = -50, const bool &dnyAudNorm = false, const bool &channelsCoupled = true, const int &filterSize = 31);
~NormalizeFilter(void);
virtual bool apply(const QString &sourceFile, const QString &outputFile, AudioFileModel_TechInfo *formatInfo, volatile bool *abortFlag);
private:
const QString m_binary;
int m_peakVolume;
int m_equalizationMode;
const bool m_useDynAudNorm;
const bool m_channelsCoupled;
const int m_peakVolume;
const int m_filterLength;
};

View File

@ -262,8 +262,10 @@ 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");
LAMEXP_MAKE_ID(normalizationFilterEQMode, "AdvancedOptions/VolumeNormalization/EqualizationMode");
LAMEXP_MAKE_ID(normalizationFilterDynamic, "AdvancedOptions/VolumeNormalization/UseDynAudNorm");
LAMEXP_MAKE_ID(normalizationFilterCoupled, "AdvancedOptions/VolumeNormalization/ChannelCoupling");
LAMEXP_MAKE_ID(normalizationFilterMaxVolume, "AdvancedOptions/VolumeNormalization/MaxVolume");
LAMEXP_MAKE_ID(normalizationFilterSize, "AdvancedOptions/VolumeNormalization/FilterLength");
LAMEXP_MAKE_ID(opusComplexity, "AdvancedOptions/Opus/EncodingComplexity");
LAMEXP_MAKE_ID(opusDisableResample, "AdvancedOptions/Opus/DisableResample");
LAMEXP_MAKE_ID(opusFramesize, "AdvancedOptions/Opus/FrameSize");
@ -638,8 +640,10 @@ LAMEXP_MAKE_OPTION_S(mostRecentInputPath, defaultDirectory())
LAMEXP_MAKE_OPTION_B(neroAACEnable2Pass, true)
LAMEXP_MAKE_OPTION_B(neroAacNotificationsEnabled, true)
LAMEXP_MAKE_OPTION_B(normalizationFilterEnabled, false)
LAMEXP_MAKE_OPTION_I(normalizationFilterEQMode, 0)
LAMEXP_MAKE_OPTION_B(normalizationFilterDynamic, false)
LAMEXP_MAKE_OPTION_B(normalizationFilterCoupled, true)
LAMEXP_MAKE_OPTION_I(normalizationFilterMaxVolume, -50)
LAMEXP_MAKE_OPTION_I(normalizationFilterSize, 31)
LAMEXP_MAKE_OPTION_I(opusComplexity, 10)
LAMEXP_MAKE_OPTION_B(opusDisableResample, false)
LAMEXP_MAKE_OPTION_I(opusFramesize, 3)

View File

@ -179,8 +179,10 @@ public:
LAMEXP_MAKE_OPTION_B(neroAACEnable2Pass)
LAMEXP_MAKE_OPTION_B(neroAacNotificationsEnabled)
LAMEXP_MAKE_OPTION_B(normalizationFilterEnabled)
LAMEXP_MAKE_OPTION_I(normalizationFilterEQMode)
LAMEXP_MAKE_OPTION_B(normalizationFilterDynamic)
LAMEXP_MAKE_OPTION_B(normalizationFilterCoupled)
LAMEXP_MAKE_OPTION_I(normalizationFilterMaxVolume)
LAMEXP_MAKE_OPTION_I(normalizationFilterSize)
LAMEXP_MAKE_OPTION_I(opusComplexity)
LAMEXP_MAKE_OPTION_B(opusDisableResample)
LAMEXP_MAKE_OPTION_I(opusFramesize)