summaryrefslogtreecommitdiff
path: root/libs/ardour/io.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2019-03-28 03:01:53 +0100
committerRobin Gareus <robin@gareus.org>2019-03-28 03:01:53 +0100
commit0c368499f844d79ac6d268f459cd3b00a35e19ca (patch)
tree9d04c922ceac26b0990e72bbd05e36e10086ab2d /libs/ardour/io.cc
parent1fa2d15a9d976dd8f7a71baefa090b99ef34f56c (diff)
Fix route-templates with external sends
Diffstat (limited to 'libs/ardour/io.cc')
-rw-r--r--libs/ardour/io.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc
index 5d6d343f2e..693dc07f23 100644
--- a/libs/ardour/io.cc
+++ b/libs/ardour/io.cc
@@ -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)) {