Add Lua bindings to set toggle-actions
[ardour.git] / gtk2_ardour / public_editor.h
index 009a2063e3805a6a5f3ce1dfd5cefda49f390e94..375594f2bc746920403ee26495aab3821f856f53 100644 (file)
 
 #include "pbd/statefuldestructible.h"
 
+#include "ardour/session_handle.h"
+
 #include "canvas/fwd.h"
 
 #include "gtkmm2ext/actions.h"
 #include "gtkmm2ext/bindings.h"
-#include "gtkmm2ext/tabbable.h"
 #include "gtkmm2ext/visibility_tracker.h"
 
+#include "widgets/tabbable.h"
+
+#include "axis_provider.h"
 #include "editing.h"
 #include "selection.h"
 
@@ -80,6 +84,7 @@ class PluginUIWindow;
 class RegionView;
 class RouteTimeAxisView;
 class Selection;
+class StripableTimeAxisView;
 class TempoCurve;
 class TempoMarker;
 class TimeAxisView;
@@ -105,7 +110,8 @@ using ARDOUR::framecnt_t;
  * of PublicEditor need not be recompiled if private methods or member variables
  * change.
  */
-class PublicEditor : public Gtkmm2ext::Tabbable {
+class PublicEditor : public ArdourWidgets::Tabbable,  public ARDOUR::SessionHandlePtr, public AxisViewProvider
+{
 public:
        PublicEditor (Gtk::Widget& content);
        virtual ~PublicEditor ();
@@ -123,9 +129,6 @@ public:
         */
        virtual void set_session (ARDOUR::Session* s) = 0;
 
-       /** @return The Session that we are editing, or 0 */
-       virtual ARDOUR::Session* session () const = 0;
-
        /** Set the snap type.
         * @param t Snap type (defined in editing_syms.h)
         */
@@ -151,7 +154,7 @@ public:
        virtual void snap_to (ARDOUR::MusicFrame& first,
                              ARDOUR::RoundMode   direction = ARDOUR::RoundNearest,
                              bool                for_mark  = false,
-                             bool                ensure_snap = false) = 0;
+                             bool                ensure_snap = false) = 0;
 
        /** Undo some transactions.
         * @param n Number of transactions to undo.
@@ -181,8 +184,7 @@ public:
         */
        virtual Editing::MouseMode current_mouse_mode () const = 0;
 
-       /** @return Whether the current mouse mode is an "internal" editing mode.
-        */
+       /** @return Whether the current mouse mode is an "internal" editing mode. */
        virtual bool internal_editing() const = 0;
 
        /** Possibly start the audition of a region.  If @param r is 0, or not an AudioRegion
@@ -316,11 +318,14 @@ public:
        virtual void scroll_tracks_up_line () = 0;
        virtual bool scroll_down_one_track (bool skip_child_views = false) = 0;
        virtual bool scroll_up_one_track (bool skip_child_views = false) = 0;
+       virtual void select_topmost_track () = 0;
        virtual void prepare_for_cleanup () = 0;
        virtual void finish_cleanup () = 0;
        virtual void reset_x_origin (framepos_t frame) = 0;
        virtual double get_y_origin () const = 0;
        virtual void reset_y_origin (double pos) = 0;
+       virtual void set_visible_track_count (int32_t) = 0;
+       virtual void fit_selection () = 0;
        virtual void remove_last_capture () = 0;
        virtual void maximise_editing_space () = 0;
        virtual void restore_editing_space () = 0;
@@ -350,7 +355,9 @@ public:
 
        virtual bool track_selection_change_without_scroll () const = 0;
 
-       virtual RouteTimeAxisView* get_route_view_by_route_id (const PBD::ID& id) const = 0;
+       virtual StripableTimeAxisView* get_stripable_time_axis_by_id (const PBD::ID& id) const = 0;
+
+       virtual TimeAxisView* time_axis_view_from_stripable (boost::shared_ptr<ARDOUR::Stripable> s) const = 0;
 
        virtual void get_equivalent_regions (RegionView* rv, std::vector<RegionView*>&, PBD::PropertyID) const = 0;
        virtual RegionView* regionview_from_region (boost::shared_ptr<ARDOUR::Region>) const = 0;
@@ -421,15 +428,13 @@ public:
 
        virtual ArdourCanvas::GtkCanvasViewport* get_track_canvas() const = 0;
 
-       virtual TimeAxisView* axis_view_from_stripable (boost::shared_ptr<ARDOUR::Stripable>) const = 0;
-
        virtual void set_current_trimmable (boost::shared_ptr<ARDOUR::Trimmable>) = 0;
        virtual void set_current_movable (boost::shared_ptr<ARDOUR::Movable>) = 0;
 
        virtual void center_screen (framepos_t) = 0;
 
        virtual TrackViewList axis_views_from_routes (boost::shared_ptr<ARDOUR::RouteList>) const = 0;
-       virtual TrackViewList const & get_track_views () = 0;
+       virtual TrackViewList const & get_track_views () const = 0;
 
        virtual DragManager* drags () const = 0;
        virtual void maybe_autoscroll (bool, bool, bool from_headers) = 0;
@@ -443,7 +448,8 @@ public:
        virtual void abort_reversible_command () = 0;
        virtual void commit_reversible_command () = 0;
 
-       virtual void access_action (std::string,std::string) = 0;
+       virtual void access_action (const std::string&, const std::string&) = 0;
+       virtual void set_toggleaction (const std::string&, const std::string&, bool) = 0;
 
        virtual MouseCursors const * cursors () const = 0;
        virtual VerboseCursor * verbose_cursor () const = 0;