diff options
author | Carl Hetherington <carl@carlh.net> | 2011-11-16 20:11:33 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2011-11-16 20:11:33 +0000 |
commit | ec90b0ceb09e2c678a76ded3485e24bb37889801 (patch) | |
tree | 6c7d5773fa69e2bcdcee08d45f1aaacca2761e4d /gtk2_ardour/editor_drag.h | |
parent | 86d927b4ddbcedd1d6c120b1176aaef7352773cd (diff) |
Use a Drag class for midi note selection, so that it
gets autoscroll (#4474).
git-svn-id: svn://localhost/ardour2/branches/3.0@10650 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_drag.h')
-rw-r--r-- | gtk2_ardour/editor_drag.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/gtk2_ardour/editor_drag.h b/gtk2_ardour/editor_drag.h index 8bc52bc056..44b2d50767 100644 --- a/gtk2_ardour/editor_drag.h +++ b/gtk2_ardour/editor_drag.h @@ -761,6 +761,43 @@ public: std::pair<ARDOUR::framecnt_t, int> move_threshold () const { return std::make_pair (8, 1); } + + void do_select_things (GdkEvent *, bool); + + /** Select some things within a rectangle. + * @param button_state The button state from the GdkEvent. + * @param x1 The left-hand side of the rectangle in session frames. + * @param x2 The right-hand side of the rectangle in session frames. + * @param y1 The top of the rectangle in trackview coordinates. + * @param y2 The bottom of the rectangle in trackview coordinates. + * @param drag_in_progress true if the drag is currently happening. + */ + virtual void select_things (int button_state, framepos_t x1, framepos_t x2, double y1, double y2, bool drag_in_progress) = 0; + + virtual void deselect_things () = 0; +}; + +/** A general editor RubberbandSelectDrag (for regions, automation points etc.) */ +class EditorRubberbandSelectDrag : public RubberbandSelectDrag +{ +public: + EditorRubberbandSelectDrag (Editor *, ArdourCanvas::Item *); + + void select_things (int, framepos_t, framepos_t, double, double, bool); + void deselect_things (); +}; + +/** A RubberbandSelectDrag for selecting MIDI notes */ +class MidiRubberbandSelectDrag : public RubberbandSelectDrag +{ +public: + MidiRubberbandSelectDrag (Editor *, MidiRegionView *); + + void select_things (int, framepos_t, framepos_t, double, double, bool); + void deselect_things (); + +private: + MidiRegionView* _region_view; }; /** Region drag in time-FX mode */ |