From 86a594fe901cb2c691bd434e6addb4c14ffdb1d5 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 22 Mar 2021 02:14:30 +0100 Subject: [PATCH] Mitigate batch gain-changes #8576 This combines SessionEvent per playlist. Now per change there are "only" two SessionEvent::Overwrite events queued per playlist in the GUI thread for later processing the Butler. These are triggered by Playlist::ContentsChanged() and Playlist::LayeringChanged(), both of which trigger DiskIOProcessor::playlist_modified. (Previously there used to be two per region) --- gtk2_ardour/editor_ops.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 97e0c270f5..09d4236d9a 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -5516,6 +5516,12 @@ Editor::adjust_region_gain (bool up) } bool in_command = false; + for (RegionSelection::iterator r = rs.begin(); r != rs.end(); ++r) { + AudioRegionView* const arv = dynamic_cast(*r); + if (arv) { + arv->region()->playlist()->freeze (); + } + } for (RegionSelection::iterator r = rs.begin(); r != rs.end(); ++r) { AudioRegionView* const arv = dynamic_cast(*r); @@ -5545,6 +5551,13 @@ Editor::adjust_region_gain (bool up) if (in_command) { commit_reversible_command (); } + + for (RegionSelection::iterator r = rs.begin(); r != rs.end(); ++r) { + AudioRegionView* const arv = dynamic_cast(*r); + if (arv) { + arv->region()->playlist()->thaw (); + } + } } void