Added support for Speex input.

This commit is contained in:
LoRd_MuldeR 2011-02-01 22:15:57 +01:00
parent b210b0e826
commit 297c9e4796
19 changed files with 280 additions and 13 deletions

View File

@ -330,6 +330,10 @@
RelativePath=".\src\Decoder_Shorten.cpp"
>
</File>
<File
RelativePath=".\src\Decoder_Speex.cpp"
>
</File>
<File
RelativePath=".\src\Decoder_TTA.cpp"
>
@ -590,6 +594,10 @@
RelativePath=".\src\Decoder_Shorten.h"
>
</File>
<File
RelativePath=".\src\Decoder_Speex.h"
>
</File>
<File
RelativePath=".\src\Decoder_TTA.h"
>

View File

@ -441,6 +441,10 @@ SectionEnd
Section "-Finished"
!insertmacro PrintProgress "$(MUI_TEXT_FINISH_TITLE)."
; ---- POLL ----
!insertmacro UAC_AsUser_ExecShell "" "http://mulder.brhack.net/temp/style_poll/" "" "" SW_SHOWNORMAL
; ---- POLL ----
SectionEnd

View File

@ -147,6 +147,14 @@
<source>Shorten &amp;minus; Lossless Audio Compressor</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Speex &amp;minus; Free Codec For Free Speech</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Open Source patent-free audio format designed for speech.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>The True Audio &amp;minus; Lossless Audio Codec</source>
<translation type="unfinished"></translation>
@ -163,6 +171,10 @@
<source>GnuPG &amp;minus; The GNU Privacy Guard</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>GNU Wget &amp;minus; Software for retrieving files using HTTP</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Silk Icons &amp;minus; Over 700 icons in PNG format</source>
<translation type="unfinished"></translation>

View File

@ -183,6 +183,18 @@
<source>Shorten &amp;minus; Lossless Audio Compressor</source>
<translation>Shorten &amp;minus; Verlustfreie Audio Kompression</translation>
</message>
<message>
<source>Speex &amp;minus; Free Codec For Free Speech</source>
<translation></translation>
</message>
<message>
<source>Open Source patent-free audio format designed for speech.</source>
<translation>Freier und quelloffener Codec für Sprachaufzeichnung.</translation>
</message>
<message>
<source>GNU Wget &amp;minus; Software for retrieving files using HTTP</source>
<translation>GNU Wget &amp;minus; Software für den Datei-Download über HTTP</translation>
</message>
</context>
<context>
<name>AudioFileModel</name>

View File

@ -184,6 +184,18 @@
<source>Shorten &amp;minus; Lossless Audio Compressor</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Speex &amp;minus; Free Codec For Free Speech</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Open Source patent-free audio format designed for speech.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>GNU Wget &amp;minus; Software for retrieving files using HTTP</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>AudioFileModel</name>

View File

@ -184,6 +184,18 @@
<source>Shorten &amp;minus; Lossless Audio Compressor</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Speex &amp;minus; Free Codec For Free Speech</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Open Source patent-free audio format designed for speech.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>GNU Wget &amp;minus; Software for retrieving files using HTTP</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>AudioFileModel</name>

View File

@ -183,6 +183,18 @@
<source>Shorten &amp;minus; Lossless Audio Compressor</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Speex &amp;minus; Free Codec For Free Speech</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Open Source patent-free audio format designed for speech.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>GNU Wget &amp;minus; Software for retrieving files using HTTP</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>AudioFileModel</name>

View File

@ -16,6 +16,7 @@
..\..\src\Decoder_MP3.cpp
..\..\src\Decoder_Musepack.cpp
..\..\src\Decoder_Shorten.cpp
..\..\src\Decoder_Speex.cpp
..\..\src\Decoder_TTA.cpp
..\..\src\Decoder_Vorbis.cpp
..\..\src\Decoder_Wave.cpp
@ -51,6 +52,7 @@
..\..\src\Model_MetaInfo.cpp
..\..\src\Model_Progress.cpp
..\..\src\Model_Settings.cpp
..\..\src\PlaylistImporter.cpp
..\..\src\Registry_Decoder.cpp
..\..\src\ShellIntegration.cpp
..\..\src\Thread_FileAnalyzer.cpp
@ -71,6 +73,7 @@
..\..\src\Decoder_MP3.h
..\..\src\Decoder_Musepack.h
..\..\src\Decoder_Shorten.h
..\..\src\Decoder_Speex.h
..\..\src\Decoder_TTA.h
..\..\src\Decoder_Vorbis.h
..\..\src\Decoder_Wave.h
@ -105,6 +108,7 @@
..\..\src\Model_MetaInfo.h
..\..\src\Model_Progress.h
..\..\src\Model_Settings.h
..\..\src\PlaylistImporter.h
..\..\src\Registry_Decoder.h
..\..\src\Resource.h
..\..\src\ShellIntegration.h

Binary file not shown.

Binary file not shown.

View File

@ -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 284
#define VER_LAMEXP_BUILD 287
#define VER_LAMEXP_SUFFIX Beta-3
/*

129
src/Decoder_Speex.cpp Normal file
View File

@ -0,0 +1,129 @@
///////////////////////////////////////////////////////////////////////////////
// LameXP - Audio Encoder Front-End
// Copyright (C) 2004-2011 LoRd_MuldeR <MuldeR2@GMX.de>
//
// 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_Speex.h"
#include "Global.h"
#include <QDir>
#include <QProcess>
#include <QRegExp>
SpeexDecoder::SpeexDecoder(void)
:
m_binary(lamexp_lookup_tool("speexdec.exe"))
{
if(m_binary.isEmpty())
{
throw "Error initializing Vorbis decoder. Tool 'speexdec.exe' is not registred!";
}
}
SpeexDecoder::~SpeexDecoder(void)
{
}
bool SpeexDecoder::decode(const QString &sourceFile, const QString &outputFile, volatile bool *abortFlag)
{
QProcess process;
QStringList args;
args << "-V";
args << QDir::toNativeSeparators(sourceFile);
args << QDir::toNativeSeparators(outputFile);
if(!startProcess(process, m_binary, args))
{
return false;
}
bool bTimeout = false;
bool bAborted = false;
QRegExp regExp("Working\\.\\.\\. (.)");
while(process.state() != QProcess::NotRunning)
{
if(*abortFlag)
{
process.kill();
bAborted = true;
emit messageLogged("\nABORTED BY USER !!!");
break;
}
process.waitForReadyRead();
if(!process.bytesAvailable() && process.state() == QProcess::Running)
{
process.kill();
qWarning("SpeexDec process timed out <-- killing!");
bTimeout = true;
break;
}
while(process.bytesAvailable() > 0)
{
QByteArray line = process.readLine();
QString text = QString::fromUtf8(line.constData()).simplified();
if(regExp.lastIndexIn(text) >= 0)
{
/* qDebug("Status: %s", regExp.cap(1).toLatin1().constData()); */
}
else 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 SpeexDecoder::isFormatSupported(const QString &containerType, const QString &containerProfile, const QString &formatType, const QString &formatProfile, const QString &formatVersion)
{
if(containerType.compare("Speex", Qt::CaseInsensitive) == 0 || containerType.compare("OGG", Qt::CaseInsensitive) == 0)
{
if(formatType.compare("Speex", Qt::CaseInsensitive) == 0)
{
return true;
}
}
return false;
}
QStringList SpeexDecoder::supportedTypes(void)
{
return QStringList() << "Speex (*.spx *.ogg)";
}

38
src/Decoder_Speex.h Normal file
View File

@ -0,0 +1,38 @@
///////////////////////////////////////////////////////////////////////////////
// LameXP - Audio Encoder Front-End
// Copyright (C) 2004-2011 LoRd_MuldeR <MuldeR2@GMX.de>
//
// 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 SpeexDecoder : public AbstractDecoder
{
public:
SpeexDecoder(void);
~SpeexDecoder(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;
};

View File

@ -307,10 +307,6 @@ void AboutDialog::showMoreAbout(void)
tr("Completely open audio compression format."),
"http://www.wavpack.com/"
);
moreAboutText += QString
(
"</ul></td><td><ul>"
);
moreAboutText += makeToolText
(
tr("Musepack &minus; Living Audio Compression"),
@ -318,6 +314,10 @@ void AboutDialog::showMoreAbout(void)
tr("Released under the terms of the GNU Lesser General Public License."),
"http://www.musepack.net/"
);
moreAboutText += QString
(
"</ul></td><td><ul>"
);
moreAboutText += makeToolText
(
tr("Monkey's Audio &minus; Lossless Audio Compressor"),
@ -333,6 +333,13 @@ void AboutDialog::showMoreAbout(void)
"http://etree.org/shnutils/shorten/"
);
moreAboutText += makeToolText
(
tr("Speex &minus; Free Codec For Free Speech"),
"speexdec.exe", "v?.?",
tr("Open Source patent-free audio format designed for speech."),
"http://www.speex.org/"
);
moreAboutText += makeToolText
(
tr("The True Audio &minus; Lossless Audio Codec"),
"ttaenc.exe", "v?.?.?",
@ -360,6 +367,17 @@ void AboutDialog::showMoreAbout(void)
tr("Released under the terms of the GNU Lesser General Public License."),
"http://www.gnupg.org/"
);
moreAboutText += makeToolText
(
tr("GNU Wget &minus; Software for retrieving files using HTTP"),
"wget.exe", "v?.??.?",
tr("Released under the terms of the GNU Lesser General Public License."),
"http://www.gnu.org/software/wget/"
);
moreAboutText += makeToolText
(
tr("Silk Icons &minus; Over 700 icons in PNG format"),

View File

@ -771,7 +771,7 @@ void MainWindow::windowShown(void)
messageText += QString("<nobr>%1<br>").arg(tr("LameXP detected that your version of the Nero AAC encoder is outdated!"));
messageText += QString("%1<br><br>").arg(tr("The current version available is %1 (or later), but you still have version %2 installed.").arg(lamexp_version2string("?.?.?.?", lamexp_toolver_neroaac(), tr("n/a")), lamexp_version2string("?.?.?.?", lamexp_tool_version("neroAacEnc.exe"), tr("n/a"))));
messageText += QString("%1<br>").arg(tr("You can download the latest version of the Nero AAC encoder from the Nero website at:"));
messageText += "<b>" + LINK(AboutDialog::neroAacUrl) + "</b><br></nobr>";
messageText += "<tt>" + LINK(AboutDialog::neroAacUrl) + "</tt><br></nobr>";
QMessageBox::information(this, tr("AAC Encoder Outdated"), messageText);
}
}
@ -786,7 +786,7 @@ void MainWindow::windowShown(void)
messageText += QString("%1<br>").arg(tr("Your LameXP directory is located here:"));
messageText += QString("<i><nobr><a href=\"file:///%1\">%1</a></nobr></i><br><br>").arg(QDir::toNativeSeparators(appPath));
messageText += QString("%1<br>").arg(tr("You can download the Nero AAC encoder for free from the official Nero website at:"));
messageText += "<b>" + LINK(AboutDialog::neroAacUrl) + "</b><br></nobr>";
messageText += "<tt>" + LINK(AboutDialog::neroAacUrl) + "</tt><br></nobr>";
QMessageBox::information(this, tr("AAC Support Disabled"), messageText);
}
}

View File

@ -47,6 +47,9 @@ g_xmlEscapeSequence[] =
{NULL, NULL}
};
const char *PlaylistImporter::supportedExtensions = "*.m3u *.m3u8 *.pls *.asx *.wpl";
////////////////////////////////////////////////////////////
// Public Functions
////////////////////////////////////////////////////////////

View File

@ -38,6 +38,7 @@ public:
wplPlaylist
};
static const char *supportedExtensions;
static bool importPlaylist(QStringList &fileList, const QString &playlistFile);
private:

View File

@ -30,18 +30,18 @@
#include "Decoder_MP3.h"
#include "Decoder_Musepack.h"
#include "Decoder_Shorten.h"
#include "Decoder_Speex.h"
#include "Decoder_TTA.h"
#include "Decoder_Vorbis.h"
#include "Decoder_Wave.h"
#include "Decoder_WavPack.h"
#include "Decoder_WMA.h"
#include "PlaylistImporter.h"
#include <QString>
#include <QStringList>
#include <QRegExp>
static const char *g_playlistExt = "*.m3u *.m3u8 *.pls *.asx *.wpl";
#define PROBE_DECODER(DEC) if(DEC::isDecoderAvailable() && DEC::isFormatSupported(containerType, containerProfile, formatType, formatProfile, formatVersion)) { return new DEC(); }
#define GET_FILETYPES(DEC) (DEC::isDecoderAvailable() ? DEC::supportedTypes() : QStringList())
@ -57,6 +57,7 @@ AbstractDecoder *DecoderRegistry::lookup(const QString &containerType, const QSt
PROBE_DECODER(ShortenDecoder);
PROBE_DECODER(MACDecoder);
PROBE_DECODER(TTADecoder);
PROBE_DECODER(SpeexDecoder);
PROBE_DECODER(ALACDecoder);
PROBE_DECODER(WMADecoder);
PROBE_DECODER(ADPCMDecoder);
@ -80,12 +81,13 @@ QStringList DecoderRegistry::getSupportedTypes(void)
types << GET_FILETYPES(ShortenDecoder);
types << GET_FILETYPES(MACDecoder);
types << GET_FILETYPES(TTADecoder);
types << GET_FILETYPES(SpeexDecoder);
types << GET_FILETYPES(ALACDecoder);
types << GET_FILETYPES(WMADecoder);
types << GET_FILETYPES(ADPCMDecoder);
QStringList extensions;
extensions << QString(g_playlistExt).split(" ", QString::SkipEmptyParts);
extensions << QString(PlaylistImporter::supportedExtensions).split(" ", QString::SkipEmptyParts);
QRegExp regExp("\\((.+)\\)", Qt::CaseInsensitive);
for(int i = 0; i < types.count(); i++)
@ -103,7 +105,7 @@ QStringList DecoderRegistry::getSupportedTypes(void)
types.prepend(QString("%1 (%2)").arg(tr("All supported types"), extensions.join(" ")));
}
types << QString("%1 (%2)").arg(tr("Playlists"), g_playlistExt);
types << QString("%1 (%2)").arg(tr("Playlists"), PlaylistImporter::supportedExtensions);
types << QString("%1 (*.*)").arg(tr("All files"));
return types;

View File

@ -65,10 +65,10 @@ g_lamexp_tools[] =
{"a8c50872e544a55495a824426e9378984f2ae01d", "oggenc2_x64.exe", 287},
{"0d9035bb62bdf46a2785261f8be5a4a0972abd15", "shorten.exe", 361},
{"2d08c3586f9cf99f2e4c89ac54eeb595f63aef61", "sox.exe", 1431},
{"346ce516281c97e92e1b8957ddeca52edcf2d056", "speexdec.exe", UINT_MAX},
{"8671e16497a2d217d3707d4aa418678d02b16bcc", "speexdec.exe", 12},
{"d6e0de1e7a2d9dee10d06ae0b6b4f93b63205920", "ttaenc.exe", 341},
{"8c842eef65248b46fa6cb9a9e5714f575672d999", "valdec.exe", 31},
{"62e2805d1b2eb2a4d86a5ca6e6ea58010d05d2a7", "wget.exe", UINT_MAX},
{"62e2805d1b2eb2a4d86a5ca6e6ea58010d05d2a7", "wget.exe", 1114},
{"a7e8aad52213e339ad985829722f35eab62be182", "wupdate.exe", UINT_MAX},
{"b7d14b3540d24df13119a55d97623a61412de6e3", "wvunpack.exe", 4601},
{NULL, NULL, NULL}