From 4ea2fdd5bd9883c13e7327e9e3344aa0870063a0 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 3 Nov 2021 15:07:46 -0600 Subject: [PATCH] Fix internal (aux) send to call ::use_target() when Session::AfterConnect is emitted --- libs/ardour/ardour/internal_send.h | 2 +- libs/ardour/internal_send.cc | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/libs/ardour/ardour/internal_send.h b/libs/ardour/ardour/internal_send.h index 2ba66ab39a..46402650ba 100644 --- a/libs/ardour/ardour/internal_send.h +++ b/libs/ardour/ardour/internal_send.h @@ -79,7 +79,7 @@ private: void send_from_going_away (); void send_to_going_away (); void send_to_property_changed (const PBD::PropertyChange&); - int connect_when_legal (); + int after_connect (); void init_gain (); int use_target (boost::shared_ptr, bool update_name = true); void target_io_changed (); diff --git a/libs/ardour/internal_send.cc b/libs/ardour/internal_send.cc index 6ae57d10cd..7676192a1e 100644 --- a/libs/ardour/internal_send.cc +++ b/libs/ardour/internal_send.cc @@ -421,12 +421,13 @@ InternalSend::set_state (const XMLNode& node, int version) * exist. */ - if (!IO::connecting_legal) { - IO::ConnectingLegal.connect_same_thread (connect_c, boost::bind (&InternalSend::connect_when_legal, this)); + if (_session.loading()) { + Session::AfterConnect.connect_same_thread (connect_c, boost::bind (&InternalSend::after_connect, this)); } else { - connect_when_legal (); + after_connect (); } } + allow_pan_reset (); if (!is_foldback ()) { @@ -439,7 +440,7 @@ InternalSend::set_state (const XMLNode& node, int version) } int -InternalSend::connect_when_legal () +InternalSend::after_connect () { connect_c.disconnect ();