diff options
Diffstat (limited to 'src/plugins/Input')
| -rw-r--r-- | src/plugins/Input/flac/decoderflacfactory.cpp | 17 | ||||
| -rw-r--r-- | src/plugins/Input/mad/decodermadfactory.cpp | 9 | ||||
| -rw-r--r-- | src/plugins/Input/mpc/decodermpcfactory.cpp | 11 | ||||
| -rw-r--r-- | src/plugins/Input/vorbis/decodervorbisfactory.cpp | 10 |
4 files changed, 44 insertions, 3 deletions
diff --git a/src/plugins/Input/flac/decoderflacfactory.cpp b/src/plugins/Input/flac/decoderflacfactory.cpp index 7e2600b7d..af7b00dcf 100644 --- a/src/plugins/Input/flac/decoderflacfactory.cpp +++ b/src/plugins/Input/flac/decoderflacfactory.cpp @@ -25,7 +25,10 @@ #include <taglib/oggflacfile.h> #include <taglib/xiphcomment.h> #include <taglib/tmap.h> - +#if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 8)) +#include <taglib/tfilestream.h> +#include <taglib/id3v2framefactory.h> +#endif #include "cueparser.h" #include "decoder_flac.h" #include "flacmetadatamodel.h" @@ -98,15 +101,27 @@ QList<FileInfo *> DecoderFLACFactory::createPlayList(const QString &fileName, bo return QList<FileInfo *>() << info; } +#if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 8)) + TagLib::FileStream stream(fileName.toLocal8Bit().constData(), true); +#endif + if(fileName.endsWith(".flac", Qt::CaseInsensitive)) { +#if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 8)) + flacFile = new TagLib::FLAC::File(&stream, TagLib::ID3v2::FrameFactory::instance()); +#else flacFile = new TagLib::FLAC::File(fileName.toLocal8Bit().constData()); +#endif tag = useMetaData ? flacFile->xiphComment() : 0; ap = flacFile->audioProperties(); } else if(fileName.endsWith(".oga", Qt::CaseInsensitive)) { +#if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 8)) + oggFlacFile = new TagLib::Ogg::FLAC::File(&stream); +#else oggFlacFile = new TagLib::Ogg::FLAC::File(fileName.toLocal8Bit().constData()); +#endif tag = useMetaData ? oggFlacFile->tag() : 0; ap = oggFlacFile->audioProperties(); } diff --git a/src/plugins/Input/mad/decodermadfactory.cpp b/src/plugins/Input/mad/decodermadfactory.cpp index e45bc5d6c..c1457c29f 100644 --- a/src/plugins/Input/mad/decodermadfactory.cpp +++ b/src/plugins/Input/mad/decodermadfactory.cpp @@ -30,6 +30,9 @@ #include <taglib/apetag.h> #include <taglib/tfile.h> #include <taglib/mpegfile.h> +#if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 8)) +#include <taglib/tfilestream.h> +#endif #include "mpegmetadatamodel.h" #include "replaygainreader.h" #include "settingsdialog.h" @@ -123,7 +126,13 @@ QList<FileInfo *> DecoderMADFactory::createPlayList(const QString &fileName, boo { FileInfo *info = new FileInfo(fileName); TagLib::Tag *tag = 0; + +#if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 8)) + TagLib::FileStream stream(fileName.toLocal8Bit().constData(), true); + TagLib::MPEG::File fileRef(&stream, TagLib::ID3v2::FrameFactory::instance()); +#else TagLib::MPEG::File fileRef(fileName.toLocal8Bit ().constData()); +#endif if (useMetaData) { diff --git a/src/plugins/Input/mpc/decodermpcfactory.cpp b/src/plugins/Input/mpc/decodermpcfactory.cpp index f0faaab51..30d06365b 100644 --- a/src/plugins/Input/mpc/decodermpcfactory.cpp +++ b/src/plugins/Input/mpc/decodermpcfactory.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2008-2012 by Ilya Kotov * + * Copyright (C) 2008-2014 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -23,6 +23,9 @@ #include <taglib/fileref.h> #include <taglib/mpcfile.h> #include <taglib/apetag.h> +#if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 8)) +#include <taglib/tfilestream.h> +#endif #include "mpcmetadatamodel.h" #include "decoder_mpc.h" #include "decodermpcfactory.h" @@ -75,7 +78,13 @@ QList<FileInfo *> DecoderMPCFactory::createPlayList(const QString &fileName, boo { FileInfo *info = new FileInfo(fileName); +#if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 8)) + TagLib::FileStream stream(fileName.toLocal8Bit().constData(), true); + TagLib::MPC::File fileRef(&stream); +#else TagLib::MPC::File fileRef(fileName.toLocal8Bit().constData()); +#endif + TagLib::APE::Tag *tag = useMetaData ? fileRef.APETag() : 0; if (tag && !tag->isEmpty()) { diff --git a/src/plugins/Input/vorbis/decodervorbisfactory.cpp b/src/plugins/Input/vorbis/decodervorbisfactory.cpp index 17d5af27e..342a543af 100644 --- a/src/plugins/Input/vorbis/decodervorbisfactory.cpp +++ b/src/plugins/Input/vorbis/decodervorbisfactory.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2008-2013 by Ilya Kotov * + * Copyright (C) 2008-2014 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -21,6 +21,9 @@ #include <taglib/tag.h> #include <taglib/fileref.h> #include <taglib/vorbisfile.h> +#if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 8)) +#include <taglib/tfilestream.h> +#endif #include "replaygainreader.h" #include "decoder_vorbis.h" #include "vorbismetadatamodel.h" @@ -78,7 +81,12 @@ QList<FileInfo *> DecoderVorbisFactory::createPlayList(const QString &fileName, { FileInfo *info = new FileInfo(fileName); +#if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 8)) + TagLib::FileStream stream(fileName.toLocal8Bit().constData(), true); + TagLib::Ogg::Vorbis::File fileRef(&stream); +#else TagLib::Ogg::Vorbis::File fileRef(fileName.toLocal8Bit().constData()); +#endif TagLib::Ogg::XiphComment *tag = useMetaData ? fileRef.tag() : 0; if (tag && !tag->isEmpty()) |
