Initial support for advanced options. Only "LAME Algorithm Quality" so far.

This commit is contained in:
LoRd_MuldeR 2011-01-21 19:14:11 +01:00
parent 9e5120576d
commit 476edebda8
21 changed files with 346 additions and 107 deletions

View File

@ -402,7 +402,15 @@
<translation type="unfinished"></translation>
</message>
<message>
<source>More options will be added in a later version, stay tuned!</source>
<source> LAME Algorithm Quality </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Faster Processing</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Better quality</source>
<translation type="unfinished"></translation>
</message>
<message>
@ -781,6 +789,26 @@
<source>Uncompressed</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Best Quality (Very Slow)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>High Quality (Recommended)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Average Quality (Default)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Low Quality (Fast)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Poor Quality (Very Fast)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Do you really want to disable the update reminder?</source>
<translation type="unfinished"></translation>

View File

@ -402,10 +402,6 @@
<source>Advanced Options</source>
<translation>Erweiterte Optionen</translation>
</message>
<message>
<source>More options will be added in a later version, stay tuned!</source>
<translation>Weitere Optionen werden in einer späteren Version zur Verfügung stehen!</translation>
</message>
<message>
<source> Encode Now!</source>
<translation>Jetzt Kodieren!</translation>
@ -898,6 +894,38 @@
<source>n/a</source>
<translation>n/v</translation>
</message>
<message>
<source> LAME Algorithm Quality </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Faster Processing</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Better quality</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Best Quality (Very Slow)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>High Quality (Recommended)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Average Quality (Default)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Low Quality (Fast)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Poor Quality (Very Fast)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MetaInfo</name>

View File

@ -402,10 +402,6 @@
<source>Advanced Options</source>
<translation>Opciones avanzadas</translation>
</message>
<message>
<source>More options will be added in a later version, stay tuned!</source>
<translation>¡Permanezcan atentos, se añadirán más opciones en las próximas versiones!</translation>
</message>
<message>
<source> Encode Now!</source>
<translation>¡Codificar ahora!</translation>
@ -898,6 +894,38 @@
<source>n/a</source>
<translation>n/d</translation>
</message>
<message>
<source> LAME Algorithm Quality </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Faster Processing</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Better quality</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Best Quality (Very Slow)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>High Quality (Recommended)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Average Quality (Default)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Low Quality (Fast)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Poor Quality (Very Fast)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MetaInfo</name>

View File

@ -405,10 +405,6 @@
<source>Advanced Options</source>
<translation>Avancées</translation>
</message>
<message>
<source>More options will be added in a later version, stay tuned!</source>
<translation>Plus d&apos;options seront ajoutés dans une version ultérieure, restez à l&apos;écoute!</translation>
</message>
<message>
<source> Encode Now!</source>
<translation>Encoder maintenant!</translation>
@ -902,6 +898,38 @@ Votre dossier TEMP est situé ici:</translation>
<source>n/a</source>
<translation>n/a</translation>
</message>
<message>
<source> LAME Algorithm Quality </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Faster Processing</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Better quality</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Best Quality (Very Slow)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>High Quality (Recommended)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Average Quality (Default)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Low Quality (Fast)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Poor Quality (Very Fast)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MetaInfo</name>

View File

@ -402,10 +402,6 @@
<source>Advanced Options</source>
<translation>Opzioni Avanzate</translation>
</message>
<message>
<source>More options will be added in a later version, stay tuned!</source>
<translation>Maggiori opzioni verranno aggiunte nella prossima versione, resta sintonizzato!</translation>
</message>
<message>
<source> Encode Now!</source>
<translation>Codifica Ora!</translation>
@ -898,6 +894,38 @@
<source>n/a</source>
<translation type="unfinished"></translation>
</message>
<message>
<source> LAME Algorithm Quality </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Faster Processing</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Better quality</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Best Quality (Very Slow)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>High Quality (Recommended)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Average Quality (Default)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Low Quality (Fast)</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Poor Quality (Very Fast)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MetaInfo</name>

View File

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>676</width>
<width>667</width>
<height>459</height>
</rect>
</property>
@ -971,101 +971,140 @@
<layout class="QGridLayout" name="gridLayout_8">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_7">
<item row="2" column="1">
<widget class="QLabel" name="label_4">
<property name="cursor">
<cursorShape>ForbiddenCursor</cursorShape>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../res/Images.qrc">:/images/Cogwheels.png</pixmap>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="4" column="1">
<spacer name="verticalSpacer_7">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<spacer name="verticalSpacer_8">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0">
<spacer name="horizontalSpacer_12">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="2">
<spacer name="horizontalSpacer_13">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label">
<property name="enabled">
<bool>false</bool>
</property>
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox_5">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>More options will be added in a later version, stay tuned!</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
<property name="title">
<string> LAME Algorithm Quality </string>
</property>
<layout class="QGridLayout" name="gridLayout_17">
<item row="0" column="1">
<layout class="QGridLayout" name="gridLayout_16">
<item row="1" column="1" colspan="3">
<widget class="QSlider" name="sliderLameAlgoQuality">
<property name="maximum">
<number>4</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>1</number>
</property>
</widget>
</item>
<item row="1" column="0">
<spacer name="horizontalSpacer_12">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Maximum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="4">
<spacer name="horizontalSpacer_13">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<spacer name="verticalSpacer_4">
<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>8</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1">
<widget class="QLabel" name="label">
<property name="text">
<string>Faster Processing</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QLabel" name="labelLameAlgoQuality">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string notr="true">(VALUE)</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Better quality</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
@ -1176,7 +1215,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>676</width>
<width>667</width>
<height>21</height>
</rect>
</property>
@ -1505,6 +1544,8 @@
<include location="../res/Images.qrc"/>
<include location="../res/Icons.qrc"/>
<include location="../res/Images.qrc"/>
<include location="../res/Icons.qrc"/>
<include location="../res/Images.qrc"/>
</resources>
<connections>
<connection>

View File

@ -2,8 +2,6 @@
<RCC version="1.0">
<qresource>
<file>images/Busy.gif</file>
<file>images/Cogwheels.png</file>
<file>images/Construction.gif</file>
<file>images/DropBox.png</file>
<file>images/HeaderIcon_LogFile.png</file>
<file>images/HeaderIcon_MetaInfo.png</file>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -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 242
#define VER_LAMEXP_BUILD 243
#define VER_LAMEXP_SUFFIX Beta-1
/*

View File

@ -212,6 +212,11 @@ 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());
connect(sliderLameAlgoQuality, SIGNAL(valueChanged(int)), this, SLOT(updateLameAlgoQuality(int)));
updateLameAlgoQuality(sliderLameAlgoQuality->value());
//Activate file menu actions
connect(actionOpenFolder, SIGNAL(triggered()), this, SLOT(openFolderActionActivated()));
@ -451,6 +456,7 @@ void MainWindow::changeEvent(QEvent *e)
m_metaInfoModel->clearData();
updateEncoder(m_settings->compressionEncoder());
updateLameAlgoQuality(sliderLameAlgoQuality->value());
}
}
@ -1547,6 +1553,40 @@ void MainWindow::updateBitrate(int value)
}
}
/*
* Lame algorithm quality changed
*/
void MainWindow::updateLameAlgoQuality(int value)
{
QString text;
switch(value)
{
case 4:
text = tr("Best Quality (Very Slow)");
break;
case 3:
text = tr("High Quality (Recommended)");
break;
case 2:
text = tr("Average Quality (Default)");
break;
case 1:
text = tr("Low Quality (Fast)");
break;
case 0:
text = tr("Poor Quality (Very Fast)");
break;
}
if(!text.isEmpty())
{
m_settings->lameAlgoQuality(value);
labelLameAlgoQuality->setText(text);
}
}
/*
* Model reset
*/

View File

@ -79,6 +79,7 @@ private slots:
void updateEncoder(int id);
void updateRCMode(int id);
void updateBitrate(int value);
void updateLameAlgoQuality(int value);
void sourceModelChanged(void);
void metaTagsEnabledChanged(void);
void playlistEnabledChanged(void);

View File

@ -435,6 +435,7 @@ void ProcessingDialog::startNextJob(void)
MP3Encoder *mp3Encoder = new MP3Encoder();
mp3Encoder->setBitrate(m_settings->compressionBitrate());
mp3Encoder->setRCMode(m_settings->compressionRCMode());
mp3Encoder->setAlgoQuality(m_settings->lameAlgoQuality());
encoder = mp3Encoder;
}
break;

View File

@ -26,9 +26,12 @@
#include <QProcess>
#include <QDir>
#include <limits.h>
#define IS_UNICODE(STR) (qstricmp(STR.toUtf8().constData(), QString::fromLocal8Bit(STR.toLocal8Bit()).toUtf8().constData()))
static const int g_lameAgorithmQualityLUT[] = {9, 7, 5, 2, 0, INT_MAX};
MP3Encoder::MP3Encoder(void)
:
m_binary(lamexp_lookup_tool("lame.exe"))
@ -37,6 +40,8 @@ MP3Encoder::MP3Encoder(void)
{
throw "Error initializing MP3 encoder. Tool 'lame.exe' is not registred!";
}
m_algorithmQuality = 3;
}
MP3Encoder::~MP3Encoder(void)
@ -49,7 +54,7 @@ bool MP3Encoder::encode(const QString &sourceFile, const AudioFileModel &metaInf
QStringList args;
args << "--nohist";
args << "-h";
args << "-q" << QString::number(g_lameAgorithmQualityLUT[m_algorithmQuality]);
switch(m_configRCMode)
{
@ -178,3 +183,8 @@ bool MP3Encoder::requiresDownmix(void)
{
return true;
}
void MP3Encoder::setAlgoQuality(int value)
{
m_algorithmQuality = value;
}

View File

@ -37,7 +37,11 @@ public:
virtual bool isFormatSupported(const QString &containerType, const QString &containerProfile, const QString &formatType, const QString &formatProfile, const QString &formatVersion);
virtual QString extension(void);
virtual bool requiresDownmix(void);
//Advanced options
virtual void setAlgoQuality(int value);
private:
const QString m_binary;
int m_algorithmQuality;
};

View File

@ -50,6 +50,8 @@ static const char *g_settingsId_neroAacNotificationsEnabled = "Flags/EnableNeroA
static const char *g_settingsId_wmaDecoderNotificationsEnabled = "Flags/EnableWmaDecoderNotifications";
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";
//Macros
#define MAKE_OPTION1(OPT,DEF) \
int SettingsModel::OPT(void) { return m_settings->value(g_settingsId_##OPT, DEF).toInt(); } \
@ -185,3 +187,4 @@ MAKE_OPTION3(neroAacNotificationsEnabled, true)
MAKE_OPTION3(wmaDecoderNotificationsEnabled, true)
MAKE_OPTION3(dropBoxWidgetEnabled, true)
MAKE_OPTION2(currentLanguage, defaultLanguage());
MAKE_OPTION1(lameAlgoQuality, 3)

View File

@ -79,6 +79,7 @@ public:
MAKE_OPTION_DEC3(wmaDecoderNotificationsEnabled)
MAKE_OPTION_DEC3(dropBoxWidgetEnabled)
MAKE_OPTION_DEC2(currentLanguage);
MAKE_OPTION_DEC1(lameAlgoQuality);
//Misc
void validate(void);