summaryrefslogtreecommitdiff
path: root/gtk2_ardour/global_port_matrix.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-09-05 21:39:43 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-09-05 21:39:43 -0400
commit94efddd240f0cef752bfba5e1ccb06eb952221d1 (patch)
tree6ef76faea8c524827941d3350c469591d3ef6d19 /gtk2_ardour/global_port_matrix.cc
parentbc1cc154dc5b67cd49bbca87537331af3328f85b (diff)
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.
Diffstat (limited to 'gtk2_ardour/global_port_matrix.cc')
-rw-r--r--gtk2_ardour/global_port_matrix.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/gtk2_ardour/global_port_matrix.cc b/gtk2_ardour/global_port_matrix.cc
index cdba7f5c27..80e2616bd8 100644
--- a/gtk2_ardour/global_port_matrix.cc
+++ b/gtk2_ardour/global_port_matrix.cc
@@ -19,6 +19,7 @@
#include <gtkmm/image.h>
#include <gtkmm/stock.h>
+
#include "global_port_matrix.h"
#include "utils.h"
@@ -118,15 +119,17 @@ GlobalPortMatrix::get_state (BundleChannel c[2]) const
if (!p && !q) {
/* two non-Ardour ports; things are slightly more involved */
- /* XXX: is this the easiest way to do this? */
- /* XXX: isn't this very inefficient? */
+
+ /* get a port handle for one of them .. */
PortEngine::PortHandle ph = AudioEngine::instance()->port_engine().get_port_by_name (*i);
if (!ph) {
return PortMatrixNode::NOT_ASSOCIATED;
}
- if (AudioEngine::instance()->port_engine().connected (ph)) {
+ /* see if it is connected to the other one ... */
+
+ if (AudioEngine::instance()->port_engine().connected_to (ph, *j, false)) {
return PortMatrixNode::ASSOCIATED;
}