Ardour  9.0-pre0-1699-gfaebc7ab35
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 PatchChange;
68 class EditingContext;
69 class Editor;
70 class EditorCursor;
71 class TimeAxisView;
72 class Pianoroll;
73 class MidiTimeAxisView;
74 class Drag;
75 class NoteBase;
76 class TimeAxisView;
77 class RouteTimeAxisView;
78 class RegionSelection;
79 class MidiRegionView;
80 class MidiView;
81 class MeterMarker;
82 class ArdourMarker;
83 class TempoMarker;
84 class TempoCurve;
85 class ControlPoint;
86 class AudioRegionView;
87 class AutomationLine;
89 class VelocityDisplay;
90 
93 {
94 public:
95 
98 
99  bool motion_handler (GdkEvent *, bool);
101  void abort ();
102  void add (Drag *);
105  bool end_grab (GdkEvent *);
107 
109 
111  bool ending () const {
112  return _ending;
113  }
114 
115  bool active () const {
116  return !_drags.empty ();
117  }
118 
120  double current_pointer_x () const {
121  return _current_pointer_x;
122  }
123 
125  double current_pointer_y () const {
126  return _current_pointer_y;
127  }
128 
132  }
133 
136  return _current_pointer_time;
137  }
138 
140  bool preview_video () const;
141 
142 private:
144  std::list<Drag*> _drags;
145  bool _ending;
150 };
151 
153 class Drag
154 {
155 public:
156  Drag (EditingContext&, ArdourCanvas::Item *, Temporal::TimeDomain td, ArdourCanvas::Item const * bounding_item, bool hide_snapped_cursor = true);
157  virtual ~Drag ();
158 
160  _drags = m;
161  }
162 
164  _bounding_item = i;
165  }
166 
169  return _item;
170  }
171 
174 
175  void swap_grab (ArdourCanvas::Item *, Gdk::Cursor *, uint32_t);
176  bool motion_handler (GdkEvent*, bool);
177  void abort ();
178 
179  Temporal::timepos_t adjusted_time (Temporal::timepos_t const &, GdkEvent const *, bool snap = true) const;
180  Temporal::timepos_t adjusted_current_time (GdkEvent const *, bool snap = true) const;
181 
182  bool was_double_click() const { return _was_double_click; }
183  void set_double_click (bool yn) { _was_double_click = yn; }
184 
186 
191  virtual void start_grab (GdkEvent* e, Gdk::Cursor* c = 0);
192 
193  virtual bool end_grab (GdkEvent *);
194 
199  virtual void motion (GdkEvent* e, bool f) = 0;
200 
205  virtual void finished (GdkEvent* e, bool m) = 0;
206 
211  virtual void aborted (bool m) = 0;
212 
216  virtual bool active (Editing::MouseMode m) {
217  return true;
218  }
219 
220  bool preview_video () const {
221  return _preview_video;
222  }
223 
225  typedef std::pair<int,int> MoveThreshold;
226 
227  virtual MoveThreshold move_threshold () const;
228 
229  virtual bool allow_vertical_autoscroll () const {
230  return true;
231  }
232 
233  virtual bool allow_horizontal_autoscroll () const {
234  return true;
235  }
236 
238  virtual bool x_movement_matters () const {
239  return true;
240  }
241 
243  virtual bool y_movement_matters () const {
244  return true;
245  }
246 
247  virtual bool mid_drag_key_event (GdkEventKey*) { return false; }
248 
249  bool initially_vertical() const {
250  return _initially_vertical;
251  }
252 
254  virtual void setup_pointer_offset () {
256  }
257 
259  virtual void setup_video_offset () {
260  /* video offset is always in audio time */
262  _preview_video = false;
263  }
264 
265  int grab_button() const { return _grab_button; }
266 
267 protected:
268 
269  double grab_x () const {
270  return _grab_x;
271  }
272 
273  double grab_y () const {
274  return _grab_y;
275  }
276 
278 
280  return _raw_grab_time;
281  }
282 
284  return _grab_time.samples();
285  }
286 
288  return _grab_time;
289  }
290 
291  double last_pointer_x () const {
292  return _last_pointer_x;
293  }
294 
295  double last_pointer_y () const {
296  return _last_pointer_y;
297  }
298 
300  return _last_pointer_time.samples();
301  }
302 
304  return _last_pointer_time;
305  }
306 
307  Temporal::timecnt_t snap_delta (guint const) const;
308 
309  double current_pointer_x () const;
310  double current_pointer_y () const;
311 
312  /* sets snap delta from unsnapped pos */
314 
315  std::shared_ptr<ARDOUR::Region> add_midi_region (MidiTimeAxisView*, bool commit);
316 
318  void show_verbose_cursor_duration (Temporal::timepos_t const & , Temporal::timepos_t const & , double xoffset = 0);
319  void show_verbose_cursor_text (std::string const &);
321 
334  bool _copy;
335 
336 private:
343  double _grab_x;
344  double _grab_y;
351 
352  /* difference between some key position's snapped and unsnapped
353  * samplepos. used for relative snap.
354  */
358 
360 };
361 
367 class EditorDrag : public Drag
368 {
369  public:
370  EditorDrag (Editor&, ArdourCanvas::Item *, Temporal::TimeDomain td, ArdourCanvas::Item const * bounding_item, bool hide_snapped_cursor = true);
371  protected:
373 };
374 
375 class RegionDrag;
376 
379 {
380 public:
382 
392  double layer;
393  double initial_y;
397  std::shared_ptr<ARDOUR::Playlist> initial_playlist;
399 };
400 
402 class RegionDrag : public EditorDrag, public sigc::trackable
403 {
404 public:
405  RegionDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain, bool hide_snapped_cursor = true);
406  virtual ~RegionDrag () {}
407 
408 protected:
409 
411  std::list<DraggingView> _views;
412 
414  std::vector<TimeAxisView*> _time_axis_views;
416  int apply_track_delta (const int start, const int delta, const int skip, const bool distance_only = false) const;
417 
420  uint32_t _ntracks;
421 
423 
424  friend class DraggingView;
425 
426 protected:
428 
429 private:
430 
433 };
434 
437 {
438 public:
439 
442 
443  virtual void start_grab (GdkEvent *, Gdk::Cursor *);
444  virtual void motion (GdkEvent *, bool);
445  virtual void finished (GdkEvent *, bool);
446  virtual void aborted (bool);
447 };
448 
451 {
452 public:
453  RegionBrushDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain td);
454  virtual ~RegionBrushDrag () {}
455 
456  virtual void start_grab (GdkEvent *, Gdk::Cursor *);
457  virtual void motion (GdkEvent *, bool);
458  virtual void finished (GdkEvent *, bool);
459  virtual void aborted (bool);
460 private:
461  typedef std::set<Temporal::timepos_t> TimePositionSet;
463 };
464 
467 {
468 public:
469 
470  RegionMotionDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain td);
471  virtual ~RegionMotionDrag () {}
472 
473  virtual void start_grab (GdkEvent *, Gdk::Cursor *);
474  virtual void motion (GdkEvent *, bool);
475  virtual void finished (GdkEvent *, bool);
476  virtual void aborted (bool);
477 
481  virtual bool regions_came_from_canvas () const = 0;
482 
483 protected:
484 
486  virtual bool y_movement_allowed (int, double, int skip_invisible = 0) const;
488 
494  std::vector<ArdourMarker*> ripple_markers;
495 
496 private:
497  uint32_t _ndropzone;
498  uint32_t _pdropzone;
499  uint32_t _ddropzone;
500 };
501 
502 
507 {
508 public:
509  RegionMoveDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, bool, Temporal::TimeDomain);
510  virtual ~RegionMoveDrag () {}
511 
512  void motion (GdkEvent *, bool);
513  void finished (GdkEvent *, bool);
514  void aborted (bool);
515 
517 
518  bool regions_came_from_canvas () const {
519  return true;
520  }
521 
523 
524 private:
526  bool const,
527  bool const,
528  Temporal::timepos_t const &,
529  int32_t const ev_state
530  );
531 
533  bool const,
534  bool const,
535  Temporal::timepos_t const &,
536  int32_t const ev_state
537  );
538 
540  std::shared_ptr<ARDOUR::Region>,
543  Temporal::timepos_t const &,
545  );
546 
548  std::shared_ptr<ARDOUR::Region>,
549  std::shared_ptr<ARDOUR::Playlist>,
550  ARDOUR::PlaylistSet& modified_playlists
551  );
552 
553 
555  RouteTimeAxisView* create_destination_time_axis (std::shared_ptr<ARDOUR::Region>, TimeAxisView* original);
556 
558 };
559 
562 {
563 public:
564  RegionInsertDrag (Editor&, std::shared_ptr<ARDOUR::Region>, RouteTimeAxisView*, Temporal::timepos_t const &, Temporal::TimeDomain);
565 
566  void finished (GdkEvent *, bool);
567  void aborted (bool);
568 
569  bool regions_came_from_canvas () const {
570  return false;
571  }
572 };
573 
575 class RegionCutDrag : public EditorDrag
576 {
577 public:
580 
581  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
582  void motion (GdkEvent*, bool);
583  void finished (GdkEvent*, bool);
584  void aborted (bool);
585 };
586 
589 {
590 public:
592 
593  void motion (GdkEvent *, bool);
594  void finished (GdkEvent *, bool);
595  void aborted (bool);
596 
597 private:
599  std::shared_ptr<ARDOUR::Region> _region;
600 };
601 
603 class NoteResizeDrag : public Drag
604 {
605 public:
607 
608  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
609  void motion (GdkEvent *, bool);
610  void finished (GdkEvent *, bool);
611  void aborted (bool);
612 
614  return false;
615  }
616 
617 private:
619  bool relative;
620  bool at_front;
622  double _snap_delta;
623 };
624 
626 class NoteDrag : public Drag
627 {
628 public:
630 
631  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
632  void motion (GdkEvent *, bool);
633  void finished (GdkEvent *, bool);
634  void aborted (bool);
635 
637 
639  return false;
640  }
641 
642 private:
643 
644  Temporal::timecnt_t total_dx (GdkEvent * event) const; // total movement in quarter notes
645  int8_t total_dy () const;
646 
651  Temporal::timepos_t _earliest; // earliest note in note selection
653  double _note_height;
654 };
655 
656 class NoteCreateDrag : public Drag
657 {
658 public:
661 
662  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
663  void motion (GdkEvent *, bool);
664  void finished (GdkEvent *, bool);
665  void aborted (bool);
666 
668  return mode == Editing::MouseDraw || mode == Editing::MouseContent;
669  }
670 
672  return false;
673  }
674 
675  bool y_movement_matters () const {
676  return false;
677  }
678 
679 private:
680  double y_to_region (double) const;
681  Temporal::Beats round_to_grid (Temporal::timepos_t const & pos, GdkEvent const * event) const;
682 
686 };
687 
688 class HitCreateDrag : public Drag
689 {
690 public:
693 
694  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
695  void motion (GdkEvent *, bool) {}
696  void finished (GdkEvent *, bool);
697  void aborted (bool) {}
698 
700  return mode == Editing::MouseDraw || mode == Editing::MouseContent;
701  }
702 
703  bool y_movement_matters () const {
704  return false;
705  }
706 
707 private:
708  double y_to_region (double) const;
709 
712  int _y;
713 
714 };
715 
717 class PatchChangeDrag : public Drag
718 {
719 public:
721 
722  void motion (GdkEvent *, bool);
723  void finished (GdkEvent *, bool);
724  void aborted (bool);
725 
726  bool y_movement_matters () const {
727  return false;
728  }
729 
731  return false;
732  }
733 
735 
736 private:
740 };
741 
744 {
745 public:
747 
750 };
751 
754 {
755 public:
757 
758  void motion (GdkEvent *, bool);
759  void finished (GdkEvent *, bool);
760  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
761 
762  bool y_movement_matters () const {
763  return false;
764  }
765 
767  return false;
768  }
769 
770  void aborted (bool);
771 
772 protected:
773  std::list<AVDraggingView> _views;
774 
775 private:
778  bool _stuck;
779 };
780 
782 class TrimDrag : public RegionDrag
783 {
784 public:
785  enum Operation {
787  EndTrim
788  };
789 
790  TrimDrag (Editor&, ArdourCanvas::Item *, RegionView*, std::list<RegionView*> const &, Temporal::TimeDomain td, bool preserve_fade_anchor = false);
791 
792  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
793  void motion (GdkEvent *, bool);
794  void finished (GdkEvent *, bool);
795  void aborted (bool);
796 
797  bool y_movement_matters () const {
798  return false;
799  }
800 
802  return false;
803  }
804 
806 
807 private:
808 
810 
813 
814  std::vector<RegionView::DisplaySuspender> suspenders;
815 };
816 
819 {
820 public:
822 
823  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
824  void motion (GdkEvent *, bool);
825  void finished (GdkEvent *, bool);
826  void aborted (bool);
827 
829  return false;
830  }
831 
832  bool y_movement_matters () const {
833  return false;
834  }
835 
837 
838 private:
842 
843  bool _movable;
847 };
848 
851 {
852 public:
854 
855  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
856  void motion (GdkEvent *, bool);
857  void finished (GdkEvent *, bool);
858  void aborted (bool);
859 
860 private:
862  double initial_bpm;
865 };
866 
869 {
870 public:
872 
873  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
874  void motion (GdkEvent *, bool);
875  void finished (GdkEvent *, bool);
876  void aborted (bool);
877 
879  return false;
880  }
881 
882  bool y_movement_matters () const {
883  return true;
884  }
885 
887 
888 private:
892 
893  bool _movable;
894  double _grab_bpm;
897 };
898 
900 class BBTMarkerDrag : public EditorDrag
901 {
902 public:
904 
905  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
906  void motion (GdkEvent *, bool);
907  void finished (GdkEvent *, bool);
908  void aborted (bool);
909 
911  return false;
912  }
913 
914  bool y_movement_matters () const {
915  return false;
916  }
917 
919 
920 private:
924 
926 };
927 
929 {
930 public:
932 
933  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
934  void motion (GdkEvent *, bool);
935  void finished (GdkEvent *, bool);
936  void aborted (bool);
937 
939  return false;
940  }
941 
943  return false;
944  }
945 
946  bool y_movement_matters () const {
947  return false;
948  }
949 
951 
952 private:
955  double _grab_bpm;
957 
960 };
961 
963 {
964 public:
969  XMLNode&,
970  bool ramped);
971 
972  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
973  void motion (GdkEvent *, bool);
974  void finished (GdkEvent *, bool);
975  void aborted (bool);
976 
978  return false;
979  }
980 
982  return false;
983  }
984 
985  bool y_movement_matters () const {
986  return false;
987  }
988 
990 
991 private:
996 
997  double direction;
998  double delta;
1001 
1004  bool _do_ramp;
1005 };
1006 
1007 
1010 {
1011 public:
1013 
1014  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1015  void motion (GdkEvent *, bool);
1016  void finished (GdkEvent *, bool);
1017  void aborted (bool);
1018 
1020  return false;
1021  }
1022 
1023  bool y_movement_matters () const {
1024  return true;
1025  }
1026 
1028 
1029 private:
1036 };
1037 
1039 class TempoEndDrag : public EditorDrag
1040 {
1041 public:
1043 
1044  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1045  void motion (GdkEvent *, bool);
1046  void finished (GdkEvent *, bool);
1047  void aborted (bool);
1048 
1050  return false;
1051  }
1052 
1053  bool y_movement_matters () const {
1054  return true;
1055  }
1056 
1058 
1059 private:
1064 
1067 };
1068 
1070 class CursorDrag : public EditorDrag
1071 {
1072 public:
1074 
1075  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1076  void motion (GdkEvent *, bool);
1077  void finished (GdkEvent *, bool);
1078  void aborted (bool);
1079 
1081  return false;
1082  }
1083 
1084  bool y_movement_matters () const {
1085  return true;
1086  }
1087 
1088 private:
1090 
1092  bool _stop;
1093  double _grab_zoom;
1094 
1095  //used for zooming
1100 };
1101 
1103 class FadeInDrag : public RegionDrag
1104 {
1105 public:
1106  FadeInDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain);
1107 
1108  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1109  void motion (GdkEvent *, bool);
1110  void finished (GdkEvent *, bool);
1111  void aborted (bool);
1112 
1113  bool y_movement_matters () const {
1114  return false;
1115  }
1116 
1118  return false;
1119  }
1120 
1122 };
1123 
1125 class FadeOutDrag : public RegionDrag
1126 {
1127 public:
1128  FadeOutDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain td);
1129 
1130  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1131  void motion (GdkEvent *, bool);
1132  void finished (GdkEvent *, bool);
1133  void aborted (bool);
1134 
1135  bool y_movement_matters () const {
1136  return false;
1137  }
1138 
1140  return false;
1141  }
1142 
1144 };
1145 
1147 class MarkerDrag : public EditorDrag
1148 {
1149 public:
1152 
1153  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1154  void motion (GdkEvent *, bool);
1155  void finished (GdkEvent *, bool);
1156  void aborted (bool);
1157 
1159  return false;
1160  }
1161 
1162  bool y_movement_matters () const {
1163  return false;
1164  }
1165 
1168 
1169 private:
1171 
1176  std::vector<ArdourMarker*> markers;
1179  };
1180 
1181  std::vector<ARDOUR::Location::ChangeSuspender> lcs;
1182 
1183  typedef std::list<CopiedLocationMarkerInfo> CopiedLocationInfo;
1186 };
1187 
1189 class ControlPointDrag : public Drag
1190 {
1191 public:
1193 
1194  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1195  void motion (GdkEvent *, bool);
1196  void finished (GdkEvent *, bool);
1197  void aborted (bool);
1198 
1200 
1202  return false;
1203  }
1204 
1205 
1206 private:
1207 
1212  bool _pushing;
1213  uint32_t _final_index;
1214  static double _zero_gain_fraction;
1215 
1217 };
1218 
1220 class LineDrag : public Drag
1221 {
1222 public:
1223  LineDrag (EditingContext &e, ArdourCanvas::Item *i, std::function<void(GdkEvent*,Temporal::timepos_t const &,double)>);
1225 
1226  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1227  void motion (GdkEvent *, bool);
1228  void finished (GdkEvent *, bool);
1229  void aborted (bool);
1230 
1232  return false;
1233  }
1234 
1235 private:
1236 
1241  uint32_t _before;
1242  uint32_t _after;
1244  std::function<void(GdkEvent*,Temporal::timepos_t const &,double)> click_functor;
1245 };
1246 
1248 class FeatureLineDrag : public Drag
1249 {
1250 public:
1252 
1253  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1254  void motion (GdkEvent *, bool);
1255  void finished (GdkEvent *, bool);
1256  void aborted (bool);
1257 
1258 private:
1259 
1262 
1265 
1266  float _before;
1267  uint32_t _max_x;
1268 };
1269 
1272 {
1273 public:
1275 
1276  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1277  void motion (GdkEvent *, bool);
1278  void finished (GdkEvent *, bool);
1279  void aborted (bool);
1280 
1281  void do_select_things (GdkEvent *, bool);
1282 
1291  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);
1292  virtual void deselect_things ();
1293 
1294  protected:
1296  std::function<bool(GdkEvent*,Temporal::timepos_t const &)> click_functor;
1297 };
1298 
1301 {
1302  public:
1304 
1305  void select_things (int, Temporal::timepos_t const &, Temporal::timepos_t const &, double, double, bool);
1307  void finished (GdkEvent *, bool);
1308 
1309  private:
1311 };
1312 
1315 {
1316 public:
1318 
1319  void select_things (int, Temporal::timepos_t const &, Temporal::timepos_t const &, double, double, bool);
1321 
1322 private:
1324 };
1325 
1327 class TimeFXDrag : public RegionDrag
1328 {
1329 public:
1330  TimeFXDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain td);
1331 
1332  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1333  void motion (GdkEvent *, bool);
1334  void finished (GdkEvent *, bool);
1335  void aborted (bool);
1336 private:
1338 };
1339 
1342 {
1343 public:
1344  enum Operation {
1350  };
1351 
1353 
1354  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1355  void motion (GdkEvent *, bool);
1356  void finished (GdkEvent *, bool);
1357  void aborted (bool);
1358 
1360 
1361 private:
1363  bool _add;
1368 };
1369 
1372 {
1373 public:
1375 
1377  void motion (GdkEvent*, bool);
1378  void finished (GdkEvent *, bool);
1379  void aborted (bool);
1380 
1381 private:
1385 };
1386 
1389 {
1390 public:
1391  enum Operation {
1396  };
1397 
1400 
1401  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1402  void motion (GdkEvent *, bool);
1403  void finished (GdkEvent *, bool);
1404  void aborted (bool);
1405 
1407  return false;
1408  }
1409 
1410  bool y_movement_matters () const {
1411  return false;
1412  }
1413 
1414 private:
1416 
1419 };
1420 
1423 {
1424 public:
1426 
1427  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1428  void motion (GdkEvent *, bool);
1429  void finished (GdkEvent *, bool);
1430  void aborted (bool);
1431 
1432 private:
1434 };
1435 
1440 {
1441 public:
1442  AutomationRangeDrag (EditingContext&, AutomationTimeAxisView *, float initial_value, std::list<ARDOUR::TimelineRange> const &);
1443  AutomationRangeDrag (EditingContext&, std::list<RegionView*> const &, std::list<ARDOUR::TimelineRange> const &, double y_origin, double y_height);
1444 
1445  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1446  void motion (GdkEvent *, bool);
1447  void finished (GdkEvent *, bool);
1448  void aborted (bool);
1449 
1450  bool x_movement_matters () const {
1451  return false;
1452  }
1453 
1454 private:
1455  void setup (std::list<std::shared_ptr<AutomationLine> > const &);
1456  double y_fraction (double global_y_position) const;
1457  double value (std::shared_ptr<ARDOUR::AutomationList> list, Temporal::timepos_t const & x) const;
1458 
1459  std::list<ARDOUR::TimelineRange> _ranges;
1460 
1462  struct Line {
1463  std::shared_ptr<AutomationLine> line;
1464  std::list<ControlPoint*> points;
1465  std::pair<Temporal::timepos_t, Temporal::timepos_t> range;
1467  };
1468 
1469  std::list<Line> _lines;
1470  double _y_origin;
1471  double _y_height;
1475 };
1476 
1479 class CrossfadeEdgeDrag : public Drag
1480 {
1481 public:
1483 
1485  void motion (GdkEvent*, bool);
1486  void finished (GdkEvent*, bool);
1487  void aborted (bool);
1488 
1489  bool y_movement_matters () const {
1490  return false;
1491  }
1492 
1493 private:
1495  bool start;
1496 };
1497 
1498 class RegionMarkerDrag : public Drag
1499 {
1500  public:
1503 
1504  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1505  void motion (GdkEvent *, bool);
1506  void finished (GdkEvent *, bool);
1507  void aborted (bool);
1508 
1510  return false;
1511  }
1512 
1513  bool y_movement_matters () const {
1514  return false;
1515  }
1516 
1518 
1519  private:
1524 };
1525 
1526 
1527 class LollipopDrag : public Drag
1528 {
1529  public:
1532 
1533  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1534  void motion (GdkEvent *, bool);
1535  void finished (GdkEvent *, bool);
1536  void aborted (bool);
1537 
1539  return false;
1540  }
1541 
1543  return false;
1544  }
1545 
1546  bool x_movement_matters () const {
1547  return false;
1548  }
1549 
1551 
1552  private:
1555 };
1556 
1557 template<typename OrderedPointList, typename OrderedPoint>
1558 class FreehandLineDrag : public Drag
1559 {
1560  public:
1563 
1564  void motion (GdkEvent*, bool);
1565  void finished (GdkEvent*, bool);
1567  virtual void point_added (ArdourCanvas::Duple const & d, ArdourCanvas::Rectangle const & r, double last_x) {}
1568  virtual void line_extended (ArdourCanvas::Duple const & from, ArdourCanvas::Duple const & to, ArdourCanvas::Rectangle const & r, double last_x) {
1569  point_added (to, r, last_x);
1570  }
1571 
1572  protected:
1573  ArdourCanvas::Item* parent; /* we do not own this. If null, use base_rect as the parent */
1574  ArdourCanvas::Rectangle& base_rect; /* we do not own this */
1578  int edge_x;
1579  bool did_snap;
1581  OrderedPointList drawn_points;
1584 
1585  void maybe_add_point (GdkEvent*, Temporal::timepos_t const &, bool first_move);
1586 };
1587 
1588 class AutomationDrawDrag : public FreehandLineDrag<Evoral::ControlList::OrderedPoints, Evoral::ControlList::OrderedPoint>
1589 {
1590  public:
1593 
1594  void finished (GdkEvent*, bool);
1595  void aborted (bool) {}
1596 };
1597 
1598 class VelocityLineDrag : public FreehandLineDrag<Evoral::ControlList::OrderedPoints, Evoral::ControlList::OrderedPoint>
1599 {
1600  public:
1603 
1604  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1605  void finished (GdkEvent*, bool);
1606  void aborted (bool);
1607  void point_added (ArdourCanvas::Duple const & d, ArdourCanvas::Rectangle const & r, double last_x);
1608  void line_extended (ArdourCanvas::Duple const & from, ArdourCanvas::Duple const & to, ArdourCanvas::Rectangle const & r, double last_x);
1609 
1610  private:
1613 };
1614 
1615 class ClipStartDrag : public Drag
1616 {
1617  public:
1620 
1623  void motion (GdkEvent*, bool);
1624  void finished (GdkEvent*, bool);
1625  void aborted (bool);
1626 
1627  private:
1631 };
1632 
1633 class ClipEndDrag : public Drag
1634 {
1635  public:
1638 
1641  void motion (GdkEvent*, bool);
1642  void finished (GdkEvent*, bool);
1643  void aborted (bool);
1644 
1645  private:
1649 };
1650 
1651 #endif /* __gtk2_ardour_editor_drag_h_ */
AVDraggingView(RegionView *)
samplepos_t initial_position
initial position of the region
Definition: editor_drag.h:749
RegionView * view
the view
Definition: editor_drag.h:748
void aborted(bool)
Definition: editor_drag.h:1595
void finished(GdkEvent *, bool)
AutomationDrawDrag(EditingContext &, ArdourCanvas::Item *, ArdourCanvas::Rectangle &, bool, Temporal::TimeDomain)
std::list< ARDOUR::TimelineRange > _ranges
Definition: editor_drag.h:1459
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:1469
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:1450
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:925
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:923
bool y_movement_matters() const
Definition: editor_drag.h:914
BBTMarkerDrag(Editor &, ArdourCanvas::Item *)
void aborted(bool)
BBTMarker * _marker
Definition: editor_drag.h:921
void finished(GdkEvent *, bool)
void motion(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:910
Temporal::MusicTimePoint const * _point
Definition: editor_drag.h:922
void start_grab(GdkEvent *, Gdk::Cursor *)
void aborted(bool)
void finished(GdkEvent *, bool)
ClipEndDrag(EditingContext &, ArdourCanvas::Rectangle &, Pianoroll &m)
ArdourCanvas::Rectangle * dragging_rect
Definition: editor_drag.h:1647
void motion(GdkEvent *, bool)
bool end_grab(GdkEvent *)
ArdourCanvas::Rect original_rect
Definition: editor_drag.h:1648
Pianoroll & mce
Definition: editor_drag.h:1646
void aborted(bool)
bool end_grab(GdkEvent *)
ArdourCanvas::Rect original_rect
Definition: editor_drag.h:1630
void motion(GdkEvent *, bool)
void finished(GdkEvent *, bool)
void start_grab(GdkEvent *, Gdk::Cursor *)
Pianoroll & mce
Definition: editor_drag.h:1628
ArdourCanvas::Rectangle * dragging_rect
Definition: editor_drag.h:1629
ClipStartDrag(EditingContext &, ArdourCanvas::Rectangle &, Pianoroll &m)
uint32_t _final_index
Definition: editor_drag.h:1213
void motion(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1201
Temporal::timecnt_t total_dt(GdkEvent *) const
bool active(Editing::MouseMode m)
ControlPoint * _point
Definition: editor_drag.h:1208
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:1214
double _cumulative_y_drag
Definition: editor_drag.h:1211
AudioRegionView * arv
Definition: editor_drag.h:1494
bool y_movement_matters() const
Definition: editor_drag.h:1489
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:1093
int _last_y_delta
Definition: editor_drag.h:1099
CursorDrag(Editor &, EditorCursor &, bool)
bool _stop
true to stop the transport on starting the drag, otherwise false
Definition: editor_drag.h:1092
EditorCursor & _cursor
Definition: editor_drag.h:1091
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1080
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:1084
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:148
bool ending() const
Definition: editor_drag.h:111
bool _old_follow_playhead
state of Editor::follow_playhead() before the drags started
Definition: editor_drag.h:149
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:143
std::list< Drag * > _drags
Definition: editor_drag.h:144
double current_pointer_x() const
Definition: editor_drag.h:120
bool active() const
Definition: editor_drag.h:115
double current_pointer_y() const
Definition: editor_drag.h:125
double _current_pointer_y
canvas-coordinate space y of the current pointer
Definition: editor_drag.h:147
void add(Drag *)
Temporal::timepos_t current_pointer_time() const
Definition: editor_drag.h:135
double _current_pointer_x
canvas-coordinate space x of the current pointer
Definition: editor_drag.h:146
bool _ending
true if end_grab or abort is in progress, otherwise false
Definition: editor_drag.h:145
bool motion_handler(GdkEvent *, bool)
DragManager(EditingContext *e)
ARDOUR::samplepos_t current_pointer_sample() const
Definition: editor_drag.h:130
void mark_double_click()
Temporal::timepos_t last_pointer_time() const
Definition: editor_drag.h:303
double last_pointer_y() const
Definition: editor_drag.h:295
virtual bool active(Editing::MouseMode m)
Definition: editor_drag.h:216
Temporal::timepos_t pixel_duration_to_time(double x) const
void set_double_click(bool yn)
Definition: editor_drag.h:183
virtual bool y_movement_matters() const
Definition: editor_drag.h:243
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:168
virtual void setup_pointer_offset()
Definition: editor_drag.h:254
double _last_pointer_x
trackview x of the pointer last time a motion occurred
Definition: editor_drag.h:345
virtual void start_grab(GdkEvent *e, Gdk::Cursor *c=0)
ArdourCanvas::Item * _item
our item
Definition: editor_drag.h:324
Temporal::timecnt_t _video_offset
Definition: editor_drag.h:328
bool _y_constrained
true if y motion is constrained, otherwise false
Definition: editor_drag.h:331
void abort()
Gtkmm2ext::Bindings::DragsBlockBindings binding_blocker
Definition: editor_drag.h:359
Temporal::TimeDomain time_domain() const
Definition: editor_drag.h:172
virtual ~Drag()
Temporal::timepos_t _last_pointer_time
adjusted_time the last time a motion occurred
Definition: editor_drag.h:349
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:233
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:344
void set_manager(DragManager *m)
Definition: editor_drag.h:159
std::pair< int, int > MoveThreshold
Definition: editor_drag.h:225
bool _move_threshold_passed
true if the move threshold has been passed, otherwise false
Definition: editor_drag.h:339
void set_grab_button_anyway(GdkEvent *)
DragManager * _drags
Definition: editor_drag.h:323
bool _was_double_click
true if drag initiated by a double click event
Definition: editor_drag.h:342
void show_view_preview(Temporal::timepos_t const &)
Temporal::timecnt_t _pointer_offset
Definition: editor_drag.h:327
ArdourCanvas::Item const * _bounding_item
our coordinate reference (normally null)
Definition: editor_drag.h:325
bool _initially_vertical
true if after move threshold is passed we appear to be moving vertically; undefined before that
Definition: editor_drag.h:341
ARDOUR::timepos_t _earliest_time_limit
time we cannot drag before (defaults to 0, indicating no such limit)
Definition: editor_drag.h:333
double current_pointer_y() const
virtual bool mid_drag_key_event(GdkEventKey *)
Definition: editor_drag.h:247
std::shared_ptr< ARDOUR::Region > add_midi_region(MidiTimeAxisView *, bool commit)
int grab_button() const
Definition: editor_drag.h:265
bool _preview_video
Definition: editor_drag.h:329
virtual void motion(GdkEvent *e, bool f)=0
virtual bool allow_vertical_autoscroll() const
Definition: editor_drag.h:229
bool _copy
Definition: editor_drag.h:334
virtual bool end_grab(GdkEvent *)
double last_pointer_x() const
Definition: editor_drag.h:291
ARDOUR::samplepos_t last_pointer_sample() const
Definition: editor_drag.h:299
virtual MoveThreshold move_threshold() const
Temporal::timecnt_t _snap_delta
Definition: editor_drag.h:355
bool motion_handler(GdkEvent *, bool)
double _last_pointer_y
trackview y of the pointer last time a motion occurred
Definition: editor_drag.h:346
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:283
int _grab_button
Definition: editor_drag.h:357
bool _hide_snapped_cursor
set true of Drag::motion does not call set_snapped_cursor_position
Definition: editor_drag.h:338
double current_pointer_x() const
bool _x_constrained
true if x motion is constrained, otherwise false
Definition: editor_drag.h:330
double grab_y() const
Definition: editor_drag.h:273
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:347
bool initially_vertical() const
Definition: editor_drag.h:249
bool _trackview_only
true if pointer y value should always be relative to the top of the trackview group
Definition: editor_drag.h:337
void set_bounding_item(ArdourCanvas::Item const *i)
Definition: editor_drag.h:163
Temporal::timepos_t raw_grab_time() const
Definition: editor_drag.h:279
bool was_double_click() const
Definition: editor_drag.h:182
virtual bool x_movement_matters() const
Definition: editor_drag.h:238
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:340
virtual void aborted(bool m)=0
EditingContext & editing_context
Definition: editor_drag.h:322
virtual void setup_video_offset()
Definition: editor_drag.h:259
bool _was_rolling
true if the session was rolling before the drag started, otherwise false
Definition: editor_drag.h:332
double _grab_x
trackview x of the grab start position
Definition: editor_drag.h:343
bool preview_video() const
Definition: editor_drag.h:220
Temporal::timepos_t grab_time() const
Definition: editor_drag.h:287
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:356
Temporal::TimeDomain _time_domain
Definition: editor_drag.h:350
double grab_x() const
Definition: editor_drag.h:269
Temporal::timepos_t _grab_time
adjusted_time that the mouse was at when start_grab was called, or 0
Definition: editor_drag.h:348
samplepos_t anchored_fade_length
fade_length when anchored during drag
Definition: editor_drag.h:396
RegionView * view
the view
Definition: editor_drag.h:383
double layer
Definition: editor_drag.h:392
std::shared_ptr< ARDOUR::Playlist > initial_playlist
Definition: editor_drag.h:397
DraggingView(RegionView *, RegionDrag *, TimeAxisView *original_tav)
Temporal::timepos_t initial_position
initial position of the region
Definition: editor_drag.h:394
TimeAxisView * initial_time_axis_view
Definition: editor_drag.h:398
double initial_y
the initial y position of the view before any reparenting
Definition: editor_drag.h:393
int time_axis_view
Definition: editor_drag.h:387
Temporal::timepos_t initial_end
initial end position of the region
Definition: editor_drag.h:395
EditorDrag(Editor &, ArdourCanvas::Item *, Temporal::TimeDomain td, ArdourCanvas::Item const *bounding_item, bool hide_snapped_cursor=true)
Editor & _editor
Definition: editor_drag.h:372
Definition: editor.h:160
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1117
void setup_pointer_offset()
void aborted(bool)
void motion(GdkEvent *, bool)
bool y_movement_matters() const
Definition: editor_drag.h:1113
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:1135
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1139
void setup_pointer_offset()
void motion(GdkEvent *, bool)
void finished(GdkEvent *, bool)
ArdourCanvas::Line * _line
Definition: editor_drag.h:1260
double _cumulative_x_drag
Definition: editor_drag.h:1264
double _region_view_grab_x
Definition: editor_drag.h:1263
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:1261
FeatureLineDrag(Editor &e, ArdourCanvas::Item *i)
ArdourCanvas::Coord line_start_y
Definition: editor_drag.h:1583
virtual void point_added(ArdourCanvas::Duple const &d, ArdourCanvas::Rectangle const &r, double last_x)
Definition: editor_drag.h:1567
void maybe_add_point(GdkEvent *, Temporal::timepos_t const &, bool first_move)
ArdourCanvas::Item * parent
Definition: editor_drag.h:1573
ArdourCanvas::Rectangle & base_rect
Definition: editor_drag.h:1574
ArdourCanvas::Coord line_start_x
Definition: editor_drag.h:1582
ArdourCanvas::PolyLine * dragging_line
Definition: editor_drag.h:1575
virtual void line_extended(ArdourCanvas::Duple const &from, ArdourCanvas::Duple const &to, ArdourCanvas::Rectangle const &r, double last_x)
Definition: editor_drag.h:1568
void finished(GdkEvent *, bool)
OrderedPointList drawn_points
Definition: editor_drag.h:1581
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:695
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Temporal::timepos_t _last_pos
Definition: editor_drag.h:711
void finished(GdkEvent *, bool)
MidiView * _midi_view
Definition: editor_drag.h:710
double y_to_region(double) const
bool y_movement_matters() const
Definition: editor_drag.h:703
void aborted(bool)
Definition: editor_drag.h:697
bool active(Editing::MouseMode mode)
Definition: editor_drag.h:699
void aborted(bool)
bool have_command
Definition: editor_drag.h:1243
std::function< void(GdkEvent *, Temporal::timepos_t const &, double)> click_functor
Definition: editor_drag.h:1244
uint32_t _before
Definition: editor_drag.h:1241
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
double _fixed_grab_x
Definition: editor_drag.h:1238
double _cumulative_y_drag
Definition: editor_drag.h:1240
AutomationLine * _line
Definition: editor_drag.h:1237
uint32_t _after
Definition: editor_drag.h:1242
void finished(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1231
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:1239
ArdourCanvas::Lollipop * _primary
Definition: editor_drag.h:1554
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:1553
bool allow_horizontal_autoscroll() const
Definition: editor_drag.h:1542
bool x_movement_matters() const
Definition: editor_drag.h:1546
void motion(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1538
void finished(GdkEvent *, bool)
double _grab_bpm
Definition: editor_drag.h:955
bool y_movement_matters() const
Definition: editor_drag.h:946
void setup_pointer_offset()
void finished(GdkEvent *, bool)
void motion(GdkEvent *, bool)
XMLNode * _before_state
Definition: editor_drag.h:958
MappingEndDrag(Editor &, ArdourCanvas::Item *, Temporal::TempoMap::WritableSharedPtr &, Temporal::TempoPoint &, Temporal::TempoPoint &after, XMLNode &before_state)
Temporal::TempoPoint & _tempo
Definition: editor_drag.h:953
bool allow_horizontal_autoscroll() const
Definition: editor_drag.h:942
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:938
void aborted(bool)
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:956
Temporal::TempoPoint & _after
Definition: editor_drag.h:954
void motion(GdkEvent *, bool)
bool y_movement_matters() const
Definition: editor_drag.h:985
bool allow_horizontal_autoscroll() const
Definition: editor_drag.h:981
double initial_focus_npm
Definition: editor_drag.h:999
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:993
Temporal::TempoPoint & prev
Definition: editor_drag.h:992
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:977
Temporal::TempoPoint & next
Definition: editor_drag.h:994
void setup_pointer_offset()
XMLNode * _before_state
Definition: editor_drag.h:1002
double initial_pre_npm
Definition: editor_drag.h:1000
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:995
void aborted(bool)
void finished(GdkEvent *, bool)
void aborted(bool)
bool _selection_changed
Definition: editor_drag.h:1173
std::list< CopiedLocationMarkerInfo > CopiedLocationInfo
Definition: editor_drag.h:1183
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
bool y_movement_matters() const
Definition: editor_drag.h:1162
void finished(GdkEvent *, bool)
MarkerDrag(Editor &, ArdourCanvas::Item *)
ArdourCanvas::Points _points
Definition: editor_drag.h:1185
CopiedLocationInfo _copied_locations
Definition: editor_drag.h:1184
std::vector< ARDOUR::Location::ChangeSuspender > lcs
Definition: editor_drag.h:1181
void setup_pointer_offset()
void update_item(ARDOUR::Location *)
ArdourMarker * _marker
marker being dragged
Definition: editor_drag.h:1172
void motion(GdkEvent *, bool)
void setup_video_offset()
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1158
void finished(GdkEvent *, bool)
Temporal::superclock_t initial_sclock
Definition: editor_drag.h:841
void setup_pointer_offset()
void aborted(bool)
Editing::GridType _old_grid_type
Definition: editor_drag.h:844
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Editing::SnapMode _old_snap_mode
Definition: editor_drag.h:845
MeterMarkerDrag(Editor &, ArdourCanvas::Item *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:828
MeterMarker * _marker
Definition: editor_drag.h:839
void motion(GdkEvent *, bool)
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:840
bool y_movement_matters() const
Definition: editor_drag.h:832
XMLNode * before_state
Definition: editor_drag.h:846
void finished(GdkEvent *, bool)
MidiRubberbandSelectDrag(EditingContext &, MidiView *)
void select_things(int, Temporal::timepos_t const &, Temporal::timepos_t const &, double, double, bool)
void select_things(int, Temporal::timepos_t const &, Temporal::timepos_t const &, double, double, bool)
MidiVerticalSelectDrag(EditingContext &, MidiView *)
static Gdk::Cursor * invalid_cursor()
Definition: mouse_cursors.h:90
MouseZoomDrag(Editor &, ArdourCanvas::Item *)
void finished(GdkEvent *, bool)
void aborted(bool)
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void motion(GdkEvent *, bool)
NoteCreateDrag(EditingContext &, ArdourCanvas::Item *, MidiView *)
void aborted(bool)
MidiView * _midi_view
Definition: editor_drag.h:683
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:671
Temporal::timepos_t _note[2]
Definition: editor_drag.h:685
bool active(Editing::MouseMode mode)
Definition: editor_drag.h:667
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:675
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:684
double _note_height
Definition: editor_drag.h:653
NoteBase * _primary
Definition: editor_drag.h:648
double _cumulative_dy
Definition: editor_drag.h:650
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:647
Temporal::timecnt_t _cumulative_dx
Definition: editor_drag.h:649
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:638
void finished(GdkEvent *, bool)
Temporal::timepos_t _earliest
Definition: editor_drag.h:651
bool _was_selected
Definition: editor_drag.h:652
void motion(GdkEvent *, bool)
NoteResizeDrag(EditingContext &, ArdourCanvas::Item *)
MidiView * midi_view
Definition: editor_drag.h:618
void finished(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:613
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
double _snap_delta
Definition: editor_drag.h:622
void aborted(bool)
void motion(GdkEvent *, bool)
void finished(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:730
PatchChangeDrag(EditingContext &, PatchChange *, MidiView *)
PatchChange * _patch_change
Definition: editor_drag.h:738
MidiView * _region_view
Definition: editor_drag.h:737
double _cumulative_dx
Definition: editor_drag.h:739
void aborted(bool)
void motion(GdkEvent *, bool)
void setup_pointer_offset()
bool y_movement_matters() const
Definition: editor_drag.h:726
ArdourCanvas::Rectangle * _drag_rect
Definition: editor_drag.h:1418
void motion(GdkEvent *, bool)
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Operation _operation
Definition: editor_drag.h:1417
void aborted(bool)
RangeMarkerBarDrag(Editor &, ArdourCanvas::Item *, Operation)
void update_item(ARDOUR::Location *)
bool y_movement_matters() const
Definition: editor_drag.h:1410
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1406
void finished(GdkEvent *, bool)
std::set< Temporal::timepos_t > TimePositionSet
Definition: editor_drag.h:461
virtual void finished(GdkEvent *, bool)
virtual void aborted(bool)
TimePositionSet _already_pasted
Definition: editor_drag.h:462
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:454
MidiTimeAxisView * _view
Definition: editor_drag.h:598
void finished(GdkEvent *, bool)
RegionCreateDrag(Editor &, ArdourCanvas::Item *, TimeAxisView *)
void aborted(bool)
std::shared_ptr< ARDOUR::Region > _region
Definition: editor_drag.h:599
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:406
uint32_t _ntracks
Definition: editor_drag.h:420
RegionView * _primary
the view that was clicked on (or whatever) to start the drag
Definition: editor_drag.h:410
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:419
std::list< DraggingView > _views
information about all views that are being dragged
Definition: editor_drag.h:411
PBD::ScopedConnection death_connection
Definition: editor_drag.h:432
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:414
int _visible_y_low
Definition: editor_drag.h:418
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:569
void aborted(bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1509
void aborted(bool)
ARDOUR::CueMarker model
Definition: editor_drag.h:1522
ARDOUR::CueMarker dragging_model
Definition: editor_drag.h:1523
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void finished(GdkEvent *, bool)
void setup_pointer_offset()
ArdourMarker * view
Definition: editor_drag.h:1521
bool y_movement_matters() const
Definition: editor_drag.h:1513
void motion(GdkEvent *, bool)
RegionMarkerDrag(Editor &, RegionView *, ArdourCanvas::Item *)
RegionView * rv
Definition: editor_drag.h:1520
uint32_t _ddropzone
Definition: editor_drag.h:499
virtual bool y_movement_allowed(int, double, int skip_invisible=0) const
uint32_t _ndropzone
Definition: editor_drag.h:497
uint32_t _pdropzone
Definition: editor_drag.h:498
std::vector< ArdourMarker * > ripple_markers
Definition: editor_drag.h:494
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:490
virtual bool regions_came_from_canvas() const =0
virtual ~RegionMotionDrag()
Definition: editor_drag.h:471
double _last_pointer_layer
Definition: editor_drag.h:493
double _total_x_delta
Definition: editor_drag.h:491
virtual void aborted(bool)
int _last_pointer_time_axis_view
Definition: editor_drag.h:492
void aborted(bool)
RegionView * _new_region_view
Definition: editor_drag.h:557
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:518
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:510
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:441
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:1296
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:1364
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void setup_pointer_offset()
bool _time_selection_at_start
Definition: editor_drag.h:1365
void aborted(bool)
Temporal::timepos_t end_at_start
Definition: editor_drag.h:1367
Temporal::timepos_t start_at_start
Definition: editor_drag.h:1366
Operation _operation
Definition: editor_drag.h:1362
void motion(GdkEvent *, bool)
Temporal::timepos_t _end_at_start
Definition: editor_drag.h:1384
void finished(GdkEvent *, bool)
SelectionMarkerDrag(Editor &, ArdourCanvas::Item *)
void motion(GdkEvent *, bool)
Temporal::timepos_t _start_at_start
Definition: editor_drag.h:1383
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:861
XMLNode * _before_state
Definition: editor_drag.h:864
void motion(GdkEvent *, bool)
TempoCurveDrag(Editor &, ArdourCanvas::Item *)
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:863
double initial_bpm
Definition: editor_drag.h:862
bool y_movement_matters() const
Definition: editor_drag.h:1053
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1049
XMLNode * _before_state
Definition: editor_drag.h:1065
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:1063
void aborted(bool)
Temporal::Beats _grab_qn
Definition: editor_drag.h:1060
void motion(GdkEvent *, bool)
Temporal::TempoPoint * previous_tempo
Definition: editor_drag.h:1062
TempoEndDrag(Editor &, ArdourCanvas::Item *)
void setup_pointer_offset()
void finished(GdkEvent *, bool)
Temporal::TempoPoint * _tempo
Definition: editor_drag.h:1061
TempoMarker * _marker
Definition: editor_drag.h:889
XMLNode * _before_state
Definition: editor_drag.h:896
void motion(GdkEvent *, bool)
void setup_pointer_offset()
Temporal::TempoPoint const * _real_section
Definition: editor_drag.h:890
void aborted(bool)
TempoMarkerDrag(Editor &, ArdourCanvas::Item *)
void finished(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:878
bool y_movement_matters() const
Definition: editor_drag.h:882
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Temporal::Beats _grab_qn
Definition: editor_drag.h:895
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:891
Temporal::Beats _grab_qn
Definition: editor_drag.h:1030
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void setup_pointer_offset()
void finished(GdkEvent *, bool)
XMLNode * _before_state
Definition: editor_drag.h:1035
void motion(GdkEvent *, bool)
void aborted(bool)
bool y_movement_matters() const
Definition: editor_drag.h:1023
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1019
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:1033
TempoTwistDrag(Editor &, ArdourCanvas::Item *)
Temporal::TempoPoint const * _next_tempo
Definition: editor_drag.h:1032
Temporal::TempoPoint * _tempo
Definition: editor_drag.h:1031
std::shared_ptr< TempoMap > WritableSharedPtr
int64_t samples() const
Definition: timeline.h:90
void finished(GdkEvent *, bool)
bool _dragging_start
Definition: editor_drag.h:1337
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:801
bool _preserve_fade_anchor
Definition: editor_drag.h:811
bool _jump_position_when_done
Definition: editor_drag.h:812
Operation _operation
Definition: editor_drag.h:809
bool y_movement_matters() const
Definition: editor_drag.h:797
std::vector< RegionView::DisplaySuspender > suspenders
Definition: editor_drag.h:814
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:1611
void aborted(bool)
void finished(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:766
bool y_movement_matters() const
Definition: editor_drag.h:762
std::list< AVDraggingView > _views
information about all audio that are being dragged along
Definition: editor_drag.h:773
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
ARDOUR::sampleoffset_t _startdrag_video_offset
Definition: editor_drag.h:776
VideoTimeLineDrag(Editor &e, ArdourCanvas::Item *i)
ARDOUR::sampleoffset_t _max_backwards_drag
Definition: editor_drag.h:777
void finished(GdkEvent *, bool)
void motion(GdkEvent *, bool)
void aborted(bool)
Definition: xml++.h:114
PBD::PropertyDescriptor< timepos_t > start
Temporal::timecnt_t timecnt_t
std::set< std::shared_ptr< Playlist > > PlaylistSet
Temporal::sampleoffset_t sampleoffset_t
Temporal::samplepos_t samplepos_t
uint32_t layer_t
std::vector< Duple > Points
SnapMode
Definition: editing.h:71
GridType
Definition: editing.h:53
MouseMode
Definition: editing.h:99
Definition: axis_view.h:42
int64_t superclock_t
Definition: superclock.h:34
std::list< ControlPoint * > points
points to drag on the line
Definition: editor_drag.h:1464
std::pair< Temporal::timepos_t, Temporal::timepos_t > range
the range of all points on the line, in session time
Definition: editor_drag.h:1465
std::shared_ptr< AutomationLine > line
the line
Definition: editor_drag.h:1463
XMLNode * state
the XML state node before the drag
Definition: editor_drag.h:1466
std::vector< ArdourMarker * > markers
Definition: editor_drag.h:1176
CopiedLocationMarkerInfo(ARDOUR::Location *l, ArdourMarker *m)