diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-01-20 02:54:23 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-01-20 02:54:23 +0000 |
commit | 5de9a8f38b0e18317b2b23c5b8698d0d29eba12b (patch) | |
tree | 2068d91f2e1af148386e855cee397d332709f4c6 /gtk2_ardour/editor_drag.cc | |
parent | c2a93a9b3855f85830a715757b8c131113bc9a3e (diff) |
make mouse range mode do something interesting when in internal/note edit mode. not entirely finished because the usual modifiers to add/extend the selection don't work correctly. note that this works both on the scroomer (where the modifiers do work correctly) and in the track (where they do not)
git-svn-id: svn://localhost/ardour2/branches/3.0@11273 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_drag.cc')
-rw-r--r-- | gtk2_ardour/editor_drag.cc | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 25d1c878b8..5201d3346d 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -3112,6 +3112,7 @@ FeatureLineDrag::aborted (bool) RubberbandSelectDrag::RubberbandSelectDrag (Editor* e, ArdourCanvas::Item* i) : Drag (e, i) + , _vertical_only (false) { DEBUG_TRACE (DEBUG::Drags, "New RubberbandSelectDrag\n"); } @@ -3163,8 +3164,14 @@ RubberbandSelectDrag::motion (GdkEvent* event, bool) double x2 = _editor->frame_to_pixel (end); _editor->rubberband_rect->property_x1() = x1; + if (_vertical_only) { + /* fixed 10 pixel width */ + _editor->rubberband_rect->property_x2() = x1 + 10; + } else { + _editor->rubberband_rect->property_x2() = x2; + } + _editor->rubberband_rect->property_y1() = y1; - _editor->rubberband_rect->property_x2() = x2; _editor->rubberband_rect->property_y2() = y2; _editor->rubberband_rect->show(); @@ -4337,6 +4344,34 @@ MidiRubberbandSelectDrag::deselect_things () /* XXX */ } +MidiVerticalSelectDrag::MidiVerticalSelectDrag (Editor* e, MidiRegionView* rv) + : RubberbandSelectDrag (e, rv->get_canvas_frame ()) + , _region_view (rv) +{ + _vertical_only = true; +} + +void +MidiVerticalSelectDrag::select_things (int button_state, framepos_t x1, framepos_t x2, double y1, double y2, bool drag_in_progress) +{ + double const y = _region_view->midi_view()->y_position (); + + y1 = max (0.0, y1 - y); + y2 = max (0.0, y2 - y); + + _region_view->update_vertical_drag_selection ( + y1, + y2, + Keyboard::modifier_state_contains (button_state, Keyboard::TertiaryModifier) + ); +} + +void +MidiVerticalSelectDrag::deselect_things () +{ + /* XXX */ +} + EditorRubberbandSelectDrag::EditorRubberbandSelectDrag (Editor* e, ArdourCanvas::Item* i) : RubberbandSelectDrag (e, i) { |