From 576cdb08b5eab456eea91263fac1709dd7931a9d Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 1 May 2010 15:09:19 +0000 Subject: perhaps, just possibly, a working solo model. needs to be fixed so that connections to other JACK clients count as "physical" connections, so don't use this with ardour connected to other JACK apps just yet. Oh, this also invalidates existing a3 sessions again git-svn-id: svn://localhost/ardour2/branches/3.0@7033 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/port.cc | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'libs/ardour/port.cc') diff --git a/libs/ardour/port.cc b/libs/ardour/port.cc index 5897015b27..9cbdd14172 100644 --- a/libs/ardour/port.cc +++ b/libs/ardour/port.cc @@ -99,7 +99,8 @@ Port::get_connections (std::vector & c) const c.push_back (jc[i]); ++n; } - free (jc); + + jack_free (jc); } return n; @@ -148,7 +149,7 @@ Port::disconnect (std::string const & other) _connections.erase (other); } -return r; + return r; } @@ -290,3 +291,24 @@ Port::set_latency (nframes_t n) jack_port_set_latency (_jack_port, n); } +bool +Port::physically_connected () const +{ + const char** jc = jack_port_get_connections (_jack_port); + + if (jc) { + for (int i = 0; jc[i]; ++i) { + + jack_port_t* port = jack_port_by_name (_engine->jack(), jc[i]); + + if (port && (jack_port_flags (port) & JackPortIsPhysical)) { + jack_free (jc); + return true; + } + } + + jack_free (jc); + } + + return false; +} -- cgit v1.2.3