diff options
author | nick_m <mainsbridge@gmail.com> | 2015-09-14 05:24:28 +1000 |
---|---|---|
committer | nick_m <mainsbridge@gmail.com> | 2015-10-20 00:53:27 +1100 |
commit | 17294ab9ec2d0b826dce88930148fda0f5e978b3 (patch) | |
tree | fbcca294ff1009370e3a12366b5fd8df17abee06 /gtk2_ardour/editor_mouse.cc | |
parent | 03df442d0e5878868a7bc945cf23371271e67c42 (diff) |
Make control point selection more consistent.
- disallow simultaneous events via ControlList::editor_add ()
- clicking on an automation line selects the points that define it.
- don't 'flash' a region selection when using mousedraw mode.
- cp click selection resembles region selection.
- region gain points respect snap modifier (a la automation points).
Diffstat (limited to 'gtk2_ardour/editor_mouse.cc')
-rw-r--r-- | gtk2_ardour/editor_mouse.cc | 55 |
1 files changed, 53 insertions, 2 deletions
diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index ccf63839e2..b4e4cc81af 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -399,8 +399,9 @@ Editor::step_mouse_mode (bool next) } void -Editor::button_selection (ArdourCanvas::Item* /*item*/, GdkEvent* event, ItemType item_type) +Editor::button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type) { + /* in object/audition/timefx/gain-automation mode, any button press sets the selection if the object can be selected. this is a bit of hack, because @@ -472,6 +473,9 @@ Editor::button_selection (ArdourCanvas::Item* /*item*/, GdkEvent* event, ItemTyp switch (item_type) { case RegionItem: + if (eff_mouse_mode == MouseDraw) { + break; + } if (press) { if (eff_mouse_mode != MouseRange) { _mouse_changed_selection = set_selected_regionview_from_click (press, op); @@ -519,6 +523,51 @@ Editor::button_selection (ArdourCanvas::Item* /*item*/, GdkEvent* event, ItemTyp } break; + case GainLineItem: + case AutomationLineItem: + if (eff_mouse_mode != MouseRange) { + AutomationLine* al; + std::list<Selectable*> selectables; + uint32_t before, after; + framecnt_t const where = (framecnt_t) floor (event->button.x * samples_per_pixel); + + if ((al = reinterpret_cast<AutomationLine*> (item->get_data ("line")))) { + + if (!al->control_points_adjacent (where, before, after)) { + break; + } + } + + selectables.push_back (al->nth (before)); + selectables.push_back (al->nth (after)); + + switch (op) { + case Selection::Set: + if (press) { + selection->set (selectables); + _mouse_changed_selection = true; + } + break; + case Selection::Add: + if (press) { + selection->add (selectables); + _mouse_changed_selection = true; + } + break; + case Selection::Toggle: + if (press) { + selection->toggle (selectables); + _mouse_changed_selection = true; + } + break; + + case Selection::Extend: + /* XXX */ + break; + } + } + break; + case StreamItem: /* for context click, select track */ if (event->button.button == 3) { @@ -532,7 +581,9 @@ Editor::button_selection (ArdourCanvas::Item* /*item*/, GdkEvent* event, ItemTyp break; case AutomationTrackItem: - set_selected_track_as_side_effect (op); + if (eff_mouse_mode != MouseDraw) { + set_selected_track_as_side_effect (op); + } break; default: |