diff --git a/LameXP.vcproj b/LameXP.vcproj index 0f7f6953..99533c97 100644 --- a/LameXP.vcproj +++ b/LameXP.vcproj @@ -318,6 +318,10 @@ RelativePath=".\src\Decoder_MP3.cpp" > + + @@ -542,6 +546,10 @@ RelativePath=".\src\Decoder_MP3.h" > + + diff --git a/etc/Translation/Blank.ts b/etc/Translation/Blank.ts index ea7f8dcb..3ff42489 100644 --- a/etc/Translation/Blank.ts +++ b/etc/Translation/Blank.ts @@ -127,6 +127,10 @@ Freely available source code, simple SDK and non-restrictive licensing. + + The True Audio - Lossless Audio Codec + + MediaInfo - Media File Analysis Tool diff --git a/etc/Translation/LameXP_DE.ts b/etc/Translation/LameXP_DE.ts index 13b36cb9..37bd1a1d 100644 --- a/etc/Translation/LameXP_DE.ts +++ b/etc/Translation/LameXP_DE.ts @@ -155,6 +155,10 @@ Completely open audio compression format. Komplett offenes Audio Kompressionsformat. + + The True Audio - Lossless Audio Codec + + AudioFileModel diff --git a/etc/Translation/LameXP_ES.ts b/etc/Translation/LameXP_ES.ts index c1fd534e..f8ee38b7 100644 --- a/etc/Translation/LameXP_ES.ts +++ b/etc/Translation/LameXP_ES.ts @@ -156,6 +156,10 @@ Completely open audio compression format. Formato de comresiĆ³n de audio completamente abierto. + + The True Audio - Lossless Audio Codec + + AudioFileModel diff --git a/etc/Translation/LameXP_FR.ts b/etc/Translation/LameXP_FR.ts index 785463c1..c1c00636 100644 --- a/etc/Translation/LameXP_FR.ts +++ b/etc/Translation/LameXP_FR.ts @@ -158,6 +158,10 @@ Completely open audio compression format. + + The True Audio - Lossless Audio Codec + + AudioFileModel diff --git a/etc/Translation/LameXP_IT.ts b/etc/Translation/LameXP_IT.ts index cd6422de..de560a9f 100644 --- a/etc/Translation/LameXP_IT.ts +++ b/etc/Translation/LameXP_IT.ts @@ -155,6 +155,10 @@ Completely open audio compression format. + + The True Audio - Lossless Audio Codec + + AudioFileModel diff --git a/etc/Translation/update.lst b/etc/Translation/update.lst index 54ddaf07..9b0a21e7 100644 --- a/etc/Translation/update.lst +++ b/etc/Translation/update.lst @@ -13,6 +13,7 @@ ..\..\src\Decoder_FLAC.cpp ..\..\src\Decoder_MAC.cpp ..\..\src\Decoder_MP3.cpp +..\..\src\Decoder_TTA.cpp ..\..\src\Decoder_Vorbis.cpp ..\..\src\Decoder_Wave.cpp ..\..\src\Decoder_WavPack.cpp @@ -60,6 +61,7 @@ ..\..\src\Decoder_FLAC.h ..\..\src\Decoder_MAC.h ..\..\src\Decoder_MP3.h +..\..\src\Decoder_TTA.h ..\..\src\Decoder_Vorbis.h ..\..\src\Decoder_Wave.h ..\..\src\Decoder_WavPack.h diff --git a/res/tools/ttaenc.exe b/res/tools/ttaenc.exe index 598e21d1..685d176c 100644 Binary files a/res/tools/ttaenc.exe and b/res/tools/ttaenc.exe differ diff --git a/src/Config.h b/src/Config.h index 6bc0e903..7177f6c0 100644 --- a/src/Config.h +++ b/src/Config.h @@ -25,7 +25,7 @@ #define VER_LAMEXP_MAJOR 4 #define VER_LAMEXP_MINOR_HI 0 #define VER_LAMEXP_MINOR_LO 0 -#define VER_LAMEXP_BUILD 237 +#define VER_LAMEXP_BUILD 238 #define VER_LAMEXP_SUFFIX TechPreview /* diff --git a/src/Decoder_TTA.cpp b/src/Decoder_TTA.cpp new file mode 100644 index 00000000..ebf14b19 --- /dev/null +++ b/src/Decoder_TTA.cpp @@ -0,0 +1,127 @@ +/////////////////////////////////////////////////////////////////////////////// +// 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 "Decoder_TTA.h" + +#include "Global.h" + +#include +#include +#include +#include + +TTADecoder::TTADecoder(void) +: + m_binary(lamexp_lookup_tool("ttaenc.exe")) +{ + if(m_binary.isEmpty()) + { + throw "Error initializing TTA decoder. Tool 'ttaenc.exe' is not registred!"; + } +} + +TTADecoder::~TTADecoder(void) +{ +} + +bool TTADecoder::decode(const QString &sourceFile, const QString &outputFile, volatile bool *abortFlag) +{ + QProcess process; + QStringList args; + + args << "-d"; + args << "-o" << QDir::toNativeSeparators(outputFile); + args << QDir::toNativeSeparators(sourceFile); + + if(!startProcess(process, m_binary, args)) + { + return false; + } + + bool bTimeout = false; + bool bAborted = false; + + //The TTA Decoder doesn't actually send any status updates :-[ + emit statusUpdated(20 + (QUuid::createUuid().data1 % 80)); + + while(process.state() != QProcess::NotRunning) + { + if(*abortFlag) + { + process.kill(); + bAborted = true; + emit messageLogged("\nABORTED BY USER !!!"); + break; + } + process.waitForReadyRead(180000); + if(!process.bytesAvailable() && process.state() == QProcess::Running) + { + process.kill(); + qWarning("TTAEnc process timed out <-- killing!"); + bTimeout = true; + break; + } + while(process.bytesAvailable() > 0) + { + QByteArray line = process.readLine(); + QString text = QString::fromUtf8(line.constData()).simplified(); + 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 || QFileInfo(outputFile).size() == 0) + { + return false; + } + + return true; +} + +bool TTADecoder::isFormatSupported(const QString &containerType, const QString &containerProfile, const QString &formatType, const QString &formatProfile, const QString &formatVersion) +{ + if(containerType.compare("TTA", Qt::CaseInsensitive) == 0) + { + if(formatType.compare("TTA", Qt::CaseInsensitive) == 0) + { + return true; + } + } + + return false; +} + +QStringList TTADecoder::supportedTypes(void) +{ + return QStringList() << "The True Audio (*.tta)"; +} diff --git a/src/Decoder_TTA.h b/src/Decoder_TTA.h new file mode 100644 index 00000000..12663eb5 --- /dev/null +++ b/src/Decoder_TTA.h @@ -0,0 +1,38 @@ +/////////////////////////////////////////////////////////////////////////////// +// 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 "Decoder_Abstract.h" + +class TTADecoder : public AbstractDecoder +{ +public: + TTADecoder(void); + ~TTADecoder(void); + + virtual bool decode(const QString &sourceFile, const QString &outputFile, volatile bool *abortFlag); + static bool isFormatSupported(const QString &containerType, const QString &containerProfile, const QString &formatType, const QString &formatProfile, const QString &formatVersion); + static QStringList supportedTypes(void); + +private: + const QString m_binary; +}; diff --git a/src/Dialog_About.cpp b/src/Dialog_About.cpp index fa90031e..e9ac5cab 100644 --- a/src/Dialog_About.cpp +++ b/src/Dialog_About.cpp @@ -296,6 +296,13 @@ void AboutDialog::showMoreAbout(void) "http://www.monkeysaudio.com/" ); moreAboutText += makeToolText + ( + tr("The True Audio - Lossless Audio Codec"), + "ttaenc.exe", "v?.?.?", + tr("Released under the terms of the GNU Lesser General Public License."), + "http://tta.sourceforge.net/" + ); + moreAboutText += makeToolText ( tr("MediaInfo - Media File Analysis Tool"), "mediainfo_i386.exe", "v?.?.??", diff --git a/src/Registry_Decoder.cpp b/src/Registry_Decoder.cpp index a0d55cde..52776106 100644 --- a/src/Registry_Decoder.cpp +++ b/src/Registry_Decoder.cpp @@ -22,15 +22,16 @@ #include "Registry_Decoder.h" #include "Decoder_AAC.h" +#include "Decoder_AC3.h" #include "Decoder_ADPCM.h" +#include "Decoder_FLAC.h" #include "Decoder_MAC.h" #include "Decoder_MP3.h" +#include "Decoder_TTA.h" #include "Decoder_Vorbis.h" -#include "Decoder_FLAC.h" -#include "Decoder_AC3.h" -#include "Decoder_WMA.h" #include "Decoder_Wave.h" #include "Decoder_WavPack.h" +#include "Decoder_WMA.h" #include #include @@ -48,6 +49,7 @@ AbstractDecoder *DecoderRegistry::lookup(const QString &containerType, const QSt PROBE_DECODER(FLACDecoder); PROBE_DECODER(WavPackDecoder); PROBE_DECODER(MACDecoder); + PROBE_DECODER(TTADecoder); PROBE_DECODER(WMADecoder); PROBE_DECODER(ADPCMDecoder); PROBE_DECODER(WaveDecoder); @@ -67,6 +69,7 @@ QStringList DecoderRegistry::getSupportedTypes(void) types << GET_FILETYPES(FLACDecoder); types << GET_FILETYPES(WavPackDecoder); types << GET_FILETYPES(MACDecoder); + types << GET_FILETYPES(TTADecoder); types << GET_FILETYPES(WMADecoder); types << GET_FILETYPES(ADPCMDecoder); diff --git a/src/Thread_Initialization.cpp b/src/Thread_Initialization.cpp index bb24fcbe..1279704e 100644 --- a/src/Thread_Initialization.cpp +++ b/src/Thread_Initialization.cpp @@ -68,7 +68,7 @@ static const struct lamexp_tool_t g_lamexp_tools[] = {"2d08c3586f9cf99f2e4c89ac54eeb595f63aef61", "sox.exe", 1431}, {"346ce516281c97e92e1b8957ddeca52edcf2d056", "speexdec.exe", UINT_MAX}, {"8a74b767cfe88bf88c068fdae0de02d65589d25e", "takc.exe", UINT_MAX}, - {"1c5cedb56358a0e8c4590a863a97c94d7d7e98b2", "ttaenc.exe", UINT_MAX}, + {"d6e0de1e7a2d9dee10d06ae0b6b4f93b63205920", "ttaenc.exe", 341}, {"8c842eef65248b46fa6cb9a9e5714f575672d999", "valdec.exe", 31}, {"8159f4e824b3e343ece95ba6dbb5e16da9c4866e", "volumax.exe", UINT_MAX}, {"62e2805d1b2eb2a4d86a5ca6e6ea58010d05d2a7", "wget.exe", UINT_MAX},