13
0

Fix route-templates with external sends

This commit is contained in:
Robin Gareus 2019-03-28 03:01:53 +01:00
parent 1fa2d15a9d
commit 0c368499f8
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 23 additions and 0 deletions

View File

@ -576,6 +576,21 @@ IO::set_state (const XMLNode& node, int version)
if (create_ports (node, version)) {
return -1;
}
if (_sendish && _direction == Output) {
/* ignore <Port name="..."> from XML for sends, but use the names
* ::ensure_ports_locked() creates port using ::build_legal_port_name()
* This is needed to properly restore connections when creating
* external sends from templates because the IO name changes.
*/
PortSet::iterator i = _ports.begin();
XMLNodeConstIterator x = node.children().begin();
for (; i != _ports.end(), x != node.children().end(); ++i, ++x) {
if ((*x)->name() == "Port") {
(*x)->remove_property (X_("name"));
(*x)->set_property (X_("name"), i->name());
}
}
}
// after create_ports, updates names
if (node.get_property ("pretty-name", name)) {

View File

@ -3439,6 +3439,14 @@ Session::new_route_from_template (uint32_t how_many, PresentationInfo::order_t i
(*i)->remove_property (X_("name"));
(*i)->set_property ("bitslot", bitslot);
(*i)->set_property ("name", name);
XMLNodeList io_kids = (*i)->children ();
for (XMLNodeList::iterator j = io_kids.begin(); j != io_kids.end(); ++j) {
if ((*j)->name() != X_("IO")) {
continue;
}
(*j)->remove_property (X_("name"));
(*j)->set_property ("name", name);
}
}
else if (type && type->value() == X_("intreturn")) {
(*i)->remove_property (X_("bitslot"));