From e8d99698c23b1d8ac4a396635e9af60d52a12229 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Fri, 19 Dec 2008 17:30:41 +0000 Subject: more ffmpeg formats support (including ape); ffmpeg plugin settings git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@692 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp | 36 ++++++++++++++++++----- 1 file changed, 28 insertions(+), 8 deletions(-) (limited to 'src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp') diff --git a/src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp b/src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp index 22f16799e..7ed9d4b78 100644 --- a/src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp +++ b/src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp @@ -19,6 +19,7 @@ ***************************************************************************/ #include +#include extern "C" { @@ -41,6 +42,7 @@ extern "C" } #include "detailsdialog.h" +#include "settingsdialog.h" #include "decoder_ffmpeg.h" #include "decoderffmpegfactory.h" @@ -49,8 +51,15 @@ extern "C" bool DecoderFFmpegFactory::supports(const QString &source) const { - - return (source.right(4).toLower() == ".wma"); + QSettings settings(QDir::homePath()+"/.qmmp/qmmprc", QSettings::IniFormat); + QStringList filters = settings.value("FFMPEG/filters","*.wma").toStringList(); + foreach(QString filter, filters) + { + QRegExp regexp(filter, Qt::CaseInsensitive, QRegExp::Wildcard); + if (regexp.exactMatch(source)) + return TRUE; + } + return FALSE; } bool DecoderFFmpegFactory::canDecode(QIODevice *) const @@ -60,13 +69,15 @@ bool DecoderFFmpegFactory::canDecode(QIODevice *) const const DecoderProperties DecoderFFmpegFactory::properties() const { + QSettings settings(QDir::homePath()+"/.qmmp/qmmprc", QSettings::IniFormat); + QStringList filters = settings.value("FFMPEG/filters","*.wma").toStringList(); DecoderProperties properties; properties.name = tr("FFMPEG Plugin"); - properties.filter = "*.wma"; - properties.description = tr("WMA Files"); + properties.filter = filters.join(" "); + properties.description = tr("FFMPEG Formats"); //properties.contentType = ""; properties.hasAbout = TRUE; - properties.hasSettings = FALSE; + properties.hasSettings = TRUE; properties.noInput = TRUE; properties.protocols = "file"; return properties; @@ -114,14 +125,23 @@ QObject* DecoderFFmpegFactory::showDetails(QWidget *parent, const QString &path) return d; } -void DecoderFFmpegFactory::showSettings(QWidget *) -{} +void DecoderFFmpegFactory::showSettings(QWidget *parent) +{ + SettingsDialog *s = new SettingsDialog(parent); + s->show(); +} void DecoderFFmpegFactory::showAbout(QWidget *parent) { QMessageBox::about (parent, tr("About FFmpeg Audio Plugin"), tr("Qmmp FFmpeg Audio Plugin")+"\n"+ - tr("Suppored formats: WMA")+"\n"+ + QString(tr("Compiled against libavformat-%1.%2.%3 and libavcodec-%4.%5.%6")) + .arg(LIBAVFORMAT_VERSION_MAJOR) + .arg(LIBAVFORMAT_VERSION_MINOR) + .arg(LIBAVFORMAT_VERSION_MICRO) + .arg(LIBAVCODEC_VERSION_MAJOR) + .arg(LIBAVCODEC_VERSION_MINOR) + .arg(LIBAVCODEC_VERSION_MICRO)+"\n"+ tr("Writen by: Ilya Kotov ")); } -- cgit v1.2.3-13-gbd6f