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: svn://localhost/ardour2/branches/2.0-ongoing@4892 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2009-03-25 17:39:53 +00:00
parent 4634029141
commit 3633378e1d
2 changed files with 4 additions and 4 deletions

View file

@ -523,14 +523,14 @@ LadspaPlugin::connect_and_run (vector<Sample*>& 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++;

View file

@ -425,11 +425,11 @@ LV2Plugin::connect_and_run (vector<Sample*>& 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++;
}
}