summaryrefslogtreecommitdiff
path: root/libs/ardour/ladspa_plugin.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2006-07-07 23:51:30 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2006-07-07 23:51:30 +0000
commit8b46567e0677eb25c965ed46b80da8808fa33b2b (patch)
treef34e3d1cbdab142e7f155d981fee5fb56a82c431 /libs/ardour/ladspa_plugin.cc
parent6f2e8de6a05d9d52069fa1f95c3264b5f151df5f (diff)
id_t becomes a fully-fledged object, UUID's used for IDs, generic MIDI now owns bindings, MIDI binding concept removed from libardour itself in favor of generic Controllables
git-svn-id: svn://localhost/ardour2/trunk@669 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ladspa_plugin.cc')
-rw-r--r--libs/ardour/ladspa_plugin.cc94
1 files changed, 6 insertions, 88 deletions
diff --git a/libs/ardour/ladspa_plugin.cc b/libs/ardour/ladspa_plugin.cc
index 11001655d2..fa19a682e7 100644
--- a/libs/ardour/ladspa_plugin.cc
+++ b/libs/ardour/ladspa_plugin.cc
@@ -133,20 +133,9 @@ LadspaPlugin::init (void *mod, uint32_t index, jack_nframes_t rate)
}
}
- Plugin::setup_midi_controls ();
+ Plugin::setup_controls ();
latency_compute_run ();
-
- MIDI::Controllable *mcontrol;
-
- for (uint32_t i = 0; i < parameter_count(); ++i) {
- if (LADSPA_IS_PORT_INPUT(port_descriptor (i)) &&
- LADSPA_IS_PORT_CONTROL(port_descriptor (i))) {
- if ((mcontrol = get_nth_midi_control (i)) != 0) {
- mcontrol->midi_rebind (_session.midi_port(), 0);
- }
- }
- }
}
LadspaPlugin::~LadspaPlugin ()
@@ -318,17 +307,14 @@ LadspaPlugin::set_parameter (uint32_t which, float val)
shadow_data[which] = (LADSPA_Data) val;
ParameterChanged (which, val); /* EMIT SIGNAL */
- if (session().get_midi_feedback()) {
-
- if (which < parameter_count() && midi_controls[which]) {
- midi_controls[which]->send_feedback (val);
- }
+ if (which < parameter_count() && controls[which]) {
+ controls[which]->Changed ();
}
-
+
} else {
warning << string_compose (_("illegal parameter number used with plugin \"%1\". This may"
- "indicate a change in the plugin design, and presets may be"
- "invalid"), name())
+ "indicate a change in the plugin design, and presets may be"
+ "invalid"), name())
<< endmsg;
}
}
@@ -380,28 +366,6 @@ LadspaPlugin::get_state()
snprintf(buf, sizeof(buf), "%+f", shadow_data[i]);
child->add_property("value", string(buf));
root->add_child_nocopy (*child);
-
- MIDI::Controllable *pcontrol = get_nth_midi_control (i);
-
- if (pcontrol) {
-
- MIDI::eventType ev;
- MIDI::byte additional;
- MIDI::channel_t chn;
- XMLNode* midi_node;
-
- if (pcontrol->get_control_info (chn, ev, additional)) {
-
- midi_node = child->add_child ("midi-control");
-
- snprintf (buf, sizeof(buf), "0x%x", ev);
- midi_node->add_property ("event", buf);
- snprintf (buf, sizeof(buf), "%d", chn);
- midi_node->add_property ("channel", buf);
- snprintf (buf, sizeof(buf), "0x%x", additional);
- midi_node->add_property ("additional", buf);
- }
- }
}
}
@@ -452,52 +416,6 @@ LadspaPlugin::set_state(const XMLNode& node)
sscanf (port, "%" PRIu32, &port_id);
set_parameter (port_id, atof(data));
-
- XMLNodeList midi_kids;
- XMLNodeConstIterator iter;
-
- midi_kids = child->children ("midi-control");
-
- for (iter = midi_kids.begin(); iter != midi_kids.end(); ++iter) {
-
- child = *iter;
-
- MIDI::eventType ev = MIDI::on; /* initialize to keep gcc happy */
- MIDI::byte additional = 0; /* initialize to keep gcc happy */
- MIDI::channel_t chn = 0; /* initialize to keep gcc happy */
- bool ok = true;
- int xx;
-
- if ((prop = child->property ("event")) != 0) {
- sscanf (prop->value().c_str(), "0x%x", &xx);
- ev = (MIDI::eventType) xx;
- } else {
- ok = false;
- }
-
- if (ok && ((prop = child->property ("channel")) != 0)) {
- sscanf (prop->value().c_str(), "%d", &xx);
- chn = (MIDI::channel_t) xx;
- } else {
- ok = false;
- }
-
- if (ok && ((prop = child->property ("additional")) != 0)) {
- sscanf (prop->value().c_str(), "0x%x", &xx);
- additional = (MIDI::byte) xx;
- }
-
- if (ok) {
- MIDI::Controllable* pcontrol = get_nth_midi_control (port_id);
-
- if (pcontrol) {
- pcontrol->set_control_type (chn, ev, additional);
- }
-
- } else {
- error << string_compose(_("LADSPA LadspaPlugin MIDI control specification for port %1 is incomplete, so it has been ignored"), port) << endl;
- }
- }
}
latency_compute_run ();