Some paths weren't getting set up correctly for the MSVC build
[ardour.git] / gtk2_ardour / editor_drag.h
index 9ed07b32df14adfa6bf10c9ac21a525a32bc5495..95eaf1409b0faee9e4ef529c70cb89b02d27f041 100644 (file)
@@ -34,6 +34,7 @@
 #include "editor_items.h"
 #include "mouse_cursors.h"
 #include "editing.h"
+#include "track_selection.h"
 
 namespace ARDOUR {
        class Location;
@@ -143,7 +144,7 @@ public:
        bool motion_handler (GdkEvent*, bool);
        void abort ();
 
-       ARDOUR::framepos_t adjusted_frame (ARDOUR::framepos_t, GdkEvent const *, bool snap = true) const;
+       ARDOUR::MusicFrame adjusted_frame (ARDOUR::framepos_t, GdkEvent const *, bool snap = true) const;
        ARDOUR::framepos_t adjusted_current_frame (GdkEvent const *, bool snap = true) const;
 
         bool was_double_click() const { return _was_double_click; }
@@ -280,8 +281,9 @@ private:
        /* difference between some key position's snapped and unsnapped
         *  framepos. used for relative snap.
         */
-       ARDOUR::frameoffset_t _snap_delta;
+       framepos_t _snap_delta;
        CursorContext::Handle _cursor_ctx; ///< cursor change context
+       bool _constraint_pressed; ///< if the keyboard indicated constraint modifier was pressed on start_grab()
 };
 
 class RegionDrag;
@@ -360,12 +362,12 @@ public:
 
 protected:
 
-       double compute_x_delta (GdkEvent const *, ARDOUR::framepos_t *);
+       double compute_x_delta (GdkEvent const *, ARDOUR::MusicFrame *);
        virtual bool y_movement_allowed (int, double, int skip_invisible = 0) const;
 
        bool _brushing;
        bool _ignore_video_lock;
-       ARDOUR::framepos_t _last_frame_position; ///< last position of the thing being dragged
+       ARDOUR::MusicFrame _last_position; ///< last position of the thing being dragged
        double _total_x_delta;
        int _last_pointer_time_axis_view;
        double _last_pointer_layer;
@@ -407,21 +409,25 @@ private:
        void finished_no_copy (
                bool const,
                bool const,
-               ARDOUR::framecnt_t const
+               ARDOUR::MusicFrame,
+               int32_t const ev_state
                );
 
        void finished_copy (
                bool const,
                bool const,
-               ARDOUR::framecnt_t const
+               ARDOUR::MusicFrame,
+               int32_t const ev_state
                );
 
        RegionView* insert_region_into_playlist (
                boost::shared_ptr<ARDOUR::Region>,
                RouteTimeAxisView*,
                ARDOUR::layer_t,
-               ARDOUR::framecnt_t,
-               PlaylistSet&
+               ARDOUR::MusicFrame,
+               double quarter_note,
+               PlaylistSet&,
+               bool for_music = false
                );
 
        void remove_region_from_playlist (
@@ -497,6 +503,7 @@ class RegionCutDrag : public Drag
        RegionCutDrag (Editor*, ArdourCanvas::Item*, framepos_t);
        ~RegionCutDrag ();
 
+       void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
        void motion (GdkEvent*, bool);
        void finished (GdkEvent*, bool);
        void aborted (bool);
@@ -561,6 +568,7 @@ class NoteDrag : public Drag
        double _cumulative_dy;
        bool   _was_selected;
        double _note_height;
+       bool   _copy;
 };
 
 class NoteCreateDrag : public Drag
@@ -586,11 +594,50 @@ private:
        double y_to_region (double) const;
        ARDOUR::framecnt_t grid_frames (framepos_t) const;
 
+       /** @return minimum number of frames (in x) and pixels (in y) that should be considered a movement */
+       virtual std::pair<ARDOUR::framecnt_t, int> move_threshold () const {
+               return std::make_pair (0, 0);
+       }
+
        MidiRegionView* _region_view;
        ArdourCanvas::Rectangle* _drag_rect;
        framepos_t _note[2];
 };
 
+class HitCreateDrag : public Drag
+{
+public:
+       HitCreateDrag (Editor *, ArdourCanvas::Item *, MidiRegionView *);
+       ~HitCreateDrag ();
+
+       void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
+       void motion (GdkEvent *, bool);
+       void finished (GdkEvent *, bool);
+       void aborted (bool);
+
+       bool active (Editing::MouseMode mode) {
+               return mode == Editing::MouseDraw || mode == Editing::MouseContent;
+       }
+
+       bool y_movement_matters () const {
+               return false;
+       }
+
+private:
+       double y_to_region (double) const;
+       ARDOUR::framecnt_t grid_frames (framepos_t) const;
+
+       /** @return minimum number of frames (in x) and pixels (in y) that should be considered a movement */
+       virtual std::pair<ARDOUR::framecnt_t, int> move_threshold () const {
+               return std::make_pair (0, 0);
+       }
+
+       MidiRegionView* _region_view;
+       framepos_t      _last_pos;
+       double          _last_y;
+
+};
+
 /** Drag to move MIDI patch changes */
 class PatchChangeDrag : public Drag
 {
@@ -741,6 +788,7 @@ private:
 
        bool _copy;
        bool _movable;
+       double _grab_bpm;
        XMLNode* before_state;
 };
 
@@ -766,8 +814,7 @@ public:
        void setup_pointer_frame_offset ();
 
 private:
-       double _pulse;
-       double _beat;
+       double _grab_qn;
        ARDOUR::TempoSection* _tempo;
        XMLNode* before_state;
 };
@@ -1060,7 +1107,7 @@ public:
 private:
        Operation _operation;
        bool _add;
-       std::list<TimeAxisView*> _added_time_axes;
+       TrackSelection _track_selection_at_start;
        bool _time_selection_at_start;
         framepos_t start_at_start;
         framepos_t end_at_start;
@@ -1185,5 +1232,21 @@ class CrossfadeEdgeDrag : public Drag
        bool start;
 };
 
+class RulerZoomDrag : public Drag
+{
+public:
+       RulerZoomDrag (Editor*, ArdourCanvas::Item*);
+
+       void start_grab (GdkEvent*, Gdk::Cursor* c = 0);
+       void motion (GdkEvent *, bool);
+       void finished (GdkEvent*, bool);
+       void aborted (bool);
+
+       virtual bool allow_vertical_autoscroll () const {
+               return false;
+       }
+
+};
+
 #endif /* __gtk2_ardour_editor_drag_h_ */