Added "custom parameters" options for Opus. Also added a "help" button for all "custom parameters" edit boxes, which will simply show the CLI help screen.

This commit is contained in:
LoRd_MuldeR 2012-07-29 22:55:02 +02:00
parent c095bbee95
commit 3e18116dd5
23 changed files with 1446 additions and 1058 deletions

View File

@ -462,6 +462,7 @@ del "$(TargetDir)imageformats\q???d4.dll"
<ClCompile Include="src\Tool_Abstract.cpp" />
<ClCompile Include="src\Tool_WaveProperties.cpp" />
<ClCompile Include="src\WinSevenTaskbar.cpp" />
<ClCompile Include="tmp\MOC_CustomEventFilter.cpp" />
<ClCompile Include="tmp\MOC_Decoder_Abstract.cpp" />
<ClCompile Include="tmp\MOC_Dialog_About.cpp" />
<ClCompile Include="tmp\MOC_Dialog_CueImport.cpp" />
@ -516,6 +517,23 @@ del "$(TargetDir)imageformats\q???d4.dll"
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\Config.h" />
<CustomBuild Include="src\CustomEventFilter.h">
<Command Condition="'$(Configuration)|$(Platform)'=='Debug_Qt5|Win32'">"$(QTDIR)\bin\moc.exe" -o "$(SolutionDir)tmp\MOC_%(Filename).cpp" "%(FullPath)"</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug_Qt5|Win32'">MOC "$(SolutionDir)tmp\MOC_%(Filename).cpp"</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"$(QTDIR)\bin\moc.exe" -o "$(SolutionDir)tmp\MOC_%(Filename).cpp" "%(FullPath)"</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">MOC "$(SolutionDir)tmp\MOC_%(Filename).cpp"</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release_Static_Qt5|Win32'">"$(QTDIR)\bin\moc.exe" -o "$(SolutionDir)tmp\MOC_%(Filename).cpp" "%(FullPath)"</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Release_Static_Qt5|Win32'">MOC "$(SolutionDir)tmp\MOC_%(Filename).cpp"</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'">"$(QTDIR)\bin\moc.exe" -o "$(SolutionDir)tmp\MOC_%(Filename).cpp" "%(FullPath)"</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'">MOC "$(SolutionDir)tmp\MOC_%(Filename).cpp"</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(QTDIR)\bin\moc.exe" -o "$(SolutionDir)tmp\MOC_%(Filename).cpp" "%(FullPath)"</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MOC "$(SolutionDir)tmp\MOC_%(Filename).cpp"</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug_Qt5|Win32'">$(SolutionDir)tmp\MOC_%(Filename).cpp;%(Outputs)</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)tmp\MOC_%(Filename).cpp;%(Outputs)</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release_Static_Qt5|Win32'">$(SolutionDir)tmp\MOC_%(Filename).cpp;%(Outputs)</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'">$(SolutionDir)tmp\MOC_%(Filename).cpp;%(Outputs)</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)tmp\MOC_%(Filename).cpp;%(Outputs)</Outputs>
</CustomBuild>
<ClInclude Include="src\Decoder_AAC.h" />
<CustomBuild Include="src\Encoder_AC3.h">
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(QTDIR)\bin\moc.exe" -o "$(SolutionDir)tmp\MOC_%(Filename).cpp" "%(FullPath)"</Command>
@ -726,9 +744,9 @@ del "$(TargetDir)imageformats\q???d4.dll"
<ClInclude Include="src\Tools.h" />
<CustomBuild Include="src\Tool_WaveProperties.h">
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"$(QTDIR)\bin\moc.exe" -o "$(SolutionDir)tmp\MOC_%(Filename).cpp" "%(FullPath)"</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug_Qt5|Win32'">"$(QTDIR5)\qtbase\bin\moc.exe" -o "$(SolutionDir)tmp\MOC_%(Filename).cpp" "%(FullPath)"</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug_Qt5|Win32'">"$(QTDIR)\bin\moc.exe" -o "$(SolutionDir)tmp\MOC_%(Filename).cpp" "%(FullPath)"</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'">"$(QTDIR)\bin\moc.exe" -o "$(SolutionDir)tmp\MOC_%(Filename).cpp" "%(FullPath)"</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Release_Static_Qt5|Win32'">"$(QTDIR5)\qtbase\bin\moc.exe" -o "$(SolutionDir)tmp\MOC_%(Filename).cpp" "%(FullPath)"</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Release_Static_Qt5|Win32'">"$(QTDIR)\bin\moc.exe" -o "$(SolutionDir)tmp\MOC_%(Filename).cpp" "%(FullPath)"</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(QTDIR)\bin\moc.exe" -o "$(SolutionDir)tmp\MOC_%(Filename).cpp" "%(FullPath)"</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">MOC "$(SolutionDir)tmp\MOC_%(Filename).cpp"</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug_Qt5|Win32'">MOC "$(SolutionDir)tmp\MOC_%(Filename).cpp"</Message>
@ -1332,21 +1350,18 @@ del "$(TargetDir)imageformats\q???d4.dll"
<CustomBuild Include="src\Tool_Abstract.h">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">MOC "$(SolutionDir)tmp\MOC_%(Filename).cpp"</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug_Qt5|Win32'">MOC "$(SolutionDir)tmp\MOC_%(Filename).cpp"</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"$(QTDIR)\bin\moc.exe" -o "$(SolutionDir)tmp\MOC_%(Filename).cpp" "%(FullPath)"
</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug_Qt5|Win32'">"$(QTDIR5)\qtbase\bin\moc.exe" -o "$(SolutionDir)tmp\MOC_%(Filename).cpp" "%(FullPath)"</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"$(QTDIR)\bin\moc.exe" -o "$(SolutionDir)tmp\MOC_%(Filename).cpp" "%(FullPath)"</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug_Qt5|Win32'">"$(QTDIR)\bin\moc.exe" -o "$(SolutionDir)tmp\MOC_%(Filename).cpp" "%(FullPath)"</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)tmp\MOC_%(Filename).cpp;%(Outputs)</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug_Qt5|Win32'">$(SolutionDir)tmp\MOC_%(Filename).cpp;%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'">MOC "$(SolutionDir)tmp\MOC_%(Filename).cpp"</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Release_Static_Qt5|Win32'">MOC "$(SolutionDir)tmp\MOC_%(Filename).cpp"</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'">"$(QTDIR)\bin\moc.exe" -o "$(SolutionDir)tmp\MOC_%(Filename).cpp" "%(FullPath)"
</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Release_Static_Qt5|Win32'">"$(QTDIR5)\qtbase\bin\moc.exe" -o "$(SolutionDir)tmp\MOC_%(Filename).cpp" "%(FullPath)"</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'">"$(QTDIR)\bin\moc.exe" -o "$(SolutionDir)tmp\MOC_%(Filename).cpp" "%(FullPath)"</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Release_Static_Qt5|Win32'">"$(QTDIR)\bin\moc.exe" -o "$(SolutionDir)tmp\MOC_%(Filename).cpp" "%(FullPath)"</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'">$(SolutionDir)tmp\MOC_%(Filename).cpp;%(Outputs)</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release_Static_Qt5|Win32'">$(SolutionDir)tmp\MOC_%(Filename).cpp;%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MOC "$(SolutionDir)tmp\MOC_%(Filename).cpp"</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(QTDIR)\bin\moc.exe" -o "$(SolutionDir)tmp\MOC_%(Filename).cpp" "%(FullPath)"
</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(QTDIR)\bin\moc.exe" -o "$(SolutionDir)tmp\MOC_%(Filename).cpp" "%(FullPath)"</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)tmp\MOC_%(Filename).cpp;%(Outputs)</Outputs>
</CustomBuild>
<ClInclude Include="src\WinSevenTaskbar.h" />

View File

@ -373,6 +373,9 @@
<ClCompile Include="src\Decoder_Opus.cpp">
<Filter>Source Files\Decoders</Filter>
</ClCompile>
<ClCompile Include="tmp\MOC_CustomEventFilter.cpp">
<Filter>Generated Files\MOC</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\Config.h">
@ -686,6 +689,9 @@
<CustomBuild Include="src\Encoder_Opus.h">
<Filter>Header Files\Encoders</Filter>
</CustomBuild>
<CustomBuild Include="src\CustomEventFilter.h">
<Filter>Header Files\Misc</Filter>
</CustomBuild>
</ItemGroup>
<ItemGroup>
<None Include="res\MainIcon.ico" />

File diff suppressed because it is too large Load Diff

View File

@ -1890,6 +1890,10 @@
<source>Use Experimental Encoder Perceptual Tuning</source>
<translation>Psychoakustische Optimierungen (experimentell)</translation>
</message>
<message>
<source>OpusEnc:</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MetaInfo</name>

View File

@ -1889,6 +1889,10 @@
<source>Use Experimental Encoder Perceptual Tuning</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>OpusEnc:</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MetaInfo</name>

View File

@ -1899,6 +1899,10 @@ Ouvrir le dossier récursivement...</translation>
<source>Use Experimental Encoder Perceptual Tuning</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>OpusEnc:</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MetaInfo</name>

View File

@ -1890,6 +1890,10 @@
<source>Use Experimental Encoder Perceptual Tuning</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>OpusEnc:</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MetaInfo</name>

View File

@ -1889,6 +1889,10 @@
<source>Use Experimental Encoder Perceptual Tuning</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>OpusEnc:</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MetaInfo</name>

File diff suppressed because it is too large Load Diff

View File

@ -1895,6 +1895,10 @@
<source>Use Experimental Encoder Perceptual Tuning</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>OpusEnc:</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MetaInfo</name>

File diff suppressed because it is too large Load Diff

View File

@ -1889,6 +1889,10 @@
<source>Use Experimental Encoder Perceptual Tuning</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>OpusEnc:</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MetaInfo</name>

View File

@ -1890,6 +1890,10 @@
<source>Use Experimental Encoder Perceptual Tuning</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>OpusEnc:</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MetaInfo</name>

View File

@ -1889,6 +1889,10 @@
<source>Use Experimental Encoder Perceptual Tuning</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>OpusEnc:</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MetaInfo</name>

View File

@ -1324,7 +1324,7 @@
<x>0</x>
<y>0</y>
<width>604</width>
<height>1651</height>
<height>1677</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_22">
@ -2539,7 +2539,7 @@
</property>
</widget>
</item>
<item row="1" column="0" rowspan="4">
<item row="1" column="0" rowspan="8">
<spacer name="horizontalSpacer_33">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -2555,7 +2555,7 @@
</property>
</spacer>
</item>
<item row="1" column="3" rowspan="4">
<item row="1" column="4" rowspan="8">
<spacer name="horizontalSpacer_34">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -2587,7 +2587,7 @@
</property>
</spacer>
</item>
<item row="8" column="1" colspan="2">
<item row="9" column="1" colspan="2">
<spacer name="verticalSpacer_16">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -2603,7 +2603,7 @@
</property>
</spacer>
</item>
<item row="7" column="1" colspan="2">
<item row="8" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QLabel" name="labelCustomParamsIcon">
@ -2630,7 +2630,7 @@
</item>
</layout>
</item>
<item row="6" column="1" colspan="2">
<item row="7" column="1" colspan="2">
<widget class="QLabel" name="labelCustomParamsSpacer">
<property name="minimumSize">
<size>
@ -2671,6 +2671,106 @@
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLabel" name="helpCustomParamLAME">
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="pixmap">
<pixmap resource="../res/Icons.qrc">:/icons/help.png</pixmap>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QLabel" name="helpCustomParamOggEnc">
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="pixmap">
<pixmap resource="../res/Icons.qrc">:/icons/help.png</pixmap>
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QLabel" name="helpCustomParamNeroAAC">
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="pixmap">
<pixmap resource="../res/Icons.qrc">:/icons/help.png</pixmap>
</property>
</widget>
</item>
<item row="4" column="3">
<widget class="QLabel" name="helpCustomParamFLAC">
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="pixmap">
<pixmap resource="../res/Icons.qrc">:/icons/help.png</pixmap>
</property>
</widget>
</item>
<item row="5" column="3">
<widget class="QLabel" name="helpCustomParamAften">
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="pixmap">
<pixmap resource="../res/Icons.qrc">:/icons/help.png</pixmap>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QLabel" name="label_23">
<property name="text">
<string>OpusEnc:</string>
</property>
</widget>
</item>
<item row="6" column="2">
<widget class="QLineEdit" name="lineEditCustomParamOpus">
<property name="font">
<font>
<family>Lucida Console</family>
</font>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="placeholderText">
<string>You can enter custom parameters here!</string>
</property>
</widget>
</item>
<item row="6" column="3">
<widget class="QLabel" name="helpCustomParamOpus">
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="pixmap">
<pixmap resource="../res/Icons.qrc">:/icons/help.png</pixmap>
</property>
</widget>
</item>
</layout>
</item>
</layout>
@ -4412,6 +4512,8 @@
<include location="../res/Icons.qrc"/>
<include location="../res/Icons.qrc"/>
<include location="../res/Icons.qrc"/>
<include location="../res/Icons.qrc"/>
<include location="../res/Icons.qrc"/>
</resources>
<connections>
<connection>

View File

@ -64,6 +64,7 @@
<file>icons/font.png</file>
<file>icons/group.png</file>
<file>icons/heart.png</file>
<file>icons/help.png</file>
<file>icons/house.png</file>
<file>icons/hourglass.png</file>
<file>icons/information.png</file>

View File

@ -30,7 +30,7 @@
#define VER_LAMEXP_MINOR_LO 5
#define VER_LAMEXP_TYPE Alpha
#define VER_LAMEXP_PATCH 11
#define VER_LAMEXP_BUILD 1061
#define VER_LAMEXP_BUILD 1064
///////////////////////////////////////////////////////////////////////////////
// Tool versions (minimum expected versions!)

57
src/CustomEventFilter.h Normal file
View File

@ -0,0 +1,57 @@
///////////////////////////////////////////////////////////////////////////////
// LameXP - Audio Encoder Front-End
// Copyright (C) 2004-2012 LoRd_MuldeR <MuldeR2@GMX.de>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//
// http://www.gnu.org/licenses/gpl-2.0.txt
///////////////////////////////////////////////////////////////////////////////
#include <QEvent>
#include <QObject>
class CustomEventFilter: public QObject
{
Q_OBJECT
public:
CustomEventFilter(void) {}
bool eventFilter(QObject *obj, QEvent *event)
{
if(obj != this)
{
switch(event->type())
{
case QEvent::MouseButtonPress:
emit clicked(obj);
break;
case QEvent::Enter:
emit mouseEntered(obj);
break;
case QEvent::Leave:
emit mouseLeft(obj);
break;
}
}
return false;
}
signals:
void clicked(QObject *sender);
void mouseEntered(QObject *sender);
void mouseLeft(QObject *sender);
};

View File

@ -30,6 +30,7 @@
#include "Dialog_Update.h"
#include "Dialog_DropBox.h"
#include "Dialog_CueImport.h"
#include "Dialog_LogView.h"
#include "Thread_FileAnalyzer.h"
#include "Thread_FileAnalyzer_ST.h"
#include "Thread_MessageHandler.h"
@ -40,6 +41,7 @@
#include "WinSevenTaskbar.h"
#include "Registry_Decoder.h"
#include "ShellIntegration.h"
#include "CustomEventFilter.h"
//Qt includes
#include <QMessageBox>
@ -71,7 +73,7 @@
#include <ShellAPI.h>
////////////////////////////////////////////////////////////
//Helper macros
// Helper macros
////////////////////////////////////////////////////////////
#define ABORT_IF_BUSY do \
@ -118,6 +120,25 @@ while(0)
} \
while(0)
#define SET_CHECKBOX_STATE(CHCKBX, STATE) do \
{ \
if((CHCKBX)->isChecked() != (STATE)) \
{ \
(CHCKBX)->click(); \
} \
if((CHCKBX)->isChecked() != (STATE)) \
{ \
qWarning("Warning: Failed to set checkbox " #CHCKBX " state!"); \
} \
} \
while(0)
#define TRIM_STRING_RIGHT(STR) do \
{ \
while((STR.length() > 0) && STR[STR.length()-1].isSpace()) STR.chop(1); \
} \
while(0)
#define LINK(URL) QString("<a href=\"%1\">%2</a>").arg(URL).arg(QString(URL).replace("-", "&minus;"))
#define FSLINK(PATH) QString("<a href=\"file:///%1\">%2</a>").arg(PATH).arg(QString(PATH).replace("-", "&minus;"))
#define USE_NATIVE_FILE_DIALOG (lamexp_themes_enabled() || ((QSysInfo::windowsVersion() & QSysInfo::WV_NT_based) < QSysInfo::WV_XP))
@ -158,7 +179,10 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
tabWidget->setCurrentIndex(0);
connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(tabPageChanged(int)));
//Setup "Source" tab
//--------------------------------
// Setup "Source" tab
//--------------------------------
sourceFileView->setModel(m_fileListModel);
sourceFileView->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents);
sourceFileView->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents);
@ -194,7 +218,10 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
connect(m_exportCsvContextAction, SIGNAL(triggered(bool)), this, SLOT(exportCsvContextActionTriggered()));
connect(m_importCsvContextAction, SIGNAL(triggered(bool)), this, SLOT(importCsvContextActionTriggered()));
//Setup "Output" tab
//--------------------------------
// Setup "Output" tab
//--------------------------------
outputFolderView->setHeaderHidden(true);
outputFolderView->setAnimated(false);
outputFolderView->setMouseTracking(false);
@ -203,7 +230,7 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
outputFolderView->installEventFilter(this);
outputFoldersEditorLabel->installEventFilter(this);
outputFoldersFovoritesLabel->installEventFilter(this);
while(saveToSourceFolderCheckBox->isChecked() != m_settings->outputToSourceDir()) saveToSourceFolderCheckBox->click();
SET_CHECKBOX_STATE(saveToSourceFolderCheckBox, m_settings->outputToSourceDir());
prependRelativePathCheckBox->setChecked(m_settings->prependRelativeSourcePath());
connect(outputFolderView, SIGNAL(clicked(QModelIndex)), this, SLOT(outputFolderViewClicked(QModelIndex)));
connect(outputFolderView, SIGNAL(activated(QModelIndex)), this, SLOT(outputFolderViewClicked(QModelIndex)));
@ -246,7 +273,10 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
outputFolderViewClicked(QModelIndex());
refreshFavorites();
//Setup "Meta Data" tab
//--------------------------------
// Setup "Meta Data" tab
//--------------------------------
m_metaInfoModel = new MetaInfoModel(m_metaData, 6);
m_metaInfoModel->clearData();
m_metaInfoModel->setData(m_metaInfoModel->index(4, 1), m_settings->metaInfoPosition());
@ -254,14 +284,17 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
metaDataView->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents);
metaDataView->verticalHeader()->hide();
metaDataView->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents);
while(writeMetaDataCheckBox->isChecked() != m_settings->writeMetaTags()) writeMetaDataCheckBox->click();
SET_CHECKBOX_STATE(writeMetaDataCheckBox, m_settings->writeMetaTags());
generatePlaylistCheckBox->setChecked(m_settings->createPlaylist());
connect(buttonEditMeta, SIGNAL(clicked()), this, SLOT(editMetaButtonClicked()));
connect(buttonClearMeta, SIGNAL(clicked()), this, SLOT(clearMetaButtonClicked()));
connect(writeMetaDataCheckBox, SIGNAL(clicked()), this, SLOT(metaTagsEnabledChanged()));
connect(generatePlaylistCheckBox, SIGNAL(clicked()), this, SLOT(playlistEnabledChanged()));
//--------------------------------
//Setup "Compression" tab
//--------------------------------
m_encoderButtonGroup = new QButtonGroup(this);
m_encoderButtonGroup->addButton(radioButtonEncoderMP3, SettingsModel::MP3Encoder);
m_encoderButtonGroup->addButton(radioButtonEncoderVorbis, SettingsModel::VorbisEncoder);
@ -293,9 +326,13 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
connect(sliderBitrate, SIGNAL(valueChanged(int)), this, SLOT(updateBitrate(int)));
updateEncoder(m_encoderButtonGroup->checkedId());
//--------------------------------
//Setup "Advanced Options" tab
//--------------------------------
sliderLameAlgoQuality->setValue(m_settings->lameAlgoQuality());
if(m_settings->maximumInstances() > 0) sliderMaxInstances->setValue(m_settings->maximumInstances());
spinBoxBitrateManagementMin->setValue(m_settings->bitrateManagementMinRate());
spinBoxBitrateManagementMax->setValue(m_settings->bitrateManagementMaxRate());
spinBoxNormalizationFilter->setValue(static_cast<double>(m_settings->normalizationFilterMaxVolume()) / 100.0);
@ -303,6 +340,7 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
spinBoxToneAdjustTreble->setValue(static_cast<double>(m_settings->toneAdjustTreble()) / 100.0);
spinBoxAftenSearchSize->setValue(m_settings->aftenExponentSearchSize());
spinBoxOpusComplexity->setValue(m_settings->opusComplexity());
comboBoxMP3ChannelMode->setCurrentIndex(m_settings->lameChannelMode());
comboBoxSamplingRate->setCurrentIndex(m_settings->samplingRate());
comboBoxAACProfile->setCurrentIndex(m_settings->aacEncProfile());
@ -311,23 +349,35 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
comboBoxNormalizationMode->setCurrentIndex(m_settings->normalizationFilterEqualizationMode());
comboBoxOpusOptimize->setCurrentIndex(m_settings->opusOptimizeFor());
comboBoxOpusFramesize->setCurrentIndex(m_settings->opusFramesize());
while(checkBoxBitrateManagement->isChecked() != m_settings->bitrateManagementEnabled()) checkBoxBitrateManagement->click();
while(checkBoxNeroAAC2PassMode->isChecked() != m_settings->neroAACEnable2Pass()) checkBoxNeroAAC2PassMode->click();
while(checkBoxAftenFastAllocation->isChecked() != m_settings->aftenFastBitAllocation()) checkBoxAftenFastAllocation->click();
while(checkBoxNormalizationFilter->isChecked() != m_settings->normalizationFilterEnabled()) checkBoxNormalizationFilter->click();
while(checkBoxAutoDetectInstances->isChecked() != (m_settings->maximumInstances() < 1)) checkBoxAutoDetectInstances->click();
while(checkBoxUseSystemTempFolder->isChecked() == m_settings->customTempPathEnabled()) checkBoxUseSystemTempFolder->click();
while(checkBoxRenameOutput->isChecked() != m_settings->renameOutputFilesEnabled()) checkBoxRenameOutput->click();
while(checkBoxForceStereoDownmix->isChecked() != m_settings->forceStereoDownmix()) checkBoxForceStereoDownmix->click();
while(checkBoxOpusExpAnalysis->isChecked() != m_settings->opusExpAnalysis()) checkBoxOpusExpAnalysis->click();
SET_CHECKBOX_STATE(checkBoxBitrateManagement, m_settings->bitrateManagementEnabled());
SET_CHECKBOX_STATE(checkBoxNeroAAC2PassMode, m_settings->neroAACEnable2Pass());
SET_CHECKBOX_STATE(checkBoxAftenFastAllocation, m_settings->aftenFastBitAllocation());
SET_CHECKBOX_STATE(checkBoxNormalizationFilter, m_settings->normalizationFilterEnabled());
SET_CHECKBOX_STATE(checkBoxAutoDetectInstances, (m_settings->maximumInstances() < 1));
SET_CHECKBOX_STATE(checkBoxUseSystemTempFolder, m_settings->customTempPathEnabled());
SET_CHECKBOX_STATE(checkBoxRenameOutput, m_settings->renameOutputFilesEnabled());
SET_CHECKBOX_STATE(checkBoxForceStereoDownmix, m_settings->forceStereoDownmix());
SET_CHECKBOX_STATE(checkBoxOpusExpAnalysis, m_settings->opusExpAnalysis());
checkBoxNeroAAC2PassMode->setEnabled(!(m_fhgEncoderAvailable || m_qaacEncoderAvailable));
lineEditCustomParamLAME->setText(m_settings->customParametersLAME());
lineEditCustomParamOggEnc->setText(m_settings->customParametersOggEnc());
lineEditCustomParamNeroAAC->setText(m_settings->customParametersAacEnc());
lineEditCustomParamFLAC->setText(m_settings->customParametersFLAC());
lineEditCustomParamAften->setText(m_settings->customParametersAften());
lineEditCustomParamOpus->setText(m_settings->customParametersOpus());
lineEditCustomTempFolder->setText(QDir::toNativeSeparators(m_settings->customTempPath()));
lineEditRenamePattern->setText(m_settings->renameOutputFilesPattern());
m_evenFilterCustumParamsHelp = new CustomEventFilter();
helpCustomParamLAME->installEventFilter(m_evenFilterCustumParamsHelp);
helpCustomParamOggEnc->installEventFilter(m_evenFilterCustumParamsHelp);
helpCustomParamNeroAAC->installEventFilter(m_evenFilterCustumParamsHelp);
helpCustomParamFLAC->installEventFilter(m_evenFilterCustumParamsHelp);
helpCustomParamAften->installEventFilter(m_evenFilterCustumParamsHelp);
helpCustomParamOpus->installEventFilter(m_evenFilterCustumParamsHelp);
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)));
@ -351,6 +401,7 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
connect(lineEditCustomParamNeroAAC, SIGNAL(editingFinished()), this, SLOT(customParamsChanged()));
connect(lineEditCustomParamFLAC, SIGNAL(editingFinished()), this, SLOT(customParamsChanged()));
connect(lineEditCustomParamAften, SIGNAL(editingFinished()), this, SLOT(customParamsChanged()));
connect(lineEditCustomParamOpus, SIGNAL(editingFinished()), this, SLOT(customParamsChanged()));
connect(sliderMaxInstances, SIGNAL(valueChanged(int)), this, SLOT(updateMaximumInstances(int)));
connect(checkBoxAutoDetectInstances, SIGNAL(clicked(bool)), this, SLOT(autoDetectInstancesChanged(bool)));
connect(buttonBrowseCustomTempFolder, SIGNAL(clicked()), this, SLOT(browseCustomTempFolderButtonClicked()));
@ -366,12 +417,22 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
connect(comboBoxOpusFramesize, SIGNAL(currentIndexChanged(int)), this, SLOT(opusSettingsChanged()));
connect(spinBoxOpusComplexity, SIGNAL(valueChanged(int)), this, SLOT(opusSettingsChanged()));
connect(checkBoxOpusExpAnalysis, SIGNAL(clicked(bool)), this, SLOT(opusSettingsChanged()));
connect(m_evenFilterCustumParamsHelp, SIGNAL(clicked(QObject*)), this, SLOT(customParamsHelpRequested(QObject*)));
//--------------------------------
// Force initial GUI update
//--------------------------------
updateLameAlgoQuality(sliderLameAlgoQuality->value());
updateMaximumInstances(sliderMaxInstances->value());
toneAdjustTrebleChanged(spinBoxToneAdjustTreble->value());
toneAdjustBassChanged(spinBoxToneAdjustBass->value());
customParamsChanged();
//--------------------------------
// Initialize actions
//--------------------------------
//Activate file menu actions
actionOpenFolder->setData(QVariant::fromValue<bool>(false));
actionOpenFolderRecursively->setData(QVariant::fromValue<bool>(true));
@ -463,6 +524,10 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
connect(actionDocumentChangelog, SIGNAL(triggered()), this, SLOT(documentActionActivated()));
connect(actionDocumentTranslate, SIGNAL(triggered()), this, SLOT(documentActionActivated()));
//--------------------------------
// Prepare to show window
//--------------------------------
//Center window in screen
QRect desktopRect = QApplication::desktop()->screenGeometry();
QRect thisRect = this->geometry();
@ -550,6 +615,7 @@ MainWindow::~MainWindow(void)
LAMEXP_DELETE(m_outputFolderFavoritesMenu);
LAMEXP_DELETE(m_outputFolderContextMenu);
LAMEXP_DELETE(m_dropBox);
LAMEXP_DELETE(m_evenFilterCustumParamsHelp);
}
////////////////////////////////////////////////////////////
@ -1471,7 +1537,7 @@ void MainWindow::encodeButtonClicked(void)
{
if(QMessageBox::warning(this, tr("Not Found"), QString("%1<br><tt>%2</tt>").arg(NOBR(tr("Your currently selected TEMP folder does not exist anymore:")), NOBR(QDir::toNativeSeparators(tempFolder))), tr("Restore Default"), tr("Cancel")) == 0)
{
while(checkBoxUseSystemTempFolder->isChecked() == m_settings->customTempPathEnabledDefault()) checkBoxUseSystemTempFolder->click();
SET_CHECKBOX_STATE(checkBoxUseSystemTempFolder, m_settings->customTempPathEnabledDefault());
}
return;
}
@ -3535,6 +3601,7 @@ void MainWindow::customParamsChanged(void)
lineEditCustomParamNeroAAC->setText(lineEditCustomParamNeroAAC->text().simplified());
lineEditCustomParamFLAC->setText(lineEditCustomParamFLAC->text().simplified());
lineEditCustomParamAften->setText(lineEditCustomParamAften->text().simplified());
lineEditCustomParamOpus->setText(lineEditCustomParamOpus->text().simplified());
bool customParamsUsed = false;
if(!lineEditCustomParamLAME->text().isEmpty()) customParamsUsed = true;
@ -3542,6 +3609,7 @@ void MainWindow::customParamsChanged(void)
if(!lineEditCustomParamNeroAAC->text().isEmpty()) customParamsUsed = true;
if(!lineEditCustomParamFLAC->text().isEmpty()) customParamsUsed = true;
if(!lineEditCustomParamAften->text().isEmpty()) customParamsUsed = true;
if(!lineEditCustomParamOpus->text().isEmpty()) customParamsUsed = true;
labelCustomParamsIcon->setVisible(customParamsUsed);
labelCustomParamsText->setVisible(customParamsUsed);
@ -3552,9 +3620,9 @@ void MainWindow::customParamsChanged(void)
m_settings->customParametersAacEnc(lineEditCustomParamNeroAAC->text());
m_settings->customParametersFLAC(lineEditCustomParamFLAC->text());
m_settings->customParametersAften(lineEditCustomParamAften->text());
m_settings->customParametersOpus(lineEditCustomParamOpus->text());
}
/*
* Rename output files enabled changed
*/
@ -3711,6 +3779,83 @@ void MainWindow::useCustomTempFolderChanged(bool checked)
m_settings->customTempPathEnabled(!checked);
}
/*
* Show help for custom parameters
*/
void MainWindow::customParamsHelpRequested(QObject *obj)
{
QString toolName, command;
if(obj == helpCustomParamLAME) { toolName = "lame.exe"; command = "--help"; }
if(obj == helpCustomParamOggEnc) { toolName = "oggenc2.exe"; command = "--help"; }
if(obj == helpCustomParamNeroAAC)
{
if(m_qaacEncoderAvailable) { toolName = "qaac.exe"; command = "--help"; }
else if(m_fhgEncoderAvailable) { toolName = "fhgaacenc.exe"; command = ""; }
else if(m_neroEncoderAvailable) { toolName = "neroAacEnc.exe"; command = "-help"; }
}
if(obj == helpCustomParamFLAC) { toolName = "flac.exe"; command = "--help"; }
if(obj == helpCustomParamAften) { toolName = "aften.exe"; command = "-h"; }
if(obj == helpCustomParamOpus) { toolName = "opusenc_std.exe"; command = "--help"; }
if(toolName.isEmpty() || command.isNull())
{
MessageBeep(MB_ICONERROR);
return;
}
const QString binary = lamexp_lookup_tool(toolName);
if(binary.isEmpty())
{
MessageBeep(MB_ICONERROR);
qWarning("customParamsHelpRequested: Binary could not be found!");
return;
}
QProcess *process = new QProcess();
process->setProcessChannelMode(QProcess::MergedChannels);
process->setReadChannel(QProcess::StandardOutput);
process->start(binary, command.isEmpty() ? QStringList() : QStringList() << command);
if(process->waitForStarted(15000))
{
qApp->processEvents();
process->waitForFinished(15000);
}
if(process->state() != QProcess::NotRunning)
{
process->kill();
process->waitForFinished(-1);
}
QStringList output; bool spaceFlag = true;
while(process->canReadLine())
{
QString temp = QString::fromUtf8(process->readLine());
TRIM_STRING_RIGHT(temp);
if(temp.isEmpty())
{
if(!spaceFlag) { output << temp; spaceFlag = true; }
}
else
{
output << temp; spaceFlag = false;
}
}
LAMEXP_DELETE(process);
if(output.count() < 1)
{
MessageBeep(MB_ICONERROR);
}
LogViewDialog *dialog = new LogViewDialog(this);
TEMP_HIDE_DROPBOX( dialog->exec(output); );
LAMEXP_DELETE(dialog);
}
/*
* Reset all advanced options to their defaults
*/
@ -3732,19 +3877,20 @@ void MainWindow::resetAdvancedOptionsButtonClicked(void)
comboBoxNormalizationMode->setCurrentIndex(m_settings->normalizationFilterEqualizationModeDefault());
comboBoxOpusOptimize->setCurrentIndex(m_settings->opusOptimizeForDefault());
comboBoxOpusFramesize->setCurrentIndex(m_settings->opusFramesizeDefault());
while(checkBoxBitrateManagement->isChecked() != m_settings->bitrateManagementEnabledDefault()) checkBoxBitrateManagement->click();
while(checkBoxNeroAAC2PassMode->isChecked() != m_settings->neroAACEnable2PassDefault()) checkBoxNeroAAC2PassMode->click();
while(checkBoxNormalizationFilter->isChecked() != m_settings->normalizationFilterEnabledDefault()) checkBoxNormalizationFilter->click();
while(checkBoxAutoDetectInstances->isChecked() != (m_settings->maximumInstancesDefault() < 1)) checkBoxAutoDetectInstances->click();
while(checkBoxUseSystemTempFolder->isChecked() == m_settings->customTempPathEnabledDefault()) checkBoxUseSystemTempFolder->click();
while(checkBoxAftenFastAllocation->isChecked() != m_settings->aftenFastBitAllocationDefault()) checkBoxAftenFastAllocation->click();
while(checkBoxRenameOutput->isChecked() != m_settings->renameOutputFilesEnabledDefault()) checkBoxRenameOutput->click();
while(checkBoxForceStereoDownmix->isChecked() != m_settings->forceStereoDownmixDefault()) checkBoxForceStereoDownmix->click();
while(checkBoxOpusExpAnalysis->isChecked() != m_settings->opusExpAnalysisDefault()) checkBoxOpusExpAnalysis->click();
SET_CHECKBOX_STATE(checkBoxBitrateManagement, m_settings->bitrateManagementEnabledDefault());
SET_CHECKBOX_STATE(checkBoxNeroAAC2PassMode, m_settings->neroAACEnable2PassDefault());
SET_CHECKBOX_STATE(checkBoxNormalizationFilter, m_settings->normalizationFilterEnabledDefault());
SET_CHECKBOX_STATE(checkBoxAutoDetectInstances, (m_settings->maximumInstancesDefault() < 1));
SET_CHECKBOX_STATE(checkBoxUseSystemTempFolder, m_settings->customTempPathEnabledDefault());
SET_CHECKBOX_STATE(checkBoxAftenFastAllocation, m_settings->aftenFastBitAllocationDefault());
SET_CHECKBOX_STATE(checkBoxRenameOutput, m_settings->renameOutputFilesEnabledDefault());
SET_CHECKBOX_STATE(checkBoxForceStereoDownmix, m_settings->forceStereoDownmixDefault());
SET_CHECKBOX_STATE(checkBoxOpusExpAnalysis, m_settings->opusExpAnalysisDefault());
lineEditCustomParamLAME->setText(m_settings->customParametersLAMEDefault());
lineEditCustomParamOggEnc->setText(m_settings->customParametersOggEncDefault());
lineEditCustomParamNeroAAC->setText(m_settings->customParametersAacEncDefault());
lineEditCustomParamFLAC->setText(m_settings->customParametersFLACDefault());
lineEditCustomParamOpus->setText(m_settings->customParametersFLACDefault());
lineEditCustomTempFolder->setText(QDir::toNativeSeparators(m_settings->customTempPathDefault()));
lineEditRenamePattern->setText(m_settings->renameOutputFilesPatternDefault());
customParamsChanged();

View File

@ -35,6 +35,7 @@ class FileListModel;
class AbstractEncoder;
class QMenu;
class DropBox;
class CustomEventFilter;
class MainWindow: public QMainWindow, private Ui::MainWindow
{
@ -71,6 +72,7 @@ private slots:
void clearMetaButtonClicked(void);
void closeButtonClicked(void);
void customParamsChanged(void);
void customParamsHelpRequested(QObject*);
void customTempFolderChanged(const QString &text);
void disableNeroAacNotificationsActionTriggered(bool checked);
void disableShellIntegrationActionTriggered(bool);
@ -205,4 +207,6 @@ private:
QActionGroup *m_tabActionGroup;
QButtonGroup *m_encoderButtonGroup;
QButtonGroup *m_modeButtonGroup;
CustomEventFilter *m_evenFilterCustumParamsHelp;
};

View File

@ -857,7 +857,7 @@ AbstractEncoder *ProcessingDialog::makeEncoder(bool *nativeResampling)
opusEncoder->setEncodeComplexity(m_settings->opusComplexity());
opusEncoder->setFrameSize(m_settings->opusFramesize());
opusEncoder->setExpAnalysisOn(m_settings->opusExpAnalysis());
//TODO: opusEncoder->setCustomParams(m_settings->customParametersOpus());
opusEncoder->setCustomParams(m_settings->customParametersOpus());
encoder = opusEncoder;
}
break; case SettingsModel::DCAEncoder:

View File

@ -115,6 +115,7 @@ LAMEXP_MAKE_ID(customParametersOggEnc, "AdvancedOptions/CustomParameters/OggEnc"
LAMEXP_MAKE_ID(customParametersAacEnc, "AdvancedOptions/CustomParameters/AacEnc");
LAMEXP_MAKE_ID(customParametersAften, "AdvancedOptions/CustomParameters/Aften");
LAMEXP_MAKE_ID(customParametersFLAC, "AdvancedOptions/CustomParameters/FLAC");
LAMEXP_MAKE_ID(customParametersOpus, "AdvancedOptions/CustomParameters/OpusEnc");
LAMEXP_MAKE_ID(renameOutputFilesEnabled, "AdvancedOptions/RenameOutputFiles/Enabled");
LAMEXP_MAKE_ID(renameOutputFilesPattern, "AdvancedOptions/RenameOutputFiles/Pattern");
LAMEXP_MAKE_ID(hibernateComputer, "AdvancedOptions/HibernateComputerOnShutdown");
@ -396,6 +397,7 @@ LAMEXP_MAKE_OPTION_S(customParametersOggEnc, QString());
LAMEXP_MAKE_OPTION_S(customParametersAacEnc, QString());
LAMEXP_MAKE_OPTION_S(customParametersAften, QString());
LAMEXP_MAKE_OPTION_S(customParametersFLAC, QString());
LAMEXP_MAKE_OPTION_S(customParametersOpus, QString());
LAMEXP_MAKE_OPTION_B(renameOutputFilesEnabled, false);
LAMEXP_MAKE_OPTION_S(renameOutputFilesPattern, "[<TrackNo>] <Artist> - <Title>");
LAMEXP_MAKE_OPTION_U(metaInfoPosition, UINT_MAX);

View File

@ -126,6 +126,7 @@ public:
LAMEXP_MAKE_OPTION_S(customParametersAacEnc);
LAMEXP_MAKE_OPTION_S(customParametersAften);
LAMEXP_MAKE_OPTION_S(customParametersFLAC);
LAMEXP_MAKE_OPTION_S(customParametersOpus);
LAMEXP_MAKE_OPTION_B(renameOutputFilesEnabled);
LAMEXP_MAKE_OPTION_S(renameOutputFilesPattern);
LAMEXP_MAKE_OPTION_U(metaInfoPosition);