From aa3f57c0236c77f2fd90415fc1f3062a93b25b93 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Wed, 24 Nov 2010 18:17:51 +0000 Subject: some api changes, partial mpris 2.0 implementation git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1991 90c681e8-e032-0410-971d-27865f9a5e38 --- .../Input/sndfile/decodersndfilefactory.cpp | 26 ++++++++++------------ 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'src/plugins/Input/sndfile/decodersndfilefactory.cpp') diff --git a/src/plugins/Input/sndfile/decodersndfilefactory.cpp b/src/plugins/Input/sndfile/decodersndfilefactory.cpp index 5ffbb8ddb..e01ac3103 100644 --- a/src/plugins/Input/sndfile/decodersndfilefactory.cpp +++ b/src/plugins/Input/sndfile/decodersndfilefactory.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2007-2009 by Ilya Kotov * + * Copyright (C) 2007-2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -18,6 +18,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include +#include extern "C" { #include @@ -31,17 +32,7 @@ extern "C" bool DecoderSndFileFactory::supports(const QString &source) const { - - if ((source.right(3).toLower() == ".au") || - (source.right(4).toLower() == ".snd") || - (source.right(4).toLower() == ".aif") || - (source.right(5).toLower() == ".aiff") || - (source.right(5).toLower() == ".8svx") || - (source.right(4).toLower() == ".sph") || - (source.right(3).toLower() == ".sf") || - (source.right(4).toLower() == ".voc")) - return true; - else if (source.right(4).toLower() == ".wav") + if (source.right(4).toLower() == ".wav") { //try top open the file SF_INFO snd_info; @@ -52,6 +43,12 @@ bool DecoderSndFileFactory::supports(const QString &source) const sndfile = 0; return true; } + foreach(QString filter, properties().filters) + { + QRegExp regexp(filter, Qt::CaseInsensitive, QRegExp::Wildcard); + if (regexp.exactMatch(source)) + return true; + } return false; } @@ -64,14 +61,15 @@ const DecoderProperties DecoderSndFileFactory::properties() const { DecoderProperties properties; properties.name = tr("Sndfile Plugin"); - properties.filter = "*.wav *.au *.snd *.aif *.aiff *.8svx *.sph *.sf *.voc"; + properties.filters << "*.wav" << "*.au" << "*.snd" << "*.aif" << "*.aiff" << "*.8svx"; + properties.filters << "*.sph" << "*.sf" << "*.voc"; properties.description = tr("PCM Files"); //properties.contentType = ""; properties.shortName = "sndfile"; properties.hasAbout = true; properties.hasSettings = false; properties.noInput = true; - properties.protocols = "file"; + properties.protocols << "file"; return properties; } -- cgit v1.2.3-13-gbd6f