diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2008-04-09 13:31:11 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2008-04-09 13:31:11 +0000 |
| commit | d38a753c77724bf6a1df6bf204c58f318908ec48 (patch) | |
| tree | 9f52beac65b1615311353779e9ce889885019de9 /src/plugins/Input/sndfile | |
| parent | 4c257a6d66604435127d877f6f663632a63a9688 (diff) | |
| download | qmmp-d38a753c77724bf6a1df6bf204c58f318908ec48.tar.gz qmmp-d38a753c77724bf6a1df6bf204c58f318908ec48.tar.bz2 qmmp-d38a753c77724bf6a1df6bf204c58f318908ec48.zip | |
mp3 wave support
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@336 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Input/sndfile')
| -rw-r--r-- | src/plugins/Input/sndfile/decodersndfilefactory.cpp | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/src/plugins/Input/sndfile/decodersndfilefactory.cpp b/src/plugins/Input/sndfile/decodersndfilefactory.cpp index 37a42f9ff..30178aabe 100644 --- a/src/plugins/Input/sndfile/decodersndfilefactory.cpp +++ b/src/plugins/Input/sndfile/decodersndfilefactory.cpp @@ -18,7 +18,9 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include <QtGui> +extern "C"{ #include <sndfile.h> +} #include "decoder_sndfile.h" #include "decodersndfilefactory.h" @@ -29,16 +31,27 @@ bool DecoderSndFileFactory::supports(const QString &source) const { - return (source.right(4).toLower() == ".wav") || - (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() == ".wav") || - (source.right(4).toLower() == ".sph") || - (source.right(3).toLower() == ".sf") || - (source.right(4).toLower() == ".voc"); + 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") + { + //try top open the file + SF_INFO snd_info; + SNDFILE *sndfile = sf_open(source.toLocal8Bit(), SFM_READ, &snd_info); + if(!sndfile) + return FALSE; + sf_close (sndfile); + sndfile = 0; + return TRUE; + } + return FALSE; } bool DecoderSndFileFactory::canDecode(QIODevice *) const @@ -99,6 +112,8 @@ FileTag *DecoderSndFileFactory::createTag(const QString &source) QObject* DecoderSndFileFactory::showDetails(QWidget *parent, const QString &path) { + Q_UNUSED(parent); + Q_UNUSED(path); return 0; } |
