diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2018-06-11 09:51:44 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2018-06-11 09:51:44 +0000 |
| commit | 39c2837912e7b8b2519e390830bd090f4b4bf255 (patch) | |
| tree | 4fac36de253caf985fae3d20a62bffdf4dbd80b6 /src/plugins/Input | |
| parent | e9de5431a1a5e9d7808cae45c234bb5cb9fd473a (diff) | |
| download | qmmp-39c2837912e7b8b2519e390830bd090f4b4bf255.tar.gz qmmp-39c2837912e7b8b2519e390830bd090f4b4bf255.tar.bz2 qmmp-39c2837912e7b8b2519e390830bd090f4b4bf255.zip | |
removed old musepack library support
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@8015 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Input')
| -rw-r--r-- | src/plugins/Input/mpc/CMakeLists.txt | 11 | ||||
| -rw-r--r-- | src/plugins/Input/mpc/decoder_mpc.cpp | 78 | ||||
| -rw-r--r-- | src/plugins/Input/mpc/decoder_mpc.h | 7 |
3 files changed, 10 insertions, 86 deletions
diff --git a/src/plugins/Input/mpc/CMakeLists.txt b/src/plugins/Input/mpc/CMakeLists.txt index 3790a874b..57aadc83b 100644 --- a/src/plugins/Input/mpc/CMakeLists.txt +++ b/src/plugins/Input/mpc/CMakeLists.txt @@ -10,19 +10,12 @@ link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) # libmpc CHECK_INCLUDE_FILE_CXX(mpc/mpcdec.h MPC_HEADER_NEW_FOUND) -IF(NOT MPC_HEADER_NEW_FOUND) -CHECK_INCLUDE_FILE_CXX(mpcdec/mpcdec.h MPC_HEADER_OLD_FOUND) -ADD_DEFINITIONS(-DMPC_OLD_API) -ENDIF(NOT MPC_HEADER_NEW_FOUND) - FIND_LIBRARY(MPC_LIB NAME mpcdec PATHS /usr/lib /usr/lib32 /usr/local/lib /usr/local/lib32) -IF((MPC_HEADER_NEW_FOUND OR MPC_HEADER_OLD_FOUND) AND (NOT MPC_LIB MATCHES "^.*-NOTFOUND")) +IF(MPC_HEADER_NEW_FOUND AND (NOT MPC_LIB MATCHES "^.*-NOTFOUND")) SET(MPC_FOUND TRUE CACHE INTERNAL "mpc") MESSAGE(STATUS "Found MusePack: ${MPC_LIB}") -ELSE((MPC_HEADER_NEW_FOUND OR MPC_HEADER_OLD_FOUND) AND (NOT MPC_LIB MATCHES "^.*-NOTFOUND")) -MESSAGE(STATUS "Could not find MusePack library") -ENDIF((MPC_HEADER_NEW_FOUND OR MPC_HEADER_OLD_FOUND) AND (NOT MPC_LIB MATCHES "^.*-NOTFOUND")) +ENDIF(MPC_HEADER_NEW_FOUND AND (NOT MPC_LIB MATCHES "^.*-NOTFOUND")) include_directories(${TAGLIB_INCLUDE_DIRS}) link_directories(${TAGLIB_LIBRARY_DIRS}) diff --git a/src/plugins/Input/mpc/decoder_mpc.cpp b/src/plugins/Input/mpc/decoder_mpc.cpp index 4a776ffc6..85d7f4a92 100644 --- a/src/plugins/Input/mpc/decoder_mpc.cpp +++ b/src/plugins/Input/mpc/decoder_mpc.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2006-2016 by Ilya Kotov * + * Copyright (C) 2006-2018 by Ilya Kotov * * forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -28,63 +28,33 @@ // mpc callbacks -#ifdef MPC_OLD_API -static mpc_int32_t mpc_callback_read (void *data, void *buffer, mpc_int32_t size) -{ - DecoderMPC *dmpc = (DecoderMPC *) data; -#else static mpc_int32_t mpc_callback_read (mpc_reader *reader, void *buffer, mpc_int32_t size) { DecoderMPC *dmpc = (DecoderMPC *) reader->data; -#endif - qint64 res; - - res = dmpc->input()->read((char *)buffer, size); - - return res; + return dmpc->input()->read((char *)buffer, size); } -#ifdef MPC_OLD_API -static mpc_bool_t mpc_callback_seek (void *data, mpc_int32_t offset) -{ - DecoderMPC *dmpc = (DecoderMPC *) data; -#else + static mpc_bool_t mpc_callback_seek (mpc_reader *reader, mpc_int32_t offset) { DecoderMPC *dmpc = (DecoderMPC *) reader->data; -#endif return dmpc->input()->seek(offset); } -#ifdef MPC_OLD_API -static mpc_int32_t mpc_callback_tell (void *data) -{ - DecoderMPC *dmpc = (DecoderMPC *) data; -#else + static mpc_int32_t mpc_callback_tell (mpc_reader *reader) { DecoderMPC *dmpc = (DecoderMPC *) reader->data; -#endif return dmpc->input()->pos (); } -#ifdef MPC_OLD_API -static mpc_bool_t mpc_callback_canseek (void *data) -{ - DecoderMPC *dmpc = (DecoderMPC *) data; -#else + static mpc_bool_t mpc_callback_canseek (mpc_reader *reader) { DecoderMPC *dmpc = (DecoderMPC *) reader->data; -#endif return !dmpc->input()->isSequential () ; } -#ifdef MPC_OLD_API -static mpc_int32_t mpc_callback_get_size (void *data) -{ - DecoderMPC *dmpc = (DecoderMPC *) data; -#else + static mpc_int32_t mpc_callback_get_size (mpc_reader *reader) { DecoderMPC *dmpc = (DecoderMPC *) reader->data; -#endif return dmpc->input()->size(); } @@ -138,40 +108,19 @@ bool DecoderMPC::initialize() m_data->reader.get_size = mpc_callback_get_size; m_data->reader.data = this; -#ifdef MPC_OLD_API - mpc_streaminfo_init (&m_data->info); - if (mpc_streaminfo_read (&m_data->info, &m_data->reader) != ERROR_CODE_OK) - return false; -#else m_data->demuxer = mpc_demux_init (&m_data->reader); if (!m_data->demuxer) return false; mpc_demux_get_info (m_data->demuxer, &m_data->info); -#endif int chan = data()->info.channels; configure(data()->info.sample_freq, chan, Qmmp::PCM_FLOAT); QMap<Qmmp::ReplayGainKey, double> rg_info; //replay gain information -#ifdef MPC_OLD_API - mpc_decoder_setup (&data()->decoder, &data()->reader); - - //mpc_decoder_scale_output (&data()->decoder, 3.0); - if (!mpc_decoder_initialize (&data()->decoder, &data()->info)) - { - 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; @@ -191,15 +140,6 @@ int DecoderMPC::bitrate() const qint64 DecoderMPC::read(unsigned char *audio, qint64 maxSize) { -#ifdef MPC_OLD_API - mpc_uint32_t vbrAcc = 0; - mpc_uint32_t vbrUpd = 0; - MPC_SAMPLE_FORMAT buffer[MPC_DECODER_BUFFER_LENGTH]; - m_len = mpc_decoder_decode (&data()->decoder, buffer, &vbrAcc, &vbrUpd); - m_len *= data()->info.channels; - memcpy(audio, buffer, qMin(qint64(m_len * sizeof(float)), maxSize)); - m_bitrate = vbrUpd * data()->info.sample_freq / 1152000; -#else mpc_frame_info frame; mpc_status err; MPC_SAMPLE_FORMAT buffer[MPC_DECODER_BUFFER_LENGTH]; @@ -221,15 +161,11 @@ qint64 DecoderMPC::read(unsigned char *audio, qint64 maxSize) } } m_bitrate = frame.bits * data()->info.sample_freq / 1152000; -#endif return m_len * sizeof(float); } void DecoderMPC::seek(qint64 pos) { -#ifdef MPC_OLD_API - mpc_decoder_seek_seconds(&data()->decoder, pos/1000); -#else mpc_demux_seek_second(data()->demuxer, (double)pos/1000); -#endif + } diff --git a/src/plugins/Input/mpc/decoder_mpc.h b/src/plugins/Input/mpc/decoder_mpc.h index 4c61304e1..a3c3da372 100644 --- a/src/plugins/Input/mpc/decoder_mpc.h +++ b/src/plugins/Input/mpc/decoder_mpc.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2006-2016 by Ilya Kotov * + * Copyright (C) 2006-2018 by Ilya Kotov * * forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -21,12 +21,7 @@ #ifndef DECODER_MPC_H #define DECODER_MPC_H -#ifdef MPC_OLD_API -#include <mpcdec/mpcdec.h> -#else #include <mpc/mpcdec.h> -#endif - #include <qmmp/decoder.h> struct mpc_data |
