diff --git a/LameXP_VS2010.vcxproj b/LameXP_VS2010.vcxproj
index ab96eeba..02e56db3 100644
--- a/LameXP_VS2010.vcxproj
+++ b/LameXP_VS2010.vcxproj
@@ -131,11 +131,13 @@ copy "$(QTDIR)\plugins\imageformats\q????d4.dll" "$(TargetDir)imageformats\"
Fast
NotUsing
Level3
-
-
false
true
false
+
+
+ true
+ false
"/MANIFESTDEPENDENCY:type=%27win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27 processorArchitecture=%27*%27" %(AdditionalOptions)
@@ -157,6 +159,11 @@ copy "$(QTDIR)\plugins\imageformats\q????d4.dll" "$(TargetDir)imageformats\"
MachineX86
5.0
lamexp_crt_startup
+
+
+ true
+
+
Copy plugin DLL%27s
@@ -196,11 +203,12 @@ del "$(TargetDir)imageformats\q???d4.dll"
Fast
NotUsing
Level3
-
-
+ ProgramDatabase
false
true
false
+ false
+ true
"/MANIFESTDEPENDENCY:type=%27win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27 processorArchitecture=%27*%27" %(AdditionalOptions)
@@ -208,10 +216,10 @@ del "$(TargetDir)imageformats\q???d4.dll"
LinkVerboseLib
$(SolutionDir)\etc\Prerequisites\qt4_static\lib;$(SolutionDir)\etc\Prerequisites\qt4_static\plugins\imageformats;$(SolutionDir)\etc\Prerequisites\EncodePointer\lib;%(AdditionalLibraryDirectories)
%(IgnoreSpecificDefaultLibraries)
- false
+ true
- false
+ true
Windows
true
true
@@ -220,6 +228,10 @@ del "$(TargetDir)imageformats\q???d4.dll"
MachineX86
5.0
lamexp_crt_startup
+ true
+
+
+ true
@@ -258,6 +270,7 @@ del "$(TargetDir)imageformats\q???d4.dll"
+
@@ -305,6 +318,7 @@ del "$(TargetDir)imageformats\q???d4.dll"
+
@@ -382,6 +396,17 @@ del "$(TargetDir)imageformats\q???d4.dll"
$(SolutionDir)tmp\MOC_%(Filename).cpp;%(Outputs)
+
+ "$(QTDIR)\bin\moc.exe" -o "$(SolutionDir)tmp\MOC_%(Filename).cpp" "%(FullPath)"
+ "$(QTDIR)\bin\moc.exe" -o "$(SolutionDir)tmp\MOC_%(Filename).cpp" "%(FullPath)"
+ "$(QTDIR)\bin\moc.exe" -o "$(SolutionDir)tmp\MOC_%(Filename).cpp" "%(FullPath)"
+ MOC "$(SolutionDir)tmp\MOC_%(Filename).cpp"
+ MOC "$(SolutionDir)tmp\MOC_%(Filename).cpp"
+ MOC "$(SolutionDir)tmp\MOC_%(Filename).cpp"
+ $(SolutionDir)tmp\MOC_%(Filename).cpp;%(Outputs)
+ $(SolutionDir)tmp\MOC_%(Filename).cpp;%(Outputs)
+ $(SolutionDir)tmp\MOC_%(Filename).cpp;%(Outputs)
+
diff --git a/LameXP_VS2010.vcxproj.filters b/LameXP_VS2010.vcxproj.filters
index 17533262..35009bbc 100644
--- a/LameXP_VS2010.vcxproj.filters
+++ b/LameXP_VS2010.vcxproj.filters
@@ -310,6 +310,12 @@
Source Files\Decoders
+
+ Source Files\Encoders
+
+
+ Generated Files\MOC
+
@@ -584,6 +590,9 @@
Header Files\Threads
+
+ Header Files\Encoders
+
diff --git a/etc/Translation/Blank.ts b/etc/Translation/Blank.ts
index 7cc57589..f3115f00 100644
--- a/etc/Translation/Blank.ts
+++ b/etc/Translation/Blank.ts
@@ -704,7 +704,7 @@
-
+
@@ -1331,9 +1331,9 @@
-
-
-
+
+
+
@@ -1374,13 +1374,13 @@
-
+
-
+
@@ -1455,671 +1455,671 @@
-
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
-
-
-
+
+
+
+
-
-
+
+
-
+
-
+
-
-
-
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
+
-
-
-
+
+
+
-
+
-
+
-
+
-
-
-
+
+
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
+
+
-
+
-
+
-
+
-
+
-
-
-
+
+
+
-
+
-
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
+
-
+
-
+
-
-
-
-
+
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -2541,114 +2541,114 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
diff --git a/src/Config.h b/src/Config.h
index 91219640..713aa80b 100644
--- a/src/Config.h
+++ b/src/Config.h
@@ -29,8 +29,8 @@
#define VER_LAMEXP_MINOR_HI 0
#define VER_LAMEXP_MINOR_LO 3
#define VER_LAMEXP_TYPE Alpha
-#define VER_LAMEXP_PATCH 12
-#define VER_LAMEXP_BUILD 648
+#define VER_LAMEXP_PATCH 13
+#define VER_LAMEXP_BUILD 652
///////////////////////////////////////////////////////////////////////////////
// Tools versions
diff --git a/src/Dialog_MainWindow.cpp b/src/Dialog_MainWindow.cpp
index 4f56120e..9f52edb3 100644
--- a/src/Dialog_MainWindow.cpp
+++ b/src/Dialog_MainWindow.cpp
@@ -86,6 +86,7 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
m_metaData(metaInfo),
m_settings(settingsModel),
m_neroEncoderAvailable(lamexp_check_tool("neroAacEnc.exe") && lamexp_check_tool("neroAacDec.exe") && lamexp_check_tool("neroAacTag.exe")),
+ m_fhgEncoderAvailable(lamexp_check_tool("fhgaacenc.exe") && lamexp_check_tool("enc_fhgaac.dll") && lamexp_check_tool("nsutil.dll") && lamexp_check_tool("libmp4v2.dll")),
m_accepted(false),
m_firstTimeShown(true),
m_OutputFolderViewInitialized(false)
@@ -200,10 +201,10 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
m_modeButtonGroup->addButton(radioButtonModeQuality, SettingsModel::VBRMode);
m_modeButtonGroup->addButton(radioButtonModeAverageBitrate, SettingsModel::ABRMode);
m_modeButtonGroup->addButton(radioButtonConstBitrate, SettingsModel::CBRMode);
- radioButtonEncoderAAC->setEnabled(m_neroEncoderAvailable);
+ radioButtonEncoderAAC->setEnabled(m_neroEncoderAvailable || m_fhgEncoderAvailable);
radioButtonEncoderMP3->setChecked(m_settings->compressionEncoder() == SettingsModel::MP3Encoder);
radioButtonEncoderVorbis->setChecked(m_settings->compressionEncoder() == SettingsModel::VorbisEncoder);
- radioButtonEncoderAAC->setChecked((m_settings->compressionEncoder() == SettingsModel::AACEncoder) && m_neroEncoderAvailable);
+ radioButtonEncoderAAC->setChecked((m_settings->compressionEncoder() == SettingsModel::AACEncoder) && (m_neroEncoderAvailable || m_fhgEncoderAvailable));
radioButtonEncoderAC3->setChecked(m_settings->compressionEncoder() == SettingsModel::AC3Encoder);
radioButtonEncoderFLAC->setChecked(m_settings->compressionEncoder() == SettingsModel::FLACEncoder);
radioButtonEncoderPCM->setChecked(m_settings->compressionEncoder() == SettingsModel::PCMEncoder);
@@ -988,7 +989,7 @@ void MainWindow::windowShown(void)
}
else
{
- if(m_settings->neroAacNotificationsEnabled())
+ if(m_settings->neroAacNotificationsEnabled() && (!m_fhgEncoderAvailable))
{
QString appPath = QDir(QCoreApplication::applicationDirPath()).canonicalPath();
if(appPath.isEmpty()) appPath = QCoreApplication::applicationDirPath();
@@ -1006,32 +1007,6 @@ void MainWindow::windowShown(void)
}
}
}
-
- //Check for WMA support
- //if(m_settings->wmaDecoderNotificationsEnabled())
- //{
- // if(!lamexp_check_tool("wmawav.exe"))
- // {
- // QString messageText;
- // messageText += QString("%1
").arg(tr("LameXP has detected that the WMA File Decoder component is not currently installed on your system.").replace("-", "−"));
- // messageText += QString("%1
").arg(tr("You won't be able to process WMA files as input unless the WMA File Decoder component is installed!").replace("-", "−"));
- // messageText += QString("%1").arg(tr("Do you want to download and install the WMA File Decoder component now?").replace("-", "−"));
- // int result = QMessageBox::information(this, tr("WMA Decoder Missing"), messageText, tr("Download && Install"), tr("Don't Show Again"), tr("Postpone"));
- // if(result == 0)
- // {
- // if(installWMADecoder())
- // {
- // QApplication::quit();
- // return;
- // }
- // }
- // else if(result == 1)
- // {
- // m_settings->wmaDecoderNotificationsEnabled(false);
- // actionDisableWmaDecoderNotifications->setChecked(!m_settings->wmaDecoderNotificationsEnabled());
- // }
- // }
- //}
//Add files from the command-line
for(int i = 0; i < arguments.count() - 1; i++)
diff --git a/src/Dialog_MainWindow.h b/src/Dialog_MainWindow.h
index 7c00a664..6d96b1be 100644
--- a/src/Dialog_MainWindow.h
+++ b/src/Dialog_MainWindow.h
@@ -154,6 +154,7 @@ private:
bool m_OutputFolderViewInitialized;
const bool m_neroEncoderAvailable;
+ const bool m_fhgEncoderAvailable;
WorkingBanner *m_banner;
QStringList *m_delayedFileList;
diff --git a/src/Dialog_Processing.cpp b/src/Dialog_Processing.cpp
index dd0c22a6..8cbf58d0 100644
--- a/src/Dialog_Processing.cpp
+++ b/src/Dialog_Processing.cpp
@@ -32,6 +32,7 @@
#include "Encoder_MP3.h"
#include "Encoder_Vorbis.h"
#include "Encoder_AAC.h"
+#include "Encoder_AAC_FHG.h"
#include "Encoder_AC3.h"
#include "Encoder_FLAC.h"
#include "Encoder_Wave.h"
@@ -595,13 +596,24 @@ void ProcessingDialog::startNextJob(void)
break;
case SettingsModel::AACEncoder:
{
- AACEncoder *aacEncoder = new AACEncoder();
- aacEncoder->setBitrate(m_settings->compressionBitrate());
- aacEncoder->setRCMode(m_settings->compressionRCMode());
- aacEncoder->setEnable2Pass(m_settings->neroAACEnable2Pass());
- aacEncoder->setProfile(m_settings->neroAACProfile());
- aacEncoder->setCustomParams(m_settings->customParametersNeroAAC());
- encoder = aacEncoder;
+ if(lamexp_lookup_tool("fhgaacenc.exe").isEmpty() || lamexp_lookup_tool("enc_fhgaac.dll").isEmpty())
+ {
+ AACEncoder *aacEncoder = new AACEncoder();
+ aacEncoder->setBitrate(m_settings->compressionBitrate());
+ aacEncoder->setRCMode(m_settings->compressionRCMode());
+ aacEncoder->setEnable2Pass(m_settings->neroAACEnable2Pass());
+ aacEncoder->setProfile(m_settings->neroAACProfile());
+ aacEncoder->setCustomParams(m_settings->customParametersNeroAAC());
+ encoder = aacEncoder;
+ }
+ else
+ {
+ FHGAACEncoder *aacEncoder = new FHGAACEncoder();
+ aacEncoder->setBitrate(m_settings->compressionBitrate());
+ aacEncoder->setRCMode(m_settings->compressionRCMode());
+ aacEncoder->setProfile(m_settings->neroAACProfile());
+ encoder = aacEncoder;
+ }
}
break;
case SettingsModel::AC3Encoder:
diff --git a/src/Encoder_AAC_FHG.cpp b/src/Encoder_AAC_FHG.cpp
new file mode 100644
index 00000000..7869f9c5
--- /dev/null
+++ b/src/Encoder_AAC_FHG.cpp
@@ -0,0 +1,176 @@
+///////////////////////////////////////////////////////////////////////////////
+// LameXP - Audio Encoder Front-End
+// Copyright (C) 2004-2011 LoRd_MuldeR
+//
+// 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 "Encoder_AAC_FHG.h"
+
+#include "Global.h"
+#include "Model_Settings.h"
+
+#include
+#include
+
+#define max(a,b) (((a) > (b)) ? (a) : (b))
+#define min(a,b) (((a) < (b)) ? (a) : (b))
+
+FHGAACEncoder::FHGAACEncoder(void)
+:
+ m_binary_enc(lamexp_lookup_tool("fhgaacenc.exe")),
+ m_binary_dll(lamexp_lookup_tool("enc_fhgaac.dll"))
+{
+ if(m_binary_enc.isEmpty() || m_binary_dll.isEmpty())
+ {
+ throw "Error initializing FhgAacEnc. Tool 'fhgaacenc.exe' is not registred!";
+ }
+
+ m_configProfile = 0;
+}
+
+FHGAACEncoder::~FHGAACEncoder(void)
+{
+}
+
+bool FHGAACEncoder::encode(const QString &sourceFile, const AudioFileModel &metaInfo, const QString &outputFile, volatile bool *abortFlag)
+{
+ QProcess process;
+ QStringList args;
+
+ switch(m_configRCMode)
+ {
+ case SettingsModel::VBRMode:
+ args << "--vbr" << QString::number(max(1, min(5, m_configBitrate)));
+ break;
+ case SettingsModel::CBRMode:
+ args << "--cbr" << QString::number(max(32, min(500, (m_configBitrate * 8))));
+ break;
+ case SettingsModel::ABRMode:
+ qWarning("FhgAacEnc does not support ABR mode -> failure!");
+ emit messageLogged("\nTHIS ENCODER DOES NOT SUPPORT AN \"ABR\" MODE !!!");
+ return false;
+ break;
+ default:
+ throw "Bad rate-control mode!";
+ break;
+ }
+
+ switch(m_configProfile)
+ {
+ case 1:
+ args << "--profile" << "lc"; //Forces use of LC AAC profile
+ break;
+ case 2:
+ args << "--profile" << "he"; //Forces use of HE AAC profile
+ break;
+ case 3:
+ args << "--profile" << "hev2"; //Forces use of HEv2 AAC profile
+ break;
+ }
+
+ args << "--dll" << m_binary_dll;
+
+ args << QDir::toNativeSeparators(sourceFile);
+ args << QDir::toNativeSeparators(outputFile);
+
+ if(!startProcess(process, m_binary_enc, args))
+ {
+ return false;
+ }
+
+ bool bTimeout = false;
+ bool bAborted = false;
+
+ QRegExp regExp("Progress:\\s*(\\d+)%");
+
+ while(process.state() != QProcess::NotRunning)
+ {
+ if(*abortFlag)
+ {
+ process.kill();
+ bAborted = true;
+ emit messageLogged("\nABORTED BY USER !!!");
+ break;
+ }
+ process.waitForReadyRead(m_processTimeoutInterval);
+ if(!process.bytesAvailable() && process.state() == QProcess::Running)
+ {
+ process.kill();
+ qWarning("FhgAacEnc process timed out <-- killing!");
+ emit messageLogged("\nPROCESS TIMEOUT !!!");
+ bTimeout = true;
+ break;
+ }
+ while(process.bytesAvailable() > 0)
+ {
+ QByteArray line = process.readLine();
+ QString text = QString::fromUtf8(line.constData()).simplified();
+ if(regExp.lastIndexIn(text) >= 0)
+ {
+ bool ok = false;
+ int progress = regExp.cap(1).toInt(&ok);
+ if(ok) emit statusUpdated(progress);
+ }
+ else if(!text.isEmpty())
+ {
+ emit messageLogged(text);
+ }
+ }
+ }
+
+ process.waitForFinished();
+ if(process.state() != QProcess::NotRunning)
+ {
+ process.kill();
+ process.waitForFinished(-1);
+ }
+
+ emit statusUpdated(100);
+ emit messageLogged(QString().sprintf("\nExited with code: 0x%04X", process.exitCode()));
+
+ if(bTimeout || bAborted || process.exitStatus() != QProcess::NormalExit)
+ {
+ return false;
+ }
+
+ return true;
+}
+
+QString FHGAACEncoder::extension(void)
+{
+ return "mp4";
+}
+
+bool FHGAACEncoder::isFormatSupported(const QString &containerType, const QString &containerProfile, const QString &formatType, const QString &formatProfile, const QString &formatVersion)
+{
+ if(containerType.compare("Wave", Qt::CaseInsensitive) == 0)
+ {
+ if(formatType.compare("PCM", Qt::CaseInsensitive) == 0)
+ {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+
+void FHGAACEncoder::setProfile(int profile)
+{
+ m_configProfile = profile;
+}
diff --git a/src/Encoder_AAC_FHG.h b/src/Encoder_AAC_FHG.h
new file mode 100644
index 00000000..db24281d
--- /dev/null
+++ b/src/Encoder_AAC_FHG.h
@@ -0,0 +1,47 @@
+///////////////////////////////////////////////////////////////////////////////
+// LameXP - Audio Encoder Front-End
+// Copyright (C) 2004-2011 LoRd_MuldeR
+//
+// 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
+///////////////////////////////////////////////////////////////////////////////
+
+#pragma once
+
+#include "Encoder_Abstract.h"
+
+#include
+
+class FHGAACEncoder : public AbstractEncoder
+{
+ Q_OBJECT
+
+public:
+ FHGAACEncoder(void);
+ ~FHGAACEncoder(void);
+
+ virtual bool encode(const QString &sourceFile, const AudioFileModel &metaInfo, const QString &outputFile, volatile bool *abortFlag);
+ virtual bool isFormatSupported(const QString &containerType, const QString &containerProfile, const QString &formatType, const QString &formatProfile, const QString &formatVersion);
+ virtual QString extension(void);
+
+ //Advanced options
+ virtual void setProfile(int profile);
+
+private:
+ const QString m_binary_enc;
+ const QString m_binary_dll;
+ int m_configProfile;
+};
diff --git a/src/Thread_Initialization.cpp b/src/Thread_Initialization.cpp
index cd28a9b3..df337e31 100644
--- a/src/Thread_Initialization.cpp
+++ b/src/Thread_Initialization.cpp
@@ -233,9 +233,12 @@ void InitializationThread::run()
//Register all translations
initTranslations();
- //Look for Nero encoder
+ //Look for Nero AAC encoder
initNeroAac();
+ //Look for FHG AAC encoder
+ initFhgAac();
+
delay();
m_bSuccess = true;
}
@@ -410,6 +413,105 @@ void InitializationThread::initNeroAac(void)
}
}
+void InitializationThread::initFhgAac(void)
+{
+ const QString appPath = QDir(QCoreApplication::applicationDirPath()).canonicalPath();
+
+ QFileInfo fhgFileInfo[4];
+ fhgFileInfo[0] = QFileInfo(QString("%1/fhgaacenc.exe").arg(appPath));
+ fhgFileInfo[1] = QFileInfo(QString("%1/enc_fhgaac.dll").arg(appPath));
+ fhgFileInfo[2] = QFileInfo(QString("%1/nsutil.dll").arg(appPath));
+ fhgFileInfo[3] = QFileInfo(QString("%1/libmp4v2.dll").arg(appPath));
+
+ bool fhgFilesFound = true;
+ for(int i = 0; i < 4; i++) { if(!fhgFileInfo[i].exists()) fhgFilesFound = false; }
+
+ //Lock the FhgAacEnc binaries
+ if(!fhgFilesFound)
+ {
+ qDebug("FhgAacEnc binaries not found -> FhgAacEnc support will be disabled!\n");
+ return;
+ }
+
+ qDebug("Found FhgAacEnc executable:\n%s\n", fhgFileInfo[0].canonicalFilePath().toUtf8().constData());
+ qDebug("Found FhgAacEnc enclibrary:\n%s\n", fhgFileInfo[1].canonicalFilePath().toUtf8().constData());
+
+ LockedFile *fhgBin[4];
+ for(int i = 0; i < 4; i++) fhgBin[i] = NULL;
+
+ try
+ {
+ for(int i = 0; i < 4; i++)
+ {
+ fhgBin[i] = new LockedFile(fhgFileInfo[i].canonicalFilePath());
+ }
+ }
+ catch(...)
+ {
+ for(int i = 0; i < 4; i++) LAMEXP_DELETE(fhgBin[i]);
+ qWarning("Failed to get excluive lock to FhgAacEnc binary -> FhgAacEnc support will be disabled!");
+ return;
+ }
+
+ QProcess process;
+ process.setProcessChannelMode(QProcess::MergedChannels);
+ process.setReadChannel(QProcess::StandardOutput);
+ process.start(fhgFileInfo[0].canonicalFilePath(), QStringList() << "--version");
+
+ if(!process.waitForStarted())
+ {
+ qWarning("FhgAacEnc process failed to create!");
+ qWarning("Error message: \"%s\"\n", process.errorString().toLatin1().constData());
+ process.kill();
+ process.waitForFinished(-1);
+ for(int i = 0; i < 4; i++) LAMEXP_DELETE(fhgBin[i]);
+ return;
+ }
+
+ QRegExp fhgAacEncSig("fhgaacenc version (\\d+) by tmkk", Qt::CaseInsensitive);
+ unsigned int fhgVersion = 0;
+
+ while(process.state() != QProcess::NotRunning)
+ {
+ process.waitForReadyRead();
+ if(!process.bytesAvailable() && process.state() == QProcess::Running)
+ {
+ qWarning("FhgAacEnc process time out -> killing!");
+ process.kill();
+ process.waitForFinished(-1);
+ for(int i = 0; i < 4; i++) LAMEXP_DELETE(fhgBin[i]);
+ return;
+ }
+ while(process.bytesAvailable() > 0)
+ {
+ QString line = QString::fromUtf8(process.readLine().constData()).simplified();
+ if(fhgAacEncSig.lastIndexIn(line) >= 0)
+ {
+ bool ok = false;
+ unsigned int temp = fhgAacEncSig.cap(1).toUInt(&ok);
+ if(ok) fhgVersion = temp;
+ }
+ }
+ }
+
+ if(!(fhgVersion > 0))
+ {
+ qWarning("FhgAacEnc version couldn't be determined -> FhgAacEnc support will be disabled!");
+ for(int i = 0; i < 4; i++) LAMEXP_DELETE(fhgBin[i]);
+ return;
+ }
+ else if(fhgVersion < 20110819)
+ {
+ qWarning("FhgAacEnc version is too much outdated -> FhgAacEnc support will be disabled!");
+ for(int i = 0; i < 4; i++) LAMEXP_DELETE(fhgBin[i]);
+ return;
+ }
+
+ for(int i = 0; i < 4; i++)
+ {
+ lamexp_register_tool(fhgFileInfo[i].fileName(), fhgBin[i], fhgVersion);
+ }
+}
//void InitializationThread::initWmaDec(void)
//{
diff --git a/src/Thread_Initialization.h b/src/Thread_Initialization.h
index 569b81f0..857cd84c 100644
--- a/src/Thread_Initialization.h
+++ b/src/Thread_Initialization.h
@@ -42,6 +42,7 @@ private:
void delay(void);
void initTranslations(void);
void initNeroAac(void);
+ void initFhgAac(void);
bool m_bSuccess;
lamexp_cpu_t m_cpuFeatures;