X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Feditor.h;h=168f3dcc90a4eb321655e472306dd962ae68db41;hb=5fef65538040fbac1b9edd1847a269aa925a49c9;hp=76006194b991f88e246a91c29fcfd52f9b5e7366;hpb=db60bc86b8cbcee44e333047346714bd138b1ca6;p=ardour.git diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 76006194b9..168f3dcc90 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -58,6 +58,7 @@ #include "enums.h" #include "editor_items.h" #include "region_selection.h" +#include "selection_memento.h" namespace Gtkmm2ext { class TearOff; @@ -149,6 +150,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD double visible_canvas_height () const { return _visible_canvas_height; } + double trackviews_height () const; void cycle_snap_mode (); void next_snap_choice (); @@ -176,11 +178,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD Editing::MidiEditMode current_midi_edit_mode () const; void remove_midi_note (ArdourCanvas::Item *, GdkEvent *); - bool internal_editing() const { return _internal_editing ; } - void set_internal_edit (bool yn); - bool toggle_internal_editing_from_double_click (GdkEvent*); + bool internal_editing() const; - void _ensure_time_axis_view_is_visible (TimeAxisView const & tav, bool at_top); void foreach_time_axis_view (sigc::slot); void add_to_idle_resize (TimeAxisView*, int32_t); @@ -251,7 +250,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void maybe_locate_with_edit_preroll (framepos_t); void play_with_preroll (); void select_all_in_track (Selection::Operation op); - void select_all_regions (Selection::Operation op); + void select_all_objects (Selection::Operation op); void invert_selection_in_track (); void invert_selection (); void deselect_all (); @@ -277,7 +276,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void export_range (); void export_region (); - void add_toplevel_controls (Gtk::Container&); + void add_transport_frame (Gtk::Container&); + void add_toplevel_menu (Gtk::Container&); Gtk::HBox& get_status_bar_packer() { return status_bar_hpacker; } void set_zoom_focus (Editing::ZoomFocus); @@ -285,6 +285,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD framecnt_t get_current_zoom () const { return samples_per_pixel; } void cycle_zoom_focus (); void temporal_zoom_step (bool coarser); + 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); @@ -311,6 +312,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD /* nudge is initiated by transport controls owned by ARDOUR_UI */ framecnt_t get_nudge_distance (framepos_t pos, framecnt_t& next); + framecnt_t get_paste_offset (framepos_t pos, unsigned paste_count, framecnt_t duration); Evoral::MusicalTime get_grid_type_as_beats (bool& success, framepos_t position); void nudge_forward (bool next, bool force_playhead); @@ -367,7 +369,9 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD 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 (); void reset_y_origin (double); @@ -401,6 +405,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void get_regions_corresponding_to (boost::shared_ptr region, std::vector& regions, bool src_comparison); + void get_regionviews_by_id (PBD::ID const & id, RegionSelection & regions) const; + void center_screen (framepos_t); TrackViewList axis_views_from_routes (boost::shared_ptr) const; @@ -408,9 +414,19 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD Gtkmm2ext::TearOff* mouse_mode_tearoff () const { return _mouse_mode_tearoff; } Gtkmm2ext::TearOff* tools_tearoff () const { return _tools_tearoff; } - void snap_to (framepos_t& first, int32_t direction = 0, bool for_mark = false); - void snap_to_with_modifier (framepos_t& first, GdkEvent const *, int32_t direction = 0, bool for_mark = false); - void snap_to (framepos_t& first, framepos_t& last, int32_t direction = 0, bool for_mark = false); + void snap_to (framepos_t& first, + ARDOUR::RoundMode direction = ARDOUR::RoundNearest, + bool for_mark = false); + + void snap_to_with_modifier (framepos_t& first, + GdkEvent const * ev, + ARDOUR::RoundMode direction = ARDOUR::RoundNearest, + bool for_mark = false); + + void snap_to (framepos_t& first, + framepos_t& last, + ARDOUR::RoundMode direction = ARDOUR::RoundNearest, + bool for_mark = false); void begin_reversible_command (std::string cmd_name); void begin_reversible_command (GQuark); @@ -470,6 +486,12 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void metric_get_samples (std::vector&, gdouble, gdouble, gint); void metric_get_minsec (std::vector&, gdouble, gdouble, gint); + /* editing operations that need to be public */ + void mouse_add_new_marker (framepos_t where, bool is_cd=false, bool is_xrun=false); + void split_regions_at (framepos_t, RegionSelection&); + 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); + protected: void map_transport_state (); void map_position_change (framepos_t); @@ -522,12 +544,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void set_samples_per_pixel (framecnt_t); Editing::MouseMode mouse_mode; - Editing::MouseMode pre_internal_mouse_mode; - Editing::SnapType pre_internal_snap_type; - Editing::SnapMode pre_internal_snap_mode; - Editing::SnapType internal_snap_type; - Editing::SnapMode internal_snap_mode; - bool _internal_editing; Editing::MouseMode effective_mouse_mode () const; enum JoinObjectRangeState { @@ -561,9 +577,9 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD Gtk::VBox scrollers_rulers_markers_box; void location_changed (ARDOUR::Location *); - void location_flags_changed (ARDOUR::Location *, void *); + void location_flags_changed (ARDOUR::Location *); void refresh_location_display (); - void refresh_location_display_internal (ARDOUR::Locations::LocationList&); + void refresh_location_display_internal (const ARDOUR::Locations::LocationList&); void add_new_location (ARDOUR::Location *); ArdourCanvas::Container* add_new_location_internal (ARDOUR::Location *); void location_gone (ARDOUR::Location *); @@ -625,7 +641,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void hide_marker (ArdourCanvas::Item*, GdkEvent*); void clear_marker_display (); - void mouse_add_new_marker (framepos_t where, bool is_cd=false, bool is_xrun=false); void mouse_add_new_range (framepos_t); bool choose_new_marker_name(std::string &name); void update_cd_marker_display (); @@ -824,11 +839,14 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void store_ruler_visibility (); void restore_ruler_visibility (); - enum MinsecRulerScale { + + + enum MinsecRulerScale { + minsec_show_msecs, minsec_show_seconds, minsec_show_minutes, minsec_show_hours, - minsec_show_frames + minsec_show_many_hours }; MinsecRulerScale minsec_ruler_scale; @@ -843,7 +861,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD timecode_show_frames, timecode_show_seconds, timecode_show_minutes, - timecode_show_hours + timecode_show_hours, + timecode_show_many_hours }; TimecodeRulerScale timecode_ruler_scale; @@ -856,7 +875,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void set_samples_ruler_scale (framepos_t, framepos_t); enum BBTRulerScale { - bbt_over, + bbt_show_many, bbt_show_64, bbt_show_16, bbt_show_4, @@ -963,6 +982,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD std::vector region_boundary_cache; void build_region_boundary_cache (); + Gtk::HBox toplevel_hpacker; + Gtk::HBox top_hbox; Gtk::HBox bottom_hbox; @@ -1099,9 +1120,14 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD Gtkmm2ext::ActionMap editor_action_map; Gtkmm2ext::Bindings key_bindings; + /* CUT/COPY/PASTE */ + + framepos_t last_paste_pos; + unsigned paste_count; + void cut_copy (Editing::CutCopyOp); bool can_cut_copy () const; - void cut_copy_points (Editing::CutCopyOp); + void cut_copy_points (Editing::CutCopyOp, Evoral::MusicalTime earliest=Evoral::MusicalTime(), bool midi=false); void cut_copy_regions (Editing::CutCopyOp, RegionSelection&); void cut_copy_ranges (Editing::CutCopyOp); void cut_copy_midi (Editing::CutCopyOp); @@ -1133,9 +1159,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void change_region_layering_order (bool from_context_menu); void lower_region (); void lower_region_to_bottom (); - void split_regions_at (framepos_t, RegionSelection&); void split_region_at_transients (); - void split_region_at_points (boost::shared_ptr, ARDOUR::AnalysisFeatureList&, bool can_ferret, bool select_new = false); void crop_region_to_selection (); void crop_region_to (framepos_t start, framepos_t end); void set_sync_point (framepos_t, const RegionSelection&); @@ -1166,6 +1190,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void reset_region_scale_amplitude (); void adjust_region_gain (bool up); void quantize_region (); + void legatize_region (bool shrink_only); void insert_patch_change (bool from_context); void fork_region (); @@ -1212,7 +1237,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void play_location (ARDOUR::Location&); void loop_location (ARDOUR::Location&); - void temporal_zoom_selection (); + void calc_extra_zoom_edges(framepos_t &start, framepos_t &end); + void temporal_zoom_selection (bool both_axes = false); void temporal_zoom_region (bool both_axes); void zoom_to_region (bool both_axes); void temporal_zoom_session (); @@ -1302,6 +1328,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void jump_forward_to_mark (); void jump_backward_to_mark (); void cursor_align (bool playhead_to_edit); + void toggle_skip_playback (); void remove_last_capture (); void select_all_selectables_using_time_selection (); @@ -1320,6 +1347,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void set_punch_from_selection (); void set_punch_from_region (); + void set_session_extents_from_selection (); + void set_loop_from_edit_range (bool play); void set_loop_from_region (bool play); void set_punch_from_edit_range (); @@ -1382,6 +1411,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void set_fade_in_active (bool); void set_fade_out_active (bool); + void fade_range (); + std::set > motion_frozen_playlists; bool _dragging_playhead; @@ -1427,7 +1458,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD bool canvas_feature_line_event (GdkEvent* event, ArdourCanvas::Item*, RegionView*); bool canvas_stream_view_event (GdkEvent* event,ArdourCanvas::Item*, RouteTimeAxisView*); bool canvas_marker_event (GdkEvent* event,ArdourCanvas::Item*, Marker*); - bool canvas_zoom_rect_event (GdkEvent* event,ArdourCanvas::Item*); bool canvas_tempo_marker_event (GdkEvent* event,ArdourCanvas::Item*, TempoMarker*); bool canvas_meter_marker_event (GdkEvent* event,ArdourCanvas::Item*, MeterMarker*); bool canvas_automation_track_event(GdkEvent* event, ArdourCanvas::Item*, AutomationTimeAxisView*); @@ -1585,10 +1615,13 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD ArdourButton tav_expand_button; ArdourButton tav_shrink_button; ArdourDropdown visible_tracks_selector; + ArdourDropdown zoom_preset_selector; int32_t _visible_track_count; void build_track_count_menu (); void set_visible_track_count (int32_t); + + void set_zoom_preset(int64_t); Gtk::VBox toolbar_clock_vbox; Gtk::VBox toolbar_selection_clock_vbox; @@ -1599,10 +1632,10 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD ArdourButton mouse_select_button; ArdourButton mouse_draw_button; ArdourButton mouse_move_button; - ArdourButton mouse_gain_button; - ArdourButton mouse_zoom_button; ArdourButton mouse_timefx_button; + ArdourButton mouse_content_button; ArdourButton mouse_audition_button; + ArdourButton mouse_cut_button; ArdourButton smart_mode_button; Glib::RefPtr smart_mode_action; @@ -1611,9 +1644,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void mouse_mode_object_range_toggled (); bool ignore_mouse_mode_toggle; - ArdourButton internal_edit_button; - void toggle_internal_editing (); - bool mouse_select_button_release (GdkEventButton*); Gtk::VBox automation_box; @@ -1680,6 +1710,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD Selection* selection; Selection* cut_buffer; + SelectionMemento* _selection_memento; void time_selection_changed (); void update_time_selection_display (); @@ -1698,6 +1729,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void point_selection_changed (); void marker_selection_changed (); + bool _ignore_follow_edits; + void cancel_selection (); void cancel_time_selection (); @@ -1735,11 +1768,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD ArdourCanvas::Rectangle *rubberband_rect; - /* mouse zoom process */ - - ArdourCanvas::Rectangle *zoom_rect; - void reposition_zoom_rect (framepos_t start, framepos_t end); - EditorRouteGroups* _route_groups; EditorRoutes* _routes; EditorRegions* _regions; @@ -1842,7 +1870,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void write_selection (); - XMLNode *before; /* used in *_reversible_command */ + std::list before; /* used in *_reversible_command */ void update_title (); void update_title_s (const std::string & snapshot_name); @@ -1982,6 +2010,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void edit_point_chosen (Editing::EditPoint); Glib::RefPtr edit_point_action (Editing::EditPoint); std::vector edit_point_strings; + std::vector edit_mode_strings; void selected_marker_moved (ARDOUR::Location*); @@ -2000,8 +2029,13 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void select_next_route (); void select_prev_route (); - void snap_to_internal (framepos_t& first, int32_t direction = 0, bool for_mark = false); - void timecode_snap_to_internal (framepos_t& first, int32_t direction = 0, bool for_mark = false); + void snap_to_internal (framepos_t& first, + ARDOUR::RoundMode direction = ARDOUR::RoundNearest, + bool for_mark = false); + + void timecode_snap_to_internal (framepos_t& first, + ARDOUR::RoundMode direction = ARDOUR::RoundNearest, + bool for_mark = false); RhythmFerret* rhythm_ferret; @@ -2095,6 +2129,10 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD TimeAxisView* _stepping_axis_view; void zoom_vertical_modifier_released(); + void bring_in_callback (Gtk::Label*, uint32_t n, uint32_t total, std::string name); + void update_bring_in_message (Gtk::Label* label, uint32_t n, uint32_t total, std::string name); + void bring_all_sources_into_session (); + friend class Drag; friend class RegionDrag; friend class RegionMoveDrag;