Ardour  9.0-pre0-1786-g726295c4ce
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 
713  int _y;
714 
715 };
716 
718 class PatchChangeDrag : public Drag
719 {
720 public:
722 
723  void motion (GdkEvent *, bool);
724  void finished (GdkEvent *, bool);
725  void aborted (bool);
726 
727  bool y_movement_matters () const {
728  return false;
729  }
730 
732  return false;
733  }
734 
736 
737 private:
741 };
742 
745 {
746 public:
748 
751 };
752 
755 {
756 public:
758 
759  void motion (GdkEvent *, bool);
760  void finished (GdkEvent *, bool);
761  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
762 
763  bool y_movement_matters () const {
764  return false;
765  }
766 
768  return false;
769  }
770 
771  void aborted (bool);
772 
773 protected:
774  std::list<AVDraggingView> _views;
775 
776 private:
779  bool _stuck;
780 };
781 
783 class TrimDrag : public RegionDrag
784 {
785 public:
786  enum Operation {
788  EndTrim
789  };
790 
791  TrimDrag (Editor&, ArdourCanvas::Item *, RegionView*, std::list<RegionView*> const &, Temporal::TimeDomain td, bool preserve_fade_anchor = false);
792 
793  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
794  void motion (GdkEvent *, bool);
795  void finished (GdkEvent *, bool);
796  void aborted (bool);
797 
798  bool y_movement_matters () const {
799  return false;
800  }
801 
803  return false;
804  }
805 
807 
808 private:
809 
811 
814 
815  std::vector<RegionView::DisplaySuspender> suspenders;
816 };
817 
820 {
821 public:
823 
824  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
825  void motion (GdkEvent *, bool);
826  void finished (GdkEvent *, bool);
827  void aborted (bool);
828 
830  return false;
831  }
832 
833  bool y_movement_matters () const {
834  return false;
835  }
836 
838 
839 private:
843 
844  bool _movable;
848 };
849 
852 {
853 public:
855 
856  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
857  void motion (GdkEvent *, bool);
858  void finished (GdkEvent *, bool);
859  void aborted (bool);
860 
861 private:
863  double initial_bpm;
866 };
867 
870 {
871 public:
873 
874  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
875  void motion (GdkEvent *, bool);
876  void finished (GdkEvent *, bool);
877  void aborted (bool);
878 
880  return false;
881  }
882 
883  bool y_movement_matters () const {
884  return true;
885  }
886 
888 
889 private:
893 
894  bool _movable;
895  double _grab_bpm;
898 };
899 
901 class BBTMarkerDrag : public EditorDrag
902 {
903 public:
905 
906  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
907  void motion (GdkEvent *, bool);
908  void finished (GdkEvent *, bool);
909  void aborted (bool);
910 
912  return false;
913  }
914 
915  bool y_movement_matters () const {
916  return false;
917  }
918 
920 
921 private:
925 
927 };
928 
930 {
931 public:
933 
934  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
935  void motion (GdkEvent *, bool);
936  void finished (GdkEvent *, bool);
937  void aborted (bool);
938 
940  return false;
941  }
942 
944  return false;
945  }
946 
947  bool y_movement_matters () const {
948  return false;
949  }
950 
952 
953 private:
956  double _grab_bpm;
958 
961 };
962 
964 {
965 public:
970  XMLNode&,
971  bool ramped);
972 
973  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
974  void motion (GdkEvent *, bool);
975  void finished (GdkEvent *, bool);
976  void aborted (bool);
977 
979  return false;
980  }
981 
983  return false;
984  }
985 
986  bool y_movement_matters () const {
987  return false;
988  }
989 
991 
992 private:
997 
998  double direction;
999  double delta;
1002 
1005  bool _do_ramp;
1006 };
1007 
1008 
1011 {
1012 public:
1014 
1015  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1016  void motion (GdkEvent *, bool);
1017  void finished (GdkEvent *, bool);
1018  void aborted (bool);
1019 
1021  return false;
1022  }
1023 
1024  bool y_movement_matters () const {
1025  return true;
1026  }
1027 
1029 
1030 private:
1037 };
1038 
1040 class TempoEndDrag : public EditorDrag
1041 {
1042 public:
1044 
1045  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1046  void motion (GdkEvent *, bool);
1047  void finished (GdkEvent *, bool);
1048  void aborted (bool);
1049 
1051  return false;
1052  }
1053 
1054  bool y_movement_matters () const {
1055  return true;
1056  }
1057 
1059 
1060 private:
1065 
1068 };
1069 
1071 class CursorDrag : public EditorDrag
1072 {
1073 public:
1075 
1076  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1077  void motion (GdkEvent *, bool);
1078  void finished (GdkEvent *, bool);
1079  void aborted (bool);
1080 
1082  return false;
1083  }
1084 
1085  bool y_movement_matters () const {
1086  return true;
1087  }
1088 
1089 private:
1091 
1093  bool _stop;
1094  double _grab_zoom;
1095 
1096  //used for zooming
1101 };
1102 
1104 class FadeInDrag : public RegionDrag
1105 {
1106 public:
1107  FadeInDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain);
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 
1114  bool y_movement_matters () const {
1115  return false;
1116  }
1117 
1119  return false;
1120  }
1121 
1123 };
1124 
1126 class FadeOutDrag : public RegionDrag
1127 {
1128 public:
1129  FadeOutDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain td);
1130 
1131  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1132  void motion (GdkEvent *, bool);
1133  void finished (GdkEvent *, bool);
1134  void aborted (bool);
1135 
1136  bool y_movement_matters () const {
1137  return false;
1138  }
1139 
1141  return false;
1142  }
1143 
1145 };
1146 
1148 class MarkerDrag : public EditorDrag
1149 {
1150 public:
1153 
1154  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1155  void motion (GdkEvent *, bool);
1156  void finished (GdkEvent *, bool);
1157  void aborted (bool);
1158 
1160  return false;
1161  }
1162 
1163  bool y_movement_matters () const {
1164  return false;
1165  }
1166 
1169 
1170 private:
1172 
1177  std::vector<ArdourMarker*> markers;
1180  };
1181 
1182  std::vector<ARDOUR::Location::ChangeSuspender> lcs;
1183 
1184  typedef std::list<CopiedLocationMarkerInfo> CopiedLocationInfo;
1187 };
1188 
1190 class ControlPointDrag : public Drag
1191 {
1192 public:
1194 
1195  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1196  void motion (GdkEvent *, bool);
1197  void finished (GdkEvent *, bool);
1198  void aborted (bool);
1199 
1201 
1203  return false;
1204  }
1205 
1206 
1207 private:
1208 
1213  bool _pushing;
1214  uint32_t _final_index;
1215  static double _zero_gain_fraction;
1216 
1218 };
1219 
1221 class LineDrag : public Drag
1222 {
1223 public:
1224  LineDrag (EditingContext &e, ArdourCanvas::Item *i, std::function<void(GdkEvent*,Temporal::timepos_t const &,double)>);
1226 
1227  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1228  void motion (GdkEvent *, bool);
1229  void finished (GdkEvent *, bool);
1230  void aborted (bool);
1231 
1233  return false;
1234  }
1235 
1236 private:
1237 
1242  uint32_t _before;
1243  uint32_t _after;
1245  std::function<void(GdkEvent*,Temporal::timepos_t const &,double)> click_functor;
1246 };
1247 
1249 class FeatureLineDrag : public Drag
1250 {
1251 public:
1253 
1254  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1255  void motion (GdkEvent *, bool);
1256  void finished (GdkEvent *, bool);
1257  void aborted (bool);
1258 
1259 private:
1260 
1263 
1266 
1267  float _before;
1268  uint32_t _max_x;
1269 };
1270 
1273 {
1274 public:
1276 
1277  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1278  void motion (GdkEvent *, bool);
1279  void finished (GdkEvent *, bool);
1280  void aborted (bool);
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);
1293  virtual void deselect_things ();
1294 
1295  protected:
1297  std::function<bool(GdkEvent*,Temporal::timepos_t const &)> click_functor;
1298 };
1299 
1302 {
1303  public:
1305 
1306  void select_things (int, Temporal::timepos_t const &, Temporal::timepos_t const &, double, double, bool);
1308  void finished (GdkEvent *, bool);
1309 
1310  private:
1312 };
1313 
1316 {
1317 public:
1319 
1320  void select_things (int, Temporal::timepos_t const &, Temporal::timepos_t const &, double, double, bool);
1322 
1323 private:
1325 };
1326 
1328 class TimeFXDrag : public RegionDrag
1329 {
1330 public:
1331  TimeFXDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain td);
1332 
1333  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1334  void motion (GdkEvent *, bool);
1335  void finished (GdkEvent *, bool);
1336  void aborted (bool);
1337 private:
1339 };
1340 
1343 {
1344 public:
1345  enum Operation {
1351  };
1352 
1354 
1355  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1356  void motion (GdkEvent *, bool);
1357  void finished (GdkEvent *, bool);
1358  void aborted (bool);
1359 
1361 
1362 private:
1364  bool _add;
1369 };
1370 
1373 {
1374 public:
1376 
1378  void motion (GdkEvent*, bool);
1379  void finished (GdkEvent *, bool);
1380  void aborted (bool);
1381 
1382 private:
1386 };
1387 
1390 {
1391 public:
1392  enum Operation {
1397  };
1398 
1401 
1402  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1403  void motion (GdkEvent *, bool);
1404  void finished (GdkEvent *, bool);
1405  void aborted (bool);
1406 
1408  return false;
1409  }
1410 
1411  bool y_movement_matters () const {
1412  return false;
1413  }
1414 
1415 private:
1417 
1420 };
1421 
1424 {
1425 public:
1427 
1428  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1429  void motion (GdkEvent *, bool);
1430  void finished (GdkEvent *, bool);
1431  void aborted (bool);
1432 
1433 private:
1435 };
1436 
1441 {
1442 public:
1443  AutomationRangeDrag (EditingContext&, AutomationTimeAxisView *, float initial_value, std::list<ARDOUR::TimelineRange> const &);
1444  AutomationRangeDrag (EditingContext&, std::list<RegionView*> const &, std::list<ARDOUR::TimelineRange> const &, double y_origin, double y_height);
1445 
1446  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1447  void motion (GdkEvent *, bool);
1448  void finished (GdkEvent *, bool);
1449  void aborted (bool);
1450 
1451  bool x_movement_matters () const {
1452  return false;
1453  }
1454 
1455 private:
1456  void setup (std::list<std::shared_ptr<AutomationLine> > const &);
1457  double y_fraction (double global_y_position) const;
1458  double value (std::shared_ptr<ARDOUR::AutomationList> list, Temporal::timepos_t const & x) const;
1459 
1460  std::list<ARDOUR::TimelineRange> _ranges;
1461 
1463  struct Line {
1464  std::shared_ptr<AutomationLine> line;
1465  std::list<ControlPoint*> points;
1466  std::pair<Temporal::timepos_t, Temporal::timepos_t> range;
1468  };
1469 
1470  std::list<Line> _lines;
1471  double _y_origin;
1472  double _y_height;
1476 };
1477 
1480 class CrossfadeEdgeDrag : public Drag
1481 {
1482 public:
1484 
1486  void motion (GdkEvent*, bool);
1487  void finished (GdkEvent*, bool);
1488  void aborted (bool);
1489 
1490  bool y_movement_matters () const {
1491  return false;
1492  }
1493 
1494 private:
1496  bool start;
1497 };
1498 
1499 class RegionMarkerDrag : public Drag
1500 {
1501  public:
1504 
1505  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1506  void motion (GdkEvent *, bool);
1507  void finished (GdkEvent *, bool);
1508  void aborted (bool);
1509 
1511  return false;
1512  }
1513 
1514  bool y_movement_matters () const {
1515  return false;
1516  }
1517 
1519 
1520  private:
1525 };
1526 
1527 
1528 class LollipopDrag : public Drag
1529 {
1530  public:
1533 
1534  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1535  void motion (GdkEvent *, bool);
1536  void finished (GdkEvent *, bool);
1537  void aborted (bool);
1538 
1540  return false;
1541  }
1542 
1544  return false;
1545  }
1546 
1547  bool x_movement_matters () const {
1548  return false;
1549  }
1550 
1552 
1553  private:
1556 };
1557 
1558 template<typename OrderedPointList, typename OrderedPoint>
1559 class FreehandLineDrag : public Drag
1560 {
1561  public:
1564 
1565  void motion (GdkEvent*, bool);
1566  void finished (GdkEvent*, bool);
1568  virtual void point_added (ArdourCanvas::Duple const & d, ArdourCanvas::Rectangle const & r, double last_x) {}
1569  virtual void line_extended (ArdourCanvas::Duple const & from, ArdourCanvas::Duple const & to, ArdourCanvas::Rectangle const & r, double last_x) {
1570  point_added (to, r, last_x);
1571  }
1572 
1573  protected:
1574  ArdourCanvas::Item* parent; /* we do not own this. If null, use base_rect as the parent */
1575  ArdourCanvas::Rectangle& base_rect; /* we do not own this */
1579  int edge_x;
1580  bool did_snap;
1582  OrderedPointList drawn_points;
1585 
1586  void maybe_add_point (GdkEvent*, Temporal::timepos_t const &, bool first_move);
1587 };
1588 
1589 class AutomationDrawDrag : public FreehandLineDrag<Evoral::ControlList::OrderedPoints, Evoral::ControlList::OrderedPoint>
1590 {
1591  public:
1594 
1595  void finished (GdkEvent*, bool);
1596  void aborted (bool) {}
1597 };
1598 
1599 class VelocityLineDrag : public FreehandLineDrag<Evoral::ControlList::OrderedPoints, Evoral::ControlList::OrderedPoint>
1600 {
1601  public:
1604 
1605  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1606  void finished (GdkEvent*, bool);
1607  void aborted (bool);
1608  void point_added (ArdourCanvas::Duple const & d, ArdourCanvas::Rectangle const & r, double last_x);
1609  void line_extended (ArdourCanvas::Duple const & from, ArdourCanvas::Duple const & to, ArdourCanvas::Rectangle const & r, double last_x);
1610 
1611  private:
1614 };
1615 
1616 class ClipStartDrag : public Drag
1617 {
1618  public:
1621 
1624  void motion (GdkEvent*, bool);
1625  void finished (GdkEvent*, bool);
1626  void aborted (bool);
1627 
1628  private:
1632 };
1633 
1634 class ClipEndDrag : public Drag
1635 {
1636  public:
1639 
1642  void motion (GdkEvent*, bool);
1643  void finished (GdkEvent*, bool);
1644  void aborted (bool);
1645 
1646  private:
1650 };
1651 
1652 #endif /* __gtk2_ardour_editor_drag_h_ */
AVDraggingView(RegionView *)
samplepos_t initial_position
initial position of the region
Definition: editor_drag.h:750
RegionView * view
the view
Definition: editor_drag.h:749
void aborted(bool)
Definition: editor_drag.h:1596
void finished(GdkEvent *, bool)
AutomationDrawDrag(EditingContext &, ArdourCanvas::Item *, ArdourCanvas::Rectangle &, bool, Temporal::TimeDomain)
std::list< ARDOUR::TimelineRange > _ranges
Definition: editor_drag.h:1460
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:1470
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:1451
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:926
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:924
bool y_movement_matters() const
Definition: editor_drag.h:915
BBTMarkerDrag(Editor &, ArdourCanvas::Item *)
void aborted(bool)
BBTMarker * _marker
Definition: editor_drag.h:922
void finished(GdkEvent *, bool)
void motion(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:911
Temporal::MusicTimePoint const * _point
Definition: editor_drag.h:923
void start_grab(GdkEvent *, Gdk::Cursor *)
void aborted(bool)
ClipEndDrag(CueEditor &, ArdourCanvas::Rectangle &)
void finished(GdkEvent *, bool)
CueEditor & ce
Definition: editor_drag.h:1647
ArdourCanvas::Rectangle * dragging_rect
Definition: editor_drag.h:1648
void motion(GdkEvent *, bool)
bool end_grab(GdkEvent *)
ArdourCanvas::Rect original_rect
Definition: editor_drag.h:1649
void aborted(bool)
bool end_grab(GdkEvent *)
ArdourCanvas::Rect original_rect
Definition: editor_drag.h:1631
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:1630
CueEditor & ce
Definition: editor_drag.h:1629
uint32_t _final_index
Definition: editor_drag.h:1214
void motion(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1202
Temporal::timecnt_t total_dt(GdkEvent *) const
bool active(Editing::MouseMode m)
ControlPoint * _point
Definition: editor_drag.h:1209
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:1215
double _cumulative_y_drag
Definition: editor_drag.h:1212
AudioRegionView * arv
Definition: editor_drag.h:1495
bool y_movement_matters() const
Definition: editor_drag.h:1490
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:1094
int _last_y_delta
Definition: editor_drag.h:1100
CursorDrag(Editor &, EditorCursor &, bool)
bool _stop
true to stop the transport on starting the drag, otherwise false
Definition: editor_drag.h:1093
EditorCursor & _cursor
Definition: editor_drag.h:1092
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1081
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:1085
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:1118
void setup_pointer_offset()
void aborted(bool)
void motion(GdkEvent *, bool)
bool y_movement_matters() const
Definition: editor_drag.h:1114
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:1136
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1140
void setup_pointer_offset()
void motion(GdkEvent *, bool)
void finished(GdkEvent *, bool)
ArdourCanvas::Line * _line
Definition: editor_drag.h:1261
double _cumulative_x_drag
Definition: editor_drag.h:1265
double _region_view_grab_x
Definition: editor_drag.h:1264
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:1262
FeatureLineDrag(Editor &e, ArdourCanvas::Item *i)
ArdourCanvas::Coord line_start_y
Definition: editor_drag.h:1584
virtual void point_added(ArdourCanvas::Duple const &d, ArdourCanvas::Rectangle const &r, double last_x)
Definition: editor_drag.h:1568
void maybe_add_point(GdkEvent *, Temporal::timepos_t const &, bool first_move)
ArdourCanvas::Item * parent
Definition: editor_drag.h:1574
ArdourCanvas::Rectangle & base_rect
Definition: editor_drag.h:1575
ArdourCanvas::Coord line_start_x
Definition: editor_drag.h:1583
ArdourCanvas::PolyLine * dragging_line
Definition: editor_drag.h:1576
virtual void line_extended(ArdourCanvas::Duple const &from, ArdourCanvas::Duple const &to, ArdourCanvas::Rectangle const &r, double last_x)
Definition: editor_drag.h:1569
void finished(GdkEvent *, bool)
OrderedPointList drawn_points
Definition: editor_drag.h:1582
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)
Temporal::timepos_t _last_pos
Definition: editor_drag.h:712
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:1244
std::function< void(GdkEvent *, Temporal::timepos_t const &, double)> click_functor
Definition: editor_drag.h:1245
uint32_t _before
Definition: editor_drag.h:1242
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
double _fixed_grab_x
Definition: editor_drag.h:1239
double _cumulative_y_drag
Definition: editor_drag.h:1241
AutomationLine * _line
Definition: editor_drag.h:1238
uint32_t _after
Definition: editor_drag.h:1243
void finished(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1232
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:1240
ArdourCanvas::Lollipop * _primary
Definition: editor_drag.h:1555
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:1554
bool allow_horizontal_autoscroll() const
Definition: editor_drag.h:1543
bool x_movement_matters() const
Definition: editor_drag.h:1547
void motion(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1539
void finished(GdkEvent *, bool)
double _grab_bpm
Definition: editor_drag.h:956
bool y_movement_matters() const
Definition: editor_drag.h:947
void setup_pointer_offset()
void finished(GdkEvent *, bool)
void motion(GdkEvent *, bool)
XMLNode * _before_state
Definition: editor_drag.h:959
MappingEndDrag(Editor &, ArdourCanvas::Item *, Temporal::TempoMap::WritableSharedPtr &, Temporal::TempoPoint &, Temporal::TempoPoint &after, XMLNode &before_state)
Temporal::TempoPoint & _tempo
Definition: editor_drag.h:954
bool allow_horizontal_autoscroll() const
Definition: editor_drag.h:943
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:939
void aborted(bool)
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:957
Temporal::TempoPoint & _after
Definition: editor_drag.h:955
void motion(GdkEvent *, bool)
bool y_movement_matters() const
Definition: editor_drag.h:986
bool allow_horizontal_autoscroll() const
Definition: editor_drag.h:982
double initial_focus_npm
Definition: editor_drag.h:1000
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:994
Temporal::TempoPoint & prev
Definition: editor_drag.h:993
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:978
Temporal::TempoPoint & next
Definition: editor_drag.h:995
void setup_pointer_offset()
XMLNode * _before_state
Definition: editor_drag.h:1003
double initial_pre_npm
Definition: editor_drag.h:1001
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:996
void aborted(bool)
void finished(GdkEvent *, bool)
void aborted(bool)
bool _selection_changed
Definition: editor_drag.h:1174
std::list< CopiedLocationMarkerInfo > CopiedLocationInfo
Definition: editor_drag.h:1184
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
bool y_movement_matters() const
Definition: editor_drag.h:1163
void finished(GdkEvent *, bool)
MarkerDrag(Editor &, ArdourCanvas::Item *)
ArdourCanvas::Points _points
Definition: editor_drag.h:1186
CopiedLocationInfo _copied_locations
Definition: editor_drag.h:1185
std::vector< ARDOUR::Location::ChangeSuspender > lcs
Definition: editor_drag.h:1182
void setup_pointer_offset()
void update_item(ARDOUR::Location *)
ArdourMarker * _marker
marker being dragged
Definition: editor_drag.h:1173
void motion(GdkEvent *, bool)
void setup_video_offset()
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1159
void finished(GdkEvent *, bool)
Temporal::superclock_t initial_sclock
Definition: editor_drag.h:842
void setup_pointer_offset()
void aborted(bool)
Editing::GridType _old_grid_type
Definition: editor_drag.h:845
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Editing::SnapMode _old_snap_mode
Definition: editor_drag.h:846
MeterMarkerDrag(Editor &, ArdourCanvas::Item *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:829
MeterMarker * _marker
Definition: editor_drag.h:840
void motion(GdkEvent *, bool)
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:841
bool y_movement_matters() const
Definition: editor_drag.h:833
XMLNode * before_state
Definition: editor_drag.h:847
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)
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:731
PatchChangeDrag(EditingContext &, PatchChange *, MidiView *)
PatchChange * _patch_change
Definition: editor_drag.h:739
MidiView * _region_view
Definition: editor_drag.h:738
double _cumulative_dx
Definition: editor_drag.h:740
void aborted(bool)
void motion(GdkEvent *, bool)
void setup_pointer_offset()
bool y_movement_matters() const
Definition: editor_drag.h:727
ArdourCanvas::Rectangle * _drag_rect
Definition: editor_drag.h:1419
void motion(GdkEvent *, bool)
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Operation _operation
Definition: editor_drag.h:1418
void aborted(bool)
RangeMarkerBarDrag(Editor &, ArdourCanvas::Item *, Operation)
void update_item(ARDOUR::Location *)
bool y_movement_matters() const
Definition: editor_drag.h:1411
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1407
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:1510
void aborted(bool)
ARDOUR::CueMarker model
Definition: editor_drag.h:1523
ARDOUR::CueMarker dragging_model
Definition: editor_drag.h:1524
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void finished(GdkEvent *, bool)
void setup_pointer_offset()
ArdourMarker * view
Definition: editor_drag.h:1522
bool y_movement_matters() const
Definition: editor_drag.h:1514
void motion(GdkEvent *, bool)
RegionMarkerDrag(Editor &, RegionView *, ArdourCanvas::Item *)
RegionView * rv
Definition: editor_drag.h:1521
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:1297
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:1365
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void setup_pointer_offset()
bool _time_selection_at_start
Definition: editor_drag.h:1366
void aborted(bool)
Temporal::timepos_t end_at_start
Definition: editor_drag.h:1368
Temporal::timepos_t start_at_start
Definition: editor_drag.h:1367
Operation _operation
Definition: editor_drag.h:1363
void motion(GdkEvent *, bool)
Temporal::timepos_t _end_at_start
Definition: editor_drag.h:1385
void finished(GdkEvent *, bool)
SelectionMarkerDrag(Editor &, ArdourCanvas::Item *)
void motion(GdkEvent *, bool)
Temporal::timepos_t _start_at_start
Definition: editor_drag.h:1384
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:862
XMLNode * _before_state
Definition: editor_drag.h:865
void motion(GdkEvent *, bool)
TempoCurveDrag(Editor &, ArdourCanvas::Item *)
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:864
double initial_bpm
Definition: editor_drag.h:863
bool y_movement_matters() const
Definition: editor_drag.h:1054
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1050
XMLNode * _before_state
Definition: editor_drag.h:1066
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:1064
void aborted(bool)
Temporal::Beats _grab_qn
Definition: editor_drag.h:1061
void motion(GdkEvent *, bool)
Temporal::TempoPoint * previous_tempo
Definition: editor_drag.h:1063
TempoEndDrag(Editor &, ArdourCanvas::Item *)
void setup_pointer_offset()
void finished(GdkEvent *, bool)
Temporal::TempoPoint * _tempo
Definition: editor_drag.h:1062
TempoMarker * _marker
Definition: editor_drag.h:890
XMLNode * _before_state
Definition: editor_drag.h:897
void motion(GdkEvent *, bool)
void setup_pointer_offset()
Temporal::TempoPoint const * _real_section
Definition: editor_drag.h:891
void aborted(bool)
TempoMarkerDrag(Editor &, ArdourCanvas::Item *)
void finished(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:879
bool y_movement_matters() const
Definition: editor_drag.h:883
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Temporal::Beats _grab_qn
Definition: editor_drag.h:896
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:892
Temporal::Beats _grab_qn
Definition: editor_drag.h:1031
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void setup_pointer_offset()
void finished(GdkEvent *, bool)
XMLNode * _before_state
Definition: editor_drag.h:1036
void motion(GdkEvent *, bool)
void aborted(bool)
bool y_movement_matters() const
Definition: editor_drag.h:1024
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1020
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:1034
TempoTwistDrag(Editor &, ArdourCanvas::Item *)
Temporal::TempoPoint const * _next_tempo
Definition: editor_drag.h:1033
Temporal::TempoPoint * _tempo
Definition: editor_drag.h:1032
std::shared_ptr< TempoMap > WritableSharedPtr
int64_t samples() const
Definition: timeline.h:90
void finished(GdkEvent *, bool)
bool _dragging_start
Definition: editor_drag.h:1338
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:802
bool _preserve_fade_anchor
Definition: editor_drag.h:812
bool _jump_position_when_done
Definition: editor_drag.h:813
Operation _operation
Definition: editor_drag.h:810
bool y_movement_matters() const
Definition: editor_drag.h:798
std::vector< RegionView::DisplaySuspender > suspenders
Definition: editor_drag.h:815
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:1612
void aborted(bool)
void finished(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:767
bool y_movement_matters() const
Definition: editor_drag.h:763
std::list< AVDraggingView > _views
information about all audio that are being dragged along
Definition: editor_drag.h:774
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
ARDOUR::sampleoffset_t _startdrag_video_offset
Definition: editor_drag.h:777
VideoTimeLineDrag(Editor &e, ArdourCanvas::Item *i)
ARDOUR::sampleoffset_t _max_backwards_drag
Definition: editor_drag.h:778
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:34
std::list< ControlPoint * > points
points to drag on the line
Definition: editor_drag.h:1465
std::pair< Temporal::timepos_t, Temporal::timepos_t > range
the range of all points on the line, in session time
Definition: editor_drag.h:1466
std::shared_ptr< AutomationLine > line
the line
Definition: editor_drag.h:1464
XMLNode * state
the XML state node before the drag
Definition: editor_drag.h:1467
std::vector< ArdourMarker * > markers
Definition: editor_drag.h:1177
CopiedLocationMarkerInfo(ARDOUR::Location *l, ArdourMarker *m)