Ardour  9.2-588-gca716e361e
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  bool dragging_lollipop () const;
144  std::list<Drag*> const & drags() const { return _drags; }
145 
146 private:
148  std::list<Drag*> _drags;
149  bool _ending;
154 };
155 
157 class Drag
158 {
159 public:
160  Drag (EditingContext&, ArdourCanvas::Item *, Temporal::TimeDomain td, ArdourCanvas::Item const * bounding_item, bool hide_snapped_cursor = true);
161  virtual ~Drag ();
162 
164  _drags = m;
165  }
166 
167  ArdourCanvas::Item const * bounding_item() const { return _bounding_item; }
169 
172  return _item;
173  }
174 
177 
178  void swap_grab (ArdourCanvas::Item *, Gdk::Cursor *, uint32_t);
179  bool motion_handler (GdkEvent*, bool);
180  void abort ();
181 
182  Temporal::timepos_t adjusted_time (Temporal::timepos_t const &, GdkEvent const *, bool snap = true) const;
183  Temporal::timepos_t adjusted_current_time (GdkEvent const *, bool snap = true) const;
184 
185  bool was_double_click() const { return _was_double_click; }
186  void set_double_click (bool yn) { _was_double_click = yn; }
187 
189 
194  virtual void start_grab (GdkEvent* e, Gdk::Cursor* c = 0);
195 
196  virtual bool end_grab (GdkEvent *);
197 
202  virtual void motion (GdkEvent* e, bool f) = 0;
203 
208  virtual void finished (GdkEvent* e, bool m) = 0;
209 
214  virtual void aborted (bool m) = 0;
215 
219  virtual bool active (Editing::MouseMode m) {
220  return true;
221  }
222 
223  bool preview_video () const {
224  return _preview_video;
225  }
226 
228  typedef std::pair<int,int> MoveThreshold;
229 
230  virtual MoveThreshold move_threshold () const;
231 
232  virtual bool allow_vertical_autoscroll () const {
233  return true;
234  }
235 
236  virtual bool allow_horizontal_autoscroll () const {
237  return true;
238  }
239 
241  virtual bool x_movement_matters () const {
242  return true;
243  }
244 
246  virtual bool y_movement_matters () const {
247  return true;
248  }
249 
250  virtual bool mid_drag_key_event (GdkEventKey*) { return false; }
251 
252  bool initially_vertical() const {
253  return _initially_vertical;
254  }
255 
257  virtual void setup_pointer_offset () {
259  }
260 
262  virtual void setup_video_offset () {
263  /* video offset is always in audio time */
265  _preview_video = false;
266  }
267 
268  int grab_button() const { return _grab_button; }
269 
270 protected:
271 
272  double grab_x () const {
273  return _grab_x;
274  }
275 
276  double grab_y () const {
277  return _grab_y;
278  }
279 
281 
283  return _raw_grab_time;
284  }
285 
287  return _grab_time.samples();
288  }
289 
291  return _grab_time;
292  }
293 
294  double last_pointer_x () const {
295  return _last_pointer_x;
296  }
297 
298  double last_pointer_y () const {
299  return _last_pointer_y;
300  }
301 
303  return _last_pointer_time.samples();
304  }
305 
307  return _last_pointer_time;
308  }
309 
310  Temporal::timecnt_t snap_delta (guint const) const;
311 
312  double current_pointer_x () const;
313  double current_pointer_y () const;
314 
315  /* sets snap delta from unsnapped pos */
317 
318  std::shared_ptr<ARDOUR::Region> add_midi_region (MidiTimeAxisView*, bool commit);
319 
321  void show_verbose_cursor_duration (Temporal::timepos_t const & , Temporal::timepos_t const & , double xoffset = 0);
322  void show_verbose_cursor_text (std::string const &);
324 
337  bool _copy;
338 
339 private:
346  double _grab_x;
347  double _grab_y;
354 
355  /* difference between some key position's snapped and unsnapped
356  * samplepos. used for relative snap.
357  */
361 
363 };
364 
370 class EditorDrag : public Drag
371 {
372  public:
373  EditorDrag (Editor&, ArdourCanvas::Item *, Temporal::TimeDomain td, ArdourCanvas::Item const * bounding_item, bool hide_snapped_cursor = true);
374  protected:
376 };
377 
378 class RegionDrag;
379 
382 {
383 public:
385 
395  double layer;
396  double initial_y;
400  std::shared_ptr<ARDOUR::Playlist> initial_playlist;
402 };
403 
405 class RegionDrag : public EditorDrag, public sigc::trackable
406 {
407 public:
408  RegionDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain, bool hide_snapped_cursor = true);
409  virtual ~RegionDrag () {}
410 
411 protected:
412 
414  std::list<DraggingView> _views;
415 
417  std::vector<TimeAxisView*> _time_axis_views;
419  int apply_track_delta (const int start, const int delta, const int skip, const bool distance_only = false) const;
420 
423  uint32_t _ntracks;
424 
426 
427  friend class DraggingView;
428 
429 protected:
431 
432 private:
433 
436 };
437 
440 {
441 public:
442 
445 
446  virtual void start_grab (GdkEvent *, Gdk::Cursor *);
447  virtual void motion (GdkEvent *, bool);
448  virtual void finished (GdkEvent *, bool);
449  virtual void aborted (bool);
450 };
451 
454 {
455 public:
456  RegionBrushDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain td);
457  virtual ~RegionBrushDrag () {}
458 
459  virtual void start_grab (GdkEvent *, Gdk::Cursor *);
460  virtual void motion (GdkEvent *, bool);
461  virtual void finished (GdkEvent *, bool);
462  virtual void aborted (bool);
463 private:
464  typedef std::set<Temporal::timepos_t> TimePositionSet;
466 };
467 
470 {
471 public:
472 
473  RegionMotionDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain td);
474  virtual ~RegionMotionDrag () {}
475 
476  virtual void start_grab (GdkEvent *, Gdk::Cursor *);
477  virtual void motion (GdkEvent *, bool);
478  virtual void finished (GdkEvent *, bool);
479  virtual void aborted (bool);
480 
484  virtual bool regions_came_from_canvas () const = 0;
485 
486 protected:
487 
489  virtual bool y_movement_allowed (int, double, int skip_invisible = 0) const;
491 
497  std::vector<ArdourMarker*> ripple_markers;
498 
499 private:
500  uint32_t _ndropzone;
501  uint32_t _pdropzone;
502  uint32_t _ddropzone;
503 };
504 
505 
510 {
511 public:
512  RegionMoveDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, bool, Temporal::TimeDomain);
513  virtual ~RegionMoveDrag () {}
514 
515  void motion (GdkEvent *, bool);
516  void finished (GdkEvent *, bool);
517  void aborted (bool);
518 
520 
521  bool regions_came_from_canvas () const {
522  return true;
523  }
524 
526 
527 private:
529  bool const,
530  bool const,
531  Temporal::timepos_t const &,
532  int32_t const ev_state
533  );
534 
536  bool const,
537  bool const,
538  Temporal::timepos_t const &,
539  int32_t const ev_state
540  );
541 
543  std::shared_ptr<ARDOUR::Region>,
546  Temporal::timepos_t const &,
548  );
549 
551  std::shared_ptr<ARDOUR::Region>,
552  std::shared_ptr<ARDOUR::Playlist>,
553  ARDOUR::PlaylistSet& modified_playlists
554  );
555 
556 
558  RouteTimeAxisView* create_destination_time_axis (std::shared_ptr<ARDOUR::Region>, TimeAxisView* original);
559 
561 };
562 
565 {
566 public:
567  RegionInsertDrag (Editor&, std::shared_ptr<ARDOUR::Region>, RouteTimeAxisView*, Temporal::timepos_t const &, Temporal::TimeDomain);
568 
569  void finished (GdkEvent *, bool);
570  void aborted (bool);
571 
572  bool regions_came_from_canvas () const {
573  return false;
574  }
575 };
576 
578 class RegionCutDrag : public EditorDrag
579 {
580 public:
583 
584  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
585  void motion (GdkEvent*, bool);
586  void finished (GdkEvent*, bool);
587  void aborted (bool);
588 };
589 
592 {
593 public:
595 
596  void motion (GdkEvent *, bool);
597  void finished (GdkEvent *, bool);
598  void aborted (bool);
599 
600 private:
602  std::shared_ptr<ARDOUR::Region> _region;
603 };
604 
606 class NoteResizeDrag : public Drag
607 {
608 public:
610 
611  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
612  void motion (GdkEvent *, bool);
613  void finished (GdkEvent *, bool);
614  void aborted (bool);
615 
617  return false;
618  }
619 
620 private:
622  bool relative;
623  bool at_front;
625  double _snap_delta;
626 };
627 
629 class NoteDrag : public Drag
630 {
631 public:
633 
634  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
635  void motion (GdkEvent *, bool);
636  void finished (GdkEvent *, bool);
637  void aborted (bool);
638 
640 
642  return false;
643  }
644 
645 private:
646 
647  Temporal::timecnt_t total_dx (GdkEvent * event) const; // total movement in quarter notes
648  int8_t total_dy () const;
649 
654  Temporal::timepos_t _earliest; // earliest note in note selection
656  double _note_height;
657 };
658 
659 class NoteCreateDrag : public Drag
660 {
661 public:
664 
665  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
666  void motion (GdkEvent *, bool);
667  void finished (GdkEvent *, bool);
668  void aborted (bool);
669 
671  return mode == Editing::MouseDraw || mode == Editing::MouseContent;
672  }
673 
675  return false;
676  }
677 
678  bool y_movement_matters () const {
679  return false;
680  }
681 
682 private:
683  double y_to_region (double) const;
684  Temporal::Beats round_to_grid (Temporal::timepos_t const & pos, GdkEvent const * event) const;
685 
689 };
690 
691 class HitCreateDrag : public Drag
692 {
693 public:
696 
697  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
698  void motion (GdkEvent *, bool) {}
699  void finished (GdkEvent *, bool);
700  void aborted (bool) {}
701 
703  return mode == Editing::MouseDraw || mode == Editing::MouseContent;
704  }
705 
706  bool y_movement_matters () const {
707  return false;
708  }
709 
710 private:
711  double y_to_region (double) const;
712 
714  int _y;
715 
716 };
717 
718 class NoteBrushDrag : public Drag
719 {
720 public:
723 
724  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
725  void motion (GdkEvent *, bool);
726  void finished (GdkEvent *, bool);
727  void aborted (bool) {}
728 
730  return mode == Editing::MouseDraw || mode == Editing::MouseContent;
731  }
732 
733  bool y_movement_matters () const {
734  return false;
735  }
736 
737 private:
738  double y_to_region (double) const;
740 
743  int _y;
750 };
751 
753 class PatchChangeDrag : public Drag
754 {
755 public:
757 
758  void motion (GdkEvent *, bool);
759  void finished (GdkEvent *, bool);
760  void aborted (bool);
761 
762  bool y_movement_matters () const {
763  return false;
764  }
765 
767  return false;
768  }
769 
771 
772 private:
776 };
777 
780 {
781 public:
783 
786 };
787 
790 {
791 public:
793 
794  void motion (GdkEvent *, bool);
795  void finished (GdkEvent *, bool);
796  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
797 
798  bool y_movement_matters () const {
799  return false;
800  }
801 
803  return false;
804  }
805 
806  void aborted (bool);
807 
808 protected:
809  std::list<AVDraggingView> _views;
810 
811 private:
814  bool _stuck;
815 };
816 
818 class TrimDrag : public RegionDrag
819 {
820 public:
821  enum Operation {
823  EndTrim
824  };
825 
826  TrimDrag (Editor&, ArdourCanvas::Item *, RegionView*, std::list<RegionView*> const &, Temporal::TimeDomain td, bool preserve_fade_anchor = false);
827 
828  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
829  void motion (GdkEvent *, bool);
830  void finished (GdkEvent *, bool);
831  void aborted (bool);
832 
833  bool y_movement_matters () const {
834  return false;
835  }
836 
838  return false;
839  }
840 
842 
843 private:
844 
846 
849 
850  std::vector<RegionView::DisplaySuspender> suspenders;
851 };
852 
855 {
856 public:
858 
859  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
860  void motion (GdkEvent *, bool);
861  void finished (GdkEvent *, bool);
862  void aborted (bool);
863 
865  return false;
866  }
867 
868  bool y_movement_matters () const {
869  return false;
870  }
871 
873 
874 private:
878 
879  bool _movable;
883 };
884 
887 {
888 public:
890 
891  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
892  void motion (GdkEvent *, bool);
893  void finished (GdkEvent *, bool);
894  void aborted (bool);
895 
896 private:
898  double initial_bpm;
901 };
902 
905 {
906 public:
908 
909  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
910  void motion (GdkEvent *, bool);
911  void finished (GdkEvent *, bool);
912  void aborted (bool);
913 
915  return false;
916  }
917 
918  bool y_movement_matters () const {
919  return true;
920  }
921 
923 
924 private:
928 
929  bool _movable;
930  double _grab_bpm;
933 };
934 
936 class BBTMarkerDrag : public EditorDrag
937 {
938 public:
940 
941  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
942  void motion (GdkEvent *, bool);
943  void finished (GdkEvent *, bool);
944  void aborted (bool);
945 
947  return false;
948  }
949 
950  bool y_movement_matters () const {
951  return false;
952  }
953 
955 
956 private:
960 
962 };
963 
965 {
966 public:
968 
969  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
970  void motion (GdkEvent *, bool);
971  void finished (GdkEvent *, bool);
972  void aborted (bool);
973 
975  return false;
976  }
977 
979  return false;
980  }
981 
982  bool y_movement_matters () const {
983  return false;
984  }
985 
987 
988 private:
991  double _grab_bpm;
993 
996 };
997 
999 {
1000 public:
1005  XMLNode&,
1006  bool ramped);
1007 
1008  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1009  void motion (GdkEvent *, bool);
1010  void finished (GdkEvent *, bool);
1011  void aborted (bool);
1012 
1014  return false;
1015  }
1016 
1018  return false;
1019  }
1020 
1021  bool y_movement_matters () const {
1022  return false;
1023  }
1024 
1026 
1027 private:
1032 
1033  double direction;
1034  double delta;
1037 
1040  bool _do_ramp;
1041 };
1042 
1043 
1046 {
1047 public:
1049 
1050  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1051  void motion (GdkEvent *, bool);
1052  void finished (GdkEvent *, bool);
1053  void aborted (bool);
1054 
1056  return false;
1057  }
1058 
1059  bool y_movement_matters () const {
1060  return true;
1061  }
1062 
1064 
1065 private:
1072 };
1073 
1075 class TempoEndDrag : public EditorDrag
1076 {
1077 public:
1079 
1080  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1081  void motion (GdkEvent *, bool);
1082  void finished (GdkEvent *, bool);
1083  void aborted (bool);
1084 
1086  return false;
1087  }
1088 
1089  bool y_movement_matters () const {
1090  return true;
1091  }
1092 
1094 
1095 private:
1100 
1103 };
1104 
1106 class CursorDrag : public EditorDrag
1107 {
1108 public:
1110 
1111  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1112  void motion (GdkEvent *, bool);
1113  void finished (GdkEvent *, bool);
1114  void aborted (bool);
1115 
1117  return false;
1118  }
1119 
1120  bool y_movement_matters () const {
1121  return true;
1122  }
1123 
1124 private:
1126 
1128  bool _stop;
1129  double _grab_zoom;
1130 
1131  //used for zooming
1136 };
1137 
1139 class FadeInDrag : public RegionDrag
1140 {
1141 public:
1142  FadeInDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain);
1143 
1144  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1145  void motion (GdkEvent *, bool);
1146  void finished (GdkEvent *, bool);
1147  void aborted (bool);
1148 
1149  bool y_movement_matters () const {
1150  return false;
1151  }
1152 
1154  return false;
1155  }
1156 
1158 };
1159 
1161 class FadeOutDrag : public RegionDrag
1162 {
1163 public:
1164  FadeOutDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain td);
1165 
1166  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1167  void motion (GdkEvent *, bool);
1168  void finished (GdkEvent *, bool);
1169  void aborted (bool);
1170 
1171  bool y_movement_matters () const {
1172  return false;
1173  }
1174 
1176  return false;
1177  }
1178 
1180 };
1181 
1183 class MarkerDrag : public EditorDrag
1184 {
1185 public:
1188 
1189  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1190  void motion (GdkEvent *, bool);
1191  void finished (GdkEvent *, bool);
1192  void aborted (bool);
1193 
1195  return false;
1196  }
1197 
1198  bool y_movement_matters () const {
1199  return false;
1200  }
1201 
1204 
1205 private:
1207 
1212  std::vector<ArdourMarker*> markers;
1215  };
1216 
1217  std::vector<ARDOUR::Location::ChangeSuspender> lcs;
1218 
1219  typedef std::list<CopiedLocationMarkerInfo> CopiedLocationInfo;
1222 };
1223 
1225 class ControlPointDrag : public Drag
1226 {
1227 public:
1229 
1230  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1231  void motion (GdkEvent *, bool);
1232  void finished (GdkEvent *, bool);
1233  void aborted (bool);
1234 
1236 
1238  return false;
1239  }
1240 
1241 
1242 private:
1243 
1248  bool _pushing;
1249  uint32_t _final_index;
1250  static double _zero_gain_fraction;
1251 
1253 };
1254 
1256 class LineDrag : public Drag
1257 {
1258 public:
1259  LineDrag (EditingContext &e, ArdourCanvas::Item *i, std::function<void(GdkEvent*,Temporal::timepos_t const &,double)>);
1261 
1262  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1263  void motion (GdkEvent *, bool);
1264  void finished (GdkEvent *, bool);
1265  void aborted (bool);
1266 
1268  return false;
1269  }
1270 
1271 private:
1272 
1277  uint32_t _before;
1278  uint32_t _after;
1280  std::function<void(GdkEvent*,Temporal::timepos_t const &,double)> click_functor;
1281 };
1282 
1284 class FeatureLineDrag : public Drag
1285 {
1286 public:
1288 
1289  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1290  void motion (GdkEvent *, bool);
1291  void finished (GdkEvent *, bool);
1292  void aborted (bool);
1293 
1294 private:
1295 
1298 
1301 
1302  float _before;
1303  uint32_t _max_x;
1304 };
1305 
1308 {
1309 public:
1311 
1312  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1313  void motion (GdkEvent *, bool);
1314  void finished (GdkEvent *, bool);
1315  void aborted (bool);
1316 
1317  void do_select_things (GdkEvent *, bool);
1318 
1327  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);
1328  virtual void deselect_things ();
1329 
1330  protected:
1332  std::function<bool(GdkEvent*,Temporal::timepos_t const &)> click_functor;
1333 };
1334 
1337 {
1338  public:
1340 
1341  void select_things (int, Temporal::timepos_t const &, Temporal::timepos_t const &, double, double, bool);
1343  void finished (GdkEvent *, bool);
1344 
1345  private:
1347 };
1348 
1351 {
1352 public:
1354 
1355  void select_things (int, Temporal::timepos_t const &, Temporal::timepos_t const &, double, double, bool);
1357 
1358 private:
1360 };
1361 
1363 class TimeFXDrag : public RegionDrag
1364 {
1365 public:
1366  TimeFXDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain td);
1367 
1368  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1369  void motion (GdkEvent *, bool);
1370  void finished (GdkEvent *, bool);
1371  void aborted (bool);
1372 private:
1374 };
1375 
1378 {
1379 public:
1380  enum Operation {
1386  };
1387 
1389 
1390  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1391  void motion (GdkEvent *, bool);
1392  void finished (GdkEvent *, bool);
1393  void aborted (bool);
1394 
1396 
1397 private:
1399  bool _add;
1404 };
1405 
1408 {
1409 public:
1411 
1413  void motion (GdkEvent*, bool);
1414  void finished (GdkEvent *, bool);
1415  void aborted (bool);
1416 
1417 private:
1421 };
1422 
1425 {
1426 public:
1427  enum Operation {
1432  };
1433 
1436 
1437  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1438  void motion (GdkEvent *, bool);
1439  void finished (GdkEvent *, bool);
1440  void aborted (bool);
1441 
1443  return false;
1444  }
1445 
1446  bool y_movement_matters () const {
1447  return false;
1448  }
1449 
1450 private:
1452 
1455 };
1456 
1459 {
1460 public:
1462 
1463  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1464  void motion (GdkEvent *, bool);
1465  void finished (GdkEvent *, bool);
1466  void aborted (bool);
1467 
1468 private:
1470 };
1471 
1476 {
1477 public:
1478  AutomationRangeDrag (EditingContext&, AutomationTimeAxisView *, float initial_value, std::list<ARDOUR::TimelineRange> const &);
1479  AutomationRangeDrag (EditingContext&, std::list<RegionView*> const &, std::list<ARDOUR::TimelineRange> const &, double y_origin, double y_height);
1480 
1481  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1482  void motion (GdkEvent *, bool);
1483  void finished (GdkEvent *, bool);
1484  void aborted (bool);
1485 
1486  bool x_movement_matters () const {
1487  return false;
1488  }
1489 
1490 private:
1491  void setup (std::list<std::shared_ptr<AutomationLine> > const &);
1492  double y_fraction (double global_y_position) const;
1493  double value (std::shared_ptr<ARDOUR::AutomationList> list, Temporal::timepos_t const & x) const;
1494 
1495  std::list<ARDOUR::TimelineRange> _ranges;
1496 
1498  struct Line {
1499  std::shared_ptr<AutomationLine> line;
1500  std::list<ControlPoint*> points;
1501  std::pair<Temporal::timepos_t, Temporal::timepos_t> range;
1503  };
1504 
1505  std::list<Line> _lines;
1506  double _y_origin;
1507  double _y_height;
1511 };
1512 
1515 class CrossfadeEdgeDrag : public Drag
1516 {
1517 public:
1519 
1521  void motion (GdkEvent*, bool);
1522  void finished (GdkEvent*, bool);
1523  void aborted (bool);
1524 
1525  bool y_movement_matters () const {
1526  return false;
1527  }
1528 
1529 private:
1531  bool start;
1532 };
1533 
1534 class RegionMarkerDrag : public Drag
1535 {
1536  public:
1539 
1540  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1541  void motion (GdkEvent *, bool);
1542  void finished (GdkEvent *, bool);
1543  void aborted (bool);
1544 
1546  return false;
1547  }
1548 
1549  bool y_movement_matters () const {
1550  return false;
1551  }
1552 
1554 
1555  private:
1560 };
1561 
1562 
1563 class LollipopDrag : public Drag
1564 {
1565  public:
1568 
1569  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1570  void motion (GdkEvent *, bool);
1571  void finished (GdkEvent *, bool);
1572  void aborted (bool);
1573 
1575  return false;
1576  }
1577 
1579  return false;
1580  }
1581 
1582  bool x_movement_matters () const {
1583  return false;
1584  }
1585 
1587 
1588  private:
1591 };
1592 
1593 template<typename OrderedPointList, typename OrderedPoint>
1594 class FreehandLineDrag : public Drag
1595 {
1596  public:
1599 
1600  void motion (GdkEvent*, bool);
1601  void finished (GdkEvent*, bool);
1603  virtual void point_added (ArdourCanvas::Duple const & d, ArdourCanvas::Rectangle const & r, double last_x) {}
1604  virtual void line_extended (ArdourCanvas::Duple const & from, ArdourCanvas::Duple const & to, ArdourCanvas::Rectangle const & r, double last_x) {
1605  point_added (to, r, last_x);
1606  }
1607 
1608  protected:
1609  ArdourCanvas::Item* parent; /* we do not own this. If null, use base_rect as the parent */
1610  ArdourCanvas::Rectangle& base_rect; /* we do not own this */
1614  int edge_x;
1615  bool did_snap;
1617  OrderedPointList drawn_points;
1620 
1621  void maybe_add_point (GdkEvent*, Temporal::timepos_t const &, bool first_move);
1622 };
1623 
1624 class AutomationDrawDrag : public FreehandLineDrag<Evoral::ControlList::OrderedPoints, Evoral::ControlList::OrderedPoint>
1625 {
1626  public:
1629 
1630  void finished (GdkEvent*, bool);
1631  void aborted (bool) {}
1632 
1633 private:
1634  std::function<bool(GdkEvent*,Temporal::timepos_t const &)> click_functor;
1635 };
1636 
1637 class VelocityLineDrag : public FreehandLineDrag<Evoral::ControlList::OrderedPoints, Evoral::ControlList::OrderedPoint>
1638 {
1639  public:
1642 
1643  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1644  void finished (GdkEvent*, bool);
1645  void aborted (bool);
1646  void point_added (ArdourCanvas::Duple const & d, ArdourCanvas::Rectangle const & r, double last_x);
1647  void line_extended (ArdourCanvas::Duple const & from, ArdourCanvas::Duple const & to, ArdourCanvas::Rectangle const & r, double last_x);
1648 
1649  private:
1652 };
1653 
1654 class ClipStartDrag : public Drag
1655 {
1656  public:
1659 
1662  void motion (GdkEvent*, bool);
1663  void finished (GdkEvent*, bool);
1664  void aborted (bool);
1665 
1666  private:
1670 };
1671 
1672 class ClipEndDrag : public Drag
1673 {
1674  public:
1677 
1680  void motion (GdkEvent*, bool);
1681  void finished (GdkEvent*, bool);
1682  void aborted (bool);
1683 
1684  private:
1688 };
1689 
1690 #endif /* __gtk2_ardour_editor_drag_h_ */
AVDraggingView(RegionView *)
samplepos_t initial_position
initial position of the region
Definition: editor_drag.h:785
RegionView * view
the view
Definition: editor_drag.h:784
void aborted(bool)
Definition: editor_drag.h:1631
AutomationDrawDrag(EditingContext &, ArdourCanvas::Item *, ArdourCanvas::Rectangle &, bool, Temporal::TimeDomain, std::function< bool(GdkEvent *, Temporal::timepos_t const &)>)
std::function< bool(GdkEvent *, Temporal::timepos_t const &)> click_functor
Definition: editor_drag.h:1634
void finished(GdkEvent *, bool)
std::list< ARDOUR::TimelineRange > _ranges
Definition: editor_drag.h:1495
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:1505
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:1486
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:961
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:959
bool y_movement_matters() const
Definition: editor_drag.h:950
BBTMarkerDrag(Editor &, ArdourCanvas::Item *)
void aborted(bool)
BBTMarker * _marker
Definition: editor_drag.h:957
void finished(GdkEvent *, bool)
void motion(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:946
Temporal::MusicTimePoint const * _point
Definition: editor_drag.h:958
void start_grab(GdkEvent *, Gdk::Cursor *)
void aborted(bool)
ClipEndDrag(CueEditor &, ArdourCanvas::Rectangle &)
void finished(GdkEvent *, bool)
CueEditor & ce
Definition: editor_drag.h:1685
ArdourCanvas::Rectangle * dragging_rect
Definition: editor_drag.h:1686
void motion(GdkEvent *, bool)
bool end_grab(GdkEvent *)
ArdourCanvas::Rect original_rect
Definition: editor_drag.h:1687
void aborted(bool)
bool end_grab(GdkEvent *)
ArdourCanvas::Rect original_rect
Definition: editor_drag.h:1669
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:1668
CueEditor & ce
Definition: editor_drag.h:1667
uint32_t _final_index
Definition: editor_drag.h:1249
void motion(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1237
Temporal::timecnt_t total_dt(GdkEvent *) const
bool active(Editing::MouseMode m)
ControlPoint * _point
Definition: editor_drag.h:1244
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:1250
double _cumulative_y_drag
Definition: editor_drag.h:1247
AudioRegionView * arv
Definition: editor_drag.h:1530
bool y_movement_matters() const
Definition: editor_drag.h:1525
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:1129
int _last_y_delta
Definition: editor_drag.h:1135
CursorDrag(Editor &, EditorCursor &, bool)
bool _stop
true to stop the transport on starting the drag, otherwise false
Definition: editor_drag.h:1128
EditorCursor & _cursor
Definition: editor_drag.h:1127
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1116
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:1120
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:152
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:153
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:147
std::list< Drag * > _drags
Definition: editor_drag.h:148
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:151
bool dragging_lollipop() const
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:150
bool _ending
true if end_grab or abort is in progress, otherwise false
Definition: editor_drag.h:149
std::list< Drag * > const & drags() const
Definition: editor_drag.h:144
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:306
double last_pointer_y() const
Definition: editor_drag.h:298
virtual bool active(Editing::MouseMode m)
Definition: editor_drag.h:219
Temporal::timepos_t pixel_duration_to_time(double x) const
void set_double_click(bool yn)
Definition: editor_drag.h:186
virtual bool y_movement_matters() const
Definition: editor_drag.h:246
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:171
virtual void setup_pointer_offset()
Definition: editor_drag.h:257
double _last_pointer_x
trackview x of the pointer last time a motion occurred
Definition: editor_drag.h:348
virtual void start_grab(GdkEvent *e, Gdk::Cursor *c=0)
ArdourCanvas::Item * _item
our item
Definition: editor_drag.h:327
Temporal::timecnt_t _video_offset
Definition: editor_drag.h:331
bool _y_constrained
true if y motion is constrained, otherwise false
Definition: editor_drag.h:334
void abort()
Gtkmm2ext::Bindings::DragsBlockBindings binding_blocker
Definition: editor_drag.h:362
Temporal::TimeDomain time_domain() const
Definition: editor_drag.h:175
virtual ~Drag()
Temporal::timepos_t _last_pointer_time
adjusted_time the last time a motion occurred
Definition: editor_drag.h:352
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:236
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:347
void set_manager(DragManager *m)
Definition: editor_drag.h:163
std::pair< int, int > MoveThreshold
Definition: editor_drag.h:228
bool _move_threshold_passed
true if the move threshold has been passed, otherwise false
Definition: editor_drag.h:342
void set_grab_button_anyway(GdkEvent *)
DragManager * _drags
Definition: editor_drag.h:326
bool _was_double_click
true if drag initiated by a double click event
Definition: editor_drag.h:345
void show_view_preview(Temporal::timepos_t const &)
Temporal::timecnt_t _pointer_offset
Definition: editor_drag.h:330
ArdourCanvas::Item const * _bounding_item
our coordinate reference (normally null)
Definition: editor_drag.h:328
bool _initially_vertical
true if after move threshold is passed we appear to be moving vertically; undefined before that
Definition: editor_drag.h:344
ARDOUR::timepos_t _earliest_time_limit
time we cannot drag before (defaults to 0, indicating no such limit)
Definition: editor_drag.h:336
double current_pointer_y() const
virtual bool mid_drag_key_event(GdkEventKey *)
Definition: editor_drag.h:250
std::shared_ptr< ARDOUR::Region > add_midi_region(MidiTimeAxisView *, bool commit)
int grab_button() const
Definition: editor_drag.h:268
bool _preview_video
Definition: editor_drag.h:332
virtual void motion(GdkEvent *e, bool f)=0
virtual bool allow_vertical_autoscroll() const
Definition: editor_drag.h:232
ArdourCanvas::Item const * bounding_item() const
Definition: editor_drag.h:167
bool _copy
Definition: editor_drag.h:337
virtual bool end_grab(GdkEvent *)
double last_pointer_x() const
Definition: editor_drag.h:294
ARDOUR::samplepos_t last_pointer_sample() const
Definition: editor_drag.h:302
virtual MoveThreshold move_threshold() const
Temporal::timecnt_t _snap_delta
Definition: editor_drag.h:358
bool motion_handler(GdkEvent *, bool)
double _last_pointer_y
trackview y of the pointer last time a motion occurred
Definition: editor_drag.h:349
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:286
int _grab_button
Definition: editor_drag.h:360
bool _hide_snapped_cursor
set true of Drag::motion does not call set_snapped_cursor_position
Definition: editor_drag.h:341
double current_pointer_x() const
bool _x_constrained
true if x motion is constrained, otherwise false
Definition: editor_drag.h:333
double grab_y() const
Definition: editor_drag.h:276
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:350
bool initially_vertical() const
Definition: editor_drag.h:252
bool _trackview_only
true if pointer y value should always be relative to the top of the trackview group
Definition: editor_drag.h:340
void set_bounding_item(ArdourCanvas::Item const *i)
Temporal::timepos_t raw_grab_time() const
Definition: editor_drag.h:282
bool was_double_click() const
Definition: editor_drag.h:185
virtual bool x_movement_matters() const
Definition: editor_drag.h:241
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:343
virtual void aborted(bool m)=0
EditingContext & editing_context
Definition: editor_drag.h:325
virtual void setup_video_offset()
Definition: editor_drag.h:262
bool _was_rolling
true if the session was rolling before the drag started, otherwise false
Definition: editor_drag.h:335
double _grab_x
trackview x of the grab start position
Definition: editor_drag.h:346
bool preview_video() const
Definition: editor_drag.h:223
Temporal::timepos_t grab_time() const
Definition: editor_drag.h:290
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:359
Temporal::TimeDomain _time_domain
Definition: editor_drag.h:353
double grab_x() const
Definition: editor_drag.h:272
Temporal::timepos_t _grab_time
adjusted_time that the mouse was at when start_grab was called, or 0
Definition: editor_drag.h:351
samplepos_t anchored_fade_length
fade_length when anchored during drag
Definition: editor_drag.h:399
RegionView * view
the view
Definition: editor_drag.h:386
double layer
Definition: editor_drag.h:395
std::shared_ptr< ARDOUR::Playlist > initial_playlist
Definition: editor_drag.h:400
DraggingView(RegionView *, RegionDrag *, TimeAxisView *original_tav)
Temporal::timepos_t initial_position
initial position of the region
Definition: editor_drag.h:397
TimeAxisView * initial_time_axis_view
Definition: editor_drag.h:401
double initial_y
the initial y position of the view before any reparenting
Definition: editor_drag.h:396
int time_axis_view
Definition: editor_drag.h:390
Temporal::timepos_t initial_end
initial end position of the region
Definition: editor_drag.h:398
EditorDrag(Editor &, ArdourCanvas::Item *, Temporal::TimeDomain td, ArdourCanvas::Item const *bounding_item, bool hide_snapped_cursor=true)
Editor & _editor
Definition: editor_drag.h:375
Definition: editor.h:157
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1153
void setup_pointer_offset()
void aborted(bool)
void motion(GdkEvent *, bool)
bool y_movement_matters() const
Definition: editor_drag.h:1149
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:1171
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1175
void setup_pointer_offset()
void motion(GdkEvent *, bool)
void finished(GdkEvent *, bool)
ArdourCanvas::Line * _line
Definition: editor_drag.h:1296
double _cumulative_x_drag
Definition: editor_drag.h:1300
double _region_view_grab_x
Definition: editor_drag.h:1299
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:1297
FeatureLineDrag(Editor &e, ArdourCanvas::Item *i)
ArdourCanvas::Coord line_start_y
Definition: editor_drag.h:1619
virtual void point_added(ArdourCanvas::Duple const &d, ArdourCanvas::Rectangle const &r, double last_x)
Definition: editor_drag.h:1603
void maybe_add_point(GdkEvent *, Temporal::timepos_t const &, bool first_move)
ArdourCanvas::Item * parent
Definition: editor_drag.h:1609
ArdourCanvas::Rectangle & base_rect
Definition: editor_drag.h:1610
ArdourCanvas::Coord line_start_x
Definition: editor_drag.h:1618
ArdourCanvas::PolyLine * dragging_line
Definition: editor_drag.h:1611
virtual void line_extended(ArdourCanvas::Duple const &from, ArdourCanvas::Duple const &to, ArdourCanvas::Rectangle const &r, double last_x)
Definition: editor_drag.h:1604
void finished(GdkEvent *, bool)
OrderedPointList drawn_points
Definition: editor_drag.h:1617
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:698
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void finished(GdkEvent *, bool)
MidiView * _midi_view
Definition: editor_drag.h:713
double y_to_region(double) const
bool y_movement_matters() const
Definition: editor_drag.h:706
void aborted(bool)
Definition: editor_drag.h:700
bool active(Editing::MouseMode mode)
Definition: editor_drag.h:702
void aborted(bool)
bool have_command
Definition: editor_drag.h:1279
std::function< void(GdkEvent *, Temporal::timepos_t const &, double)> click_functor
Definition: editor_drag.h:1280
uint32_t _before
Definition: editor_drag.h:1277
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
double _fixed_grab_x
Definition: editor_drag.h:1274
double _cumulative_y_drag
Definition: editor_drag.h:1276
AutomationLine * _line
Definition: editor_drag.h:1273
uint32_t _after
Definition: editor_drag.h:1278
void finished(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1267
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:1275
ArdourCanvas::Lollipop * _primary
Definition: editor_drag.h:1590
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:1589
bool allow_horizontal_autoscroll() const
Definition: editor_drag.h:1578
bool x_movement_matters() const
Definition: editor_drag.h:1582
void motion(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1574
void finished(GdkEvent *, bool)
double _grab_bpm
Definition: editor_drag.h:991
bool y_movement_matters() const
Definition: editor_drag.h:982
void setup_pointer_offset()
void finished(GdkEvent *, bool)
void motion(GdkEvent *, bool)
XMLNode * _before_state
Definition: editor_drag.h:994
MappingEndDrag(Editor &, ArdourCanvas::Item *, Temporal::TempoMap::WritableSharedPtr &, Temporal::TempoPoint &, Temporal::TempoPoint &after, XMLNode &before_state)
Temporal::TempoPoint & _tempo
Definition: editor_drag.h:989
bool allow_horizontal_autoscroll() const
Definition: editor_drag.h:978
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:974
void aborted(bool)
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:992
Temporal::TempoPoint & _after
Definition: editor_drag.h:990
void motion(GdkEvent *, bool)
bool y_movement_matters() const
Definition: editor_drag.h:1021
bool allow_horizontal_autoscroll() const
Definition: editor_drag.h:1017
double initial_focus_npm
Definition: editor_drag.h:1035
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:1029
Temporal::TempoPoint & prev
Definition: editor_drag.h:1028
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1013
Temporal::TempoPoint & next
Definition: editor_drag.h:1030
void setup_pointer_offset()
XMLNode * _before_state
Definition: editor_drag.h:1038
double initial_pre_npm
Definition: editor_drag.h:1036
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:1031
void aborted(bool)
void finished(GdkEvent *, bool)
void aborted(bool)
bool _selection_changed
Definition: editor_drag.h:1209
std::list< CopiedLocationMarkerInfo > CopiedLocationInfo
Definition: editor_drag.h:1219
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
bool y_movement_matters() const
Definition: editor_drag.h:1198
void finished(GdkEvent *, bool)
MarkerDrag(Editor &, ArdourCanvas::Item *)
ArdourCanvas::Points _points
Definition: editor_drag.h:1221
CopiedLocationInfo _copied_locations
Definition: editor_drag.h:1220
std::vector< ARDOUR::Location::ChangeSuspender > lcs
Definition: editor_drag.h:1217
void setup_pointer_offset()
void update_item(ARDOUR::Location *)
ArdourMarker * _marker
marker being dragged
Definition: editor_drag.h:1208
void motion(GdkEvent *, bool)
void setup_video_offset()
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1194
void finished(GdkEvent *, bool)
Temporal::superclock_t initial_sclock
Definition: editor_drag.h:877
void setup_pointer_offset()
void aborted(bool)
Editing::GridType _old_grid_type
Definition: editor_drag.h:880
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Editing::SnapMode _old_snap_mode
Definition: editor_drag.h:881
MeterMarkerDrag(Editor &, ArdourCanvas::Item *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:864
MeterMarker * _marker
Definition: editor_drag.h:875
void motion(GdkEvent *, bool)
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:876
bool y_movement_matters() const
Definition: editor_drag.h:868
XMLNode * before_state
Definition: editor_drag.h:882
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:741
Temporal::Beats get_stride(Temporal::Beats const &pos, Temporal::BBT_Offset const &quantization)
Temporal::Beats next_grid
Definition: editor_drag.h:745
bool y_movement_matters() const
Definition: editor_drag.h:733
double y_to_region(double) const
void motion(GdkEvent *, bool)
Temporal::timepos_t _last_pos
Definition: editor_drag.h:742
void finished(GdkEvent *, bool)
void aborted(bool)
Definition: editor_drag.h:727
Temporal::Beats specified_length
Definition: editor_drag.h:747
Temporal::Beats stride
Definition: editor_drag.h:744
NoteBrushDrag(EditingContext &, ArdourCanvas::Item *, MidiView *, Temporal::Beats specified_length=Temporal::Beats(), int stride_multiple=1, int held_note=-1)
bool active(Editing::MouseMode mode)
Definition: editor_drag.h:729
NoteCreateDrag(EditingContext &, ArdourCanvas::Item *, MidiView *)
void aborted(bool)
MidiView * _midi_view
Definition: editor_drag.h:686
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:674
Temporal::timepos_t _note[2]
Definition: editor_drag.h:688
bool active(Editing::MouseMode mode)
Definition: editor_drag.h:670
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:678
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:687
double _note_height
Definition: editor_drag.h:656
NoteBase * _primary
Definition: editor_drag.h:651
double _cumulative_dy
Definition: editor_drag.h:653
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:650
Temporal::timecnt_t _cumulative_dx
Definition: editor_drag.h:652
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:641
void finished(GdkEvent *, bool)
Temporal::timepos_t _earliest
Definition: editor_drag.h:654
bool _was_selected
Definition: editor_drag.h:655
void motion(GdkEvent *, bool)
NoteResizeDrag(EditingContext &, ArdourCanvas::Item *)
MidiView * midi_view
Definition: editor_drag.h:621
void finished(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:616
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
double _snap_delta
Definition: editor_drag.h:625
void aborted(bool)
void motion(GdkEvent *, bool)
void finished(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:766
PatchChangeDrag(EditingContext &, PatchChange *, MidiView *)
PatchChange * _patch_change
Definition: editor_drag.h:774
MidiView * _region_view
Definition: editor_drag.h:773
double _cumulative_dx
Definition: editor_drag.h:775
void aborted(bool)
void motion(GdkEvent *, bool)
void setup_pointer_offset()
bool y_movement_matters() const
Definition: editor_drag.h:762
ArdourCanvas::Rectangle * _drag_rect
Definition: editor_drag.h:1454
void motion(GdkEvent *, bool)
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Operation _operation
Definition: editor_drag.h:1453
void aborted(bool)
RangeMarkerBarDrag(Editor &, ArdourCanvas::Item *, Operation)
void update_item(ARDOUR::Location *)
bool y_movement_matters() const
Definition: editor_drag.h:1446
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1442
void finished(GdkEvent *, bool)
std::set< Temporal::timepos_t > TimePositionSet
Definition: editor_drag.h:464
virtual void finished(GdkEvent *, bool)
virtual void aborted(bool)
TimePositionSet _already_pasted
Definition: editor_drag.h:465
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:457
MidiTimeAxisView * _view
Definition: editor_drag.h:601
void finished(GdkEvent *, bool)
RegionCreateDrag(Editor &, ArdourCanvas::Item *, TimeAxisView *)
void aborted(bool)
std::shared_ptr< ARDOUR::Region > _region
Definition: editor_drag.h:602
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:409
uint32_t _ntracks
Definition: editor_drag.h:423
RegionView * _primary
the view that was clicked on (or whatever) to start the drag
Definition: editor_drag.h:413
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:422
std::list< DraggingView > _views
information about all views that are being dragged
Definition: editor_drag.h:414
PBD::ScopedConnection death_connection
Definition: editor_drag.h:435
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:417
int _visible_y_low
Definition: editor_drag.h:421
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:572
void aborted(bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1545
void aborted(bool)
ARDOUR::CueMarker model
Definition: editor_drag.h:1558
ARDOUR::CueMarker dragging_model
Definition: editor_drag.h:1559
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void finished(GdkEvent *, bool)
void setup_pointer_offset()
ArdourMarker * view
Definition: editor_drag.h:1557
bool y_movement_matters() const
Definition: editor_drag.h:1549
void motion(GdkEvent *, bool)
RegionMarkerDrag(Editor &, RegionView *, ArdourCanvas::Item *)
RegionView * rv
Definition: editor_drag.h:1556
uint32_t _ddropzone
Definition: editor_drag.h:502
virtual bool y_movement_allowed(int, double, int skip_invisible=0) const
uint32_t _ndropzone
Definition: editor_drag.h:500
uint32_t _pdropzone
Definition: editor_drag.h:501
std::vector< ArdourMarker * > ripple_markers
Definition: editor_drag.h:497
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:493
virtual bool regions_came_from_canvas() const =0
virtual ~RegionMotionDrag()
Definition: editor_drag.h:474
double _last_pointer_layer
Definition: editor_drag.h:496
double _total_x_delta
Definition: editor_drag.h:494
virtual void aborted(bool)
int _last_pointer_time_axis_view
Definition: editor_drag.h:495
void aborted(bool)
RegionView * _new_region_view
Definition: editor_drag.h:560
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:521
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:513
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:444
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:1332
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:1400
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void setup_pointer_offset()
bool _time_selection_at_start
Definition: editor_drag.h:1401
void aborted(bool)
Temporal::timepos_t end_at_start
Definition: editor_drag.h:1403
Temporal::timepos_t start_at_start
Definition: editor_drag.h:1402
Operation _operation
Definition: editor_drag.h:1398
void motion(GdkEvent *, bool)
Temporal::timepos_t _end_at_start
Definition: editor_drag.h:1420
void finished(GdkEvent *, bool)
SelectionMarkerDrag(Editor &, ArdourCanvas::Item *)
void motion(GdkEvent *, bool)
Temporal::timepos_t _start_at_start
Definition: editor_drag.h:1419
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:897
XMLNode * _before_state
Definition: editor_drag.h:900
void motion(GdkEvent *, bool)
TempoCurveDrag(Editor &, ArdourCanvas::Item *)
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:899
double initial_bpm
Definition: editor_drag.h:898
bool y_movement_matters() const
Definition: editor_drag.h:1089
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1085
XMLNode * _before_state
Definition: editor_drag.h:1101
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:1099
void aborted(bool)
Temporal::Beats _grab_qn
Definition: editor_drag.h:1096
void motion(GdkEvent *, bool)
Temporal::TempoPoint * previous_tempo
Definition: editor_drag.h:1098
TempoEndDrag(Editor &, ArdourCanvas::Item *)
void setup_pointer_offset()
void finished(GdkEvent *, bool)
Temporal::TempoPoint * _tempo
Definition: editor_drag.h:1097
TempoMarker * _marker
Definition: editor_drag.h:925
XMLNode * _before_state
Definition: editor_drag.h:932
void motion(GdkEvent *, bool)
void setup_pointer_offset()
Temporal::TempoPoint const * _real_section
Definition: editor_drag.h:926
void aborted(bool)
TempoMarkerDrag(Editor &, ArdourCanvas::Item *)
void finished(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:914
bool y_movement_matters() const
Definition: editor_drag.h:918
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Temporal::Beats _grab_qn
Definition: editor_drag.h:931
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:927
Temporal::Beats _grab_qn
Definition: editor_drag.h:1066
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void setup_pointer_offset()
void finished(GdkEvent *, bool)
XMLNode * _before_state
Definition: editor_drag.h:1071
void motion(GdkEvent *, bool)
void aborted(bool)
bool y_movement_matters() const
Definition: editor_drag.h:1059
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1055
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:1069
TempoTwistDrag(Editor &, ArdourCanvas::Item *)
Temporal::TempoPoint const * _next_tempo
Definition: editor_drag.h:1068
Temporal::TempoPoint * _tempo
Definition: editor_drag.h:1067
std::shared_ptr< TempoMap > WritableSharedPtr
int64_t samples() const
Definition: timeline.h:90
void finished(GdkEvent *, bool)
bool _dragging_start
Definition: editor_drag.h:1373
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:837
bool _preserve_fade_anchor
Definition: editor_drag.h:847
bool _jump_position_when_done
Definition: editor_drag.h:848
Operation _operation
Definition: editor_drag.h:845
bool y_movement_matters() const
Definition: editor_drag.h:833
std::vector< RegionView::DisplaySuspender > suspenders
Definition: editor_drag.h:850
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:1650
void aborted(bool)
void finished(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:802
bool y_movement_matters() const
Definition: editor_drag.h:798
std::list< AVDraggingView > _views
information about all audio that are being dragged along
Definition: editor_drag.h:809
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
ARDOUR::sampleoffset_t _startdrag_video_offset
Definition: editor_drag.h:812
VideoTimeLineDrag(Editor &e, ArdourCanvas::Item *i)
ARDOUR::sampleoffset_t _max_backwards_drag
Definition: editor_drag.h:813
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:1500
std::pair< Temporal::timepos_t, Temporal::timepos_t > range
the range of all points on the line, in session time
Definition: editor_drag.h:1501
std::shared_ptr< AutomationLine > line
the line
Definition: editor_drag.h:1499
XMLNode * state
the XML state node before the drag
Definition: editor_drag.h:1502
std::vector< ArdourMarker * > markers
Definition: editor_drag.h:1212
CopiedLocationMarkerInfo(ARDOUR::Location *l, ArdourMarker *m)