diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 0f05949a05..5612ff3c0d 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -1425,14 +1425,15 @@ public: PBD::Signal1 VirtualSoundCheckChanged; struct LivetraxAutoConnectSuspender { - LivetraxAutoConnectSuspender (Session& s) : session (s) { session.suspend_livetrax_auto_connect (); } - ~LivetraxAutoConnectSuspender () { session.unsuspend_livetrax_auto_connect (); } + LivetraxAutoConnectSuspender (Session& s) : session (s), did_move (false) { session.suspend_livetrax_auto_connect (); } + ~LivetraxAutoConnectSuspender () { session.unsuspend_livetrax_auto_connect (did_move); } Session& session; + bool did_move; }; void suspend_livetrax_auto_connect (); - void unsuspend_livetrax_auto_connect (); + void unsuspend_livetrax_auto_connect (bool with_action); void update_track_numbers () { reassign_track_numbers (); } protected: diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 16988239f9..71d6b9e8fa 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -4652,6 +4652,7 @@ Session::reassign_track_numbers () int64_t tn = 0; int64_t bn = 0; uint32_t trigger_order = 0; + RouteList r (*(routes.reader ())); r.sort (Stripable::Sorter()); @@ -7824,12 +7825,12 @@ Session::suspend_livetrax_auto_connect () } void -Session::unsuspend_livetrax_auto_connect () +Session::unsuspend_livetrax_auto_connect (bool with_action) { if (_no_livetrax_auto_connect) { _no_livetrax_auto_connect--; - if (_no_livetrax_auto_connect == 0) { + if (_no_livetrax_auto_connect == 0 && with_action) { reassign_track_numbers (); } }