Fix copying RegionFx Automation

This commit is contained in:
Robin Gareus 2024-05-03 14:44:49 +02:00
parent 233a82d5f9
commit 100ee72cec
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
1 changed files with 6 additions and 3 deletions

View File

@ -355,9 +355,12 @@ RegionFxPlugin::set_default_automation (timepos_t end)
{
for (auto const& i : _controls) {
std::shared_ptr<AutomationControl> ac = std::dynamic_pointer_cast<AutomationControl> (i.second);
assert (ac->alist ()->empty ());
ac->alist ()->fast_simple_add (timepos_t (time_domain ()), ac->normal ());
ac->alist ()->fast_simple_add (end, ac->normal ());
if (ac->alist ()->empty ()) {
ac->alist ()->fast_simple_add (timepos_t (time_domain ()), ac->normal ());
ac->alist ()->fast_simple_add (end, ac->normal ());
} else {
ac->alist ()->truncate_end (end);
}
}
}