new_grid: Rewrite of Snap and Grid. (squashed commit)
[ardour.git] / gtk2_ardour / public_editor.h
index ed66f27bd84eba1fdf79d7c977b0989ef6b2056e..42ec913bc10339f81de4004978ff21e09578a583 100644 (file)
 #include <gtkmm/notebook.h>
 #include <sigc++/signal.h>
 
+#include "pbd/statefuldestructible.h"
+
 #include "temporal/beats.h"
-#include "evoral/Note.hpp"
 
-#include "pbd/statefuldestructible.h"
+#include "evoral/Note.hpp"
 
 #include "ardour/session_handle.h"
 
@@ -132,9 +133,9 @@ public:
        /** Set the snap type.
         * @param t Snap type (defined in editing_syms.h)
         */
-       virtual void set_snap_to (Editing::SnapType t) = 0;
+       virtual void set_grid_to (Editing::GridType t) = 0;
 
-       virtual Editing::SnapType snap_type () const = 0;
+       virtual Editing::GridType grid_type () const = 0;
        virtual Editing::SnapMode snap_mode () const = 0;
 
        /** Set the snap mode.
@@ -142,17 +143,13 @@ public:
         */
        virtual void set_snap_mode (Editing::SnapMode m) = 0;
 
-       /** Set the snap threshold.
-        * @param t Snap threshold in `units'.
-        */
-       virtual void set_snap_threshold (double t) = 0;
-
        /**
         * Snap a value according to the current snap setting.
         * ensure_snap overrides SnapOff and magnetic snap
         */
        virtual void snap_to (ARDOUR::MusicSample& first,
                              ARDOUR::RoundMode   direction = ARDOUR::RoundNearest,
+                             ARDOUR::SnapPref    gpref = ARDOUR::SnapToAny,
                              bool                for_mark  = false,
                              bool                ensure_snap = false) = 0;
 
@@ -223,8 +220,7 @@ public:
        virtual void trigger_script (int nth) = 0;
        virtual void add_location_from_playhead_cursor () = 0;
        virtual void remove_location_at_playhead_cursor () = 0;
-       virtual void set_show_measures (bool yn) = 0;
-       virtual bool show_measures () const = 0;
+       virtual void update_grid () = 0;
        virtual void remove_tracks () = 0;
        virtual void set_loop_range (samplepos_t start, samplepos_t end, std::string cmd) = 0;
        virtual void set_punch_range (samplepos_t start, samplepos_t end, std::string cmd) = 0;
@@ -298,7 +294,7 @@ public:
         * @param yn true to follow playhead, otherwise false.
         * @param catch_up true to reset the editor view to show the playhead (if yn == true), otherwise false.
         */
-       virtual void set_follow_playhead (bool yn, bool catch_up = false) = 0;
+       virtual void set_follow_playhead (bool yn, bool catch_up = true) = 0;
 
        /** Toggle whether the editor is following the playhead */
        virtual void toggle_follow_playhead () = 0;
@@ -425,6 +421,7 @@ public:
        virtual ArdourCanvas::ScrollGroup* get_hscroll_group () const = 0;
        virtual ArdourCanvas::ScrollGroup* get_hvscroll_group () const = 0;
        virtual ArdourCanvas::ScrollGroup* get_cursor_scroll_group () const = 0;
+       virtual ArdourCanvas::Container* get_drag_motion_group () const = 0;
 
        virtual ArdourCanvas::GtkCanvasViewport* get_track_canvas() const = 0;
 
@@ -464,7 +461,10 @@ public:
        virtual void snap_to_with_modifier (ARDOUR::MusicSample& first,
                                            GdkEvent const *    ev,
                                            ARDOUR::RoundMode   direction = ARDOUR::RoundNearest,
-                                           bool                for_mark  = false) = 0;
+                                           ARDOUR::SnapPref    gpref = ARDOUR::SnapToAny,
+                                           bool                for_mark = false) = 0;
+
+       virtual void set_snapped_cursor_position (samplepos_t pos) = 0;
 
        virtual void get_regions_at (RegionSelection &, samplepos_t where, TrackViewList const &) const = 0;
        virtual void get_regions_after (RegionSelection&, samplepos_t where, const TrackViewList& ts) const = 0;
@@ -472,6 +472,9 @@ public:
        virtual void get_regionviews_by_id (PBD::ID const id, RegionSelection & regions) const = 0;
        virtual void get_per_region_note_selection (std::list<std::pair<PBD::ID, std::set<boost::shared_ptr<Evoral::Note<Temporal::Beats> > > > >&) const = 0;
 
+       virtual void build_region_boundary_cache () = 0;
+       virtual void mark_region_boundary_cache_dirty () = 0;
+
        virtual void mouse_add_new_tempo_event (samplepos_t where) = 0;
        virtual void mouse_add_new_meter_event (samplepos_t where) = 0;
        virtual void edit_tempo_section (ARDOUR::TempoSection*) = 0;