From 762831633532afb117892741c5f4ab3129a97c1e Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 10 May 2012 18:36:05 +0000 Subject: [PATCH] implement undo/redo for xfade trimmin git-svn-id: svn://localhost/ardour2/branches/3.0@12242 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor_drag.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index e9ab0d3a60..97590be1a9 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -4618,11 +4618,24 @@ CrossfadeEdgeDrag::finished (GdkEvent*, bool) new_length = ar->verify_xfade_bounds (len + _editor->unit_to_frame (distance), start); + _editor->begin_reversible_command ("xfade trim"); + ar->playlist()->clear_owned_changes (); + if (start) { ar->set_fade_in_length (new_length); } else { ar->set_fade_out_length (new_length); } + + /* Adjusting the xfade may affect other regions in the playlist, so we need + to get undo Commands from the whole playlist rather than just the + region. + */ + + vector cmds; + ar->playlist()->rdiff (cmds); + _editor->session()->add_commands (cmds); + } void