diff --git a/LameXP_VS2013.vcxproj b/LameXP_VS2013.vcxproj index 73651482..fbd27c0e 100644 --- a/LameXP_VS2013.vcxproj +++ b/LameXP_VS2013.vcxproj @@ -297,6 +297,7 @@ copy /Y "$(SolutionDir)\..\Prerequisites\VisualLeakDetector\bin\Win32\*.manifest + @@ -357,6 +358,7 @@ copy /Y "$(SolutionDir)\..\Prerequisites\VisualLeakDetector\bin\Win32\*.manifest + @@ -407,6 +409,17 @@ copy /Y "$(SolutionDir)\..\Prerequisites\VisualLeakDetector\bin\Win32\*.manifest + + "$(QTDIR)\bin\moc.exe" -o "$(SolutionDir)tmp\$(ProjectName)\MOC_%(Filename).cpp" "%(FullPath)" + "$(QTDIR)\bin\moc.exe" -o "$(SolutionDir)tmp\$(ProjectName)\MOC_%(Filename).cpp" "%(FullPath)" + "$(QTDIR)\bin\moc.exe" -o "$(SolutionDir)tmp\$(ProjectName)\MOC_%(Filename).cpp" "%(FullPath)" + MOC "$(SolutionDir)tmp\$(ProjectName)\MOC_%(Filename).cpp" + MOC "$(SolutionDir)tmp\$(ProjectName)\MOC_%(Filename).cpp" + MOC "$(SolutionDir)tmp\$(ProjectName)\MOC_%(Filename).cpp" + $(SolutionDir)tmp\$(ProjectName)\MOC_%(Filename).cpp;%(Outputs) + $(SolutionDir)tmp\$(ProjectName)\MOC_%(Filename).cpp;%(Outputs) + $(SolutionDir)tmp\$(ProjectName)\MOC_%(Filename).cpp;%(Outputs) + diff --git a/LameXP_VS2013.vcxproj.filters b/LameXP_VS2013.vcxproj.filters index ca979142..4134a675 100644 --- a/LameXP_VS2013.vcxproj.filters +++ b/LameXP_VS2013.vcxproj.filters @@ -409,6 +409,12 @@ Generated Files\QRC + + Source Files\Encoders + + + Generated Files\MOC + @@ -540,6 +546,9 @@ Header Files\Misc + + Header Files\Encoders + diff --git a/doc/Changelog.html b/doc/Changelog.html index 9123b881..c8aeea9c 100644 --- a/doc/Changelog.html +++ b/doc/Changelog.html @@ -88,6 +88,7 @@ h='gmail.com';a='@';n='z&#x document.write(''+e+'<\/'+'a'+'>'); // -->
+
  • Added optional support for the libfdk-aac encoder, using the fdkaac front-end by nu774
  • Updated ALAC decoder to refalac v1.47 (2015-02-15), based on reference implementation by Apple
  • Fixed potential deadlock in Cue Sheet import dialog when "Browse..." button is clicked
  • diff --git a/doc/Changelog.md b/doc/Changelog.md index 17a35b1b..e403b0ce 100644 --- a/doc/Changelog.md +++ b/doc/Changelog.md @@ -5,6 +5,7 @@ ## LameXP v4.12 [xxxx-xx-xx] ## {-} * Added Hungarian translation, thanks to Zityi's Translator Team +* Added optional support for the *libfdk-aac* encoder, using the [fdkaac](https://github.com/nu774/fdkaac) front-end by nu774 * Updated ALAC decoder to refalac v1.47 (2015-02-15), based on reference implementation by Apple * Fixed potential deadlock in Cue Sheet import dialog when "Browse..." button is clicked diff --git a/etc/Translation/Blank.ts b/etc/Translation/Blank.ts index 5ac67082..53c9c116 100644 --- a/etc/Translation/Blank.ts +++ b/etc/Translation/Blank.ts @@ -2551,32 +2551,32 @@ - + Overwrite Mode - + Warning: This mode may overwrite existing files with no way to revert! - + Continue - + Revert - + Already Running - + LameXP is already running, please use the running instance! diff --git a/etc/Translation/LameXP_DE.ts b/etc/Translation/LameXP_DE.ts index 3564b36d..cb914703 100644 --- a/etc/Translation/LameXP_DE.ts +++ b/etc/Translation/LameXP_DE.ts @@ -1282,7 +1282,7 @@ Verzeichnis konnte nicht erstellt werden - + LameXP is already running, please use the running instance! LameXP wird bereits ausgeführt. Bitte benutzen Sie die laufende Instanz! @@ -1484,7 +1484,7 @@ Diese Demo (Test) Version von LameXP ist am %1. abgelaufen. - + Already Running Wird bereits ausgeführt @@ -2450,22 +2450,22 @@ Bei existierender Zieldatei: - + Overwrite Mode Überschreiben Modus - + Warning: This mode may overwrite existing files with no way to revert! Achtung: Dieser Modus überschreibt möglicherweise existierende Dateien! - + Continue Fortfahren - + Revert Zurück diff --git a/etc/Translation/LameXP_ES.ts b/etc/Translation/LameXP_ES.ts index d847fdf4..b756dad3 100644 --- a/etc/Translation/LameXP_ES.ts +++ b/etc/Translation/LameXP_ES.ts @@ -1410,12 +1410,12 @@ ¡El disco es de solo lectura o no se tienen los derechos suficientes! - + Already Running Ya se está ejecutando - + LameXP is already running, please use the running instance! ¡LameXP ya se está ejecutando, use esa instancia por favor! @@ -2450,22 +2450,22 @@ Si el archivo de destino ya existe: - + Overwrite Mode Modo de sobreescritura - + Warning: This mode may overwrite existing files with no way to revert! Aviso: ¡Este modo sobreescribirá los archivos existentes sin ninguna posibilidad de recuperarlos! - + Continue Continuar - + Revert Revertir diff --git a/etc/Translation/LameXP_FR.ts b/etc/Translation/LameXP_FR.ts index 783ccac1..620a6ce6 100644 --- a/etc/Translation/LameXP_FR.ts +++ b/etc/Translation/LameXP_FR.ts @@ -1415,12 +1415,12 @@ Votre dossier TEMP est situé ici: Le lecteur est en lecture seule ou en droits d'accès insuffisants! - + Already Running Déjà en cours d'exécution - + LameXP is already running, please use the running instance! LameXP est déjà en cours d'exécution, veuillez utiliser cette instance! @@ -2458,22 +2458,22 @@ Ouvrir le dossier récursivement... Si le fichier cible existe déjà : - + Overwrite Mode Mode d'écrasement - + Warning: This mode may overwrite existing files with no way to revert! AVERTISSEMENT : Ce mode peut remplacer les fichiers existants sans aucun moyen de revenir en arrière ! - + Continue Continuer - + Revert Revenir diff --git a/etc/Translation/LameXP_HU.ts b/etc/Translation/LameXP_HU.ts index ded18de3..21c2a271 100644 --- a/etc/Translation/LameXP_HU.ts +++ b/etc/Translation/LameXP_HU.ts @@ -2551,32 +2551,32 @@ Nem lehet írni a kiválasztott könyvtárba. Kérjük válasszon egy másik könyvtárat! - + Overwrite Mode Felülírási mód - + Warning: This mode may overwrite existing files with no way to revert! Figyelem: Ez a mód felülírja a már létező fájlokat, amelyeket azt követően nem tud visszaállítani! - + Continue Folytatás - + Revert Visszaállítás - + Already Running Már fut - + LameXP is already running, please use the running instance! A LameXP már fut. Kérjük, használja a futó példányt! diff --git a/etc/Translation/LameXP_IT.ts b/etc/Translation/LameXP_IT.ts index 26be2d7f..b2a1f33a 100644 --- a/etc/Translation/LameXP_IT.ts +++ b/etc/Translation/LameXP_IT.ts @@ -1282,7 +1282,7 @@ Creazione della cartella non riuscita - + LameXP is already running, please use the running instance! LameXP è già in esecuzione, per favore usa la sessione già aperta! @@ -1484,7 +1484,7 @@ Questa versione dimostrativa (Test) di LameXP è scaduta il %1. - + Already Running Già in Esecuzione @@ -2450,22 +2450,22 @@ Se il file di destinazione esiste già: - + Overwrite Mode Modalità sovrascrittura - + Warning: This mode may overwrite existing files with no way to revert! Attenzione: Questa modalità potrebbe sovrascrivere i file esistenti senza possibilità di recupero! - + Continue Continuare - + Revert Annulla diff --git a/etc/Translation/LameXP_KR.ts b/etc/Translation/LameXP_KR.ts index 6343c766..9bb96804 100644 --- a/etc/Translation/LameXP_KR.ts +++ b/etc/Translation/LameXP_KR.ts @@ -1713,12 +1713,12 @@ 드라이버가 읽기-전용이거나 접근 권한이 없습니다! - + Already Running 이미 실행 중 - + LameXP is already running, please use the running instance! LameXP가 이미 실행 중입니다. 실행 중인 인스턴스를 사용하십시오! @@ -2446,22 +2446,22 @@ 대상 파일이 이미 존재하면: - + Overwrite Mode 대체 방식 - + Warning: This mode may overwrite existing files with no way to revert! 경고: 이 방식은 기존 파일이 되돌릴 수 없는 방법으로 대체될 수 있습니다! - + Continue 계속 - + Revert 되돌리기 diff --git a/etc/Translation/LameXP_PL.ts b/etc/Translation/LameXP_PL.ts index a2236f90..ba9e650f 100644 --- a/etc/Translation/LameXP_PL.ts +++ b/etc/Translation/LameXP_PL.ts @@ -2568,32 +2568,32 @@ Nie można zapisać do wybranej lokalizacji. Prosze wybierz inną lokalizację! - + Overwrite Mode Tryb nadpisywania - + Warning: This mode may overwrite existing files with no way to revert! Ostrzeżenie: W tym trybie istniejące pliki będą nadpisywane bez możliwości ich odzyskania! - + Continue Kontynuuj - + Revert Cofnij - + Already Running Już działa - + LameXP is already running, please use the running instance! LameXP już działa, przejdź do działającego procesu! diff --git a/etc/Translation/LameXP_RU.ts b/etc/Translation/LameXP_RU.ts index 7069db71..3d2230dc 100644 --- a/etc/Translation/LameXP_RU.ts +++ b/etc/Translation/LameXP_RU.ts @@ -1645,12 +1645,12 @@ Диск только для чтения или недостаточно прав для записи! - + Already Running Уже запущено - + LameXP is already running, please use the running instance! LameXP уже запущена, пожалуйста, используйте запущенную копию программы! @@ -2460,22 +2460,22 @@ Если файл уже существует: - + Overwrite Mode Ркжим перезаписи - + Warning: This mode may overwrite existing files with no way to revert! Предупреждение: В этом режиме безвозвратно будут перезаписываться уже существующие файлы, если таковые есть! - + Continue Да - + Revert Отмена diff --git a/etc/Translation/LameXP_SV.ts b/etc/Translation/LameXP_SV.ts index 35f1b850..debb35ba 100644 --- a/etc/Translation/LameXP_SV.ts +++ b/etc/Translation/LameXP_SV.ts @@ -2560,32 +2560,32 @@ Kan inte skriva till den specificerade mappen. Välj en annan destination! - + Overwrite Mode Överskrivningsläge - + Warning: This mode may overwrite existing files with no way to revert! Varning! Det här läget kan skriva över befintliga filer, utan möjlighet att återskapa! - + Continue Fortsätt - + Revert Återställ - + Already Running Körs redan - + LameXP is already running, please use the running instance! LameXP körs redan, använd den redan startade instansen! diff --git a/etc/Translation/LameXP_TW.ts b/etc/Translation/LameXP_TW.ts index 99be9dfb..f8624c7b 100644 --- a/etc/Translation/LameXP_TW.ts +++ b/etc/Translation/LameXP_TW.ts @@ -1406,12 +1406,12 @@ 驅動器是只讀的或沒有足夠的訪問權限 ! - + Already Running 已在運行 - + LameXP is already running, please use the running instance! LameXP 已在運行,請使用當前運行的實例 ! @@ -2446,22 +2446,22 @@ 如果目標文件已存在: - + Overwrite Mode 覆蓋模式 - + Warning: This mode may overwrite existing files with no way to revert! 警告: 這種模式可能會覆蓋現有的文件無法恢復! - + Continue 繼續 - + Revert 還原 diff --git a/etc/Translation/LameXP_UK.ts b/etc/Translation/LameXP_UK.ts index ba94ae8b..62ffb86b 100644 --- a/etc/Translation/LameXP_UK.ts +++ b/etc/Translation/LameXP_UK.ts @@ -1609,12 +1609,12 @@ Носій в режимі 'лише для читання' або використовуються недостатні права доступу! - + Already Running Вже запущено - + LameXP is already running, please use the running instance! LameXP вже запущено, тому використовуйте запущену копію програми! @@ -2453,22 +2453,22 @@ Якщо цільовий файл вже існує: - + Overwrite Mode Режим перезапису - + Warning: This mode may overwrite existing files with no way to revert! Попередження: Цей режим може перезаписати існуючі файли без можливості відмінити зміни! - + Continue Продовжити - + Revert Відмінити diff --git a/etc/Translation/LameXP_ZH.ts b/etc/Translation/LameXP_ZH.ts index faea0a9e..9da77f46 100644 --- a/etc/Translation/LameXP_ZH.ts +++ b/etc/Translation/LameXP_ZH.ts @@ -1406,12 +1406,12 @@ 驱动器是只读的或没有足够的访问权限! - + Already Running 已运行 - + LameXP is already running, please use the running instance! LameXP 已在运行,请使用当前运行的实例! @@ -2446,22 +2446,22 @@ 如果目标文件已存在: - + Overwrite Mode 覆盖模式 - + Warning: This mode may overwrite existing files with no way to revert! 警告: 这种模式可能会覆盖现有的文件且无法恢复! - + Continue 继续 - + Revert 后退 diff --git a/src/Config.h b/src/Config.h index 8c115d3d..65f10e8f 100644 --- a/src/Config.h +++ b/src/Config.h @@ -35,7 +35,7 @@ #define VER_LAMEXP_MINOR_LO 2 #define VER_LAMEXP_TYPE Alpha #define VER_LAMEXP_PATCH 1 -#define VER_LAMEXP_BUILD 1708 +#define VER_LAMEXP_BUILD 1710 #define VER_LAMEXP_CONFG 1700 /////////////////////////////////////////////////////////////////////////////// @@ -51,6 +51,7 @@ #define VER_LAMEXP_TOOL_NEROAAC 1540 #define VER_LAMEXP_TOOL_FHGAACENC 20120806 +#define VER_LAMEXP_TOOL_FDKAACENC 62 #define VER_LAMEXP_TOOL_QAAC 244 #define VER_LAMEXP_TOOL_COREAUDIO 7980 diff --git a/src/Dialog_MainWindow.cpp b/src/Dialog_MainWindow.cpp index d312242c..bb6be550 100644 --- a/src/Dialog_MainWindow.cpp +++ b/src/Dialog_MainWindow.cpp @@ -4044,14 +4044,15 @@ void MainWindow::customParamsHelpRequested(QWidget *obj, QEvent *event) { switch(EncoderRegistry::getAacEncoder()) { - case SettingsModel::AAC_ENCODER_QAAC: showCustomParamsHelpScreen("qaac.exe", "--help"); break; - case SettingsModel::AAC_ENCODER_FHG : showCustomParamsHelpScreen("fhgaacenc.exe", ""); break; - case SettingsModel::AAC_ENCODER_NERO: showCustomParamsHelpScreen("neroAacEnc.exe", "-help"); break; + case SettingsModel::AAC_ENCODER_QAAC: showCustomParamsHelpScreen("qaac.exe", "--help"); break; + case SettingsModel::AAC_ENCODER_FHG : showCustomParamsHelpScreen("fhgaacenc.exe", "" ); break; + case SettingsModel::AAC_ENCODER_FDK : showCustomParamsHelpScreen("fdkaac.exe", "--help"); break; + case SettingsModel::AAC_ENCODER_NERO: showCustomParamsHelpScreen("neroAacEnc.exe", "-help" ); break; default: MUtils::Sound::beep(MUtils::Sound::BEEP_ERR); break; } } - else if(obj == ui->helpCustomParamFLAC) showCustomParamsHelpScreen("flac.exe", "--help"); - else if(obj == ui->helpCustomParamAften) showCustomParamsHelpScreen("aften.exe", "-h"); + else if(obj == ui->helpCustomParamFLAC) showCustomParamsHelpScreen("flac.exe", "--help"); + else if(obj == ui->helpCustomParamAften) showCustomParamsHelpScreen("aften.exe", "-h" ); else if(obj == ui->helpCustomParamOpus) showCustomParamsHelpScreen("opusenc.exe", "--help"); else MUtils::Sound::beep(MUtils::Sound::BEEP_ERR); } diff --git a/src/Global.h b/src/Global.h index 8c757238..bbdca1cc 100644 --- a/src/Global.h +++ b/src/Global.h @@ -61,6 +61,7 @@ bool lamexp_version_demo (void); const QDate& lamexp_version_expires (void); unsigned int lamexp_toolver_neroaac (void); unsigned int lamexp_toolver_fhgaacenc(void); +unsigned int lamexp_toolver_fdkaacenc(void); unsigned int lamexp_toolver_qaacenc (void); unsigned int lamexp_toolver_coreaudio(void); diff --git a/src/Global_Version.cpp b/src/Global_Version.cpp index 7153191c..d64d7b1e 100644 --- a/src/Global_Version.cpp +++ b/src/Global_Version.cpp @@ -67,6 +67,7 @@ static const char *g_lamexp_tracker_url = "https://github.com/lordmulder/LameXP/ //Tool versions (expected versions!) static const unsigned int g_lamexp_toolver_neroaac = VER_LAMEXP_TOOL_NEROAAC; static const unsigned int g_lamexp_toolver_fhgaacenc = VER_LAMEXP_TOOL_FHGAACENC; +static const unsigned int g_lamexp_toolver_fdkaacenc = VER_LAMEXP_TOOL_FDKAACENC; static const unsigned int g_lamexp_toolver_qaacenc = VER_LAMEXP_TOOL_QAAC; static const unsigned int g_lamexp_toolver_coreaudio = VER_LAMEXP_TOOL_COREAUDIO; @@ -84,6 +85,7 @@ unsigned int lamexp_version_confg(void) { return g_lamexp_version_confg; const char* lamexp_version_release(void) { return g_lamexp_version_rname; } unsigned int lamexp_toolver_neroaac(void) { return g_lamexp_toolver_neroaac; } unsigned int lamexp_toolver_fhgaacenc(void) { return g_lamexp_toolver_fhgaacenc; } +unsigned int lamexp_toolver_fdkaacenc(void) { return g_lamexp_toolver_fdkaacenc; } unsigned int lamexp_toolver_qaacenc(void) { return g_lamexp_toolver_qaacenc; } unsigned int lamexp_toolver_coreaudio(void) { return g_lamexp_toolver_coreaudio; } diff --git a/src/Model_Settings.h b/src/Model_Settings.h index c65e34cf..7d7901b7 100644 --- a/src/Model_Settings.h +++ b/src/Model_Settings.h @@ -93,7 +93,8 @@ public: AAC_ENCODER_NONE = 0, AAC_ENCODER_NERO = 1, AAC_ENCODER_FHG = 2, - AAC_ENCODER_QAAC = 3, + AAC_ENCODER_FDK = 3, + AAC_ENCODER_QAAC = 4, }; //Consts diff --git a/src/Registry_Encoder.cpp b/src/Registry_Encoder.cpp index 6a2e1227..7bb7f3ca 100644 --- a/src/Registry_Encoder.cpp +++ b/src/Registry_Encoder.cpp @@ -26,6 +26,7 @@ #include "Model_Settings.h" #include "Encoder_AAC.h" #include "Encoder_AAC_FHG.h" +#include "Encoder_AAC_FDK.h" #include "Encoder_AAC_QAAC.h" #include "Encoder_AC3.h" #include "Encoder_DCA.h" @@ -106,6 +107,13 @@ AbstractEncoder *EncoderRegistry::createInstance(const int encoderId, const Sett encoder = aacEncoder; } break; + case SettingsModel::AAC_ENCODER_FDK: + { + FDKAACEncoder *aacEncoder = new FDKAACEncoder(); + aacEncoder->setProfile(settings->aacEncProfile()); + encoder = aacEncoder; + } + break; case SettingsModel::AAC_ENCODER_NERO: { AACEncoder *aacEncoder = new AACEncoder(); @@ -198,20 +206,21 @@ const AbstractEncoderInfo *EncoderRegistry::getEncoderInfo(const int encoderId) switch(encoderId) { - case SettingsModel::MP3Encoder: info = MP3Encoder::getEncoderInfo(); break; + case SettingsModel::MP3Encoder: info = MP3Encoder ::getEncoderInfo(); break; case SettingsModel::VorbisEncoder: info = VorbisEncoder::getEncoderInfo(); break; - case SettingsModel::AC3Encoder: info = AC3Encoder::getEncoderInfo(); break; - case SettingsModel::FLACEncoder: info = FLACEncoder::getEncoderInfo(); break; - case SettingsModel::OpusEncoder: info = OpusEncoder::getEncoderInfo(); break; - case SettingsModel::DCAEncoder: info = DCAEncoder::getEncoderInfo(); break; - case SettingsModel::MACEncoder: info = MACEncoder::getEncoderInfo(); break; - case SettingsModel::PCMEncoder: info = WaveEncoder::getEncoderInfo(); break; + case SettingsModel::AC3Encoder: info = AC3Encoder ::getEncoderInfo(); break; + case SettingsModel::FLACEncoder: info = FLACEncoder ::getEncoderInfo(); break; + case SettingsModel::OpusEncoder: info = OpusEncoder ::getEncoderInfo(); break; + case SettingsModel::DCAEncoder: info = DCAEncoder ::getEncoderInfo(); break; + case SettingsModel::MACEncoder: info = MACEncoder ::getEncoderInfo(); break; + case SettingsModel::PCMEncoder: info = WaveEncoder ::getEncoderInfo(); break; case SettingsModel::AACEncoder: switch(getAacEncoder()) { - case SettingsModel::AAC_ENCODER_QAAC: info = QAACEncoder::getEncoderInfo(); break; + case SettingsModel::AAC_ENCODER_QAAC: info = QAACEncoder ::getEncoderInfo(); break; case SettingsModel::AAC_ENCODER_FHG: info = FHGAACEncoder::getEncoderInfo(); break; - case SettingsModel::AAC_ENCODER_NERO: info = AACEncoder::getEncoderInfo(); break; + case SettingsModel::AAC_ENCODER_FDK: info = FDKAACEncoder::getEncoderInfo(); break; + case SettingsModel::AAC_ENCODER_NERO: info = AACEncoder ::getEncoderInfo(); break; default: MUTILS_THROW("Unknown AAC encoder specified!"); } break; @@ -480,6 +489,10 @@ int EncoderRegistry::getAacEncoder(void) { return SettingsModel::AAC_ENCODER_QAAC; } + else if(lamexp_tools_check("fdkaac.exe")) + { + return SettingsModel::AAC_ENCODER_FDK; + } else if(lamexp_tools_check("fhgaacenc.exe") && lamexp_tools_check("enc_fhgaac.dll") && lamexp_tools_check("nsutil.dll") && lamexp_tools_check("libmp4v2.dll")) { return SettingsModel::AAC_ENCODER_FHG; diff --git a/src/Thread_Initialization.cpp b/src/Thread_Initialization.cpp index 106bb107..94ff6235 100644 --- a/src/Thread_Initialization.cpp +++ b/src/Thread_Initialization.cpp @@ -403,6 +403,7 @@ double InitializationThread::doInit(const size_t threadCount) //Look for AAC encoders initAacEnc_Nero(); initAacEnc_FHG(); + initAacEnc_FDK(); initAacEnc_QAAC(); m_bSuccess = true; @@ -522,7 +523,7 @@ void InitializationThread::initAacEnc_Nero(void) { if(!MUtils::OS::is_executable_file(neroFileInfo[i].canonicalFilePath())) { - qDebug("%s executbale is invalid -> NeroAAC encoding support will be disabled!\n", MUTILS_UTF8(neroFileInfo[i].fileName())); + qDebug("%s executable is invalid -> NeroAAC encoding support will be disabled!\n", MUTILS_UTF8(neroFileInfo[i].fileName())); return; } } @@ -645,7 +646,7 @@ void InitializationThread::initAacEnc_FHG(void) if(!MUtils::OS::is_executable_file(fhgFileInfo[0].canonicalFilePath())) { - qDebug("FhgAacEnc executbale is invalid -> FhgAacEnc support will be disabled!\n"); + qDebug("FhgAacEnc executable is invalid -> FhgAacEnc support will be disabled!\n"); return; } @@ -728,6 +729,96 @@ void InitializationThread::initAacEnc_FHG(void) } } +void InitializationThread::initAacEnc_FDK(void) +{ + const QString appPath = QDir(QCoreApplication::applicationDirPath()).canonicalPath(); + + const QFileInfo fdkFileInfo(QString("%1/fdkaac.exe").arg(appPath)); + if(!(fdkFileInfo.exists() && fdkFileInfo.isFile())) + { + qDebug("FdkAac encoder binary not found -> FdkAac encoding support will be disabled!\n"); + return; + } + + if(!MUtils::OS::is_executable_file(fdkFileInfo.canonicalFilePath())) + { + qDebug("%s executable is invalid -> FdkAac encoding support will be disabled!\n", MUTILS_UTF8(fdkFileInfo.fileName())); + return; + } + + qDebug("Found FdkAac encoder binary:\n%s\n", MUTILS_UTF8(fdkFileInfo.canonicalFilePath())); + + //Lock the fdkaac binaries + QScopedPointer fdkAacBin; + try + { + fdkAacBin.reset(new LockedFile(fdkFileInfo.canonicalFilePath())); + } + catch(...) + { + qWarning("Failed to get excluive lock to FdkAac encoder binary -> FdkAac encoding support will be disabled!"); + return; + } + + QProcess process; + MUtils::init_process(process, fdkFileInfo.absolutePath()); + + process.start(fdkFileInfo.canonicalFilePath(), QStringList() << "--help"); + + if(!process.waitForStarted()) + { + qWarning("FdkAac process failed to create!"); + qWarning("Error message: \"%s\"\n", process.errorString().toLatin1().constData()); + process.kill(); + process.waitForFinished(-1); + return; + } + + quint32 fdkAacVersion = 0; + QRegExp fdkAacSig("fdkaac\\s+(\\d)\\.(\\d)\\.(\\d)", Qt::CaseInsensitive); + + while(process.state() != QProcess::NotRunning) + { + if(!process.waitForReadyRead()) + { + if(process.state() == QProcess::Running) + { + qWarning("fdkaac process time out -> killing!"); + process.kill(); + process.waitForFinished(-1); + return; + } + } + while(process.canReadLine()) + { + QString line = QString::fromUtf8(process.readLine().constData()).simplified(); + if(fdkAacSig.lastIndexIn(line) >= 0) + { + quint32 tmp[3]; + if(MUtils::regexp_parse_uint32(fdkAacSig, tmp, 3)) + { + fdkAacVersion = (qBound(0U, tmp[0], 9U) * 100U) + (qBound(0U, tmp[1], 9U) * 10U) + qBound(0U, tmp[2], 9U); + } + } + } + } + + if(fdkAacVersion <= 0) + { + qWarning("fdkaac version could not be determined -> fdkaac encoding support will be disabled!"); + return; + } + else if(fdkAacVersion < lamexp_toolver_fdkaacenc()) + { + qWarning("fdkaac version is too much outdated (%s) -> fdkaac support will be disabled!", MUTILS_UTF8(lamexp_version2string("v?.?.?", fdkAacVersion, "N/A"))); + qWarning("Minimum required fdkaac version currently is: %s\n", MUTILS_UTF8(lamexp_version2string("v?.?.?", lamexp_toolver_fdkaacenc(), "N/A"))); + return; + } + + qDebug("Enabled fdkaac encoder %s.\n", MUTILS_UTF8(lamexp_version2string("v?.?.?", fdkAacVersion, "N/A"))); + lamexp_tools_register(fdkFileInfo.fileName(), fdkAacBin.take(), fdkAacVersion); +} + void InitializationThread::initAacEnc_QAAC(void) { const QString appPath = QDir(QCoreApplication::applicationDirPath()).canonicalPath(); @@ -756,7 +847,7 @@ void InitializationThread::initAacEnc_QAAC(void) if(!MUtils::OS::is_executable_file(qaacFileInfo[0].canonicalFilePath())) { - qDebug("QAAC executbale is invalid -> QAAC support will be disabled!\n"); + qDebug("QAAC executable is invalid -> QAAC support will be disabled!\n"); return; } diff --git a/src/Thread_Initialization.h b/src/Thread_Initialization.h index 3cfe7be2..6df43eb9 100644 --- a/src/Thread_Initialization.h +++ b/src/Thread_Initialization.h @@ -56,6 +56,7 @@ private: void initTranslations(void); void initAacEnc_Nero(void); void initAacEnc_FHG(void); + void initAacEnc_FDK(void); void initAacEnc_QAAC(void); bool m_bSuccess;