X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Feditor.h;h=d45545b4a703495835b8744e0053aa44c4a771e9;hb=6424a0eab93c85f8b1ff56334f779c1232dfe475;hp=8f00fe110b56369a5240a199f9a3e7f75c1af71c;hpb=98b14ad0e63964b6ec206edf85ec23c5c3731002;p=ardour.git diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 8f00fe110b..d45545b4a7 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -34,11 +34,12 @@ #include #include -#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" @@ -54,16 +55,15 @@ #include "ardour_button.h" #include "ardour_dialog.h" #include "ardour_dropdown.h" -#include "binding_owners.h" #include "public_editor.h" #include "editing.h" #include "enums.h" #include "editor_items.h" #include "region_selection.h" #include "selection_memento.h" +#include "tempo_curve.h" namespace Gtkmm2ext { - class TearOff; class Bindings; } @@ -144,8 +144,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void set_session (ARDOUR::Session *); ARDOUR::Session* session() const { return _session; } - Gtk::Window* use_own_window (); - + Gtk::Window* use_own_window (bool and_fill_it); + void first_idle (); virtual bool have_idled () const { return _have_idled; } @@ -173,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); @@ -248,7 +249,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD /* selection */ Selection& get_selection() const { return *selection; } - bool get_selection_extents ( framepos_t &start, framepos_t &end ); // the time extents of the current selection, whether Range, Region(s), Control Points, or Notes + bool get_selection_extents (framepos_t &start, framepos_t &end) const; // the time extents of the current selection, whether Range, Region(s), Control Points, or Notes Selection& get_cut_buffer() const { return *cut_buffer; } void track_mixer_selection (); @@ -276,8 +277,11 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD /* analysis window */ - void analyze_region_selection(); - void analyze_range_selection(); + void loudness_analyze_region_selection(); + void loudness_analyze_range_selection(); + + void spectral_analyze_region_selection(); + void spectral_analyze_range_selection(); /* export */ @@ -326,6 +330,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); + unsigned get_grid_music_divisions (uint32_t event_state); + void nudge_forward (bool next, bool force_playhead); void nudge_backward (bool next, bool force_playhead); @@ -351,7 +357,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void set_summary (); void set_group_tabs (); void toggle_measure_visibility (); - void toggle_logo_visibility (); /* fades */ @@ -384,9 +389,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void maximise_editing_space(); void restore_editing_space(); - void update_tearoff_visibility(); - void reattach_all_tearoffs (); - double get_y_origin () const; void reset_x_origin (framepos_t); void reset_x_origin_to_follow_playhead (); @@ -442,9 +444,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD TrackViewList axis_views_from_routes (boost::shared_ptr) const; - Gtkmm2ext::TearOff* mouse_mode_tearoff () const { return _mouse_mode_tearoff; } - Gtkmm2ext::TearOff* tools_tearoff () const { return _tools_tearoff; } - void snap_to (framepos_t& first, ARDOUR::RoundMode direction = ARDOUR::RoundNearest, bool for_mark = false, @@ -535,7 +534,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); void split_region_at_points (boost::shared_ptr, ARDOUR::AnalysisFeatureList&, bool can_ferret, bool select_new = false); RegionSelection get_regions_from_selection_and_mouse (framepos_t); @@ -558,7 +557,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void color_handler (); bool constructed; - Gtkmm2ext::Bindings key_bindings; // to keep track of the playhead position for control_scroll boost::optional _control_scroll_target; @@ -615,17 +613,15 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void update_join_object_range_location (double); - boost::optional pre_notebook_shrink_pane_width; - - void pane_allocation_handler (Gtk::Allocation&, Gtk::Paned*); + boost::optional 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; @@ -643,6 +639,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void remove_marker (ArdourCanvas::Item&, GdkEvent*); gint really_remove_marker (ARDOUR::Location* loc); void goto_nth_marker (int nth); + void trigger_script (int nth); void toggle_marker_lines (); void set_marker_line_visibility (bool); @@ -777,11 +774,13 @@ 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; - VBoxWithBindings global_vpacker; + Gtk::HBox global_hpacker; + Gtk::VBox global_vpacker; /* Cursor stuff. Do not use directly, use via CursorContext. */ friend class CursorContext; @@ -816,8 +815,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD Gtk::EventBox time_bars_event_box; Gtk::VBox time_bars_vbox; - ArdourCanvas::Pixbuf *logo_item; - ArdourCanvas::Container *tempo_group; ArdourCanvas::Container *meter_group; ArdourCanvas::Container *marker_group; @@ -893,8 +890,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 (ARDOUR::TempoMap::BBTPointList::const_iterator& begin, - ARDOUR::TempoMap::BBTPointList::const_iterator& end); + void update_tempo_based_rulers (std::vector& grid); void popup_ruler_menu (framepos_t where = 0, ItemType type = RegionItem); void update_ruler_visibility (); void set_ruler_visible (RulerType, bool); @@ -957,9 +953,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 (framepos_t lower, framepos_t upper, - ARDOUR::TempoMap::BBTPointList::const_iterator current_bbt_points_begin, - ARDOUR::TempoMap::BBTPointList::const_iterator current_bbt_points_end); + void compute_bbt_ruler_scale (std::vector& grid, framepos_t lower, framepos_t upper); ArdourCanvas::Ruler* timecode_ruler; ArdourCanvas::Ruler* bbt_ruler; @@ -1097,7 +1091,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, Selection::Operation); void control_unselect (); void access_action (std::string,std::string); bool deferred_control_scroll (framepos_t); @@ -1139,7 +1133,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD /* track views */ TrackViewList track_views; std::pair trackview_by_y_position (double, bool trackview_relative_offset = true) const; - RouteTimeAxisView* axis_view_from_route (boost::shared_ptr) const; + TimeAxisView* axis_view_from_stripable (boost::shared_ptr) const; TrackViewList get_tracks_for_range_action () const; @@ -1182,7 +1176,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void register_region_actions (); void load_bindings (); - Gtkmm2ext::ActionMap editor_action_map; /* CUT/COPY/PASTE */ @@ -1197,7 +1190,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 */ @@ -1283,14 +1276,14 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void naturalize_region (); - void reset_focus (); + 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); @@ -1576,6 +1569,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 *); @@ -1627,6 +1621,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void initialize_canvas (); + void set_script_action_name (int i, const std::string&); + /* display control */ bool _show_measures; @@ -1643,8 +1639,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD ArdourCanvas::Container* time_line_group; void hide_measures (); - void draw_measures (ARDOUR::TempoMap::BBTPointList::const_iterator& begin, - ARDOUR::TempoMap::BBTPointList::const_iterator& end); + void draw_measures (std::vector&); void new_tempo_section (); @@ -1663,6 +1658,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 (); @@ -1687,11 +1684,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; @@ -1702,14 +1701,16 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD typedef std::list Marks; Marks metric_marks; + typedef std::list Curves; + Curves tempo_curves; + void remove_metric_marks (); void draw_metric_marks (const ARDOUR::Metrics& metrics); - void compute_current_bbt_points (framepos_t left, framepos_t right, - ARDOUR::TempoMap::BBTPointList::const_iterator& begin, - ARDOUR::TempoMap::BBTPointList::const_iterator& end); + void compute_current_bbt_points (std::vector& 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; @@ -1741,7 +1742,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD Gtk::Table toolbar_selection_clock_table; Gtk::Label toolbar_selection_cursor_label; - Gtkmm2ext::TearOff* _mouse_mode_tearoff; ArdourButton mouse_select_button; ArdourButton mouse_draw_button; ArdourButton mouse_move_button; @@ -1800,23 +1800,17 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD Glib::RefPtr zoom_focus_action (Editing::ZoomFocus); Gtk::HBox _zoom_box; - Gtkmm2ext::TearOff* _zoom_tearoff; void zoom_adjustment_changed(); void setup_toolbar (); void setup_tooltips (); - Gtkmm2ext::TearOff* _tools_tearoff; Gtk::HBox toolbar_hbox; Gtk::EventBox toolbar_base; Gtk::Frame toolbar_frame; Gtk::Viewport _toolbar_viewport; - /* midi toolbar */ - - Gtk::HBox panic_box; - void setup_midi_toolbar (); /* selection process */ @@ -1989,6 +1983,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void update_title_s (const std::string & snapshot_name); void instant_save (); + bool no_save_instant; boost::shared_ptr last_audition_region; @@ -2035,9 +2030,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void cms_new (boost::shared_ptr); void current_mixer_strip_hidden (); - void detach_tearoff (Gtk::Box* b, Gtk::Window* w); - void reattach_tearoff (Gtk::Box* b, Gtk::Window* w, int32_t n); -#ifdef GTKOSX +#ifdef __APPLE__ void ensure_all_elements_drawn (); #endif /* nudging tracks */ @@ -2132,7 +2125,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void get_regions_after (RegionSelection&, framepos_t where, const TrackViewList& ts) const; RegionSelection get_regions_from_selection_and_edit_point (); - RegionSelection get_regions_from_selection_and_entered (); + RegionSelection get_regions_from_selection_and_entered () const; void start_updating_meters (); void stop_updating_meters (); @@ -2250,12 +2243,21 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD QuantizeDialog* quantize_dialog; MainMenuDisabler* _main_menu_disabler; + /* private helper functions to help with registering axis */ + + Glib::RefPtr reg_sens (Glib::RefPtr group, char const * name, char const * label, sigc::slot slot); + void toggle_reg_sens (Glib::RefPtr group, char const * name, char const * label, sigc::slot slot); + void radio_reg_sens (Glib::RefPtr action_group, Gtk::RadioAction::Group& radio_group, char const * name, char const * label, sigc::slot slot); + + Gtkmm2ext::ActionMap myactions; + friend class Drag; 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;