aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Input/wavpack
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2018-05-27 21:02:29 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2018-05-27 21:02:29 +0000
commit75a3fb1184673e6bf0be1bdc1785db07ab87aaf2 (patch)
tree894cee0020fa1ced6a32e1bb6ca8b6f36325af3f /src/plugins/Input/wavpack
parent9e9636ada5475874f9eeb704d2af1af7b0447e9a (diff)
downloadqmmp-75a3fb1184673e6bf0be1bdc1785db07ab87aaf2.tar.gz
qmmp-75a3fb1184673e6bf0be1bdc1785db07ab87aaf2.tar.bz2
qmmp-75a3fb1184673e6bf0be1bdc1785db07ab87aaf2.zip
enabled wavpack plugin
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@7970 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Input/wavpack')
-rw-r--r--src/plugins/Input/wavpack/cueparser.cpp70
-rw-r--r--src/plugins/Input/wavpack/cueparser.h17
-rw-r--r--src/plugins/Input/wavpack/decoder_wavpack.cpp8
-rw-r--r--src/plugins/Input/wavpack/decoderwavpackfactory.cpp77
-rw-r--r--src/plugins/Input/wavpack/decoderwavpackfactory.h13
-rw-r--r--src/plugins/Input/wavpack/replaygainreader.cpp88
-rw-r--r--src/plugins/Input/wavpack/replaygainreader.h47
-rw-r--r--src/plugins/Input/wavpack/wavpack.pro6
8 files changed, 102 insertions, 224 deletions
diff --git a/src/plugins/Input/wavpack/cueparser.cpp b/src/plugins/Input/wavpack/cueparser.cpp
index bd0056c39..ecfb2c9d6 100644
--- a/src/plugins/Input/wavpack/cueparser.cpp
+++ b/src/plugins/Input/wavpack/cueparser.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2008-2017 by Ilya Kotov *
+ * Copyright (C) 2008-2018 by Ilya Kotov *
* forkotov02@ya.ru *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -28,12 +28,12 @@
#include <qmmp/metadatamanager.h>
#include "cueparser.h"
-CUEParser::CUEParser(const QByteArray &array, const QString &fileName)
+CUEParser::CUEParser(const QByteArray &array, const QString &path)
{
QString album, genre, date, comment;
QTextStream textStream (array);
textStream.setCodec("UTF-8");
- m_filePath = fileName;
+ m_filePath = path;
QString artist;
double album_peak = 0.0, album_gain = 0.0;
while (!textStream.atEnd())
@@ -48,31 +48,31 @@ CUEParser::CUEParser(const QByteArray &array, const QString &fileName)
if(m_tracks.isEmpty())
artist = words[1];
else
- m_tracks.last()->info.setMetaData(Qmmp::ARTIST, words[1]);
+ m_tracks.last()->info.setValue(Qmmp::ARTIST, words[1]);
}
else if (words[0] == "TITLE")
{
if(m_tracks.isEmpty())
album = words[1];
else
- m_tracks.last()->info.setMetaData(Qmmp::TITLE, words[1]);
+ m_tracks.last()->info.setValue(Qmmp::TITLE, words[1]);
}
else if (words[0] == "TRACK")
{
- FileInfo info("wvpack://" + fileName + QString("#%1").arg(words[1].toInt()));
- info.setMetaData(Qmmp::TRACK, words[1].toInt());
- info.setMetaData(Qmmp::ALBUM, album);
- info.setMetaData(Qmmp::GENRE, genre);
- info.setMetaData(Qmmp::YEAR, date);
- info.setMetaData(Qmmp::COMMENT, comment);
- info.setMetaData(Qmmp::ARTIST, artist);
- info.setMetaData(Qmmp::ALBUMARTIST, artist);
+ TrackInfo info("wvpack://" + path + QString("#%1").arg(words[1].toInt()));
+ info.setValue(Qmmp::TRACK, words[1].toInt());
+ info.setValue(Qmmp::ALBUM, album);
+ info.setValue(Qmmp::GENRE, genre);
+ info.setValue(Qmmp::YEAR, date);
+ info.setValue(Qmmp::COMMENT, comment);
+ info.setValue(Qmmp::ARTIST, artist);
+ info.setValue(Qmmp::ALBUMARTIST, artist);
+ info.setValue(Qmmp::REPLAYGAIN_ALBUM_GAIN, album_gain);
+ info.setValue(Qmmp::REPLAYGAIN_ALBUM_PEAK, album_peak);
m_tracks << new CUETrack;
m_tracks.last()->info = info;
m_tracks.last()->offset = 0;
- m_tracks.last()->replayGain.insert(Qmmp::REPLAYGAIN_ALBUM_GAIN, album_gain);
- m_tracks.last()->replayGain.insert(Qmmp::REPLAYGAIN_ALBUM_PEAK, album_peak);
}
else if (words[0] == "INDEX" && words[1] == "01")
{
@@ -81,7 +81,7 @@ CUEParser::CUEParser(const QByteArray &array, const QString &fileName)
m_tracks.last()->offset = getLength(words[2]);
int c = m_tracks.count();
if(c > 1)
- m_tracks[c - 2]->info.setLength(m_tracks[c - 1]->offset - m_tracks[c - 2]->offset);
+ m_tracks[c - 2]->info.setDuration(m_tracks[c - 1]->offset - m_tracks[c - 2]->offset);
}
else if (words[0] == "REM")
{
@@ -98,9 +98,9 @@ CUEParser::CUEParser(const QByteArray &array, const QString &fileName)
else if (words[1] == "REPLAYGAIN_ALBUM_PEAK")
album_peak = words[2].toDouble();
else if (words[1] == "REPLAYGAIN_TRACK_GAIN" && !m_tracks.isEmpty())
- m_tracks.last()->replayGain.insert(Qmmp::REPLAYGAIN_TRACK_GAIN, words[2].toDouble());
+ m_tracks.last()->info.setValue(Qmmp::REPLAYGAIN_TRACK_GAIN, words[2].toDouble());
else if (words[1] == "REPLAYGAIN_TRACK_PEAK" && !m_tracks.isEmpty())
- m_tracks.last()->replayGain.insert(Qmmp::REPLAYGAIN_TRACK_PEAK, words[2].toDouble());
+ m_tracks.last()->info.setValue(Qmmp::REPLAYGAIN_TRACK_PEAK, words[2].toDouble());
}
}
if(m_tracks.isEmpty())
@@ -108,13 +108,18 @@ CUEParser::CUEParser(const QByteArray &array, const QString &fileName)
qWarning("CUEParser: invalid cue file");
return;
}
- //calculate last item length
- QList <FileInfo *> f_list = MetaDataManager::instance()->createPlayList(m_filePath, false);
- qint64 l = f_list.isEmpty() ? 0 : f_list.at(0)->length() * 1000;
- if (l > m_tracks.last()->offset)
- m_tracks.last()->info.setLength(l - m_tracks.last()->offset);
- else
- m_tracks.last()->info.setLength(0);
+
+ QList<TrackInfo *> f_list = MetaDataManager::instance()->createPlayList(m_filePath, TrackInfo::Properties);
+ if(!f_list.isEmpty())
+ {
+ //calculate last item length
+ m_tracks.last()->info.setDuration(qMax(0LL, f_list.first()->duration() - m_tracks.last()->offset));
+ //add properties
+ foreach(CUETrack *cueTrack, m_tracks)
+ cueTrack->info.setValues(f_list.first()->properties());
+ qDeleteAll(f_list);
+ f_list.clear();
+ }
}
CUEParser::~CUEParser()
@@ -123,13 +128,12 @@ CUEParser::~CUEParser()
m_tracks.clear();
}
-QList<FileInfo*> CUEParser::createPlayList()
+QList<TrackInfo*> CUEParser::createPlayList()
{
- QList<FileInfo*> list;
+ QList<TrackInfo*> list;
foreach(CUETrack *track, m_tracks)
{
- list << new FileInfo(track->info);
- list.last()->setLength(track->info.length()/1000);
+ list << new TrackInfo(track->info);
}
return list;
}
@@ -144,9 +148,9 @@ qint64 CUEParser::offset(int track) const
return m_tracks.at(track - 1)->offset;
}
-qint64 CUEParser::length(int track) const
+qint64 CUEParser::duration(int track) const
{
- return m_tracks.at(track - 1)->info.length();
+ return m_tracks.at(track - 1)->info.duration();
}
int CUEParser::count() const
@@ -154,7 +158,7 @@ int CUEParser::count() const
return m_tracks.count();
}
-FileInfo *CUEParser::info(int track)
+TrackInfo *CUEParser::info(int track)
{
return &m_tracks.at(track - 1)->info;
}
@@ -166,7 +170,7 @@ const QString CUEParser::trackURL(int track) const
const QMap<Qmmp::ReplayGainKey, double> CUEParser::replayGain(int track) const
{
- return m_tracks.at(track - 1)->replayGain;
+ return m_tracks.at(track - 1)->info.replayGainInfo();
}
QStringList CUEParser::splitLine(const QString &line)
diff --git a/src/plugins/Input/wavpack/cueparser.h b/src/plugins/Input/wavpack/cueparser.h
index 676bef0aa..e173aee58 100644
--- a/src/plugins/Input/wavpack/cueparser.h
+++ b/src/plugins/Input/wavpack/cueparser.h
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2008-2016 by Ilya Kotov *
+ * Copyright (C) 2008-2018 by Ilya Kotov *
* forkotov02@ya.ru *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -26,7 +26,7 @@
#include <QStringList>
#include <QUrl>
#include <qmmp/qmmp.h>
-#include <qmmp/fileinfo.h>
+#include <qmmp/trackinfo.h>
/**
@@ -35,27 +35,26 @@
class CUEParser
{
public:
- CUEParser(const QByteArray &array, const QString &fileName);
+ CUEParser(const QByteArray &array, const QString &path);
~CUEParser();
- QList<FileInfo*> createPlayList();
+ QList<TrackInfo *> createPlayList();
const QString filePath() const;
qint64 offset(int track) const;
- qint64 length(int track) const;
+ qint64 duration(int track) const;
int count() const;
- FileInfo *info(int track);
+ TrackInfo *info(int track);
const QString trackURL(int track) const;
const QMap<Qmmp::ReplayGainKey, double> replayGain(int track) const;
private:
struct CUETrack
{
- FileInfo info;
+ TrackInfo info;
qint64 offset;
- QMap<Qmmp::ReplayGainKey, double> replayGain;
};
- QList <CUETrack * > m_tracks;
+ QList <CUETrack *> m_tracks;
QStringList splitLine(const QString &line);
qint64 getLength(const QString &str);
QString m_filePath;
diff --git a/src/plugins/Input/wavpack/decoder_wavpack.cpp b/src/plugins/Input/wavpack/decoder_wavpack.cpp
index 0adf85449..e97e1b95b 100644
--- a/src/plugins/Input/wavpack/decoder_wavpack.cpp
+++ b/src/plugins/Input/wavpack/decoder_wavpack.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2008-2017 by Ilya Kotov *
+ * Copyright (C) 2008-2018 by Ilya Kotov *
* forkotov02@ya.ru *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -141,7 +141,7 @@ bool DecoderWavPack::initialize()
m_totalTime = (qint64) WavpackGetNumSamples(m_context) * 1000 / freq;
else
{
- m_length = m_parser->length(m_track);
+ m_length = m_parser->duration(m_track);
m_offset = m_parser->offset(m_track);
m_length_in_bytes = audioParameters().sampleRate() *
audioParameters().frameSize() * m_length/1000;
@@ -218,8 +218,8 @@ void DecoderWavPack::next()
if(m_parser && m_track +1 <= m_parser->count())
{
m_track++;
- m_offset = m_parser->length(m_track);
- m_length = m_parser->length(m_track);
+ m_offset = m_parser->duration(m_track);
+ m_length = m_parser->duration(m_track);
m_length_in_bytes = audioParameters().sampleRate() *
audioParameters().channels() *
audioParameters().sampleSize() * m_length/1000;
diff --git a/src/plugins/Input/wavpack/decoderwavpackfactory.cpp b/src/plugins/Input/wavpack/decoderwavpackfactory.cpp
index 4f730232f..fb52c7ee7 100644
--- a/src/plugins/Input/wavpack/decoderwavpackfactory.cpp
+++ b/src/plugins/Input/wavpack/decoderwavpackfactory.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2008-2017 by Ilya Kotov *
+ * Copyright (C) 2008-2018 by Ilya Kotov *
* forkotov02@ya.ru *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -52,35 +52,35 @@ Decoder *DecoderWavPackFactory::create(const QString &p, QIODevice *)
return new DecoderWavPack(p);
}
-QList<FileInfo *> DecoderWavPackFactory::createPlayList(const QString &fileName, bool useMetaData, QStringList *ignoredFiles)
+QList<TrackInfo *> DecoderWavPackFactory::createPlayList(const QString &path, TrackInfo::Parts parts, QStringList *ignoredFiles)
{
- QList <FileInfo*> list;
+ QList<TrackInfo *> list;
char err[80];
- int cue_len=0;
+ int cue_len = 0;
//extract metadata of one cue track
- if(fileName.contains("://"))
+ if(path.contains("://"))
{
- QString path = fileName;
- path.remove("wvpack://");
- path.remove(QRegExp("#\\d+$"));
- int track = fileName.section("#", -1).toInt();
- list = createPlayList(path, true, ignoredFiles);
+ QString filePath = path;
+ filePath.remove("wvpack://");
+ filePath.remove(QRegExp("#\\d+$"));
+ int track = filePath.section("#", -1).toInt();
+ list = createPlayList(filePath, parts, ignoredFiles);
if (list.isEmpty() || track <= 0 || track > list.count())
{
qDeleteAll(list);
list.clear();
return list;
}
- FileInfo *info = list.takeAt(track - 1);
+ TrackInfo *info = list.takeAt(track - 1);
qDeleteAll(list);
- return QList<FileInfo *>() << info;
+ return QList<TrackInfo *>() << info;
}
#if defined(Q_OS_WIN) && defined(OPEN_FILE_UTF8)
WavpackContext *ctx = WavpackOpenFileInput (fileName.toUtf8().constData(),
err, OPEN_WVC | OPEN_TAGS | OPEN_FILE_UTF8, 0);
#else
- WavpackContext *ctx = WavpackOpenFileInput (fileName.toLocal8Bit().constData(),
+ WavpackContext *ctx = WavpackOpenFileInput (path.toLocal8Bit().constData(),
err, OPEN_WVC | OPEN_TAGS, 0);
#endif
if (!ctx)
@@ -88,15 +88,15 @@ QList<FileInfo *> DecoderWavPackFactory::createPlayList(const QString &fileName,
qWarning("DecoderWavPackFactory: error: %s", err);
return list;
}
- FileInfo *info = new FileInfo(fileName);
- if (useMetaData)
+ TrackInfo *info = new TrackInfo(path);
+ if(parts & TrackInfo::MetaData)
{
cue_len = WavpackGetTagItem (ctx, "cuesheet", NULL, 0);
if (cue_len)
{
char *value = (char*)malloc (cue_len * 2 + 1);
WavpackGetTagItem (ctx, "cuesheet", value, cue_len + 1);
- CUEParser parser(value, fileName);
+ CUEParser parser(value, path);
list = parser.createPlayList();
delete info;
info = 0;
@@ -106,31 +106,52 @@ QList<FileInfo *> DecoderWavPackFactory::createPlayList(const QString &fileName,
char value[200];
memset(value,0,sizeof(value));
WavpackGetTagItem (ctx, "Album", value, sizeof(value));
- info->setMetaData(Qmmp::ALBUM, QString::fromUtf8(value));
+ info->setValue(Qmmp::ALBUM, QString::fromUtf8(value));
WavpackGetTagItem (ctx, "Artist", value, sizeof(value));
- info->setMetaData(Qmmp::ARTIST, QString::fromUtf8(value));
+ info->setValue(Qmmp::ARTIST, QString::fromUtf8(value));
WavpackGetTagItem (ctx, "Album Artist", value, sizeof(value));
- info->setMetaData(Qmmp::ALBUMARTIST, QString::fromUtf8(value));
+ info->setValue(Qmmp::ALBUMARTIST, QString::fromUtf8(value));
WavpackGetTagItem (ctx, "Comment", value, sizeof(value));
- info->setMetaData(Qmmp::COMMENT, QString::fromUtf8(value));
+ info->setValue(Qmmp::COMMENT, QString::fromUtf8(value));
WavpackGetTagItem (ctx, "Genre", value, sizeof(value));
- info->setMetaData(Qmmp::GENRE, QString::fromUtf8(value));
+ info->setValue(Qmmp::GENRE, QString::fromUtf8(value));
WavpackGetTagItem (ctx, "Title", value, sizeof(value));
- info->setMetaData(Qmmp::TITLE, QString::fromUtf8(value));
+ info->setValue(Qmmp::TITLE, QString::fromUtf8(value));
WavpackGetTagItem (ctx, "Composer", value, sizeof(value));
- info->setMetaData(Qmmp::COMPOSER, QString::fromUtf8(value));
+ info->setValue(Qmmp::COMPOSER, QString::fromUtf8(value));
WavpackGetTagItem (ctx, "Year", value, sizeof(value));
- info->setMetaData(Qmmp::YEAR, QString::fromUtf8(value).toInt());
+ info->setValue(Qmmp::YEAR, QString::fromUtf8(value).toInt());
WavpackGetTagItem (ctx, "Track", value, sizeof(value));
- info->setMetaData(Qmmp::TRACK, QString::fromUtf8(value).toInt());
+ info->setValue(Qmmp::TRACK, QString::fromUtf8(value).toInt());
WavpackGetTagItem (ctx, "Disc", value, sizeof(value));
- info->setMetaData(Qmmp::DISCNUMBER, QString::fromUtf8(value).toInt());
+ info->setValue(Qmmp::DISCNUMBER, QString::fromUtf8(value).toInt());
}
}
- if (info)
+ if(info)
{
- info->setLength((int) WavpackGetNumSamples(ctx)/WavpackGetSampleRate(ctx));
+ info->setDuration((qint64)WavpackGetNumSamples(ctx) * 1000 / WavpackGetSampleRate(ctx));
+ if(parts & TrackInfo::Properties)
+ {
+ info->setValue(Qmmp::BITRATE, WavpackGetAverageBitrate(ctx, 1));
+ info->setValue(Qmmp::SAMPLERATE, WavpackGetSampleRate(ctx));
+ info->setValue(Qmmp::CHANNELS, WavpackGetNumChannels(ctx));
+ info->setValue(Qmmp::BITS_PER_SAMPLE, WavpackGetBitsPerSample(ctx));
+ info->setValue(Qmmp::FORMAT_NAME, "WavPack");
+ }
+
+ if(parts & TrackInfo::ReplayGainInfo)
+ {
+ char value[200] = { 0 };
+ WavpackGetTagItem(ctx, "REPLAYGAIN_TRACK_GAIN", value, sizeof(value));
+ info->setValue(Qmmp::REPLAYGAIN_TRACK_GAIN, value);
+ WavpackGetTagItem(ctx, "REPLAYGAIN_TRACK_PEAK", value, sizeof(value));
+ info->setValue(Qmmp::REPLAYGAIN_TRACK_PEAK, value);
+ WavpackGetTagItem(ctx, "REPLAYGAIN_ALBUM_GAIN", value, sizeof(value));
+ info->setValue(Qmmp::REPLAYGAIN_ALBUM_GAIN, value);
+ WavpackGetTagItem(ctx, "REPLAYGAIN_ALBUM_PEAK", value, sizeof(value));
+ info->setValue(Qmmp::REPLAYGAIN_ALBUM_PEAK, value);
+ }
list << info;
}
WavpackCloseFile (ctx);
diff --git a/src/plugins/Input/wavpack/decoderwavpackfactory.h b/src/plugins/Input/wavpack/decoderwavpackfactory.h
index 96974ee18..66edf5f70 100644
--- a/src/plugins/Input/wavpack/decoderwavpackfactory.h
+++ b/src/plugins/Input/wavpack/decoderwavpackfactory.h
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2008-2016 by Ilya Kotov *
+ * Copyright (C) 2008-2018 by Ilya Kotov *
* forkotov02@ya.ru *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -20,16 +20,7 @@
#ifndef DECODERWAVPACKFACTORY_H
#define DECODERWAVPACKFACTORY_H
-#include <QObject>
-#include <QString>
-#include <QIODevice>
-#include <QWidget>
-
-#include <qmmp/decoder.h>
-#include <qmmp/output.h>
#include <qmmp/decoderfactory.h>
-#include <qmmp/fileinfo.h>
-
class DecoderWavPackFactory : public QObject,
DecoderFactory
@@ -42,7 +33,7 @@ public:
bool canDecode(QIODevice *input) const;
const DecoderProperties properties() const;
Decoder *create(const QString &p, QIODevice *i);
- QList<FileInfo *> createPlayList(const QString &fileName, bool useMetaData, QStringList *ignoredFiles);
+ QList<TrackInfo *> createPlayList(const QString &path, TrackInfo::Parts parts, QStringList *ignoredFiles);
MetaDataModel* createMetaDataModel(const QString &path, QObject *parent = 0);
void showSettings(QWidget *parent);
void showAbout(QWidget *parent);
diff --git a/src/plugins/Input/wavpack/replaygainreader.cpp b/src/plugins/Input/wavpack/replaygainreader.cpp
deleted file mode 100644
index b48406f6e..000000000
--- a/src/plugins/Input/wavpack/replaygainreader.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2009-2016 by Ilya Kotov *
- * forkotov02@ya.ru *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
- ***************************************************************************/
-
-#include <QtGlobal>
-#include <QRegExp>
-#include "replaygainreader.h"
-
-ReplayGainReader::ReplayGainReader(const QString &path)
-{
- if(path.contains("://"))
- {
- QString p = m_path;
- p.remove("wvpack://");
- p.remove(QRegExp("#\\d+$"));
- m_path = p;
- }
- else
- m_path = path;
-
- char err[80];
-
-#if defined(Q_OS_WIN) && defined(OPEN_FILE_UTF8)
- m_ctx = WavpackOpenFileInput (m_path.toUtf8().constData(),
- err, OPEN_WVC | OPEN_TAGS | OPEN_FILE_UTF8, 0);
-#else
- m_ctx = WavpackOpenFileInput (m_path.toLocal8Bit().constData(), err,
- OPEN_WVC | OPEN_EDIT_TAGS, 0);
-#endif
- if (!m_ctx)
- {
- qWarning("ReplayGainReader: error: %s", err);
- return;
- }
- readAPE();
-}
-
-ReplayGainReader::~ReplayGainReader()
-{
- if(m_ctx)
- WavpackCloseFile (m_ctx);
-}
-
-QMap <Qmmp::ReplayGainKey, double> ReplayGainReader::replayGainInfo() const
-{
- return m_values;
-}
-
-void ReplayGainReader::readAPE()
-{
- char value[200];
- WavpackGetTagItem (m_ctx, "REPLAYGAIN_TRACK_GAIN", value, sizeof(value));
- setValue(Qmmp::REPLAYGAIN_TRACK_GAIN, value);
- WavpackGetTagItem (m_ctx, "REPLAYGAIN_TRACK_PEAK", value, sizeof(value));
- setValue(Qmmp::REPLAYGAIN_TRACK_PEAK, value);
- WavpackGetTagItem (m_ctx, "REPLAYGAIN_ALBUM_GAIN", value, sizeof(value));
- setValue(Qmmp::REPLAYGAIN_ALBUM_GAIN, value);
- WavpackGetTagItem (m_ctx, "REPLAYGAIN_ALBUM_PEAK", value, sizeof(value));
- setValue(Qmmp::REPLAYGAIN_ALBUM_PEAK, value);
-}
-
-void ReplayGainReader::setValue(Qmmp::ReplayGainKey key, QString value)
-{
- value.remove(" dB");
- value = value.trimmed();
- if(value.isEmpty())
- return;
- bool ok;
- double v = value.toDouble(&ok);
- if(ok)
- m_values[key] = v;
-}
diff --git a/src/plugins/Input/wavpack/replaygainreader.h b/src/plugins/Input/wavpack/replaygainreader.h
deleted file mode 100644
index b861dae1e..000000000
--- a/src/plugins/Input/wavpack/replaygainreader.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2009 by Ilya Kotov *
- * forkotov02@ya.ru *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
- ***************************************************************************/
-
-#ifndef REPLAYGAINREADER_H
-#define REPLAYGAINREADER_H
-
-#include <QMap>
-#include <QString>
-#include <wavpack/wavpack.h>
-#include <qmmp/qmmp.h>
-
-/**
- @author Ilya Kotov <forkotov02@ya.ru>
-*/
-class ReplayGainReader
-{
-public:
- ReplayGainReader(const QString &path);
- ~ReplayGainReader();
- QMap <Qmmp::ReplayGainKey, double> replayGainInfo() const;
-
-private:
- void readAPE();
- void setValue(Qmmp::ReplayGainKey key, QString value);
- QMap <Qmmp::ReplayGainKey, double> m_values;
- WavpackContext *m_ctx;
- QString m_path;
-};
-
-#endif // REPLAYGAINREADER_H
diff --git a/src/plugins/Input/wavpack/wavpack.pro b/src/plugins/Input/wavpack/wavpack.pro
index c55d21148..b398b3cc6 100644
--- a/src/plugins/Input/wavpack/wavpack.pro
+++ b/src/plugins/Input/wavpack/wavpack.pro
@@ -5,14 +5,12 @@ TARGET = $$PLUGINS_PREFIX/Input/wavpack
HEADERS += decoderwavpackfactory.h \
decoder_wavpack.h \
cueparser.h \
- wavpackmetadatamodel.h \
- replaygainreader.h
+ wavpackmetadatamodel.h
SOURCES += decoder_wavpack.cpp \
decoderwavpackfactory.cpp \
cueparser.cpp \
- wavpackmetadatamodel.cpp \
- replaygainreader.cpp
+ wavpackmetadatamodel.cpp
RESOURCES = translations/translations.qrc