From 4c1d79af4a253ff8a031a7c07a6fdd8d92d0b0e3 Mon Sep 17 00:00:00 2001 From: nick_m Date: Wed, 17 Jun 2015 00:45:04 +1000 Subject: Unbreak region brush drag wrt undo, avoid some dangling commands in the gui - also allow moving of automation lines in internal mouse mode. - this is also a first pass at ensuring that if an operation does nothing, avoid an undo entry. --- gtk2_ardour/editor_drag.cc | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'gtk2_ardour/editor_drag.cc') diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 229b1ae1a0..d3ed92a97c 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -619,6 +619,11 @@ RegionMotionDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor) assert(_last_pointer_time_axis_view >= 0); _last_pointer_layer = tv.first->layer_display() == Overlaid ? 0 : tv.second; } + + if (_brushing) { + /* cross track dragging seems broken here. disabled for now. */ + _y_constrained = true; + } } double @@ -1223,13 +1228,13 @@ void RegionMoveDrag::motion (GdkEvent* event, bool first_move) { if (_copy && first_move) { - - if (_x_constrained) { + if (_x_constrained && !_brushing) { _editor->begin_reversible_command (Operations::fixed_time_region_copy); - } else { + } else if (!_brushing) { _editor->begin_reversible_command (Operations::region_copy); + } else if (_brushing) { + _editor->begin_reversible_command (Operations::drag_region_brush); } - /* duplicate the regionview(s) and region(s) */ list new_regionviews; @@ -1287,14 +1292,14 @@ RegionMoveDrag::motion (GdkEvent* event, bool first_move) } } else if (!_copy && first_move) { - - if (_x_constrained) { + if (_x_constrained && !_brushing) { _editor->begin_reversible_command (_("fixed time region drag")); - } else { + } else if (!_brushing) { _editor->begin_reversible_command (Operations::region_drag); + } else if (_brushing) { + _editor->begin_reversible_command (Operations::drag_region_brush); } } - RegionMotionDrag::motion (event, first_move); } @@ -1502,12 +1507,6 @@ RegionMoveDrag::finished_no_copy ( set views_to_update; RouteTimeAxisView* new_time_axis_view = 0; - if (_brushing) { - /* all changes were made during motion event handlers */ - _editor->commit_reversible_command (); - return; - } - typedef map, RouteTimeAxisView*> PlaylistMapping; PlaylistMapping playlist_mapping; @@ -1621,7 +1620,6 @@ RegionMoveDrag::finished_no_copy ( } rv->region()->set_position (where); - _editor->session()->add_command (new StatefulDiffCommand (rv->region())); } @@ -1670,7 +1668,7 @@ RegionMoveDrag::finished_no_copy ( /* write commands for the accumulated diffs for all our modified playlists */ add_stateful_diff_commands_for_playlists (modified_playlists); - + /* applies to _brushing */ _editor->commit_reversible_command (); /* We have futzed with the layering of canvas items on our streamviews. -- cgit v1.2.3