diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-03-02 18:05:26 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-03-02 18:05:26 +0000 |
commit | 17088ee3ea5af1e6174b098bb5bcfdaec6ebf9b0 (patch) | |
tree | cbf9fe8fb94212f9a50c6b760ebaac3b4a1bcec6 /gtk2_ardour/editor_timefx.cc | |
parent | a5ab2e99e19d5f5d4c1f91f38cd774fefdf257dc (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/editor_timefx.cc')
-rw-r--r-- | gtk2_ardour/editor_timefx.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/gtk2_ardour/editor_timefx.cc b/gtk2_ardour/editor_timefx.cc index aab6b67658..fcd7e9baf4 100644 --- a/gtk2_ardour/editor_timefx.cc +++ b/gtk2_ardour/editor_timefx.cc @@ -26,6 +26,7 @@ #include "pbd/error.h" #include "pbd/pthread_utils.h" #include "pbd/memento_command.h" +#include "pbd/stateful_diff_command.h" #include <gtkmm2ext/utils.h> @@ -80,11 +81,10 @@ Editor::time_stretch (RegionSelection& regions, float fraction) MidiStretch stretch(*_session, request); begin_reversible_command ("midi stretch"); stretch.run(regions.front()->region()); - XMLNode &before = playlist->get_state(); + playlist->clear_history (); playlist->replace_region (regions.front()->region(), stretch.results[0], regions.front()->region()->position()); - XMLNode &after = playlist->get_state(); - _session->add_command (new MementoCommand<Playlist>(*playlist, &before, &after)); + _session->add_command (new StatefulDiffCommand (playlist)); commit_reversible_command (); } @@ -315,10 +315,9 @@ Editor::do_timefx (TimeFXDialog& dialog) in_command = true; } - XMLNode &before = playlist->get_state(); + playlist->clear_history (); playlist->replace_region (region, new_region, region->position()); - XMLNode &after = playlist->get_state(); - _session->add_command (new MementoCommand<Playlist>(*playlist, &before, &after)); + _session->add_command (new StatefulDiffCommand (playlist)); } i = tmp; |