From a904b3a5e97ad3568aae2591068fb7bd962779c0 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Sun, 27 Dec 2015 09:43:27 +0000 Subject: enabled bs2b plugin git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@5897 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/Effect/bs2b/bs2bplugin.cpp | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) (limited to 'src/plugins/Effect/bs2b/bs2bplugin.cpp') diff --git a/src/plugins/Effect/bs2b/bs2bplugin.cpp b/src/plugins/Effect/bs2b/bs2bplugin.cpp index 252f3e0ff..14c6f5db7 100644 --- a/src/plugins/Effect/bs2b/bs2bplugin.cpp +++ b/src/plugins/Effect/bs2b/bs2bplugin.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2009-2014 by Ilya Kotov * + * Copyright (C) 2009-2015 by Ilya Kotov * * Copyright (C) 2009 by Sebastian Pipping * * * * This program is free software; you can redistribute it and/or modify * @@ -41,36 +41,20 @@ Bs2bPlugin::~Bs2bPlugin() bs2b_close(m_bs2b_handler); } -#define CASE_BS2B(bitsPerSample, dataType, functionToCall, samples, out_data) \ - case bitsPerSample: \ - { \ - dataType * data = reinterpret_cast(out_data); \ - functionToCall(m_bs2b_handler, data, samples); \ - } \ - break; - void Bs2bPlugin::applyEffect(Buffer *b) { if(m_chan != 2) return; - uint samples = b->nbytes / audioParameters().sampleSize() / 2; + m_mutex.lock(); - switch (format()) - { - CASE_BS2B(Qmmp::PCM_S8, int8_t, bs2b_cross_feed_s8, samples, b->data) - CASE_BS2B(Qmmp::PCM_S16LE, int16_t, bs2b_cross_feed_s16le, samples, b->data) - //CASE_BS2B(Qmmp::PCM_S24LE, bs2b_int24_t, bs2b_cross_feed_s24le, samples, out_data) - CASE_BS2B(Qmmp::PCM_S32LE, int32_t, bs2b_cross_feed_s32le, samples, b->data) - default: - ; // noop - } + bs2b_cross_feed_f(m_bs2b_handler, b->data, b->samples/2); m_mutex.unlock(); } -void Bs2bPlugin::configure(quint32 freq, ChannelMap map, Qmmp::AudioFormat format) +void Bs2bPlugin::configure(quint32 freq, ChannelMap map) { m_chan = map.count(); - Effect::configure(freq, map, format); + Effect::configure(freq, map); bs2b_set_srate(m_bs2b_handler,freq); } -- cgit v1.2.3-13-gbd6f