diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2010-11-24 18:17:51 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2010-11-24 18:17:51 +0000 |
| commit | aa3f57c0236c77f2fd90415fc1f3062a93b25b93 (patch) | |
| tree | d9ab905b952cf9289239b95db99f39321a54e65b /src/plugins/Input/sndfile/decodersndfilefactory.cpp | |
| parent | 5c2f5798c6222d35e08fa0853812e2390181e735 (diff) | |
| download | qmmp-aa3f57c0236c77f2fd90415fc1f3062a93b25b93.tar.gz qmmp-aa3f57c0236c77f2fd90415fc1f3062a93b25b93.tar.bz2 qmmp-aa3f57c0236c77f2fd90415fc1f3062a93b25b93.zip | |
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
Diffstat (limited to 'src/plugins/Input/sndfile/decodersndfilefactory.cpp')
| -rw-r--r-- | src/plugins/Input/sndfile/decodersndfilefactory.cpp | 26 |
1 files changed, 12 insertions, 14 deletions
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 <QtGui> +#include <QRegExp> extern "C" { #include <sndfile.h> @@ -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; } |
