From ed43f1b9815e8af6870c5e54f64d3f188f76d216 Mon Sep 17 00:00:00 2001 From: paul Date: Wed, 25 Mar 2009 17:39:53 +0000 Subject: [PATCH] make LADSPA and LV2 plugins pay attention to "offset" in connect_and_run, again (see previous commit for the reason why - the first call in an automation process cycle could have a non-zero offset) git-svn-id: http://subversion.ardour.org/svn/ardour2/ardour2/branches/2.0-ongoing@4892 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/ladspa_plugin.cc | 4 ++-- libs/ardour/lv2_plugin.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/ardour/ladspa_plugin.cc b/libs/ardour/ladspa_plugin.cc index 9289899f5..6a27b8571 100644 --- a/libs/ardour/ladspa_plugin.cc +++ b/libs/ardour/ladspa_plugin.cc @@ -523,14 +523,14 @@ LadspaPlugin::connect_and_run (vector& bufs, uint32_t nbufs, int32_t& i while (port_index < parameter_count()) { if (LADSPA_IS_PORT_AUDIO (port_descriptor(port_index))) { if (LADSPA_IS_PORT_INPUT (port_descriptor(port_index))) { - connect_port (port_index, bufs[min((uint32_t) in_index,nbufs - 1)]); + connect_port (port_index, bufs[min((uint32_t) in_index,nbufs - 1)] + offset); //cerr << this << ' ' << name() << " @ " << offset << " inport " << in_index << " = buf " // << min((uint32_t)in_index,nbufs) << " = " << &bufs[min((uint32_t)in_index,nbufs)][offset] << endl; in_index++; } else if (LADSPA_IS_PORT_OUTPUT (port_descriptor (port_index))) { - connect_port (port_index, bufs[min((uint32_t) out_index,nbufs - 1)]); + connect_port (port_index, bufs[min((uint32_t) out_index,nbufs - 1)] + offset); // cerr << this << ' ' << name() << " @ " << offset << " outport " << out_index << " = buf " // << min((uint32_t)out_index,nbufs) << " = " << &bufs[min((uint32_t)out_index,nbufs)][offset] << endl; out_index++; diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc index 32160abb5..10648c36d 100644 --- a/libs/ardour/lv2_plugin.cc +++ b/libs/ardour/lv2_plugin.cc @@ -425,11 +425,11 @@ LV2Plugin::connect_and_run (vector& bufs, uint32_t nbufs, int32_t& in_i if (parameter_is_audio(port_index)) { if (parameter_is_input(port_index)) { slv2_instance_connect_port(_instance, port_index, - bufs[min((uint32_t)in_index, nbufs - 1)]); + bufs[min((uint32_t)in_index, nbufs - 1)] + offset); in_index++; } else if (parameter_is_output(port_index)) { slv2_instance_connect_port(_instance, port_index, - bufs[min((uint32_t)out_index, nbufs - 1)]); + bufs[min((uint32_t)out_index, nbufs - 1)] + offset); out_index++; } } -- 2.11.4.GIT