summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_drag.cc
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2015-06-17 00:45:04 +1000
committernick_m <mainsbridge@gmail.com>2015-06-17 09:54:22 +1000
commit4c1d79af4a253ff8a031a7c07a6fdd8d92d0b0e3 (patch)
tree9005cba5bbcbcd0072be32ecb95383fb6dfafd7b /gtk2_ardour/editor_drag.cc
parent15336d06e41fed130f1a0db9eee07b74546c7d92 (diff)
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.
Diffstat (limited to 'gtk2_ardour/editor_drag.cc')
-rw-r--r--gtk2_ardour/editor_drag.cc30
1 files changed, 14 insertions, 16 deletions
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<DraggingView> 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<RouteTimeAxisView*> 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<boost::shared_ptr<Playlist>, 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.