aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Input/mad/decoder_mad.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2009-12-26 22:41:24 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2009-12-26 22:41:24 +0000
commitdb21f3b3428d88b19d2f82ae933830153310a1f1 (patch)
tree76da52ae3cace5b6030f1967cba61302f09e420f /src/plugins/Input/mad/decoder_mad.cpp
parent2d1d2a4a807fced7d2b5e56998da67149bc2010e (diff)
downloadqmmp-db21f3b3428d88b19d2f82ae933830153310a1f1.tar.gz
qmmp-db21f3b3428d88b19d2f82ae933830153310a1f1.tar.bz2
qmmp-db21f3b3428d88b19d2f82ae933830153310a1f1.zip
enabled replaygain support (for mp3 file with ape tags only)
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1453 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Input/mad/decoder_mad.cpp')
-rw-r--r--src/plugins/Input/mad/decoder_mad.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/plugins/Input/mad/decoder_mad.cpp b/src/plugins/Input/mad/decoder_mad.cpp
index 3707abcbc..f76ff9350 100644
--- a/src/plugins/Input/mad/decoder_mad.cpp
+++ b/src/plugins/Input/mad/decoder_mad.cpp
@@ -8,21 +8,18 @@
#include <QtGui>
#include <taglib/id3v2header.h>
#include <taglib/tbytevector.h>
-
-#include "decoder_mad.h"
-#include "tagextractor.h"
#include <qmmp/buffer.h>
#include <qmmp/output.h>
-
#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(QIODevice *i)
- : Decoder(i)
+DecoderMAD::DecoderMAD(const QString &url, QIODevice *i) : Decoder(i)
{
m_inited = false;
m_totalTime = 0;
@@ -36,6 +33,7 @@ DecoderMAD::DecoderMAD(QIODevice *i)
m_output_at = 0;
m_skip_frames = 0;
m_eof = false;
+ m_url = url;
}
DecoderMAD::~DecoderMAD()
@@ -100,7 +98,14 @@ bool DecoderMAD::initialize()
mad_frame_mute (&frame);
stream.next_frame = 0;
stream.sync = 0;
- configure(m_freq, m_channels, 16);
+
+ if(!m_url.contains("://"))
+ {
+ ReplayGainReader rg(m_url);
+ configure(m_freq, m_channels, 16, rg.replayGainInfo());
+ }
+ else
+ configure(m_freq, m_channels, 16);
m_inited = TRUE;
return TRUE;