From 435f1da1de18bafe57e43e47fd8a6fc69fd8bab7 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Sat, 16 Jan 2010 15:33:17 +0000 Subject: updated audio engine git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1503 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/Effect/ladspa/ladspahelper.cpp | 12 +++++------- src/plugins/Effect/ladspa/ladspahelper.h | 4 ++-- src/plugins/Effect/ladspa/ladspahost.cpp | 5 +++-- src/plugins/Effect/ladspa/ladspahost.h | 3 ++- 4 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src/plugins/Effect/ladspa') diff --git a/src/plugins/Effect/ladspa/ladspahelper.cpp b/src/plugins/Effect/ladspa/ladspahelper.cpp index af683beca..ca34106f3 100644 --- a/src/plugins/Effect/ladspa/ladspahelper.cpp +++ b/src/plugins/Effect/ladspa/ladspahelper.cpp @@ -31,15 +31,13 @@ LADSPAHelper::LADSPAHelper() : Effect() LADSPAHelper::~LADSPAHelper() {} -ulong LADSPAHelper::process(char *in_data, const ulong size, char **out_data) +void LADSPAHelper::applyEffect(Buffer *b) { - LADSPAHost::instance()->applyEffect((qint16 *) in_data, size); - memcpy(*out_data, in_data, size); - return size; + LADSPAHost::instance()->applyEffect((qint16 *)b->data, b->nbytes); } -void LADSPAHelper::configure(quint32 freq, int chan, int res) +void LADSPAHelper::configure(quint32 freq, int chan, Qmmp::AudioFormat format) { - LADSPAHost::instance()->configure(freq,chan,res); - Effect::configure(freq, chan, res); + LADSPAHost::instance()->configure(freq,chan,format); + Effect::configure(freq, chan, format); } diff --git a/src/plugins/Effect/ladspa/ladspahelper.h b/src/plugins/Effect/ladspa/ladspahelper.h index 53983fa17..18a44dafd 100644 --- a/src/plugins/Effect/ladspa/ladspahelper.h +++ b/src/plugins/Effect/ladspa/ladspahelper.h @@ -32,8 +32,8 @@ public: LADSPAHelper(); virtual ~LADSPAHelper(); - ulong process(char *in_data, const ulong size, char **out_data); - void configure(quint32 freq, int chan, int res); + void applyEffect(Buffer *b); + void configure(quint32 freq, int chan, Qmmp::AudioFormat format); }; #endif // LADSPAHELPER_H diff --git a/src/plugins/Effect/ladspa/ladspahost.cpp b/src/plugins/Effect/ladspa/ladspahost.cpp index d9eef5281..2e84fe205 100644 --- a/src/plugins/Effect/ladspa/ladspahost.cpp +++ b/src/plugins/Effect/ladspa/ladspahost.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include "ladspahost.h" #ifndef PATH_MAX @@ -56,10 +57,10 @@ LADSPAHost::~LADSPAHost() } } -void LADSPAHost::configure(quint32 freq, int chan, int res) +void LADSPAHost::configure(quint32 freq, int chan, Qmmp::AudioFormat format) { m_chan = chan; - m_prec = res; + m_prec = AudioParameters::sampleSize(format); m_freq = freq; foreach(LADSPAEffect *e, m_effects) { diff --git a/src/plugins/Effect/ladspa/ladspahost.h b/src/plugins/Effect/ladspa/ladspahost.h index f97e54c08..2a35d7bbc 100644 --- a/src/plugins/Effect/ladspa/ladspahost.h +++ b/src/plugins/Effect/ladspa/ladspahost.h @@ -24,6 +24,7 @@ #include #include #include +#include #include "ladspa.h" class QWidget; @@ -83,7 +84,7 @@ public: virtual ~LADSPAHost(); int applyEffect(qint16 *d, int length); - void configure(quint32 freq, int chan, int res); + void configure(quint32 freq, int chan, Qmmp::AudioFormat format); QList plugins(); QList runningPlugins(); LADSPAEffect *addPlugin(LADSPAPlugin * plugin); -- cgit v1.2.3-13-gbd6f