13
0

libardour infrastructure to suspend track-reordering side effects during a drag

This commit is contained in:
Paul Davis 2024-05-05 21:53:18 -06:00
parent 2ee9a7ab5f
commit 83bd2ee752
2 changed files with 33 additions and 1 deletions

View File

@ -402,7 +402,7 @@ public:
}
RecordState record_status() const {
return _record_status.load();
return _record_status.load();
}
bool actively_recording () const {
@ -1416,6 +1416,17 @@ public:
bool virtual_soundcheck() const;
PBD::Signal1<void,bool> VirtualSoundCheckChanged;
struct LivetraxAutoConnectSuspender {
LivetraxAutoConnectSuspender (Session& s) : session (s) { session.suspend_livetrax_auto_connect (); }
~LivetraxAutoConnectSuspender () { session.unsuspend_livetrax_auto_connect (); }
Session& session;
};
void suspend_livetrax_auto_connect ();
void unsuspend_livetrax_auto_connect ();
void update_track_numbers () { reassign_track_numbers (); }
protected:
friend class AudioEngine;
void set_block_size (pframes_t nframes);
@ -2431,6 +2442,8 @@ private:
void set_virtual_soundcheck (bool);
bool _virtual_soundcheck;
std::atomic<uint32_t> _no_livetrax_auto_connect;
};

View File

@ -351,6 +351,7 @@ Session::Session (AudioEngine &eng,
, tb_with_filled_slots (0)
, _no_file_format_reset (0)
, _virtual_soundcheck (false)
, _no_livetrax_auto_connect (0)
{
_suspend_save.store (0);
_playback_load.store (0);
@ -7757,9 +7758,27 @@ Session::cut_copy_section (timepos_t const& start_, timepos_t const& end_, timep
commit_reversible_command ();
}
void
Session::suspend_livetrax_auto_connect ()
{
_no_livetrax_auto_connect++;
}
void
Session::unsuspend_livetrax_auto_connect ()
{
if (_no_livetrax_auto_connect) {
_no_livetrax_auto_connect--;
}
}
void
Session::livetrax_auto_connect_route (std::shared_ptr<Route> route)
{
if (_no_livetrax_auto_connect) {
return;
}
ChanCount ignored;
auto_connect_route (route, true, true, ignored, ignored, ignored, ignored);
}