Changed detection of QAAC for the new fully-static build.

This commit is contained in:
LoRd_MuldeR 2011-11-21 22:28:14 +01:00
parent d95b42c018
commit 3e7ae9642c
9 changed files with 34 additions and 42 deletions

View File

@ -2761,17 +2761,17 @@
<context>
<name>QApplication</name>
<message>
<location filename="../../src/Global.cpp" line="696"/>
<location filename="../../src/Global.cpp" line="699"/>
<source>Executable &apos;%1&apos; doesn&apos;t support Windows compatibility mode.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Global.cpp" line="783"/>
<location filename="../../src/Global.cpp" line="786"/>
<source>Executable &apos;%1&apos; requires Qt v%2, but found Qt v%3.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Global.cpp" line="792"/>
<location filename="../../src/Global.cpp" line="795"/>
<source>Executable &apos;%1&apos; requires Windows 2000 or later.</source>
<translation type="unfinished"></translation>
</message>

View File

@ -2761,17 +2761,17 @@
<context>
<name>QApplication</name>
<message>
<location filename="../../src/Global.cpp" line="696"/>
<location filename="../../src/Global.cpp" line="699"/>
<source>Executable &apos;%1&apos; doesn&apos;t support Windows compatibility mode.</source>
<translation type="unfinished">Plik wykonywalny &apos;%1&apos; nie działa w trybie kompatybilności z Windows.</translation>
</message>
<message>
<location filename="../../src/Global.cpp" line="783"/>
<location filename="../../src/Global.cpp" line="786"/>
<source>Executable &apos;%1&apos; requires Qt v%2, but found Qt v%3.</source>
<translation type="unfinished">Plik wykonywalny &apos;%1&apos; wymaga Qt v%2, znaleziono jednak Qt v%3.</translation>
</message>
<message>
<location filename="../../src/Global.cpp" line="792"/>
<location filename="../../src/Global.cpp" line="795"/>
<source>Executable &apos;%1&apos; requires Windows 2000 or later.</source>
<translation type="unfinished">Plik wykonywalny &apos;%1&apos; wymaga do uruchomienia Windows 2000 lub nowszego.</translation>
</message>

View File

@ -30,7 +30,7 @@
#define VER_LAMEXP_MINOR_LO 4
#define VER_LAMEXP_TYPE Alpha
#define VER_LAMEXP_PATCH 2
#define VER_LAMEXP_BUILD 782
#define VER_LAMEXP_BUILD 784
///////////////////////////////////////////////////////////////////////////////
// Tool versions (minimum expected versions!)

View File

@ -90,7 +90,7 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
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_qaacEncoderAvailable(lamexp_check_tool("qaac.exe") && lamexp_check_tool("libsoxrate.dll") && lamexp_check_tool("msvcp100.dll") && lamexp_check_tool("msvcr100.dll")),
m_qaacEncoderAvailable(lamexp_check_tool("qaac.exe")),
m_accepted(false),
m_firstTimeShown(true),
m_OutputFolderViewInitialized(false)

View File

@ -661,7 +661,7 @@ void ProcessingDialog::startNextJob(void)
break;
case SettingsModel::AACEncoder:
{
if(lamexp_check_tool("qaac.exe") && lamexp_check_tool("libsoxrate.dll"))
if(lamexp_check_tool("qaac.exe"))
{
QAACEncoder *aacEncoder = new QAACEncoder();
aacEncoder->setBitrate(m_settings->compressionBitrate());

View File

@ -27,13 +27,13 @@
#include <math.h>
#include <QProcess>
#include <QDir>
#include <QCoreApplication>
QAACEncoder::QAACEncoder(void)
:
m_binary_enc(lamexp_lookup_tool("qaac.exe")),
m_binary_dll(lamexp_lookup_tool("libsoxrate.dll"))
m_binary_enc(lamexp_lookup_tool("qaac.exe"))
{
if(m_binary_enc.isEmpty() || m_binary_dll.isEmpty())
if(m_binary_enc.isEmpty())
{
throw "Error initializing QAAC. Tool 'qaac.exe' is not registred!";
}
@ -52,6 +52,12 @@ bool QAACEncoder::encode(const QString &sourceFile, const AudioFileModel &metaIn
process.setWorkingDirectory(QFileInfo(outputFile).canonicalPath());
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
env.insert("PATH", QString("%1;%2").arg(QDir::toNativeSeparators(QDir(QCoreApplication::applicationDirPath()).canonicalPath()), QDir::toNativeSeparators(lamexp_temp_folder2())));
env.insert("TEMP", QDir::toNativeSeparators(lamexp_temp_folder2()));
env.insert("TMP", QDir::toNativeSeparators(lamexp_temp_folder2()));
process.setProcessEnvironment(env);
if(m_configRCMode != SettingsModel::VBRMode)
{
switch(m_configProfile)

View File

@ -42,6 +42,5 @@ public:
private:
const QString m_binary_enc;
const QString m_binary_dll;
int m_configProfile;
};

View File

@ -222,7 +222,7 @@ void SettingsModel::validate(void)
{
if(!(lamexp_check_tool("fhgaacenc.exe") && lamexp_check_tool("enc_fhgaac.dll")))
{
if(!(lamexp_check_tool("qaac.exe") && lamexp_check_tool("libsoxrate.dll")))
if(!lamexp_check_tool("qaac.exe"))
{
if(this->compressionEncoder() == SettingsModel::AACEncoder)
{

View File

@ -484,15 +484,10 @@ void InitializationThread::initFhgAac(void)
void InitializationThread::initQAac(void)
{
const QString appPath = QDir(QCoreApplication::applicationDirPath()).canonicalPath();
QFileInfo qaacFileInfo[4];
qaacFileInfo[0] = QFileInfo(QString("%1/qaac.exe").arg(appPath));
qaacFileInfo[1] = QFileInfo(QString("%1/libsoxrate.dll").arg(appPath));
qaacFileInfo[2] = QFileInfo(QString("%1/msvcp100.dll").arg(appPath));
qaacFileInfo[3] = QFileInfo(QString("%1/msvcr100.dll").arg(appPath));
bool qaacFilesFound = true;
for(int i = 0; i < 4; i++) { if(!qaacFileInfo[i].exists()) qaacFilesFound = false; }
QFileInfo qaacFileInfo(QString("%1/qaac.exe").arg(appPath));
if(!qaacFileInfo.exists()) qaacFilesFound = false;
//Lock the QAAC binaries
if(!qaacFilesFound)
@ -501,21 +496,16 @@ void InitializationThread::initQAac(void)
return;
}
qDebug("Found QAAC encoder:\n%s\n", qaacFileInfo[0].canonicalFilePath().toUtf8().constData());
LockedFile *qaacBin[4];
for(int i = 0; i < 4; i++) qaacBin[i] = NULL;
qDebug("Found QAAC encoder:\n%s\n", qaacFileInfo.canonicalFilePath().toUtf8().constData());
LockedFile *qaacBin = NULL;
try
{
for(int i = 0; i < 4; i++)
{
qaacBin[i] = new LockedFile(qaacFileInfo[i].canonicalFilePath());
}
qaacBin = new LockedFile(qaacFileInfo.canonicalFilePath());
}
catch(...)
{
for(int i = 0; i < 4; i++) LAMEXP_DELETE(qaacBin[i]);
LAMEXP_DELETE(qaacBin);
qWarning("Failed to get excluive lock to QAAC binary -> QAAC support will be disabled!");
return;
}
@ -523,7 +513,7 @@ void InitializationThread::initQAac(void)
QProcess process;
process.setProcessChannelMode(QProcess::MergedChannels);
process.setReadChannel(QProcess::StandardOutput);
process.start(qaacFileInfo[0].canonicalFilePath(), QStringList() << "--check");
process.start(qaacFileInfo.canonicalFilePath(), QStringList() << "--check");
if(!process.waitForStarted())
{
@ -531,7 +521,7 @@ void InitializationThread::initQAac(void)
qWarning("Error message: \"%s\"\n", process.errorString().toLatin1().constData());
process.kill();
process.waitForFinished(-1);
for(int i = 0; i < 4; i++) LAMEXP_DELETE(qaacBin[i]);
LAMEXP_DELETE(qaacBin);
return;
}
@ -548,7 +538,7 @@ void InitializationThread::initQAac(void)
qWarning("QAAC process time out -> killing!");
process.kill();
process.waitForFinished(-1);
for(int i = 0; i < 4; i++) LAMEXP_DELETE(qaacBin[i]);
LAMEXP_DELETE(qaacBin);
return;
}
while(process.bytesAvailable() > 0)
@ -587,33 +577,30 @@ void InitializationThread::initQAac(void)
if(!(qaacVersion > 0))
{
qWarning("QAAC version couldn't be determined -> QAAC support will be disabled!");
for(int i = 0; i < 4; i++) LAMEXP_DELETE(qaacBin[i]);
LAMEXP_DELETE(qaacBin);
return;
}
else if(qaacVersion < lamexp_toolver_qaacenc())
{
qWarning("QAAC version is too much outdated (%s) -> QAAC support will be disabled!", lamexp_version2string("v?.??", qaacVersion, "N/A").toLatin1().constData());
for(int i = 0; i < 4; i++) LAMEXP_DELETE(qaacBin[i]);
LAMEXP_DELETE(qaacBin);
return;
}
if(!(coreVersion > 0))
{
qWarning("CoreAudioToolbox version couldn't be determined -> QAAC support will be disabled!");
for(int i = 0; i < 4; i++) LAMEXP_DELETE(qaacBin[i]);
LAMEXP_DELETE(qaacBin);
return;
}
else if(coreVersion < lamexp_toolver_coreaudio())
{
qWarning("CoreAudioToolbox version is too much outdated (%s) -> QAAC support will be disabled!", lamexp_version2string("v?.?.?.?", coreVersion, "N/A").toLatin1().constData());
for(int i = 0; i < 4; i++) LAMEXP_DELETE(qaacBin[i]);
LAMEXP_DELETE(qaacBin);
return;
}
for(int i = 0; i < 4; i++)
{
lamexp_register_tool(qaacFileInfo[i].fileName(), qaacBin[i], qaacVersion);
}
lamexp_register_tool(qaacFileInfo.fileName(), qaacBin, qaacVersion);
}
void InitializationThread::selfTest(void)