diff options
Diffstat (limited to 'src')
32 files changed, 246 insertions, 150 deletions
diff --git a/src/plugins/Input/mad/decoder_mad.cpp b/src/plugins/Input/mad/decoder_mad.cpp index f76ff9350..1e4fea68f 100644 --- a/src/plugins/Input/mad/decoder_mad.cpp +++ b/src/plugins/Input/mad/decoder_mad.cpp @@ -13,13 +13,12 @@ #include <math.h> #include <stdio.h> #include "tagextractor.h" -#include "replaygainreader.h" #include "decoder_mad.h" #define XING_MAGIC (('X' << 24) | ('i' << 16) | ('n' << 8) | 'g') #define INPUT_BUFFER_SIZE (32*1024) -DecoderMAD::DecoderMAD(const QString &url, QIODevice *i) : Decoder(i) +DecoderMAD::DecoderMAD(QIODevice *i) : Decoder(i) { m_inited = false; m_totalTime = 0; @@ -33,7 +32,6 @@ DecoderMAD::DecoderMAD(const QString &url, QIODevice *i) : Decoder(i) m_output_at = 0; m_skip_frames = 0; m_eof = false; - m_url = url; } DecoderMAD::~DecoderMAD() @@ -98,15 +96,7 @@ bool DecoderMAD::initialize() mad_frame_mute (&frame); stream.next_frame = 0; stream.sync = 0; - - if(!m_url.contains("://")) - { - ReplayGainReader rg(m_url); - configure(m_freq, m_channels, 16, rg.replayGainInfo()); - } - else - configure(m_freq, m_channels, 16); - + configure(m_freq, m_channels, 16); m_inited = TRUE; return TRUE; } diff --git a/src/plugins/Input/mad/decoder_mad.h b/src/plugins/Input/mad/decoder_mad.h index a98f7fbf7..c78e3f8c8 100644 --- a/src/plugins/Input/mad/decoder_mad.h +++ b/src/plugins/Input/mad/decoder_mad.h @@ -22,7 +22,7 @@ extern "C" class DecoderMAD : public Decoder { public: - DecoderMAD(const QString &url, QIODevice *i); + DecoderMAD(QIODevice *i); virtual ~DecoderMAD(); // standard decoder API @@ -46,7 +46,6 @@ private: uint m_bitrate; long m_freq, m_len; qint64 m_output_bytes, m_output_at; - QString m_url; // file input buffer char *m_input_buf; diff --git a/src/plugins/Input/mad/decodermadfactory.cpp b/src/plugins/Input/mad/decodermadfactory.cpp index 2ec86e011..2a7df8189 100644 --- a/src/plugins/Input/mad/decodermadfactory.cpp +++ b/src/plugins/Input/mad/decodermadfactory.cpp @@ -31,6 +31,7 @@ #include <taglib/tfile.h> #include <taglib/mpegfile.h> #include "mpegmetadatamodel.h" +#include "replaygainreader.h" #include "settingsdialog.h" #include "decoder_mad.h" #include "decodermadfactory.h" @@ -95,7 +96,13 @@ const DecoderProperties DecoderMADFactory::properties() const Decoder *DecoderMADFactory::create(const QString &url, QIODevice *input) { - return new DecoderMAD(url, input); + Decoder *d = new DecoderMAD(input); + if(!url.contains("://")) //local file + { + ReplayGainReader rg(url); + d->setReplayGainInfo(rg.replayGainInfo()); + } + return d; } QList<FileInfo *> DecoderMADFactory::createPlayList(const QString &fileName, bool useMetaData) diff --git a/src/plugins/Input/mad/translations/mad_plugin_cs.ts b/src/plugins/Input/mad/translations/mad_plugin_cs.ts index ac90ee91e..d0bc46a5a 100644 --- a/src/plugins/Input/mad/translations/mad_plugin_cs.ts +++ b/src/plugins/Input/mad/translations/mad_plugin_cs.ts @@ -4,37 +4,37 @@ <context> <name>DecoderMADFactory</name> <message> - <location filename="../decodermadfactory.cpp" line="86"/> + <location filename="../decodermadfactory.cpp" line="87"/> <source>MPEG Plugin</source> <translation>Modul MPEG</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="89"/> + <location filename="../decodermadfactory.cpp" line="90"/> <source>MPEG Files</source> <translation>Soubory MPEG</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="213"/> + <location filename="../decodermadfactory.cpp" line="220"/> <source>About MPEG Audio Plugin</source> <translation>O modulu MPEG</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="214"/> + <location filename="../decodermadfactory.cpp" line="221"/> <source>Qmmp MPEG Audio Plugin</source> <translation>Vstupní modul Qmmp MPEG</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="215"/> + <location filename="../decodermadfactory.cpp" line="222"/> <source>Compiled against libmad version:</source> <translation>Zkompilováno s libmad verze:</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="219"/> + <location filename="../decodermadfactory.cpp" line="226"/> <source>Writen by: Ilya Kotov <forkotov02@hotmail.ru></source> <translation>Autor: Ilja Kotov <forkotov02@hotmail.ru></translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="220"/> + <location filename="../decodermadfactory.cpp" line="227"/> <source>Source code based on mq3 progect</source> <translation>Zdrojový kód je založen na projektu mq3</translation> </message> diff --git a/src/plugins/Input/mad/translations/mad_plugin_de.ts b/src/plugins/Input/mad/translations/mad_plugin_de.ts index 091f7a4aa..aaf31a68e 100644 --- a/src/plugins/Input/mad/translations/mad_plugin_de.ts +++ b/src/plugins/Input/mad/translations/mad_plugin_de.ts @@ -4,37 +4,37 @@ <context> <name>DecoderMADFactory</name> <message> - <location filename="../decodermadfactory.cpp" line="86"/> + <location filename="../decodermadfactory.cpp" line="87"/> <source>MPEG Plugin</source> <translation>MPEG-Modul</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="89"/> + <location filename="../decodermadfactory.cpp" line="90"/> <source>MPEG Files</source> <translation>MPEG-Dateien</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="213"/> + <location filename="../decodermadfactory.cpp" line="220"/> <source>About MPEG Audio Plugin</source> <translation>Über MPEG-Audio-Modul</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="214"/> + <location filename="../decodermadfactory.cpp" line="221"/> <source>Qmmp MPEG Audio Plugin</source> <translation>Qmmp MPEG-Audio-Modul</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="215"/> + <location filename="../decodermadfactory.cpp" line="222"/> <source>Compiled against libmad version:</source> <translation>Kompiliert gegen libmad-Version:</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="219"/> + <location filename="../decodermadfactory.cpp" line="226"/> <source>Writen by: Ilya Kotov <forkotov02@hotmail.ru></source> <translation>Autor: Ilya Kotov <forkotov02@hotmail.ru></translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="220"/> + <location filename="../decodermadfactory.cpp" line="227"/> <source>Source code based on mq3 progect</source> <translation>Quellcode basiert auf dem mq3-Projekt</translation> </message> diff --git a/src/plugins/Input/mad/translations/mad_plugin_it.ts b/src/plugins/Input/mad/translations/mad_plugin_it.ts index df9f0126e..d8571e4f5 100644 --- a/src/plugins/Input/mad/translations/mad_plugin_it.ts +++ b/src/plugins/Input/mad/translations/mad_plugin_it.ts @@ -4,37 +4,37 @@ <context> <name>DecoderMADFactory</name> <message> - <location filename="../decodermadfactory.cpp" line="86"/> + <location filename="../decodermadfactory.cpp" line="87"/> <source>MPEG Plugin</source> <translation>Modulo MPEG</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="89"/> + <location filename="../decodermadfactory.cpp" line="90"/> <source>MPEG Files</source> <translation>Brani MPEG</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="213"/> + <location filename="../decodermadfactory.cpp" line="220"/> <source>About MPEG Audio Plugin</source> <translation>Info sul modulo audio MPEG</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="214"/> + <location filename="../decodermadfactory.cpp" line="221"/> <source>Qmmp MPEG Audio Plugin</source> <translation>Modulo audio MPEG per Qmmp</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="215"/> + <location filename="../decodermadfactory.cpp" line="222"/> <source>Compiled against libmad version:</source> <translation>Compilato con libmad-Version:</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="219"/> + <location filename="../decodermadfactory.cpp" line="226"/> <source>Writen by: Ilya Kotov <forkotov02@hotmail.ru></source> <translation>Autore: Ilya Kotov <forkotov02@hotmail.ru></translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="220"/> + <location filename="../decodermadfactory.cpp" line="227"/> <source>Source code based on mq3 progect</source> <translation>Codice sorgente basato sul progetto mq3</translation> </message> diff --git a/src/plugins/Input/mad/translations/mad_plugin_lt.ts b/src/plugins/Input/mad/translations/mad_plugin_lt.ts index 9e6851995..44e981e2a 100644 --- a/src/plugins/Input/mad/translations/mad_plugin_lt.ts +++ b/src/plugins/Input/mad/translations/mad_plugin_lt.ts @@ -4,37 +4,37 @@ <context> <name>DecoderMADFactory</name> <message> - <location filename="../decodermadfactory.cpp" line="86"/> + <location filename="../decodermadfactory.cpp" line="87"/> <source>MPEG Plugin</source> <translation>MPEG įskiepis</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="89"/> + <location filename="../decodermadfactory.cpp" line="90"/> <source>MPEG Files</source> <translation>MPEG bylos</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="213"/> + <location filename="../decodermadfactory.cpp" line="220"/> <source>About MPEG Audio Plugin</source> <translation>Apie MPEG audio įskiepį</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="214"/> + <location filename="../decodermadfactory.cpp" line="221"/> <source>Qmmp MPEG Audio Plugin</source> <translation>Qmmp MPEG įskiepis</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="215"/> + <location filename="../decodermadfactory.cpp" line="222"/> <source>Compiled against libmad version:</source> <translation>Sukurta libmad pagrindu:</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="219"/> + <location filename="../decodermadfactory.cpp" line="226"/> <source>Writen by: Ilya Kotov <forkotov02@hotmail.ru></source> <translation>Sukūrė: Ilya Kotov <forkotov02@hotmail.ru></translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="220"/> + <location filename="../decodermadfactory.cpp" line="227"/> <source>Source code based on mq3 progect</source> <translation>Išvesties kodas sukurtas mq3 pagrindu</translation> </message> diff --git a/src/plugins/Input/mad/translations/mad_plugin_pl.ts b/src/plugins/Input/mad/translations/mad_plugin_pl.ts index 209d3303d..3e1454134 100644 --- a/src/plugins/Input/mad/translations/mad_plugin_pl.ts +++ b/src/plugins/Input/mad/translations/mad_plugin_pl.ts @@ -4,37 +4,37 @@ <context> <name>DecoderMADFactory</name> <message> - <location filename="../decodermadfactory.cpp" line="86"/> + <location filename="../decodermadfactory.cpp" line="87"/> <source>MPEG Plugin</source> <translation>Wtyczka MPEG</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="89"/> + <location filename="../decodermadfactory.cpp" line="90"/> <source>MPEG Files</source> <translation>Pliki MPEG</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="213"/> + <location filename="../decodermadfactory.cpp" line="220"/> <source>About MPEG Audio Plugin</source> <translation>O wtyczce Audio MPEG</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="214"/> + <location filename="../decodermadfactory.cpp" line="221"/> <source>Qmmp MPEG Audio Plugin</source> <translation>Wtyczka MPEG Audio dla Qmmp</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="215"/> + <location filename="../decodermadfactory.cpp" line="222"/> <source>Compiled against libmad version:</source> <translation>Skompilowane przy użyciu biblioteki libmad w wersji:</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="219"/> + <location filename="../decodermadfactory.cpp" line="226"/> <source>Writen by: Ilya Kotov <forkotov02@hotmail.ru></source> <translation>Autor: Ilja Kotov <forkotov02@hotmail.ru></translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="220"/> + <location filename="../decodermadfactory.cpp" line="227"/> <source>Source code based on mq3 progect</source> <translation>Kod źródłowy oparty na projekcie mq3</translation> </message> diff --git a/src/plugins/Input/mad/translations/mad_plugin_ru.ts b/src/plugins/Input/mad/translations/mad_plugin_ru.ts index a913f51d7..58e7df962 100644 --- a/src/plugins/Input/mad/translations/mad_plugin_ru.ts +++ b/src/plugins/Input/mad/translations/mad_plugin_ru.ts @@ -4,37 +4,37 @@ <context> <name>DecoderMADFactory</name> <message> - <location filename="../decodermadfactory.cpp" line="86"/> + <location filename="../decodermadfactory.cpp" line="87"/> <source>MPEG Plugin</source> <translation>Модуль MPEG</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="89"/> + <location filename="../decodermadfactory.cpp" line="90"/> <source>MPEG Files</source> <translation>Файлы MPEG</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="213"/> + <location filename="../decodermadfactory.cpp" line="220"/> <source>About MPEG Audio Plugin</source> <translation>Об аудио-модуле MPEG</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="214"/> + <location filename="../decodermadfactory.cpp" line="221"/> <source>Qmmp MPEG Audio Plugin</source> <translation>Аудио-модуль MPEG для Qmmp</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="215"/> + <location filename="../decodermadfactory.cpp" line="222"/> <source>Compiled against libmad version:</source> <translation>Собрано с версией libmad:</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="219"/> + <location filename="../decodermadfactory.cpp" line="226"/> <source>Writen by: Ilya Kotov <forkotov02@hotmail.ru></source> <translation>Разработчик: Илья Котов <forkotov02@hotmail.ru></translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="220"/> + <location filename="../decodermadfactory.cpp" line="227"/> <source>Source code based on mq3 progect</source> <translation>Исходный код основан на проекте mq3</translation> </message> diff --git a/src/plugins/Input/mad/translations/mad_plugin_tr.ts b/src/plugins/Input/mad/translations/mad_plugin_tr.ts index 731fefe6d..3f567928c 100644 --- a/src/plugins/Input/mad/translations/mad_plugin_tr.ts +++ b/src/plugins/Input/mad/translations/mad_plugin_tr.ts @@ -4,37 +4,37 @@ <context> <name>DecoderMADFactory</name> <message> - <location filename="../decodermadfactory.cpp" line="86"/> + <location filename="../decodermadfactory.cpp" line="87"/> <source>MPEG Plugin</source> <translation>MPEG Eklentisi</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="89"/> + <location filename="../decodermadfactory.cpp" line="90"/> <source>MPEG Files</source> <translation>MPEG Dosyaları</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="213"/> + <location filename="../decodermadfactory.cpp" line="220"/> <source>About MPEG Audio Plugin</source> <translation>MPEG Ses Eklentisi Hakkında</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="214"/> + <location filename="../decodermadfactory.cpp" line="221"/> <source>Qmmp MPEG Audio Plugin</source> <translation>Qmmp MPEG Ses Eklentisi</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="215"/> + <location filename="../decodermadfactory.cpp" line="222"/> <source>Compiled against libmad version:</source> <translation>Derlendiği libmad sürümü:</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="219"/> + <location filename="../decodermadfactory.cpp" line="226"/> <source>Writen by: Ilya Kotov <forkotov02@hotmail.ru></source> <translation>Yazan: Ilya Kotov <forkotov02@hotmail.ru></translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="220"/> + <location filename="../decodermadfactory.cpp" line="227"/> <source>Source code based on mq3 progect</source> <translation>Kaynak kodu mq3 projesi temellidir</translation> </message> diff --git a/src/plugins/Input/mad/translations/mad_plugin_uk_UA.ts b/src/plugins/Input/mad/translations/mad_plugin_uk_UA.ts index c509c85ca..351759f83 100644 --- a/src/plugins/Input/mad/translations/mad_plugin_uk_UA.ts +++ b/src/plugins/Input/mad/translations/mad_plugin_uk_UA.ts @@ -4,37 +4,37 @@ <context> <name>DecoderMADFactory</name> <message> - <location filename="../decodermadfactory.cpp" line="86"/> + <location filename="../decodermadfactory.cpp" line="87"/> <source>MPEG Plugin</source> <translation>Модуль MPEG</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="89"/> + <location filename="../decodermadfactory.cpp" line="90"/> <source>MPEG Files</source> <translation>Файли MPEG</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="213"/> + <location filename="../decodermadfactory.cpp" line="220"/> <source>About MPEG Audio Plugin</source> <translation>Про аудіо-модуль MPEG</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="214"/> + <location filename="../decodermadfactory.cpp" line="221"/> <source>Qmmp MPEG Audio Plugin</source> <translation>Аудіо-модуль MPEG для Qmmp</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="215"/> + <location filename="../decodermadfactory.cpp" line="222"/> <source>Compiled against libmad version:</source> <translation>Зібрано з версією libmad:</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="219"/> + <location filename="../decodermadfactory.cpp" line="226"/> <source>Writen by: Ilya Kotov <forkotov02@hotmail.ru></source> <translation>Розробник: Ілля Котов <forkotov02@hotmail.ru></translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="220"/> + <location filename="../decodermadfactory.cpp" line="227"/> <source>Source code based on mq3 progect</source> <translation>Вихідний код базується на проекті mq3</translation> </message> diff --git a/src/plugins/Input/mad/translations/mad_plugin_zh_CN.ts b/src/plugins/Input/mad/translations/mad_plugin_zh_CN.ts index 5b7aef659..4e1138c22 100644 --- a/src/plugins/Input/mad/translations/mad_plugin_zh_CN.ts +++ b/src/plugins/Input/mad/translations/mad_plugin_zh_CN.ts @@ -4,37 +4,37 @@ <context> <name>DecoderMADFactory</name> <message> - <location filename="../decodermadfactory.cpp" line="86"/> + <location filename="../decodermadfactory.cpp" line="87"/> <source>MPEG Plugin</source> <translation>MPEG 插件</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="89"/> + <location filename="../decodermadfactory.cpp" line="90"/> <source>MPEG Files</source> <translation>MPEG 文件</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="213"/> + <location filename="../decodermadfactory.cpp" line="220"/> <source>About MPEG Audio Plugin</source> <translation>关于 MPEG 音频插件</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="214"/> + <location filename="../decodermadfactory.cpp" line="221"/> <source>Qmmp MPEG Audio Plugin</source> <translation>Qmmp MPEG 音频插件</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="215"/> + <location filename="../decodermadfactory.cpp" line="222"/> <source>Compiled against libmad version:</source> <translation>编译基于 libmad 的版本:</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="219"/> + <location filename="../decodermadfactory.cpp" line="226"/> <source>Writen by: Ilya Kotov <forkotov02@hotmail.ru></source> <translation>作者:Ilya Kotov <forkotov02@hotmail.ru></translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="220"/> + <location filename="../decodermadfactory.cpp" line="227"/> <source>Source code based on mq3 progect</source> <translation>源代码基于 mq3 项目</translation> </message> diff --git a/src/plugins/Input/mad/translations/mad_plugin_zh_TW.ts b/src/plugins/Input/mad/translations/mad_plugin_zh_TW.ts index db84455c7..042c22d25 100644 --- a/src/plugins/Input/mad/translations/mad_plugin_zh_TW.ts +++ b/src/plugins/Input/mad/translations/mad_plugin_zh_TW.ts @@ -4,37 +4,37 @@ <context> <name>DecoderMADFactory</name> <message> - <location filename="../decodermadfactory.cpp" line="86"/> + <location filename="../decodermadfactory.cpp" line="87"/> <source>MPEG Plugin</source> <translation>MPEG 插件</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="89"/> + <location filename="../decodermadfactory.cpp" line="90"/> <source>MPEG Files</source> <translation>MPEG 檔案</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="213"/> + <location filename="../decodermadfactory.cpp" line="220"/> <source>About MPEG Audio Plugin</source> <translation>關於 MPEG 聲訊插件</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="214"/> + <location filename="../decodermadfactory.cpp" line="221"/> <source>Qmmp MPEG Audio Plugin</source> <translation>Qmmp MPEG 聲訊插件</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="215"/> + <location filename="../decodermadfactory.cpp" line="222"/> <source>Compiled against libmad version:</source> <translation>編譯基於 libmad 的版本:</translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="219"/> + <location filename="../decodermadfactory.cpp" line="226"/> <source>Writen by: Ilya Kotov <forkotov02@hotmail.ru></source> <translation>作者:Ilya Kotov <forkotov02@hotmail.ru></translation> </message> <message> - <location filename="../decodermadfactory.cpp" line="220"/> + <location filename="../decodermadfactory.cpp" line="227"/> <source>Source code based on mq3 progect</source> <translation>源碼基於 mq3 項目</translation> </message> diff --git a/src/plugins/Input/vorbis/CMakeLists.txt b/src/plugins/Input/vorbis/CMakeLists.txt index 18b9e9226..3b8356c04 100644 --- a/src/plugins/Input/vorbis/CMakeLists.txt +++ b/src/plugins/Input/vorbis/CMakeLists.txt @@ -35,12 +35,14 @@ SET(libvorbis_SRCS decoder_vorbis.cpp decodervorbisfactory.cpp vorbismetadatamodel.cpp + replaygainreader.cpp ) SET(libvorbis_MOC_HDRS decodervorbisfactory.h decoder_vorbis.h vorbismetadatamodel.h + replaygainreader.h ) SET(libvorbis_RCCS translations/translations.qrc) diff --git a/src/plugins/Input/vorbis/decoder_vorbis.cpp b/src/plugins/Input/vorbis/decoder_vorbis.cpp index 33836f016..d07ee413a 100644 --- a/src/plugins/Input/vorbis/decoder_vorbis.cpp +++ b/src/plugins/Input/vorbis/decoder_vorbis.cpp @@ -9,10 +9,8 @@ #include <qmmp/output.h> #include <qmmp/recycler.h> #include <qmmp/fileinfo.h> - #include <QObject> #include <QIODevice> - #include "decoder_vorbis.h" // ic functions for OggVorbis @@ -55,10 +53,8 @@ static int oggseek(void *src, int64_t offset, int whence) } -static int oggclose(void *src) +static int oggclose(void *) { - DecoderVorbis *dogg = (DecoderVorbis *) src; - //dogg->input()->close(); return 0; } @@ -137,9 +133,7 @@ bool DecoderVorbis::initialize() freq = ogginfo->rate; chan = ogginfo->channels; } - configure(freq, chan, 16); - inited = TRUE; return TRUE; } diff --git a/src/plugins/Input/vorbis/decoder_vorbis.h b/src/plugins/Input/vorbis/decoder_vorbis.h index eeac19c07..e9b33d60c 100644 --- a/src/plugins/Input/vorbis/decoder_vorbis.h +++ b/src/plugins/Input/vorbis/decoder_vorbis.h @@ -15,7 +15,7 @@ class DecoderVorbis : public Decoder { public: - DecoderVorbis(QIODevice *); + DecoderVorbis(QIODevice *i); virtual ~DecoderVorbis(); // Standard Decoder API diff --git a/src/plugins/Input/vorbis/decodervorbisfactory.cpp b/src/plugins/Input/vorbis/decodervorbisfactory.cpp index 1c3a0c87c..ad4ff844c 100644 --- a/src/plugins/Input/vorbis/decodervorbisfactory.cpp +++ b/src/plugins/Input/vorbis/decodervorbisfactory.cpp @@ -21,7 +21,7 @@ #include <taglib/tag.h> #include <taglib/fileref.h> #include <taglib/vorbisfile.h> - +#include "replaygainreader.h" #include "decoder_vorbis.h" #include "vorbismetadatamodel.h" #include "decodervorbisfactory.h" @@ -58,10 +58,15 @@ const DecoderProperties DecoderVorbisFactory::properties() const return properties; } -Decoder *DecoderVorbisFactory::create(const QString &path, QIODevice *input) +Decoder *DecoderVorbisFactory::create(const QString &url, QIODevice *input) { - Q_UNUSED(path); - return new DecoderVorbis(input); + Decoder *d = new DecoderVorbis(input); + if(!url.contains("://")) //local file + { + ReplayGainReader rg(url); + d->setReplayGainInfo(rg.replayGainInfo()); + } + return d; } MetaDataModel* DecoderVorbisFactory::createMetaDataModel(const QString &path, QObject *parent) diff --git a/src/plugins/Input/vorbis/replaygainreader.cpp b/src/plugins/Input/vorbis/replaygainreader.cpp new file mode 100644 index 000000000..78799f497 --- /dev/null +++ b/src/plugins/Input/vorbis/replaygainreader.cpp @@ -0,0 +1,61 @@ +/*************************************************************************** + * Copyright (C) 2009 by Ilya Kotov * + * forkotov02@hotmail.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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include <QtGlobal> +#include <taglib/tag.h> +#include <taglib/fileref.h> +#include <taglib/vorbisfile.h> +#include "replaygainreader.h" + +ReplayGainReader::ReplayGainReader(const QString &path) +{ + TagLib::Ogg::Vorbis::File fileRef(path.toLocal8Bit ().constData()); + if(fileRef.tag()) + readVorbisComment(fileRef.tag()); +} + +QMap <Qmmp::ReplayGainKey, double> ReplayGainReader::replayGainInfo() const +{ + return m_values; +} + +void ReplayGainReader::readVorbisComment(TagLib::Ogg::XiphComment *comment) +{ + TagLib::Ogg::FieldListMap items = comment->fieldListMap(); + if (items.contains("REPLAYGAIN_TRACK_GAIN")) + setValue(Qmmp::REPLAYGAIN_TRACK_GAIN,TStringToQString(items["REPLAYGAIN_TRACK_GAIN"].front())); + if (items.contains("REPLAYGAIN_TRACK_PEAK")) + setValue(Qmmp::REPLAYGAIN_TRACK_PEAK,TStringToQString(items["REPLAYGAIN_TRACK_PEAK"].front())); + if (items.contains("REPLAYGAIN_ALBUM_GAIN")) + setValue(Qmmp::REPLAYGAIN_ALBUM_GAIN,TStringToQString(items["REPLAYGAIN_ALBUM_GAIN"].front())); + if (items.contains("REPLAYGAIN_ALBUM_PEAK")) + setValue(Qmmp::REPLAYGAIN_ALBUM_PEAK,TStringToQString(items["REPLAYGAIN_ALBUM_PEAK"].front())); +} + +void ReplayGainReader::setValue(Qmmp::ReplayGainKey key, QString value) +{ + value.remove(" dB"); + if(value.isEmpty()) + return; + bool ok; + double v = value.toDouble(&ok); + if(ok) + m_values[key] = v; +} diff --git a/src/plugins/Input/vorbis/replaygainreader.h b/src/plugins/Input/vorbis/replaygainreader.h new file mode 100644 index 000000000..98a22b5d7 --- /dev/null +++ b/src/plugins/Input/vorbis/replaygainreader.h @@ -0,0 +1,44 @@ +/*************************************************************************** + * Copyright (C) 2009 by Ilya Kotov * + * forkotov02@hotmail.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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef REPLAYGAINREADER_H +#define REPLAYGAINREADER_H + +#include <QMap> +#include <QString> +#include <taglib/xiphcomment.h> +#include <qmmp/qmmp.h> + +/** + @author Ilya Kotov <forkotov02@hotmail.ru> +*/ +class ReplayGainReader +{ +public: + ReplayGainReader(const QString &path); + QMap <Qmmp::ReplayGainKey, double> replayGainInfo() const; + +private: + void readVorbisComment(TagLib::Ogg::XiphComment *comment); + void setValue(Qmmp::ReplayGainKey key, QString value); + QMap <Qmmp::ReplayGainKey, double> m_values; +}; + +#endif // REPLAYGAINREADER_H diff --git a/src/plugins/Input/vorbis/translations/vorbis_plugin_cs.ts b/src/plugins/Input/vorbis/translations/vorbis_plugin_cs.ts index a53e7bb22..aa11d11ff 100644 --- a/src/plugins/Input/vorbis/translations/vorbis_plugin_cs.ts +++ b/src/plugins/Input/vorbis/translations/vorbis_plugin_cs.ts @@ -14,22 +14,22 @@ <translation>Soubory Ogg-Vorbis</translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="119"/> + <location filename="../decodervorbisfactory.cpp" line="124"/> <source>About Ogg Vorbis Audio Plugin</source> <translation>O modulu Ogg-Vorbis</translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="120"/> + <location filename="../decodervorbisfactory.cpp" line="125"/> <source>Qmmp Ogg Vorbis Audio Plugin</source> <translation>Vstupní modul Qmmp Ogg-Vorbis</translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="121"/> + <location filename="../decodervorbisfactory.cpp" line="126"/> <source>Writen by: Ilya Kotov <forkotov02@hotmail.ru></source> <translation>Autor: Ilja Kotov <forkotov02@hotmail.ru></translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="122"/> + <location filename="../decodervorbisfactory.cpp" line="127"/> <source>Source code based on mq3 progect</source> <translation>Zdrojový kód je založen na projektu mq3</translation> </message> diff --git a/src/plugins/Input/vorbis/translations/vorbis_plugin_de.ts b/src/plugins/Input/vorbis/translations/vorbis_plugin_de.ts index c30af790f..0abb8edd8 100644 --- a/src/plugins/Input/vorbis/translations/vorbis_plugin_de.ts +++ b/src/plugins/Input/vorbis/translations/vorbis_plugin_de.ts @@ -14,22 +14,22 @@ <translation>Ogg-Vorbis-Dateien</translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="119"/> + <location filename="../decodervorbisfactory.cpp" line="124"/> <source>About Ogg Vorbis Audio Plugin</source> <translation>Über Ogg-Vorbis-Audio-Modul</translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="120"/> + <location filename="../decodervorbisfactory.cpp" line="125"/> <source>Qmmp Ogg Vorbis Audio Plugin</source> <translation>Qmmp Ogg-Vorbis-Audio-Modul</translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="121"/> + <location filename="../decodervorbisfactory.cpp" line="126"/> <source>Writen by: Ilya Kotov <forkotov02@hotmail.ru></source> <translation>Autor: Ilya Kotov <forkotov02@hotmail.ru></translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="122"/> + <location filename="../decodervorbisfactory.cpp" line="127"/> <source>Source code based on mq3 progect</source> <translation>Quellcode basiert auf dem mq3-Projekt</translation> </message> diff --git a/src/plugins/Input/vorbis/translations/vorbis_plugin_it.ts b/src/plugins/Input/vorbis/translations/vorbis_plugin_it.ts index a039093f7..aa335b1ba 100644 --- a/src/plugins/Input/vorbis/translations/vorbis_plugin_it.ts +++ b/src/plugins/Input/vorbis/translations/vorbis_plugin_it.ts @@ -14,22 +14,22 @@ <translation>Brani Ogg Vorbis</translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="119"/> + <location filename="../decodervorbisfactory.cpp" line="124"/> <source>About Ogg Vorbis Audio Plugin</source> <translation>Info sul modulo audio Ogg Vorbis</translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="120"/> + <location filename="../decodervorbisfactory.cpp" line="125"/> <source>Qmmp Ogg Vorbis Audio Plugin</source> <translation>Modulo audio Ogg Vorbis per Qmmp</translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="121"/> + <location filename="../decodervorbisfactory.cpp" line="126"/> <source>Writen by: Ilya Kotov <forkotov02@hotmail.ru></source> <translation>Autore: Ilya Kotov <forkotov02@hotmail.ru></translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="122"/> + <location filename="../decodervorbisfactory.cpp" line="127"/> <source>Source code based on mq3 progect</source> <translation>Codice sorgente basato sul Progetto mq3</translation> </message> diff --git a/src/plugins/Input/vorbis/translations/vorbis_plugin_lt.ts b/src/plugins/Input/vorbis/translations/vorbis_plugin_lt.ts index 9927a9660..b108fc784 100644 --- a/src/plugins/Input/vorbis/translations/vorbis_plugin_lt.ts +++ b/src/plugins/Input/vorbis/translations/vorbis_plugin_lt.ts @@ -14,22 +14,22 @@ <translation>Ogg Vorbis bylos</translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="119"/> + <location filename="../decodervorbisfactory.cpp" line="124"/> <source>About Ogg Vorbis Audio Plugin</source> <translation>Apie Ogg Vorbis audio įskiepį</translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="120"/> + <location filename="../decodervorbisfactory.cpp" line="125"/> <source>Qmmp Ogg Vorbis Audio Plugin</source> <translation>Qmmp Ogg Vorbis audio įskiepis</translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="121"/> + <location filename="../decodervorbisfactory.cpp" line="126"/> <source>Writen by: Ilya Kotov <forkotov02@hotmail.ru></source> <translation>Sukūrė: Ilya Kotov <forkotov02@hotmail.ru></translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="122"/> + <location filename="../decodervorbisfactory.cpp" line="127"/> <source>Source code based on mq3 progect</source> <translation>Išvesties kodas sukurtas mq3 pagrindu</translation> </message> diff --git a/src/plugins/Input/vorbis/translations/vorbis_plugin_pl.ts b/src/plugins/Input/vorbis/translations/vorbis_plugin_pl.ts index 2a7bb7df9..77e61caca 100644 --- a/src/plugins/Input/vorbis/translations/vorbis_plugin_pl.ts +++ b/src/plugins/Input/vorbis/translations/vorbis_plugin_pl.ts @@ -14,22 +14,22 @@ <translation>Pliki Ogg Vorbis</translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="119"/> + <location filename="../decodervorbisfactory.cpp" line="124"/> <source>About Ogg Vorbis Audio Plugin</source> <translation>O wtyczce Ogg Vorbis Audio</translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="120"/> + <location filename="../decodervorbisfactory.cpp" line="125"/> <source>Qmmp Ogg Vorbis Audio Plugin</source> <translation>Wtyczka Ogg Vorbis dla Qmmp</translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="121"/> + <location filename="../decodervorbisfactory.cpp" line="126"/> <source>Writen by: Ilya Kotov <forkotov02@hotmail.ru></source> <translation>Autor: Ilja Kotov <forkotov02@hotmail.ru></translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="122"/> + <location filename="../decodervorbisfactory.cpp" line="127"/> <source>Source code based on mq3 progect</source> <translation>Kod źródłowy oparty jest na projekcie mq3</translation> </message> diff --git a/src/plugins/Input/vorbis/translations/vorbis_plugin_ru.ts b/src/plugins/Input/vorbis/translations/vorbis_plugin_ru.ts index a24ab44e1..7e5bbd217 100644 --- a/src/plugins/Input/vorbis/translations/vorbis_plugin_ru.ts +++ b/src/plugins/Input/vorbis/translations/vorbis_plugin_ru.ts @@ -14,22 +14,22 @@ <translation>Файлы Ogg Vorbis</translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="119"/> + <location filename="../decodervorbisfactory.cpp" line="124"/> <source>About Ogg Vorbis Audio Plugin</source> <translation>Об аудио-модуле Ogg Vorbis</translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="120"/> + <location filename="../decodervorbisfactory.cpp" line="125"/> <source>Qmmp Ogg Vorbis Audio Plugin</source> <translation>Аудио-модуль Ogg Vorbis для Qmmp</translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="121"/> + <location filename="../decodervorbisfactory.cpp" line="126"/> <source>Writen by: Ilya Kotov <forkotov02@hotmail.ru></source> <translation>Разработчик: Илья Котов <forkotov02@hotmail.ru></translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="122"/> + <location filename="../decodervorbisfactory.cpp" line="127"/> <source>Source code based on mq3 progect</source> <translation>Исходный код основан на проекте mq3</translation> </message> diff --git a/src/plugins/Input/vorbis/translations/vorbis_plugin_tr.ts b/src/plugins/Input/vorbis/translations/vorbis_plugin_tr.ts index 28a6315ae..6cb38d590 100644 --- a/src/plugins/Input/vorbis/translations/vorbis_plugin_tr.ts +++ b/src/plugins/Input/vorbis/translations/vorbis_plugin_tr.ts @@ -14,22 +14,22 @@ <translation>Ogg Vorbis Dosyaları</translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="119"/> + <location filename="../decodervorbisfactory.cpp" line="124"/> <source>About Ogg Vorbis Audio Plugin</source> <translation>Ogg Vorbis Ses Eklentisi Hakkında</translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="120"/> + <location filename="../decodervorbisfactory.cpp" line="125"/> <source>Qmmp Ogg Vorbis Audio Plugin</source> <translation>Qmmp Ogg Vorbis Ses Eklentisi</translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="121"/> + <location filename="../decodervorbisfactory.cpp" line="126"/> <source>Writen by: Ilya Kotov <forkotov02@hotmail.ru></source> <translation>Yazan: Ilya Kotov <forkotov02@hotmail.ru></translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="122"/> + <location filename="../decodervorbisfactory.cpp" line="127"/> <source>Source code based on mq3 progect</source> <translation>Kaynak kodu mq3 projesi temellidir</translation> </message> diff --git a/src/plugins/Input/vorbis/translations/vorbis_plugin_uk_UA.ts b/src/plugins/Input/vorbis/translations/vorbis_plugin_uk_UA.ts index 93cbba72b..0038ba003 100644 --- a/src/plugins/Input/vorbis/translations/vorbis_plugin_uk_UA.ts +++ b/src/plugins/Input/vorbis/translations/vorbis_plugin_uk_UA.ts @@ -14,22 +14,22 @@ <translation>Файли Ogg Vorbis</translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="119"/> + <location filename="../decodervorbisfactory.cpp" line="124"/> <source>About Ogg Vorbis Audio Plugin</source> <translation>Про аудіо-модуль Ogg Vorbis</translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="120"/> + <location filename="../decodervorbisfactory.cpp" line="125"/> <source>Qmmp Ogg Vorbis Audio Plugin</source> <translation>Аудіо-модуль Ogg Vorbis для Qmmp</translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="121"/> + <location filename="../decodervorbisfactory.cpp" line="126"/> <source>Writen by: Ilya Kotov <forkotov02@hotmail.ru></source> <translation>Розробник: Ілля Котов <forkotov02@hotmail.ru></translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="122"/> + <location filename="../decodervorbisfactory.cpp" line="127"/> <source>Source code based on mq3 progect</source> <translation>Вихідний код базується на проекті mq3</translation> </message> diff --git a/src/plugins/Input/vorbis/translations/vorbis_plugin_zh_CN.ts b/src/plugins/Input/vorbis/translations/vorbis_plugin_zh_CN.ts index 5ac594d04..2344ea7b9 100644 --- a/src/plugins/Input/vorbis/translations/vorbis_plugin_zh_CN.ts +++ b/src/plugins/Input/vorbis/translations/vorbis_plugin_zh_CN.ts @@ -14,22 +14,22 @@ <translation>Ogg Vorbis 文件</translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="119"/> + <location filename="../decodervorbisfactory.cpp" line="124"/> <source>About Ogg Vorbis Audio Plugin</source> <translation>关于 Ogg Vorbis 音频插件</translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="120"/> + <location filename="../decodervorbisfactory.cpp" line="125"/> <source>Qmmp Ogg Vorbis Audio Plugin</source> <translation>Qmmp Ogg Vorbis 音频插件</translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="121"/> + <location filename="../decodervorbisfactory.cpp" line="126"/> <source>Writen by: Ilya Kotov <forkotov02@hotmail.ru></source> <translation>作者:Ilya Kotov <forkotov02@hotmail.ru></translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="122"/> + <location filename="../decodervorbisfactory.cpp" line="127"/> <source>Source code based on mq3 progect</source> <translation>源代码基于 mq3 项目</translation> </message> diff --git a/src/plugins/Input/vorbis/translations/vorbis_plugin_zh_TW.ts b/src/plugins/Input/vorbis/translations/vorbis_plugin_zh_TW.ts index 9b5d16014..2f8d0ab1f 100644 --- a/src/plugins/Input/vorbis/translations/vorbis_plugin_zh_TW.ts +++ b/src/plugins/Input/vorbis/translations/vorbis_plugin_zh_TW.ts @@ -14,22 +14,22 @@ <translation>Ogg Vorbis 檔案</translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="119"/> + <location filename="../decodervorbisfactory.cpp" line="124"/> <source>About Ogg Vorbis Audio Plugin</source> <translation>關於 Ogg Vorbis 聲訊插件</translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="120"/> + <location filename="../decodervorbisfactory.cpp" line="125"/> <source>Qmmp Ogg Vorbis Audio Plugin</source> <translation>Qmmp Ogg Vorbis 聲訊插件</translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="121"/> + <location filename="../decodervorbisfactory.cpp" line="126"/> <source>Writen by: Ilya Kotov <forkotov02@hotmail.ru></source> <translation>作者:Ilya Kotov <forkotov02@hotmail.ru></translation> </message> <message> - <location filename="../decodervorbisfactory.cpp" line="122"/> + <location filename="../decodervorbisfactory.cpp" line="127"/> <source>Source code based on mq3 progect</source> <translation>源碼基於 mq3 項目</translation> </message> diff --git a/src/plugins/Input/vorbis/vorbis.pro b/src/plugins/Input/vorbis/vorbis.pro index 68e61c464..f122ee0d8 100644 --- a/src/plugins/Input/vorbis/vorbis.pro +++ b/src/plugins/Input/vorbis/vorbis.pro @@ -2,10 +2,12 @@ include(../../plugins.pri) FORMS += HEADERS += decodervorbisfactory.h \ decoder_vorbis.h \ - vorbismetadatamodel.h + vorbismetadatamodel.h \ + replaygainreader.h SOURCES += decoder_vorbis.cpp \ decodervorbisfactory.cpp \ - vorbismetadatamodel.cpp + vorbismetadatamodel.cpp \ + replaygainreader.cpp TARGET = $$PLUGINS_PREFIX/Input/vorbis QMAKE_CLEAN = $$PLUGINS_PREFIX/Input/libvorbis.so INCLUDEPATH += ../../../ diff --git a/src/qmmp/decoder.cpp b/src/qmmp/decoder.cpp index d68939843..369f1e769 100644 --- a/src/qmmp/decoder.cpp +++ b/src/qmmp/decoder.cpp @@ -32,15 +32,14 @@ Decoder::Decoder(QIODevice *input) : m_input(input) Decoder::~Decoder() {} -void Decoder::configure(quint32 srate, int chan, int bps, const QMap<Qmmp::ReplayGainKey, double> &rg) +void Decoder::setReplayGainInfo(const QMap<Qmmp::ReplayGainKey, double> &rg) { - m_parameters = AudioParameters(srate, chan, bps); m_rg = rg; } void Decoder::configure(quint32 srate, int chan, int bps) { - configure(srate, chan, bps, QMap<Qmmp::ReplayGainKey, double>()); + m_parameters = AudioParameters(srate, chan, bps); } void Decoder::next() diff --git a/src/qmmp/decoder.h b/src/qmmp/decoder.h index 30fe76465..44a917ff8 100644 --- a/src/qmmp/decoder.h +++ b/src/qmmp/decoder.h @@ -66,6 +66,7 @@ public: AudioParameters audioParameters() const; QMap<Qmmp::ReplayGainKey, double> replayGainInfo() const; + void setReplayGainInfo(const QMap<Qmmp::ReplayGainKey,double> &rg); QIODevice *input(); /*! * Returns DecoderFactory pointer which supports file \b path or 0 if file \b path is unsupported @@ -110,14 +111,6 @@ protected: * @param srate Sample rate. * @param chan Number of channels. * @param bps Bits per sample. - * @param rg ReplayGaing information. - */ - void configure(quint32 srate, int chan, int bps, const QMap<Qmmp::ReplayGainKey,double> &rg); - /*! - * Use this function inside initialize() reimplementation to tell other plugins about audio parameters. - * @param srate Sample rate. - * @param chan Number of channels. - * @param bps Bits per sample. */ void configure(quint32 srate, int chan, int bps); |
