13
0

Fix TCM requiring port-reconnect when engine restarts

An engine restart sends dis-connect messages for the reverse
port-mapping (after making the connection):

Connect: system:midi_capture_41a56f90 -> ardour:MTC in
Connect: system:capture_1 -> ardour:LTC in
DisConnect: ardour:MTC in -> system:midi_capture_41a56f90
DisConnect: ardour:LTC in -> system:capture_1

This lead to TransportMaster being marked as inactive.
This is likely an issue that should be fixed elsewhere, but in
case of JACK, we likely do not have control over this.
This commit is contained in:
Robin Gareus 2020-05-11 03:42:21 +02:00
parent a6ffc6213b
commit 58c5f75fc9
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
3 changed files with 7 additions and 11 deletions

View File

@ -129,9 +129,8 @@ LTC_TransportMaster::connection_handler (boost::weak_ptr<ARDOUR::Port> w0, std::
{
TransportMaster::connection_handler(w0, n0, w1, n1, con);
boost::shared_ptr<Port> p0 = w0.lock ();
boost::shared_ptr<Port> p1 = w1.lock ();
if (p0 == _port || p1 == _port) {
boost::shared_ptr<Port> p = w1.lock ();
if (p == _port) {
resync_latency (false);
}
}

View File

@ -94,9 +94,8 @@ MTC_TransportMaster::connection_handler (boost::weak_ptr<ARDOUR::Port> w0, std::
{
TransportMaster::connection_handler(w0, n0, w1, n1, con);
boost::shared_ptr<Port> p0 = w0.lock ();
boost::shared_ptr<Port> p1 = w1.lock ();
if (p0 == _port || p1 == _port) {
boost::shared_ptr<Port> p = w1.lock ();
if (p == _port) {
resync_latency (false);
}
}

View File

@ -164,16 +164,14 @@ TransportMaster::set_name (std::string const & str)
}
void
TransportMaster::connection_handler (boost::weak_ptr<ARDOUR::Port>, std::string name1, boost::weak_ptr<ARDOUR::Port>, std::string name2, bool yn)
TransportMaster::connection_handler (boost::weak_ptr<ARDOUR::Port>, std::string, boost::weak_ptr<ARDOUR::Port> w1, std::string, bool yn)
{
if (!_port) {
return;
}
const std::string fqn = ARDOUR::AudioEngine::instance()->make_port_name_non_relative (_port->name());
if (fqn == name1 || fqn == name2) {
boost::shared_ptr<Port> p = w1.lock ();
if (p == _port) {
/* it's about us */
/* XXX technically .. if the user makes an N->1 connection to