diff options
author | Hans Fugal <hans@fugal.net> | 2006-07-27 00:19:12 +0000 |
---|---|---|
committer | Hans Fugal <hans@fugal.net> | 2006-07-27 00:19:12 +0000 |
commit | 656d56b12d0b86f9140956badd9c9e11d791549b (patch) | |
tree | 295a9cfa1e8e983516cb3bb1cfafc8e17390509c /gtk2_ardour/region_gain_line.cc | |
parent | ed31a9a262bcda7ac2ae390793f2302247ddca94 (diff) |
r205@gandalf: fugalh | 2006-07-26 18:11:47 -0600
More Command conversions
git-svn-id: svn://localhost/ardour2/branches/undo@697 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/region_gain_line.cc')
-rw-r--r-- | gtk2_ardour/region_gain_line.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gtk2_ardour/region_gain_line.cc b/gtk2_ardour/region_gain_line.cc index 54b7fa5b56..526e8844ef 100644 --- a/gtk2_ardour/region_gain_line.cc +++ b/gtk2_ardour/region_gain_line.cc @@ -47,7 +47,8 @@ AudioRegionGainLine::start_drag (ControlPoint* cp, float fraction) { AutomationLine::start_drag(cp,fraction); if (!rv.region.envelope_active()) { - trackview.session().add_undo( bind( mem_fun(rv.region, &AudioRegion::set_envelope_active), false) ); + trackview.session().add_command(MementoUndoCommand<AudioRegion>(rv.region, rv.region.get_state())); + rv.region.set_envelope_active(false); } } @@ -63,9 +64,10 @@ AudioRegionGainLine::remove_point (ControlPoint& cp) XMLNode &before = get_state(); if (!rv.region.envelope_active()) { - trackview.session().add_undo( bind( mem_fun(rv.region, &AudioRegion::set_envelope_active), false) ); - trackview.session().add_redo( bind( mem_fun(rv.region, &AudioRegion::set_envelope_active), true) ); + XMLNode &before = rv.region.get_state(); rv.region.set_envelope_active(true); + XMLNode &after = rv.region.get_state(); + trackview.session().add_command(MementoCommand<AudioRegion>(rv.region, before, after)); } alist.erase (mr.start, mr.end); |