#include <lrdf.h>
-#include <pbd/compose.h>
-#include <pbd/error.h>
-#include <pbd/xml++.h>
+#include "pbd/compose.h"
+#include "pbd/error.h"
+#include "pbd/xml++.h"
-#include <midi++/manager.h>
+#include "midi++/manager.h"
-#include <ardour/ardour.h>
-#include <ardour/session.h>
-#include <ardour/audioengine.h>
-#include <ardour/ladspa_plugin.h>
-#include <ardour/buffer_set.h>
+#include "ardour/ardour.h"
+#include "ardour/session.h"
+#include "ardour/audioengine.h"
+#include "ardour/ladspa_plugin.h"
+#include "ardour/buffer_set.h"
+#include "ardour/audio_buffer.h"
-#include <pbd/stl_delete.h>
+#include "pbd/stl_delete.h"
#include "i18n.h"
#include <locale.h>
// dlclose (module);
- if (_control_data) {
- delete [] _control_data;
- }
-
- if (_shadow_data) {
- delete [] _shadow_data;
- }
+ delete [] _control_data;
+ delete [] _shadow_data;
}
string
if (which < _descriptor->PortCount) {
_shadow_data[which] = (LADSPA_Data) val;
#if 0
- ParameterChanged (Parameter(PluginAutomation, which), val); /* EMIT SIGNAL */
+ ParameterChanged (Parameter(PluginAutomation, 0, which), val); /* EMIT SIGNAL */
if (which < parameter_count() && controls[which]) {
controls[which]->Changed ();
if (LADSPA_IS_PORT_INPUT(port_descriptor (i)) &&
LADSPA_IS_PORT_CONTROL(port_descriptor (i))){
- child = new XMLNode("port");
+ child = new XMLNode("Port");
snprintf(buf, sizeof(buf), "%u", i);
child->add_property("number", string(buf));
snprintf(buf, sizeof(buf), "%+f", _shadow_data[i]);
return -1;
}
- nodes = node.children ("port");
+ nodes = node.children ("Port");
for(iter = nodes.begin(); iter != nodes.end(); ++iter){
}
string
-LadspaPlugin::describe_parameter (Parameter which)
+LadspaPlugin::describe_parameter (Evoral::Parameter which)
{
if (which.type() == PluginAutomation && which.id() < parameter_count()) {
return port_names()[which.id()];
}
}
-set<Parameter>
+set<Evoral::Parameter>
LadspaPlugin::automatable () const
{
- set<Parameter> ret;
+ set<Evoral::Parameter> ret;
for (uint32_t i = 0; i < parameter_count(); ++i){
if (LADSPA_IS_PORT_INPUT(port_descriptor (i)) &&
LADSPA_IS_PORT_CONTROL(port_descriptor (i))){
- ret.insert (ret.end(), Parameter(PluginAutomation, i));
+ ret.insert (ret.end(), Evoral::Parameter(PluginAutomation, 0, i));
}
}
}
int
-LadspaPlugin::connect_and_run (BufferSet& bufs, uint32_t& in_index, uint32_t& out_index, nframes_t nframes, nframes_t offset)
+LadspaPlugin::connect_and_run (BufferSet& bufs,
+ ChanMapping in_map, ChanMapping out_map,
+ nframes_t nframes, nframes_t offset)
{
- uint32_t port_index = 0;
- cycles_t then, now;
-
- then = get_cycles ();
-
- const uint32_t nbufs = bufs.count().n_audio();
-
- while (port_index < parameter_count()) {
- if (LADSPA_IS_PORT_AUDIO (port_descriptor(port_index))) {
- if (LADSPA_IS_PORT_INPUT (port_descriptor(port_index))) {
- const size_t index = min(in_index, nbufs - 1);
- connect_port (port_index, bufs.get_audio(index).data(nframes, 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))) {
- const size_t index = min(out_index,nbufs - 1);
- connect_port (port_index, bufs.get_audio(index).data(nframes, 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++;
+ cycles_t now;
+ cycles_t then = get_cycles ();
+
+ uint32_t audio_in_index = 0;
+ uint32_t audio_out_index = 0;
+ for (uint32_t port_index = 0; port_index < parameter_count(); ++port_index) {
+ if (LADSPA_IS_PORT_AUDIO(port_descriptor(port_index))) {
+ if (LADSPA_IS_PORT_INPUT(port_descriptor(port_index))) {
+ const uint32_t buf_index = in_map.get(DataType::AUDIO, audio_in_index++);
+ connect_port(port_index, bufs.get_audio(buf_index).data(offset));
+ } else if (LADSPA_IS_PORT_OUTPUT(port_descriptor(port_index))) {
+ const uint32_t buf_index = out_map.get(DataType::AUDIO, audio_out_index++);
+ connect_port(port_index, bufs.get_audio(buf_index).data(offset));
}
}
- port_index++;
}
run_in_place (nframes);