summaryrefslogtreecommitdiff
path: root/gtk2_ardour/region_gain_line.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2010-03-02 18:05:26 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2010-03-02 18:05:26 +0000
commit17088ee3ea5af1e6174b098bb5bcfdaec6ebf9b0 (patch)
treecbf9fe8fb94212f9a50c6b760ebaac3b4a1bcec6 /gtk2_ardour/region_gain_line.cc
parenta5ab2e99e19d5f5d4c1f91f38cd774fefdf257dc (diff)
(1) remove most uses of MementoCommand for Playlist and Region (2) move frozen state from Region into Stateful, renamed "suspend property changes" (3) successive changes to a Property (scalar) after clear_history() do not keep resetting the old value (fixes region trim)
git-svn-id: svn://localhost/ardour2/branches/3.0@6720 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/region_gain_line.cc')
-rw-r--r--gtk2_ardour/region_gain_line.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/gtk2_ardour/region_gain_line.cc b/gtk2_ardour/region_gain_line.cc
index 827562524e..30e19ec24a 100644
--- a/gtk2_ardour/region_gain_line.cc
+++ b/gtk2_ardour/region_gain_line.cc
@@ -19,6 +19,7 @@
#include "evoral/Curve.hpp"
#include "pbd/memento_command.h"
+#include "pbd/stateful_diff_command.h"
#include "ardour/audioregion.h"
#include "ardour/session.h"
@@ -53,6 +54,8 @@ void
AudioRegionGainLine::start_drag_single (ControlPoint* cp, double x, float fraction)
{
AutomationLine::start_drag_single (cp, x, fraction);
+
+ // XXX Stateful need to capture automation curve data
if (!rv.audio_region()->envelope_active()) {
trackview.session()->add_command(new MementoCommand<AudioRegion>(*(rv.audio_region().get()), &rv.audio_region()->get_state(), 0));
@@ -72,10 +75,9 @@ AudioRegionGainLine::remove_point (ControlPoint& cp)
XMLNode &before = alist->get_state();
if (!rv.audio_region()->envelope_active()) {
- XMLNode &region_before = rv.audio_region()->get_state();
+ rv.audio_region()->clear_history ();
rv.audio_region()->set_envelope_active(true);
- XMLNode &region_after = rv.audio_region()->get_state();
- trackview.session()->add_command(new MementoCommand<AudioRegion>(*(rv.audio_region().get()), &region_before, &region_after));
+ trackview.session()->add_command(new StatefulDiffCommand (rv.audio_region()));
}
alist->erase (mr.start, mr.end);