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 framepos_t anchored_fade_length; ///< fade_length when anchored during drag
265 boost::shared_ptr<ARDOUR::Playlist> initial_playlist;
268 /** Abstract base class for drags that involve region(s) */
269 class RegionDrag : public Drag, public sigc::trackable
272 RegionDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &);
273 virtual ~RegionDrag () {}
277 RegionView* _primary; ///< the view that was clicked on (or whatever) to start the drag
278 std::list<DraggingView> _views; ///< information about all views that are being dragged
280 /** a list of the non-hidden TimeAxisViews sorted by editor order key */
281 std::vector<TimeAxisView*> _time_axis_views;
282 int find_time_axis_view (TimeAxisView *) const;
287 friend class DraggingView;
291 void region_going_away (RegionView *);
292 PBD::ScopedConnection death_connection;
296 /** Drags involving region motion from somewhere */
297 class RegionMotionDrag : public RegionDrag
301 RegionMotionDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, bool);
302 virtual ~RegionMotionDrag () {}
304 virtual void start_grab (GdkEvent *, Gdk::Cursor *);
305 virtual void motion (GdkEvent *, bool);
306 virtual void finished (GdkEvent *, bool);
307 virtual void aborted (bool);
309 /** @return true if the regions being `moved' came from somewhere on the canvas;
310 * false if they came from outside (e.g. from the region list).
312 virtual bool regions_came_from_canvas () const = 0;
316 double compute_x_delta (GdkEvent const *, ARDOUR::framepos_t *);
317 bool y_movement_allowed (int, double) const;
320 ARDOUR::framepos_t _last_frame_position; ///< last position of the thing being dragged
321 double _total_x_delta;
322 int _last_pointer_time_axis_view;
323 double _last_pointer_layer;
327 /** Drags to move (or copy) regions that are already shown in the GUI to
328 * somewhere different.
330 class RegionMoveDrag : public RegionMotionDrag
333 RegionMoveDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, bool, bool);
334 virtual ~RegionMoveDrag () {}
336 void motion (GdkEvent *, bool);
337 void finished (GdkEvent *, bool);
340 bool regions_came_from_canvas () const {
344 std::pair<ARDOUR::framecnt_t, int> move_threshold () const {
345 return std::make_pair (4, 4);
348 void setup_pointer_frame_offset ();
351 typedef std::set<boost::shared_ptr<ARDOUR::Playlist> > PlaylistSet;
353 void finished_no_copy (
356 ARDOUR::framecnt_t const
362 ARDOUR::framecnt_t const
365 RegionView* insert_region_into_playlist (
366 boost::shared_ptr<ARDOUR::Region>,
373 void remove_region_from_playlist (
374 boost::shared_ptr<ARDOUR::Region>,
375 boost::shared_ptr<ARDOUR::Playlist>,
376 PlaylistSet& modified_playlists
379 void add_stateful_diff_commands_for_playlists (PlaylistSet const &);
381 void collect_new_region_view (RegionView *);
382 RouteTimeAxisView* create_destination_time_axis (boost::shared_ptr<ARDOUR::Region>);
385 RegionView* _new_region_view;
388 /** Drag to insert a region from somewhere */
389 class RegionInsertDrag : public RegionMotionDrag
392 RegionInsertDrag (Editor *, boost::shared_ptr<ARDOUR::Region>, RouteTimeAxisView*, ARDOUR::framepos_t);
394 void finished (GdkEvent *, bool);
397 bool regions_came_from_canvas () const {
402 /** Region drag in splice mode */
403 class RegionSpliceDrag : public RegionMoveDrag
406 RegionSpliceDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &);
408 void motion (GdkEvent *, bool);
409 void finished (GdkEvent *, bool);
413 /** Drags to create regions */
414 class RegionCreateDrag : public Drag
417 RegionCreateDrag (Editor *, ArdourCanvas::Item *, TimeAxisView *);
419 void motion (GdkEvent *, bool);
420 void finished (GdkEvent *, bool);
424 MidiTimeAxisView* _view;
425 boost::shared_ptr<ARDOUR::Region> _region;
428 /** Drags to resize MIDI notes */
429 class NoteResizeDrag : public Drag
432 NoteResizeDrag (Editor *, ArdourCanvas::Item *);
434 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
435 void motion (GdkEvent *, bool);
436 void finished (GdkEvent *, bool);
440 MidiRegionView* region;
445 /** Drags to move MIDI notes */
446 class NoteDrag : public Drag
449 NoteDrag (Editor*, ArdourCanvas::Item*);
451 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
452 void motion (GdkEvent *, bool);
453 void finished (GdkEvent *, bool);
458 ARDOUR::frameoffset_t total_dx () const;
459 int8_t total_dy () const;
461 MidiRegionView* _region;
463 double _cumulative_dx;
464 double _cumulative_dy;
469 class NoteCreateDrag : public Drag
472 NoteCreateDrag (Editor *, ArdourCanvas::Item *, MidiRegionView *);
475 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
476 void motion (GdkEvent *, bool);
477 void finished (GdkEvent *, bool);
481 double y_to_region (double) const;
482 framecnt_t grid_frames (framepos_t) const;
484 MidiRegionView* _region_view;
485 ArdourCanvas::Rectangle* _drag_rect;
489 /** Drag to move MIDI patch changes */
490 class PatchChangeDrag : public Drag
493 PatchChangeDrag (Editor *, PatchChange *, MidiRegionView *);
495 void motion (GdkEvent *, bool);
496 void finished (GdkEvent *, bool);
499 bool y_movement_matters () const {
503 void setup_pointer_frame_offset ();
506 MidiRegionView* _region_view;
507 PatchChange* _patch_change;
508 double _cumulative_dx;
511 /** Container for details about audio regions being dragged along with video */
515 AVDraggingView (RegionView *);
517 RegionView* view; ///< the view
518 framepos_t initial_position; ///< initial position of the region
521 /** Drag of video offset */
522 class VideoTimeLineDrag : public Drag
525 VideoTimeLineDrag (Editor *e, ArdourCanvas::Item *i);
527 void motion (GdkEvent *, bool);
528 void finished (GdkEvent *, bool);
529 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
531 bool y_movement_matters () const {
535 bool allow_vertical_autoscroll () const {
542 std::list<AVDraggingView> _views; ///< information about all audio that are being dragged along
545 ARDOUR::frameoffset_t _startdrag_video_offset;
546 ARDOUR::frameoffset_t _max_backwards_drag;
549 /** Drag to trim region(s) */
550 class TrimDrag : public RegionDrag
559 TrimDrag (Editor *, ArdourCanvas::Item *, RegionView*, std::list<RegionView*> const &, bool preserve_fade_anchor = false);
561 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
562 void motion (GdkEvent *, bool);
563 void finished (GdkEvent *, bool);
566 bool y_movement_matters () const {
570 void setup_pointer_frame_offset ();
574 Operation _operation;
576 bool _preserve_fade_anchor;
577 bool _jump_position_when_done;
580 /** Meter marker drag */
581 class MeterMarkerDrag : public Drag
584 MeterMarkerDrag (Editor *, ArdourCanvas::Item *, bool);
586 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
587 void motion (GdkEvent *, bool);
588 void finished (GdkEvent *, bool);
591 bool allow_vertical_autoscroll () const {
595 bool y_movement_matters () const {
599 void setup_pointer_frame_offset ();
602 MeterMarker* _marker;
604 XMLNode* before_state;
607 /** Tempo marker drag */
608 class TempoMarkerDrag : public Drag
611 TempoMarkerDrag (Editor *, ArdourCanvas::Item *, bool);
613 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
614 void motion (GdkEvent *, bool);
615 void finished (GdkEvent *, bool);
618 bool allow_vertical_autoscroll () const {
622 bool y_movement_matters () const {
626 void setup_pointer_frame_offset ();
629 TempoMarker* _marker;
631 XMLNode* before_state;
635 /** Drag of the playhead cursor */
636 class CursorDrag : public Drag
639 CursorDrag (Editor *, EditorCursor&, bool);
641 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
642 void motion (GdkEvent *, bool);
643 void finished (GdkEvent *, bool);
646 bool active (Editing::MouseMode) {
650 bool allow_vertical_autoscroll () const {
654 bool y_movement_matters () const {
659 void fake_locate (framepos_t);
661 EditorCursor& _cursor;
662 bool _stop; ///< true to stop the transport on starting the drag, otherwise false
663 double _grab_zoom; ///< editor frames per unit when our grab started
666 /** Region fade-in drag */
667 class FadeInDrag : public RegionDrag
670 FadeInDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &);
672 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
673 void motion (GdkEvent *, bool);
674 void finished (GdkEvent *, bool);
677 bool y_movement_matters () const {
681 void setup_pointer_frame_offset ();
684 /** Region fade-out drag */
685 class FadeOutDrag : public RegionDrag
688 FadeOutDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &);
690 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
691 void motion (GdkEvent *, bool);
692 void finished (GdkEvent *, bool);
695 bool y_movement_matters () const {
699 void setup_pointer_frame_offset ();
703 class MarkerDrag : public Drag
706 MarkerDrag (Editor *, ArdourCanvas::Item *);
709 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
710 void motion (GdkEvent *, bool);
711 void finished (GdkEvent *, bool);
714 bool allow_vertical_autoscroll () const {
718 bool y_movement_matters () const {
722 void setup_pointer_frame_offset ();
725 void update_item (ARDOUR::Location *);
727 Marker* _marker; ///< marker being dragged
729 struct CopiedLocationMarkerInfo {
730 ARDOUR::Location* location;
731 std::vector<Marker*> markers;
733 CopiedLocationMarkerInfo (ARDOUR::Location* l, Marker* m);
736 typedef std::list<CopiedLocationMarkerInfo> CopiedLocationInfo;
737 CopiedLocationInfo _copied_locations;
738 ArdourCanvas::Points _points;
741 /** Control point drag */
742 class ControlPointDrag : public Drag
745 ControlPointDrag (Editor *, ArdourCanvas::Item *);
747 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
748 void motion (GdkEvent *, bool);
749 void finished (GdkEvent *, bool);
752 bool active (Editing::MouseMode m);
756 ControlPoint* _point;
757 double _fixed_grab_x;
758 double _fixed_grab_y;
759 double _cumulative_x_drag;
760 double _cumulative_y_drag;
762 uint32_t _final_index;
763 static double _zero_gain_fraction;
766 /** Gain or automation line drag */
767 class LineDrag : public Drag
770 LineDrag (Editor *e, ArdourCanvas::Item *i);
772 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
773 void motion (GdkEvent *, bool);
774 void finished (GdkEvent *, bool);
777 bool active (Editing::MouseMode) {
783 AutomationLine* _line;
784 double _fixed_grab_x;
785 double _fixed_grab_y;
788 double _cumulative_y_drag;
791 /** Transient feature line drags*/
792 class FeatureLineDrag : public Drag
795 FeatureLineDrag (Editor *e, ArdourCanvas::Item *i);
797 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
798 void motion (GdkEvent *, bool);
799 void finished (GdkEvent *, bool);
802 bool active (Editing::MouseMode) {
808 ArdourCanvas::Line* _line;
809 AudioRegionView* _arv;
811 double _region_view_grab_x;
812 double _cumulative_x_drag;
818 /** Dragging of a rubberband rectangle for selecting things */
819 class RubberbandSelectDrag : public Drag
822 RubberbandSelectDrag (Editor *, ArdourCanvas::Item *);
824 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
825 void motion (GdkEvent *, bool);
826 void finished (GdkEvent *, bool);
829 std::pair<ARDOUR::framecnt_t, int> move_threshold () const {
830 return std::make_pair (8, 1);
833 void do_select_things (GdkEvent *, bool);
835 /** Select some things within a rectangle.
836 * @param button_state The button state from the GdkEvent.
837 * @param x1 The left-hand side of the rectangle in session frames.
838 * @param x2 The right-hand side of the rectangle in session frames.
839 * @param y1 The top of the rectangle in trackview coordinates.
840 * @param y2 The bottom of the rectangle in trackview coordinates.
841 * @param drag_in_progress true if the drag is currently happening.
843 virtual void select_things (int button_state, framepos_t x1, framepos_t x2, double y1, double y2, bool drag_in_progress) = 0;
845 virtual void deselect_things () = 0;
851 /** A general editor RubberbandSelectDrag (for regions, automation points etc.) */
852 class EditorRubberbandSelectDrag : public RubberbandSelectDrag
855 EditorRubberbandSelectDrag (Editor *, ArdourCanvas::Item *);
857 void select_things (int, framepos_t, framepos_t, double, double, bool);
858 void deselect_things ();
861 /** A RubberbandSelectDrag for selecting MIDI notes */
862 class MidiRubberbandSelectDrag : public RubberbandSelectDrag
865 MidiRubberbandSelectDrag (Editor *, MidiRegionView *);
867 void select_things (int, framepos_t, framepos_t, double, double, bool);
868 void deselect_things ();
871 MidiRegionView* _region_view;
874 /** A RubberbandSelectDrag for selecting MIDI notes but with no horizonal component */
875 class MidiVerticalSelectDrag : public RubberbandSelectDrag
878 MidiVerticalSelectDrag (Editor *, MidiRegionView *);
880 void select_things (int, framepos_t, framepos_t, double, double, bool);
881 void deselect_things ();
884 MidiRegionView* _region_view;
887 /** Region drag in time-FX mode */
888 class TimeFXDrag : public RegionDrag
891 TimeFXDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &);
893 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
894 void motion (GdkEvent *, bool);
895 void finished (GdkEvent *, bool);
899 /** Scrub drag in audition mode */
900 class ScrubDrag : public Drag
903 ScrubDrag (Editor *, ArdourCanvas::Item *);
905 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
906 void motion (GdkEvent *, bool);
907 void finished (GdkEvent *, bool);
911 /** Drag in range select mode */
912 class SelectionDrag : public Drag
923 SelectionDrag (Editor *, ArdourCanvas::Item *, Operation);
925 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
926 void motion (GdkEvent *, bool);
927 void finished (GdkEvent *, bool);
930 void setup_pointer_frame_offset ();
933 Operation _operation;
936 int _original_pointer_time_axis;
937 int _last_pointer_time_axis;
938 std::list<TimeAxisView*> _added_time_axes;
939 bool _time_selection_at_start;
940 framepos_t start_at_start;
941 framepos_t end_at_start;
944 /** Range marker drag */
945 class RangeMarkerBarDrag : public Drag
950 CreateTransportMarker,
954 RangeMarkerBarDrag (Editor *, ArdourCanvas::Item *, Operation);
956 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
957 void motion (GdkEvent *, bool);
958 void finished (GdkEvent *, bool);
961 bool allow_vertical_autoscroll () const {
965 bool y_movement_matters () const {
970 void update_item (ARDOUR::Location *);
972 Operation _operation;
973 ArdourCanvas::Rectangle* _drag_rect;
977 /** Drag of rectangle to set zoom */
978 class MouseZoomDrag : public Drag
981 MouseZoomDrag (Editor *, ArdourCanvas::Item *);
983 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
984 void motion (GdkEvent *, bool);
985 void finished (GdkEvent *, bool);
988 std::pair<ARDOUR::framecnt_t, int> move_threshold () const {
989 return std::make_pair (4, 4);
996 /** Drag of a range of automation data (either on an automation track or region gain),
997 * changing value but not position.
999 class AutomationRangeDrag : public Drag
1002 AutomationRangeDrag (Editor *, AutomationTimeAxisView *, std::list<ARDOUR::AudioRange> const &);
1003 AutomationRangeDrag (Editor *, AudioRegionView *, std::list<ARDOUR::AudioRange> const &);
1005 void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1006 void motion (GdkEvent *, bool);
1007 void finished (GdkEvent *, bool);
1008 void aborted (bool);
1010 bool x_movement_matters () const {
1014 bool active (Editing::MouseMode) {
1019 void setup (std::list<boost::shared_ptr<AutomationLine> > const &);
1020 double y_fraction (boost::shared_ptr<AutomationLine>, double global_y_position) const;
1022 std::list<ARDOUR::AudioRange> _ranges;
1024 /** A line that is part of the drag */
1026 boost::shared_ptr<AutomationLine> line; ///< the line
1027 std::list<ControlPoint*> points; ///< points to drag on the line
1028 std::pair<ARDOUR::framepos_t, ARDOUR::framepos_t> range; ///< the range of all points on the line, in session frames
1029 XMLNode* state; ///< the XML state node before the drag
1030 double original_fraction; ///< initial y-fraction before the drag
1033 std::list<Line> _lines;
1035 bool _nothing_to_drag;
1038 /** Drag of one edge of an xfade
1040 class CrossfadeEdgeDrag : public Drag
1043 CrossfadeEdgeDrag (Editor*, AudioRegionView*, ArdourCanvas::Item*, bool start);
1045 void start_grab (GdkEvent*, Gdk::Cursor* c = 0);
1046 void motion (GdkEvent*, bool);
1047 void finished (GdkEvent*, bool);
1048 void aborted (bool);
1050 bool y_movement_matters () const {
1054 virtual std::pair<ARDOUR::framecnt_t, int> move_threshold () const {
1055 return std::make_pair (4, 4);
1059 AudioRegionView* arv;
1063 #endif /* __gtk2_ardour_editor_drag_h_ */