X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Feditor.h;h=eaa9132e862292486ea85c4e5f8dec6425c38888;hb=0038820f473664a9a4fb524537cd846a9e024661;hp=168f3dcc90a4eb321655e472306dd962ae68db41;hpb=5fef65538040fbac1b9edd1847a269aa925a49c9;p=ardour.git diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 168f3dcc90..eaa9132e86 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 @@ -97,6 +98,7 @@ class AutomationTimeAxisView; class BundleManager; class ButtonJoiner; class ControlPoint; +class CursorContext; class DragManager; class EditNoteDialog; class EditorCursor; @@ -230,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 { @@ -240,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 (); @@ -258,6 +261,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void set_selected_regionview_from_region_list (boost::shared_ptr region, Selection::Operation op = Selection::Set); + void remove_tracks (); + /* tempo */ void set_show_measures (bool yn); @@ -283,9 +288,9 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void set_zoom_focus (Editing::ZoomFocus); Editing::ZoomFocus get_zoom_focus () const { return zoom_focus; } framecnt_t get_current_zoom () const { return samples_per_pixel; } - void cycle_zoom_focus (); + void cycle_zoom_focus (); void temporal_zoom_step (bool coarser); - void ensure_time_axis_view_is_visible (TimeAxisView const & tav, bool at_top); + 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); @@ -313,7 +318,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD 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); + 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); @@ -359,8 +365,9 @@ 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 (); @@ -378,7 +385,9 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD 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 (Editing::EditIgnoreOption = Editing::EDIT_IGNORE_NONE, + bool use_context_click = false, + bool from_outside_canvas = false); bool update_mouse_speed (); bool decelerate_mouse_speed (); @@ -400,12 +409,23 @@ 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 get_regions_corresponding_to (boost::shared_ptr region, std::vector& regions, bool src_comparison); + void do_embed (std::vector paths, + Editing::ImportDisposition disposition, + Editing::ImportMode mode, + framepos_t& pos, + boost::shared_ptr instrument = boost::shared_ptr()); - void get_regionviews_by_id (PBD::ID const & id, RegionSelection & regions) const; + 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); @@ -428,22 +448,24 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD 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 { return _drags; } - void maybe_autoscroll (bool, bool, bool); - bool autoscroll_active() const; + 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); @@ -461,6 +483,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; } @@ -469,15 +504,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 */ @@ -487,11 +522,16 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD 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 mouse_add_new_marker (framepos_t where, bool is_cd=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); + void mouse_add_new_tempo_event (framepos_t where); + void mouse_add_new_meter_event (framepos_t where); + void edit_tempo_section (ARDOUR::TempoSection*); + void edit_meter_section (ARDOUR::MeterSection*); + protected: void map_transport_state (); void map_position_change (framepos_t); @@ -538,12 +578,16 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void cancel_visual_state_op (uint32_t n); framepos_t leftmost_frame; - framecnt_t samples_per_pixel; + framecnt_t samples_per_pixel; Editing::ZoomFocus zoom_focus; void set_samples_per_pixel (framecnt_t); Editing::MouseMode mouse_mode; + Editing::SnapType pre_internal_snap_type; + Editing::SnapMode pre_internal_snap_mode; + Editing::SnapType internal_snap_type; + Editing::SnapMode internal_snap_mode; Editing::MouseMode effective_mouse_mode () const; enum JoinObjectRangeState { @@ -642,6 +686,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); @@ -672,12 +718,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); @@ -714,6 +761,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 *); @@ -721,14 +771,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; @@ -766,15 +826,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; @@ -787,11 +847,11 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD */ ArdourCanvas::Container* _drag_motion_group; - /* a rect that sits at the bottom of all tracks to act as a drag-no-drop/clickable + /* a rect that sits at the bottom of all tracks to act as a drag-no-drop/clickable * target area. */ - ArdourCanvas::Rectangle* _canvas_drop_zone; - bool canvas_drop_zone_event (GdkEvent* event); + ArdourCanvas::Rectangle* _canvas_drop_zone; + bool canvas_drop_zone_event (GdkEvent* event); enum RulerType { ruler_metric_timecode = 0, @@ -828,7 +888,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, + void update_tempo_based_rulers (ARDOUR::TempoMap::BBTPointList::const_iterator& begin, ARDOUR::TempoMap::BBTPointList::const_iterator& end); void popup_ruler_menu (framepos_t where = 0, ItemType type = RegionItem); void update_ruler_visibility (); @@ -892,7 +952,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, + 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); @@ -901,7 +961,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; @@ -944,7 +1004,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; @@ -991,9 +1050,9 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD /** the adjustment that controls the overall editor vertical scroll position */ Gtk::Adjustment vertical_adjustment; - Gtk::Adjustment horizontal_adjustment; + Gtk::Adjustment horizontal_adjustment; - Gtk::Adjustment unused_adjustment; // yes, really; Gtk::Layout constructor requires refs + Gtk::Adjustment unused_adjustment; // yes, really; Gtk::Layout constructor requires refs Gtk::Layout controls_layout; bool control_layout_scroll (GdkEventScroll* ev); void reset_controls_layout_width (); @@ -1069,7 +1128,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD static int _idle_visual_changer (void *arg); int idle_visual_changer (); - void visual_changer (const VisualChange&); + void visual_changer (const VisualChange&); void ensure_visual_change_idle_handler (); /* track views */ @@ -1090,7 +1149,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; @@ -1116,9 +1176,9 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void register_actions (); void register_region_actions (); - void load_bindings (); - Gtkmm2ext::ActionMap editor_action_map; - Gtkmm2ext::Bindings key_bindings; + void load_bindings (); + Gtkmm2ext::ActionMap editor_action_map; + Gtkmm2ext::Bindings key_bindings; /* CUT/COPY/PASTE */ @@ -1127,7 +1187,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void cut_copy (Editing::CutCopyOp); bool can_cut_copy () const; - void cut_copy_points (Editing::CutCopyOp, Evoral::MusicalTime earliest=Evoral::MusicalTime(), bool midi=false); + 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); @@ -1190,13 +1250,20 @@ 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 (); void do_insert_time (); void insert_time (framepos_t, framecnt_t, Editing::InsertTimeOption, bool, bool, bool, bool, bool, bool); + void do_cut_time (); + void cut_time (framepos_t pos, framecnt_t distance, Editing::InsertTimeOption opt, bool ignore_music_glue, bool markers_too, bool tempo_too); + void tab_to_transient (bool forward); void set_tempo_from_region (); @@ -1240,7 +1307,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD 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); @@ -1264,24 +1330,52 @@ 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; - void toggle_midi_input_active (bool flip_others); + void toggle_midi_input_active (bool flip_others); ARDOUR::InterThreadInfo* current_interthread_info; @@ -1347,11 +1441,11 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void set_punch_from_selection (); void set_punch_from_region (); + void set_session_start_from_playhead (); + void set_session_end_from_playhead (); 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 (); 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); @@ -1526,25 +1620,21 @@ 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, + void draw_measures (ARDOUR::TempoMap::BBTPointList::const_iterator& begin, ARDOUR::TempoMap::BBTPointList::const_iterator& end); void new_tempo_section (); - void mouse_add_new_tempo_event (framepos_t where); - void mouse_add_new_meter_event (framepos_t where); void remove_tempo_marker (ArdourCanvas::Item*); void remove_meter_marker (ArdourCanvas::Item*); gint real_remove_tempo_marker (ARDOUR::TempoSection*); gint real_remove_meter_marker (ARDOUR::MeterSection*); - void edit_tempo_section (ARDOUR::TempoSection*); - void edit_meter_section (ARDOUR::MeterSection*); 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 (); @@ -1592,7 +1682,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void remove_metric_marks (); void draw_metric_marks (const ARDOUR::Metrics& metrics); - void compute_current_bbt_points (framepos_t left, framepos_t right, + void compute_current_bbt_points (framepos_t left, framepos_t right, ARDOUR::TempoMap::BBTPointList::const_iterator& begin, ARDOUR::TempoMap::BBTPointList::const_iterator& end); @@ -1617,11 +1707,11 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD 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); + 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; @@ -1713,7 +1803,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD SelectionMemento* _selection_memento; void time_selection_changed (); - void update_time_selection_display (); + void update_time_selection_display (); void track_selection_changed (); void region_selection_changed (); sigc::connection editor_regions_selection_changed_connection; @@ -1786,15 +1876,15 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD /* autoscrolling */ - sigc::connection autoscroll_connection; - bool autoscroll_horizontal_allowed; - bool autoscroll_vertical_allowed; - uint32_t autoscroll_cnt; - Gtk::Widget* autoscroll_widget; - ArdourCanvas::Rect autoscroll_boundary; + sigc::connection autoscroll_connection; + bool autoscroll_horizontal_allowed; + bool autoscroll_vertical_allowed; + uint32_t autoscroll_cnt; + Gtk::Widget* autoscroll_widget; + ArdourCanvas::Rect autoscroll_boundary; bool autoscroll_canvas (); - void start_canvas_autoscroll (bool allow_horiz, bool allow_vert, const ArdourCanvas::Rect& boundary); + void start_canvas_autoscroll (bool allow_horiz, bool allow_vert, const ArdourCanvas::Rect& boundary); void stop_canvas_autoscroll (); /* trimming */ @@ -1817,45 +1907,45 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD /* Drag-n-Drop */ int convert_drop_to_paths ( - std::vector& paths, - const Glib::RefPtr& context, - gint x, - gint y, - const Gtk::SelectionData& data, - guint info, - guint time); + std::vector& paths, + const Glib::RefPtr& context, + gint x, + gint y, + const Gtk::SelectionData& data, + guint info, + guint time); void track_canvas_drag_data_received ( - const Glib::RefPtr& context, - gint x, - gint y, - const Gtk::SelectionData& data, - guint info, - guint time); + const Glib::RefPtr& context, + gint x, + gint y, + const Gtk::SelectionData& data, + guint info, + guint time); void drop_paths ( - const Glib::RefPtr& context, - gint x, - gint y, - const Gtk::SelectionData& data, - guint info, - guint time); + const Glib::RefPtr& context, + gint x, + gint y, + const Gtk::SelectionData& data, + guint info, + guint time); void drop_regions ( - const Glib::RefPtr& context, - gint x, - gint y, - const Gtk::SelectionData& data, - guint info, - guint time); + const Glib::RefPtr& context, + gint x, + gint y, + const Gtk::SelectionData& data, + guint info, + guint time); void drop_routes ( - const Glib::RefPtr& context, - gint x, - gint y, - const Gtk::SelectionData& data, - guint info, - guint time); + const Glib::RefPtr& context, + gint x, + gint y, + const Gtk::SelectionData& data, + guint info, + guint time); /* audio export */ @@ -1870,6 +1960,10 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void write_selection (); + 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 (); @@ -1892,12 +1986,12 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void duplicate_range (bool with_dialog); - /** computes the timeline frame (sample) of an event whose coordinates + /** computes the timeline frame (sample) of an event whose coordinates * are in canvas units (pixels, scroll offset included). */ framepos_t canvas_event_sample (GdkEvent const *, double* px = 0, double* py = 0) const; - /** computes the timeline frame (sample) of an event whose coordinates + /** computes the timeline frame (sample) of an event whose coordinates * are in window units (pixels, no scroll offset). */ framepos_t window_event_sample (GdkEvent const *, double* px = 0, double* py = 0) const; @@ -1952,7 +2046,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 */ @@ -1973,6 +2067,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*); @@ -1993,6 +2089,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 (); @@ -2040,10 +2140,11 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD RhythmFerret* rhythm_ferret; void fit_tracks (TrackViewList &); - void fit_selected_tracks (); + void fit_selection (); void set_track_height (Height); - void remove_tracks (); + void _remove_tracks (); + bool idle_remove_tracks (); void toggle_tracks_active (); bool _have_idled; @@ -2111,7 +2212,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD bool _following_mixer_selection; int time_fx (ARDOUR::RegionList&, float val, bool pitching); - void note_edit_done (int, EditNoteDialog*); + void note_edit_done (int, EditNoteDialog*); void toggle_sound_midi_notes (); /** Flag for a bit of a hack wrt control point selection; see set_selected_control_point_from_click */