Fix master/monitor auto-connect
When initially using a different backend, the engine does not yet have a reference to the Session, and main busses were not connected.
This commit is contained in:
@@ -146,7 +146,7 @@ public:
|
||||
int disconnect (std::shared_ptr<Port>);
|
||||
int disconnect (std::string const&);
|
||||
int reestablish_ports ();
|
||||
int reconnect_ports ();
|
||||
int reconnect_ports (Session* s = nullptr);
|
||||
|
||||
bool connected (const std::string&);
|
||||
bool physically_connected (const std::string&);
|
||||
|
||||
@@ -920,7 +920,7 @@ PortManager::set_pretty_names (std::vector<std::string> const& port_names, DataT
|
||||
}
|
||||
|
||||
int
|
||||
PortManager::reconnect_ports ()
|
||||
PortManager::reconnect_ports (Session* s)
|
||||
{
|
||||
std::shared_ptr<Ports const> p = _ports.reader ();
|
||||
|
||||
@@ -928,7 +928,10 @@ PortManager::reconnect_ports ()
|
||||
|
||||
DEBUG_TRACE (DEBUG::Ports, string_compose ("reconnect %1 ports\n", p->size ()));
|
||||
|
||||
Session* s = AudioEngine::instance ()->session ();
|
||||
if (!s) {
|
||||
s = AudioEngine::instance ()->session ();
|
||||
}
|
||||
|
||||
if (s && s->master_out() && !s->master_out ()->output()->has_ext_connection()) {
|
||||
s->auto_connect_master_bus ();
|
||||
}
|
||||
|
||||
@@ -1670,7 +1670,7 @@ Session::hookup_io ()
|
||||
|
||||
/* Get everything connected */
|
||||
|
||||
AudioEngine::instance()->reconnect_ports ();
|
||||
AudioEngine::instance()->reconnect_ports (this);
|
||||
|
||||
AfterConnect (); /* EMIT SIGNAL */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user