From 7a687f2d7bad9f92a22499f88d08dd03dc1f0955 Mon Sep 17 00:00:00 2001 From: LoRd_MuldeR Date: Sun, 19 Jan 2014 17:33:39 +0100 Subject: [PATCH] Fixed QAAC detection, hopefully. --- src/Encoder_AAC_QAAC.cpp | 9 +++++---- src/Encoder_AAC_QAAC.h | 5 +++-- src/Model_Settings.cpp | 15 +++++---------- src/Registry_Encoder.cpp | 2 +- 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/src/Encoder_AAC_QAAC.cpp b/src/Encoder_AAC_QAAC.cpp index 34da3ec7..1f4fd727 100644 --- a/src/Encoder_AAC_QAAC.cpp +++ b/src/Encoder_AAC_QAAC.cpp @@ -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; } diff --git a/src/Encoder_AAC_QAAC.h b/src/Encoder_AAC_QAAC.h index dd1986ef..83f398eb 100644 --- a/src/Encoder_AAC_QAAC.h +++ b/src/Encoder_AAC_QAAC.h @@ -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; }; diff --git a/src/Model_Settings.cpp b/src/Model_Settings.cpp index 2fc911ba..0c5ecea6 100644 --- a/src/Model_Settings.cpp +++ b/src/Model_Settings.cpp @@ -23,6 +23,7 @@ #include "Model_Settings.h" #include "Global.h" +#include "Registry_Encoder.h" #include #include @@ -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); } } diff --git a/src/Registry_Encoder.cpp b/src/Registry_Encoder.cpp index d09bd9a3..2c9b8eae 100644 --- a/src/Registry_Encoder.cpp +++ b/src/Registry_Encoder.cpp @@ -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; }