summaryrefslogtreecommitdiff
path: root/libs/ardour/bundle.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2012-05-21 21:50:29 +0000
committerCarl Hetherington <carl@carlh.net>2012-05-21 21:50:29 +0000
commitfa1e12b682e66ef6eb30de9aaad7ac919eb10634 (patch)
tree475105ababa9be82bef9957a7de3574621d01d08 /libs/ardour/bundle.cc
parent451a03d68a2a2b62753413a6bb06c0bbaa25fff7 (diff)
Slightly hacky improvement to embolden the labels of
connection matrix tabs when they have connections. git-svn-id: svn://localhost/ardour2/branches/3.0@12371 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/bundle.cc')
-rw-r--r--libs/ardour/bundle.cc28
1 files changed, 28 insertions, 0 deletions
diff --git a/libs/ardour/bundle.cc b/libs/ardour/bundle.cc
index dd4bacdff2..6180836bd2 100644
--- a/libs/ardour/bundle.cc
+++ b/libs/ardour/bundle.cc
@@ -440,6 +440,34 @@ Bundle::connected_to (boost::shared_ptr<Bundle> other, AudioEngine & engine)
return true;
}
+/** This must not be called in code executed as a response to a JACK event,
+ * as it uses jack_port_get_all_connections().
+ * @return true if any of this bundle's channels are connected to anything.
+ */
+bool
+Bundle::connected_to_anything (AudioEngine& engine)
+{
+ for (uint32_t i = 0; i < nchannels().n_total(); ++i) {
+ Bundle::PortList const & ports = channel_ports (i);
+
+ for (uint32_t j = 0; j < ports.size(); ++j) {
+ /* ports[j] may not be an Ardour port, so use JACK directly
+ rather than doing it with Port.
+ */
+ jack_port_t* jp = jack_port_by_name (engine.jack(), ports[j].c_str());
+ if (jp) {
+ const char ** c = jack_port_get_all_connections (engine.jack(), jp);
+ if (c) {
+ jack_free (c);
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+}
+
void
Bundle::set_ports_are_inputs ()
{