Fix crash when touching stale Automation Points
authorRobin Gareus <robin@gareus.org>
Fri, 15 Feb 2019 20:37:19 +0000 (21:37 +0100)
committerRobin Gareus <robin@gareus.org>
Fri, 15 Feb 2019 20:37:19 +0000 (21:37 +0100)
Undo/Redo allows to change a region's envelope without the envelope-list
changing (AutomationList::StateChanged is not emitted).

This also catches other operations where region-length can change while
the Envelope is visible. -- Normally when using the range or object tool
to modify a Region, the Envelope is not visible.

Without this change it was possible that the GUI shows automation
points that don't have a corresponding libardour representation:

e.g. select range, change tool to "draw", press "s" (split), undo,
click on any region-gain point.

gtk2_ardour/region_gain_line.cc

index 134809c9e5c5417d395e729c0f9b9801977346a4..9fae44636c02799f4dc6bffd90217fa23c540627 100644 (file)
@@ -110,4 +110,12 @@ AudioRegionGainLine::region_changed (const PropertyChange& what_changed)
        if (what_changed.contains (interesting_stuff)) {
                _time_converter->set_origin_b (rv.region()->position());
        }
+
+       interesting_stuff.clear ();
+       interesting_stuff.add (ARDOUR::Properties::start);
+       interesting_stuff.add (ARDOUR::Properties::length);
+
+       if (what_changed.contains (interesting_stuff)) {
+               reset ();
+       }
 }