diff options
author | Carl Hetherington <carl@carlh.net> | 2010-12-29 17:52:32 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-12-29 17:52:32 +0000 |
commit | 0dd2fb557c95f15672345e6368a478d25898a4d1 (patch) | |
tree | 8022453f0d85b0719018f9f1d85523fa59669035 /libs/ardour/audioengine.cc | |
parent | f31e5b5d714752484f3e5ea2a1228fdef0527154 (diff) |
Update mixer strip input/output button labels from the general JACK port connection / disconnection callback so that all changes are noticed. Fixes #3638.
git-svn-id: svn://localhost/ardour2/branches/3.0@8368 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/audioengine.cc')
-rw-r--r-- | libs/ardour/audioengine.cc | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc index 683dbca422..b2241f5c2f 100644 --- a/libs/ardour/audioengine.cc +++ b/libs/ardour/audioengine.cc @@ -394,10 +394,30 @@ AudioEngine::_registration_callback (jack_port_id_t /*id*/, int /*reg*/, void* a } void -AudioEngine::_connect_callback (jack_port_id_t /*id_a*/, jack_port_id_t /*id_b*/, int /*conn*/, void* arg) +AudioEngine::_connect_callback (jack_port_id_t id_a, jack_port_id_t id_b, int conn, void* arg) { AudioEngine* ae = static_cast<AudioEngine*> (arg); - ae->PortConnectedOrDisconnected (); /* EMIT SIGNAL */ + + GET_PRIVATE_JACK_POINTER (ae->_jack); + + jack_port_t* jack_port_a = jack_port_by_id (_priv_jack, id_a); + jack_port_t* jack_port_b = jack_port_by_id (_priv_jack, id_b); + + Port* port_a = 0; + Port* port_b = 0; + + boost::shared_ptr<Ports> pr = ae->ports.reader (); + Ports::iterator i = pr->begin (); + while (i != pr->end() && (port_a == 0 || port_b == 0)) { + if (jack_port_a == (*i)->_jack_port) { + port_a = *i; + } else if (jack_port_b == (*i)->_jack_port) { + port_b = *i; + } + ++i; + } + + ae->PortConnectedOrDisconnected (port_a, port_b, conn == 0 ? false : true); /* EMIT SIGNAL */ } void |