diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 4de1722ed8..5920e08afa 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -2880,8 +2880,7 @@ SelectionDrag::start_grab (GdkEvent* event, Gdk::Cursor*) if (_editor->clicked_axisview) { _editor->clicked_axisview->order_selection_trims (_item, true); } - Drag::start_grab (event, cursor); - cursor = _editor->trimmer_cursor; + Drag::start_grab (event, _editor->trimmer_cursor); start = _editor->selection->time[_editor->clicked_selection].start; _pointer_frame_offset = grab_frame() - start; break; @@ -2890,8 +2889,7 @@ SelectionDrag::start_grab (GdkEvent* event, Gdk::Cursor*) if (_editor->clicked_axisview) { _editor->clicked_axisview->order_selection_trims (_item, false); } - Drag::start_grab (event, cursor); - cursor = _editor->trimmer_cursor; + Drag::start_grab (event, _editor->trimmer_cursor); end = _editor->selection->time[_editor->clicked_selection].end; _pointer_frame_offset = grab_frame() - end; break; @@ -3554,12 +3552,26 @@ AutomationRangeDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor) boost::shared_ptr the_list = _line->the_list (); for (list::const_iterator j = _ranges.begin(); j != _ranges.end(); ++j) { + + /* fade into and out of the region that we're dragging; + 64 samples length plucked out of thin air. + */ + nframes64_t const h = (j->start + j->end) / 2; + nframes64_t a = j->start + 64; + if (a > h) { + a = h; + } + nframes64_t b = j->end - 64; + if (b < h) { + b = h; + } + the_list->add (j->start, the_list->eval (j->start)); _line->add_always_in_view (j->start); - the_list->add (j->start + 1, the_list->eval (j->start + 1)); - _line->add_always_in_view (j->start + 1); - the_list->add (j->end - 1, the_list->eval (j->end - 1)); - _line->add_always_in_view (j->end - 1); + the_list->add (a, the_list->eval (a)); + _line->add_always_in_view (a); + the_list->add (b, the_list->eval (b)); + _line->add_always_in_view (b); the_list->add (j->end, the_list->eval (j->end)); _line->add_always_in_view (j->end); } diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index 1b91947d40..453554f492 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -612,6 +612,28 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT break; } + if (_join_object_range_state == JOIN_OBJECT_RANGE_OBJECT) { + /* special case: allow trim of range selections in joined object mode; + in theory eff should equal MouseRange in this case, but it doesn't + because entering the range selection canvas item results in entered_regionview + being set to 0, so update_join_object_range_location acts as if we aren't + over a region. + */ + switch (item_type) { + case StartSelectionTrimItem: + assert (_drag == 0); + _drag = new SelectionDrag (this, item, SelectionDrag::SelectionStartTrim); + _drag->start_grab (event); + break; + + case EndSelectionTrimItem: + assert (_drag == 0); + _drag = new SelectionDrag (this, item, SelectionDrag::SelectionEndTrim); + _drag->start_grab (event); + break; + } + } + Editing::MouseMode eff = effective_mouse_mode (); switch (eff) { @@ -770,15 +792,8 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT case AutomationTrackItem: assert (_drag == 0); - - if (join_object_range_button.get_active()) { - /* smart "join" mode: drag automation */ - _drag = new AutomationRangeDrag (this, item, selection->time); - } else { - /* otherwise: rubberband drag to select automation points */ - _drag = new RubberbandSelectDrag (this, item); - } - + /* rubberband drag to select automation points */ + _drag = new RubberbandSelectDrag (this, item); _drag->start_grab (event); break; @@ -2681,7 +2696,7 @@ Editor::update_join_object_range_location (double x, double y) _join_object_range_state = JOIN_OBJECT_RANGE_NONE; return; } - + if (entered_regionview) { double cx = x;