Show cursor in Cut mode on button press at cutting position
[ardour.git] / gtk2_ardour / editor_drag.h
index 1c2a910fcf7c4caab481ea01d042473575078cfe..88e651899b0c970b872e6c1cc2fd3adff58b849e 100644 (file)
@@ -327,6 +327,7 @@ protected:
        std::vector<TimeAxisView*> _time_axis_views;
        int find_time_axis_view (TimeAxisView *) const;
        int apply_track_delta (const int start, const int delta, const int skip, const bool distance_only = false) const;
+       int32_t current_music_divisor (framepos_t pos, int32_t button_state);
 
        int _visible_y_low;
        int _visible_y_high;
@@ -501,6 +502,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);
@@ -590,11 +592,47 @@ 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;
+};
+
 /** Drag to move MIDI patch changes */
 class PatchChangeDrag : public Drag
 {