Speed up AFL/PFL changes for large sessions
[ardour.git] / gtk2_ardour / editor.h
index 139e044eae9d23236100a86c4e8cb3d93754f66e..57e72393fad0053ff141b9f90f808a8802e24626 100644 (file)
 #include <gtkmm/comboboxtext.h>
 #include <gtkmm/layout.h>
 
-#include "gtkmm2ext/selector.h"
+#include "gtkmm2ext/bindings.h"
 #include "gtkmm2ext/click_box.h"
 #include "gtkmm2ext/dndtreeview.h"
+#include "gtkmm2ext/pane.h"
+#include "gtkmm2ext/selector.h"
 #include "gtkmm2ext/stateful_button.h"
-#include "gtkmm2ext/bindings.h"
 
 #include "pbd/stateful.h"
 #include "pbd/signals.h"
@@ -60,6 +61,7 @@
 #include "editor_items.h"
 #include "region_selection.h"
 #include "selection_memento.h"
+#include "tempo_curve.h"
 
 namespace Gtkmm2ext {
        class Bindings;
@@ -171,6 +173,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
 
        Editing::SnapMode  snap_mode () const;
        Editing::SnapType  snap_type () const;
+       bool  snap_musical () const;
 
        void undo (uint32_t n = 1);
        void redo (uint32_t n = 1);
@@ -294,8 +297,10 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        Editing::ZoomFocus get_zoom_focus () const { return zoom_focus; }
        framecnt_t         get_current_zoom () const { return samples_per_pixel; }
        void               cycle_zoom_focus ();
-       void temporal_zoom_step (bool coarser);
-       void temporal_zoom_step_mouse_focus (bool coarser);
+       void temporal_zoom_step (bool zoom_out);
+       void temporal_zoom_step_scale (bool zoom_out, double scale);
+       void temporal_zoom_step_mouse_focus (bool zoom_out);
+       void temporal_zoom_step_mouse_focus_scale (bool zoom_out, double scale);
        void ensure_time_axis_view_is_visible (TimeAxisView const & tav, bool at_top);
        void tav_zoom_step (bool coarser);
        void tav_zoom_smooth (bool coarser, bool force_all);
@@ -327,6 +332,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        unsigned get_grid_beat_divisions(framepos_t position);
        Evoral::Beats get_grid_type_as_beats (bool& success, framepos_t position);
 
+       int32_t get_grid_music_divisions (uint32_t event_state);
+
        void nudge_forward (bool next, bool force_playhead);
        void nudge_backward (bool next, bool force_playhead);
 
@@ -529,7 +536,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
 
        /* editing operations that need to be public */
        void mouse_add_new_marker (framepos_t where, bool is_cd=false);
-       void split_regions_at (framepos_t, RegionSelection&);
+       void split_regions_at (framepos_t, RegionSelection&, const int32_t sub_num, bool snap = true);
        void split_region_at_points (boost::shared_ptr<ARDOUR::Region>, ARDOUR::AnalysisFeatureList&, bool can_ferret, bool select_new = false);
        RegionSelection get_regions_from_selection_and_mouse (framepos_t);
 
@@ -608,17 +615,15 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
 
        void update_join_object_range_location (double);
 
-       boost::optional<int>  pre_notebook_shrink_pane_width;
-
-       void pane_allocation_handler (Gtk::Allocation&, Gtk::Paned*);
+       boost::optional<float>  pre_notebook_shrink_pane_width;
 
        Gtk::Notebook _the_notebook;
        bool _notebook_shrunk;
        void add_notebook_page (std::string const &, Gtk::Widget &);
        bool notebook_tab_clicked (GdkEventButton *, Gtk::Widget *);
 
-       Gtk::HPaned   edit_pane;
-       Gtk::VPaned   editor_summary_pane;
+       Gtkmm2ext::HPane   edit_pane;
+       Gtkmm2ext::VPane   editor_summary_pane;
 
        Gtk::EventBox meter_base;
        Gtk::HBox     meter_box;
@@ -771,8 +776,10 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        void popup_note_context_menu (ArdourCanvas::Item *, GdkEvent *);
        Gtk::Menu _note_context_menu;
 
+       void add_stripables (ARDOUR::StripableList&);
        void add_routes (ARDOUR::RouteList&);
        void timeaxisview_deleted (TimeAxisView *);
+       void add_vcas (ARDOUR::VCAList&);
 
        Gtk::HBox global_hpacker;
        Gtk::VBox global_vpacker;
@@ -885,7 +892,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        void update_just_timecode ();
        void compute_fixed_ruler_scale (); //calculates the RulerScale of the fixed rulers
        void update_fixed_rulers ();
-       void update_tempo_based_rulers (std::vector<ARDOUR::TempoMap::BBTPoint>& grid);
+       void update_tempo_based_rulers ();
        void popup_ruler_menu (framepos_t where = 0, ItemType type = RegionItem);
        void update_ruler_visibility ();
        void set_ruler_visible (RulerType, bool);
@@ -948,7 +955,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        gint bbt_nmarks;
        uint32_t bbt_bar_helper_on;
        uint32_t bbt_accent_modulo;
-       void compute_bbt_ruler_scale (std::vector<ARDOUR::TempoMap::BBTPoint>& grid, framepos_t lower, framepos_t upper);
+       void compute_bbt_ruler_scale (framepos_t lower, framepos_t upper);
 
        ArdourCanvas::Ruler* timecode_ruler;
        ArdourCanvas::Ruler* bbt_ruler;
@@ -1086,7 +1093,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        void control_step_tracks_down ();
        void control_view (uint32_t);
        void control_scroll (float);
-       void control_select (uint32_t rid, Selection::Operation);
+       void control_select (boost::shared_ptr<ARDOUR::Stripable>, Selection::Operation);
        void control_unselect ();
        void access_action (std::string,std::string);
        bool deferred_control_scroll (framepos_t);
@@ -1128,7 +1135,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        /* track views */
        TrackViewList track_views;
        std::pair<TimeAxisView*, double> trackview_by_y_position (double, bool trackview_relative_offset = true) const;
-       RouteTimeAxisView* axis_view_from_route (boost::shared_ptr<ARDOUR::Route>) const;
+       TimeAxisView* axis_view_from_stripable (boost::shared_ptr<ARDOUR::Stripable>) const;
 
        TrackViewList get_tracks_for_range_action () const;
 
@@ -1185,7 +1192,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        void cut_copy_midi (Editing::CutCopyOp);
 
        void mouse_paste ();
-       void paste_internal (framepos_t position, float times);
+       void paste_internal (framepos_t position, float times, const int32_t sub_num);
 
        /* EDITING OPERATIONS */
 
@@ -1271,14 +1278,12 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
 
        void naturalize_region ();
 
-       void reset_focus (Gtk::Widget*);
-
        void split_region ();
 
        void delete_ ();
        void cut ();
        void copy ();
-       void paste (float times, bool from_context_menu = false);
+       void paste (float times, bool from_context_menu);
 
        void place_transient ();
        void remove_transient (ArdourCanvas::Item* item);
@@ -1446,6 +1451,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        void set_loop_from_selection (bool play);
        void set_punch_from_selection ();
        void set_punch_from_region ();
+       void set_auto_punch_range();
 
        void set_session_start_from_playhead ();
        void set_session_end_from_playhead ();
@@ -1456,7 +1462,9 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        void set_loop_range (framepos_t start, framepos_t end, std::string cmd);
        void set_punch_range (framepos_t start, framepos_t end, std::string cmd);
 
+       void toggle_location_at_playhead_cursor ();
        void add_location_from_playhead_cursor ();
+       bool do_remove_location_at_playhead_cursor ();
        void remove_location_at_playhead_cursor ();
        bool select_new_marker;
 
@@ -1564,6 +1572,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        bool canvas_stream_view_event (GdkEvent* event,ArdourCanvas::Item*, RouteTimeAxisView*);
        bool canvas_marker_event (GdkEvent* event,ArdourCanvas::Item*, ArdourMarker*);
        bool canvas_tempo_marker_event (GdkEvent* event,ArdourCanvas::Item*, TempoMarker*);
+       bool canvas_tempo_curve_event (GdkEvent* event,ArdourCanvas::Item*, TempoCurve*);
        bool canvas_meter_marker_event (GdkEvent* event,ArdourCanvas::Item*, MeterMarker*);
        bool canvas_automation_track_event(GdkEvent* event, ArdourCanvas::Item*, AutomationTimeAxisView*);
        bool canvas_note_event (GdkEvent* event, ArdourCanvas::Item *);
@@ -1652,6 +1661,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        void marker_menu_remove ();
        void marker_menu_rename ();
        void rename_marker (ArdourMarker *marker);
+       void toggle_marker_lock_style ();
+       void toggle_tempo_type ();
        void toggle_marker_menu_lock ();
        void toggle_marker_menu_glue ();
        void marker_menu_hide ();
@@ -1676,11 +1687,13 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        void new_transport_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
        void build_range_marker_menu (bool, bool);
        void build_marker_menu (ARDOUR::Location *);
-       void build_tempo_or_meter_marker_menu (bool);
+       void build_tempo_marker_menu (TempoMarker *, bool);
+       void build_meter_marker_menu (MeterMarker *, bool);
        void build_new_transport_marker_menu ();
        void dynamic_cast_marker_object (void*, MeterMarker**, TempoMarker**) const;
 
-       Gtk::Menu* tempo_or_meter_marker_menu;
+       Gtk::Menu* tempo_marker_menu;
+       Gtk::Menu* meter_marker_menu;
        Gtk::Menu* marker_menu;
        Gtk::Menu* range_marker_menu;
        Gtk::Menu* transport_marker_menu;
@@ -1691,12 +1704,16 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        typedef std::list<ArdourMarker*> Marks;
        Marks metric_marks;
 
+       typedef std::list<TempoCurve*> Curves;
+       Curves tempo_curves;
+
        void remove_metric_marks ();
        void draw_metric_marks (const ARDOUR::Metrics& metrics);
 
        void compute_current_bbt_points (std::vector<ARDOUR::TempoMap::BBTPoint>& grid, framepos_t left, framepos_t right);
 
        void tempo_map_changed (const PBD::PropertyChange&);
+       void marker_position_changed ();
        void redisplay_tempo (bool immediate_redraw);
 
        uint32_t bbt_beat_subdivision;
@@ -1985,6 +2002,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        /* duplication */
 
        void duplicate_range (bool with_dialog);
+       void duplicate_regions (float times);
 
        /** computes the timeline frame (sample) of an event whose coordinates
         * are in canvas units (pixels, scroll offset included).
@@ -2238,11 +2256,13 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        Gtkmm2ext::ActionMap myactions;
 
        friend class Drag;
+       friend class RegionCutDrag;
        friend class RegionDrag;
        friend class RegionMoveDrag;
        friend class RegionSpliceDrag;
        friend class RegionRippleDrag;
        friend class TrimDrag;
+       friend class BBTRulerDrag;
        friend class MeterMarkerDrag;
        friend class TempoMarkerDrag;
        friend class CursorDrag;
@@ -2253,6 +2273,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        friend class ControlPointDrag;
        friend class LineDrag;
        friend class RubberbandSelectDrag;
+       friend class RulerZoomDrag;
        friend class EditorRubberbandSelectDrag;
        friend class TimeFXDrag;
        friend class ScrubDrag;