diff options
author | Carl Hetherington <carl@carlh.net> | 2010-08-26 01:44:11 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-08-26 01:44:11 +0000 |
commit | c243a02c998f585295f2179657673e2cf0fa4428 (patch) | |
tree | 1a18ca901b5f7fb1270938e2fb62f7e2636400ef /gtk2_ardour/editor_drag.cc | |
parent | df2fd9491904aba95e08e1e26552be609530ee83 (diff) |
Fix crossfade undo using the stateful diff system. Fixes #3257.
git-svn-id: svn://localhost/ardour2/branches/3.0@7694 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_drag.cc')
-rw-r--r-- | gtk2_ardour/editor_drag.cc | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index f2acf2e7a8..cef27660a6 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -1037,6 +1037,15 @@ RegionMoveDrag::finished_no_copy ( playlist->freeze (); } + /* this movement may result in a crossfade being modified, so we need to get undo + data from the playlist as well as the region. + */ + + r = modified_playlists.insert (playlist); + if (r.second) { + playlist->clear_changes (); + } + rv->region()->set_position (where, (void*) this); _editor->session()->add_command (new StatefulDiffCommand (rv->region())); @@ -1172,7 +1181,12 @@ void RegionMoveDrag::add_stateful_diff_commands_for_playlists (PlaylistSet const & playlists) { for (PlaylistSet::const_iterator i = playlists.begin(); i != playlists.end(); ++i) { - _editor->session()->add_command (new StatefulDiffCommand (*i)); + StatefulDiffCommand* c = new StatefulDiffCommand (*i); + if (!c->empty()) { + _editor->session()->add_command (new StatefulDiffCommand (*i)); + } else { + delete c; + } } } |