From 7f66b715397ed5debcf1cc29f47dcc8d917d519a Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 14 Nov 2008 22:14:15 +0000 Subject: Apply LV2 changes from 2.0. Completely and utterly untested. git-svn-id: svn://localhost/ardour2/branches/3.0@4178 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/ardour/lv2_plugin.h | 2 ++ libs/ardour/lv2_plugin.cc | 14 ++++++++++++++ libs/ardour/plugin_insert.cc | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) (limited to 'libs') diff --git a/libs/ardour/ardour/lv2_plugin.h b/libs/ardour/ardour/lv2_plugin.h index 978e52b446..7114428626 100644 --- a/libs/ardour/ardour/lv2_plugin.h +++ b/libs/ardour/ardour/lv2_plugin.h @@ -65,6 +65,8 @@ class LV2Plugin : public ARDOUR::Plugin SLV2Plugin slv2_plugin() { return _plugin; } SLV2UI slv2_ui() { return _ui; } SLV2Port slv2_port(uint32_t i) { return slv2_plugin_get_port_by_index(_plugin, i); } + + const char* port_symbol(uint32_t port); const LV2_Feature* const* features() { return _features; } diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc index 0260e02560..3b0a61b4f0 100644 --- a/libs/ardour/lv2_plugin.cc +++ b/libs/ardour/lv2_plugin.cc @@ -187,6 +187,19 @@ LV2Plugin::default_value (uint32_t port) return _defaults[port]; } +const char* +LV2Plugin::port_symbol (uint32_t index) +{ + SLV2Port port = slv2_plugin_get_port_by_index(_plugin, index); + if (!port) { + error << name() << ": Invalid port index " << index << endmsg; + } + + SLV2Value sym = slv2_port_get_symbol(_plugin, port); + return slv2_value_as_string(sym); +} + + void LV2Plugin::set_parameter (uint32_t which, float val) { @@ -251,6 +264,7 @@ LV2Plugin::get_state() child = new XMLNode("port"); snprintf(buf, sizeof(buf), "%u", i); child->add_property("number", string(buf)); + child->add_property("symbol", port_symbol(i)); snprintf(buf, sizeof(buf), "%+f", _shadow_data[i]); child->add_property("value", string(buf)); root->add_child_nocopy (*child); diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc index 7ed35dd1a7..e199dbcec5 100644 --- a/libs/ardour/plugin_insert.cc +++ b/libs/ardour/plugin_insert.cc @@ -816,7 +816,7 @@ PluginInsert::set_state(const XMLNode& node) if ((cprop = child->property("number")) != 0) { port = cprop->value().c_str(); } else { - warning << _("PluginInsert: Auto: no ladspa port number") << endmsg; + warning << _("PluginInsert: Auto: no plugin port number") << endmsg; continue; } -- cgit v1.2.3