X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Feditor.h;h=2e2593dbf1c6d027b12d24b1561d21d7f0a51c28;hb=6f2ca4194c732cebc71edd8a4295eefebf7294b3;hp=75b66d6f047c7a3047a0fff6c25aa347a0a69a5c;hpb=d97199088bb6ee95e4cd6b4e6450ad9a54f559c1;p=ardour.git diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 75b66d6f04..2e2593dbf1 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -20,13 +20,14 @@ #ifndef __ardour_editor_h__ #define __ardour_editor_h__ +#include + +#include #include #include #include -#include #include -#include -#include +#include #include @@ -58,6 +59,7 @@ #include "enums.h" #include "editor_items.h" #include "region_selection.h" +#include "selection_memento.h" namespace Gtkmm2ext { class TearOff; @@ -96,6 +98,7 @@ class AutomationTimeAxisView; class BundleManager; class ButtonJoiner; class ControlPoint; +class CursorContext; class DragManager; class EditNoteDialog; class EditorCursor; @@ -149,6 +152,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 +180,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); @@ -231,7 +232,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD } double sample_to_pixel (framepos_t sample) const { - return sample / samples_per_pixel; + return round (sample / (double) samples_per_pixel); } double sample_to_pixel_unrounded (framepos_t sample) const { @@ -241,6 +242,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 Selection& get_cut_buffer() const { return *cut_buffer; } void track_mixer_selection (); @@ -277,7 +279,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 +288,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,7 +315,9 @@ 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); - Evoral::MusicalTime get_grid_type_as_beats (bool& success, framepos_t position); + framecnt_t get_paste_offset (framepos_t pos, unsigned paste_count, framecnt_t duration); + unsigned get_grid_beat_divisions(framepos_t position); + Evoral::Beats get_grid_type_as_beats (bool& success, framepos_t position); void nudge_forward (bool next, bool force_playhead); void nudge_backward (bool next, bool force_playhead); @@ -357,8 +363,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void scroll_tracks_down_line (); void scroll_tracks_up_line (); - bool scroll_up_one_track (); - bool scroll_down_one_track (); + bool scroll_up_one_track (bool skip_child_views = false); + bool scroll_down_one_track (bool skip_child_views = false); void prepare_for_cleanup (); void finish_cleanup (); @@ -367,14 +373,18 @@ 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); void reset_zoom (framecnt_t); void reposition_and_zoom (framepos_t, double); - framepos_t get_preferred_edit_position (bool ignore_playhead = false, bool use_context_click = false); + framepos_t get_preferred_edit_position (bool ignore_playhead = false, + bool use_context_click = false, + bool from_outside_canvas = false); bool update_mouse_speed (); bool decelerate_mouse_speed (); @@ -396,11 +406,24 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD int get_regionview_count_from_region_list (boost::shared_ptr); - void do_import (std::vector paths, Editing::ImportDisposition, Editing::ImportMode mode, ARDOUR::SrcQuality, framepos_t&); - void do_embed (std::vector paths, Editing::ImportDisposition, Editing::ImportMode mode, framepos_t&); + void do_import (std::vector paths, + Editing::ImportDisposition disposition, + Editing::ImportMode mode, + ARDOUR::SrcQuality quality, + framepos_t& pos, + boost::shared_ptr instrument = boost::shared_ptr()); + + void do_embed (std::vector paths, + Editing::ImportDisposition disposition, + Editing::ImportMode mode, + framepos_t& pos, + boost::shared_ptr instrument = boost::shared_ptr()); 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 get_per_region_note_selection (std::list > > > >&) const; + void center_screen (framepos_t); TrackViewList axis_views_from_routes (boost::shared_ptr) const; @@ -408,12 +431,28 @@ 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_selection_op_history (); + void begin_reversible_selection_op (std::string cmd_name); + void commit_reversible_selection_op (); + void undo_selection_op (); + void redo_selection_op (); void begin_reversible_command (std::string cmd_name); void begin_reversible_command (GQuark); + void abort_reversible_command (); void commit_reversible_command (); DragManager* drags () const { @@ -423,11 +462,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void maybe_autoscroll (bool, bool, bool); bool autoscroll_active() const; - Gdk::Cursor* get_canvas_cursor () const { return current_canvas_cursor; } - void set_canvas_cursor (Gdk::Cursor*, bool save=false); - - void push_canvas_cursor (Gdk::Cursor*); - void pop_canvas_cursor (); + Gdk::Cursor* get_canvas_cursor () const; void set_current_trimmable (boost::shared_ptr); void set_current_movable (boost::shared_ptr); @@ -445,6 +480,19 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void get_pointer_position (double &, double &) const; + /** Context for mouse entry (stored in a stack). */ + struct EnterContext { + ItemType item_type; + boost::shared_ptr cursor_ctx; + }; + + /** Get the topmost enter context for the given item type. + * + * This is used to change the cursor associated with a given enter context, + * which may not be on the top of the stack. + */ + EnterContext* get_enter_context(ItemType type); + TimeAxisView* stepping_axis_view () { return _stepping_axis_view; } @@ -453,15 +501,15 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD _stepping_axis_view = v; } - ArdourCanvas::Container* get_trackview_group () const { return _trackview_group; } - ArdourCanvas::Container* get_noscroll_group () const { return no_scroll_group; } - ArdourCanvas::ScrollGroup* get_hscroll_group () const { return h_scroll_group; } - ArdourCanvas::ScrollGroup* get_vscroll_group () const { return v_scroll_group; } - ArdourCanvas::ScrollGroup* get_hvscroll_group () const { return hv_scroll_group; } + ArdourCanvas::Container* get_trackview_group () const { return _trackview_group; } + ArdourCanvas::Container* get_noscroll_group () const { return no_scroll_group; } + ArdourCanvas::ScrollGroup* get_hscroll_group () const { return h_scroll_group; } + ArdourCanvas::ScrollGroup* get_hvscroll_group () const { return hv_scroll_group; } + ArdourCanvas::ScrollGroup* get_cursor_scroll_group () const { return cursor_scroll_group; } - ArdourCanvas::GtkCanvasViewport* get_track_canvas () const; + ArdourCanvas::GtkCanvasViewport* get_track_canvas () const; - void override_visible_track_count (); + void override_visible_track_count (); /* Ruler metrics methods */ @@ -474,7 +522,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD 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 (); + RegionSelection get_regions_from_selection_and_mouse (framepos_t); protected: void map_transport_state (); @@ -528,12 +576,10 @@ 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 { @@ -567,9 +613,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 *); @@ -632,6 +678,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void hide_marker (ArdourCanvas::Item*, GdkEvent*); void clear_marker_display (); void mouse_add_new_range (framepos_t); + void mouse_add_new_loop (framepos_t); + void mouse_add_new_punch (framepos_t); bool choose_new_marker_name(std::string &name); void update_cd_marker_display (); void ensure_cd_marker_updated (LocationMarkers * lam, ARDOUR::Location * location); @@ -662,12 +710,13 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type); bool button_release_can_deselect; + bool _mouse_changed_selection; void catch_vanishing_regionview (RegionView *); void set_selected_track (TimeAxisView&, Selection::Operation op = Selection::Set, bool no_remove=false); void select_all_tracks (); - void select_all_internal_edit (Selection::Operation); + bool select_all_internal_edit (Selection::Operation); bool set_selected_control_point_from_click (bool press, Selection::Operation op = Selection::Set); void set_selected_track_from_click (bool press, Selection::Operation op = Selection::Set, bool no_remove=false); @@ -704,6 +753,9 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void popup_control_point_context_menu (ArdourCanvas::Item *, GdkEvent *); Gtk::Menu _control_point_context_menu; + void popup_note_context_menu (ArdourCanvas::Item *, GdkEvent *); + Gtk::Menu _note_context_menu; + void add_routes (ARDOUR::RouteList&); void timeaxisview_deleted (TimeAxisView *); @@ -711,14 +763,24 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD Gtk::VBox global_vpacker; Gtk::VBox vpacker; - std::stack _cursor_stack; - Gdk::Cursor* current_canvas_cursor; + /* Cursor stuff. Do not use directly, use via CursorContext. */ + friend class CursorContext; + std::vector _cursor_stack; + void set_canvas_cursor (Gdk::Cursor*); + size_t push_canvas_cursor (Gdk::Cursor*); + void pop_canvas_cursor (); + Gdk::Cursor* which_grabber_cursor () const; Gdk::Cursor* which_track_cursor () const; Gdk::Cursor* which_mode_cursor () const; Gdk::Cursor* which_trim_cursor (bool left_side) const; - bool reset_canvas_cursor (); - void choose_canvas_cursor_on_entry (GdkEventCrossing*, ItemType); + Gdk::Cursor* which_canvas_cursor (ItemType type) const; + + /** Push the appropriate enter/cursor context on item entry. */ + void choose_canvas_cursor_on_entry (ItemType); + + /** Update all enter cursors based on current settings. */ + void update_all_enter_cursors (); ArdourCanvas::GtkCanvas* _track_canvas; ArdourCanvas::GtkCanvasViewport* _track_canvas_viewport; @@ -756,15 +818,15 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD /* The group containing all other groups that are scrolled vertically and horizontally. */ - ArdourCanvas::ScrollGroup* hv_scroll_group; + ArdourCanvas::ScrollGroup* hv_scroll_group; - /* The group containing all other groups that are scrolled vertically ONLY + /* The group containing all other groups that are scrolled horizontally ONLY */ - ArdourCanvas::ScrollGroup* v_scroll_group; + ArdourCanvas::ScrollGroup* h_scroll_group; - /* The group containing all other groups that are scrolled horizontally ONLY + /* Scroll group for cursors, scrolled horizontally, above everything else */ - ArdourCanvas::ScrollGroup* h_scroll_group; + ArdourCanvas::ScrollGroup* cursor_scroll_group; /* The group containing all trackviews. */ ArdourCanvas::Container* no_scroll_group; @@ -829,11 +891,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; @@ -848,7 +913,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; @@ -861,7 +927,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, @@ -887,7 +953,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD ArdourCanvas::Ruler* samples_ruler; ArdourCanvas::Ruler* minsec_ruler; - static const double timebar_height; + static double timebar_height; guint32 visible_timebars; Gtk::Menu *editor_ruler_menu; @@ -930,7 +996,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void toggle_ruler_video (bool onoff) {ruler_video_action->set_active(onoff);} int videotl_bar_height; /* in units of timebar_height; default: 4 */ int get_videotl_bar_height () const { return videotl_bar_height; } - void export_video (bool range = false); void toggle_region_video_lock (); friend class EditorCursor; @@ -968,6 +1033,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; @@ -1074,7 +1141,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD framepos_t cut_buffer_start; framecnt_t cut_buffer_length; - Gdk::Cursor* pre_press_cursor; + boost::shared_ptr _press_cursor_ctx; ///< Button press cursor context + boost::weak_ptr _trimmable; boost::weak_ptr _movable; @@ -1104,9 +1172,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::Beats earliest=Evoral::Beats(), bool midi=false); void cut_copy_regions (Editing::CutCopyOp, RegionSelection&); void cut_copy_ranges (Editing::CutCopyOp); void cut_copy_midi (Editing::CutCopyOp); @@ -1169,6 +1242,11 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void reset_region_scale_amplitude (); void adjust_region_gain (bool up); void quantize_region (); + void quantize_regions (const RegionSelection& rs); + void legatize_region (bool shrink_only); + void legatize_regions (const RegionSelection& rs, bool shrink_only); + void transform_region (); + void transform_regions (const RegionSelection& rs); void insert_patch_change (bool from_context); void fork_region (); @@ -1215,9 +1293,9 @@ 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 (); void temporal_zoom (framecnt_t samples_per_pixel); void temporal_zoom_by_frame (framepos_t start, framepos_t end); @@ -1241,19 +1319,47 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD bool idle_drop_paths (std::vector paths, framepos_t frame, double ypos, bool copy); void drop_paths_part_two (const std::vector& paths, framepos_t frame, double ypos, bool copy); - int import_sndfiles (std::vector paths, Editing::ImportDisposition, Editing::ImportMode mode, - ARDOUR::SrcQuality, framepos_t& pos, - int target_regions, int target_tracks, boost::shared_ptr&, bool); - int embed_sndfiles (std::vector paths, bool multiple_files, bool& check_sample_rate, - Editing::ImportDisposition disposition, Editing::ImportMode mode, - framepos_t& pos, int target_regions, int target_tracks, boost::shared_ptr&); - - int add_sources (std::vector paths, ARDOUR::SourceList& sources, framepos_t& pos, - Editing::ImportDisposition, Editing::ImportMode, - int target_regions, int target_tracks, boost::shared_ptr&, bool add_channel_suffix); - - int finish_bringing_in_material (boost::shared_ptr region, uint32_t, uint32_t, framepos_t& pos, Editing::ImportMode mode, - boost::shared_ptr& existing_track, const std::string& new_track_name); + int import_sndfiles (std::vector paths, + Editing::ImportDisposition disposition, + Editing::ImportMode mode, + ARDOUR::SrcQuality quality, + framepos_t& pos, + int target_regions, + int target_tracks, + boost::shared_ptr& track, + bool replace, + boost::shared_ptr instrument = boost::shared_ptr()); + + int embed_sndfiles (std::vector paths, + bool multiple_files, + bool& check_sample_rate, + Editing::ImportDisposition disposition, + Editing::ImportMode mode, + framepos_t& pos, + int target_regions, + int target_tracks, + boost::shared_ptr& track, + boost::shared_ptr instrument = boost::shared_ptr()); + + int add_sources (std::vector paths, + ARDOUR::SourceList& sources, + framepos_t& pos, + Editing::ImportDisposition disposition, + Editing::ImportMode mode, + int target_regions, + int target_tracks, + boost::shared_ptr& track, + bool add_channel_suffix, + boost::shared_ptr instrument = boost::shared_ptr()); + + int finish_bringing_in_material (boost::shared_ptr region, + uint32_t in_chans, + uint32_t out_chans, + framepos_t& pos, + Editing::ImportMode mode, + boost::shared_ptr& existing_track, + const std::string& new_track_name, + boost::shared_ptr instrument); boost::shared_ptr get_nth_selected_audio_track (int nth) const; boost::shared_ptr get_nth_selected_midi_track (int nth) const; @@ -1305,6 +1411,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 (); @@ -1323,9 +1430,9 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void set_punch_from_selection (); void set_punch_from_region (); - void set_loop_from_edit_range (bool play); + void set_session_extents_from_selection (); + void set_loop_from_region (bool play); - void set_punch_from_edit_range (); 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); @@ -1385,6 +1492,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; @@ -1430,7 +1539,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*); @@ -1517,7 +1625,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void edit_tempo_marker (TempoMarker&); void edit_meter_marker (MeterMarker&); void edit_control_point (ArdourCanvas::Item*); - void edit_notes (TimeAxisViewItem&); + void edit_notes (MidiRegionView*); void marker_menu_edit (); void marker_menu_remove (); @@ -1588,10 +1696,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; @@ -1602,9 +1713,8 @@ 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; @@ -1615,9 +1725,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; @@ -1684,6 +1791,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 (); @@ -1702,6 +1810,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 (); @@ -1739,11 +1849,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; @@ -1846,7 +1951,11 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void write_selection (); - XMLNode *before; /* used in *_reversible_command */ + uint32_t selection_op_cmd_depth; + uint32_t selection_op_history_it; + + std::list selection_op_history; /* used in *_reversible_selection_op */ + std::list before; /* used in *_reversible_command */ void update_title (); void update_title_s (const std::string & snapshot_name); @@ -1928,7 +2037,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void apply_filter (ARDOUR::Filter&, std::string cmd, ProgressReporter* progress = 0); Command* apply_midi_note_edit_op_to_region (ARDOUR::MidiOperator& op, MidiRegionView& mrv); - void apply_midi_note_edit_op (ARDOUR::MidiOperator& op); + void apply_midi_note_edit_op (ARDOUR::MidiOperator& op, const RegionSelection& rs); /* handling cleanup */ @@ -1949,6 +2058,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD */ RegionView* entered_regionview; + std::vector _enter_stack; + bool clear_entered_track; bool left_track_canvas (GdkEventCrossing*); bool entered_track_canvas (GdkEventCrossing*); @@ -1969,6 +2080,10 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD Glib::RefPtr undo_action; Glib::RefPtr redo_action; + Glib::RefPtr alternate_redo_action; + Glib::RefPtr alternate_alternate_redo_action; + Glib::RefPtr selection_undo_action; + Glib::RefPtr selection_redo_action; void history_changed (); @@ -1986,6 +2101,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*); @@ -2004,13 +2120,18 @@ 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; void fit_tracks (TrackViewList &); - void fit_selected_tracks (); + void fit_selection (); void set_track_height (Height); void remove_tracks (); @@ -2099,6 +2220,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;