summaryrefslogtreecommitdiff
path: root/libs/ardour/port.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-08-08 16:31:08 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-08-08 16:31:08 -0400
commitd90e2b42211ead2a38afd5590e2937992312795e (patch)
tree6abc6aa6571c1206a822e3ef4036458791cbaeaf /libs/ardour/port.cc
parentea7d89dd519caa7a45ad7a0e99bad14445513f3b (diff)
rationalize (a bit) engine start/stop/restart so that it is possible to start up, disconnect from JACK and then reconnect
Diffstat (limited to 'libs/ardour/port.cc')
-rw-r--r--libs/ardour/port.cc14
1 files changed, 12 insertions, 2 deletions
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<std::string> & 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) {