Ignore saved port-name when loading ctrl-surface state

In some cases old and/or conflicting port names were saved
with the session (e.g. "Faderport" for FP1,8). Loading old sessions
then merges this state into the config, which could lead to
port-registration failure when the surfaces was enabled.
This commit is contained in:
Robin Gareus 2021-04-17 02:07:09 +02:00
parent c212909282
commit e0a6aba28d
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
8 changed files with 16 additions and 0 deletions

View file

@ -663,6 +663,7 @@ GenericMidiControlProtocol::set_state (const XMLNode& node, int version)
if ((child = node.child (X_("Input"))) != 0) {
XMLNode* portnode = child->child (Port::state_node_name.c_str());
if (portnode) {
portnode->remove_property ("name");
boost::shared_ptr<ARDOUR::Port>(_input_port)->set_state (*portnode, version);
}
}
@ -670,6 +671,7 @@ GenericMidiControlProtocol::set_state (const XMLNode& node, int version)
if ((child = node.child (X_("Output"))) != 0) {
XMLNode* portnode = child->child (Port::state_node_name.c_str());
if (portnode) {
portnode->remove_property ("name");
boost::shared_ptr<ARDOUR::Port>(_output_port)->set_state (*portnode, version);
}
}