Make activate/deactivate all only operate on visible
[ardour.git] / gtk2_ardour / editor_drag.h
index bfd308b6f9eba0bb413cedcc78ad4c1abf2db4b7..8bc52bc056be5f46582b90a5c5b8f4b692765140 100644 (file)
@@ -24,7 +24,6 @@
 
 #include <gdk/gdk.h>
 #include <stdint.h>
-#include <bitset>
 
 #include "ardour/types.h"
 
@@ -100,6 +99,7 @@ private:
        double _current_pointer_x; ///< trackview x of the current pointer
        double _current_pointer_y; ///< trackview y of the current pointer
        ARDOUR::framepos_t _current_pointer_frame; ///< frame that the pointer is now at
+       bool _old_follow_playhead; ///< state of Editor::follow_playhead() before the drags started
 };
 
 /** Abstract base class for dragging of things within the editor */
@@ -124,7 +124,7 @@ public:
 
        ARDOUR::framepos_t adjusted_frame (ARDOUR::framepos_t, GdkEvent const *, bool snap = true) const;
        ARDOUR::framepos_t adjusted_current_frame (GdkEvent const *, bool snap = true) const;
-       
+
        /** Called to start a grab of an item.
         *  @param e Event that caused the grab to start.
         *  @param c Cursor to use, or 0.
@@ -212,6 +212,10 @@ protected:
                return _last_pointer_frame;
        }
 
+       void show_verbose_cursor_time (framepos_t);
+       void show_verbose_cursor_duration (framepos_t, framepos_t, double xoffset = 0);
+       void show_verbose_cursor_text (std::string const &);
+
        Editor* _editor; ///< our editor
        DragManager* _drags;
        ArdourCanvas::Item* _item; ///< our item
@@ -241,7 +245,9 @@ struct DraggingView
        DraggingView (RegionView *, RegionDrag *);
 
        RegionView* view; ///< the view
-       /** index into RegionDrag::_time_axis_views of the view that this region is currently beind displayed on */
+       /** index into RegionDrag::_time_axis_views of the view that this region is currently being displayed on,
+        *  or -1 if it is not visible.
+        */
        int time_axis_view;
        /** layer that this region is currently being displayed on */
        ARDOUR::layer_t layer;
@@ -271,9 +277,9 @@ protected:
        int _visible_y_high;
 
        friend class DraggingView;
-       
+
 private:
-       
+
        void region_going_away (RegionView *);
        PBD::ScopedConnection death_connection;
 };
@@ -365,7 +371,7 @@ private:
        void add_stateful_diff_commands_for_playlists (PlaylistSet const &);
 
        void collect_new_region_view (RegionView *);
-       
+
        bool _copy;
        RegionView* _new_region_view;
 };
@@ -443,7 +449,7 @@ class NoteDrag : public Drag
 
        ARDOUR::frameoffset_t total_dx () const;
        int8_t total_dy () const;
-       
+
        MidiRegionView* _region;
        Gnome::Canvas::CanvasNoteEvent* _primary;
        double _cumulative_dx;
@@ -511,7 +517,7 @@ public:
        }
 
        void setup_pointer_frame_offset ();
-       
+
 private:
 
        Operation _operation;
@@ -537,7 +543,7 @@ public:
        }
 
        void setup_pointer_frame_offset ();
-       
+
 private:
        MeterMarker* _marker;
        bool _copy;
@@ -563,7 +569,7 @@ public:
        }
 
        void setup_pointer_frame_offset ();
-       
+
 private:
        TempoMarker* _marker;
        bool _copy;
@@ -590,13 +596,14 @@ public:
        }
 
        bool y_movement_matters () const {
-               return false;
+               return true;
        }
-       
+
 private:
        void fake_locate (framepos_t);
-       
+
        bool _stop; ///< true to stop the transport on starting the drag, otherwise false
+       double _grab_zoom; ///< editor frames per unit when our grab started
 };
 
 /** Region fade-in drag */
@@ -656,13 +663,12 @@ public:
        }
 
        void setup_pointer_frame_offset ();
-       
+
 private:
        void update_item (ARDOUR::Location *);
 
        Marker* _marker; ///< marker being dragged
        std::list<ARDOUR::Location*> _copied_locations;
-       ArdourCanvas::Line* _line;
        ArdourCanvas::Points _points;
 };
 
@@ -686,7 +692,7 @@ private:
        double _fixed_grab_y;
        double _cumulative_x_drag;
        double _cumulative_y_drag;
-       static double const _zero_gain_fraction;
+       static double _zero_gain_fraction;
 };
 
 /** Gain or automation line drag */
@@ -731,13 +737,13 @@ public:
 
 private:
 
-       ArdourCanvas::SimpleLine* _line;
+       ArdourCanvas::Line* _line;
        AudioRegionView* _arv;
-       
+
        double _region_view_grab_x;
        double _cumulative_x_drag;
-       
-       uint32_t _before;
+
+       float _before;
        uint32_t _max_x;
 };
 
@@ -887,9 +893,9 @@ private:
                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
        };
-       
+
        std::list<Line> _lines;
-       
+
        bool _nothing_to_drag;
 };