Ardour  8.12
editor_drag.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2009-2012 Carl Hetherington <carl@carlh.net>
3  * Copyright (C) 2009-2015 David Robillard <d@drobilla.net>
4  * Copyright (C) 2009-2017 Paul Davis <paul@linuxaudiosystems.com>
5  * Copyright (C) 2013-2014 Colin Fletcher <colin.m.fletcher@googlemail.com>
6  * Copyright (C) 2013-2019 Robin Gareus <robin@gareus.org>
7  * Copyright (C) 2015-2017 Nick Mainsbridge <mainsbridge@gmail.com>
8  * Copyright (C) 2015-2018 Ben Loftis <ben@harrisonconsoles.com>
9  * Copyright (C) 2016 Tim Mayberry <mojofunk@gmail.com>
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License along
22  * with this program; if not, write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24  */
25 
26 #ifndef __gtk2_ardour_editor_drag_h_
27 #define __gtk2_ardour_editor_drag_h_
28 
29 #include <list>
30 #include <vector>
31 
32 #include <gdk/gdk.h>
33 #include <stdint.h>
34 
35 #include "ardour/tempo.h"
36 #include "ardour/types.h"
37 
38 #include "evoral/ControlList.h"
39 
40 #include "canvas/types.h"
41 
42 #include "gtkmm2ext/bindings.h"
43 
44 #include "cursor_context.h"
45 #include "editor_items.h"
46 #include "mouse_cursors.h"
47 #include "editing.h"
48 #include "track_selection.h"
49 #include "region_view.h"
50 
51 namespace ARDOUR {
52  class Location;
53  class Region;
54  class TempoSection;
55 }
56 
57 namespace ArdourCanvas {
58  class Item;
59  class Line;
60  class Rectangle;
61  class Lollipop;
62 }
63 
64 namespace PBD {
65  class StatefulDiffCommand;
66 }
67 
68 class PatchChange;
69 class Editor;
70 class EditorCursor;
71 class TimeAxisView;
72 class MidiTimeAxisView;
73 class Drag;
74 class NoteBase;
75 class TimeAxisView;
76 class RouteTimeAxisView;
77 class RegionSelection;
78 class MidiRegionView;
79 class MeterMarker;
80 class ArdourMarker;
81 class TempoMarker;
82 class TempoCurve;
83 class ControlPoint;
84 class AudioRegionView;
85 class AutomationLine;
88 
91 {
92 public:
93 
96 
97  bool motion_handler (GdkEvent *, bool);
99  void abort ();
100  void add (Drag *);
103  bool end_grab (GdkEvent *);
105 
107 
109  bool ending () const {
110  return _ending;
111  }
112 
113  bool active () const {
114  return !_drags.empty ();
115  }
116 
118  double current_pointer_x () const {
119  return _current_pointer_x;
120  }
121 
123  double current_pointer_y () const {
124  return _current_pointer_y;
125  }
126 
130  }
131 
134  return _current_pointer_time;
135  }
136 
138  bool preview_video () const;
139 
140 private:
142  std::list<Drag*> _drags;
143  bool _ending;
148 };
149 
151 class Drag
152 {
153 public:
154  Drag (Editor *, ArdourCanvas::Item *, Temporal::TimeDomain td, bool trackview_only = true, bool hide_snapped_cursor = true);
155  virtual ~Drag ();
156 
158  _drags = m;
159  }
160 
163  return _item;
164  }
165 
168 
169  void swap_grab (ArdourCanvas::Item *, Gdk::Cursor *, uint32_t);
170  bool motion_handler (GdkEvent*, bool);
171  void abort ();
172 
173  Temporal::timepos_t adjusted_time (Temporal::timepos_t const &, GdkEvent const *, bool snap = true) const;
174  Temporal::timepos_t adjusted_current_time (GdkEvent const *, bool snap = true) const;
175 
176  bool was_double_click() const { return _was_double_click; }
177  void set_double_click (bool yn) { _was_double_click = yn; }
178 
180 
185  virtual void start_grab (GdkEvent* e, Gdk::Cursor* c = 0);
186 
187  virtual bool end_grab (GdkEvent *);
188 
193  virtual void motion (GdkEvent* e, bool f) = 0;
194 
199  virtual void finished (GdkEvent* e, bool m) = 0;
200 
205  virtual void aborted (bool m) = 0;
206 
210  virtual bool active (Editing::MouseMode m) {
211  return true;
212  }
213 
214  bool preview_video () const {
215  return _preview_video;
216  }
217 
219  std::pair<Temporal::timecnt_t,int> move_threshold () const {
220  return std::make_pair (Temporal::timecnt_t (1, Temporal::AudioTime), 1);
221  }
222 
223  virtual bool allow_vertical_autoscroll () const {
224  return true;
225  }
226 
227  virtual bool allow_horizontal_autoscroll () const {
228  return true;
229  }
230 
232  virtual bool x_movement_matters () const {
233  return true;
234  }
235 
237  virtual bool y_movement_matters () const {
238  return true;
239  }
240 
241  virtual bool mid_drag_key_event (GdkEventKey*) { return false; }
242 
243  bool initially_vertical() const {
244  return _initially_vertical;
245  }
246 
248  virtual void setup_pointer_offset () {
250  }
251 
253  virtual void setup_video_offset () {
254  /* video offset is always in audio time */
256  _preview_video = false;
257  }
258 
259  int grab_button() const { return _grab_button; }
260 
261 protected:
262 
263  double grab_x () const {
264  return _grab_x;
265  }
266 
267  double grab_y () const {
268  return _grab_y;
269  }
270 
272 
274  return _raw_grab_time;
275  }
276 
278  return _grab_time.samples();
279  }
280 
282  return _grab_time;
283  }
284 
285  double last_pointer_x () const {
286  return _last_pointer_x;
287  }
288 
289  double last_pointer_y () const {
290  return _last_pointer_y;
291  }
292 
294  return _last_pointer_time.samples();
295  }
296 
298  return _last_pointer_time;
299  }
300 
301  Temporal::timecnt_t snap_delta (guint const) const;
302 
303  double current_pointer_x () const;
304  double current_pointer_y () const;
305 
306  /* sets snap delta from unsnapped pos */
308 
309  std::shared_ptr<ARDOUR::Region> add_midi_region (MidiTimeAxisView*, bool commit);
310 
312  void show_verbose_cursor_duration (Temporal::timepos_t const & , Temporal::timepos_t const & , double xoffset = 0);
313  void show_verbose_cursor_text (std::string const &);
315 
327 
328 private:
335  double _grab_x;
336  double _grab_y;
343 
344  /* difference between some key position's snapped and unsnapped
345  * samplepos. used for relative snap.
346  */
351 
353 };
354 
355 class RegionDrag;
356 
359 {
360 public:
362 
372  double layer;
373  double initial_y;
377  std::shared_ptr<ARDOUR::Playlist> initial_playlist;
379 };
380 
382 class RegionDrag : public Drag, public sigc::trackable
383 {
384 public:
385  RegionDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain, bool hide_snapped_cursor = true);
386  virtual ~RegionDrag () {}
387 
388 protected:
389 
391  std::list<DraggingView> _views;
392 
394  std::vector<TimeAxisView*> _time_axis_views;
396  int apply_track_delta (const int start, const int delta, const int skip, const bool distance_only = false) const;
397 
400  uint32_t _ntracks;
401 
403 
404  friend class DraggingView;
405 
406 protected:
408 
409 private:
410 
413 };
414 
417 {
418 public:
419 
420  RegionSlipContentsDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain td);
422 
423  virtual void start_grab (GdkEvent *, Gdk::Cursor *);
424  virtual void motion (GdkEvent *, bool);
425  virtual void finished (GdkEvent *, bool);
426  virtual void aborted (bool);
427 };
428 
431 {
432 public:
433  RegionBrushDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain td);
434  virtual ~RegionBrushDrag () {}
435 
436  virtual void start_grab (GdkEvent *, Gdk::Cursor *);
437  virtual void motion (GdkEvent *, bool);
438  virtual void finished (GdkEvent *, bool);
439  virtual void aborted (bool);
440 private:
441  typedef std::set<Temporal::timepos_t> TimePositionSet;
443 };
444 
447 {
448 public:
449 
450  RegionMotionDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain td);
451  virtual ~RegionMotionDrag () {}
452 
453  virtual void start_grab (GdkEvent *, Gdk::Cursor *);
454  virtual void motion (GdkEvent *, bool);
455  virtual void finished (GdkEvent *, bool);
456  virtual void aborted (bool);
457 
461  virtual bool regions_came_from_canvas () const = 0;
462 
463 protected:
464 
466  virtual bool y_movement_allowed (int, double, int skip_invisible = 0) const;
468 
474  std::vector<ArdourMarker*> ripple_markers;
475 
476 private:
477  uint32_t _ndropzone;
478  uint32_t _pdropzone;
479  uint32_t _ddropzone;
480 };
481 
482 
487 {
488 public:
489  RegionMoveDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, bool, Temporal::TimeDomain);
490  virtual ~RegionMoveDrag () {}
491 
492  void motion (GdkEvent *, bool);
493  void finished (GdkEvent *, bool);
494  void aborted (bool);
495 
497 
498  bool regions_came_from_canvas () const {
499  return true;
500  }
501 
502  std::pair<Temporal::timecnt_t,int> move_threshold () const {
503  return std::make_pair (Temporal::timecnt_t (4, Temporal::AudioTime), 4);
504  }
505 
507 
508 private:
510  bool const,
511  bool const,
512  Temporal::timepos_t const &,
513  int32_t const ev_state
514  );
515 
517  bool const,
518  bool const,
519  Temporal::timepos_t const &,
520  int32_t const ev_state
521  );
522 
524  std::shared_ptr<ARDOUR::Region>,
527  Temporal::timepos_t const &,
529  );
530 
532  std::shared_ptr<ARDOUR::Region>,
533  std::shared_ptr<ARDOUR::Playlist>,
534  ARDOUR::PlaylistSet& modified_playlists
535  );
536 
537 
539  RouteTimeAxisView* create_destination_time_axis (std::shared_ptr<ARDOUR::Region>, TimeAxisView* original);
540 
541  bool _copy;
543 };
544 
547 {
548 public:
549  RegionInsertDrag (Editor *, std::shared_ptr<ARDOUR::Region>, RouteTimeAxisView*, Temporal::timepos_t const &, Temporal::TimeDomain);
550 
551  void finished (GdkEvent *, bool);
552  void aborted (bool);
553 
554  bool regions_came_from_canvas () const {
555  return false;
556  }
557 };
558 
560 class RegionCutDrag : public Drag
561 {
562 public:
565 
566  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
567  void motion (GdkEvent*, bool);
568  void finished (GdkEvent*, bool);
569  void aborted (bool);
570 
571 private:
572 };
573 
575 class RegionCreateDrag : public Drag
576 {
577 public:
579 
580  void motion (GdkEvent *, bool);
581  void finished (GdkEvent *, bool);
582  void aborted (bool);
583 
584 private:
586  std::shared_ptr<ARDOUR::Region> _region;
587 };
588 
590 class NoteResizeDrag : public Drag
591 {
592 public:
594 
595  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
596  void motion (GdkEvent *, bool);
597  void finished (GdkEvent *, bool);
598  void aborted (bool);
599 
601  return false;
602  }
603 
604 private:
606  bool relative;
607  bool at_front;
609  double _snap_delta;
610 };
611 
613 class NoteDrag : public Drag
614 {
615 public:
617 
618  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
619  void motion (GdkEvent *, bool);
620  void finished (GdkEvent *, bool);
621  void aborted (bool);
622 
624 
626  return false;
627  }
628 
629 private:
630 
631  Temporal::timecnt_t total_dx (GdkEvent * event) const; // total movement in quarter notes
632  int8_t total_dy () const;
633 
638  Temporal::timepos_t _earliest; // earliest note in note selection
640  double _note_height;
641  bool _copy;
642 };
643 
644 class NoteCreateDrag : public Drag
645 {
646 public:
649 
650  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
651  void motion (GdkEvent *, bool);
652  void finished (GdkEvent *, bool);
653  void aborted (bool);
654 
656  return mode == Editing::MouseDraw || mode == Editing::MouseContent;
657  }
658 
660  return false;
661  }
662 
663  bool y_movement_matters () const {
664  return false;
665  }
666 
667 private:
668  double y_to_region (double) const;
669  Temporal::Beats round_to_grid (Temporal::timepos_t const & pos, GdkEvent const * event) const;
670 
672  std::pair<Temporal::timecnt_t,int> move_threshold () const {
673  return std::make_pair (Temporal::timecnt_t (0, Temporal::AudioTime), 0);
674  }
675 
679 };
680 
681 class HitCreateDrag : public Drag
682 {
683 public:
686 
687  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
688  void motion (GdkEvent *, bool) {}
689  void finished (GdkEvent *, bool);
690  void aborted (bool) {}
691 
693  return mode == Editing::MouseDraw || mode == Editing::MouseContent;
694  }
695 
696  bool y_movement_matters () const {
697  return false;
698  }
699 
700 private:
701  double y_to_region (double) const;
702 
704  std::pair<Temporal::timecnt_t,int> move_threshold () const {
705  return std::make_pair (Temporal::timecnt_t::zero (Temporal::AudioTime), 0);
706  }
707 
710  double _y;
711 
712 };
713 
715 class PatchChangeDrag : public Drag
716 {
717 public:
719 
720  void motion (GdkEvent *, bool);
721  void finished (GdkEvent *, bool);
722  void aborted (bool);
723 
724  bool y_movement_matters () const {
725  return false;
726  }
727 
729  return false;
730  }
731 
733 
734 private:
738 };
739 
742 {
743 public:
745 
748 };
749 
751 class VideoTimeLineDrag : public Drag
752 {
753 public:
755 
756  void motion (GdkEvent *, bool);
757  void finished (GdkEvent *, bool);
758  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
759 
760  bool y_movement_matters () const {
761  return false;
762  }
763 
765  return false;
766  }
767 
768  void aborted (bool);
769 
770 protected:
771  std::list<AVDraggingView> _views;
772 
773 private:
776  bool _stuck;
777 };
778 
780 class TrimDrag : public RegionDrag
781 {
782 public:
783  enum Operation {
785  EndTrim
786  };
787 
788  TrimDrag (Editor *, ArdourCanvas::Item *, RegionView*, std::list<RegionView*> const &, Temporal::TimeDomain td, bool preserve_fade_anchor = false);
789 
790  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
791  void motion (GdkEvent *, bool);
792  void finished (GdkEvent *, bool);
793  void aborted (bool);
794 
795  bool y_movement_matters () const {
796  return false;
797  }
798 
800  return false;
801  }
802 
804 
805 private:
806 
808 
811 
812  std::vector<RegionView::DisplaySuspender> suspenders;
813 };
814 
816 class MeterMarkerDrag : public Drag
817 {
818 public:
820 
821  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
822  void motion (GdkEvent *, bool);
823  void finished (GdkEvent *, bool);
824  void aborted (bool);
825 
827  return false;
828  }
829 
830  bool y_movement_matters () const {
831  return false;
832  }
833 
835 
836 private:
840 
841  bool _movable;
845 };
846 
848 class TempoCurveDrag : public Drag
849 {
850 public:
852 
853  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
854  void motion (GdkEvent *, bool);
855  void finished (GdkEvent *, bool);
856  void aborted (bool);
857 
858 private:
860  double initial_bpm;
863 };
864 
866 class TempoMarkerDrag : public Drag
867 {
868 public:
870 
871  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
872  void motion (GdkEvent *, bool);
873  void finished (GdkEvent *, bool);
874  void aborted (bool);
875 
877  return false;
878  }
879 
880  bool y_movement_matters () const {
881  return true;
882  }
883 
885 
886 private:
890 
891  bool _movable;
892  double _grab_bpm;
895 };
896 
898 class BBTMarkerDrag : public Drag
899 {
900 public:
902 
903  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
904  void motion (GdkEvent *, bool);
905  void finished (GdkEvent *, bool);
906  void aborted (bool);
907 
909  return false;
910  }
911 
912  bool y_movement_matters () const {
913  return false;
914  }
915 
917 
918 private:
922 
924 };
925 
926 class MappingEndDrag : public Drag
927 {
928 public:
930 
931  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
932  void motion (GdkEvent *, bool);
933  void finished (GdkEvent *, bool);
934  void aborted (bool);
935 
937  return false;
938  }
939 
941  return false;
942  }
943 
944  bool y_movement_matters () const {
945  return false;
946  }
947 
949 
950 private:
953  double _grab_bpm;
955 
958 };
959 
960 class MappingTwistDrag : public Drag
961 {
962 public:
967  XMLNode&,
968  bool ramped);
969 
970  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
971  void motion (GdkEvent *, bool);
972  void finished (GdkEvent *, bool);
973  void aborted (bool);
974 
976  return false;
977  }
978 
980  return false;
981  }
982 
983  bool y_movement_matters () const {
984  return false;
985  }
986 
988 
989 private:
994 
995  double direction;
996  double delta;
999 
1002  bool _do_ramp;
1003 };
1004 
1005 
1007 class TempoTwistDrag : public Drag
1008 {
1009 public:
1011 
1012  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1013  void motion (GdkEvent *, bool);
1014  void finished (GdkEvent *, bool);
1015  void aborted (bool);
1016 
1018  return false;
1019  }
1020 
1021  bool y_movement_matters () const {
1022  return true;
1023  }
1024 
1026 
1027 private:
1034 };
1035 
1037 class TempoEndDrag : public Drag
1038 {
1039 public:
1041 
1042  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1043  void motion (GdkEvent *, bool);
1044  void finished (GdkEvent *, bool);
1045  void aborted (bool);
1046 
1048  return false;
1049  }
1050 
1051  bool y_movement_matters () const {
1052  return true;
1053  }
1054 
1056 
1057 private:
1062 
1065 };
1066 
1068 class CursorDrag : public Drag
1069 {
1070 public:
1072 
1073  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1074  void motion (GdkEvent *, bool);
1075  void finished (GdkEvent *, bool);
1076  void aborted (bool);
1077 
1079  return false;
1080  }
1081 
1082  bool y_movement_matters () const {
1083  return true;
1084  }
1085 
1086 private:
1088 
1090  bool _stop;
1091  double _grab_zoom;
1092 
1093  //used for zooming
1098 };
1099 
1101 class FadeInDrag : public RegionDrag
1102 {
1103 public:
1104  FadeInDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain);
1105 
1106  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1107  void motion (GdkEvent *, bool);
1108  void finished (GdkEvent *, bool);
1109  void aborted (bool);
1110 
1111  bool y_movement_matters () const {
1112  return false;
1113  }
1114 
1116  return false;
1117  }
1118 
1120 };
1121 
1123 class FadeOutDrag : public RegionDrag
1124 {
1125 public:
1126  FadeOutDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain td);
1127 
1128  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1129  void motion (GdkEvent *, bool);
1130  void finished (GdkEvent *, bool);
1131  void aborted (bool);
1132 
1133  bool y_movement_matters () const {
1134  return false;
1135  }
1136 
1138  return false;
1139  }
1140 
1142 };
1143 
1145 class MarkerDrag : public Drag
1146 {
1147 public:
1150 
1151  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1152  void motion (GdkEvent *, bool);
1153  void finished (GdkEvent *, bool);
1154  void aborted (bool);
1155 
1157  return false;
1158  }
1159 
1160  bool y_movement_matters () const {
1161  return false;
1162  }
1163 
1166 
1167 private:
1169 
1174  std::vector<ArdourMarker*> markers;
1177  };
1178 
1179  std::vector<ARDOUR::Location::ChangeSuspender> lcs;
1180 
1181  typedef std::list<CopiedLocationMarkerInfo> CopiedLocationInfo;
1184 };
1185 
1187 class ControlPointDrag : public Drag
1188 {
1189 public:
1191 
1192  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1193  void motion (GdkEvent *, bool);
1194  void finished (GdkEvent *, bool);
1195  void aborted (bool);
1196 
1198 
1200  return false;
1201  }
1202 
1203 
1204 private:
1205 
1210  bool _pushing;
1211  uint32_t _final_index;
1212  static double _zero_gain_fraction;
1213 
1215 };
1216 
1218 class LineDrag : public Drag
1219 {
1220 public:
1223 
1224  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1225  void motion (GdkEvent *, bool);
1226  void finished (GdkEvent *, bool);
1227  void aborted (bool);
1228 
1230  return false;
1231  }
1232 
1233 private:
1234 
1239  uint32_t _before;
1240  uint32_t _after;
1242 };
1243 
1245 class FeatureLineDrag : public Drag
1246 {
1247 public:
1249 
1250  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1251  void motion (GdkEvent *, bool);
1252  void finished (GdkEvent *, bool);
1253  void aborted (bool);
1254 
1255 private:
1256 
1259 
1262 
1263  float _before;
1264  uint32_t _max_x;
1265 };
1266 
1269 {
1270 public:
1272 
1273  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1274  void motion (GdkEvent *, bool);
1275  void finished (GdkEvent *, bool);
1276  void aborted (bool);
1277 
1278  std::pair<Temporal::timecnt_t,int> move_threshold () const {
1279  return std::make_pair (Temporal::timecnt_t (8, Temporal::AudioTime), 1);
1280  }
1281 
1282  void do_select_things (GdkEvent *, bool);
1283 
1292  virtual void select_things (int button_state, Temporal::timepos_t const & x1, Temporal::timepos_t const & x2, double y1, double y2, bool drag_in_progress) = 0;
1293 
1294  virtual void deselect_things () = 0;
1295 
1296  protected:
1298 };
1299 
1302 {
1303 public:
1305 
1306  void select_things (int, Temporal::timepos_t const &, Temporal::timepos_t const &, double, double, bool);
1308 };
1309 
1312 {
1313 public:
1315 
1316  void select_things (int, Temporal::timepos_t const &, Temporal::timepos_t const &, double, double, bool);
1318 
1319 private:
1321 };
1322 
1325 {
1326 public:
1328 
1329  void select_things (int, Temporal::timepos_t const &, Temporal::timepos_t const &, double, double, bool);
1331 
1332 private:
1334 };
1335 
1337 class TimeFXDrag : public RegionDrag
1338 {
1339 public:
1340  TimeFXDrag (Editor *, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain td);
1341 
1342  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1343  void motion (GdkEvent *, bool);
1344  void finished (GdkEvent *, bool);
1345  void aborted (bool);
1346 private:
1348 };
1349 
1351 class SelectionDrag : public Drag
1352 {
1353 public:
1354  enum Operation {
1360  };
1361 
1363 
1364  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1365  void motion (GdkEvent *, bool);
1366  void finished (GdkEvent *, bool);
1367  void aborted (bool);
1368 
1370 
1371 private:
1373  bool _add;
1378 };
1379 
1382 {
1383 public:
1385 
1387  void motion (GdkEvent*, bool);
1388  void finished (GdkEvent *, bool);
1389  void aborted (bool);
1390 
1391 private:
1395 };
1396 
1398 class RangeMarkerBarDrag : public Drag
1399 {
1400 public:
1401  enum Operation {
1406  };
1407 
1410 
1411  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1412  void motion (GdkEvent *, bool);
1413  void finished (GdkEvent *, bool);
1414  void aborted (bool);
1415 
1417  return false;
1418  }
1419 
1420  bool y_movement_matters () const {
1421  return false;
1422  }
1423 
1424 private:
1426 
1429  bool _copy;
1430 };
1431 
1433 class MouseZoomDrag : public Drag
1434 {
1435 public:
1437 
1438  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1439  void motion (GdkEvent *, bool);
1440  void finished (GdkEvent *, bool);
1441  void aborted (bool);
1442 
1443  std::pair<Temporal::timecnt_t,int> move_threshold () const {
1444  return std::make_pair (Temporal::timecnt_t (4, Temporal::AudioTime), 4);
1445  }
1446 
1447 private:
1449 };
1450 
1455 {
1456 public:
1457  AutomationRangeDrag (Editor *, AutomationTimeAxisView *, float initial_value, std::list<ARDOUR::TimelineRange> const &);
1458  AutomationRangeDrag (Editor *, std::list<RegionView*> const &, std::list<ARDOUR::TimelineRange> const &, double y_origin, double y_height);
1459 
1460  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1461  void motion (GdkEvent *, bool);
1462  void finished (GdkEvent *, bool);
1463  void aborted (bool);
1464 
1465  bool x_movement_matters () const {
1466  return false;
1467  }
1468 
1469 private:
1470  void setup (std::list<std::shared_ptr<AutomationLine> > const &);
1471  double y_fraction (double global_y_position) const;
1472  double value (std::shared_ptr<ARDOUR::AutomationList> list, Temporal::timepos_t const & x) const;
1473 
1474  std::list<ARDOUR::TimelineRange> _ranges;
1475 
1477  struct Line {
1478  std::shared_ptr<AutomationLine> line;
1479  std::list<ControlPoint*> points;
1480  std::pair<Temporal::timepos_t, Temporal::timepos_t> range;
1482  };
1483 
1484  std::list<Line> _lines;
1485  double _y_origin;
1486  double _y_height;
1490 };
1491 
1494 class CrossfadeEdgeDrag : public Drag
1495 {
1496 public:
1498 
1500  void motion (GdkEvent*, bool);
1501  void finished (GdkEvent*, bool);
1502  void aborted (bool);
1503 
1504  bool y_movement_matters () const {
1505  return false;
1506  }
1507 
1508  std::pair<Temporal::timecnt_t,int> move_threshold () const {
1509  return std::make_pair (Temporal::timecnt_t (4, Temporal::AudioTime), 4);
1510  }
1511 
1512 private:
1514  bool start;
1515 };
1516 
1517 class RegionMarkerDrag : public Drag
1518 {
1519  public:
1522 
1523  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1524  void motion (GdkEvent *, bool);
1525  void finished (GdkEvent *, bool);
1526  void aborted (bool);
1527 
1529  return false;
1530  }
1531 
1532  bool y_movement_matters () const {
1533  return false;
1534  }
1535 
1537 
1538  private:
1543 };
1544 
1545 
1546 class LollipopDrag : public Drag
1547 {
1548  public:
1551 
1552  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1553  void motion (GdkEvent *, bool);
1554  void finished (GdkEvent *, bool);
1555  void aborted (bool);
1556 
1558  return false;
1559  }
1560 
1562  return false;
1563  }
1564 
1565  bool x_movement_matters () const {
1566  return false;
1567  }
1568 
1570 
1571  private:
1574 };
1575 
1576 template<typename OrderedPointList, typename OrderedPoint>
1577 class FreehandLineDrag : public Drag
1578 {
1579  public:
1582 
1583  void motion (GdkEvent*, bool);
1584  void finished (GdkEvent*, bool);
1586  virtual void point_added (ArdourCanvas::Duple const & d, ArdourCanvas::Rectangle const & r, double last_x) {}
1587  virtual void line_extended (ArdourCanvas::Duple const & from, ArdourCanvas::Duple const & to, ArdourCanvas::Rectangle const & r, double last_x) {
1588  point_added (to, r, last_x);
1589  }
1590 
1591  protected:
1592  ArdourCanvas::Item* parent; /* we do not own this. If null, use base_rect as the parent */
1593  ArdourCanvas::Rectangle& base_rect; /* we do not own this */
1596  int edge_x;
1597  bool did_snap;
1599  OrderedPointList drawn_points;
1602 
1603  void maybe_add_point (GdkEvent*, Temporal::timepos_t const &, bool first_move);
1604 };
1605 
1606 class AutomationDrawDrag : public FreehandLineDrag<Evoral::ControlList::OrderedPoints, Evoral::ControlList::OrderedPoint>
1607 {
1608  public:
1611 
1612  void finished (GdkEvent*, bool);
1613  void aborted (bool) {}
1614 };
1615 
1616 class VelocityLineDrag : public FreehandLineDrag<Evoral::ControlList::OrderedPoints, Evoral::ControlList::OrderedPoint>
1617 {
1618  public:
1621 
1622  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1623  void finished (GdkEvent*, bool);
1624  void aborted (bool);
1625  void point_added (ArdourCanvas::Duple const & d, ArdourCanvas::Rectangle const & r, double last_x);
1626  void line_extended (ArdourCanvas::Duple const & from, ArdourCanvas::Duple const & to, ArdourCanvas::Rectangle const & r, double last_x);
1627 
1628  private:
1631 };
1632 
1633 
1634 
1635 #endif /* __gtk2_ardour_editor_drag_h_ */
AVDraggingView(RegionView *)
samplepos_t initial_position
initial position of the region
Definition: editor_drag.h:747
RegionView * view
the view
Definition: editor_drag.h:746
AutomationDrawDrag(Editor *, ArdourCanvas::Item *, ArdourCanvas::Rectangle &, Temporal::TimeDomain)
void aborted(bool)
Definition: editor_drag.h:1613
void finished(GdkEvent *, bool)
AutomationRangeDrag(Editor *, AutomationTimeAxisView *, float initial_value, std::list< ARDOUR::TimelineRange > const &)
std::list< ARDOUR::TimelineRange > _ranges
Definition: editor_drag.h:1474
double y_fraction(double global_y_position) const
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
std::list< Line > _lines
Definition: editor_drag.h:1484
double value(std::shared_ptr< ARDOUR::AutomationList > list, Temporal::timepos_t const &x) const
AutomationRangeDrag(Editor *, std::list< RegionView * > const &, std::list< ARDOUR::TimelineRange > const &, double y_origin, double y_height)
void finished(GdkEvent *, bool)
void setup(std::list< std::shared_ptr< AutomationLine > > const &)
bool x_movement_matters() const
Definition: editor_drag.h:1465
void motion(GdkEvent *, bool)
void setup_pointer_offset()
XMLNode * _before_state
Definition: editor_drag.h:923
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:921
bool y_movement_matters() const
Definition: editor_drag.h:912
BBTMarkerDrag(Editor *, ArdourCanvas::Item *)
void aborted(bool)
BBTMarker * _marker
Definition: editor_drag.h:919
void finished(GdkEvent *, bool)
void motion(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:908
Temporal::MusicTimePoint const * _point
Definition: editor_drag.h:920
uint32_t _final_index
Definition: editor_drag.h:1211
void motion(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1199
ControlPointDrag(Editor *, ArdourCanvas::Item *)
Temporal::timecnt_t total_dt(GdkEvent *) const
bool active(Editing::MouseMode m)
ControlPoint * _point
Definition: editor_drag.h:1206
void aborted(bool)
void finished(GdkEvent *, bool)
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
static double _zero_gain_fraction
Definition: editor_drag.h:1212
double _cumulative_y_drag
Definition: editor_drag.h:1209
AudioRegionView * arv
Definition: editor_drag.h:1513
std::pair< Temporal::timecnt_t, int > move_threshold() const
Definition: editor_drag.h:1508
bool y_movement_matters() const
Definition: editor_drag.h:1504
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void aborted(bool)
CrossfadeEdgeDrag(Editor *, AudioRegionView *, ArdourCanvas::Item *, bool start)
void finished(GdkEvent *, bool)
void motion(GdkEvent *, bool)
std::shared_ptr< CursorContext > Handle
void finished(GdkEvent *, bool)
void motion(GdkEvent *, bool)
double _grab_zoom
editor samples per unit when our grab started
Definition: editor_drag.h:1091
int _last_y_delta
Definition: editor_drag.h:1097
bool _stop
true to stop the transport on starting the drag, otherwise false
Definition: editor_drag.h:1090
EditorCursor & _cursor
Definition: editor_drag.h:1089
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1078
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
CursorDrag(Editor *, EditorCursor &, bool)
void aborted(bool)
void fake_locate(samplepos_t)
bool y_movement_matters() const
Definition: editor_drag.h:1082
void abort()
bool preview_video() const
Editor * _editor
Definition: editor_drag.h:141
bool mid_drag_key_event(GdkEventKey *)
DragManager(Editor *e)
Temporal::timepos_t _current_pointer_time
time that the pointer is now at
Definition: editor_drag.h:146
bool ending() const
Definition: editor_drag.h:109
bool _old_follow_playhead
state of Editor::follow_playhead() before the drags started
Definition: editor_drag.h:147
void set(Drag *, GdkEvent *, Gdk::Cursor *c=MouseCursors::invalid_cursor())
bool have_item(ArdourCanvas::Item *) const
void start_grab(GdkEvent *, Gdk::Cursor *c=MouseCursors::invalid_cursor())
bool end_grab(GdkEvent *)
std::list< Drag * > _drags
Definition: editor_drag.h:142
double current_pointer_x() const
Definition: editor_drag.h:118
bool active() const
Definition: editor_drag.h:113
double current_pointer_y() const
Definition: editor_drag.h:123
double _current_pointer_y
canvas-coordinate space y of the current pointer
Definition: editor_drag.h:145
void add(Drag *)
Temporal::timepos_t current_pointer_time() const
Definition: editor_drag.h:133
double _current_pointer_x
canvas-coordinate space x of the current pointer
Definition: editor_drag.h:144
bool _ending
true if end_grab or abort is in progress, otherwise false
Definition: editor_drag.h:143
bool motion_handler(GdkEvent *, bool)
ARDOUR::samplepos_t current_pointer_sample() const
Definition: editor_drag.h:128
void mark_double_click()
Temporal::timepos_t last_pointer_time() const
Definition: editor_drag.h:297
double last_pointer_y() const
Definition: editor_drag.h:289
virtual bool active(Editing::MouseMode m)
Definition: editor_drag.h:210
std::pair< Temporal::timecnt_t, int > move_threshold() const
Definition: editor_drag.h:219
void set_double_click(bool yn)
Definition: editor_drag.h:177
virtual bool y_movement_matters() const
Definition: editor_drag.h:237
Temporal::timepos_t adjusted_current_time(GdkEvent const *, bool snap=true) const
void set_time_domain(Temporal::TimeDomain)
ArdourCanvas::Item * item() const
Definition: editor_drag.h:162
virtual void setup_pointer_offset()
Definition: editor_drag.h:248
double _last_pointer_x
trackview x of the pointer last time a motion occurred
Definition: editor_drag.h:337
virtual void start_grab(GdkEvent *e, Gdk::Cursor *c=0)
Editor * _editor
our editor
Definition: editor_drag.h:316
ArdourCanvas::Item * _item
our item
Definition: editor_drag.h:318
Temporal::timecnt_t _video_offset
Definition: editor_drag.h:321
bool _y_constrained
true if y motion is constrained, otherwise false
Definition: editor_drag.h:324
void abort()
Gtkmm2ext::Bindings::DragsBlockBindings binding_blocker
Definition: editor_drag.h:352
Temporal::TimeDomain time_domain() const
Definition: editor_drag.h:166
Temporal::timepos_t pixel_to_time(double x) const
virtual ~Drag()
Temporal::timepos_t _last_pointer_time
adjusted_time the last time a motion occurred
Definition: editor_drag.h:341
Temporal::timecnt_t snap_delta(guint const) const
void show_verbose_cursor_time(Temporal::timepos_t const &)
virtual bool allow_horizontal_autoscroll() const
Definition: editor_drag.h:227
Temporal::timepos_t adjusted_time(Temporal::timepos_t const &, GdkEvent const *, bool snap=true) const
double _grab_y
y of the grab start position, possibly adjusted if _trackview_only is true
Definition: editor_drag.h:336
void set_manager(DragManager *m)
Definition: editor_drag.h:157
Drag(Editor *, ArdourCanvas::Item *, Temporal::TimeDomain td, bool trackview_only=true, bool hide_snapped_cursor=true)
bool _move_threshold_passed
true if the move threshold has been passed, otherwise false
Definition: editor_drag.h:331
void set_grab_button_anyway(GdkEvent *)
DragManager * _drags
Definition: editor_drag.h:317
bool _was_double_click
true if drag initiated by a double click event
Definition: editor_drag.h:334
void show_view_preview(Temporal::timepos_t const &)
Temporal::timecnt_t _pointer_offset
Definition: editor_drag.h:320
bool _initially_vertical
true if after move threshold is passed we appear to be moving vertically; undefined before that
Definition: editor_drag.h:333
ARDOUR::timepos_t _earliest_time_limit
time we cannot drag before (defaults to 0, indicating no such limit)
Definition: editor_drag.h:326
double current_pointer_y() const
virtual bool mid_drag_key_event(GdkEventKey *)
Definition: editor_drag.h:241
std::shared_ptr< ARDOUR::Region > add_midi_region(MidiTimeAxisView *, bool commit)
int grab_button() const
Definition: editor_drag.h:259
bool _preview_video
Definition: editor_drag.h:322
virtual void motion(GdkEvent *e, bool f)=0
virtual bool allow_vertical_autoscroll() const
Definition: editor_drag.h:223
virtual bool end_grab(GdkEvent *)
double last_pointer_x() const
Definition: editor_drag.h:285
ARDOUR::samplepos_t last_pointer_sample() const
Definition: editor_drag.h:293
Temporal::timecnt_t _snap_delta
Definition: editor_drag.h:347
bool motion_handler(GdkEvent *, bool)
double _last_pointer_y
trackview y of the pointer last time a motion occurred
Definition: editor_drag.h:338
ARDOUR::samplepos_t grab_sample() const
Definition: editor_drag.h:277
CursorContext::Handle _cursor_ctx
cursor change context
Definition: editor_drag.h:348
int _grab_button
Definition: editor_drag.h:350
bool _hide_snapped_cursor
set true of Drag::motion does not call set_snapped_cursor_position
Definition: editor_drag.h:330
double current_pointer_x() const
bool _x_constrained
true if x motion is constrained, otherwise false
Definition: editor_drag.h:323
double grab_y() const
Definition: editor_drag.h:267
virtual void finished(GdkEvent *e, bool m)=0
Temporal::timepos_t _raw_grab_time
unsnapped time that the mouse was at when start_grab was called, or 0
Definition: editor_drag.h:339
bool initially_vertical() const
Definition: editor_drag.h:243
bool _trackview_only
true if pointer y value should always be relative to the top of the trackview group
Definition: editor_drag.h:329
Temporal::timepos_t raw_grab_time() const
Definition: editor_drag.h:273
bool was_double_click() const
Definition: editor_drag.h:176
virtual bool x_movement_matters() const
Definition: editor_drag.h:232
void show_verbose_cursor_duration(Temporal::timepos_t const &, Temporal::timepos_t const &, double xoffset=0)
bool _starting_point_passed
true if we called move () with first_move flag, otherwise false
Definition: editor_drag.h:332
virtual void aborted(bool m)=0
virtual void setup_video_offset()
Definition: editor_drag.h:253
bool _was_rolling
true if the session was rolling before the drag started, otherwise false
Definition: editor_drag.h:325
double _grab_x
trackview x of the grab start position
Definition: editor_drag.h:335
bool preview_video() const
Definition: editor_drag.h:214
Temporal::timepos_t grab_time() const
Definition: editor_drag.h:281
void swap_grab(ArdourCanvas::Item *, Gdk::Cursor *, uint32_t)
void show_verbose_cursor_text(std::string const &)
void setup_snap_delta(Temporal::timepos_t const &pos)
bool _constraint_pressed
if the keyboard indicated constraint modifier was pressed on start_grab()
Definition: editor_drag.h:349
Temporal::TimeDomain _time_domain
Definition: editor_drag.h:342
double grab_x() const
Definition: editor_drag.h:263
Temporal::timepos_t _grab_time
adjusted_time that the mouse was at when start_grab was called, or 0
Definition: editor_drag.h:340
samplepos_t anchored_fade_length
fade_length when anchored during drag
Definition: editor_drag.h:376
RegionView * view
the view
Definition: editor_drag.h:363
double layer
Definition: editor_drag.h:372
std::shared_ptr< ARDOUR::Playlist > initial_playlist
Definition: editor_drag.h:377
DraggingView(RegionView *, RegionDrag *, TimeAxisView *original_tav)
Temporal::timepos_t initial_position
initial position of the region
Definition: editor_drag.h:374
TimeAxisView * initial_time_axis_view
Definition: editor_drag.h:378
double initial_y
the initial y position of the view before any reparenting
Definition: editor_drag.h:373
int time_axis_view
Definition: editor_drag.h:367
Temporal::timepos_t initial_end
initial end position of the region
Definition: editor_drag.h:375
EditorRubberbandSelectDrag(Editor *, ArdourCanvas::Item *)
void select_things(int, Temporal::timepos_t const &, Temporal::timepos_t const &, double, double, bool)
Definition: editor.h:158
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1115
void setup_pointer_offset()
void aborted(bool)
void motion(GdkEvent *, bool)
bool y_movement_matters() const
Definition: editor_drag.h:1111
void finished(GdkEvent *, bool)
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
FadeInDrag(Editor *, ArdourCanvas::Item *, RegionView *, std::list< RegionView * > const &, Temporal::TimeDomain)
void aborted(bool)
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
bool y_movement_matters() const
Definition: editor_drag.h:1133
FadeOutDrag(Editor *, ArdourCanvas::Item *, RegionView *, std::list< RegionView * > const &, Temporal::TimeDomain td)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1137
void setup_pointer_offset()
void motion(GdkEvent *, bool)
void finished(GdkEvent *, bool)
ArdourCanvas::Line * _line
Definition: editor_drag.h:1257
FeatureLineDrag(Editor *e, ArdourCanvas::Item *i)
double _cumulative_x_drag
Definition: editor_drag.h:1261
double _region_view_grab_x
Definition: editor_drag.h:1260
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void motion(GdkEvent *, bool)
void aborted(bool)
void finished(GdkEvent *, bool)
AudioRegionView * _arv
Definition: editor_drag.h:1258
FreehandLineDrag(Editor *, ArdourCanvas::Item *, ArdourCanvas::Rectangle &, Temporal::TimeDomain)
ArdourCanvas::Coord line_start_y
Definition: editor_drag.h:1601
virtual void point_added(ArdourCanvas::Duple const &d, ArdourCanvas::Rectangle const &r, double last_x)
Definition: editor_drag.h:1586
void maybe_add_point(GdkEvent *, Temporal::timepos_t const &, bool first_move)
ArdourCanvas::Item * parent
Definition: editor_drag.h:1592
ArdourCanvas::Rectangle & base_rect
Definition: editor_drag.h:1593
ArdourCanvas::Coord line_start_x
Definition: editor_drag.h:1600
ArdourCanvas::PolyLine * dragging_line
Definition: editor_drag.h:1594
virtual void line_extended(ArdourCanvas::Duple const &from, ArdourCanvas::Duple const &to, ArdourCanvas::Rectangle const &r, double last_x)
Definition: editor_drag.h:1587
void finished(GdkEvent *, bool)
OrderedPointList drawn_points
Definition: editor_drag.h:1599
bool mid_drag_key_event(GdkEventKey *)
void motion(GdkEvent *, bool)
HitCreateDrag(Editor *, ArdourCanvas::Item *, MidiRegionView *)
void motion(GdkEvent *, bool)
Definition: editor_drag.h:688
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
MidiRegionView * _region_view
Definition: editor_drag.h:708
Temporal::timepos_t _last_pos
Definition: editor_drag.h:709
void finished(GdkEvent *, bool)
std::pair< Temporal::timecnt_t, int > move_threshold() const
Definition: editor_drag.h:704
double y_to_region(double) const
bool y_movement_matters() const
Definition: editor_drag.h:696
void aborted(bool)
Definition: editor_drag.h:690
bool active(Editing::MouseMode mode)
Definition: editor_drag.h:692
void aborted(bool)
bool have_command
Definition: editor_drag.h:1241
uint32_t _before
Definition: editor_drag.h:1239
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
double _fixed_grab_x
Definition: editor_drag.h:1236
LineDrag(Editor *e, ArdourCanvas::Item *i)
double _cumulative_y_drag
Definition: editor_drag.h:1238
AutomationLine * _line
Definition: editor_drag.h:1235
uint32_t _after
Definition: editor_drag.h:1240
void finished(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1229
void motion(GdkEvent *, bool)
double _fixed_grab_y
Definition: editor_drag.h:1237
ArdourCanvas::Lollipop * _primary
Definition: editor_drag.h:1573
void setup_pointer_offset()
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void aborted(bool)
LollipopDrag(Editor *, ArdourCanvas::Item *)
VelocityGhostRegion * _region
Definition: editor_drag.h:1572
bool allow_horizontal_autoscroll() const
Definition: editor_drag.h:1561
bool x_movement_matters() const
Definition: editor_drag.h:1565
void motion(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1557
void finished(GdkEvent *, bool)
double _grab_bpm
Definition: editor_drag.h:953
MappingEndDrag(Editor *, ArdourCanvas::Item *, Temporal::TempoMap::WritableSharedPtr &, Temporal::TempoPoint &, Temporal::TempoPoint &after, XMLNode &before_state)
bool y_movement_matters() const
Definition: editor_drag.h:944
void setup_pointer_offset()
void finished(GdkEvent *, bool)
void motion(GdkEvent *, bool)
XMLNode * _before_state
Definition: editor_drag.h:956
Temporal::TempoPoint & _tempo
Definition: editor_drag.h:951
bool allow_horizontal_autoscroll() const
Definition: editor_drag.h:940
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:936
void aborted(bool)
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:954
Temporal::TempoPoint & _after
Definition: editor_drag.h:952
void motion(GdkEvent *, bool)
bool y_movement_matters() const
Definition: editor_drag.h:983
bool allow_horizontal_autoscroll() const
Definition: editor_drag.h:979
double initial_focus_npm
Definition: editor_drag.h:997
Temporal::TempoPoint & focus
Definition: editor_drag.h:991
Temporal::TempoPoint & prev
Definition: editor_drag.h:990
MappingTwistDrag(Editor *, ArdourCanvas::Item *, Temporal::TempoMap::WritableSharedPtr &, Temporal::TempoPoint &prev, Temporal::TempoPoint &focus, Temporal::TempoPoint &next, XMLNode &, bool ramped)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:975
Temporal::TempoPoint & next
Definition: editor_drag.h:992
void setup_pointer_offset()
XMLNode * _before_state
Definition: editor_drag.h:1000
double initial_pre_npm
Definition: editor_drag.h:998
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:993
void aborted(bool)
void finished(GdkEvent *, bool)
void aborted(bool)
bool _selection_changed
Definition: editor_drag.h:1171
std::list< CopiedLocationMarkerInfo > CopiedLocationInfo
Definition: editor_drag.h:1181
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
bool y_movement_matters() const
Definition: editor_drag.h:1160
void finished(GdkEvent *, bool)
ArdourCanvas::Points _points
Definition: editor_drag.h:1183
CopiedLocationInfo _copied_locations
Definition: editor_drag.h:1182
std::vector< ARDOUR::Location::ChangeSuspender > lcs
Definition: editor_drag.h:1179
void setup_pointer_offset()
void update_item(ARDOUR::Location *)
ArdourMarker * _marker
marker being dragged
Definition: editor_drag.h:1170
void motion(GdkEvent *, bool)
void setup_video_offset()
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1156
MarkerDrag(Editor *, ArdourCanvas::Item *)
void finished(GdkEvent *, bool)
Temporal::superclock_t initial_sclock
Definition: editor_drag.h:839
void setup_pointer_offset()
void aborted(bool)
Editing::GridType _old_grid_type
Definition: editor_drag.h:842
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Editing::SnapMode _old_snap_mode
Definition: editor_drag.h:843
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:826
MeterMarker * _marker
Definition: editor_drag.h:837
void motion(GdkEvent *, bool)
MeterMarkerDrag(Editor *, ArdourCanvas::Item *, bool)
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:838
bool y_movement_matters() const
Definition: editor_drag.h:830
XMLNode * before_state
Definition: editor_drag.h:844
MidiRegionView * _region_view
Definition: editor_drag.h:1320
MidiRubberbandSelectDrag(Editor *, MidiRegionView *)
void select_things(int, Temporal::timepos_t const &, Temporal::timepos_t const &, double, double, bool)
void select_things(int, Temporal::timepos_t const &, Temporal::timepos_t const &, double, double, bool)
MidiVerticalSelectDrag(Editor *, MidiRegionView *)
MidiRegionView * _region_view
Definition: editor_drag.h:1333
static Gdk::Cursor * invalid_cursor()
Definition: mouse_cursors.h:84
std::pair< Temporal::timecnt_t, int > move_threshold() const
Definition: editor_drag.h:1443
void finished(GdkEvent *, bool)
void aborted(bool)
MouseZoomDrag(Editor *, ArdourCanvas::Item *)
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void motion(GdkEvent *, bool)
std::pair< Temporal::timecnt_t, int > move_threshold() const
Definition: editor_drag.h:672
void aborted(bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:659
Temporal::timepos_t _note[2]
Definition: editor_drag.h:678
bool active(Editing::MouseMode mode)
Definition: editor_drag.h:655
NoteCreateDrag(Editor *, ArdourCanvas::Item *, MidiRegionView *)
Temporal::Beats round_to_grid(Temporal::timepos_t const &pos, GdkEvent const *event) const
void finished(GdkEvent *, bool)
bool y_movement_matters() const
Definition: editor_drag.h:663
MidiRegionView * _region_view
Definition: editor_drag.h:676
void motion(GdkEvent *, bool)
double y_to_region(double) const
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
ArdourCanvas::Rectangle * _drag_rect
Definition: editor_drag.h:677
double _note_height
Definition: editor_drag.h:640
NoteBase * _primary
Definition: editor_drag.h:635
double _cumulative_dy
Definition: editor_drag.h:637
Temporal::timecnt_t total_dx(GdkEvent *event) const
void aborted(bool)
void setup_pointer_offset()
int8_t total_dy() const
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Temporal::timecnt_t _cumulative_dx
Definition: editor_drag.h:636
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:625
bool _copy
Definition: editor_drag.h:641
MidiRegionView * _region
Definition: editor_drag.h:634
void finished(GdkEvent *, bool)
Temporal::timepos_t _earliest
Definition: editor_drag.h:638
bool _was_selected
Definition: editor_drag.h:639
void motion(GdkEvent *, bool)
NoteDrag(Editor *, ArdourCanvas::Item *)
void finished(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:600
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
double _snap_delta
Definition: editor_drag.h:609
void aborted(bool)
MidiRegionView * region
Definition: editor_drag.h:605
NoteResizeDrag(Editor *, ArdourCanvas::Item *)
void motion(GdkEvent *, bool)
void finished(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:728
PatchChange * _patch_change
Definition: editor_drag.h:736
double _cumulative_dx
Definition: editor_drag.h:737
void aborted(bool)
void motion(GdkEvent *, bool)
void setup_pointer_offset()
PatchChangeDrag(Editor *, PatchChange *, MidiRegionView *)
MidiRegionView * _region_view
Definition: editor_drag.h:735
bool y_movement_matters() const
Definition: editor_drag.h:724
ArdourCanvas::Rectangle * _drag_rect
Definition: editor_drag.h:1428
void motion(GdkEvent *, bool)
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Operation _operation
Definition: editor_drag.h:1427
void aborted(bool)
void update_item(ARDOUR::Location *)
RangeMarkerBarDrag(Editor *, ArdourCanvas::Item *, Operation)
bool y_movement_matters() const
Definition: editor_drag.h:1420
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1416
void finished(GdkEvent *, bool)
std::set< Temporal::timepos_t > TimePositionSet
Definition: editor_drag.h:441
virtual void finished(GdkEvent *, bool)
virtual void aborted(bool)
TimePositionSet _already_pasted
Definition: editor_drag.h:442
virtual void motion(GdkEvent *, bool)
RegionBrushDrag(Editor *, ArdourCanvas::Item *, RegionView *, std::list< RegionView * > const &, Temporal::TimeDomain td)
virtual void start_grab(GdkEvent *, Gdk::Cursor *)
virtual ~RegionBrushDrag()
Definition: editor_drag.h:434
MidiTimeAxisView * _view
Definition: editor_drag.h:585
void finished(GdkEvent *, bool)
RegionCreateDrag(Editor *, ArdourCanvas::Item *, TimeAxisView *)
void aborted(bool)
std::shared_ptr< ARDOUR::Region > _region
Definition: editor_drag.h:586
void motion(GdkEvent *, bool)
RegionCutDrag(Editor *, ArdourCanvas::Item *, samplepos_t)
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void motion(GdkEvent *, bool)
void finished(GdkEvent *, bool)
void aborted(bool)
virtual ~RegionDrag()
Definition: editor_drag.h:386
RegionDrag(Editor *, ArdourCanvas::Item *, RegionView *, std::list< RegionView * > const &, Temporal::TimeDomain, bool hide_snapped_cursor=true)
uint32_t _ntracks
Definition: editor_drag.h:400
RegionView * _primary
the view that was clicked on (or whatever) to start the drag
Definition: editor_drag.h:390
void region_going_away(RegionView *)
void setup_video_offset()
int _visible_y_high
Definition: editor_drag.h:399
std::list< DraggingView > _views
information about all views that are being dragged
Definition: editor_drag.h:391
PBD::ScopedConnection death_connection
Definition: editor_drag.h:412
int apply_track_delta(const int start, const int delta, const int skip, const bool distance_only=false) const
void add_stateful_diff_commands_for_playlists(ARDOUR::PlaylistSet const &)
int find_time_axis_view(TimeAxisView *) const
std::vector< TimeAxisView * > _time_axis_views
Definition: editor_drag.h:394
int _visible_y_low
Definition: editor_drag.h:398
void finished(GdkEvent *, bool)
bool regions_came_from_canvas() const
Definition: editor_drag.h:554
void aborted(bool)
RegionInsertDrag(Editor *, std::shared_ptr< ARDOUR::Region >, RouteTimeAxisView *, Temporal::timepos_t const &, Temporal::TimeDomain)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1528
RegionMarkerDrag(Editor *, RegionView *, ArdourCanvas::Item *)
void aborted(bool)
ARDOUR::CueMarker model
Definition: editor_drag.h:1541
ARDOUR::CueMarker dragging_model
Definition: editor_drag.h:1542
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void finished(GdkEvent *, bool)
void setup_pointer_offset()
ArdourMarker * view
Definition: editor_drag.h:1540
bool y_movement_matters() const
Definition: editor_drag.h:1532
void motion(GdkEvent *, bool)
RegionView * rv
Definition: editor_drag.h:1539
uint32_t _ddropzone
Definition: editor_drag.h:479
virtual bool y_movement_allowed(int, double, int skip_invisible=0) const
uint32_t _ndropzone
Definition: editor_drag.h:477
uint32_t _pdropzone
Definition: editor_drag.h:478
std::vector< ArdourMarker * > ripple_markers
Definition: editor_drag.h:474
virtual void finished(GdkEvent *, bool)
double compute_x_delta(GdkEvent const *, Temporal::timepos_t &)
void collect_ripple_views()
virtual void start_grab(GdkEvent *, Gdk::Cursor *)
RegionMotionDrag(Editor *, ArdourCanvas::Item *, RegionView *, std::list< RegionView * > const &, Temporal::TimeDomain td)
virtual void motion(GdkEvent *, bool)
Temporal::timepos_t _last_position
last position of the thing being dragged
Definition: editor_drag.h:470
virtual bool regions_came_from_canvas() const =0
virtual ~RegionMotionDrag()
Definition: editor_drag.h:451
double _last_pointer_layer
Definition: editor_drag.h:473
double _total_x_delta
Definition: editor_drag.h:471
virtual void aborted(bool)
int _last_pointer_time_axis_view
Definition: editor_drag.h:472
void aborted(bool)
RegionView * _new_region_view
Definition: editor_drag.h:542
void remove_region_from_playlist(std::shared_ptr< ARDOUR::Region >, std::shared_ptr< ARDOUR::Playlist >, ARDOUR::PlaylistSet &modified_playlists)
bool regions_came_from_canvas() const
Definition: editor_drag.h:498
std::pair< Temporal::timecnt_t, int > move_threshold() const
Definition: editor_drag.h:502
RegionView * insert_region_into_playlist(std::shared_ptr< ARDOUR::Region >, RouteTimeAxisView *, ARDOUR::layer_t, Temporal::timepos_t const &, ARDOUR::PlaylistSet &)
void finished(GdkEvent *, bool)
void clear_draggingview_list()
void setup_pointer_offset()
RegionMoveDrag(Editor *, ArdourCanvas::Item *, RegionView *, std::list< RegionView * > const &, bool, Temporal::TimeDomain)
void motion(GdkEvent *, bool)
void finished_no_copy(bool const, bool const, Temporal::timepos_t const &, int32_t const ev_state)
void collect_new_region_view(RegionView *)
virtual ~RegionMoveDrag()
Definition: editor_drag.h:490
void finished_copy(bool const, bool const, Temporal::timepos_t const &, int32_t const ev_state)
RouteTimeAxisView * create_destination_time_axis(std::shared_ptr< ARDOUR::Region >, TimeAxisView *original)
virtual ~RegionSlipContentsDrag()
Definition: editor_drag.h:421
virtual void aborted(bool)
virtual void start_grab(GdkEvent *, Gdk::Cursor *)
virtual void finished(GdkEvent *, bool)
RegionSlipContentsDrag(Editor *, ArdourCanvas::Item *, RegionView *, std::list< RegionView * > const &, Temporal::TimeDomain td)
virtual void motion(GdkEvent *, bool)
void do_select_things(GdkEvent *, bool)
RubberbandSelectDrag(Editor *, ArdourCanvas::Item *)
std::pair< Temporal::timecnt_t, int > move_threshold() const
Definition: editor_drag.h:1278
void finished(GdkEvent *, bool)
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
virtual void deselect_things()=0
void motion(GdkEvent *, bool)
virtual void select_things(int button_state, Temporal::timepos_t const &x1, Temporal::timepos_t const &x2, double y1, double y2, bool drag_in_progress)=0
void finished(GdkEvent *, bool)
TrackSelection _track_selection_at_start
Definition: editor_drag.h:1374
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void setup_pointer_offset()
bool _time_selection_at_start
Definition: editor_drag.h:1375
void aborted(bool)
SelectionDrag(Editor *, ArdourCanvas::Item *, Operation)
Temporal::timepos_t end_at_start
Definition: editor_drag.h:1377
Temporal::timepos_t start_at_start
Definition: editor_drag.h:1376
Operation _operation
Definition: editor_drag.h:1372
void motion(GdkEvent *, bool)
Temporal::timepos_t _end_at_start
Definition: editor_drag.h:1394
void finished(GdkEvent *, bool)
void motion(GdkEvent *, bool)
Temporal::timepos_t _start_at_start
Definition: editor_drag.h:1393
SelectionMarkerDrag(Editor *, ArdourCanvas::Item *)
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void aborted(bool)
TempoCurveDrag(Editor *, ArdourCanvas::Item *)
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void finished(GdkEvent *, bool)
Temporal::TempoPoint * point
Definition: editor_drag.h:859
XMLNode * _before_state
Definition: editor_drag.h:862
void motion(GdkEvent *, bool)
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:861
double initial_bpm
Definition: editor_drag.h:860
bool y_movement_matters() const
Definition: editor_drag.h:1051
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1047
XMLNode * _before_state
Definition: editor_drag.h:1063
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:1061
void aborted(bool)
Temporal::Beats _grab_qn
Definition: editor_drag.h:1058
void motion(GdkEvent *, bool)
Temporal::TempoPoint * previous_tempo
Definition: editor_drag.h:1060
TempoEndDrag(Editor *, ArdourCanvas::Item *)
void setup_pointer_offset()
void finished(GdkEvent *, bool)
Temporal::TempoPoint * _tempo
Definition: editor_drag.h:1059
TempoMarker * _marker
Definition: editor_drag.h:887
XMLNode * _before_state
Definition: editor_drag.h:894
void motion(GdkEvent *, bool)
void setup_pointer_offset()
Temporal::TempoPoint const * _real_section
Definition: editor_drag.h:888
TempoMarkerDrag(Editor *, ArdourCanvas::Item *)
void aborted(bool)
void finished(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:876
bool y_movement_matters() const
Definition: editor_drag.h:880
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Temporal::Beats _grab_qn
Definition: editor_drag.h:893
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:889
Temporal::Beats _grab_qn
Definition: editor_drag.h:1028
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void setup_pointer_offset()
void finished(GdkEvent *, bool)
XMLNode * _before_state
Definition: editor_drag.h:1033
void motion(GdkEvent *, bool)
void aborted(bool)
bool y_movement_matters() const
Definition: editor_drag.h:1021
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1017
TempoTwistDrag(Editor *, ArdourCanvas::Item *)
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:1031
Temporal::TempoPoint const * _next_tempo
Definition: editor_drag.h:1030
Temporal::TempoPoint * _tempo
Definition: editor_drag.h:1029
std::shared_ptr< TempoMap > WritableSharedPtr
static timecnt_t zero(TimeDomain td)
Definition: timeline.h:326
int64_t samples() const
Definition: timeline.h:91
TimeFXDrag(Editor *, ArdourCanvas::Item *, RegionView *, std::list< RegionView * > const &, Temporal::TimeDomain td)
void finished(GdkEvent *, bool)
bool _dragging_start
Definition: editor_drag.h:1347
void aborted(bool)
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void motion(GdkEvent *, bool)
void setup_pointer_offset()
void aborted(bool)
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
TrimDrag(Editor *, ArdourCanvas::Item *, RegionView *, std::list< RegionView * > const &, Temporal::TimeDomain td, bool preserve_fade_anchor=false)
void finished(GdkEvent *, bool)
void motion(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:799
bool _preserve_fade_anchor
Definition: editor_drag.h:809
bool _jump_position_when_done
Definition: editor_drag.h:810
Operation _operation
Definition: editor_drag.h:807
bool y_movement_matters() const
Definition: editor_drag.h:795
std::vector< RegionView::DisplaySuspender > suspenders
Definition: editor_drag.h:812
void point_added(ArdourCanvas::Duple const &d, ArdourCanvas::Rectangle const &r, double last_x)
VelocityLineDrag(Editor *, ArdourCanvas::Rectangle &, Temporal::TimeDomain)
VelocityGhostRegion * grv
Definition: editor_drag.h:1629
void line_extended(ArdourCanvas::Duple const &from, ArdourCanvas::Duple const &to, ArdourCanvas::Rectangle const &r, double last_x)
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void aborted(bool)
void finished(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:764
bool y_movement_matters() const
Definition: editor_drag.h:760
std::list< AVDraggingView > _views
information about all audio that are being dragged along
Definition: editor_drag.h:771
VideoTimeLineDrag(Editor *e, ArdourCanvas::Item *i)
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
ARDOUR::sampleoffset_t _startdrag_video_offset
Definition: editor_drag.h:774
ARDOUR::sampleoffset_t _max_backwards_drag
Definition: editor_drag.h:775
void finished(GdkEvent *, bool)
void motion(GdkEvent *, bool)
void aborted(bool)
Definition: xml++.h:114
PBD::PropertyDescriptor< timepos_t > start
Temporal::timecnt_t timecnt_t
std::set< std::shared_ptr< Playlist > > PlaylistSet
Temporal::sampleoffset_t sampleoffset_t
Temporal::samplepos_t samplepos_t
uint32_t layer_t
std::vector< Duple > Points
SnapMode
Definition: editing.h:71
GridType
Definition: editing.h:53
MouseMode
Definition: editing.h:99
Definition: axis_view.h:42
int64_t superclock_t
Definition: superclock.h:35
std::list< ControlPoint * > points
points to drag on the line
Definition: editor_drag.h:1479
std::pair< Temporal::timepos_t, Temporal::timepos_t > range
the range of all points on the line, in session time
Definition: editor_drag.h:1480
std::shared_ptr< AutomationLine > line
the line
Definition: editor_drag.h:1478
XMLNode * state
the XML state node before the drag
Definition: editor_drag.h:1481
std::vector< ArdourMarker * > markers
Definition: editor_drag.h:1174
CopiedLocationMarkerInfo(ARDOUR::Location *l, ArdourMarker *m)