Ardour  9.0-pre0-1971-g33f1681c76
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 <ydk/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 "editor_items.h"
45 #include "mouse_cursors.h"
46 #include "editing.h"
47 #include "track_selection.h"
48 #include "region_view.h"
49 
50 namespace ARDOUR {
51  class Location;
52  class Region;
53  class TempoSection;
54 }
55 
56 namespace ArdourCanvas {
57  class Item;
58  class Line;
59  class Rectangle;
60  class Lollipop;
61 }
62 
63 namespace PBD {
64  class StatefulDiffCommand;
65 }
66 
67 class CueEditor;
68 class PatchChange;
69 class EditingContext;
70 class Editor;
71 class EditorCursor;
72 class TimeAxisView;
73 class Pianoroll;
74 class MidiTimeAxisView;
75 class Drag;
76 class NoteBase;
77 class TimeAxisView;
78 class RouteTimeAxisView;
79 class RegionSelection;
80 class MidiRegionView;
81 class MidiView;
82 class MeterMarker;
83 class ArdourMarker;
84 class TempoMarker;
85 class TempoCurve;
86 class ControlPoint;
87 class AudioRegionView;
88 class AutomationLine;
90 class VelocityDisplay;
91 
94 {
95 public:
96 
99 
100  bool motion_handler (GdkEvent *, bool);
102  void abort ();
103  void add (Drag *);
106  bool end_grab (GdkEvent *);
108 
110 
112  bool ending () const {
113  return _ending;
114  }
115 
116  bool active () const {
117  return !_drags.empty ();
118  }
119 
121  double current_pointer_x () const {
122  return _current_pointer_x;
123  }
124 
126  double current_pointer_y () const {
127  return _current_pointer_y;
128  }
129 
133  }
134 
137  return _current_pointer_time;
138  }
139 
141  bool preview_video () const;
142 
143 private:
145  std::list<Drag*> _drags;
146  bool _ending;
151 };
152 
154 class Drag
155 {
156 public:
157  Drag (EditingContext&, ArdourCanvas::Item *, Temporal::TimeDomain td, ArdourCanvas::Item const * bounding_item, bool hide_snapped_cursor = true);
158  virtual ~Drag ();
159 
161  _drags = m;
162  }
163 
165  _bounding_item = i;
166  }
167 
170  return _item;
171  }
172 
175 
176  void swap_grab (ArdourCanvas::Item *, Gdk::Cursor *, uint32_t);
177  bool motion_handler (GdkEvent*, bool);
178  void abort ();
179 
180  Temporal::timepos_t adjusted_time (Temporal::timepos_t const &, GdkEvent const *, bool snap = true) const;
181  Temporal::timepos_t adjusted_current_time (GdkEvent const *, bool snap = true) const;
182 
183  bool was_double_click() const { return _was_double_click; }
184  void set_double_click (bool yn) { _was_double_click = yn; }
185 
187 
192  virtual void start_grab (GdkEvent* e, Gdk::Cursor* c = 0);
193 
194  virtual bool end_grab (GdkEvent *);
195 
200  virtual void motion (GdkEvent* e, bool f) = 0;
201 
206  virtual void finished (GdkEvent* e, bool m) = 0;
207 
212  virtual void aborted (bool m) = 0;
213 
217  virtual bool active (Editing::MouseMode m) {
218  return true;
219  }
220 
221  bool preview_video () const {
222  return _preview_video;
223  }
224 
226  typedef std::pair<int,int> MoveThreshold;
227 
228  virtual MoveThreshold move_threshold () const;
229 
230  virtual bool allow_vertical_autoscroll () const {
231  return true;
232  }
233 
234  virtual bool allow_horizontal_autoscroll () const {
235  return true;
236  }
237 
239  virtual bool x_movement_matters () const {
240  return true;
241  }
242 
244  virtual bool y_movement_matters () const {
245  return true;
246  }
247 
248  virtual bool mid_drag_key_event (GdkEventKey*) { return false; }
249 
250  bool initially_vertical() const {
251  return _initially_vertical;
252  }
253 
255  virtual void setup_pointer_offset () {
257  }
258 
260  virtual void setup_video_offset () {
261  /* video offset is always in audio time */
263  _preview_video = false;
264  }
265 
266  int grab_button() const { return _grab_button; }
267 
268 protected:
269 
270  double grab_x () const {
271  return _grab_x;
272  }
273 
274  double grab_y () const {
275  return _grab_y;
276  }
277 
279 
281  return _raw_grab_time;
282  }
283 
285  return _grab_time.samples();
286  }
287 
289  return _grab_time;
290  }
291 
292  double last_pointer_x () const {
293  return _last_pointer_x;
294  }
295 
296  double last_pointer_y () const {
297  return _last_pointer_y;
298  }
299 
301  return _last_pointer_time.samples();
302  }
303 
305  return _last_pointer_time;
306  }
307 
308  Temporal::timecnt_t snap_delta (guint const) const;
309 
310  double current_pointer_x () const;
311  double current_pointer_y () const;
312 
313  /* sets snap delta from unsnapped pos */
315 
316  std::shared_ptr<ARDOUR::Region> add_midi_region (MidiTimeAxisView*, bool commit);
317 
319  void show_verbose_cursor_duration (Temporal::timepos_t const & , Temporal::timepos_t const & , double xoffset = 0);
320  void show_verbose_cursor_text (std::string const &);
322 
335  bool _copy;
336 
337 private:
344  double _grab_x;
345  double _grab_y;
352 
353  /* difference between some key position's snapped and unsnapped
354  * samplepos. used for relative snap.
355  */
359 
361 };
362 
368 class EditorDrag : public Drag
369 {
370  public:
371  EditorDrag (Editor&, ArdourCanvas::Item *, Temporal::TimeDomain td, ArdourCanvas::Item const * bounding_item, bool hide_snapped_cursor = true);
372  protected:
374 };
375 
376 class RegionDrag;
377 
380 {
381 public:
383 
393  double layer;
394  double initial_y;
398  std::shared_ptr<ARDOUR::Playlist> initial_playlist;
400 };
401 
403 class RegionDrag : public EditorDrag, public sigc::trackable
404 {
405 public:
406  RegionDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain, bool hide_snapped_cursor = true);
407  virtual ~RegionDrag () {}
408 
409 protected:
410 
412  std::list<DraggingView> _views;
413 
415  std::vector<TimeAxisView*> _time_axis_views;
417  int apply_track_delta (const int start, const int delta, const int skip, const bool distance_only = false) const;
418 
421  uint32_t _ntracks;
422 
424 
425  friend class DraggingView;
426 
427 protected:
429 
430 private:
431 
434 };
435 
438 {
439 public:
440 
443 
444  virtual void start_grab (GdkEvent *, Gdk::Cursor *);
445  virtual void motion (GdkEvent *, bool);
446  virtual void finished (GdkEvent *, bool);
447  virtual void aborted (bool);
448 };
449 
452 {
453 public:
454  RegionBrushDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain td);
455  virtual ~RegionBrushDrag () {}
456 
457  virtual void start_grab (GdkEvent *, Gdk::Cursor *);
458  virtual void motion (GdkEvent *, bool);
459  virtual void finished (GdkEvent *, bool);
460  virtual void aborted (bool);
461 private:
462  typedef std::set<Temporal::timepos_t> TimePositionSet;
464 };
465 
468 {
469 public:
470 
471  RegionMotionDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain td);
472  virtual ~RegionMotionDrag () {}
473 
474  virtual void start_grab (GdkEvent *, Gdk::Cursor *);
475  virtual void motion (GdkEvent *, bool);
476  virtual void finished (GdkEvent *, bool);
477  virtual void aborted (bool);
478 
482  virtual bool regions_came_from_canvas () const = 0;
483 
484 protected:
485 
487  virtual bool y_movement_allowed (int, double, int skip_invisible = 0) const;
489 
495  std::vector<ArdourMarker*> ripple_markers;
496 
497 private:
498  uint32_t _ndropzone;
499  uint32_t _pdropzone;
500  uint32_t _ddropzone;
501 };
502 
503 
508 {
509 public:
510  RegionMoveDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, bool, Temporal::TimeDomain);
511  virtual ~RegionMoveDrag () {}
512 
513  void motion (GdkEvent *, bool);
514  void finished (GdkEvent *, bool);
515  void aborted (bool);
516 
518 
519  bool regions_came_from_canvas () const {
520  return true;
521  }
522 
524 
525 private:
527  bool const,
528  bool const,
529  Temporal::timepos_t const &,
530  int32_t const ev_state
531  );
532 
534  bool const,
535  bool const,
536  Temporal::timepos_t const &,
537  int32_t const ev_state
538  );
539 
541  std::shared_ptr<ARDOUR::Region>,
544  Temporal::timepos_t const &,
546  );
547 
549  std::shared_ptr<ARDOUR::Region>,
550  std::shared_ptr<ARDOUR::Playlist>,
551  ARDOUR::PlaylistSet& modified_playlists
552  );
553 
554 
556  RouteTimeAxisView* create_destination_time_axis (std::shared_ptr<ARDOUR::Region>, TimeAxisView* original);
557 
559 };
560 
563 {
564 public:
565  RegionInsertDrag (Editor&, std::shared_ptr<ARDOUR::Region>, RouteTimeAxisView*, Temporal::timepos_t const &, Temporal::TimeDomain);
566 
567  void finished (GdkEvent *, bool);
568  void aborted (bool);
569 
570  bool regions_came_from_canvas () const {
571  return false;
572  }
573 };
574 
576 class RegionCutDrag : public EditorDrag
577 {
578 public:
581 
582  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
583  void motion (GdkEvent*, bool);
584  void finished (GdkEvent*, bool);
585  void aborted (bool);
586 };
587 
590 {
591 public:
593 
594  void motion (GdkEvent *, bool);
595  void finished (GdkEvent *, bool);
596  void aborted (bool);
597 
598 private:
600  std::shared_ptr<ARDOUR::Region> _region;
601 };
602 
604 class NoteResizeDrag : public Drag
605 {
606 public:
608 
609  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
610  void motion (GdkEvent *, bool);
611  void finished (GdkEvent *, bool);
612  void aborted (bool);
613 
615  return false;
616  }
617 
618 private:
620  bool relative;
621  bool at_front;
623  double _snap_delta;
624 };
625 
627 class NoteDrag : public Drag
628 {
629 public:
631 
632  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
633  void motion (GdkEvent *, bool);
634  void finished (GdkEvent *, bool);
635  void aborted (bool);
636 
638 
640  return false;
641  }
642 
643 private:
644 
645  Temporal::timecnt_t total_dx (GdkEvent * event) const; // total movement in quarter notes
646  int8_t total_dy () const;
647 
652  Temporal::timepos_t _earliest; // earliest note in note selection
654  double _note_height;
655 };
656 
657 class NoteCreateDrag : public Drag
658 {
659 public:
662 
663  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
664  void motion (GdkEvent *, bool);
665  void finished (GdkEvent *, bool);
666  void aborted (bool);
667 
669  return mode == Editing::MouseDraw || mode == Editing::MouseContent;
670  }
671 
673  return false;
674  }
675 
676  bool y_movement_matters () const {
677  return false;
678  }
679 
680 private:
681  double y_to_region (double) const;
682  Temporal::Beats round_to_grid (Temporal::timepos_t const & pos, GdkEvent const * event) const;
683 
687 };
688 
689 class HitCreateDrag : public Drag
690 {
691 public:
694 
695  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
696  void motion (GdkEvent *, bool) {}
697  void finished (GdkEvent *, bool);
698  void aborted (bool) {}
699 
701  return mode == Editing::MouseDraw || mode == Editing::MouseContent;
702  }
703 
704  bool y_movement_matters () const {
705  return false;
706  }
707 
708 private:
709  double y_to_region (double) const;
710 
712  int _y;
713 
714 };
715 
716 class NoteBrushDrag : public Drag
717 {
718 public:
721 
722  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
723  void motion (GdkEvent *, bool);
724  void finished (GdkEvent *, bool);
725  void aborted (bool) {}
726 
728  return mode == Editing::MouseDraw || mode == Editing::MouseContent;
729  }
730 
731  bool y_movement_matters () const {
732  return false;
733  }
734 
735 private:
736  double y_to_region (double) const;
738 
741  int _y;
747 
748 };
749 
751 class PatchChangeDrag : public Drag
752 {
753 public:
755 
756  void motion (GdkEvent *, bool);
757  void finished (GdkEvent *, bool);
758  void aborted (bool);
759 
760  bool y_movement_matters () const {
761  return false;
762  }
763 
765  return false;
766  }
767 
769 
770 private:
774 };
775 
778 {
779 public:
781 
784 };
785 
788 {
789 public:
791 
792  void motion (GdkEvent *, bool);
793  void finished (GdkEvent *, bool);
794  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
795 
796  bool y_movement_matters () const {
797  return false;
798  }
799 
801  return false;
802  }
803 
804  void aborted (bool);
805 
806 protected:
807  std::list<AVDraggingView> _views;
808 
809 private:
812  bool _stuck;
813 };
814 
816 class TrimDrag : public RegionDrag
817 {
818 public:
819  enum Operation {
821  EndTrim
822  };
823 
824  TrimDrag (Editor&, ArdourCanvas::Item *, RegionView*, std::list<RegionView*> const &, Temporal::TimeDomain td, bool preserve_fade_anchor = false);
825 
826  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
827  void motion (GdkEvent *, bool);
828  void finished (GdkEvent *, bool);
829  void aborted (bool);
830 
831  bool y_movement_matters () const {
832  return false;
833  }
834 
836  return false;
837  }
838 
840 
841 private:
842 
844 
847 
848  std::vector<RegionView::DisplaySuspender> suspenders;
849 };
850 
853 {
854 public:
856 
857  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
858  void motion (GdkEvent *, bool);
859  void finished (GdkEvent *, bool);
860  void aborted (bool);
861 
863  return false;
864  }
865 
866  bool y_movement_matters () const {
867  return false;
868  }
869 
871 
872 private:
876 
877  bool _movable;
881 };
882 
885 {
886 public:
888 
889  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
890  void motion (GdkEvent *, bool);
891  void finished (GdkEvent *, bool);
892  void aborted (bool);
893 
894 private:
896  double initial_bpm;
899 };
900 
903 {
904 public:
906 
907  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
908  void motion (GdkEvent *, bool);
909  void finished (GdkEvent *, bool);
910  void aborted (bool);
911 
913  return false;
914  }
915 
916  bool y_movement_matters () const {
917  return true;
918  }
919 
921 
922 private:
926 
927  bool _movable;
928  double _grab_bpm;
931 };
932 
934 class BBTMarkerDrag : public EditorDrag
935 {
936 public:
938 
939  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
940  void motion (GdkEvent *, bool);
941  void finished (GdkEvent *, bool);
942  void aborted (bool);
943 
945  return false;
946  }
947 
948  bool y_movement_matters () const {
949  return false;
950  }
951 
953 
954 private:
958 
960 };
961 
963 {
964 public:
966 
967  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
968  void motion (GdkEvent *, bool);
969  void finished (GdkEvent *, bool);
970  void aborted (bool);
971 
973  return false;
974  }
975 
977  return false;
978  }
979 
980  bool y_movement_matters () const {
981  return false;
982  }
983 
985 
986 private:
989  double _grab_bpm;
991 
994 };
995 
997 {
998 public:
1003  XMLNode&,
1004  bool ramped);
1005 
1006  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1007  void motion (GdkEvent *, bool);
1008  void finished (GdkEvent *, bool);
1009  void aborted (bool);
1010 
1012  return false;
1013  }
1014 
1016  return false;
1017  }
1018 
1019  bool y_movement_matters () const {
1020  return false;
1021  }
1022 
1024 
1025 private:
1030 
1031  double direction;
1032  double delta;
1035 
1038  bool _do_ramp;
1039 };
1040 
1041 
1044 {
1045 public:
1047 
1048  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1049  void motion (GdkEvent *, bool);
1050  void finished (GdkEvent *, bool);
1051  void aborted (bool);
1052 
1054  return false;
1055  }
1056 
1057  bool y_movement_matters () const {
1058  return true;
1059  }
1060 
1062 
1063 private:
1070 };
1071 
1073 class TempoEndDrag : public EditorDrag
1074 {
1075 public:
1077 
1078  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1079  void motion (GdkEvent *, bool);
1080  void finished (GdkEvent *, bool);
1081  void aborted (bool);
1082 
1084  return false;
1085  }
1086 
1087  bool y_movement_matters () const {
1088  return true;
1089  }
1090 
1092 
1093 private:
1098 
1101 };
1102 
1104 class CursorDrag : public EditorDrag
1105 {
1106 public:
1108 
1109  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1110  void motion (GdkEvent *, bool);
1111  void finished (GdkEvent *, bool);
1112  void aborted (bool);
1113 
1115  return false;
1116  }
1117 
1118  bool y_movement_matters () const {
1119  return true;
1120  }
1121 
1122 private:
1124 
1126  bool _stop;
1127  double _grab_zoom;
1128 
1129  //used for zooming
1134 };
1135 
1137 class FadeInDrag : public RegionDrag
1138 {
1139 public:
1140  FadeInDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain);
1141 
1142  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1143  void motion (GdkEvent *, bool);
1144  void finished (GdkEvent *, bool);
1145  void aborted (bool);
1146 
1147  bool y_movement_matters () const {
1148  return false;
1149  }
1150 
1152  return false;
1153  }
1154 
1156 };
1157 
1159 class FadeOutDrag : public RegionDrag
1160 {
1161 public:
1162  FadeOutDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain td);
1163 
1164  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1165  void motion (GdkEvent *, bool);
1166  void finished (GdkEvent *, bool);
1167  void aborted (bool);
1168 
1169  bool y_movement_matters () const {
1170  return false;
1171  }
1172 
1174  return false;
1175  }
1176 
1178 };
1179 
1181 class MarkerDrag : public EditorDrag
1182 {
1183 public:
1186 
1187  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1188  void motion (GdkEvent *, bool);
1189  void finished (GdkEvent *, bool);
1190  void aborted (bool);
1191 
1193  return false;
1194  }
1195 
1196  bool y_movement_matters () const {
1197  return false;
1198  }
1199 
1202 
1203 private:
1205 
1210  std::vector<ArdourMarker*> markers;
1213  };
1214 
1215  std::vector<ARDOUR::Location::ChangeSuspender> lcs;
1216 
1217  typedef std::list<CopiedLocationMarkerInfo> CopiedLocationInfo;
1220 };
1221 
1223 class ControlPointDrag : public Drag
1224 {
1225 public:
1227 
1228  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1229  void motion (GdkEvent *, bool);
1230  void finished (GdkEvent *, bool);
1231  void aborted (bool);
1232 
1234 
1236  return false;
1237  }
1238 
1239 
1240 private:
1241 
1246  bool _pushing;
1247  uint32_t _final_index;
1248  static double _zero_gain_fraction;
1249 
1251 };
1252 
1254 class LineDrag : public Drag
1255 {
1256 public:
1257  LineDrag (EditingContext &e, ArdourCanvas::Item *i, std::function<void(GdkEvent*,Temporal::timepos_t const &,double)>);
1259 
1260  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1261  void motion (GdkEvent *, bool);
1262  void finished (GdkEvent *, bool);
1263  void aborted (bool);
1264 
1266  return false;
1267  }
1268 
1269 private:
1270 
1275  uint32_t _before;
1276  uint32_t _after;
1278  std::function<void(GdkEvent*,Temporal::timepos_t const &,double)> click_functor;
1279 };
1280 
1282 class FeatureLineDrag : public Drag
1283 {
1284 public:
1286 
1287  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1288  void motion (GdkEvent *, bool);
1289  void finished (GdkEvent *, bool);
1290  void aborted (bool);
1291 
1292 private:
1293 
1296 
1299 
1300  float _before;
1301  uint32_t _max_x;
1302 };
1303 
1306 {
1307 public:
1309 
1310  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1311  void motion (GdkEvent *, bool);
1312  void finished (GdkEvent *, bool);
1313  void aborted (bool);
1314 
1315  void do_select_things (GdkEvent *, bool);
1316 
1325  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);
1326  virtual void deselect_things ();
1327 
1328  protected:
1330  std::function<bool(GdkEvent*,Temporal::timepos_t const &)> click_functor;
1331 };
1332 
1335 {
1336  public:
1338 
1339  void select_things (int, Temporal::timepos_t const &, Temporal::timepos_t const &, double, double, bool);
1341  void finished (GdkEvent *, bool);
1342 
1343  private:
1345 };
1346 
1349 {
1350 public:
1352 
1353  void select_things (int, Temporal::timepos_t const &, Temporal::timepos_t const &, double, double, bool);
1355 
1356 private:
1358 };
1359 
1361 class TimeFXDrag : public RegionDrag
1362 {
1363 public:
1364  TimeFXDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain td);
1365 
1366  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1367  void motion (GdkEvent *, bool);
1368  void finished (GdkEvent *, bool);
1369  void aborted (bool);
1370 private:
1372 };
1373 
1376 {
1377 public:
1378  enum Operation {
1384  };
1385 
1387 
1388  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1389  void motion (GdkEvent *, bool);
1390  void finished (GdkEvent *, bool);
1391  void aborted (bool);
1392 
1394 
1395 private:
1397  bool _add;
1402 };
1403 
1406 {
1407 public:
1409 
1411  void motion (GdkEvent*, bool);
1412  void finished (GdkEvent *, bool);
1413  void aborted (bool);
1414 
1415 private:
1419 };
1420 
1423 {
1424 public:
1425  enum Operation {
1430  };
1431 
1434 
1435  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1436  void motion (GdkEvent *, bool);
1437  void finished (GdkEvent *, bool);
1438  void aborted (bool);
1439 
1441  return false;
1442  }
1443 
1444  bool y_movement_matters () const {
1445  return false;
1446  }
1447 
1448 private:
1450 
1453 };
1454 
1457 {
1458 public:
1460 
1461  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1462  void motion (GdkEvent *, bool);
1463  void finished (GdkEvent *, bool);
1464  void aborted (bool);
1465 
1466 private:
1468 };
1469 
1474 {
1475 public:
1476  AutomationRangeDrag (EditingContext&, AutomationTimeAxisView *, float initial_value, std::list<ARDOUR::TimelineRange> const &);
1477  AutomationRangeDrag (EditingContext&, std::list<RegionView*> const &, std::list<ARDOUR::TimelineRange> const &, double y_origin, double y_height);
1478 
1479  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1480  void motion (GdkEvent *, bool);
1481  void finished (GdkEvent *, bool);
1482  void aborted (bool);
1483 
1484  bool x_movement_matters () const {
1485  return false;
1486  }
1487 
1488 private:
1489  void setup (std::list<std::shared_ptr<AutomationLine> > const &);
1490  double y_fraction (double global_y_position) const;
1491  double value (std::shared_ptr<ARDOUR::AutomationList> list, Temporal::timepos_t const & x) const;
1492 
1493  std::list<ARDOUR::TimelineRange> _ranges;
1494 
1496  struct Line {
1497  std::shared_ptr<AutomationLine> line;
1498  std::list<ControlPoint*> points;
1499  std::pair<Temporal::timepos_t, Temporal::timepos_t> range;
1501  };
1502 
1503  std::list<Line> _lines;
1504  double _y_origin;
1505  double _y_height;
1509 };
1510 
1513 class CrossfadeEdgeDrag : public Drag
1514 {
1515 public:
1517 
1519  void motion (GdkEvent*, bool);
1520  void finished (GdkEvent*, bool);
1521  void aborted (bool);
1522 
1523  bool y_movement_matters () const {
1524  return false;
1525  }
1526 
1527 private:
1529  bool start;
1530 };
1531 
1532 class RegionMarkerDrag : public Drag
1533 {
1534  public:
1537 
1538  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1539  void motion (GdkEvent *, bool);
1540  void finished (GdkEvent *, bool);
1541  void aborted (bool);
1542 
1544  return false;
1545  }
1546 
1547  bool y_movement_matters () const {
1548  return false;
1549  }
1550 
1552 
1553  private:
1558 };
1559 
1560 
1561 class LollipopDrag : public Drag
1562 {
1563  public:
1566 
1567  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1568  void motion (GdkEvent *, bool);
1569  void finished (GdkEvent *, bool);
1570  void aborted (bool);
1571 
1573  return false;
1574  }
1575 
1577  return false;
1578  }
1579 
1580  bool x_movement_matters () const {
1581  return false;
1582  }
1583 
1585 
1586  private:
1589 };
1590 
1591 template<typename OrderedPointList, typename OrderedPoint>
1592 class FreehandLineDrag : public Drag
1593 {
1594  public:
1597 
1598  void motion (GdkEvent*, bool);
1599  void finished (GdkEvent*, bool);
1601  virtual void point_added (ArdourCanvas::Duple const & d, ArdourCanvas::Rectangle const & r, double last_x) {}
1602  virtual void line_extended (ArdourCanvas::Duple const & from, ArdourCanvas::Duple const & to, ArdourCanvas::Rectangle const & r, double last_x) {
1603  point_added (to, r, last_x);
1604  }
1605 
1606  protected:
1607  ArdourCanvas::Item* parent; /* we do not own this. If null, use base_rect as the parent */
1608  ArdourCanvas::Rectangle& base_rect; /* we do not own this */
1612  int edge_x;
1613  bool did_snap;
1615  OrderedPointList drawn_points;
1618 
1619  void maybe_add_point (GdkEvent*, Temporal::timepos_t const &, bool first_move);
1620 };
1621 
1622 class AutomationDrawDrag : public FreehandLineDrag<Evoral::ControlList::OrderedPoints, Evoral::ControlList::OrderedPoint>
1623 {
1624  public:
1627 
1628  void finished (GdkEvent*, bool);
1629  void aborted (bool) {}
1630 };
1631 
1632 class VelocityLineDrag : public FreehandLineDrag<Evoral::ControlList::OrderedPoints, Evoral::ControlList::OrderedPoint>
1633 {
1634  public:
1637 
1638  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1639  void finished (GdkEvent*, bool);
1640  void aborted (bool);
1641  void point_added (ArdourCanvas::Duple const & d, ArdourCanvas::Rectangle const & r, double last_x);
1642  void line_extended (ArdourCanvas::Duple const & from, ArdourCanvas::Duple const & to, ArdourCanvas::Rectangle const & r, double last_x);
1643 
1644  private:
1647 };
1648 
1649 class ClipStartDrag : public Drag
1650 {
1651  public:
1654 
1657  void motion (GdkEvent*, bool);
1658  void finished (GdkEvent*, bool);
1659  void aborted (bool);
1660 
1661  private:
1665 };
1666 
1667 class ClipEndDrag : public Drag
1668 {
1669  public:
1672 
1675  void motion (GdkEvent*, bool);
1676  void finished (GdkEvent*, bool);
1677  void aborted (bool);
1678 
1679  private:
1683 };
1684 
1685 #endif /* __gtk2_ardour_editor_drag_h_ */
AVDraggingView(RegionView *)
samplepos_t initial_position
initial position of the region
Definition: editor_drag.h:783
RegionView * view
the view
Definition: editor_drag.h:782
void aborted(bool)
Definition: editor_drag.h:1629
void finished(GdkEvent *, bool)
AutomationDrawDrag(EditingContext &, ArdourCanvas::Item *, ArdourCanvas::Rectangle &, bool, Temporal::TimeDomain)
std::list< ARDOUR::TimelineRange > _ranges
Definition: editor_drag.h:1493
double y_fraction(double global_y_position) const
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
AutomationRangeDrag(EditingContext &, std::list< RegionView * > const &, std::list< ARDOUR::TimelineRange > const &, double y_origin, double y_height)
std::list< Line > _lines
Definition: editor_drag.h:1503
double value(std::shared_ptr< ARDOUR::AutomationList > list, Temporal::timepos_t const &x) const
void finished(GdkEvent *, bool)
void setup(std::list< std::shared_ptr< AutomationLine > > const &)
bool x_movement_matters() const
Definition: editor_drag.h:1484
void motion(GdkEvent *, bool)
AutomationRangeDrag(EditingContext &, AutomationTimeAxisView *, float initial_value, std::list< ARDOUR::TimelineRange > const &)
void setup_pointer_offset()
XMLNode * _before_state
Definition: editor_drag.h:959
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:957
bool y_movement_matters() const
Definition: editor_drag.h:948
BBTMarkerDrag(Editor &, ArdourCanvas::Item *)
void aborted(bool)
BBTMarker * _marker
Definition: editor_drag.h:955
void finished(GdkEvent *, bool)
void motion(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:944
Temporal::MusicTimePoint const * _point
Definition: editor_drag.h:956
void start_grab(GdkEvent *, Gdk::Cursor *)
void aborted(bool)
ClipEndDrag(CueEditor &, ArdourCanvas::Rectangle &)
void finished(GdkEvent *, bool)
CueEditor & ce
Definition: editor_drag.h:1680
ArdourCanvas::Rectangle * dragging_rect
Definition: editor_drag.h:1681
void motion(GdkEvent *, bool)
bool end_grab(GdkEvent *)
ArdourCanvas::Rect original_rect
Definition: editor_drag.h:1682
void aborted(bool)
bool end_grab(GdkEvent *)
ArdourCanvas::Rect original_rect
Definition: editor_drag.h:1664
void motion(GdkEvent *, bool)
void finished(GdkEvent *, bool)
ClipStartDrag(CueEditor &, ArdourCanvas::Rectangle &)
void start_grab(GdkEvent *, Gdk::Cursor *)
ArdourCanvas::Rectangle * dragging_rect
Definition: editor_drag.h:1663
CueEditor & ce
Definition: editor_drag.h:1662
uint32_t _final_index
Definition: editor_drag.h:1247
void motion(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1235
Temporal::timecnt_t total_dt(GdkEvent *) const
bool active(Editing::MouseMode m)
ControlPoint * _point
Definition: editor_drag.h:1242
void aborted(bool)
void finished(GdkEvent *, bool)
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
ControlPointDrag(EditingContext &, ArdourCanvas::Item *)
static double _zero_gain_fraction
Definition: editor_drag.h:1248
double _cumulative_y_drag
Definition: editor_drag.h:1245
AudioRegionView * arv
Definition: editor_drag.h:1528
bool y_movement_matters() const
Definition: editor_drag.h:1523
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void aborted(bool)
void finished(GdkEvent *, bool)
CrossfadeEdgeDrag(Editor &, AudioRegionView *, ArdourCanvas::Item *, bool start)
void motion(GdkEvent *, bool)
void finished(GdkEvent *, bool)
void motion(GdkEvent *, bool)
double _grab_zoom
editor samples per unit when our grab started
Definition: editor_drag.h:1127
int _last_y_delta
Definition: editor_drag.h:1133
CursorDrag(Editor &, EditorCursor &, bool)
bool _stop
true to stop the transport on starting the drag, otherwise false
Definition: editor_drag.h:1126
EditorCursor & _cursor
Definition: editor_drag.h:1125
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1114
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void aborted(bool)
void fake_locate(samplepos_t)
bool y_movement_matters() const
Definition: editor_drag.h:1118
void abort()
bool preview_video() const
bool mid_drag_key_event(GdkEventKey *)
Temporal::timepos_t _current_pointer_time
time that the pointer is now at
Definition: editor_drag.h:149
bool ending() const
Definition: editor_drag.h:112
bool _old_follow_playhead
state of Editor::follow_playhead() before the drags started
Definition: editor_drag.h:150
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 *)
EditingContext * _editing_context
Definition: editor_drag.h:144
std::list< Drag * > _drags
Definition: editor_drag.h:145
double current_pointer_x() const
Definition: editor_drag.h:121
bool active() const
Definition: editor_drag.h:116
double current_pointer_y() const
Definition: editor_drag.h:126
double _current_pointer_y
canvas-coordinate space y of the current pointer
Definition: editor_drag.h:148
void add(Drag *)
Temporal::timepos_t current_pointer_time() const
Definition: editor_drag.h:136
double _current_pointer_x
canvas-coordinate space x of the current pointer
Definition: editor_drag.h:147
bool _ending
true if end_grab or abort is in progress, otherwise false
Definition: editor_drag.h:146
bool motion_handler(GdkEvent *, bool)
DragManager(EditingContext *e)
ARDOUR::samplepos_t current_pointer_sample() const
Definition: editor_drag.h:131
void mark_double_click()
Temporal::timepos_t last_pointer_time() const
Definition: editor_drag.h:304
double last_pointer_y() const
Definition: editor_drag.h:296
virtual bool active(Editing::MouseMode m)
Definition: editor_drag.h:217
Temporal::timepos_t pixel_duration_to_time(double x) const
void set_double_click(bool yn)
Definition: editor_drag.h:184
virtual bool y_movement_matters() const
Definition: editor_drag.h:244
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:169
virtual void setup_pointer_offset()
Definition: editor_drag.h:255
double _last_pointer_x
trackview x of the pointer last time a motion occurred
Definition: editor_drag.h:346
virtual void start_grab(GdkEvent *e, Gdk::Cursor *c=0)
ArdourCanvas::Item * _item
our item
Definition: editor_drag.h:325
Temporal::timecnt_t _video_offset
Definition: editor_drag.h:329
bool _y_constrained
true if y motion is constrained, otherwise false
Definition: editor_drag.h:332
void abort()
Gtkmm2ext::Bindings::DragsBlockBindings binding_blocker
Definition: editor_drag.h:360
Temporal::TimeDomain time_domain() const
Definition: editor_drag.h:173
virtual ~Drag()
Temporal::timepos_t _last_pointer_time
adjusted_time the last time a motion occurred
Definition: editor_drag.h:350
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:234
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 _bounding_itme is non-null
Definition: editor_drag.h:345
void set_manager(DragManager *m)
Definition: editor_drag.h:160
std::pair< int, int > MoveThreshold
Definition: editor_drag.h:226
bool _move_threshold_passed
true if the move threshold has been passed, otherwise false
Definition: editor_drag.h:340
void set_grab_button_anyway(GdkEvent *)
DragManager * _drags
Definition: editor_drag.h:324
bool _was_double_click
true if drag initiated by a double click event
Definition: editor_drag.h:343
void show_view_preview(Temporal::timepos_t const &)
Temporal::timecnt_t _pointer_offset
Definition: editor_drag.h:328
ArdourCanvas::Item const * _bounding_item
our coordinate reference (normally null)
Definition: editor_drag.h:326
bool _initially_vertical
true if after move threshold is passed we appear to be moving vertically; undefined before that
Definition: editor_drag.h:342
ARDOUR::timepos_t _earliest_time_limit
time we cannot drag before (defaults to 0, indicating no such limit)
Definition: editor_drag.h:334
double current_pointer_y() const
virtual bool mid_drag_key_event(GdkEventKey *)
Definition: editor_drag.h:248
std::shared_ptr< ARDOUR::Region > add_midi_region(MidiTimeAxisView *, bool commit)
int grab_button() const
Definition: editor_drag.h:266
bool _preview_video
Definition: editor_drag.h:330
virtual void motion(GdkEvent *e, bool f)=0
virtual bool allow_vertical_autoscroll() const
Definition: editor_drag.h:230
bool _copy
Definition: editor_drag.h:335
virtual bool end_grab(GdkEvent *)
double last_pointer_x() const
Definition: editor_drag.h:292
ARDOUR::samplepos_t last_pointer_sample() const
Definition: editor_drag.h:300
virtual MoveThreshold move_threshold() const
Temporal::timecnt_t _snap_delta
Definition: editor_drag.h:356
bool motion_handler(GdkEvent *, bool)
double _last_pointer_y
trackview y of the pointer last time a motion occurred
Definition: editor_drag.h:347
Drag(EditingContext &, ArdourCanvas::Item *, Temporal::TimeDomain td, ArdourCanvas::Item const *bounding_item, bool hide_snapped_cursor=true)
ARDOUR::samplepos_t grab_sample() const
Definition: editor_drag.h:284
int _grab_button
Definition: editor_drag.h:358
bool _hide_snapped_cursor
set true of Drag::motion does not call set_snapped_cursor_position
Definition: editor_drag.h:339
double current_pointer_x() const
bool _x_constrained
true if x motion is constrained, otherwise false
Definition: editor_drag.h:331
double grab_y() const
Definition: editor_drag.h:274
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:348
bool initially_vertical() const
Definition: editor_drag.h:250
bool _trackview_only
true if pointer y value should always be relative to the top of the trackview group
Definition: editor_drag.h:338
void set_bounding_item(ArdourCanvas::Item const *i)
Definition: editor_drag.h:164
Temporal::timepos_t raw_grab_time() const
Definition: editor_drag.h:280
bool was_double_click() const
Definition: editor_drag.h:183
virtual bool x_movement_matters() const
Definition: editor_drag.h:239
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:341
virtual void aborted(bool m)=0
EditingContext & editing_context
Definition: editor_drag.h:323
virtual void setup_video_offset()
Definition: editor_drag.h:260
bool _was_rolling
true if the session was rolling before the drag started, otherwise false
Definition: editor_drag.h:333
double _grab_x
trackview x of the grab start position
Definition: editor_drag.h:344
bool preview_video() const
Definition: editor_drag.h:221
Temporal::timepos_t grab_time() const
Definition: editor_drag.h:288
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:357
Temporal::TimeDomain _time_domain
Definition: editor_drag.h:351
double grab_x() const
Definition: editor_drag.h:270
Temporal::timepos_t _grab_time
adjusted_time that the mouse was at when start_grab was called, or 0
Definition: editor_drag.h:349
samplepos_t anchored_fade_length
fade_length when anchored during drag
Definition: editor_drag.h:397
RegionView * view
the view
Definition: editor_drag.h:384
double layer
Definition: editor_drag.h:393
std::shared_ptr< ARDOUR::Playlist > initial_playlist
Definition: editor_drag.h:398
DraggingView(RegionView *, RegionDrag *, TimeAxisView *original_tav)
Temporal::timepos_t initial_position
initial position of the region
Definition: editor_drag.h:395
TimeAxisView * initial_time_axis_view
Definition: editor_drag.h:399
double initial_y
the initial y position of the view before any reparenting
Definition: editor_drag.h:394
int time_axis_view
Definition: editor_drag.h:388
Temporal::timepos_t initial_end
initial end position of the region
Definition: editor_drag.h:396
EditorDrag(Editor &, ArdourCanvas::Item *, Temporal::TimeDomain td, ArdourCanvas::Item const *bounding_item, bool hide_snapped_cursor=true)
Editor & _editor
Definition: editor_drag.h:373
Definition: editor.h:160
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1151
void setup_pointer_offset()
void aborted(bool)
void motion(GdkEvent *, bool)
bool y_movement_matters() const
Definition: editor_drag.h:1147
FadeInDrag(Editor &, ArdourCanvas::Item *, RegionView *, std::list< RegionView * > const &, Temporal::TimeDomain)
void finished(GdkEvent *, bool)
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void aborted(bool)
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
FadeOutDrag(Editor &, ArdourCanvas::Item *, RegionView *, std::list< RegionView * > const &, Temporal::TimeDomain td)
bool y_movement_matters() const
Definition: editor_drag.h:1169
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1173
void setup_pointer_offset()
void motion(GdkEvent *, bool)
void finished(GdkEvent *, bool)
ArdourCanvas::Line * _line
Definition: editor_drag.h:1294
double _cumulative_x_drag
Definition: editor_drag.h:1298
double _region_view_grab_x
Definition: editor_drag.h:1297
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:1295
FeatureLineDrag(Editor &e, ArdourCanvas::Item *i)
ArdourCanvas::Coord line_start_y
Definition: editor_drag.h:1617
virtual void point_added(ArdourCanvas::Duple const &d, ArdourCanvas::Rectangle const &r, double last_x)
Definition: editor_drag.h:1601
void maybe_add_point(GdkEvent *, Temporal::timepos_t const &, bool first_move)
ArdourCanvas::Item * parent
Definition: editor_drag.h:1607
ArdourCanvas::Rectangle & base_rect
Definition: editor_drag.h:1608
ArdourCanvas::Coord line_start_x
Definition: editor_drag.h:1616
ArdourCanvas::PolyLine * dragging_line
Definition: editor_drag.h:1609
virtual void line_extended(ArdourCanvas::Duple const &from, ArdourCanvas::Duple const &to, ArdourCanvas::Rectangle const &r, double last_x)
Definition: editor_drag.h:1602
void finished(GdkEvent *, bool)
OrderedPointList drawn_points
Definition: editor_drag.h:1615
bool mid_drag_key_event(GdkEventKey *)
FreehandLineDrag(EditingContext &, ArdourCanvas::Item *, ArdourCanvas::Rectangle &, bool, Temporal::TimeDomain)
void motion(GdkEvent *, bool)
HitCreateDrag(EditingContext &, ArdourCanvas::Item *, MidiView *)
void motion(GdkEvent *, bool)
Definition: editor_drag.h:696
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void finished(GdkEvent *, bool)
MidiView * _midi_view
Definition: editor_drag.h:711
double y_to_region(double) const
bool y_movement_matters() const
Definition: editor_drag.h:704
void aborted(bool)
Definition: editor_drag.h:698
bool active(Editing::MouseMode mode)
Definition: editor_drag.h:700
void aborted(bool)
bool have_command
Definition: editor_drag.h:1277
std::function< void(GdkEvent *, Temporal::timepos_t const &, double)> click_functor
Definition: editor_drag.h:1278
uint32_t _before
Definition: editor_drag.h:1275
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
double _fixed_grab_x
Definition: editor_drag.h:1272
double _cumulative_y_drag
Definition: editor_drag.h:1274
AutomationLine * _line
Definition: editor_drag.h:1271
uint32_t _after
Definition: editor_drag.h:1276
void finished(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1265
void motion(GdkEvent *, bool)
LineDrag(EditingContext &e, ArdourCanvas::Item *i, std::function< void(GdkEvent *, Temporal::timepos_t const &, double)>)
double _fixed_grab_y
Definition: editor_drag.h:1273
ArdourCanvas::Lollipop * _primary
Definition: editor_drag.h:1588
void setup_pointer_offset()
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
LollipopDrag(EditingContext &, ArdourCanvas::Item *)
void aborted(bool)
VelocityDisplay * _display
Definition: editor_drag.h:1587
bool allow_horizontal_autoscroll() const
Definition: editor_drag.h:1576
bool x_movement_matters() const
Definition: editor_drag.h:1580
void motion(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1572
void finished(GdkEvent *, bool)
double _grab_bpm
Definition: editor_drag.h:989
bool y_movement_matters() const
Definition: editor_drag.h:980
void setup_pointer_offset()
void finished(GdkEvent *, bool)
void motion(GdkEvent *, bool)
XMLNode * _before_state
Definition: editor_drag.h:992
MappingEndDrag(Editor &, ArdourCanvas::Item *, Temporal::TempoMap::WritableSharedPtr &, Temporal::TempoPoint &, Temporal::TempoPoint &after, XMLNode &before_state)
Temporal::TempoPoint & _tempo
Definition: editor_drag.h:987
bool allow_horizontal_autoscroll() const
Definition: editor_drag.h:976
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:972
void aborted(bool)
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:990
Temporal::TempoPoint & _after
Definition: editor_drag.h:988
void motion(GdkEvent *, bool)
bool y_movement_matters() const
Definition: editor_drag.h:1019
bool allow_horizontal_autoscroll() const
Definition: editor_drag.h:1015
double initial_focus_npm
Definition: editor_drag.h:1033
MappingTwistDrag(Editor &, ArdourCanvas::Item *, Temporal::TempoMap::WritableSharedPtr &, Temporal::TempoPoint &prev, Temporal::TempoPoint &focus, Temporal::TempoPoint &next, XMLNode &, bool ramped)
Temporal::TempoPoint & focus
Definition: editor_drag.h:1027
Temporal::TempoPoint & prev
Definition: editor_drag.h:1026
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1011
Temporal::TempoPoint & next
Definition: editor_drag.h:1028
void setup_pointer_offset()
XMLNode * _before_state
Definition: editor_drag.h:1036
double initial_pre_npm
Definition: editor_drag.h:1034
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:1029
void aborted(bool)
void finished(GdkEvent *, bool)
void aborted(bool)
bool _selection_changed
Definition: editor_drag.h:1207
std::list< CopiedLocationMarkerInfo > CopiedLocationInfo
Definition: editor_drag.h:1217
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
bool y_movement_matters() const
Definition: editor_drag.h:1196
void finished(GdkEvent *, bool)
MarkerDrag(Editor &, ArdourCanvas::Item *)
ArdourCanvas::Points _points
Definition: editor_drag.h:1219
CopiedLocationInfo _copied_locations
Definition: editor_drag.h:1218
std::vector< ARDOUR::Location::ChangeSuspender > lcs
Definition: editor_drag.h:1215
void setup_pointer_offset()
void update_item(ARDOUR::Location *)
ArdourMarker * _marker
marker being dragged
Definition: editor_drag.h:1206
void motion(GdkEvent *, bool)
void setup_video_offset()
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1192
void finished(GdkEvent *, bool)
Temporal::superclock_t initial_sclock
Definition: editor_drag.h:875
void setup_pointer_offset()
void aborted(bool)
Editing::GridType _old_grid_type
Definition: editor_drag.h:878
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Editing::SnapMode _old_snap_mode
Definition: editor_drag.h:879
MeterMarkerDrag(Editor &, ArdourCanvas::Item *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:862
MeterMarker * _marker
Definition: editor_drag.h:873
void motion(GdkEvent *, bool)
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:874
bool y_movement_matters() const
Definition: editor_drag.h:866
XMLNode * before_state
Definition: editor_drag.h:880
void finished(GdkEvent *, bool)
MidiRubberbandSelectDrag(EditingContext &, MidiView *)
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(EditingContext &, MidiView *)
static Gdk::Cursor * invalid_cursor()
Definition: mouse_cursors.h:90
MouseZoomDrag(Editor &, ArdourCanvas::Item *)
void finished(GdkEvent *, bool)
void aborted(bool)
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void motion(GdkEvent *, bool)
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
MidiView * _midi_view
Definition: editor_drag.h:739
Temporal::Beats get_stride(Temporal::Beats const &pos, Temporal::BBT_Offset const &quantization)
Temporal::Beats next_grid
Definition: editor_drag.h:743
NoteBrushDrag(EditingContext &, ArdourCanvas::Item *, MidiView *, Temporal::Beats specified_length=Temporal::Beats(), int stride_multiple=1)
bool y_movement_matters() const
Definition: editor_drag.h:731
double y_to_region(double) const
void motion(GdkEvent *, bool)
Temporal::timepos_t _last_pos
Definition: editor_drag.h:740
void finished(GdkEvent *, bool)
void aborted(bool)
Definition: editor_drag.h:725
Temporal::Beats specified_length
Definition: editor_drag.h:745
Temporal::Beats stride
Definition: editor_drag.h:742
bool active(Editing::MouseMode mode)
Definition: editor_drag.h:727
NoteCreateDrag(EditingContext &, ArdourCanvas::Item *, MidiView *)
void aborted(bool)
MidiView * _midi_view
Definition: editor_drag.h:684
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:672
Temporal::timepos_t _note[2]
Definition: editor_drag.h:686
bool active(Editing::MouseMode mode)
Definition: editor_drag.h:668
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: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:685
double _note_height
Definition: editor_drag.h:654
NoteBase * _primary
Definition: editor_drag.h:649
double _cumulative_dy
Definition: editor_drag.h:651
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)
NoteDrag(EditingContext &, ArdourCanvas::Item *)
MidiView * _view
Definition: editor_drag.h:648
Temporal::timecnt_t _cumulative_dx
Definition: editor_drag.h:650
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:639
void finished(GdkEvent *, bool)
Temporal::timepos_t _earliest
Definition: editor_drag.h:652
bool _was_selected
Definition: editor_drag.h:653
void motion(GdkEvent *, bool)
NoteResizeDrag(EditingContext &, ArdourCanvas::Item *)
MidiView * midi_view
Definition: editor_drag.h:619
void finished(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:614
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
double _snap_delta
Definition: editor_drag.h:623
void aborted(bool)
void motion(GdkEvent *, bool)
void finished(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:764
PatchChangeDrag(EditingContext &, PatchChange *, MidiView *)
PatchChange * _patch_change
Definition: editor_drag.h:772
MidiView * _region_view
Definition: editor_drag.h:771
double _cumulative_dx
Definition: editor_drag.h:773
void aborted(bool)
void motion(GdkEvent *, bool)
void setup_pointer_offset()
bool y_movement_matters() const
Definition: editor_drag.h:760
ArdourCanvas::Rectangle * _drag_rect
Definition: editor_drag.h:1452
void motion(GdkEvent *, bool)
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Operation _operation
Definition: editor_drag.h:1451
void aborted(bool)
RangeMarkerBarDrag(Editor &, ArdourCanvas::Item *, Operation)
void update_item(ARDOUR::Location *)
bool y_movement_matters() const
Definition: editor_drag.h:1444
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1440
void finished(GdkEvent *, bool)
std::set< Temporal::timepos_t > TimePositionSet
Definition: editor_drag.h:462
virtual void finished(GdkEvent *, bool)
virtual void aborted(bool)
TimePositionSet _already_pasted
Definition: editor_drag.h:463
virtual void motion(GdkEvent *, bool)
virtual void start_grab(GdkEvent *, Gdk::Cursor *)
RegionBrushDrag(Editor &, ArdourCanvas::Item *, RegionView *, std::list< RegionView * > const &, Temporal::TimeDomain td)
virtual ~RegionBrushDrag()
Definition: editor_drag.h:455
MidiTimeAxisView * _view
Definition: editor_drag.h:599
void finished(GdkEvent *, bool)
RegionCreateDrag(Editor &, ArdourCanvas::Item *, TimeAxisView *)
void aborted(bool)
std::shared_ptr< ARDOUR::Region > _region
Definition: editor_drag.h:600
void motion(GdkEvent *, bool)
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void motion(GdkEvent *, bool)
RegionCutDrag(Editor &, ArdourCanvas::Item *, samplepos_t)
void finished(GdkEvent *, bool)
void aborted(bool)
virtual ~RegionDrag()
Definition: editor_drag.h:407
uint32_t _ntracks
Definition: editor_drag.h:421
RegionView * _primary
the view that was clicked on (or whatever) to start the drag
Definition: editor_drag.h:411
void region_going_away(RegionView *)
RegionDrag(Editor &, ArdourCanvas::Item *, RegionView *, std::list< RegionView * > const &, Temporal::TimeDomain, bool hide_snapped_cursor=true)
void setup_video_offset()
int _visible_y_high
Definition: editor_drag.h:420
std::list< DraggingView > _views
information about all views that are being dragged
Definition: editor_drag.h:412
PBD::ScopedConnection death_connection
Definition: editor_drag.h:433
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:415
int _visible_y_low
Definition: editor_drag.h:419
RegionInsertDrag(Editor &, std::shared_ptr< ARDOUR::Region >, RouteTimeAxisView *, Temporal::timepos_t const &, Temporal::TimeDomain)
void finished(GdkEvent *, bool)
bool regions_came_from_canvas() const
Definition: editor_drag.h:570
void aborted(bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1543
void aborted(bool)
ARDOUR::CueMarker model
Definition: editor_drag.h:1556
ARDOUR::CueMarker dragging_model
Definition: editor_drag.h:1557
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void finished(GdkEvent *, bool)
void setup_pointer_offset()
ArdourMarker * view
Definition: editor_drag.h:1555
bool y_movement_matters() const
Definition: editor_drag.h:1547
void motion(GdkEvent *, bool)
RegionMarkerDrag(Editor &, RegionView *, ArdourCanvas::Item *)
RegionView * rv
Definition: editor_drag.h:1554
uint32_t _ddropzone
Definition: editor_drag.h:500
virtual bool y_movement_allowed(int, double, int skip_invisible=0) const
uint32_t _ndropzone
Definition: editor_drag.h:498
uint32_t _pdropzone
Definition: editor_drag.h:499
std::vector< ArdourMarker * > ripple_markers
Definition: editor_drag.h:495
virtual void finished(GdkEvent *, bool)
RegionMotionDrag(Editor &, ArdourCanvas::Item *, RegionView *, std::list< RegionView * > const &, Temporal::TimeDomain td)
double compute_x_delta(GdkEvent const *, Temporal::timepos_t &)
void collect_ripple_views()
virtual void start_grab(GdkEvent *, Gdk::Cursor *)
virtual void motion(GdkEvent *, bool)
Temporal::timepos_t _last_position
last position of the thing being dragged
Definition: editor_drag.h:491
virtual bool regions_came_from_canvas() const =0
virtual ~RegionMotionDrag()
Definition: editor_drag.h:472
double _last_pointer_layer
Definition: editor_drag.h:494
double _total_x_delta
Definition: editor_drag.h:492
virtual void aborted(bool)
int _last_pointer_time_axis_view
Definition: editor_drag.h:493
void aborted(bool)
RegionView * _new_region_view
Definition: editor_drag.h:558
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:519
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:511
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:442
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)
std::function< bool(GdkEvent *, Temporal::timepos_t const &)> click_functor
Definition: editor_drag.h:1330
void finished(GdkEvent *, bool)
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
virtual void deselect_things()
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)
RubberbandSelectDrag(EditingContext &, ArdourCanvas::Item *, std::function< bool(GdkEvent *, Temporal::timepos_t const &)> click_functor)
void finished(GdkEvent *, bool)
SelectionDrag(Editor &, ArdourCanvas::Item *, Operation)
TrackSelection _track_selection_at_start
Definition: editor_drag.h:1398
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void setup_pointer_offset()
bool _time_selection_at_start
Definition: editor_drag.h:1399
void aborted(bool)
Temporal::timepos_t end_at_start
Definition: editor_drag.h:1401
Temporal::timepos_t start_at_start
Definition: editor_drag.h:1400
Operation _operation
Definition: editor_drag.h:1396
void motion(GdkEvent *, bool)
Temporal::timepos_t _end_at_start
Definition: editor_drag.h:1418
void finished(GdkEvent *, bool)
SelectionMarkerDrag(Editor &, ArdourCanvas::Item *)
void motion(GdkEvent *, bool)
Temporal::timepos_t _start_at_start
Definition: editor_drag.h:1417
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void aborted(bool)
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void finished(GdkEvent *, bool)
Temporal::TempoPoint * point
Definition: editor_drag.h:895
XMLNode * _before_state
Definition: editor_drag.h:898
void motion(GdkEvent *, bool)
TempoCurveDrag(Editor &, ArdourCanvas::Item *)
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:897
double initial_bpm
Definition: editor_drag.h:896
bool y_movement_matters() const
Definition: editor_drag.h:1087
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1083
XMLNode * _before_state
Definition: editor_drag.h:1099
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:1097
void aborted(bool)
Temporal::Beats _grab_qn
Definition: editor_drag.h:1094
void motion(GdkEvent *, bool)
Temporal::TempoPoint * previous_tempo
Definition: editor_drag.h:1096
TempoEndDrag(Editor &, ArdourCanvas::Item *)
void setup_pointer_offset()
void finished(GdkEvent *, bool)
Temporal::TempoPoint * _tempo
Definition: editor_drag.h:1095
TempoMarker * _marker
Definition: editor_drag.h:923
XMLNode * _before_state
Definition: editor_drag.h:930
void motion(GdkEvent *, bool)
void setup_pointer_offset()
Temporal::TempoPoint const * _real_section
Definition: editor_drag.h:924
void aborted(bool)
TempoMarkerDrag(Editor &, ArdourCanvas::Item *)
void finished(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:912
bool y_movement_matters() const
Definition: editor_drag.h:916
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Temporal::Beats _grab_qn
Definition: editor_drag.h:929
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:925
Temporal::Beats _grab_qn
Definition: editor_drag.h:1064
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void setup_pointer_offset()
void finished(GdkEvent *, bool)
XMLNode * _before_state
Definition: editor_drag.h:1069
void motion(GdkEvent *, bool)
void aborted(bool)
bool y_movement_matters() const
Definition: editor_drag.h:1057
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1053
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:1067
TempoTwistDrag(Editor &, ArdourCanvas::Item *)
Temporal::TempoPoint const * _next_tempo
Definition: editor_drag.h:1066
Temporal::TempoPoint * _tempo
Definition: editor_drag.h:1065
std::shared_ptr< TempoMap > WritableSharedPtr
int64_t samples() const
Definition: timeline.h:90
void finished(GdkEvent *, bool)
bool _dragging_start
Definition: editor_drag.h:1371
void aborted(bool)
TimeFXDrag(Editor &, ArdourCanvas::Item *, RegionView *, std::list< RegionView * > const &, Temporal::TimeDomain td)
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void motion(GdkEvent *, bool)
TrimDrag(Editor &, ArdourCanvas::Item *, RegionView *, std::list< RegionView * > const &, Temporal::TimeDomain td, bool preserve_fade_anchor=false)
void setup_pointer_offset()
void aborted(bool)
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void finished(GdkEvent *, bool)
void motion(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:835
bool _preserve_fade_anchor
Definition: editor_drag.h:845
bool _jump_position_when_done
Definition: editor_drag.h:846
Operation _operation
Definition: editor_drag.h:843
bool y_movement_matters() const
Definition: editor_drag.h:831
std::vector< RegionView::DisplaySuspender > suspenders
Definition: editor_drag.h:848
VelocityLineDrag(EditingContext &, ArdourCanvas::Rectangle &, bool, Temporal::TimeDomain)
void point_added(ArdourCanvas::Duple const &d, ArdourCanvas::Rectangle const &r, double last_x)
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)
VelocityDisplay * vd
Definition: editor_drag.h:1645
void aborted(bool)
void finished(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:800
bool y_movement_matters() const
Definition: editor_drag.h:796
std::list< AVDraggingView > _views
information about all audio that are being dragged along
Definition: editor_drag.h:807
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
ARDOUR::sampleoffset_t _startdrag_video_offset
Definition: editor_drag.h:810
VideoTimeLineDrag(Editor &e, ArdourCanvas::Item *i)
ARDOUR::sampleoffset_t _max_backwards_drag
Definition: editor_drag.h:811
void finished(GdkEvent *, bool)
void motion(GdkEvent *, bool)
void aborted(bool)
Definition: xml++.h:114
PBD::PropertyDescriptor< Temporal::BBT_Offset > quantization
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:34
std::list< ControlPoint * > points
points to drag on the line
Definition: editor_drag.h:1498
std::pair< Temporal::timepos_t, Temporal::timepos_t > range
the range of all points on the line, in session time
Definition: editor_drag.h:1499
std::shared_ptr< AutomationLine > line
the line
Definition: editor_drag.h:1497
XMLNode * state
the XML state node before the drag
Definition: editor_drag.h:1500
std::vector< ArdourMarker * > markers
Definition: editor_drag.h:1210
CopiedLocationMarkerInfo(ARDOUR::Location *l, ArdourMarker *m)