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)
This commit is contained in:
Robin Gareus 2021-03-22 02:14:30 +01:00
parent 0fc53d4683
commit 86a594fe90
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
1 changed files with 13 additions and 0 deletions

View File

@ -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<AudioRegionView*>(*r);
if (arv) {
arv->region()->playlist()->freeze ();
}
}
for (RegionSelection::iterator r = rs.begin(); r != rs.end(); ++r) {
AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*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<AudioRegionView*>(*r);
if (arv) {
arv->region()->playlist()->thaw ();
}
}
}
void