r206@gandalf: fugalh | 2006-07-26 18:19:07 -0600
authorHans Fugal <hans@fugal.net>
Thu, 27 Jul 2006 00:19:27 +0000 (00:19 +0000)
committerHans Fugal <hans@fugal.net>
Thu, 27 Jul 2006 00:19:27 +0000 (00:19 +0000)
 A couple more Command conversions. Now all that's left are the half dozen
 or so global mementos.

git-svn-id: svn://localhost/ardour2/branches/undo@698 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/editor_markers.cc
gtk2_ardour/region_gain_line.cc

index 0610b6aa9f43c918b5d5558b2197bad07c553744..96504cd0f835e0c10dd2dcba62cab27214cd342d 100644 (file)
@@ -880,10 +880,11 @@ Editor::new_transport_marker_menu_set_loop ()
                session->add_command (MementoCommand<Locations>(*(session->locations()), before, after));
        }
        else {
-               session->add_undo (retype_return<void>(bind (mem_fun (*tll, &Location::set), tll->start(), tll->end())));
-               session->add_redo (retype_return<void>(bind (mem_fun (*tll, &Location::set), temp_location->start(), temp_location->end())));
+                XMLNode &before = tll->get_state();
                tll->set_hidden (false, this);
                tll->set (temp_location->start(), temp_location->end());
+                XMLNode &after = tll->get_state();
+                session->add_command (MementoCommand<Location>(*tll, before, after));
        }
        
        commit_reversible_command ();
index 526e8844ef930c0dc554f369e9d17c2d4fc7eb05..2faa63151bf9442a7d0a5dc26eb5444145b6ef6c 100644 (file)
@@ -81,8 +81,8 @@ void
 AudioRegionGainLine::end_drag (ControlPoint* cp) 
 {
        if (!rv.region.envelope_active()) {
-               trackview.session().add_redo( bind( mem_fun(rv.region, &AudioRegion::set_envelope_active), true) );
                rv.region.set_envelope_active(true);
+                trackview.session().add_command(MementoRedoCommand<AudioRegion>(rv.region, rv.region.get_state()));
        }
        AutomationLine::end_drag(cp);
 }