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 /** Container for details about audio regions being dragged along with video */
506 AVDraggingView (RegionView *);
508 RegionView* view; ///< the view
509 framepos_t initial_position; ///< initial position of the region
512 /** Drag of video offset */
513 class VideoTimeLineDrag : public Drag
516 VideoTimeLineDrag (Editor *e, ArdourCanvas::Item *i);
518 void motion (GdkEvent *, bool);
519 void finished (GdkEvent *, bool);
520 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
522 bool y_movement_matters () const {
526 bool allow_vertical_autoscroll () const {
533 std::list<AVDraggingView> _views; ///< information about all audio that are being dragged along
536 ARDOUR::frameoffset_t _startdrag_video_offset;
537 ARDOUR::frameoffset_t _max_backwards_drag;
540 /** Drag to trim region(s) */
541 class TrimDrag : public RegionDrag
550 TrimDrag (Editor *, ArdourCanvas::Item *, RegionView*, std::list<RegionView*> const &, bool preserve_fade_anchor = false);
552 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
553 void motion (GdkEvent *, bool);
554 void finished (GdkEvent *, bool);
557 bool y_movement_matters () const {
561 void setup_pointer_frame_offset ();
565 Operation _operation;
567 bool _preserve_fade_anchor;
570 /** Meter marker drag */
571 class MeterMarkerDrag : public Drag
574 MeterMarkerDrag (Editor *, ArdourCanvas::Item *, bool);
576 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
577 void motion (GdkEvent *, bool);
578 void finished (GdkEvent *, bool);
581 bool allow_vertical_autoscroll () const {
585 bool y_movement_matters () const {
589 void setup_pointer_frame_offset ();
592 MeterMarker* _marker;
594 XMLNode* before_state;
597 /** Tempo marker drag */
598 class TempoMarkerDrag : public Drag
601 TempoMarkerDrag (Editor *, ArdourCanvas::Item *, bool);
603 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
604 void motion (GdkEvent *, bool);
605 void finished (GdkEvent *, bool);
608 bool allow_vertical_autoscroll () const {
612 bool y_movement_matters () const {
616 void setup_pointer_frame_offset ();
619 TempoMarker* _marker;
621 XMLNode* before_state;
625 /** Drag of the playhead cursor */
626 class CursorDrag : public Drag
629 CursorDrag (Editor *, EditorCursor&, bool);
631 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
632 void motion (GdkEvent *, bool);
633 void finished (GdkEvent *, bool);
636 bool active (Editing::MouseMode) {
640 bool allow_vertical_autoscroll () const {
644 bool y_movement_matters () const {
649 void fake_locate (framepos_t);
651 EditorCursor& _cursor;
652 bool _stop; ///< true to stop the transport on starting the drag, otherwise false
653 double _grab_zoom; ///< editor frames per unit when our grab started
656 /** Region fade-in drag */
657 class FadeInDrag : public RegionDrag
660 FadeInDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &);
662 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
663 void motion (GdkEvent *, bool);
664 void finished (GdkEvent *, bool);
667 bool y_movement_matters () const {
671 void setup_pointer_frame_offset ();
674 /** Region fade-out drag */
675 class FadeOutDrag : public RegionDrag
678 FadeOutDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &);
680 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
681 void motion (GdkEvent *, bool);
682 void finished (GdkEvent *, bool);
685 bool y_movement_matters () const {
689 void setup_pointer_frame_offset ();
693 class MarkerDrag : public Drag
696 MarkerDrag (Editor *, ArdourCanvas::Item *);
699 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
700 void motion (GdkEvent *, bool);
701 void finished (GdkEvent *, bool);
704 bool allow_vertical_autoscroll () const {
708 bool y_movement_matters () const {
712 void setup_pointer_frame_offset ();
715 void update_item (ARDOUR::Location *);
717 Marker* _marker; ///< marker being dragged
719 struct CopiedLocationMarkerInfo {
720 ARDOUR::Location* location;
721 std::vector<Marker*> markers;
723 CopiedLocationMarkerInfo (ARDOUR::Location* l, Marker* m);
726 typedef std::list<CopiedLocationMarkerInfo> CopiedLocationInfo;
727 CopiedLocationInfo _copied_locations;
728 ArdourCanvas::Points _points;
731 /** Control point drag */
732 class ControlPointDrag : public Drag
735 ControlPointDrag (Editor *, ArdourCanvas::Item *);
737 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
738 void motion (GdkEvent *, bool);
739 void finished (GdkEvent *, bool);
742 bool active (Editing::MouseMode m);
746 ControlPoint* _point;
747 double _fixed_grab_x;
748 double _fixed_grab_y;
749 double _cumulative_x_drag;
750 double _cumulative_y_drag;
752 uint32_t _final_index;
753 static double _zero_gain_fraction;
756 /** Gain or automation line drag */
757 class LineDrag : public Drag
760 LineDrag (Editor *e, ArdourCanvas::Item *i);
762 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
763 void motion (GdkEvent *, bool);
764 void finished (GdkEvent *, bool);
767 bool active (Editing::MouseMode) {
773 AutomationLine* _line;
774 double _fixed_grab_x;
775 double _fixed_grab_y;
778 double _cumulative_y_drag;
781 /** Transient feature line drags*/
782 class FeatureLineDrag : public Drag
785 FeatureLineDrag (Editor *e, ArdourCanvas::Item *i);
787 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
788 void motion (GdkEvent *, bool);
789 void finished (GdkEvent *, bool);
792 bool active (Editing::MouseMode) {
798 ArdourCanvas::Line* _line;
799 AudioRegionView* _arv;
801 double _region_view_grab_x;
802 double _cumulative_x_drag;
808 /** Dragging of a rubberband rectangle for selecting things */
809 class RubberbandSelectDrag : public Drag
812 RubberbandSelectDrag (Editor *, ArdourCanvas::Item *);
814 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
815 void motion (GdkEvent *, bool);
816 void finished (GdkEvent *, bool);
819 std::pair<ARDOUR::framecnt_t, int> move_threshold () const {
820 return std::make_pair (8, 1);
823 void do_select_things (GdkEvent *, bool);
825 /** Select some things within a rectangle.
826 * @param button_state The button state from the GdkEvent.
827 * @param x1 The left-hand side of the rectangle in session frames.
828 * @param x2 The right-hand side of the rectangle in session frames.
829 * @param y1 The top of the rectangle in trackview coordinates.
830 * @param y2 The bottom of the rectangle in trackview coordinates.
831 * @param drag_in_progress true if the drag is currently happening.
833 virtual void select_things (int button_state, framepos_t x1, framepos_t x2, double y1, double y2, bool drag_in_progress) = 0;
835 virtual void deselect_things () = 0;
841 /** A general editor RubberbandSelectDrag (for regions, automation points etc.) */
842 class EditorRubberbandSelectDrag : public RubberbandSelectDrag
845 EditorRubberbandSelectDrag (Editor *, ArdourCanvas::Item *);
847 void select_things (int, framepos_t, framepos_t, double, double, bool);
848 void deselect_things ();
851 /** A RubberbandSelectDrag for selecting MIDI notes */
852 class MidiRubberbandSelectDrag : public RubberbandSelectDrag
855 MidiRubberbandSelectDrag (Editor *, MidiRegionView *);
857 void select_things (int, framepos_t, framepos_t, double, double, bool);
858 void deselect_things ();
861 MidiRegionView* _region_view;
864 /** A RubberbandSelectDrag for selecting MIDI notes but with no horizonal component */
865 class MidiVerticalSelectDrag : public RubberbandSelectDrag
868 MidiVerticalSelectDrag (Editor *, MidiRegionView *);
870 void select_things (int, framepos_t, framepos_t, double, double, bool);
871 void deselect_things ();
874 MidiRegionView* _region_view;
877 /** Region drag in time-FX mode */
878 class TimeFXDrag : public RegionDrag
881 TimeFXDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &);
883 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
884 void motion (GdkEvent *, bool);
885 void finished (GdkEvent *, bool);
889 /** Scrub drag in audition mode */
890 class ScrubDrag : public Drag
893 ScrubDrag (Editor *, ArdourCanvas::Item *);
895 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
896 void motion (GdkEvent *, bool);
897 void finished (GdkEvent *, bool);
901 /** Drag in range select mode */
902 class SelectionDrag : public Drag
913 SelectionDrag (Editor *, ArdourCanvas::Item *, Operation);
915 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
916 void motion (GdkEvent *, bool);
917 void finished (GdkEvent *, bool);
920 void setup_pointer_frame_offset ();
923 Operation _operation;
926 int _original_pointer_time_axis;
927 int _last_pointer_time_axis;
928 std::list<TimeAxisView*> _added_time_axes;
929 bool _time_selection_at_start;
930 framepos_t start_at_start;
931 framepos_t end_at_start;
934 /** Range marker drag */
935 class RangeMarkerBarDrag : public Drag
940 CreateTransportMarker,
944 RangeMarkerBarDrag (Editor *, ArdourCanvas::Item *, Operation);
946 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
947 void motion (GdkEvent *, bool);
948 void finished (GdkEvent *, bool);
951 bool allow_vertical_autoscroll () const {
955 bool y_movement_matters () const {
960 void update_item (ARDOUR::Location *);
962 Operation _operation;
963 ArdourCanvas::Rectangle* _drag_rect;
967 /** Drag of rectangle to set zoom */
968 class MouseZoomDrag : public Drag
971 MouseZoomDrag (Editor *, ArdourCanvas::Item *);
973 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
974 void motion (GdkEvent *, bool);
975 void finished (GdkEvent *, bool);
978 std::pair<ARDOUR::framecnt_t, int> move_threshold () const {
979 return std::make_pair (4, 4);
986 /** Drag of a range of automation data (either on an automation track or region gain),
987 * changing value but not position.
989 class AutomationRangeDrag : public Drag
992 AutomationRangeDrag (Editor *, AutomationTimeAxisView *, std::list<ARDOUR::AudioRange> const &);
993 AutomationRangeDrag (Editor *, AudioRegionView *, std::list<ARDOUR::AudioRange> const &);
995 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
996 void motion (GdkEvent *, bool);
997 void finished (GdkEvent *, bool);
1000 bool x_movement_matters () const {
1004 bool active (Editing::MouseMode) {
1009 void setup (std::list<boost::shared_ptr<AutomationLine> > const &);
1010 double y_fraction (boost::shared_ptr<AutomationLine>, double global_y_position) const;
1012 std::list<ARDOUR::AudioRange> _ranges;
1014 /** A line that is part of the drag */
1016 boost::shared_ptr<AutomationLine> line; ///< the line
1017 std::list<ControlPoint*> points; ///< points to drag on the line
1018 std::pair<ARDOUR::framepos_t, ARDOUR::framepos_t> range; ///< the range of all points on the line, in session frames
1019 XMLNode* state; ///< the XML state node before the drag
1020 double original_fraction; ///< initial y-fraction before the drag
1023 std::list<Line> _lines;
1025 bool _nothing_to_drag;
1028 /** Drag of one edge of an xfade
1030 class CrossfadeEdgeDrag : public Drag
1033 CrossfadeEdgeDrag (Editor*, AudioRegionView*, ArdourCanvas::Item*, bool start);
1035 void start_grab (GdkEvent*, Gdk::Cursor* c = 0);
1036 void motion (GdkEvent*, bool);
1037 void finished (GdkEvent*, bool);
1038 void aborted (bool);
1040 bool y_movement_matters () const {
1044 virtual std::pair<ARDOUR::framecnt_t, int> move_threshold () const {
1045 return std::make_pair (4, 4);
1049 AudioRegionView* arv;
1053 #endif /* __gtk2_ardour_editor_drag_h_ */