From 8f5c3fcddbc6c6991580863befa210e6fe58d28a Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 12 Apr 2021 23:07:43 +0200 Subject: [PATCH] Fix non-layered record-undo Previously an empty RegionList was used (auto-partition changes were never collected at rec-stop), furthermore auto-partitioned regions do not have an old ARDOUR::AutomationList (fade in/out) property (_have_old is false). --- libs/ardour/playlist.cc | 4 +--- libs/pbd/pbd/properties.h | 7 ++++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc index 1242b6800a..a9a1d18adf 100644 --- a/libs/ardour/playlist.cc +++ b/libs/ardour/playlist.cc @@ -699,10 +699,8 @@ Playlist::add_region (boost::shared_ptr region, samplepos_t position, fl samplepos_t pos = position; if (times == 1 && auto_partition) { - RegionList thawlist; partition_internal (pos - 1, (pos + region->length ()), true, rlock.thawlist); - for (RegionList::iterator i = thawlist.begin (); i != thawlist.end (); ++i) { - (*i)->resume_property_changes (); + for (RegionList::iterator i = rlock.thawlist.begin (); i != rlock.thawlist.end (); ++i) { _session.add_command (new StatefulDiffCommand (*i)); } } diff --git a/libs/pbd/pbd/properties.h b/libs/pbd/pbd/properties.h index 02b3320624..d4b5f64aea 100644 --- a/libs/pbd/pbd/properties.h +++ b/libs/pbd/pbd/properties.h @@ -405,9 +405,10 @@ public: } bool changed () const { - /* Expensive, but, hey; this requires operator!= in - our T - */ + if (!_old) { + return false; + } + /* Expensive, but, hey; this requires operator!= in our T */ return (*_old != *_current); }