diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2009-12-31 12:36:12 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2009-12-31 12:36:12 +0000 |
| commit | 2a9c818d2a36c525a5afe2db4dcda6ae43248dcf (patch) | |
| tree | 98f1847b5e67329e653e3aee8c29f06d30a82209 /src/plugins/Input/mpc/decoder_mpc.cpp | |
| parent | 610420006a1bfd0d0a3f6ea6518130ef98ba08ac (diff) | |
| download | qmmp-2a9c818d2a36c525a5afe2db4dcda6ae43248dcf.tar.gz qmmp-2a9c818d2a36c525a5afe2db4dcda6ae43248dcf.tar.bz2 qmmp-2a9c818d2a36c525a5afe2db4dcda6ae43248dcf.zip | |
musepack plugin: added replaygain support
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1460 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Input/mpc/decoder_mpc.cpp')
| -rw-r--r-- | src/plugins/Input/mpc/decoder_mpc.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/plugins/Input/mpc/decoder_mpc.cpp b/src/plugins/Input/mpc/decoder_mpc.cpp index 0cf6c1c59..b093b6910 100644 --- a/src/plugins/Input/mpc/decoder_mpc.cpp +++ b/src/plugins/Input/mpc/decoder_mpc.cpp @@ -21,11 +21,10 @@ #include <QObject> #include <QIODevice> - #include <qmmp/buffer.h> #include <qmmp/output.h> #include <qmmp/recycler.h> - +#include <math.h> #include "decoder_mpc.h" // this function used from xmms @@ -192,7 +191,7 @@ bool DecoderMPC::initialize() int chan = data()->info.channels; configure(data()->info.sample_freq, chan, 16); - + QMap<Qmmp::ReplayGainKey, double> rg_info; //replay gain information #ifdef MPC_OLD_API mpc_decoder_setup (&data()->decoder, &data()->reader); @@ -202,7 +201,18 @@ bool DecoderMPC::initialize() qWarning("DecoderMPC: cannot get info."); return FALSE; } + rg_info[Qmmp::REPLAYGAIN_ALBUM_GAIN] = data()->info.gain_album/100.0; + rg_info[Qmmp::REPLAYGAIN_TRACK_GAIN] = data()->info.gain_title/100.0; + rg_info[Qmmp::REPLAYGAIN_ALBUM_PEAK] = data()->info.peak_album/32768.0; + rg_info[Qmmp::REPLAYGAIN_TRACK_PEAK] = data()->info.peak_title/32768.0; +#else + rg_info[Qmmp::REPLAYGAIN_ALBUM_GAIN] = data()->info.gain_album/256.0; + rg_info[Qmmp::REPLAYGAIN_TRACK_GAIN] = data()->info.gain_title/256.0; + rg_info[Qmmp::REPLAYGAIN_ALBUM_PEAK] = pow(10, data()->info.peak_album/256.0/20.0); + rg_info[Qmmp::REPLAYGAIN_TRACK_PEAK] = pow(10, data()->info.peak_title/256.0/20.0); #endif + setReplayGainInfo(rg_info); + m_totalTime = mpc_streaminfo_get_length(&data()->info) * 1000; qDebug("DecoderMPC: initialize succes"); return TRUE; |
