Ardour  9.0-pre0-582-g084a23a80d
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 <gdk/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 MidiCueEditor;
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  std::pair<Temporal::timecnt_t,int> move_threshold () const {
226  return std::make_pair (Temporal::timecnt_t (1, Temporal::AudioTime), 1);
227  }
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 
335 private:
342  double _grab_x;
343  double _grab_y;
350 
351  /* difference between some key position's snapped and unsnapped
352  * samplepos. used for relative snap.
353  */
357 
359 };
360 
366 class EditorDrag : public Drag
367 {
368  public:
369  EditorDrag (Editor&, ArdourCanvas::Item *, Temporal::TimeDomain td, ArdourCanvas::Item const * bounding_item, bool hide_snapped_cursor = true);
370  protected:
372 };
373 
374 class RegionDrag;
375 
378 {
379 public:
381 
391  double layer;
392  double initial_y;
396  std::shared_ptr<ARDOUR::Playlist> initial_playlist;
398 };
399 
401 class RegionDrag : public EditorDrag, public sigc::trackable
402 {
403 public:
404  RegionDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain, bool hide_snapped_cursor = true);
405  virtual ~RegionDrag () {}
406 
407 protected:
408 
410  std::list<DraggingView> _views;
411 
413  std::vector<TimeAxisView*> _time_axis_views;
415  int apply_track_delta (const int start, const int delta, const int skip, const bool distance_only = false) const;
416 
419  uint32_t _ntracks;
420 
422 
423  friend class DraggingView;
424 
425 protected:
427 
428 private:
429 
432 };
433 
436 {
437 public:
438 
441 
442  virtual void start_grab (GdkEvent *, Gdk::Cursor *);
443  virtual void motion (GdkEvent *, bool);
444  virtual void finished (GdkEvent *, bool);
445  virtual void aborted (bool);
446 };
447 
450 {
451 public:
452  RegionBrushDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain td);
453  virtual ~RegionBrushDrag () {}
454 
455  virtual void start_grab (GdkEvent *, Gdk::Cursor *);
456  virtual void motion (GdkEvent *, bool);
457  virtual void finished (GdkEvent *, bool);
458  virtual void aborted (bool);
459 private:
460  typedef std::set<Temporal::timepos_t> TimePositionSet;
462 };
463 
466 {
467 public:
468 
469  RegionMotionDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain td);
470  virtual ~RegionMotionDrag () {}
471 
472  virtual void start_grab (GdkEvent *, Gdk::Cursor *);
473  virtual void motion (GdkEvent *, bool);
474  virtual void finished (GdkEvent *, bool);
475  virtual void aborted (bool);
476 
480  virtual bool regions_came_from_canvas () const = 0;
481 
482 protected:
483 
485  virtual bool y_movement_allowed (int, double, int skip_invisible = 0) const;
487 
493  std::vector<ArdourMarker*> ripple_markers;
494 
495 private:
496  uint32_t _ndropzone;
497  uint32_t _pdropzone;
498  uint32_t _ddropzone;
499 };
500 
501 
506 {
507 public:
508  RegionMoveDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, bool, Temporal::TimeDomain);
509  virtual ~RegionMoveDrag () {}
510 
511  void motion (GdkEvent *, bool);
512  void finished (GdkEvent *, bool);
513  void aborted (bool);
514 
516 
517  bool regions_came_from_canvas () const {
518  return true;
519  }
520 
521  std::pair<Temporal::timecnt_t,int> move_threshold () const {
522  return std::make_pair (Temporal::timecnt_t (4, Temporal::AudioTime), 4);
523  }
524 
526 
527 private:
529  bool const,
530  bool const,
531  Temporal::timepos_t const &,
532  int32_t const ev_state
533  );
534 
536  bool const,
537  bool const,
538  Temporal::timepos_t const &,
539  int32_t const ev_state
540  );
541 
543  std::shared_ptr<ARDOUR::Region>,
546  Temporal::timepos_t const &,
548  );
549 
551  std::shared_ptr<ARDOUR::Region>,
552  std::shared_ptr<ARDOUR::Playlist>,
553  ARDOUR::PlaylistSet& modified_playlists
554  );
555 
556 
558  RouteTimeAxisView* create_destination_time_axis (std::shared_ptr<ARDOUR::Region>, TimeAxisView* original);
559 
560  bool _copy;
562 };
563 
566 {
567 public:
568  RegionInsertDrag (Editor&, std::shared_ptr<ARDOUR::Region>, RouteTimeAxisView*, Temporal::timepos_t const &, Temporal::TimeDomain);
569 
570  void finished (GdkEvent *, bool);
571  void aborted (bool);
572 
573  bool regions_came_from_canvas () const {
574  return false;
575  }
576 };
577 
579 class RegionCutDrag : public EditorDrag
580 {
581 public:
584 
585  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
586  void motion (GdkEvent*, bool);
587  void finished (GdkEvent*, bool);
588  void aborted (bool);
589 };
590 
593 {
594 public:
596 
597  void motion (GdkEvent *, bool);
598  void finished (GdkEvent *, bool);
599  void aborted (bool);
600 
601 private:
603  std::shared_ptr<ARDOUR::Region> _region;
604 };
605 
607 class NoteResizeDrag : public Drag
608 {
609 public:
611 
612  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
613  void motion (GdkEvent *, bool);
614  void finished (GdkEvent *, bool);
615  void aborted (bool);
616 
618  return false;
619  }
620 
621 private:
623  bool relative;
624  bool at_front;
626  double _snap_delta;
627 };
628 
630 class NoteDrag : public Drag
631 {
632 public:
634 
635  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
636  void motion (GdkEvent *, bool);
637  void finished (GdkEvent *, bool);
638  void aborted (bool);
639 
641 
643  return false;
644  }
645 
646 private:
647 
648  Temporal::timecnt_t total_dx (GdkEvent * event) const; // total movement in quarter notes
649  int8_t total_dy () const;
650 
655  Temporal::timepos_t _earliest; // earliest note in note selection
657  double _note_height;
658  bool _copy;
659 };
660 
661 class NoteCreateDrag : public Drag
662 {
663 public:
666 
667  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
668  void motion (GdkEvent *, bool);
669  void finished (GdkEvent *, bool);
670  void aborted (bool);
671 
673  return mode == Editing::MouseDraw || mode == Editing::MouseContent;
674  }
675 
677  return false;
678  }
679 
680  bool y_movement_matters () const {
681  return false;
682  }
683 
684 private:
685  double y_to_region (double) const;
686  Temporal::Beats round_to_grid (Temporal::timepos_t const & pos, GdkEvent const * event) const;
687 
689  std::pair<Temporal::timecnt_t,int> move_threshold () const {
690  return std::make_pair (Temporal::timecnt_t (0, Temporal::AudioTime), 0);
691  }
692 
696 };
697 
698 class HitCreateDrag : public Drag
699 {
700 public:
703 
704  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
705  void motion (GdkEvent *, bool) {}
706  void finished (GdkEvent *, bool);
707  void aborted (bool) {}
708 
710  return mode == Editing::MouseDraw || mode == Editing::MouseContent;
711  }
712 
713  bool y_movement_matters () const {
714  return false;
715  }
716 
717 private:
718  double y_to_region (double) const;
719 
721  std::pair<Temporal::timecnt_t,int> move_threshold () const {
722  return std::make_pair (Temporal::timecnt_t::zero (Temporal::AudioTime), 0);
723  }
724 
727  double _y;
728 
729 };
730 
732 class PatchChangeDrag : public Drag
733 {
734 public:
736 
737  void motion (GdkEvent *, bool);
738  void finished (GdkEvent *, bool);
739  void aborted (bool);
740 
741  bool y_movement_matters () const {
742  return false;
743  }
744 
746  return false;
747  }
748 
750 
751 private:
755 };
756 
759 {
760 public:
762 
765 };
766 
769 {
770 public:
772 
773  void motion (GdkEvent *, bool);
774  void finished (GdkEvent *, bool);
775  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
776 
777  bool y_movement_matters () const {
778  return false;
779  }
780 
782  return false;
783  }
784 
785  void aborted (bool);
786 
787 protected:
788  std::list<AVDraggingView> _views;
789 
790 private:
793  bool _stuck;
794 };
795 
797 class TrimDrag : public RegionDrag
798 {
799 public:
800  enum Operation {
802  EndTrim
803  };
804 
805  TrimDrag (Editor&, ArdourCanvas::Item *, RegionView*, std::list<RegionView*> const &, Temporal::TimeDomain td, bool preserve_fade_anchor = false);
806 
807  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
808  void motion (GdkEvent *, bool);
809  void finished (GdkEvent *, bool);
810  void aborted (bool);
811 
812  bool y_movement_matters () const {
813  return false;
814  }
815 
817  return false;
818  }
819 
821 
822 private:
823 
825 
828 
829  std::vector<RegionView::DisplaySuspender> suspenders;
830 };
831 
834 {
835 public:
837 
838  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
839  void motion (GdkEvent *, bool);
840  void finished (GdkEvent *, bool);
841  void aborted (bool);
842 
844  return false;
845  }
846 
847  bool y_movement_matters () const {
848  return false;
849  }
850 
852 
853 private:
857 
858  bool _movable;
862 };
863 
866 {
867 public:
869 
870  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
871  void motion (GdkEvent *, bool);
872  void finished (GdkEvent *, bool);
873  void aborted (bool);
874 
875 private:
877  double initial_bpm;
880 };
881 
884 {
885 public:
887 
888  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
889  void motion (GdkEvent *, bool);
890  void finished (GdkEvent *, bool);
891  void aborted (bool);
892 
894  return false;
895  }
896 
897  bool y_movement_matters () const {
898  return true;
899  }
900 
902 
903 private:
907 
908  bool _movable;
909  double _grab_bpm;
912 };
913 
915 class BBTMarkerDrag : public EditorDrag
916 {
917 public:
919 
920  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
921  void motion (GdkEvent *, bool);
922  void finished (GdkEvent *, bool);
923  void aborted (bool);
924 
926  return false;
927  }
928 
929  bool y_movement_matters () const {
930  return false;
931  }
932 
934 
935 private:
939 
941 };
942 
944 {
945 public:
947 
948  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
949  void motion (GdkEvent *, bool);
950  void finished (GdkEvent *, bool);
951  void aborted (bool);
952 
954  return false;
955  }
956 
958  return false;
959  }
960 
961  bool y_movement_matters () const {
962  return false;
963  }
964 
966 
967 private:
970  double _grab_bpm;
972 
975 };
976 
978 {
979 public:
984  XMLNode&,
985  bool ramped);
986 
987  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
988  void motion (GdkEvent *, bool);
989  void finished (GdkEvent *, bool);
990  void aborted (bool);
991 
993  return false;
994  }
995 
997  return false;
998  }
999 
1000  bool y_movement_matters () const {
1001  return false;
1002  }
1003 
1005 
1006 private:
1011 
1012  double direction;
1013  double delta;
1016 
1019  bool _do_ramp;
1020 };
1021 
1022 
1025 {
1026 public:
1028 
1029  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1030  void motion (GdkEvent *, bool);
1031  void finished (GdkEvent *, bool);
1032  void aborted (bool);
1033 
1035  return false;
1036  }
1037 
1038  bool y_movement_matters () const {
1039  return true;
1040  }
1041 
1043 
1044 private:
1051 };
1052 
1054 class TempoEndDrag : public EditorDrag
1055 {
1056 public:
1058 
1059  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1060  void motion (GdkEvent *, bool);
1061  void finished (GdkEvent *, bool);
1062  void aborted (bool);
1063 
1065  return false;
1066  }
1067 
1068  bool y_movement_matters () const {
1069  return true;
1070  }
1071 
1073 
1074 private:
1079 
1082 };
1083 
1085 class CursorDrag : public EditorDrag
1086 {
1087 public:
1089 
1090  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1091  void motion (GdkEvent *, bool);
1092  void finished (GdkEvent *, bool);
1093  void aborted (bool);
1094 
1096  return false;
1097  }
1098 
1099  bool y_movement_matters () const {
1100  return true;
1101  }
1102 
1103 private:
1105 
1107  bool _stop;
1108  double _grab_zoom;
1109 
1110  //used for zooming
1115 };
1116 
1118 class FadeInDrag : public RegionDrag
1119 {
1120 public:
1121  FadeInDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain);
1122 
1123  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1124  void motion (GdkEvent *, bool);
1125  void finished (GdkEvent *, bool);
1126  void aborted (bool);
1127 
1128  bool y_movement_matters () const {
1129  return false;
1130  }
1131 
1133  return false;
1134  }
1135 
1137 };
1138 
1140 class FadeOutDrag : public RegionDrag
1141 {
1142 public:
1143  FadeOutDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain td);
1144 
1145  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1146  void motion (GdkEvent *, bool);
1147  void finished (GdkEvent *, bool);
1148  void aborted (bool);
1149 
1150  bool y_movement_matters () const {
1151  return false;
1152  }
1153 
1155  return false;
1156  }
1157 
1159 };
1160 
1162 class MarkerDrag : public EditorDrag
1163 {
1164 public:
1167 
1168  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1169  void motion (GdkEvent *, bool);
1170  void finished (GdkEvent *, bool);
1171  void aborted (bool);
1172 
1174  return false;
1175  }
1176 
1177  bool y_movement_matters () const {
1178  return false;
1179  }
1180 
1183 
1184 private:
1186 
1191  std::vector<ArdourMarker*> markers;
1194  };
1195 
1196  std::vector<ARDOUR::Location::ChangeSuspender> lcs;
1197 
1198  typedef std::list<CopiedLocationMarkerInfo> CopiedLocationInfo;
1201 };
1202 
1204 class ControlPointDrag : public Drag
1205 {
1206 public:
1208 
1209  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1210  void motion (GdkEvent *, bool);
1211  void finished (GdkEvent *, bool);
1212  void aborted (bool);
1213 
1215 
1217  return false;
1218  }
1219 
1220 
1221 private:
1222 
1227  bool _pushing;
1228  uint32_t _final_index;
1229  static double _zero_gain_fraction;
1230 
1232 };
1233 
1235 class LineDrag : public Drag
1236 {
1237 public:
1238  LineDrag (EditingContext &e, ArdourCanvas::Item *i, std::function<void(GdkEvent*,Temporal::timepos_t const &,double)>);
1240 
1241  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1242  void motion (GdkEvent *, bool);
1243  void finished (GdkEvent *, bool);
1244  void aborted (bool);
1245 
1247  return false;
1248  }
1249 
1250 private:
1251 
1256  uint32_t _before;
1257  uint32_t _after;
1259  std::function<void(GdkEvent*,Temporal::timepos_t const &,double)> click_functor;
1260 };
1261 
1263 class FeatureLineDrag : public Drag
1264 {
1265 public:
1267 
1268  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1269  void motion (GdkEvent *, bool);
1270  void finished (GdkEvent *, bool);
1271  void aborted (bool);
1272 
1273 private:
1274 
1277 
1280 
1281  float _before;
1282  uint32_t _max_x;
1283 };
1284 
1287 {
1288 public:
1290 
1291  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1292  void motion (GdkEvent *, bool);
1293  void finished (GdkEvent *, bool);
1294  void aborted (bool);
1295 
1296  std::pair<Temporal::timecnt_t,int> move_threshold () const {
1297  return std::make_pair (Temporal::timecnt_t (8, Temporal::AudioTime), 1);
1298  }
1299 
1300  void do_select_things (GdkEvent *, bool);
1301 
1310  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);
1311  virtual void deselect_things ();
1312 
1313  protected:
1315  std::function<bool(GdkEvent*,Temporal::timepos_t const &)> click_functor;
1316 };
1317 
1320 {
1321  public:
1323 
1324  void select_things (int, Temporal::timepos_t const &, Temporal::timepos_t const &, double, double, bool);
1326 
1327  private:
1329 };
1330 
1333 {
1334 public:
1336 
1337  void select_things (int, Temporal::timepos_t const &, Temporal::timepos_t const &, double, double, bool);
1339 
1340 private:
1342 };
1343 
1345 class TimeFXDrag : public RegionDrag
1346 {
1347 public:
1348  TimeFXDrag (Editor&, ArdourCanvas::Item *, RegionView *, std::list<RegionView*> const &, Temporal::TimeDomain td);
1349 
1350  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1351  void motion (GdkEvent *, bool);
1352  void finished (GdkEvent *, bool);
1353  void aborted (bool);
1354 private:
1356 };
1357 
1360 {
1361 public:
1362  enum Operation {
1368  };
1369 
1371 
1372  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1373  void motion (GdkEvent *, bool);
1374  void finished (GdkEvent *, bool);
1375  void aborted (bool);
1376 
1378 
1379 private:
1381  bool _add;
1386 };
1387 
1390 {
1391 public:
1393 
1395  void motion (GdkEvent*, bool);
1396  void finished (GdkEvent *, bool);
1397  void aborted (bool);
1398 
1399 private:
1403 };
1404 
1407 {
1408 public:
1409  enum Operation {
1414  };
1415 
1418 
1419  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1420  void motion (GdkEvent *, bool);
1421  void finished (GdkEvent *, bool);
1422  void aborted (bool);
1423 
1425  return false;
1426  }
1427 
1428  bool y_movement_matters () const {
1429  return false;
1430  }
1431 
1432 private:
1434 
1437  bool _copy;
1438 };
1439 
1442 {
1443 public:
1445 
1446  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1447  void motion (GdkEvent *, bool);
1448  void finished (GdkEvent *, bool);
1449  void aborted (bool);
1450 
1451  std::pair<Temporal::timecnt_t,int> move_threshold () const {
1452  return std::make_pair (Temporal::timecnt_t (4, Temporal::AudioTime), 4);
1453  }
1454 
1455 private:
1457 };
1458 
1463 {
1464 public:
1465  AutomationRangeDrag (EditingContext&, AutomationTimeAxisView *, float initial_value, std::list<ARDOUR::TimelineRange> const &);
1466  AutomationRangeDrag (EditingContext&, std::list<RegionView*> const &, std::list<ARDOUR::TimelineRange> const &, double y_origin, double y_height);
1467 
1468  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1469  void motion (GdkEvent *, bool);
1470  void finished (GdkEvent *, bool);
1471  void aborted (bool);
1472 
1473  bool x_movement_matters () const {
1474  return false;
1475  }
1476 
1477 private:
1478  void setup (std::list<std::shared_ptr<AutomationLine> > const &);
1479  double y_fraction (double global_y_position) const;
1480  double value (std::shared_ptr<ARDOUR::AutomationList> list, Temporal::timepos_t const & x) const;
1481 
1482  std::list<ARDOUR::TimelineRange> _ranges;
1483 
1485  struct Line {
1486  std::shared_ptr<AutomationLine> line;
1487  std::list<ControlPoint*> points;
1488  std::pair<Temporal::timepos_t, Temporal::timepos_t> range;
1490  };
1491 
1492  std::list<Line> _lines;
1493  double _y_origin;
1494  double _y_height;
1498 };
1499 
1502 class CrossfadeEdgeDrag : public Drag
1503 {
1504 public:
1506 
1508  void motion (GdkEvent*, bool);
1509  void finished (GdkEvent*, bool);
1510  void aborted (bool);
1511 
1512  bool y_movement_matters () const {
1513  return false;
1514  }
1515 
1516  std::pair<Temporal::timecnt_t,int> move_threshold () const {
1517  return std::make_pair (Temporal::timecnt_t (4, Temporal::AudioTime), 4);
1518  }
1519 
1520 private:
1522  bool start;
1523 };
1524 
1525 class RegionMarkerDrag : public Drag
1526 {
1527  public:
1530 
1531  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1532  void motion (GdkEvent *, bool);
1533  void finished (GdkEvent *, bool);
1534  void aborted (bool);
1535 
1537  return false;
1538  }
1539 
1540  bool y_movement_matters () const {
1541  return false;
1542  }
1543 
1545 
1546  private:
1551 };
1552 
1553 
1554 class LollipopDrag : public Drag
1555 {
1556  public:
1559 
1560  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1561  void motion (GdkEvent *, bool);
1562  void finished (GdkEvent *, bool);
1563  void aborted (bool);
1564 
1566  return false;
1567  }
1568 
1570  return false;
1571  }
1572 
1573  bool x_movement_matters () const {
1574  return false;
1575  }
1576 
1578 
1579  private:
1582 };
1583 
1584 template<typename OrderedPointList, typename OrderedPoint>
1585 class FreehandLineDrag : public Drag
1586 {
1587  public:
1590 
1591  void motion (GdkEvent*, bool);
1592  void finished (GdkEvent*, bool);
1594  virtual void point_added (ArdourCanvas::Duple const & d, ArdourCanvas::Rectangle const & r, double last_x) {}
1595  virtual void line_extended (ArdourCanvas::Duple const & from, ArdourCanvas::Duple const & to, ArdourCanvas::Rectangle const & r, double last_x) {
1596  point_added (to, r, last_x);
1597  }
1598 
1599  protected:
1600  ArdourCanvas::Item* parent; /* we do not own this. If null, use base_rect as the parent */
1601  ArdourCanvas::Rectangle& base_rect; /* we do not own this */
1605  int edge_x;
1606  bool did_snap;
1608  OrderedPointList drawn_points;
1611 
1612  void maybe_add_point (GdkEvent*, Temporal::timepos_t const &, bool first_move);
1613 };
1614 
1615 class AutomationDrawDrag : public FreehandLineDrag<Evoral::ControlList::OrderedPoints, Evoral::ControlList::OrderedPoint>
1616 {
1617  public:
1620 
1621  void finished (GdkEvent*, bool);
1622  void aborted (bool) {}
1623 };
1624 
1625 class VelocityLineDrag : public FreehandLineDrag<Evoral::ControlList::OrderedPoints, Evoral::ControlList::OrderedPoint>
1626 {
1627  public:
1630 
1631  void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
1632  void finished (GdkEvent*, bool);
1633  void aborted (bool);
1634  void point_added (ArdourCanvas::Duple const & d, ArdourCanvas::Rectangle const & r, double last_x);
1635  void line_extended (ArdourCanvas::Duple const & from, ArdourCanvas::Duple const & to, ArdourCanvas::Rectangle const & r, double last_x);
1636 
1637  private:
1640 };
1641 
1642 class ClipStartDrag : public Drag
1643 {
1644  public:
1647 
1650  void motion (GdkEvent*, bool);
1651  void finished (GdkEvent*, bool);
1652  void aborted (bool);
1653 
1654  private:
1658 };
1659 
1660 class ClipEndDrag : public Drag
1661 {
1662  public:
1665 
1668  void motion (GdkEvent*, bool);
1669  void finished (GdkEvent*, bool);
1670  void aborted (bool);
1671 
1672  private:
1676 };
1677 
1678 #endif /* __gtk2_ardour_editor_drag_h_ */
AVDraggingView(RegionView *)
samplepos_t initial_position
initial position of the region
Definition: editor_drag.h:764
RegionView * view
the view
Definition: editor_drag.h:763
void aborted(bool)
Definition: editor_drag.h:1622
void finished(GdkEvent *, bool)
AutomationDrawDrag(EditingContext &, ArdourCanvas::Item *, ArdourCanvas::Rectangle &, bool, Temporal::TimeDomain)
std::list< ARDOUR::TimelineRange > _ranges
Definition: editor_drag.h:1482
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:1492
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:1473
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:940
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:938
bool y_movement_matters() const
Definition: editor_drag.h:929
BBTMarkerDrag(Editor &, ArdourCanvas::Item *)
void aborted(bool)
BBTMarker * _marker
Definition: editor_drag.h:936
void finished(GdkEvent *, bool)
void motion(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:925
Temporal::MusicTimePoint const * _point
Definition: editor_drag.h:937
void start_grab(GdkEvent *, Gdk::Cursor *)
void aborted(bool)
void finished(GdkEvent *, bool)
MidiCueEditor & mce
Definition: editor_drag.h:1673
ArdourCanvas::Rectangle * dragging_rect
Definition: editor_drag.h:1674
void motion(GdkEvent *, bool)
bool end_grab(GdkEvent *)
ArdourCanvas::Rect original_rect
Definition: editor_drag.h:1675
ClipEndDrag(EditingContext &, ArdourCanvas::Rectangle &, MidiCueEditor &m)
void aborted(bool)
bool end_grab(GdkEvent *)
ArdourCanvas::Rect original_rect
Definition: editor_drag.h:1657
void motion(GdkEvent *, bool)
void finished(GdkEvent *, bool)
ClipStartDrag(EditingContext &, ArdourCanvas::Rectangle &, MidiCueEditor &m)
void start_grab(GdkEvent *, Gdk::Cursor *)
ArdourCanvas::Rectangle * dragging_rect
Definition: editor_drag.h:1656
MidiCueEditor & mce
Definition: editor_drag.h:1655
uint32_t _final_index
Definition: editor_drag.h:1228
void motion(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1216
Temporal::timecnt_t total_dt(GdkEvent *) const
bool active(Editing::MouseMode m)
ControlPoint * _point
Definition: editor_drag.h:1223
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:1229
double _cumulative_y_drag
Definition: editor_drag.h:1226
AudioRegionView * arv
Definition: editor_drag.h:1521
std::pair< Temporal::timecnt_t, int > move_threshold() const
Definition: editor_drag.h:1516
bool y_movement_matters() const
Definition: editor_drag.h:1512
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:1108
int _last_y_delta
Definition: editor_drag.h:1114
CursorDrag(Editor &, EditorCursor &, bool)
bool _stop
true to stop the transport on starting the drag, otherwise false
Definition: editor_drag.h:1107
EditorCursor & _cursor
Definition: editor_drag.h:1106
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1095
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:1099
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
std::pair< Temporal::timecnt_t, int > move_threshold() const
Definition: editor_drag.h:225
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:344
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:358
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:348
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:343
void set_manager(DragManager *m)
Definition: editor_drag.h:159
bool _move_threshold_passed
true if the move threshold has been passed, otherwise false
Definition: editor_drag.h:338
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:341
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:340
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
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
Temporal::timecnt_t _snap_delta
Definition: editor_drag.h:354
bool motion_handler(GdkEvent *, bool)
double _last_pointer_y
trackview y of the pointer last time a motion occurred
Definition: editor_drag.h:345
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:356
bool _hide_snapped_cursor
set true of Drag::motion does not call set_snapped_cursor_position
Definition: editor_drag.h:337
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:346
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:336
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:339
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:342
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:355
Temporal::TimeDomain _time_domain
Definition: editor_drag.h:349
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:347
samplepos_t anchored_fade_length
fade_length when anchored during drag
Definition: editor_drag.h:395
RegionView * view
the view
Definition: editor_drag.h:382
double layer
Definition: editor_drag.h:391
std::shared_ptr< ARDOUR::Playlist > initial_playlist
Definition: editor_drag.h:396
DraggingView(RegionView *, RegionDrag *, TimeAxisView *original_tav)
Temporal::timepos_t initial_position
initial position of the region
Definition: editor_drag.h:393
TimeAxisView * initial_time_axis_view
Definition: editor_drag.h:397
double initial_y
the initial y position of the view before any reparenting
Definition: editor_drag.h:392
int time_axis_view
Definition: editor_drag.h:386
Temporal::timepos_t initial_end
initial end position of the region
Definition: editor_drag.h:394
EditorDrag(Editor &, ArdourCanvas::Item *, Temporal::TimeDomain td, ArdourCanvas::Item const *bounding_item, bool hide_snapped_cursor=true)
Editor & _editor
Definition: editor_drag.h:371
Definition: editor.h:158
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1132
void setup_pointer_offset()
void aborted(bool)
void motion(GdkEvent *, bool)
bool y_movement_matters() const
Definition: editor_drag.h:1128
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:1150
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1154
void setup_pointer_offset()
void motion(GdkEvent *, bool)
void finished(GdkEvent *, bool)
ArdourCanvas::Line * _line
Definition: editor_drag.h:1275
double _cumulative_x_drag
Definition: editor_drag.h:1279
double _region_view_grab_x
Definition: editor_drag.h:1278
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:1276
FeatureLineDrag(Editor &e, ArdourCanvas::Item *i)
ArdourCanvas::Coord line_start_y
Definition: editor_drag.h:1610
virtual void point_added(ArdourCanvas::Duple const &d, ArdourCanvas::Rectangle const &r, double last_x)
Definition: editor_drag.h:1594
void maybe_add_point(GdkEvent *, Temporal::timepos_t const &, bool first_move)
ArdourCanvas::Item * parent
Definition: editor_drag.h:1600
ArdourCanvas::Rectangle & base_rect
Definition: editor_drag.h:1601
ArdourCanvas::Coord line_start_x
Definition: editor_drag.h:1609
ArdourCanvas::PolyLine * dragging_line
Definition: editor_drag.h:1602
virtual void line_extended(ArdourCanvas::Duple const &from, ArdourCanvas::Duple const &to, ArdourCanvas::Rectangle const &r, double last_x)
Definition: editor_drag.h:1595
void finished(GdkEvent *, bool)
OrderedPointList drawn_points
Definition: editor_drag.h:1608
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:705
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Temporal::timepos_t _last_pos
Definition: editor_drag.h:726
void finished(GdkEvent *, bool)
std::pair< Temporal::timecnt_t, int > move_threshold() const
Definition: editor_drag.h:721
MidiView * _midi_view
Definition: editor_drag.h:725
double y_to_region(double) const
bool y_movement_matters() const
Definition: editor_drag.h:713
void aborted(bool)
Definition: editor_drag.h:707
bool active(Editing::MouseMode mode)
Definition: editor_drag.h:709
void aborted(bool)
bool have_command
Definition: editor_drag.h:1258
std::function< void(GdkEvent *, Temporal::timepos_t const &, double)> click_functor
Definition: editor_drag.h:1259
uint32_t _before
Definition: editor_drag.h:1256
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
double _fixed_grab_x
Definition: editor_drag.h:1253
double _cumulative_y_drag
Definition: editor_drag.h:1255
AutomationLine * _line
Definition: editor_drag.h:1252
uint32_t _after
Definition: editor_drag.h:1257
void finished(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1246
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:1254
ArdourCanvas::Lollipop * _primary
Definition: editor_drag.h:1581
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:1580
bool allow_horizontal_autoscroll() const
Definition: editor_drag.h:1569
bool x_movement_matters() const
Definition: editor_drag.h:1573
void motion(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1565
void finished(GdkEvent *, bool)
double _grab_bpm
Definition: editor_drag.h:970
bool y_movement_matters() const
Definition: editor_drag.h:961
void setup_pointer_offset()
void finished(GdkEvent *, bool)
void motion(GdkEvent *, bool)
XMLNode * _before_state
Definition: editor_drag.h:973
MappingEndDrag(Editor &, ArdourCanvas::Item *, Temporal::TempoMap::WritableSharedPtr &, Temporal::TempoPoint &, Temporal::TempoPoint &after, XMLNode &before_state)
Temporal::TempoPoint & _tempo
Definition: editor_drag.h:968
bool allow_horizontal_autoscroll() const
Definition: editor_drag.h:957
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:953
void aborted(bool)
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:971
Temporal::TempoPoint & _after
Definition: editor_drag.h:969
void motion(GdkEvent *, bool)
bool y_movement_matters() const
Definition: editor_drag.h:1000
bool allow_horizontal_autoscroll() const
Definition: editor_drag.h:996
double initial_focus_npm
Definition: editor_drag.h:1014
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:1008
Temporal::TempoPoint & prev
Definition: editor_drag.h:1007
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:992
Temporal::TempoPoint & next
Definition: editor_drag.h:1009
void setup_pointer_offset()
XMLNode * _before_state
Definition: editor_drag.h:1017
double initial_pre_npm
Definition: editor_drag.h:1015
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:1010
void aborted(bool)
void finished(GdkEvent *, bool)
void aborted(bool)
bool _selection_changed
Definition: editor_drag.h:1188
std::list< CopiedLocationMarkerInfo > CopiedLocationInfo
Definition: editor_drag.h:1198
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
bool y_movement_matters() const
Definition: editor_drag.h:1177
void finished(GdkEvent *, bool)
MarkerDrag(Editor &, ArdourCanvas::Item *)
ArdourCanvas::Points _points
Definition: editor_drag.h:1200
CopiedLocationInfo _copied_locations
Definition: editor_drag.h:1199
std::vector< ARDOUR::Location::ChangeSuspender > lcs
Definition: editor_drag.h:1196
void setup_pointer_offset()
void update_item(ARDOUR::Location *)
ArdourMarker * _marker
marker being dragged
Definition: editor_drag.h:1187
void motion(GdkEvent *, bool)
void setup_video_offset()
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1173
void finished(GdkEvent *, bool)
Temporal::superclock_t initial_sclock
Definition: editor_drag.h:856
void setup_pointer_offset()
void aborted(bool)
Editing::GridType _old_grid_type
Definition: editor_drag.h:859
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Editing::SnapMode _old_snap_mode
Definition: editor_drag.h:860
MeterMarkerDrag(Editor &, ArdourCanvas::Item *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:843
MeterMarker * _marker
Definition: editor_drag.h:854
void motion(GdkEvent *, bool)
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:855
bool y_movement_matters() const
Definition: editor_drag.h:847
XMLNode * before_state
Definition: editor_drag.h:861
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 *)
std::pair< Temporal::timecnt_t, int > move_threshold() const
Definition: editor_drag.h:1451
void finished(GdkEvent *, bool)
void aborted(bool)
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void motion(GdkEvent *, bool)
std::pair< Temporal::timecnt_t, int > move_threshold() const
Definition: editor_drag.h:689
NoteCreateDrag(EditingContext &, ArdourCanvas::Item *, MidiView *)
void aborted(bool)
MidiView * _midi_view
Definition: editor_drag.h:693
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:676
Temporal::timepos_t _note[2]
Definition: editor_drag.h:695
bool active(Editing::MouseMode mode)
Definition: editor_drag.h:672
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:680
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:694
MidiView * _region
Definition: editor_drag.h:651
double _note_height
Definition: editor_drag.h:657
NoteBase * _primary
Definition: editor_drag.h:652
double _cumulative_dy
Definition: editor_drag.h:654
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 *)
Temporal::timecnt_t _cumulative_dx
Definition: editor_drag.h:653
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:642
bool _copy
Definition: editor_drag.h:658
void finished(GdkEvent *, bool)
Temporal::timepos_t _earliest
Definition: editor_drag.h:655
bool _was_selected
Definition: editor_drag.h:656
void motion(GdkEvent *, bool)
NoteResizeDrag(EditingContext &, ArdourCanvas::Item *)
void finished(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:617
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
MidiView * region
Definition: editor_drag.h:622
double _snap_delta
Definition: editor_drag.h:626
void aborted(bool)
void motion(GdkEvent *, bool)
void finished(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:745
PatchChangeDrag(EditingContext &, PatchChange *, MidiView *)
PatchChange * _patch_change
Definition: editor_drag.h:753
MidiView * _region_view
Definition: editor_drag.h:752
double _cumulative_dx
Definition: editor_drag.h:754
void aborted(bool)
void motion(GdkEvent *, bool)
void setup_pointer_offset()
bool y_movement_matters() const
Definition: editor_drag.h:741
ArdourCanvas::Rectangle * _drag_rect
Definition: editor_drag.h:1436
void motion(GdkEvent *, bool)
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Operation _operation
Definition: editor_drag.h:1435
void aborted(bool)
RangeMarkerBarDrag(Editor &, ArdourCanvas::Item *, Operation)
void update_item(ARDOUR::Location *)
bool y_movement_matters() const
Definition: editor_drag.h:1428
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1424
void finished(GdkEvent *, bool)
std::set< Temporal::timepos_t > TimePositionSet
Definition: editor_drag.h:460
virtual void finished(GdkEvent *, bool)
virtual void aborted(bool)
TimePositionSet _already_pasted
Definition: editor_drag.h:461
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:453
MidiTimeAxisView * _view
Definition: editor_drag.h:602
void finished(GdkEvent *, bool)
RegionCreateDrag(Editor &, ArdourCanvas::Item *, TimeAxisView *)
void aborted(bool)
std::shared_ptr< ARDOUR::Region > _region
Definition: editor_drag.h:603
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:405
uint32_t _ntracks
Definition: editor_drag.h:419
RegionView * _primary
the view that was clicked on (or whatever) to start the drag
Definition: editor_drag.h:409
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:418
std::list< DraggingView > _views
information about all views that are being dragged
Definition: editor_drag.h:410
PBD::ScopedConnection death_connection
Definition: editor_drag.h:431
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:413
int _visible_y_low
Definition: editor_drag.h:417
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:573
void aborted(bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1536
void aborted(bool)
ARDOUR::CueMarker model
Definition: editor_drag.h:1549
ARDOUR::CueMarker dragging_model
Definition: editor_drag.h:1550
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void finished(GdkEvent *, bool)
void setup_pointer_offset()
ArdourMarker * view
Definition: editor_drag.h:1548
bool y_movement_matters() const
Definition: editor_drag.h:1540
void motion(GdkEvent *, bool)
RegionMarkerDrag(Editor &, RegionView *, ArdourCanvas::Item *)
RegionView * rv
Definition: editor_drag.h:1547
uint32_t _ddropzone
Definition: editor_drag.h:498
virtual bool y_movement_allowed(int, double, int skip_invisible=0) const
uint32_t _ndropzone
Definition: editor_drag.h:496
uint32_t _pdropzone
Definition: editor_drag.h:497
std::vector< ArdourMarker * > ripple_markers
Definition: editor_drag.h:493
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:489
virtual bool regions_came_from_canvas() const =0
virtual ~RegionMotionDrag()
Definition: editor_drag.h:470
double _last_pointer_layer
Definition: editor_drag.h:492
double _total_x_delta
Definition: editor_drag.h:490
virtual void aborted(bool)
int _last_pointer_time_axis_view
Definition: editor_drag.h:491
void aborted(bool)
RegionView * _new_region_view
Definition: editor_drag.h:561
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:517
std::pair< Temporal::timecnt_t, int > move_threshold() const
Definition: editor_drag.h:521
RegionView * insert_region_into_playlist(std::shared_ptr< ARDOUR::Region >, RouteTimeAxisView *, ARDOUR::layer_t, Temporal::timepos_t const &, ARDOUR::PlaylistSet &)
void finished(GdkEvent *, bool)
void clear_draggingview_list()
void setup_pointer_offset()
RegionMoveDrag(Editor &, ArdourCanvas::Item *, RegionView *, std::list< RegionView * > const &, bool, Temporal::TimeDomain)
void motion(GdkEvent *, bool)
void finished_no_copy(bool const, bool const, Temporal::timepos_t const &, int32_t const ev_state)
void collect_new_region_view(RegionView *)
virtual ~RegionMoveDrag()
Definition: editor_drag.h:509
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:440
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:1315
std::pair< Temporal::timecnt_t, int > move_threshold() const
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:1382
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void setup_pointer_offset()
bool _time_selection_at_start
Definition: editor_drag.h:1383
void aborted(bool)
Temporal::timepos_t end_at_start
Definition: editor_drag.h:1385
Temporal::timepos_t start_at_start
Definition: editor_drag.h:1384
Operation _operation
Definition: editor_drag.h:1380
void motion(GdkEvent *, bool)
Temporal::timepos_t _end_at_start
Definition: editor_drag.h:1402
void finished(GdkEvent *, bool)
SelectionMarkerDrag(Editor &, ArdourCanvas::Item *)
void motion(GdkEvent *, bool)
Temporal::timepos_t _start_at_start
Definition: editor_drag.h:1401
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:876
XMLNode * _before_state
Definition: editor_drag.h:879
void motion(GdkEvent *, bool)
TempoCurveDrag(Editor &, ArdourCanvas::Item *)
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:878
double initial_bpm
Definition: editor_drag.h:877
bool y_movement_matters() const
Definition: editor_drag.h:1068
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1064
XMLNode * _before_state
Definition: editor_drag.h:1080
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:1078
void aborted(bool)
Temporal::Beats _grab_qn
Definition: editor_drag.h:1075
void motion(GdkEvent *, bool)
Temporal::TempoPoint * previous_tempo
Definition: editor_drag.h:1077
TempoEndDrag(Editor &, ArdourCanvas::Item *)
void setup_pointer_offset()
void finished(GdkEvent *, bool)
Temporal::TempoPoint * _tempo
Definition: editor_drag.h:1076
TempoMarker * _marker
Definition: editor_drag.h:904
XMLNode * _before_state
Definition: editor_drag.h:911
void motion(GdkEvent *, bool)
void setup_pointer_offset()
Temporal::TempoPoint const * _real_section
Definition: editor_drag.h:905
void aborted(bool)
TempoMarkerDrag(Editor &, ArdourCanvas::Item *)
void finished(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:893
bool y_movement_matters() const
Definition: editor_drag.h:897
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
Temporal::Beats _grab_qn
Definition: editor_drag.h:910
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:906
Temporal::Beats _grab_qn
Definition: editor_drag.h:1045
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
void setup_pointer_offset()
void finished(GdkEvent *, bool)
XMLNode * _before_state
Definition: editor_drag.h:1050
void motion(GdkEvent *, bool)
void aborted(bool)
bool y_movement_matters() const
Definition: editor_drag.h:1038
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:1034
Temporal::TempoMap::WritableSharedPtr map
Definition: editor_drag.h:1048
TempoTwistDrag(Editor &, ArdourCanvas::Item *)
Temporal::TempoPoint const * _next_tempo
Definition: editor_drag.h:1047
Temporal::TempoPoint * _tempo
Definition: editor_drag.h:1046
std::shared_ptr< TempoMap > WritableSharedPtr
static timecnt_t zero(TimeDomain td)
Definition: timeline.h:325
int64_t samples() const
Definition: timeline.h:90
void finished(GdkEvent *, bool)
bool _dragging_start
Definition: editor_drag.h:1355
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:816
bool _preserve_fade_anchor
Definition: editor_drag.h:826
bool _jump_position_when_done
Definition: editor_drag.h:827
Operation _operation
Definition: editor_drag.h:824
bool y_movement_matters() const
Definition: editor_drag.h:812
std::vector< RegionView::DisplaySuspender > suspenders
Definition: editor_drag.h:829
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:1638
void aborted(bool)
void finished(GdkEvent *, bool)
bool allow_vertical_autoscroll() const
Definition: editor_drag.h:781
bool y_movement_matters() const
Definition: editor_drag.h:777
std::list< AVDraggingView > _views
information about all audio that are being dragged along
Definition: editor_drag.h:788
void start_grab(GdkEvent *, Gdk::Cursor *c=0)
ARDOUR::sampleoffset_t _startdrag_video_offset
Definition: editor_drag.h:791
VideoTimeLineDrag(Editor &e, ArdourCanvas::Item *i)
ARDOUR::sampleoffset_t _max_backwards_drag
Definition: editor_drag.h:792
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:70
GridType
Definition: editing.h:52
MouseMode
Definition: editing.h:98
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:1487
std::pair< Temporal::timepos_t, Temporal::timepos_t > range
the range of all points on the line, in session time
Definition: editor_drag.h:1488
std::shared_ptr< AutomationLine > line
the line
Definition: editor_drag.h:1486
XMLNode * state
the XML state node before the drag
Definition: editor_drag.h:1489
std::vector< ArdourMarker * > markers
Definition: editor_drag.h:1191
CopiedLocationMarkerInfo(ARDOUR::Location *l, ArdourMarker *m)