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