#include <ardour/buffer_set.h>
#include <ardour/automation_event.h>
+#ifdef HAVE_SLV2
+#include <ardour/lv2_plugin.h>
+#endif
+
#ifdef VST_SUPPORT
#include <ardour/vst_plugin.h>
#endif
{
Glib::Mutex::Lock em (_session.engine().process_lock());
- IO::MoreChannels (max(input_streams(), output_streams()));
+ IO::PortCountChanged (max(input_streams(), output_streams()));
}
ProcessorCreated (this); /* EMIT SIGNAL */
{
Glib::Mutex::Lock em (_session.engine().process_lock());
- IO::MoreChannels (max(input_streams(), output_streams()));
+ IO::PortCountChanged (max(input_streams(), output_streams()));
}
}
PluginInsert::plugin_factory (boost::shared_ptr<Plugin> other)
{
boost::shared_ptr<LadspaPlugin> lp;
+#ifdef HAVE_SLV2
+ boost::shared_ptr<LV2Plugin> lv2p;
+#endif
#ifdef VST_SUPPORT
boost::shared_ptr<VSTPlugin> vp;
#endif
if ((lp = boost::dynamic_pointer_cast<LadspaPlugin> (other)) != 0) {
return boost::shared_ptr<Plugin> (new LadspaPlugin (*lp));
+#ifdef HAVE_SLV2
+ } else if ((lv2p = boost::dynamic_pointer_cast<LV2Plugin> (other)) != 0) {
+ return boost::shared_ptr<Plugin> (new LV2Plugin (*lv2p));
+#endif
#ifdef VST_SUPPORT
} else if ((vp = boost::dynamic_pointer_cast<VSTPlugin> (other)) != 0) {
return boost::shared_ptr<Plugin> (new VSTPlugin (*vp));
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());
XMLNodeIterator niter;
XMLPropertyList plist;
const XMLProperty *prop;
- long unique = 0;
ARDOUR::PluginType type;
if ((prop = node.property ("type")) == 0) {
if (prop->value() == X_("ladspa") || prop->value() == X_("Ladspa")) { /* handle old school sessions */
type = ARDOUR::LADSPA;
+ } else if (prop->value() == X_("lv2")) {
+ type = ARDOUR::LV2;
} else if (prop->value() == X_("vst")) {
type = ARDOUR::VST;
} else {
<< 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"