summaryrefslogtreecommitdiff
path: root/libs/ardour/plugin_insert.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-01-10 21:20:59 +0000
committerDavid Robillard <d@drobilla.net>2008-01-10 21:20:59 +0000
commitbb457bb960c5bd7ed538f9d31477293415739f68 (patch)
tree84324a63b87c03589cd165b9e474296eaebb4772 /libs/ardour/plugin_insert.cc
parent73dd9d37e7d715e0d78c0e51569968f9494dac7f (diff)
Merge libs/ardour and gtk2_ardour with 2.0-ongoing R2837.
git-svn-id: svn://localhost/ardour2/trunk@2883 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/plugin_insert.cc')
-rw-r--r--libs/ardour/plugin_insert.cc28
1 files changed, 6 insertions, 22 deletions
diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc
index 3faebd7179..4153f26e85 100644
--- a/libs/ardour/plugin_insert.cc
+++ b/libs/ardour/plugin_insert.cc
@@ -606,17 +606,10 @@ PluginInsert::get_state(void)
XMLNode&
PluginInsert::state (bool full)
{
- char buf[256];
XMLNode& node = Processor::state (full);
node.add_property ("type", _plugins[0]->state_node_name());
- snprintf(buf, sizeof(buf), "%s", _plugins[0]->name());
- node.add_property("id", string(buf));
- if (_plugins[0]->state_node_name() == "ladspa") {
- char buf[32];
- snprintf (buf, sizeof (buf), "%ld", _plugins[0]->get_info()->unique_id);
- node.add_property("unique-id", string(buf));
- }
+ node.add_property("unique-id", _plugins[0]->unique_id());
node.add_property("count", string_compose("%1", _plugins.size()));
node.add_child_nocopy (_plugins[0]->get_state());
@@ -648,7 +641,6 @@ PluginInsert::set_state(const XMLNode& node)
XMLNodeIterator niter;
XMLPropertyList plist;
const XMLProperty *prop;
- long unique = 0;
ARDOUR::PluginType type;
if ((prop = node.property ("type")) == 0) {
@@ -666,24 +658,16 @@ PluginInsert::set_state(const XMLNode& node)
<< endmsg;
return -1;
}
-
+
prop = node.property ("unique-id");
- if (prop != 0) {
- unique = atol(prop->value().c_str());
- }
-
- if ((prop = node.property ("id")) == 0) {
- error << _("XML node describing insert is missing the `id' field") << endmsg;
- return -1;
+ if (prop == 0) {
+ error << _("Plugin has no unique ID field") << endmsg;
+ return -1;
}
boost::shared_ptr<Plugin> plugin;
- if (unique != 0) {
- plugin = find_plugin (_session, "", unique, type);
- } else {
- plugin = find_plugin (_session, prop->value(), 0, type);
- }
+ plugin = find_plugin (_session, prop->value(), type);
if (plugin == 0) {
error << string_compose(_("Found a reference to a plugin (\"%1\") that is unknown.\n"