From 94efddd240f0cef752bfba5e1ccb06eb952221d1 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 5 Sep 2013 21:39:43 -0400 Subject: fix a problem creating and displaying connected status for ports not owned by ardour (e.g. system:....) This was caused by using jack_port_get_connections() which will not return the correct status for ports owned by another JACK client. Because of the potential for deadlock by calling jack_port_get_all_connections(), an extra argument was added to several PortEngine:: API calls to specify whether the call is in a process-callback context, which defaults to true. The only place where false is passed is within the GlobalPortMatrix when we need to determine whether two non-ardour ports are connected. --- libs/ardour/port_manager.cc | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'libs/ardour/port_manager.cc') diff --git a/libs/ardour/port_manager.cc b/libs/ardour/port_manager.cc index 4e467e3008..1758ea4a3f 100644 --- a/libs/ardour/port_manager.cc +++ b/libs/ardour/port_manager.cc @@ -385,8 +385,13 @@ PortManager::connect (const string& source, const string& destination) } else if (dst) { ret = dst->connect (s); } else { - /* neither port is known to us, and this API isn't intended for use as a general patch bay */ - ret = -1; + /* neither port is known to us ...hand-off to the PortEngine + */ + if (_impl) { + ret = _impl->connect (s, d); + } else { + ret = -1; + } } if (ret > 0) { @@ -412,12 +417,17 @@ PortManager::disconnect (const string& source, const string& destination) boost::shared_ptr dst = get_port_by_name (d); if (src) { - ret = src->disconnect (d); + ret = src->disconnect (d); } else if (dst) { - ret = dst->disconnect (s); + ret = dst->disconnect (s); } else { - /* neither port is known to us, and this API isn't intended for use as a general patch bay */ - ret = -1; + /* neither port is known to us ...hand-off to the PortEngine + */ + if (_impl) { + ret = _impl->disconnect (s, d); + } else { + ret = -1; + } } return ret; } -- cgit v1.2.3