2 Copyright (C) 2009 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __gtk2_ardour_editor_drag_h_
21 #define __gtk2_ardour_editor_drag_h_
28 #include "ardour/types.h"
30 #include "editor_items.h"
37 class StatefulDiffCommand;
44 class MidiTimeAxisView;
48 /** Class to manage current drags */
53 DragManager (Editor* e);
56 bool motion_handler (GdkEvent *, bool);
57 bool window_motion_handler (GdkEvent *, bool);
61 void set (Drag *, GdkEvent *, Gdk::Cursor* c = 0);
62 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
63 bool end_grab (GdkEvent *);
64 bool have_item (ArdourCanvas::Item *) const;
66 void mark_double_click ();
68 /** @return true if an end drag or abort is in progress */
69 bool ending () const {
73 bool active () const {
74 return !_drags.empty ();
77 /** @return current pointer x position in canvas coordinates */
78 double current_pointer_x () const {
79 return _current_pointer_x;
82 /** @return current pointer y position in canvas coordinates */
83 double current_pointer_y () const {
84 return _current_pointer_y;
87 /** @return current pointer frame */
88 ARDOUR::framepos_t current_pointer_frame () const {
89 return _current_pointer_frame;
94 std::list<Drag*> _drags;
95 bool _ending; ///< true if end_grab or abort is in progress, otherwise false
96 double _current_pointer_x; ///< canvas-coordinate space x of the current pointer
97 double _current_pointer_y; ///< canvas-coordinate space y of the current pointer
98 ARDOUR::framepos_t _current_pointer_frame; ///< frame that the pointer is now at
99 bool _old_follow_playhead; ///< state of Editor::follow_playhead() before the drags started
102 /** Abstract base class for dragging of things within the editor */
106 Drag (Editor *, ArdourCanvas::Item *);
109 void set_manager (DragManager* m) {
113 /** @return the canvas item being dragged */
114 ArdourCanvas::Item* item () const {
118 void swap_grab (ArdourCanvas::Item *, Gdk::Cursor *, uint32_t);
119 bool motion_handler (GdkEvent*, bool);
122 ARDOUR::framepos_t adjusted_frame (ARDOUR::framepos_t, GdkEvent const *, bool snap = true) const;
123 ARDOUR::framepos_t adjusted_current_frame (GdkEvent const *, bool snap = true) const;
125 bool was_double_click() const { return _was_double_click; }
126 void set_double_click (bool yn) { _was_double_click = yn; }
128 /** Called to start a grab of an item.
129 * @param e Event that caused the grab to start.
130 * @param c Cursor to use, or 0.
132 virtual void start_grab (GdkEvent* e, Gdk::Cursor* c = 0);
134 virtual bool end_grab (GdkEvent *);
136 /** Called when a drag motion has occurred.
137 * @param e Event describing the motion.
138 * @param f true if this is the first movement, otherwise false.
140 virtual void motion (GdkEvent* e, bool f) = 0;
142 /** Called when a drag has finished.
143 * @param e Event describing the finish.
144 * @param m true if some movement occurred, otherwise false.
146 virtual void finished (GdkEvent* e, bool m) = 0;
148 /** Called to abort a drag and return things to how
149 * they were before it started.
150 * @param m true if some movement occurred, otherwise false.
152 virtual void aborted (bool m) = 0;
154 /** @param m Mouse mode.
155 * @return true if this drag should happen in this mouse mode.
157 virtual bool active (Editing::MouseMode m) {
158 return (m != Editing::MouseGain);
161 /** @return minimum number of frames (in x) and pixels (in y) that should be considered a movement */
162 virtual std::pair<ARDOUR::framecnt_t, int> move_threshold () const {
163 return std::make_pair (1, 1);
166 virtual bool allow_vertical_autoscroll () const {
170 /** @return true if x movement matters to this drag */
171 virtual bool x_movement_matters () const {
175 /** @return true if y movement matters to this drag */
176 virtual bool y_movement_matters () const {
180 /** Set up the _pointer_frame_offset */
181 virtual void setup_pointer_frame_offset () {
182 _pointer_frame_offset = 0;
187 double grab_x () const {
191 double grab_y () const {
195 ARDOUR::framepos_t raw_grab_frame () const {
196 return _raw_grab_frame;
199 ARDOUR::framepos_t grab_frame () const {
203 double last_pointer_x () const {
204 return _last_pointer_x;
207 double last_pointer_y () const {
208 return _last_pointer_y;
211 double last_pointer_frame () const {
212 return _last_pointer_frame;
215 boost::shared_ptr<ARDOUR::Region> add_midi_region (MidiTimeAxisView*);
217 void show_verbose_cursor_time (framepos_t);
218 void show_verbose_cursor_duration (framepos_t, framepos_t, double xoffset = 0);
219 void show_verbose_cursor_text (std::string const &);
221 Editor* _editor; ///< our editor
223 ArdourCanvas::Item* _item; ///< our item
224 /** Offset from the mouse's position for the drag to the start of the thing that is being dragged */
225 ARDOUR::framecnt_t _pointer_frame_offset;
226 bool _x_constrained; ///< true if x motion is constrained, otherwise false
227 bool _y_constrained; ///< true if y motion is constrained, otherwise false
228 bool _was_rolling; ///< true if the session was rolling before the drag started, otherwise false
232 bool _move_threshold_passed; ///< true if the move threshold has been passed, otherwise false
233 bool _was_double_click; ///< true if drag initiated by a double click event
234 double _grab_x; ///< trackview x of the grab start position
235 double _grab_y; ///< trackview y of the grab start position
236 double _last_pointer_x; ///< trackview x of the pointer last time a motion occurred
237 double _last_pointer_y; ///< trackview y of the pointer last time a motion occurred
238 ARDOUR::framepos_t _raw_grab_frame; ///< unsnapped frame that the mouse was at when start_grab was called, or 0
239 ARDOUR::framepos_t _grab_frame; ///< adjusted_frame that the mouse was at when start_grab was called, or 0
240 ARDOUR::framepos_t _last_pointer_frame; ///< adjusted_frame the last time a motion occurred
245 /** Container for details about a region being dragged */
249 DraggingView (RegionView *, RegionDrag *);
251 RegionView* view; ///< the view
252 /** index into RegionDrag::_time_axis_views of the view that this region is currently being displayed on,
253 * or -1 if it is not visible.
256 /** layer that this region is currently being displayed on. This is a double
257 rather than a layer_t as we use fractional layers during drags to allow the user
258 to indicate a new layer to put a region on.
261 double initial_y; ///< the initial y position of the view before any reparenting
262 framepos_t initial_position; ///< initial position of the region
263 framepos_t initial_end; ///< initial end position of the region
264 boost::shared_ptr<ARDOUR::Playlist> initial_playlist;
267 /** Abstract base class for drags that involve region(s) */
268 class RegionDrag : public Drag, public sigc::trackable
271 RegionDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &);
272 virtual ~RegionDrag () {}
276 RegionView* _primary; ///< the view that was clicked on (or whatever) to start the drag
277 std::list<DraggingView> _views; ///< information about all views that are being dragged
279 /** a list of the non-hidden TimeAxisViews sorted by editor order key */
280 std::vector<TimeAxisView*> _time_axis_views;
281 int find_time_axis_view (TimeAxisView *) const;
286 friend class DraggingView;
290 void region_going_away (RegionView *);
291 PBD::ScopedConnection death_connection;
295 /** Drags involving region motion from somewhere */
296 class RegionMotionDrag : public RegionDrag
300 RegionMotionDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, bool);
301 virtual ~RegionMotionDrag () {}
303 virtual void start_grab (GdkEvent *, Gdk::Cursor *);
304 virtual void motion (GdkEvent *, bool);
305 virtual void finished (GdkEvent *, bool);
306 virtual void aborted (bool);
308 /** @return true if the regions being `moved' came from somewhere on the canvas;
309 * false if they came from outside (e.g. from the region list).
311 virtual bool regions_came_from_canvas () const = 0;
315 double compute_x_delta (GdkEvent const *, ARDOUR::framepos_t *);
316 bool y_movement_allowed (int, double) const;
319 ARDOUR::framepos_t _last_frame_position; ///< last position of the thing being dragged
320 double _total_x_delta;
321 int _last_pointer_time_axis_view;
322 double _last_pointer_layer;
326 /** Drags to move (or copy) regions that are already shown in the GUI to
327 * somewhere different.
329 class RegionMoveDrag : public RegionMotionDrag
332 RegionMoveDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, bool, bool);
333 virtual ~RegionMoveDrag () {}
335 void motion (GdkEvent *, bool);
336 void finished (GdkEvent *, bool);
339 bool regions_came_from_canvas () const {
343 std::pair<ARDOUR::framecnt_t, int> move_threshold () const {
344 return std::make_pair (4, 4);
347 void setup_pointer_frame_offset ();
350 typedef std::set<boost::shared_ptr<ARDOUR::Playlist> > PlaylistSet;
352 void finished_no_copy (
355 ARDOUR::framecnt_t const
361 ARDOUR::framecnt_t const
364 RegionView* insert_region_into_playlist (
365 boost::shared_ptr<ARDOUR::Region>,
372 void remove_region_from_playlist (
373 boost::shared_ptr<ARDOUR::Region>,
374 boost::shared_ptr<ARDOUR::Playlist>,
375 PlaylistSet& modified_playlists
378 void add_stateful_diff_commands_for_playlists (PlaylistSet const &);
380 void collect_new_region_view (RegionView *);
383 RegionView* _new_region_view;
386 /** Drag to insert a region from somewhere */
387 class RegionInsertDrag : public RegionMotionDrag
390 RegionInsertDrag (Editor *, boost::shared_ptr<ARDOUR::Region>, RouteTimeAxisView*, ARDOUR::framepos_t);
392 void finished (GdkEvent *, bool);
395 bool regions_came_from_canvas () const {
400 /** Region drag in splice mode */
401 class RegionSpliceDrag : public RegionMoveDrag
404 RegionSpliceDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &);
406 void motion (GdkEvent *, bool);
407 void finished (GdkEvent *, bool);
411 /** Drags to create regions */
412 class RegionCreateDrag : public Drag
415 RegionCreateDrag (Editor *, ArdourCanvas::Item *, TimeAxisView *);
417 void motion (GdkEvent *, bool);
418 void finished (GdkEvent *, bool);
422 MidiTimeAxisView* _view;
423 boost::shared_ptr<ARDOUR::Region> _region;
426 /** Drags to resize MIDI notes */
427 class NoteResizeDrag : public Drag
430 NoteResizeDrag (Editor *, ArdourCanvas::Item *);
432 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
433 void motion (GdkEvent *, bool);
434 void finished (GdkEvent *, bool);
438 MidiRegionView* region;
443 /** Drags to move MIDI notes */
444 class NoteDrag : public Drag
447 NoteDrag (Editor*, ArdourCanvas::Item*);
449 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
450 void motion (GdkEvent *, bool);
451 void finished (GdkEvent *, bool);
456 ARDOUR::frameoffset_t total_dx () const;
457 int8_t total_dy () const;
459 MidiRegionView* _region;
461 double _cumulative_dx;
462 double _cumulative_dy;
467 class NoteCreateDrag : public Drag
470 NoteCreateDrag (Editor *, ArdourCanvas::Item *, MidiRegionView *);
473 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
474 void motion (GdkEvent *, bool);
475 void finished (GdkEvent *, bool);
479 double y_to_region (double) const;
480 framecnt_t grid_frames (framepos_t) const;
482 MidiRegionView* _region_view;
483 ArdourCanvas::Rectangle* _drag_rect;
487 /** Drag to move MIDI patch changes */
488 class PatchChangeDrag : public Drag
491 PatchChangeDrag (Editor *, PatchChange *, MidiRegionView *);
493 void motion (GdkEvent *, bool);
494 void finished (GdkEvent *, bool);
497 bool y_movement_matters () const {
501 void setup_pointer_frame_offset ();
504 MidiRegionView* _region_view;
505 PatchChange* _patch_change;
506 double _cumulative_dx;
509 /** Container for details about audio regions being dragged along with video */
513 AVDraggingView (RegionView *);
515 RegionView* view; ///< the view
516 framepos_t initial_position; ///< initial position of the region
519 /** Drag of video offset */
520 class VideoTimeLineDrag : public Drag
523 VideoTimeLineDrag (Editor *e, ArdourCanvas::Item *i);
525 void motion (GdkEvent *, bool);
526 void finished (GdkEvent *, bool);
527 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
529 bool y_movement_matters () const {
533 bool allow_vertical_autoscroll () const {
540 std::list<AVDraggingView> _views; ///< information about all audio that are being dragged along
543 ARDOUR::frameoffset_t _startdrag_video_offset;
544 ARDOUR::frameoffset_t _max_backwards_drag;
547 /** Drag to trim region(s) */
548 class TrimDrag : public RegionDrag
557 TrimDrag (Editor *, ArdourCanvas::Item *, RegionView*, std::list<RegionView*> const &, bool preserve_fade_anchor = false);
559 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
560 void motion (GdkEvent *, bool);
561 void finished (GdkEvent *, bool);
564 bool y_movement_matters () const {
568 void setup_pointer_frame_offset ();
572 Operation _operation;
574 bool _preserve_fade_anchor;
577 /** Meter marker drag */
578 class MeterMarkerDrag : public Drag
581 MeterMarkerDrag (Editor *, ArdourCanvas::Item *, bool);
583 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
584 void motion (GdkEvent *, bool);
585 void finished (GdkEvent *, bool);
588 bool allow_vertical_autoscroll () const {
592 bool y_movement_matters () const {
596 void setup_pointer_frame_offset ();
599 MeterMarker* _marker;
601 XMLNode* before_state;
604 /** Tempo marker drag */
605 class TempoMarkerDrag : public Drag
608 TempoMarkerDrag (Editor *, ArdourCanvas::Item *, bool);
610 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
611 void motion (GdkEvent *, bool);
612 void finished (GdkEvent *, bool);
615 bool allow_vertical_autoscroll () const {
619 bool y_movement_matters () const {
623 void setup_pointer_frame_offset ();
626 TempoMarker* _marker;
628 XMLNode* before_state;
632 /** Drag of the playhead cursor */
633 class CursorDrag : public Drag
636 CursorDrag (Editor *, EditorCursor&, bool);
638 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
639 void motion (GdkEvent *, bool);
640 void finished (GdkEvent *, bool);
643 bool active (Editing::MouseMode) {
647 bool allow_vertical_autoscroll () const {
651 bool y_movement_matters () const {
656 void fake_locate (framepos_t);
658 EditorCursor& _cursor;
659 bool _stop; ///< true to stop the transport on starting the drag, otherwise false
660 double _grab_zoom; ///< editor frames per unit when our grab started
663 /** Region fade-in drag */
664 class FadeInDrag : public RegionDrag
667 FadeInDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &);
669 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
670 void motion (GdkEvent *, bool);
671 void finished (GdkEvent *, bool);
674 bool y_movement_matters () const {
678 void setup_pointer_frame_offset ();
681 /** Region fade-out drag */
682 class FadeOutDrag : public RegionDrag
685 FadeOutDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &);
687 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
688 void motion (GdkEvent *, bool);
689 void finished (GdkEvent *, bool);
692 bool y_movement_matters () const {
696 void setup_pointer_frame_offset ();
700 class MarkerDrag : public Drag
703 MarkerDrag (Editor *, ArdourCanvas::Item *);
706 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
707 void motion (GdkEvent *, bool);
708 void finished (GdkEvent *, bool);
711 bool allow_vertical_autoscroll () const {
715 bool y_movement_matters () const {
719 void setup_pointer_frame_offset ();
722 void update_item (ARDOUR::Location *);
724 Marker* _marker; ///< marker being dragged
726 struct CopiedLocationMarkerInfo {
727 ARDOUR::Location* location;
728 std::vector<Marker*> markers;
730 CopiedLocationMarkerInfo (ARDOUR::Location* l, Marker* m);
733 typedef std::list<CopiedLocationMarkerInfo> CopiedLocationInfo;
734 CopiedLocationInfo _copied_locations;
735 ArdourCanvas::Points _points;
738 /** Control point drag */
739 class ControlPointDrag : public Drag
742 ControlPointDrag (Editor *, ArdourCanvas::Item *);
744 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
745 void motion (GdkEvent *, bool);
746 void finished (GdkEvent *, bool);
749 bool active (Editing::MouseMode m);
753 ControlPoint* _point;
754 double _fixed_grab_x;
755 double _fixed_grab_y;
756 double _cumulative_x_drag;
757 double _cumulative_y_drag;
759 uint32_t _final_index;
760 static double _zero_gain_fraction;
763 /** Gain or automation line drag */
764 class LineDrag : public Drag
767 LineDrag (Editor *e, ArdourCanvas::Item *i);
769 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
770 void motion (GdkEvent *, bool);
771 void finished (GdkEvent *, bool);
774 bool active (Editing::MouseMode) {
780 AutomationLine* _line;
781 double _fixed_grab_x;
782 double _fixed_grab_y;
785 double _cumulative_y_drag;
788 /** Transient feature line drags*/
789 class FeatureLineDrag : public Drag
792 FeatureLineDrag (Editor *e, ArdourCanvas::Item *i);
794 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
795 void motion (GdkEvent *, bool);
796 void finished (GdkEvent *, bool);
799 bool active (Editing::MouseMode) {
805 ArdourCanvas::Line* _line;
806 AudioRegionView* _arv;
808 double _region_view_grab_x;
809 double _cumulative_x_drag;
815 /** Dragging of a rubberband rectangle for selecting things */
816 class RubberbandSelectDrag : public Drag
819 RubberbandSelectDrag (Editor *, ArdourCanvas::Item *);
821 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
822 void motion (GdkEvent *, bool);
823 void finished (GdkEvent *, bool);
826 std::pair<ARDOUR::framecnt_t, int> move_threshold () const {
827 return std::make_pair (8, 1);
830 void do_select_things (GdkEvent *, bool);
832 /** Select some things within a rectangle.
833 * @param button_state The button state from the GdkEvent.
834 * @param x1 The left-hand side of the rectangle in session frames.
835 * @param x2 The right-hand side of the rectangle in session frames.
836 * @param y1 The top of the rectangle in trackview coordinates.
837 * @param y2 The bottom of the rectangle in trackview coordinates.
838 * @param drag_in_progress true if the drag is currently happening.
840 virtual void select_things (int button_state, framepos_t x1, framepos_t x2, double y1, double y2, bool drag_in_progress) = 0;
842 virtual void deselect_things () = 0;
848 /** A general editor RubberbandSelectDrag (for regions, automation points etc.) */
849 class EditorRubberbandSelectDrag : public RubberbandSelectDrag
852 EditorRubberbandSelectDrag (Editor *, ArdourCanvas::Item *);
854 void select_things (int, framepos_t, framepos_t, double, double, bool);
855 void deselect_things ();
858 /** A RubberbandSelectDrag for selecting MIDI notes */
859 class MidiRubberbandSelectDrag : public RubberbandSelectDrag
862 MidiRubberbandSelectDrag (Editor *, MidiRegionView *);
864 void select_things (int, framepos_t, framepos_t, double, double, bool);
865 void deselect_things ();
868 MidiRegionView* _region_view;
871 /** A RubberbandSelectDrag for selecting MIDI notes but with no horizonal component */
872 class MidiVerticalSelectDrag : public RubberbandSelectDrag
875 MidiVerticalSelectDrag (Editor *, MidiRegionView *);
877 void select_things (int, framepos_t, framepos_t, double, double, bool);
878 void deselect_things ();
881 MidiRegionView* _region_view;
884 /** Region drag in time-FX mode */
885 class TimeFXDrag : public RegionDrag
888 TimeFXDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &);
890 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
891 void motion (GdkEvent *, bool);
892 void finished (GdkEvent *, bool);
896 /** Scrub drag in audition mode */
897 class ScrubDrag : public Drag
900 ScrubDrag (Editor *, ArdourCanvas::Item *);
902 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
903 void motion (GdkEvent *, bool);
904 void finished (GdkEvent *, bool);
908 /** Drag in range select mode */
909 class SelectionDrag : public Drag
920 SelectionDrag (Editor *, ArdourCanvas::Item *, Operation);
922 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
923 void motion (GdkEvent *, bool);
924 void finished (GdkEvent *, bool);
927 void setup_pointer_frame_offset ();
930 Operation _operation;
933 int _original_pointer_time_axis;
934 int _last_pointer_time_axis;
935 std::list<TimeAxisView*> _added_time_axes;
936 bool _time_selection_at_start;
937 framepos_t start_at_start;
938 framepos_t end_at_start;
941 /** Range marker drag */
942 class RangeMarkerBarDrag : public Drag
947 CreateTransportMarker,
951 RangeMarkerBarDrag (Editor *, ArdourCanvas::Item *, Operation);
953 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
954 void motion (GdkEvent *, bool);
955 void finished (GdkEvent *, bool);
958 bool allow_vertical_autoscroll () const {
962 bool y_movement_matters () const {
967 void update_item (ARDOUR::Location *);
969 Operation _operation;
970 ArdourCanvas::Rectangle* _drag_rect;
974 /** Drag of rectangle to set zoom */
975 class MouseZoomDrag : public Drag
978 MouseZoomDrag (Editor *, ArdourCanvas::Item *);
980 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
981 void motion (GdkEvent *, bool);
982 void finished (GdkEvent *, bool);
985 std::pair<ARDOUR::framecnt_t, int> move_threshold () const {
986 return std::make_pair (4, 4);
993 /** Drag of a range of automation data (either on an automation track or region gain),
994 * changing value but not position.
996 class AutomationRangeDrag : public Drag
999 AutomationRangeDrag (Editor *, AutomationTimeAxisView *, std::list<ARDOUR::AudioRange> const &);
1000 AutomationRangeDrag (Editor *, AudioRegionView *, std::list<ARDOUR::AudioRange> const &);
1002 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1003 void motion (GdkEvent *, bool);
1004 void finished (GdkEvent *, bool);
1005 void aborted (bool);
1007 bool x_movement_matters () const {
1011 bool active (Editing::MouseMode) {
1016 void setup (std::list<boost::shared_ptr<AutomationLine> > const &);
1017 double y_fraction (boost::shared_ptr<AutomationLine>, double global_y_position) const;
1019 std::list<ARDOUR::AudioRange> _ranges;
1021 /** A line that is part of the drag */
1023 boost::shared_ptr<AutomationLine> line; ///< the line
1024 std::list<ControlPoint*> points; ///< points to drag on the line
1025 std::pair<ARDOUR::framepos_t, ARDOUR::framepos_t> range; ///< the range of all points on the line, in session frames
1026 XMLNode* state; ///< the XML state node before the drag
1027 double original_fraction; ///< initial y-fraction before the drag
1030 std::list<Line> _lines;
1032 bool _nothing_to_drag;
1035 /** Drag of one edge of an xfade
1037 class CrossfadeEdgeDrag : public Drag
1040 CrossfadeEdgeDrag (Editor*, AudioRegionView*, ArdourCanvas::Item*, bool start);
1042 void start_grab (GdkEvent*, Gdk::Cursor* c = 0);
1043 void motion (GdkEvent*, bool);
1044 void finished (GdkEvent*, bool);
1045 void aborted (bool);
1047 bool y_movement_matters () const {
1051 virtual std::pair<ARDOUR::framecnt_t, int> move_threshold () const {
1052 return std::make_pair (4, 4);
1056 AudioRegionView* arv;
1060 #endif /* __gtk2_ardour_editor_drag_h_ */