Fixed QAAC detection, hopefully.

This commit is contained in:
LoRd_MuldeR 2014-01-19 17:33:39 +01:00
parent 7aea8ce063
commit 7a687f2d7b
4 changed files with 14 additions and 17 deletions

View File

@ -121,10 +121,11 @@ static const g_qaacEncoderInfo;
QAACEncoder::QAACEncoder(void)
:
m_binary_enc(lamexp_lookup_tool("qaac.exe")),
m_binary_dll(lamexp_lookup_tool("libsoxrate.dll"))
m_binary_qaac(lamexp_lookup_tool("qaac.exe")),
m_binary_soxr(lamexp_lookup_tool("libsoxr.dll")),
m_binary_soxc(lamexp_lookup_tool("libsoxconvolver.dll"))
{
if(m_binary_enc.isEmpty() || m_binary_dll.isEmpty())
if(m_binary_qaac.isEmpty() || m_binary_soxr.isEmpty() || m_binary_soxc.isEmpty())
{
THROW("Error initializing QAAC. Tool 'qaac.exe' is not registred!");
}
@ -189,7 +190,7 @@ bool QAACEncoder::encode(const QString &sourceFile, const AudioFileModel_MetaInf
args << "-o" << QDir::toNativeSeparators(outputFile);
args << QDir::toNativeSeparators(sourceFile);
if(!startProcess(process, m_binary_enc, args))
if(!startProcess(process, m_binary_qaac, args))
{
return false;
}

View File

@ -45,7 +45,8 @@ public:
static const AbstractEncoderInfo *getEncoderInfo(void);
private:
const QString m_binary_enc;
const QString m_binary_dll;
const QString m_binary_qaac;
const QString m_binary_soxr;
const QString m_binary_soxc;
int m_configProfile;
};

View File

@ -23,6 +23,7 @@
#include "Model_Settings.h"
#include "Global.h"
#include "Registry_Encoder.h"
#include <QSettings>
#include <QDesktopServices>
@ -379,18 +380,12 @@ void SettingsModel::validate(void)
CHECK_RCMODE(Aften);
CHECK_RCMODE(OpusEnc);
if(!(lamexp_check_tool("neroAacEnc.exe") && lamexp_check_tool("neroAacDec.exe") && lamexp_check_tool("neroAacTag.exe")))
if(EncoderRegistry::getAacEncoder() == AAC_ENCODER_NONE)
{
if(!(lamexp_check_tool("fhgaacenc.exe") && lamexp_check_tool("enc_fhgaac.dll")))
if(this->compressionEncoder() == SettingsModel::AACEncoder)
{
if(!(lamexp_check_tool("qaac.exe") && lamexp_check_tool("libsoxrate.dll")))
{
if(this->compressionEncoder() == SettingsModel::AACEncoder)
{
qWarning("AAC encoder selected, but not available any more. Reverting to MP3!");
this->compressionEncoder(SettingsModel::MP3Encoder);
}
}
qWarning("AAC encoder selected, but not available any more. Reverting to MP3!");
this->compressionEncoder(SettingsModel::MP3Encoder);
}
}

View File

@ -476,7 +476,7 @@ void EncoderRegistry::resetAllEncoders(SettingsModel *settings)
int EncoderRegistry::getAacEncoder(void)
{
if(lamexp_check_tool("qaac.exe") && lamexp_check_tool("libsoxrate.dll"))
if(lamexp_check_tool("qaac.exe") && lamexp_check_tool("libsoxr.dll") && lamexp_check_tool("libsoxconvolver.dll"))
{
return SettingsModel::AAC_ENCODER_QAAC;
}