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);
60 void set (Drag *, GdkEvent *, Gdk::Cursor* c = 0);
61 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
62 bool end_grab (GdkEvent *);
63 bool have_item (ArdourCanvas::Item *) const;
65 /** @return true if an end drag or abort is in progress */
66 bool ending () const {
70 bool active () const {
71 return !_drags.empty ();
74 /** @return current pointer x position in trackview coordinates */
75 double current_pointer_x () const {
76 return _current_pointer_x;
79 /** @return current pointer y position in trackview coordinates */
80 double current_pointer_y () const {
81 return _current_pointer_y;
84 /** @return current pointer frame */
85 ARDOUR::framepos_t current_pointer_frame () const {
86 return _current_pointer_frame;
91 std::list<Drag*> _drags;
92 bool _ending; ///< true if end_grab or abort is in progress, otherwise false
93 double _current_pointer_x; ///< trackview x of the current pointer
94 double _current_pointer_y; ///< trackview y of the current pointer
95 ARDOUR::framepos_t _current_pointer_frame; ///< frame that the pointer is now at
96 bool _old_follow_playhead; ///< state of Editor::follow_playhead() before the drags started
99 /** Abstract base class for dragging of things within the editor */
103 Drag (Editor *, ArdourCanvas::Item *);
106 void set_manager (DragManager* m) {
110 /** @return the canvas item being dragged */
111 ArdourCanvas::Item* item () const {
115 void swap_grab (ArdourCanvas::Item *, Gdk::Cursor *, uint32_t);
116 bool motion_handler (GdkEvent*, bool);
119 ARDOUR::framepos_t adjusted_frame (ARDOUR::framepos_t, GdkEvent const *, bool snap = true) const;
120 ARDOUR::framepos_t adjusted_current_frame (GdkEvent const *, bool snap = true) const;
122 /** Called to start a grab of an item.
123 * @param e Event that caused the grab to start.
124 * @param c Cursor to use, or 0.
126 virtual void start_grab (GdkEvent* e, Gdk::Cursor* c = 0);
128 virtual bool end_grab (GdkEvent *);
130 /** Called when a drag motion has occurred.
131 * @param e Event describing the motion.
132 * @param f true if this is the first movement, otherwise false.
134 virtual void motion (GdkEvent* e, bool f) = 0;
136 /** Called when a drag has finished.
137 * @param e Event describing the finish.
138 * @param m true if some movement occurred, otherwise false.
140 virtual void finished (GdkEvent* e, bool m) = 0;
142 /** Called to abort a drag and return things to how
143 * they were before it started.
144 * @param m true if some movement occurred, otherwise false.
146 virtual void aborted (bool m) = 0;
148 /** @param m Mouse mode.
149 * @return true if this drag should happen in this mouse mode.
151 virtual bool active (Editing::MouseMode m) {
152 return (m != Editing::MouseGain);
155 /** @return minimum number of frames (in x) and pixels (in y) that should be considered a movement */
156 virtual std::pair<ARDOUR::framecnt_t, int> move_threshold () const {
157 return std::make_pair (1, 1);
160 virtual bool allow_vertical_autoscroll () const {
164 /** @return true if x movement matters to this drag */
165 virtual bool x_movement_matters () const {
169 /** @return true if y movement matters to this drag */
170 virtual bool y_movement_matters () const {
174 /** Set up the _pointer_frame_offset */
175 virtual void setup_pointer_frame_offset () {
176 _pointer_frame_offset = 0;
181 double grab_x () const {
185 double grab_y () const {
189 ARDOUR::framepos_t raw_grab_frame () const {
190 return _raw_grab_frame;
193 ARDOUR::framepos_t grab_frame () const {
197 double last_pointer_x () const {
198 return _last_pointer_x;
201 double last_pointer_y () const {
202 return _last_pointer_y;
205 double last_pointer_frame () const {
206 return _last_pointer_frame;
209 boost::shared_ptr<ARDOUR::Region> add_midi_region (MidiTimeAxisView*);
211 void show_verbose_cursor_time (framepos_t);
212 void show_verbose_cursor_duration (framepos_t, framepos_t, double xoffset = 0);
213 void show_verbose_cursor_text (std::string const &);
215 Editor* _editor; ///< our editor
217 ArdourCanvas::Item* _item; ///< our item
218 /** Offset from the mouse's position for the drag to the start of the thing that is being dragged */
219 ARDOUR::framecnt_t _pointer_frame_offset;
220 bool _x_constrained; ///< true if x motion is constrained, otherwise false
221 bool _y_constrained; ///< true if y motion is constrained, otherwise false
222 bool _was_rolling; ///< true if the session was rolling before the drag started, otherwise false
226 bool _move_threshold_passed; ///< true if the move threshold has been passed, otherwise false
227 double _grab_x; ///< trackview x of the grab start position
228 double _grab_y; ///< trackview y of the grab start position
229 double _last_pointer_x; ///< trackview x of the pointer last time a motion occurred
230 double _last_pointer_y; ///< trackview y of the pointer last time a motion occurred
231 ARDOUR::framepos_t _raw_grab_frame; ///< unsnapped frame that the mouse was at when start_grab was called, or 0
232 ARDOUR::framepos_t _grab_frame; ///< adjusted_frame that the mouse was at when start_grab was called, or 0
233 ARDOUR::framepos_t _last_pointer_frame; ///< adjusted_frame the last time a motion occurred
238 /** Container for details about a region being dragged */
242 DraggingView (RegionView *, RegionDrag *);
244 RegionView* view; ///< the view
245 /** index into RegionDrag::_time_axis_views of the view that this region is currently being displayed on,
246 * or -1 if it is not visible.
249 /** layer that this region is currently being displayed on. This is a double
250 rather than a layer_t as we use fractional layers during drags to allow the user
251 to indicate a new layer to put a region on.
254 double initial_y; ///< the initial y position of the view before any reparenting
255 framepos_t initial_position; ///< initial position of the region
256 framepos_t initial_end; ///< initial end position of the region
257 boost::shared_ptr<ARDOUR::Playlist> initial_playlist;
260 /** Abstract base class for drags that involve region(s) */
261 class RegionDrag : public Drag, public sigc::trackable
264 RegionDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &);
265 virtual ~RegionDrag () {}
269 RegionView* _primary; ///< the view that was clicked on (or whatever) to start the drag
270 std::list<DraggingView> _views; ///< information about all views that are being dragged
272 /** a list of the non-hidden TimeAxisViews sorted by editor order key */
273 std::vector<TimeAxisView*> _time_axis_views;
274 int find_time_axis_view (TimeAxisView *) const;
279 friend class DraggingView;
283 void region_going_away (RegionView *);
284 PBD::ScopedConnection death_connection;
288 /** Drags involving region motion from somewhere */
289 class RegionMotionDrag : public RegionDrag
293 RegionMotionDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, bool);
294 virtual ~RegionMotionDrag () {}
296 virtual void start_grab (GdkEvent *, Gdk::Cursor *);
297 virtual void motion (GdkEvent *, bool);
298 virtual void finished (GdkEvent *, bool);
299 virtual void aborted (bool);
301 /** @return true if the regions being `moved' came from somewhere on the canvas;
302 * false if they came from outside (e.g. from the region list).
304 virtual bool regions_came_from_canvas () const = 0;
308 double compute_x_delta (GdkEvent const *, ARDOUR::framepos_t *);
309 bool y_movement_allowed (int, double) const;
312 ARDOUR::framepos_t _last_frame_position; ///< last position of the thing being dragged
313 double _total_x_delta;
314 int _last_pointer_time_axis_view;
315 double _last_pointer_layer;
319 /** Drags to move (or copy) regions that are already shown in the GUI to
320 * somewhere different.
322 class RegionMoveDrag : public RegionMotionDrag
325 RegionMoveDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, bool, bool);
326 virtual ~RegionMoveDrag () {}
328 void motion (GdkEvent *, bool);
329 void finished (GdkEvent *, bool);
332 bool regions_came_from_canvas () const {
336 std::pair<ARDOUR::framecnt_t, int> move_threshold () const {
337 return std::make_pair (4, 4);
340 void setup_pointer_frame_offset ();
343 typedef std::set<boost::shared_ptr<ARDOUR::Playlist> > PlaylistSet;
345 void finished_no_copy (
348 ARDOUR::framecnt_t const
354 ARDOUR::framecnt_t const
357 RegionView* insert_region_into_playlist (
358 boost::shared_ptr<ARDOUR::Region>,
365 void remove_region_from_playlist (
366 boost::shared_ptr<ARDOUR::Region>,
367 boost::shared_ptr<ARDOUR::Playlist>,
368 PlaylistSet& modified_playlists
371 void add_stateful_diff_commands_for_playlists (PlaylistSet const &);
373 void collect_new_region_view (RegionView *);
376 RegionView* _new_region_view;
379 /** Drag to insert a region from somewhere */
380 class RegionInsertDrag : public RegionMotionDrag
383 RegionInsertDrag (Editor *, boost::shared_ptr<ARDOUR::Region>, RouteTimeAxisView*, ARDOUR::framepos_t);
385 void finished (GdkEvent *, bool);
388 bool regions_came_from_canvas () const {
393 /** Region drag in splice mode */
394 class RegionSpliceDrag : public RegionMoveDrag
397 RegionSpliceDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &);
399 void motion (GdkEvent *, bool);
400 void finished (GdkEvent *, bool);
404 /** Drags to create regions */
405 class RegionCreateDrag : public Drag
408 RegionCreateDrag (Editor *, ArdourCanvas::Item *, TimeAxisView *);
410 void motion (GdkEvent *, bool);
411 void finished (GdkEvent *, bool);
415 MidiTimeAxisView* _view;
416 boost::shared_ptr<ARDOUR::Region> _region;
419 /** Drags to resize MIDI notes */
420 class NoteResizeDrag : public Drag
423 NoteResizeDrag (Editor *, ArdourCanvas::Item *);
425 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
426 void motion (GdkEvent *, bool);
427 void finished (GdkEvent *, bool);
431 MidiRegionView* region;
436 /** Drags to move MIDI notes */
437 class NoteDrag : public Drag
440 NoteDrag (Editor*, ArdourCanvas::Item*);
442 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
443 void motion (GdkEvent *, bool);
444 void finished (GdkEvent *, bool);
449 ARDOUR::frameoffset_t total_dx () const;
450 int8_t total_dy () const;
452 MidiRegionView* _region;
454 double _cumulative_dx;
455 double _cumulative_dy;
460 class NoteCreateDrag : public Drag
463 NoteCreateDrag (Editor *, ArdourCanvas::Item *, MidiRegionView *);
466 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
467 void motion (GdkEvent *, bool);
468 void finished (GdkEvent *, bool);
472 double y_to_region (double) const;
473 framecnt_t grid_frames (framepos_t) const;
475 MidiRegionView* _region_view;
476 ArdourCanvas::Rectangle* _drag_rect;
480 /** Drag to move MIDI patch changes */
481 class PatchChangeDrag : public Drag
484 PatchChangeDrag (Editor *, PatchChange *, MidiRegionView *);
486 void motion (GdkEvent *, bool);
487 void finished (GdkEvent *, bool);
490 bool y_movement_matters () const {
494 void setup_pointer_frame_offset ();
497 MidiRegionView* _region_view;
498 PatchChange* _patch_change;
499 double _cumulative_dx;
502 #ifdef WITH_VIDEOTIMELINE
503 /** Container for details about audio regions being dragged along with video */
507 AVDraggingView (RegionView *);
509 RegionView* view; ///< the view
510 framepos_t initial_position; ///< initial position of the region
513 /** Drag of video offset */
514 class VideoTimeLineDrag : public Drag
515 //TODO , public sigc::trackable
518 VideoTimeLineDrag (Editor *e, ArdourCanvas::Item *i);
520 void motion (GdkEvent *, bool);
521 void finished (GdkEvent *, bool);
522 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
524 bool y_movement_matters () const {
528 bool allow_vertical_autoscroll () const {
535 std::list<AVDraggingView> _views; ///< information about all audio that are being dragged along
538 ARDOUR::frameoffset_t _startdrag_video_offset;
539 ARDOUR::frameoffset_t _max_backwards_drag;
543 /** Drag to trim region(s) */
544 class TrimDrag : public RegionDrag
553 TrimDrag (Editor *, ArdourCanvas::Item *, RegionView*, std::list<RegionView*> const &, bool preserve_fade_anchor = false);
555 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
556 void motion (GdkEvent *, bool);
557 void finished (GdkEvent *, bool);
560 bool y_movement_matters () const {
564 void setup_pointer_frame_offset ();
568 Operation _operation;
570 bool _preserve_fade_anchor;
573 /** Meter marker drag */
574 class MeterMarkerDrag : public Drag
577 MeterMarkerDrag (Editor *, ArdourCanvas::Item *, bool);
579 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
580 void motion (GdkEvent *, bool);
581 void finished (GdkEvent *, bool);
584 bool allow_vertical_autoscroll () const {
588 bool y_movement_matters () const {
592 void setup_pointer_frame_offset ();
595 MeterMarker* _marker;
597 XMLNode* before_state;
600 /** Tempo marker drag */
601 class TempoMarkerDrag : public Drag
604 TempoMarkerDrag (Editor *, ArdourCanvas::Item *, bool);
606 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
607 void motion (GdkEvent *, bool);
608 void finished (GdkEvent *, bool);
611 bool allow_vertical_autoscroll () const {
615 bool y_movement_matters () const {
619 void setup_pointer_frame_offset ();
622 TempoMarker* _marker;
624 XMLNode* before_state;
628 /** Drag of the playhead cursor */
629 class CursorDrag : public Drag
632 CursorDrag (Editor *, ArdourCanvas::Item *, bool);
634 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
635 void motion (GdkEvent *, bool);
636 void finished (GdkEvent *, bool);
639 bool active (Editing::MouseMode) {
643 bool allow_vertical_autoscroll () const {
647 bool y_movement_matters () const {
652 void fake_locate (framepos_t);
654 bool _stop; ///< true to stop the transport on starting the drag, otherwise false
655 double _grab_zoom; ///< editor frames per unit when our grab started
658 /** Region fade-in drag */
659 class FadeInDrag : public RegionDrag
662 FadeInDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &);
664 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
665 void motion (GdkEvent *, bool);
666 void finished (GdkEvent *, bool);
669 bool y_movement_matters () const {
673 void setup_pointer_frame_offset ();
676 /** Region fade-out drag */
677 class FadeOutDrag : public RegionDrag
680 FadeOutDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &);
682 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
683 void motion (GdkEvent *, bool);
684 void finished (GdkEvent *, bool);
687 bool y_movement_matters () const {
691 void setup_pointer_frame_offset ();
695 class MarkerDrag : public Drag
698 MarkerDrag (Editor *, ArdourCanvas::Item *);
701 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
702 void motion (GdkEvent *, bool);
703 void finished (GdkEvent *, bool);
706 bool allow_vertical_autoscroll () const {
710 bool y_movement_matters () const {
714 void setup_pointer_frame_offset ();
717 void update_item (ARDOUR::Location *);
719 Marker* _marker; ///< marker being dragged
721 struct CopiedLocationMarkerInfo {
722 ARDOUR::Location* location;
723 std::vector<Marker*> markers;
725 CopiedLocationMarkerInfo (ARDOUR::Location* l, Marker* m);
728 typedef std::list<CopiedLocationMarkerInfo> CopiedLocationInfo;
729 CopiedLocationInfo _copied_locations;
730 ArdourCanvas::Points _points;
733 /** Control point drag */
734 class ControlPointDrag : public Drag
737 ControlPointDrag (Editor *, ArdourCanvas::Item *);
739 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
740 void motion (GdkEvent *, bool);
741 void finished (GdkEvent *, bool);
744 bool active (Editing::MouseMode m);
748 ControlPoint* _point;
749 double _fixed_grab_x;
750 double _fixed_grab_y;
751 double _cumulative_x_drag;
752 double _cumulative_y_drag;
754 uint32_t _final_index;
755 static double _zero_gain_fraction;
758 /** Gain or automation line drag */
759 class LineDrag : public Drag
762 LineDrag (Editor *e, ArdourCanvas::Item *i);
764 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
765 void motion (GdkEvent *, bool);
766 void finished (GdkEvent *, bool);
769 bool active (Editing::MouseMode) {
775 AutomationLine* _line;
776 double _fixed_grab_x;
777 double _fixed_grab_y;
780 double _cumulative_y_drag;
783 /** Transient feature line drags*/
784 class FeatureLineDrag : public Drag
787 FeatureLineDrag (Editor *e, ArdourCanvas::Item *i);
789 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
790 void motion (GdkEvent *, bool);
791 void finished (GdkEvent *, bool);
794 bool active (Editing::MouseMode) {
800 ArdourCanvas::Line* _line;
801 AudioRegionView* _arv;
803 double _region_view_grab_x;
804 double _cumulative_x_drag;
810 /** Dragging of a rubberband rectangle for selecting things */
811 class RubberbandSelectDrag : public Drag
814 RubberbandSelectDrag (Editor *, ArdourCanvas::Item *);
816 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
817 void motion (GdkEvent *, bool);
818 void finished (GdkEvent *, bool);
821 std::pair<ARDOUR::framecnt_t, int> move_threshold () const {
822 return std::make_pair (8, 1);
825 void do_select_things (GdkEvent *, bool);
827 /** Select some things within a rectangle.
828 * @param button_state The button state from the GdkEvent.
829 * @param x1 The left-hand side of the rectangle in session frames.
830 * @param x2 The right-hand side of the rectangle in session frames.
831 * @param y1 The top of the rectangle in trackview coordinates.
832 * @param y2 The bottom of the rectangle in trackview coordinates.
833 * @param drag_in_progress true if the drag is currently happening.
835 virtual void select_things (int button_state, framepos_t x1, framepos_t x2, double y1, double y2, bool drag_in_progress) = 0;
837 virtual void deselect_things () = 0;
843 /** A general editor RubberbandSelectDrag (for regions, automation points etc.) */
844 class EditorRubberbandSelectDrag : public RubberbandSelectDrag
847 EditorRubberbandSelectDrag (Editor *, ArdourCanvas::Item *);
849 void select_things (int, framepos_t, framepos_t, double, double, bool);
850 void deselect_things ();
853 /** A RubberbandSelectDrag for selecting MIDI notes */
854 class MidiRubberbandSelectDrag : public RubberbandSelectDrag
857 MidiRubberbandSelectDrag (Editor *, MidiRegionView *);
859 void select_things (int, framepos_t, framepos_t, double, double, bool);
860 void deselect_things ();
863 MidiRegionView* _region_view;
866 /** A RubberbandSelectDrag for selecting MIDI notes but with no horizonal component */
867 class MidiVerticalSelectDrag : public RubberbandSelectDrag
870 MidiVerticalSelectDrag (Editor *, MidiRegionView *);
872 void select_things (int, framepos_t, framepos_t, double, double, bool);
873 void deselect_things ();
876 MidiRegionView* _region_view;
879 /** Region drag in time-FX mode */
880 class TimeFXDrag : public RegionDrag
883 TimeFXDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &);
885 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
886 void motion (GdkEvent *, bool);
887 void finished (GdkEvent *, bool);
891 /** Scrub drag in audition mode */
892 class ScrubDrag : public Drag
895 ScrubDrag (Editor *, ArdourCanvas::Item *);
897 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
898 void motion (GdkEvent *, bool);
899 void finished (GdkEvent *, bool);
903 /** Drag in range select mode */
904 class SelectionDrag : public Drag
915 SelectionDrag (Editor *, ArdourCanvas::Item *, Operation);
917 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
918 void motion (GdkEvent *, bool);
919 void finished (GdkEvent *, bool);
922 void setup_pointer_frame_offset ();
925 Operation _operation;
928 int _original_pointer_time_axis;
929 int _last_pointer_time_axis;
930 std::list<TimeAxisView*> _added_time_axes;
931 bool _time_selection_at_start;
932 framepos_t start_at_start;
933 framepos_t end_at_start;
936 /** Range marker drag */
937 class RangeMarkerBarDrag : public Drag
942 CreateTransportMarker,
946 RangeMarkerBarDrag (Editor *, ArdourCanvas::Item *, Operation);
948 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
949 void motion (GdkEvent *, bool);
950 void finished (GdkEvent *, bool);
953 bool allow_vertical_autoscroll () const {
957 bool y_movement_matters () const {
962 void update_item (ARDOUR::Location *);
964 Operation _operation;
965 ArdourCanvas::Rectangle* _drag_rect;
969 /** Drag of rectangle to set zoom */
970 class MouseZoomDrag : public Drag
973 MouseZoomDrag (Editor *, ArdourCanvas::Item *);
975 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
976 void motion (GdkEvent *, bool);
977 void finished (GdkEvent *, bool);
980 std::pair<ARDOUR::framecnt_t, int> move_threshold () const {
981 return std::make_pair (4, 4);
988 /** Drag of a range of automation data (either on an automation track or region gain),
989 * changing value but not position.
991 class AutomationRangeDrag : public Drag
994 AutomationRangeDrag (Editor *, AutomationTimeAxisView *, std::list<ARDOUR::AudioRange> const &);
995 AutomationRangeDrag (Editor *, AudioRegionView *, std::list<ARDOUR::AudioRange> const &);
997 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
998 void motion (GdkEvent *, bool);
999 void finished (GdkEvent *, bool);
1000 void aborted (bool);
1002 bool x_movement_matters () const {
1006 bool active (Editing::MouseMode) {
1011 void setup (std::list<boost::shared_ptr<AutomationLine> > const &);
1012 double y_fraction (boost::shared_ptr<AutomationLine>, double global_y_position) const;
1014 std::list<ARDOUR::AudioRange> _ranges;
1016 /** A line that is part of the drag */
1018 boost::shared_ptr<AutomationLine> line; ///< the line
1019 std::list<ControlPoint*> points; ///< points to drag on the line
1020 std::pair<ARDOUR::framepos_t, ARDOUR::framepos_t> range; ///< the range of all points on the line, in session frames
1021 XMLNode* state; ///< the XML state node before the drag
1022 double original_fraction; ///< initial y-fraction before the drag
1025 std::list<Line> _lines;
1027 bool _nothing_to_drag;
1030 /** Drag of one edge of an xfade
1032 class CrossfadeEdgeDrag : public Drag
1035 CrossfadeEdgeDrag (Editor*, AudioRegionView*, ArdourCanvas::Item*, bool start);
1037 void start_grab (GdkEvent*, Gdk::Cursor* c = 0);
1038 void motion (GdkEvent*, bool);
1039 void finished (GdkEvent*, bool);
1040 void aborted (bool);
1042 bool y_movement_matters () const {
1046 virtual std::pair<ARDOUR::framecnt_t, int> move_threshold () const {
1047 return std::make_pair (4, 4);
1051 AudioRegionView* arv;
1055 #endif /* __gtk2_ardour_editor_drag_h_ */