From 3cf1227421759861d4eb099c1e6cf3d043b4ca52 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 25 Sep 2023 23:55:33 +0200 Subject: [PATCH] Revert "in draw mode, mouse drags in automation tracks are always freehand drawing" This reverts commit c578695a645c0cb9388b09ce0fe82f6f7c598d88. When hovering over a control point there is still the "Fader" cursor shown. It is also handy to be able to directly modify a control-point right after adding it. A freehand draw operation can be still be initiated above, below, or left/right of a given control point. --- gtk2_ardour/automation_line.cc | 1 - gtk2_ardour/editor_mouse.cc | 15 ++++++++++----- gtk2_ardour/editor_selection.cc | 4 ---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc index adc61813e4..f13e38cbef 100644 --- a/gtk2_ardour/automation_line.cc +++ b/gtk2_ardour/automation_line.cc @@ -112,7 +112,6 @@ AutomationLine::AutomationLine (const string& name, line = new ArdourCanvas::PolyLine (group); CANVAS_DEBUG_NAME (line, "region gain envelope line"); line->set_data ("line", this); - line->set_data ("trackview", &trackview); line->set_outline_width (2.0); line->set_covers_threshold (4.0); diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index 6ffb10c38e..653e70245d 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -637,7 +637,7 @@ Editor::button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType it case ControlPointItem: /* for object/track exclusivity, we don't call set_selected_track_as_side_effect (op); */ - if (eff_mouse_mode == MouseContent) { + if (eff_mouse_mode != MouseRange) { if (event->button.button != 3) { _mouse_changed_selection |= set_selected_control_point_from_click (press, op); } else { @@ -1263,6 +1263,11 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT _drags->set (new LineDrag (this, item), event); return true; + case ControlPointItem: + _drags->set (new ControlPointDrag (this, item), event); + return true; + break; + case SelectionItem: { if (selection->time.empty ()) { @@ -1351,10 +1356,6 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT break; } - case ControlPointItem: - item = &(static_cast (item->get_data ("control_point"))->line().grab_item()); - /*fallthrough*/ - case AutomationLineItem: case AutomationTrackItem: { AutomationTimeAxisView* atv = static_cast (item->get_data ("trackview")); @@ -1364,6 +1365,10 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT } break; + case AutomationLineItem: + _drags->set (new LineDrag (this, item), event); + break; + case NoteItem: if ((note = reinterpret_cast(item->get_data ("notebase")))) { if (note->big_enough_to_trim() && note->mouse_near_ends()) { diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc index c4facf0362..ec8ae320d7 100644 --- a/gtk2_ardour/editor_selection.cc +++ b/gtk2_ardour/editor_selection.cc @@ -328,10 +328,6 @@ Editor::set_selected_control_point_from_click (bool press, Selection::Operation return false; } - if (mouse_mode != Editing::MouseContent) { - return false; - } - bool ret = false; switch (op) {