diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2016-04-28 05:30:48 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2016-04-28 05:30:48 +0000 |
| commit | 7ce39a16d12257b74dc205112901b24bda585185 (patch) | |
| tree | 6dad297c6ace9d7c58a81e069b9e927771ad6ae3 | |
| parent | 3f525068c53c3c7d505a3aaec1d209c9cf1101b9 (diff) | |
| download | qmmp-7ce39a16d12257b74dc205112901b24bda585185.tar.gz qmmp-7ce39a16d12257b74dc205112901b24bda585185.tar.bz2 qmmp-7ce39a16d12257b74dc205112901b24bda585185.zip | |
using read-only mode for ReplayGain
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@6273 90c681e8-e032-0410-971d-27865f9a5e38
| -rw-r--r-- | src/plugins/Input/flac/replaygainreader.cpp | 15 | ||||
| -rw-r--r-- | src/plugins/Input/mad/replaygainreader.cpp | 9 | ||||
| -rw-r--r-- | src/plugins/Input/vorbis/replaygainreader.cpp | 10 |
3 files changed, 34 insertions, 0 deletions
diff --git a/src/plugins/Input/flac/replaygainreader.cpp b/src/plugins/Input/flac/replaygainreader.cpp index 095e94fa9..b33dd0ffd 100644 --- a/src/plugins/Input/flac/replaygainreader.cpp +++ b/src/plugins/Input/flac/replaygainreader.cpp @@ -23,19 +23,34 @@ #include <taglib/fileref.h> #include <taglib/flacfile.h> #include <taglib/oggflacfile.h> +#if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 8)) +#include <taglib/tfilestream.h> +#include <taglib/id3v2framefactory.h> +#endif #include "replaygainreader.h" ReplayGainReader::ReplayGainReader(const QString &path) { +#if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 8)) + TagLib::FileStream stream(QStringToFileName(path), true); +#endif if(path.endsWith(".flac", Qt::CaseInsensitive)) { +#if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 8)) + TagLib::FLAC::File fileRef(&stream, TagLib::ID3v2::FrameFactory::instance()); +#else TagLib::FLAC::File fileRef(QStringToFileName(path)); +#endif if(fileRef.xiphComment()) readVorbisComment(fileRef.xiphComment()); } else if(path.endsWith(".oga", Qt::CaseInsensitive)) { +#if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 8)) + TagLib::Ogg::FLAC::File fileRef(&stream); +#else TagLib::Ogg::FLAC::File fileRef(QStringToFileName(path)); +#endif if(fileRef.tag()) readVorbisComment(fileRef.tag()); } diff --git a/src/plugins/Input/mad/replaygainreader.cpp b/src/plugins/Input/mad/replaygainreader.cpp index b8fac3ed4..fc8704a11 100644 --- a/src/plugins/Input/mad/replaygainreader.cpp +++ b/src/plugins/Input/mad/replaygainreader.cpp @@ -25,11 +25,20 @@ #include <taglib/id3v1tag.h> #include <taglib/id3v2header.h> #include <taglib/textidentificationframe.h> +#if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 8)) +#include <taglib/tfilestream.h> +#include <taglib/id3v2framefactory.h> +#endif #include "replaygainreader.h" ReplayGainReader::ReplayGainReader(const QString &path) { +#if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 8)) + TagLib::FileStream stream(QStringToFileName(path), true); + TagLib::MPEG::File fileRef(&stream, TagLib::ID3v2::FrameFactory::instance()); +#else TagLib::MPEG::File fileRef(QStringToFileName(path)); +#endif if(fileRef.ID3v2Tag()) readID3v2(fileRef.ID3v2Tag()); if(m_values.isEmpty() && fileRef.APETag()) diff --git a/src/plugins/Input/vorbis/replaygainreader.cpp b/src/plugins/Input/vorbis/replaygainreader.cpp index aac5957f5..b44f06b81 100644 --- a/src/plugins/Input/vorbis/replaygainreader.cpp +++ b/src/plugins/Input/vorbis/replaygainreader.cpp @@ -22,11 +22,21 @@ #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> +#include <taglib/id3v2framefactory.h> +#endif #include "replaygainreader.h" ReplayGainReader::ReplayGainReader(const QString &path) { +#if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 8)) + TagLib::FileStream stream(QStringToFileName(path), true); + TagLib::Ogg::Vorbis::File fileRef(&stream); +#else TagLib::Ogg::Vorbis::File fileRef(QStringToFileName(path)); +#endif + if(fileRef.tag()) readVorbisComment(fileRef.tag()); } |
