use new action map API instead of ActionManager::get_action
[ardour.git] / gtk2_ardour / public_editor.h
index ed66f27bd84eba1fdf79d7c977b0989ef6b2056e..5c2b376e73e4e7be748fbc10c47d088203270f5a 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"
 
@@ -110,7 +111,7 @@ using ARDOUR::samplecnt_t;
  * of PublicEditor need not be recompiled if private methods or member variables
  * change.
  */
-class PublicEditor : public ArdourWidgets::Tabbable,  public ARDOUR::SessionHandlePtr, public AxisViewProvider
+class PublicEditor : public ArdourWidgets::Tabbable,  public ARDOUR::SessionHandlePtr, public AxisViewProvider, public Gtkmm2ext::ActionMapOwner
 {
 public:
        PublicEditor (Gtk::Widget& content);
@@ -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,18 +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,
-                             bool                for_mark  = false,
+                             ARDOUR::SnapPref    gpref = ARDOUR::SnapToAny_Visual,
                              bool                ensure_snap = false) = 0;
 
        /** Undo some transactions.
@@ -214,6 +210,7 @@ public:
        virtual void set_selection (std::list<Selectable*>, Selection::Operation) = 0;
 
        virtual bool extend_selection_to_track (TimeAxisView&) = 0;
+       virtual void play_solo_selection(bool restart) = 0;
        virtual void play_selection () = 0;
        virtual void play_with_preroll () = 0;
        virtual void rec_with_preroll () = 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;
@@ -285,6 +281,7 @@ public:
        virtual void clear_playlists (TimeAxisView*) = 0;
        virtual void select_all_tracks () = 0;
        virtual void deselect_all () = 0;
+       virtual void invert_selection () = 0;
        virtual void set_selected_track (TimeAxisView&, Selection::Operation op = Selection::Set, bool no_remove = false) = 0;
        virtual void set_selected_mixer_strip (TimeAxisView&) = 0;
        virtual void hide_track_in_display (TimeAxisView* tv, bool apply_to_selection = false) = 0;
@@ -298,7 +295,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;
@@ -331,7 +328,7 @@ public:
        virtual void restore_editing_space () = 0;
        virtual samplepos_t get_preferred_edit_position (Editing::EditIgnoreOption = Editing::EDIT_IGNORE_NONE, bool from_context_menu = false, bool from_outside_canvas = false) = 0;
        virtual void toggle_meter_updating() = 0;
-       virtual void split_regions_at (ARDOUR::MusicSample, RegionSelection&, bool snap) = 0;
+       virtual void split_regions_at (ARDOUR::MusicSample, RegionSelection&) = 0;
        virtual void split_region_at_points (boost::shared_ptr<ARDOUR::Region>, ARDOUR::AnalysisFeatureList&, bool can_ferret, bool select_new = false) = 0;
        virtual void mouse_add_new_marker (samplepos_t where, bool is_cd=false) = 0;
        virtual void foreach_time_axis_view (sigc::slot<void,TimeAxisView&>) = 0;
@@ -425,6 +422,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 +462,9 @@ 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_Visual) = 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;