From c0c617902e03db2a75e8733dcc9982a575c2366a Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 1 Apr 2010 01:24:13 +0000 Subject: revisit setting up processors during route construction; remove several more XML-based constructors; don't put () parens around inactive plugin names (we have a checkbox); improve management of send, return and insert bitslot IDs; clean up Diskstream construction a bit more git-svn-id: svn://localhost/ardour2/branches/3.0@6819 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/port_insert.cc | 45 +++++++++++++++------------------------------ 1 file changed, 15 insertions(+), 30 deletions(-) (limited to 'libs/ardour/port_insert.cc') diff --git a/libs/ardour/port_insert.cc b/libs/ardour/port_insert.cc index fb688c6f84..f047ce2224 100644 --- a/libs/ardour/port_insert.cc +++ b/libs/ardour/port_insert.cc @@ -49,29 +49,11 @@ PortInsert::PortInsert (Session& s, boost::shared_ptr mm) _latency_detect = false; _latency_flush_frames = false; _measured_latency = 0; - - ProcessorCreated (this); /* EMIT SIGNAL */ -} - -PortInsert::PortInsert (Session& s, boost::shared_ptr mm, const XMLNode& node) - : IOProcessor (s, true, true, "unnamed port insert") - , _out (new Delivery (s, _output, mm, _name, Delivery::Insert)) - -{ - _mtdm = 0; - _latency_detect = false; - _latency_flush_frames = false; - _measured_latency = 0; - - if (set_state (node, Stateful::loading_state_version)) { - throw failed_constructor(); - } - - ProcessorCreated (this); /* EMIT SIGNAL */ } PortInsert::~PortInsert () { + _session.unmark_insert_id (bitslot); delete _mtdm; } @@ -179,6 +161,18 @@ PortInsert::set_state (const XMLNode& node, int version) XMLPropertyList plist; const XMLProperty *prop; + const XMLNode* insert_node = &node; + + // legacy sessions: search for child IOProcessor node + for (niter = nlist.begin(); niter != nlist.end(); ++niter) { + if ((*niter)->name() == "IOProcessor") { + insert_node = *niter; + break; + } + } + + Processor::set_state (*insert_node, version); + if ((prop = node.property ("type")) == 0) { error << _("XML node describing port insert is missing the `type' field") << endmsg; return -1; @@ -192,21 +186,12 @@ PortInsert::set_state (const XMLNode& node, int version) if ((prop = node.property ("bitslot")) == 0) { bitslot = _session.next_insert_id(); } else { + _session.unmark_insert_id (bitslot); sscanf (prop->value().c_str(), "%" PRIu32, &bitslot); _session.mark_insert_id (bitslot); } - const XMLNode* insert_node = &node; - - // legacy sessions: search for child IOProcessor node - for (niter = nlist.begin(); niter != nlist.end(); ++niter) { - if ((*niter)->name() == "IOProcessor") { - insert_node = *niter; - break; - } - } - - Processor::set_state (*insert_node, version); + set_name (string_compose (_("insert %1"), bitslot)); return 0; } -- cgit v1.2.3