13
0

Report failed connections when reconnecting ports

This is needed to update the GUI (mixer-strip I/O buttons)
when the engine is re-started with different I/O.

When Port::reconnect() cannot re-connect the port (e.g.
because the corresponding hardware port is missing), the IO object
needs o be notified -> PostDisconnect() -> IO::disconnect_check.

While the port-manager re-establishes and re-connects port,
port_manager->running() == false, and Port::get_connections()
returns the Port::_connections set (not actual engine connections).
So _connections.clear() has to be called synchronize it with
the actual engine connection state.
This commit is contained in:
Robin Gareus 2021-02-04 04:40:53 +01:00
parent 25ab3b14c9
commit 3d44f39c09
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 4 additions and 1 deletions

View File

@ -566,6 +566,7 @@ Port::reconnect ()
for (std::set<string>::iterator i = _connections.begin(); i != _connections.end(); ++i) {
if (connect (*i)) {
_connections.clear ();
return -1;
}
}

View File

@ -772,7 +772,9 @@ PortManager::reconnect_ports ()
DEBUG_TRACE (DEBUG::Ports, string_compose ("reconnect %1 ports\n", p->size()));
for (Ports::iterator i = p->begin(); i != p->end(); ++i) {
i->second->reconnect ();
if (i->second->reconnect ()) {
PortConnectedOrDisconnected (i->second, i->first, boost::weak_ptr<Port>(), "", false);
}
}
return 0;