Refactored AAC encoder selection code.

This commit is contained in:
LoRd_MuldeR 2013-07-14 19:45:28 +02:00
parent ceec5fa5e2
commit 1f241a1045
11 changed files with 910 additions and 852 deletions

File diff suppressed because it is too large Load Diff

View File

@ -31,7 +31,7 @@
<context> <context>
<name>MainWindow</name> <name>MainWindow</name>
<message numerus="yes"> <message numerus="yes">
<location filename="../../src/Dialog_MainWindow.cpp" line="726"/> <location filename="../../src/Dialog_MainWindow.cpp" line="724"/>
<source>%n file(s) have been rejected, because read access was not granted!</source> <source>%n file(s) have been rejected, because read access was not granted!</source>
<translation> <translation>
<numerusform>%n file have been rejected, because read access was not granted!</numerusform> <numerusform>%n file have been rejected, because read access was not granted!</numerusform>
@ -39,7 +39,7 @@
</translation> </translation>
</message> </message>
<message numerus="yes"> <message numerus="yes">
<location filename="../../src/Dialog_MainWindow.cpp" line="730"/> <location filename="../../src/Dialog_MainWindow.cpp" line="728"/>
<source>%n file(s) have been rejected, because they are dummy CDDA files!</source> <source>%n file(s) have been rejected, because they are dummy CDDA files!</source>
<translation> <translation>
<numerusform>%n file have been rejected, because they are dummy CDDA files!</numerusform> <numerusform>%n file have been rejected, because they are dummy CDDA files!</numerusform>
@ -47,7 +47,7 @@
</translation> </translation>
</message> </message>
<message numerus="yes"> <message numerus="yes">
<location filename="../../src/Dialog_MainWindow.cpp" line="734"/> <location filename="../../src/Dialog_MainWindow.cpp" line="732"/>
<source>%n file(s) have been rejected, because they appear to be Cue Sheet images!</source> <source>%n file(s) have been rejected, because they appear to be Cue Sheet images!</source>
<translation> <translation>
<numerusform>%n file have been rejected, because they appear to be Cue Sheet images!</numerusform> <numerusform>%n file have been rejected, because they appear to be Cue Sheet images!</numerusform>
@ -55,7 +55,7 @@
</translation> </translation>
</message> </message>
<message numerus="yes"> <message numerus="yes">
<location filename="../../src/Dialog_MainWindow.cpp" line="738"/> <location filename="../../src/Dialog_MainWindow.cpp" line="736"/>
<source>%n file(s) have been rejected, because the file format could not be recognized!</source> <source>%n file(s) have been rejected, because the file format could not be recognized!</source>
<translation> <translation>
<numerusform>%n file have been rejected, because the file format could not be recognized!</numerusform> <numerusform>%n file have been rejected, because the file format could not be recognized!</numerusform>
@ -63,7 +63,7 @@
</translation> </translation>
</message> </message>
<message numerus="yes"> <message numerus="yes">
<location filename="../../src/Dialog_MainWindow.cpp" line="4244"/> <location filename="../../src/Dialog_MainWindow.cpp" line="4254"/>
<source>%n Instance(s)</source> <source>%n Instance(s)</source>
<translation> <translation>
<numerusform>%n Instance</numerusform> <numerusform>%n Instance</numerusform>
@ -74,7 +74,7 @@
<context> <context>
<name>ProcessingDialog</name> <name>ProcessingDialog</name>
<message numerus="yes"> <message numerus="yes">
<location filename="../../src/Dialog_Processing.cpp" line="572"/> <location filename="../../src/Dialog_Processing.cpp" line="573"/>
<source>Encoding: %n file(s) of %1 completed so far, please wait...</source> <source>Encoding: %n file(s) of %1 completed so far, please wait...</source>
<translation> <translation>
<numerusform>Encoding: %n file of %1 completed so far, please wait...</numerusform> <numerusform>Encoding: %n file of %1 completed so far, please wait...</numerusform>
@ -82,7 +82,7 @@
</translation> </translation>
</message> </message>
<message numerus="yes"> <message numerus="yes">
<location filename="../../src/Dialog_Processing.cpp" line="610"/> <location filename="../../src/Dialog_Processing.cpp" line="611"/>
<source>Process was aborted by the user after %n file(s)!</source> <source>Process was aborted by the user after %n file(s)!</source>
<translation> <translation>
<numerusform>Process was aborted by the user after %n file!</numerusform> <numerusform>Process was aborted by the user after %n file!</numerusform>
@ -90,7 +90,7 @@
</translation> </translation>
</message> </message>
<message numerus="yes"> <message numerus="yes">
<location filename="../../src/Dialog_Processing.cpp" line="638"/> <location filename="../../src/Dialog_Processing.cpp" line="639"/>
<source>Error: %1 of %n file(s) failed (%2). Double-click failed items for detailed information!</source> <source>Error: %1 of %n file(s) failed (%2). Double-click failed items for detailed information!</source>
<translation> <translation>
<numerusform>Error: %1 of %n file failed (%2). Double-click failed items for detailed information!</numerusform> <numerusform>Error: %1 of %n file failed (%2). Double-click failed items for detailed information!</numerusform>
@ -98,7 +98,7 @@
</translation> </translation>
</message> </message>
<message numerus="yes"> <message numerus="yes">
<location filename="../../src/Dialog_Processing.cpp" line="638"/> <location filename="../../src/Dialog_Processing.cpp" line="639"/>
<source>%n file(s) skipped</source> <source>%n file(s) skipped</source>
<translation> <translation>
<numerusform>%n file skipped</numerusform> <numerusform>%n file skipped</numerusform>
@ -106,7 +106,7 @@
</translation> </translation>
</message> </message>
<message numerus="yes"> <message numerus="yes">
<location filename="../../src/Dialog_Processing.cpp" line="642"/> <location filename="../../src/Dialog_Processing.cpp" line="643"/>
<source>Error: %1 of %n file(s) failed. Double-click failed items for detailed information!</source> <source>Error: %1 of %n file(s) failed. Double-click failed items for detailed information!</source>
<translation> <translation>
<numerusform>Error: %1 of %n file failed. Double-click failed items for detailed information!</numerusform> <numerusform>Error: %1 of %n file failed. Double-click failed items for detailed information!</numerusform>
@ -114,7 +114,7 @@
</translation> </translation>
</message> </message>
<message numerus="yes"> <message numerus="yes">
<location filename="../../src/Dialog_Processing.cpp" line="656"/> <location filename="../../src/Dialog_Processing.cpp" line="657"/>
<source>All files completed successfully. Skipped %n file(s).</source> <source>All files completed successfully. Skipped %n file(s).</source>
<translation> <translation>
<numerusform>All files completed successfully. Skipped %n file.</numerusform> <numerusform>All files completed successfully. Skipped %n file.</numerusform>
@ -122,7 +122,7 @@
</translation> </translation>
</message> </message>
<message numerus="yes"> <message numerus="yes">
<location filename="../../src/Dialog_Processing.cpp" line="1310"/> <location filename="../../src/Dialog_Processing.cpp" line="1320"/>
<source>%n hour(s)</source> <source>%n hour(s)</source>
<translation> <translation>
<numerusform>%n hour</numerusform> <numerusform>%n hour</numerusform>
@ -130,8 +130,8 @@
</translation> </translation>
</message> </message>
<message numerus="yes"> <message numerus="yes">
<location filename="../../src/Dialog_Processing.cpp" line="1311"/> <location filename="../../src/Dialog_Processing.cpp" line="1321"/>
<location filename="../../src/Dialog_Processing.cpp" line="1315"/> <location filename="../../src/Dialog_Processing.cpp" line="1325"/>
<source>%n minute(s)</source> <source>%n minute(s)</source>
<translation> <translation>
<numerusform>%n minute</numerusform> <numerusform>%n minute</numerusform>
@ -139,8 +139,8 @@
</translation> </translation>
</message> </message>
<message numerus="yes"> <message numerus="yes">
<location filename="../../src/Dialog_Processing.cpp" line="1316"/> <location filename="../../src/Dialog_Processing.cpp" line="1326"/>
<location filename="../../src/Dialog_Processing.cpp" line="1320"/> <location filename="../../src/Dialog_Processing.cpp" line="1330"/>
<source>%n second(s)</source> <source>%n second(s)</source>
<translation> <translation>
<numerusform>%n second</numerusform> <numerusform>%n second</numerusform>
@ -148,7 +148,7 @@
</translation> </translation>
</message> </message>
<message numerus="yes"> <message numerus="yes">
<location filename="../../src/Dialog_Processing.cpp" line="1321"/> <location filename="../../src/Dialog_Processing.cpp" line="1331"/>
<source>%n millisecond(s)</source> <source>%n millisecond(s)</source>
<translation> <translation>
<numerusform>%n millisecond</numerusform> <numerusform>%n millisecond</numerusform>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -34,7 +34,7 @@
#define VER_LAMEXP_MINOR_LO 8 #define VER_LAMEXP_MINOR_LO 8
#define VER_LAMEXP_TYPE Beta #define VER_LAMEXP_TYPE Beta
#define VER_LAMEXP_PATCH 1 #define VER_LAMEXP_PATCH 1
#define VER_LAMEXP_BUILD 1320 #define VER_LAMEXP_BUILD 1321
#define VER_LAMEXP_CONFG 1288 #define VER_LAMEXP_CONFG 1288
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////

View File

@ -178,9 +178,7 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
m_metaData(metaInfo), m_metaData(metaInfo),
m_settings(settingsModel), m_settings(settingsModel),
m_fileSystemModel(NULL), m_fileSystemModel(NULL),
m_neroEncoderAvailable(lamexp_check_tool("neroAacEnc.exe") && lamexp_check_tool("neroAacDec.exe") && lamexp_check_tool("neroAacTag.exe")), m_aacEncoder(SettingsModel::getAacEncoder()),
m_fhgEncoderAvailable(lamexp_check_tool("fhgaacenc.exe") && lamexp_check_tool("enc_fhgaac.dll") && lamexp_check_tool("nsutil.dll") && lamexp_check_tool("libmp4v2.dll")),
m_qaacEncoderAvailable(lamexp_check_tool("qaac.exe") && lamexp_check_tool("libsoxrate.dll")),
m_accepted(false), m_accepted(false),
m_firstTimeShown(true), m_firstTimeShown(true),
m_outputFolderViewCentering(false), m_outputFolderViewCentering(false),
@ -356,10 +354,10 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
m_modeButtonGroup->addButton(ui->radioButtonModeAverageBitrate, SettingsModel::ABRMode); m_modeButtonGroup->addButton(ui->radioButtonModeAverageBitrate, SettingsModel::ABRMode);
m_modeButtonGroup->addButton(ui->radioButtonConstBitrate, SettingsModel::CBRMode); m_modeButtonGroup->addButton(ui->radioButtonConstBitrate, SettingsModel::CBRMode);
ui->radioButtonEncoderAAC->setEnabled(m_neroEncoderAvailable || m_fhgEncoderAvailable || m_qaacEncoderAvailable); ui->radioButtonEncoderAAC->setEnabled(m_aacEncoder > SettingsModel::AAC_ENCODER_NONE);
ui->radioButtonEncoderMP3->setChecked(m_settings->compressionEncoder() == SettingsModel::MP3Encoder); ui->radioButtonEncoderMP3->setChecked(m_settings->compressionEncoder() == SettingsModel::MP3Encoder);
ui->radioButtonEncoderVorbis->setChecked(m_settings->compressionEncoder() == SettingsModel::VorbisEncoder); ui->radioButtonEncoderVorbis->setChecked(m_settings->compressionEncoder() == SettingsModel::VorbisEncoder);
ui->radioButtonEncoderAAC->setChecked((m_settings->compressionEncoder() == SettingsModel::AACEncoder) && (m_neroEncoderAvailable || m_fhgEncoderAvailable || m_qaacEncoderAvailable)); ui->radioButtonEncoderAAC->setChecked((m_settings->compressionEncoder() == SettingsModel::AACEncoder) && (m_aacEncoder > SettingsModel::AAC_ENCODER_NONE));
ui->radioButtonEncoderAC3->setChecked(m_settings->compressionEncoder() == SettingsModel::AC3Encoder); ui->radioButtonEncoderAC3->setChecked(m_settings->compressionEncoder() == SettingsModel::AC3Encoder);
ui->radioButtonEncoderFLAC->setChecked(m_settings->compressionEncoder() == SettingsModel::FLACEncoder); ui->radioButtonEncoderFLAC->setChecked(m_settings->compressionEncoder() == SettingsModel::FLACEncoder);
ui->radioButtonEncoderOpus->setChecked(m_settings->compressionEncoder() == SettingsModel::OpusEncoder); ui->radioButtonEncoderOpus->setChecked(m_settings->compressionEncoder() == SettingsModel::OpusEncoder);
@ -410,7 +408,7 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
SET_CHECKBOX_STATE(ui->checkBoxRenameOutput, m_settings->renameOutputFilesEnabled()); SET_CHECKBOX_STATE(ui->checkBoxRenameOutput, m_settings->renameOutputFilesEnabled());
SET_CHECKBOX_STATE(ui->checkBoxForceStereoDownmix, m_settings->forceStereoDownmix()); SET_CHECKBOX_STATE(ui->checkBoxForceStereoDownmix, m_settings->forceStereoDownmix());
SET_CHECKBOX_STATE(ui->checkBoxOpusDisableResample, m_settings->opusDisableResample()); SET_CHECKBOX_STATE(ui->checkBoxOpusDisableResample, m_settings->opusDisableResample());
ui->checkBoxNeroAAC2PassMode->setEnabled(!(m_fhgEncoderAvailable || m_qaacEncoderAvailable)); ui->checkBoxNeroAAC2PassMode->setEnabled(m_aacEncoder == SettingsModel::AAC_ENCODER_NERO);
ui->lineEditCustomParamLAME->setText(m_settings->customParametersLAME()); ui->lineEditCustomParamLAME->setText(m_settings->customParametersLAME());
ui->lineEditCustomParamOggEnc->setText(m_settings->customParametersOggEnc()); ui->lineEditCustomParamOggEnc->setText(m_settings->customParametersOggEnc());
@ -1478,7 +1476,7 @@ void MainWindow::windowShown(void)
} }
//Check for AAC support //Check for AAC support
if(m_neroEncoderAvailable) if(m_aacEncoder == SettingsModel::AAC_ENCODER_NERO)
{ {
if(m_settings->neroAacNotificationsEnabled()) if(m_settings->neroAacNotificationsEnabled())
{ {
@ -1496,7 +1494,7 @@ void MainWindow::windowShown(void)
} }
else else
{ {
if(m_settings->neroAacNotificationsEnabled() && (!(m_fhgEncoderAvailable || m_qaacEncoderAvailable))) if(m_settings->neroAacNotificationsEnabled() && (m_aacEncoder <= SettingsModel::AAC_ENCODER_NONE))
{ {
QString appPath = QDir(QCoreApplication::applicationDirPath()).canonicalPath(); QString appPath = QDir(QCoreApplication::applicationDirPath()).canonicalPath();
if(appPath.isEmpty()) appPath = QCoreApplication::applicationDirPath(); if(appPath.isEmpty()) appPath = QCoreApplication::applicationDirPath();
@ -3454,7 +3452,13 @@ void MainWindow::updateEncoder(int id)
//Add AAC info //Add AAC info
if(m_settings->compressionEncoder() == SettingsModel::AACEncoder) if(m_settings->compressionEncoder() == SettingsModel::AACEncoder)
{ {
const QString encoderName = m_qaacEncoderAvailable ? tr("QAAC (Apple)") : (m_fhgEncoderAvailable ? tr("FHG AAC (Winamp)") : (m_neroEncoderAvailable ? tr("Nero AAC") : tr("Not available!"))); QString encoderName = tr("Not available!");
switch(m_aacEncoder)
{
case SettingsModel::AAC_ENCODER_NERO: encoderName = tr("Nero AAC"); break;
case SettingsModel::AAC_ENCODER_FHG : encoderName = tr("FHG AAC (Winamp)"); break;
case SettingsModel::AAC_ENCODER_QAAC: encoderName = tr("QAAC (Apple)"); break;
}
ui->labelEncoderInfo->setVisible(true); ui->labelEncoderInfo->setVisible(true);
ui->labelEncoderInfo->setText(tr("Current AAC Encoder: %1").arg(encoderName)); ui->labelEncoderInfo->setText(tr("Current AAC Encoder: %1").arg(encoderName));
} }
@ -3539,20 +3543,23 @@ void MainWindow::updateRCMode(int id)
switch(id) switch(id)
{ {
case SettingsModel::VBRMode: case SettingsModel::VBRMode:
if(m_qaacEncoderAvailable) switch(m_aacEncoder)
{ {
case SettingsModel::AAC_ENCODER_QAAC:
sliderMin = 0; sliderMin = 0;
sliderMax = 32; sliderMax = 32;
} break;
else if(m_fhgEncoderAvailable) case SettingsModel::AAC_ENCODER_FHG:
{
sliderMin = 1; sliderMin = 1;
sliderMax = 6; sliderMax = 6;
} break;
else case SettingsModel::AAC_ENCODER_NERO:
{
sliderMin = 0; sliderMin = 0;
sliderMax = 20; sliderMax = 20;
break;
default:
throw "updateRCMode(): Unknown AAC encoder specified!";
break;
} }
break; break;
case SettingsModel::ABRMode: case SettingsModel::ABRMode:
@ -3737,17 +3744,20 @@ void MainWindow::updateBitrate(int value)
switch(currentRCMode) switch(currentRCMode)
{ {
case SettingsModel::VBRMode: case SettingsModel::VBRMode:
if(m_qaacEncoderAvailable) switch(m_aacEncoder)
{ {
case SettingsModel::AAC_ENCODER_QAAC:
sliderText = tr("Quality Level %1").arg(QString::number(qBound(0, value * 4 , 127))); sliderText = tr("Quality Level %1").arg(QString::number(qBound(0, value * 4 , 127)));
} break;
else if(m_fhgEncoderAvailable) case SettingsModel::AAC_ENCODER_FHG:
{
sliderText = tr("Quality Level %1").arg(QString::number(value)); sliderText = tr("Quality Level %1").arg(QString::number(value));
} break;
else case SettingsModel::AAC_ENCODER_NERO:
{
sliderText = tr("Quality Level %1").arg(QString().sprintf("%.2f", static_cast<double>(value) / 20.0)); sliderText = tr("Quality Level %1").arg(QString().sprintf("%.2f", static_cast<double>(value) / 20.0));
break;
default:
throw "updateBitrate(): Unknown AAC encoder specified!";
break;
} }
m_settings->compressionVbrLevelAacEnc(value); m_settings->compressionVbrLevelAacEnc(value);
break; break;
@ -4329,10 +4339,13 @@ void MainWindow::customParamsHelpRequested(QWidget *obj, QEvent *event)
else if(obj == ui->helpCustomParamOggEnc) showCustomParamsHelpScreen("oggenc2.exe", "--help"); else if(obj == ui->helpCustomParamOggEnc) showCustomParamsHelpScreen("oggenc2.exe", "--help");
else if(obj == ui->helpCustomParamNeroAAC) else if(obj == ui->helpCustomParamNeroAAC)
{ {
if(m_qaacEncoderAvailable) showCustomParamsHelpScreen("qaac.exe", "--help"); switch(m_aacEncoder)
else if(m_fhgEncoderAvailable) showCustomParamsHelpScreen("fhgaacenc.exe", ""); {
else if(m_neroEncoderAvailable) showCustomParamsHelpScreen("neroAacEnc.exe", "-help"); case SettingsModel::AAC_ENCODER_QAAC: showCustomParamsHelpScreen("qaac.exe", "--help"); break;
else MessageBeep(MB_ICONERROR); case SettingsModel::AAC_ENCODER_FHG : showCustomParamsHelpScreen("fhgaacenc.exe", ""); break;
case SettingsModel::AAC_ENCODER_NERO: showCustomParamsHelpScreen("neroAacEnc.exe", "-help"); break;
default: MessageBeep(MB_ICONERROR); break;
}
} }
else if(obj == ui->helpCustomParamFLAC) showCustomParamsHelpScreen("flac.exe", "--help"); else if(obj == ui->helpCustomParamFLAC) showCustomParamsHelpScreen("flac.exe", "--help");
else if(obj == ui->helpCustomParamAften) showCustomParamsHelpScreen("aften.exe", "-h"); else if(obj == ui->helpCustomParamAften) showCustomParamsHelpScreen("aften.exe", "-h");

View File

@ -195,10 +195,6 @@ private:
uint m_outputFolderViewInitCounter; uint m_outputFolderViewInitCounter;
bool m_outputFolderViewCentering; bool m_outputFolderViewCentering;
const bool m_neroEncoderAvailable;
const bool m_fhgEncoderAvailable;
const bool m_qaacEncoderAvailable;
WorkingBanner *m_banner; WorkingBanner *m_banner;
QStringList *m_delayedFileList; QStringList *m_delayedFileList;
QTimer *m_delayedFileTimer; QTimer *m_delayedFileTimer;
@ -235,4 +231,6 @@ private:
CustomEventFilter *m_evenFilterOutputFolderMouse; CustomEventFilter *m_evenFilterOutputFolderMouse;
CustomEventFilter *m_evenFilterOutputFolderView; CustomEventFilter *m_evenFilterOutputFolderView;
CustomEventFilter *m_evenFilterCompressionTab; CustomEventFilter *m_evenFilterCompressionTab;
const int m_aacEncoder;
}; };

View File

@ -144,6 +144,7 @@ ProcessingDialog::ProcessingDialog(FileListModel *fileListModel, AudioFileModel
: :
QDialog(parent), QDialog(parent),
ui(new Ui::ProcessingDialog), ui(new Ui::ProcessingDialog),
m_aacEncoder(SettingsModel::getAacEncoder()),
m_systemTray(new QSystemTrayIcon(QIcon(":/icons/cd_go.png"), this)), m_systemTray(new QSystemTrayIcon(QIcon(":/icons/cd_go.png"), this)),
m_settings(settings), m_settings(settings),
m_metaInfo(metaInfo), m_metaInfo(metaInfo),
@ -996,33 +997,42 @@ AbstractEncoder *ProcessingDialog::makeEncoder(bool *nativeResampling)
/*-------- AACEncoder /*--------*/ /*-------- AACEncoder /*--------*/
case SettingsModel::AACEncoder: case SettingsModel::AACEncoder:
{ {
if(lamexp_check_tool("qaac.exe") && lamexp_check_tool("libsoxrate.dll")) switch(m_aacEncoder)
{ {
QAACEncoder *aacEncoder = new QAACEncoder(); case SettingsModel::AAC_ENCODER_QAAC:
aacEncoder->setRCMode(rcMode = m_settings->compressionRCModeAacEnc()); {
aacEncoder->setBitrate(IS_VBR(rcMode) ? m_settings->compressionVbrLevelAacEnc() : m_settings->compressionBitrateAacEnc()); QAACEncoder *aacEncoder = new QAACEncoder();
aacEncoder->setProfile(m_settings->aacEncProfile()); aacEncoder->setRCMode(rcMode = m_settings->compressionRCModeAacEnc());
aacEncoder->setCustomParams(m_settings->customParametersAacEnc()); aacEncoder->setBitrate(IS_VBR(rcMode) ? m_settings->compressionVbrLevelAacEnc() : m_settings->compressionBitrateAacEnc());
encoder = aacEncoder; aacEncoder->setProfile(m_settings->aacEncProfile());
} aacEncoder->setCustomParams(m_settings->customParametersAacEnc());
else if(lamexp_check_tool("fhgaacenc.exe") && lamexp_check_tool("enc_fhgaac.dll")) encoder = aacEncoder;
{ }
FHGAACEncoder *aacEncoder = new FHGAACEncoder(); break;
aacEncoder->setRCMode(rcMode = m_settings->compressionRCModeAacEnc()); case SettingsModel::AAC_ENCODER_FHG:
aacEncoder->setBitrate(IS_VBR(rcMode) ? m_settings->compressionVbrLevelAacEnc() : m_settings->compressionBitrateAacEnc()); {
aacEncoder->setProfile(m_settings->aacEncProfile()); FHGAACEncoder *aacEncoder = new FHGAACEncoder();
aacEncoder->setCustomParams(m_settings->customParametersAacEnc()); aacEncoder->setRCMode(rcMode = m_settings->compressionRCModeAacEnc());
encoder = aacEncoder; aacEncoder->setBitrate(IS_VBR(rcMode) ? m_settings->compressionVbrLevelAacEnc() : m_settings->compressionBitrateAacEnc());
} aacEncoder->setProfile(m_settings->aacEncProfile());
else aacEncoder->setCustomParams(m_settings->customParametersAacEnc());
{ encoder = aacEncoder;
AACEncoder *aacEncoder = new AACEncoder(); }
aacEncoder->setRCMode(rcMode = m_settings->compressionRCModeAacEnc()); break;
aacEncoder->setBitrate(IS_VBR(rcMode) ? m_settings->compressionVbrLevelAacEnc() : m_settings->compressionBitrateAacEnc()); case SettingsModel::AAC_ENCODER_NERO:
aacEncoder->setEnable2Pass(m_settings->neroAACEnable2Pass()); {
aacEncoder->setProfile(m_settings->aacEncProfile()); AACEncoder *aacEncoder = new AACEncoder();
aacEncoder->setCustomParams(m_settings->customParametersAacEnc()); aacEncoder->setRCMode(rcMode = m_settings->compressionRCModeAacEnc());
encoder = aacEncoder; aacEncoder->setBitrate(IS_VBR(rcMode) ? m_settings->compressionVbrLevelAacEnc() : m_settings->compressionBitrateAacEnc());
aacEncoder->setEnable2Pass(m_settings->neroAACEnable2Pass());
aacEncoder->setProfile(m_settings->aacEncProfile());
aacEncoder->setCustomParams(m_settings->customParametersAacEnc());
encoder = aacEncoder;
}
break;
default:
throw "makeEncoder(): Unknown AAC encoder specified!";
break;
} }
} }
break; break;

View File

@ -128,4 +128,6 @@ private:
DiskObserverThread *m_diskObserver; DiskObserverThread *m_diskObserver;
qint64 m_timerStart; qint64 m_timerStart;
int m_progressViewFilter; int m_progressViewFilter;
const int m_aacEncoder;
}; };

View File

@ -40,7 +40,7 @@
#include <QSet> #include <QSet>
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//SettingsCache Class // SettingsCache Class
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
class SettingsCache class SettingsCache
@ -126,7 +126,7 @@ private:
}; };
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//Macros // Macros
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
#define LAMEXP_MAKE_OPTION_I(OPT,DEF) \ #define LAMEXP_MAKE_OPTION_I(OPT,DEF) \
@ -162,7 +162,7 @@ while(0)
#define DIR_EXISTS(PATH) (QFileInfo(PATH).exists() && QFileInfo(PATH).isDir()) #define DIR_EXISTS(PATH) (QFileInfo(PATH).exists() && QFileInfo(PATH).isDir())
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//Constants // Constants
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
//Setting ID's //Setting ID's
@ -418,6 +418,30 @@ void SettingsModel::syncNow(void)
m_configCache->flushValues(); m_configCache->flushValues();
} }
////////////////////////////////////////////////////////////
// Static Functions
////////////////////////////////////////////////////////////
int SettingsModel::getAacEncoder(void)
{
if(lamexp_check_tool("qaac.exe") && lamexp_check_tool("libsoxrate.dll"))
{
return AAC_ENCODER_QAAC;
}
else if(lamexp_check_tool("fhgaacenc.exe") && lamexp_check_tool("enc_fhgaac.dll") && lamexp_check_tool("nsutil.dll") && lamexp_check_tool("libmp4v2.dll"))
{
return AAC_ENCODER_FHG;
}
else if(lamexp_check_tool("neroAacEnc.exe") && lamexp_check_tool("neroAacDec.exe") && lamexp_check_tool("neroAacTag.exe"))
{
return AAC_ENCODER_NERO;
}
else
{
return AAC_ENCODER_NONE;
}
}
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Private Functions // Private Functions
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -83,6 +83,14 @@ public:
Overwrite_Replaces = 2 Overwrite_Replaces = 2
}; };
enum AACEncoderType
{
AAC_ENCODER_NONE = 0,
AAC_ENCODER_NERO = 1,
AAC_ENCODER_FHG = 2,
AAC_ENCODER_QAAC = 3,
};
//Consts //Consts
static const int mp3Bitrates[15]; static const int mp3Bitrates[15];
static const int ac3Bitrates[20]; static const int ac3Bitrates[20];
@ -167,6 +175,9 @@ public:
void validate(void); void validate(void);
void syncNow(void); void syncNow(void);
//Static
static int getAacEncoder(void);
private: private:
SettingsCache *m_configCache; SettingsCache *m_configCache;