vtl: send A/V offset to video-monitor when launched
[ardour.git] / gtk2_ardour / editor_drag.h
index 1579a178a87d69dbd36a40ea4039c3e27600f675..6267956ed7774a193c4ed3cd3ba5aa2c9a2afdb2 100644 (file)
@@ -505,6 +505,44 @@ private:
        double _cumulative_dx;
 };
 
+/** 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
+{
+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<AVDraggingView> _views; ///< information about all audio that are being dragged along
+
+private:
+       ARDOUR::frameoffset_t _startdrag_video_offset;
+       ARDOUR::frameoffset_t _max_backwards_drag;
+};
+
 /** Drag to trim region(s) */
 class TrimDrag : public RegionDrag
 {
@@ -515,7 +553,7 @@ public:
                ContentsTrim,
        };
 
-       TrimDrag (Editor *, ArdourCanvas::Item *, RegionView*, std::list<RegionView*> const &);
+       TrimDrag (Editor *, ArdourCanvas::Item *, RegionView*, std::list<RegionView*> const &, bool preserve_fade_anchor = false);
 
        void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
        void motion (GdkEvent *, bool);
@@ -531,6 +569,8 @@ public:
 private:
 
        Operation _operation;
+       
+       bool _preserve_fade_anchor;
 };
 
 /** Meter marker drag */
@@ -680,7 +720,16 @@ private:
        void update_item (ARDOUR::Location *);
 
        Marker* _marker; ///< marker being dragged
-       std::list<ARDOUR::Location*> _copied_locations;
+
+        struct CopiedLocationMarkerInfo {
+           ARDOUR::Location* location;
+           std::vector<Marker*> markers;
+           bool    move_both;
+           CopiedLocationMarkerInfo (ARDOUR::Location* l, Marker* m);
+       };
+
+        typedef std::list<CopiedLocationMarkerInfo> CopiedLocationInfo;
+        CopiedLocationInfo _copied_locations;
        ArdourCanvas::Points _points;
 };
 
@@ -704,6 +753,8 @@ private:
        double _fixed_grab_y;
        double _cumulative_x_drag;
        double _cumulative_y_drag;
+        bool     _pushing;
+        uint32_t _final_index;
        static double _zero_gain_fraction;
 };
 
@@ -860,7 +911,8 @@ public:
                CreateSelection,
                SelectionStartTrim,
                SelectionEndTrim,
-               SelectionMove
+               SelectionMove,
+               SelectionExtend
        };
 
        SelectionDrag (Editor *, ArdourCanvas::Item *, Operation);
@@ -874,11 +926,14 @@ public:
 
 private:
        Operation _operation;
-       bool _copy;
+       bool _add;
+       bool _extend;
        int _original_pointer_time_axis;
        int _last_pointer_time_axis;
        std::list<TimeAxisView*> _added_time_axes;
        bool _time_selection_at_start;
+        framepos_t start_at_start;
+        framepos_t end_at_start;
 };
 
 /** Range marker drag */
@@ -957,7 +1012,8 @@ public:
 
 private:
        void setup (std::list<boost::shared_ptr<AutomationLine> > const &);
-       
+        double y_fraction (boost::shared_ptr<AutomationLine>, double global_y_position) const;
+
        std::list<ARDOUR::AudioRange> _ranges;
 
        /** A line that is part of the drag */
@@ -966,10 +1022,11 @@ private:
                std::list<ControlPoint*> points; ///< points to drag on the line
                std::pair<ARDOUR::framepos_t, ARDOUR::framepos_t> range; ///< the range of all points on the line, in session frames
                XMLNode* state; ///< the XML state node before the drag
+               double original_fraction; ///< initial y-fraction before the drag
        };
 
        std::list<Line> _lines;
-
+        double y_origin;
        bool _nothing_to_drag;
 };