X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Feditor_drag.h;h=3cfb38d02029d38e6e4569a9298be8b822f90a35;hb=bcd65def7da197a6f88eb1c4adb375f2b639f783;hp=e3e4b5e665cf2ec48d8bfa7ad2910e5b464ccda6;hpb=30237aad7f8e56bc97af4f74812e92e76c924258;p=ardour.git diff --git a/gtk2_ardour/editor_drag.h b/gtk2_ardour/editor_drag.h index e3e4b5e665..3cfb38d020 100644 --- a/gtk2_ardour/editor_drag.h +++ b/gtk2_ardour/editor_drag.h @@ -27,7 +27,6 @@ #include "ardour/types.h" -#include "canvas.h" #include "editor_items.h" namespace ARDOUR { @@ -38,18 +37,13 @@ namespace PBD { class StatefulDiffCommand; } -namespace Gnome { - namespace Canvas { - class CanvasNoteEvent; - class CanvasPatchChange; - } -} - +class PatchChange; class Editor; class EditorCursor; class TimeAxisView; class MidiTimeAxisView; class Drag; +class NoteBase; /** Class to manage current drags */ class DragManager @@ -456,7 +450,7 @@ class NoteDrag : public Drag int8_t total_dy () const; MidiRegionView* _region; - Gnome::Canvas::CanvasNoteEvent* _primary; + NoteBase* _primary; double _cumulative_dx; double _cumulative_dy; bool _was_selected; @@ -479,7 +473,7 @@ private: framecnt_t grid_frames (framepos_t) const; MidiRegionView* _region_view; - ArdourCanvas::SimpleRect* _drag_rect; + ArdourCanvas::Rectangle* _drag_rect; framepos_t _note[2]; }; @@ -487,7 +481,7 @@ private: class PatchChangeDrag : public Drag { public: - PatchChangeDrag (Editor *, ArdourCanvas::CanvasPatchChange *, MidiRegionView *); + PatchChangeDrag (Editor *, PatchChange *, MidiRegionView *); void motion (GdkEvent *, bool); void finished (GdkEvent *, bool); @@ -501,10 +495,51 @@ public: private: MidiRegionView* _region_view; - ArdourCanvas::CanvasPatchChange* _patch_change; + PatchChange* _patch_change; double _cumulative_dx; }; +#ifdef WITH_VIDEOTIMELINE +/** Container for details about audio regions being dragged along with video */ +class AVDraggingView +{ +public: + AVDraggingView (RegionView *); + + RegionView* view; ///< the view + framepos_t initial_position; ///< initial position of the region +}; + +/** Drag of video offset */ +class VideoTimeLineDrag : public Drag + //TODO , public sigc::trackable +{ +public: + VideoTimeLineDrag (Editor *e, ArdourCanvas::Item *i); + + void motion (GdkEvent *, bool); + void finished (GdkEvent *, bool); + void start_grab (GdkEvent *, Gdk::Cursor* c = 0); + + bool y_movement_matters () const { + return false; + } + + bool allow_vertical_autoscroll () const { + return false; + } + + void aborted (bool); + +protected: + std::list _views; ///< information about all audio that are being dragged along + +private: + ARDOUR::frameoffset_t _startdrag_video_offset; + ARDOUR::frameoffset_t _max_backwards_drag; +}; +#endif + /** Drag to trim region(s) */ class TrimDrag : public RegionDrag { @@ -682,7 +717,16 @@ private: void update_item (ARDOUR::Location *); Marker* _marker; ///< marker being dragged - std::list _copied_locations; + + struct CopiedLocationMarkerInfo { + ARDOUR::Location* location; + std::vector markers; + bool move_both; + CopiedLocationMarkerInfo (ARDOUR::Location* l, Marker* m); + }; + + typedef std::list CopiedLocationInfo; + CopiedLocationInfo _copied_locations; ArdourCanvas::Points _points; }; @@ -918,7 +962,7 @@ private: void update_item (ARDOUR::Location *); Operation _operation; - ArdourCanvas::SimpleRect* _drag_rect; + ArdourCanvas::Rectangle* _drag_rect; bool _copy; };