From d90e2b42211ead2a38afd5590e2937992312795e Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 8 Aug 2013 16:31:08 -0400 Subject: rationalize (a bit) engine start/stop/restart so that it is possible to start up, disconnect from JACK and then reconnect --- libs/ardour/port.cc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'libs/ardour/port.cc') diff --git a/libs/ardour/port.cc b/libs/ardour/port.cc index 7dc11c6d3d..d37761b6f2 100644 --- a/libs/ardour/port.cc +++ b/libs/ardour/port.cc @@ -88,6 +88,7 @@ void Port::drop () { if (_port_handle) { + DEBUG_TRACE (DEBUG::Ports, string_compose ("drop handle for port %1\n", name())); port_engine.unregister_port (_port_handle); _port_handle = 0; } @@ -120,12 +121,21 @@ Port::disconnect_all () bool Port::connected_to (std::string const & o) const { + if (!port_engine.connected()) { + return false; + } + return port_engine.connected_to (_port_handle, AudioEngine::instance()->make_port_name_non_relative (o)); } int Port::get_connections (std::vector & c) const { + if (!port_engine.connected()) { + c.insert (c.end(), _connections.begin(), _connections.end()); + return c.size(); + } + return port_engine.get_connections (_port_handle, c); } @@ -142,9 +152,9 @@ Port::connect (std::string const & other) } if (sends_output ()) { - port_engine.connect (our_name, other_name); + r = port_engine.connect (our_name, other_name); } else { - port_engine.connect (other_name, our_name); + r = port_engine.connect (other_name, our_name); } if (r == 0) { -- cgit v1.2.3