From e6cdd7a53803f700e7edaa5dea2b0876ada17114 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Tue, 16 Feb 2010 11:49:36 +0000 Subject: added ogg flac support git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1558 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/Input/flac/replaygainreader.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/plugins/Input/flac/replaygainreader.cpp') diff --git a/src/plugins/Input/flac/replaygainreader.cpp b/src/plugins/Input/flac/replaygainreader.cpp index 27361e12b..1968ceb00 100644 --- a/src/plugins/Input/flac/replaygainreader.cpp +++ b/src/plugins/Input/flac/replaygainreader.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2009 by Ilya Kotov * + * Copyright (C) 2009-2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -22,13 +22,23 @@ #include #include #include +#include #include "replaygainreader.h" ReplayGainReader::ReplayGainReader(const QString &path) { - TagLib::FLAC::File fileRef(path.toLocal8Bit ().constData()); - if(fileRef.xiphComment()) - readVorbisComment(fileRef.xiphComment()); + if(path.endsWith("*.flac")) + { + TagLib::FLAC::File fileRef(path.toLocal8Bit ().constData()); + if(fileRef.xiphComment()) + readVorbisComment(fileRef.xiphComment()); + } + else if(path.endsWith("*.oga")) + { + TagLib::Ogg::FLAC::File fileRef(path.toLocal8Bit ().constData()); + if(fileRef.tag()) + readVorbisComment(fileRef.tag()); + } } QMap ReplayGainReader::replayGainInfo() const -- cgit v1.2.3-13-gbd6f