X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Feditor.h;h=8150f44ae3398b6f85a6fe29ca6833db3f37dc0f;hb=c78528dcea03a61685ad0586eaa6302847af6fe9;hp=f81a212d9b39dc2dee2c58b3d1ff7372741e6bc3;hpb=9c4f5ac000ad91b55e4cf91317b7a89f6239870e;p=ardour.git diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index f81a212d9b..8150f44ae3 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -25,9 +25,6 @@ #include #include #include -#include - -#include #include @@ -41,9 +38,10 @@ #include #include -#include -#include -#include +#include "gtkmm2ext/selector.h" +#include "gtkmm2ext/click_box.h" +#include "gtkmm2ext/dndtreeview.h" +#include "gtkmm2ext/stateful_button.h" #include "pbd/stateful.h" #include "pbd/signals.h" @@ -65,6 +63,7 @@ #include "editor_items.h" #include "region_selection.h" #include "canvas.h" +#include "window_proxy.h" namespace Gnome { namespace Canvas { class NoEventText; @@ -72,6 +71,7 @@ namespace Gnome { namespace Canvas { namespace Gtkmm2ext { class TearOff; + class Bindings; } namespace ARDOUR { @@ -106,7 +106,6 @@ class BundleManager; class ControlPoint; class CrossfadeView; class DragManager; -class GlobalPortMatrixWindow; class GroupedButtons; class Marker; class MidiRegionView; @@ -128,6 +127,11 @@ class EditorRegions; class EditorLocations; class EditorSnapshots; class EditorSummary; +class RegionLayeringOrderEditor; +class ProgressReporter; +class EditorCursor; +class MouseCursors; +class VerboseCursor; /* */ class ImageFrameView; @@ -139,23 +143,6 @@ class ImageFrameSocketHandler ; class TimeAxisViewItem ; /* */ -struct EditorCursor { - Editor& editor; - ArdourCanvas::Points points; - ArdourCanvas::Line canvas_item; - nframes64_t current_frame; - double length; - - EditorCursor (Editor&, bool (Editor::*)(GdkEvent*,ArdourCanvas::Item*)); - ~EditorCursor (); - - void set_position (nframes64_t); - void set_length (double units); - void set_y_axis (double position); - - PBD::Signal1 PositionChanged; -}; - class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARDOUR::SessionHandlePtr { public: @@ -168,10 +155,10 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void first_idle (); virtual bool have_idled () const { return _have_idled; } - nframes64_t leftmost_position() const { return leftmost_frame; } + framepos_t leftmost_position() const { return leftmost_frame; } - nframes64_t current_page_frames() const { - return (nframes64_t) floor (_canvas_width * frames_per_unit); + framecnt_t current_page_frames() const { + return (framecnt_t) floor (_canvas_width * frames_per_unit); } double canvas_height () const { @@ -213,7 +200,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void foreach_time_axis_view (sigc::slot); void add_to_idle_resize (TimeAxisView*, int32_t); - RouteTimeAxisView* get_route_view_by_id (PBD::ID& id); + RouteTimeAxisView* get_route_view_by_route_id (PBD::ID& id) const; void consider_auditioning (boost::shared_ptr); void hide_a_region (boost::shared_ptr); @@ -221,6 +208,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD #ifdef USE_RUBBERBAND std::vector rb_opt_strings; + int rb_current_opt; #endif /* things that need to be public to be used in the main menubar */ @@ -228,6 +216,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void new_region_from_selection (); void separate_regions_between (const TimeSelection&); void separate_region_from_selection (); + void separate_under_selected_regions (); void separate_region_from_punch (); void separate_region_from_loop (); void separate_regions_using_location (ARDOUR::Location&); @@ -235,11 +224,11 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD /* undo related */ - nframes64_t unit_to_frame (double unit) const { - return (nframes64_t) rint (unit * frames_per_unit); + framepos_t unit_to_frame (double unit) const { + return (framepos_t) rint (unit * frames_per_unit); } - double frame_to_unit (nframes64_t frame) const { + double frame_to_unit (framepos_t frame) const { return rint ((double) frame / (double) frames_per_unit); } @@ -254,7 +243,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD xscroll_adjustment. */ - nframes64_t pixel_to_frame (double pixel) const { + framepos_t pixel_to_frame (double pixel) const { /* pixel can be less than zero when motion events are processed. since we've already run the world->canvas @@ -263,13 +252,13 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD */ if (pixel >= 0) { - return (nframes64_t) rint (pixel * frames_per_unit * GNOME_CANVAS(track_canvas->gobj())->pixels_per_unit); + return (framepos_t) rint (pixel * frames_per_unit * GNOME_CANVAS(track_canvas->gobj())->pixels_per_unit); } else { return 0; } } - gulong frame_to_pixel (nframes64_t frame) const { + gulong frame_to_pixel (framepos_t frame) const { return (gulong) rint ((frame / (frames_per_unit * GNOME_CANVAS(track_canvas->gobj())->pixels_per_unit))); } @@ -304,6 +293,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD /* export */ void export_audio (); + void stem_export (); void export_selection (); void export_range (); void export_region (); @@ -335,12 +325,13 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void create_editor_mixer (); void show_editor_list (bool yn); void set_selected_mixer_strip (TimeAxisView&); - void hide_track_in_display (TimeAxisView* tv, bool temporary = false); + void mixer_strip_width_changed (); + void hide_track_in_display (TimeAxisView* tv, bool apply_to_selection = false); /* nudge is initiated by transport controls owned by ARDOUR_UI */ - nframes64_t get_nudge_distance (nframes64_t pos, nframes64_t& next); - Evoral::MusicalTime get_grid_type_as_beats (bool& success, nframes64_t position); + framecnt_t get_nudge_distance (framepos_t pos, framecnt_t& next); + Evoral::MusicalTime 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); @@ -356,7 +347,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void toggle_stationary_playhead (); bool stationary_playhead() const { return _stationary_playhead; } - void set_follow_playhead (bool yn); + void set_follow_playhead (bool yn, bool catch_up = true); void toggle_follow_playhead (); bool follow_playhead() const { return _follow_playhead; } bool dragging_playhead () const { return _dragging_playhead; } @@ -367,13 +358,9 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void toggle_measure_visibility (); void toggle_logo_visibility (); - double get_physical_screen_width () const { return physical_screen_width; }; - double physical_screen_width; - double physical_screen_height; - /* fades/xfades */ - void toggle_selected_region_fades (int dir); + void toggle_region_fades (int dir); void update_region_fade_visibility (); bool xfade_visibility() const { return _xfade_visibility; } void update_xfade_visibility (); @@ -397,13 +384,13 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void maximise_editing_space(); void restore_editing_space(); - void reset_x_origin (nframes64_t); + void reset_x_origin (framepos_t); void reset_x_origin_to_follow_playhead (); void reset_y_origin (double); void reset_zoom (double); - void reposition_and_zoom (nframes64_t, double); + void reposition_and_zoom (framepos_t, double); - nframes64_t get_preferred_edit_position (bool ignore_playhead = false); + framepos_t get_preferred_edit_position (bool ignore_playhead = false); bool update_mouse_speed (); bool decelerate_mouse_speed (); @@ -411,7 +398,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void toggle_meter_updating(); void show_rhythm_ferret(); - void show_global_port_matrix (ARDOUR::DataType); void goto_visual_state (uint32_t); void save_visual_state (uint32_t); @@ -426,53 +412,49 @@ 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, nframes64_t&); - void do_embed (std::vector paths, Editing::ImportDisposition, Editing::ImportMode mode, nframes64_t&); + 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 get_regions_corresponding_to (boost::shared_ptr region, std::vector& regions); - void show_verbose_canvas_cursor_with (const std::string& txt); - void hide_verbose_canvas_cursor(); - - void center_screen (nframes64_t); + void center_screen (framepos_t); 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 (nframes64_t& first, int32_t direction = 0, bool for_mark = false); - void snap_to_with_modifier (nframes64_t& first, GdkEvent const *, int32_t direction = 0, bool for_mark = false); - void snap_to (nframes64_t& first, nframes64_t& last, int32_t direction = 0, bool for_mark = false); + 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 begin_reversible_command (std::string cmd_name); + void begin_reversible_command (GQuark); void commit_reversible_command (); - /* handy cursors for everyone to use */ - - static Gdk::Cursor* cross_hair_cursor; - static Gdk::Cursor* trimmer_cursor; - static Gdk::Cursor* right_side_trim_cursor; - static Gdk::Cursor* left_side_trim_cursor; - static Gdk::Cursor* fade_in_cursor; - static Gdk::Cursor* fade_out_cursor; - static Gdk::Cursor* selector_cursor; - static Gdk::Cursor* grabber_cursor; - static Gdk::Cursor* grabber_edit_point_cursor; - static Gdk::Cursor* zoom_cursor; - static Gdk::Cursor* time_fx_cursor; - static Gdk::Cursor* fader_cursor; - static Gdk::Cursor* speaker_cursor; - static Gdk::Cursor* midi_pencil_cursor; - static Gdk::Cursor* midi_select_cursor; - static Gdk::Cursor* midi_resize_cursor; - static Gdk::Cursor* midi_erase_cursor; - static Gdk::Cursor* wait_cursor; - static Gdk::Cursor* timebar_cursor; - static Gdk::Cursor* transparent_cursor; + DragManager* drags () const { + return _drags; + } + + void maybe_autoscroll (bool, bool); + + Gdk::Cursor* get_canvas_cursor () const { return current_canvas_cursor; } + void set_canvas_cursor (Gdk::Cursor*, bool save=false); + void set_current_trimmable (boost::shared_ptr); + void set_current_movable (boost::shared_ptr); + + MouseCursors const * cursors () const { + return _cursors; + } + + VerboseCursor* verbose_cursor () const { + return _verbose_cursor; + } + + void get_pointer_position (double &, double &) const; protected: void map_transport_state (); - void map_position_change (nframes64_t); + void map_position_change (framepos_t); void on_realize(); @@ -483,7 +465,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD bool constructed; // to keep track of the playhead position for control_scroll - boost::optional _control_scroll_target; + boost::optional _control_scroll_target; PlaylistSelector* _playlist_selector; @@ -492,7 +474,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD struct VisualState { double y_position; double frames_per_unit; - nframes64_t leftmost_frame; + framepos_t leftmost_frame; Editing::ZoomFocus zoom_focus; std::list track_states; }; @@ -512,7 +494,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void cancel_visual_state_op (uint32_t n); bool end_visual_state_op (uint32_t n); - nframes64_t leftmost_frame; + framepos_t leftmost_frame; double frames_per_unit; Editing::ZoomFocus zoom_focus; @@ -520,6 +502,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void post_zoom (); Editing::MouseMode mouse_mode; + Editing::MouseMode pre_internal_mouse_mode; bool _internal_editing; Editing::MouseMode effective_mouse_mode () const; @@ -545,7 +528,11 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD int pre_maximal_editor_height; void pane_allocation_handler (Gtk::Allocation&, Gtk::Paned*); - Gtk::Notebook the_notebook; + 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; @@ -558,13 +545,15 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void location_changed (ARDOUR::Location *); void location_flags_changed (ARDOUR::Location *, void *); void refresh_location_display (); - void refresh_location_display_s (const PBD::PropertyChange&); void refresh_location_display_internal (ARDOUR::Locations::LocationList&); void add_new_location (ARDOUR::Location *); + ArdourCanvas::Group* add_new_location_internal (ARDOUR::Location *); void location_gone (ARDOUR::Location *); void remove_marker (ArdourCanvas::Item&, GdkEvent*); gint really_remove_marker (ARDOUR::Location* loc); void goto_nth_marker (int nth); + void toggle_marker_lines (); + void set_marker_line_visibility (bool); uint32_t location_marker_color; uint32_t location_range_color; @@ -573,31 +562,51 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD uint32_t location_cd_marker_color; struct LocationMarkers { - Marker* start; - Marker* end; - bool valid; - - LocationMarkers () : start(0), end(0), valid (true) {} - - ~LocationMarkers (); - - void hide(); - void show (); - void set_name (const std::string&); - void set_position (nframes64_t start, nframes64_t end = 0); - void set_color_rgba (uint32_t); + Marker* start; + Marker* end; + bool valid; + + LocationMarkers () : start(0), end(0), valid (true) {} + + ~LocationMarkers (); + + void hide (); + void show (); + + void set_show_lines (bool); + void set_selected (bool); + void canvas_height_set (double); + void setup_lines (); + + void set_name (const std::string&); + void set_position (framepos_t start, framepos_t end = 0); + void set_color_rgba (uint32_t); }; LocationMarkers *find_location_markers (ARDOUR::Location *) const; ARDOUR::Location* find_location_from_marker (Marker *, bool& is_start) const; Marker* entered_marker; + bool _show_marker_lines; typedef std::map LocationMarkerMap; LocationMarkerMap location_markers; + void update_marker_labels (); + void update_marker_labels (ArdourCanvas::Group *); + void check_marker_label (Marker *); + + /** A set of lists of Markers that are in each of the canvas groups + * for the marker sections at the top of the editor. These lists + * are kept sorted in time order between marker movements, so that after + * a marker has moved we can decide whether we need to update the labels + * for all markers or for just a few. + */ + std::map > _sorted_marker_lists; + void remove_sorted_marker (Marker *); + void hide_marker (ArdourCanvas::Item*, GdkEvent*); void clear_marker_display (); - void mouse_add_new_marker (nframes64_t where, bool is_cd=false, bool is_xrun=false); + void mouse_add_new_marker (framepos_t where, bool is_cd=false, bool is_xrun=false); bool choose_new_marker_name(std::string &name); void update_cd_marker_display (); void ensure_cd_marker_updated (LocationMarkers * lam, ARDOUR::Location * location); @@ -636,10 +645,11 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD 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 set_selected_control_point_from_click (Selection::Operation op = Selection::Set, bool no_remove=false); void set_selected_track_from_click (bool press, Selection::Operation op = Selection::Set, bool no_remove=false); - void set_selected_track_as_side_effect (bool force = false); + void set_selected_track_as_side_effect (Selection::Operation op, bool force = false); bool set_selected_regionview_from_click (bool press, Selection::Operation op = Selection::Set, bool no_track_remove=false); bool set_selected_regionview_from_map_event (GdkEventAny*, StreamView*, boost::weak_ptr); @@ -659,17 +669,18 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD Gtk::Menu * track_edit_playlist_submenu; Gtk::Menu * track_selection_edit_playlist_submenu; - void popup_track_context_menu (int, int, ItemType, bool, nframes64_t); - Gtk::Menu* build_track_context_menu (nframes64_t); - Gtk::Menu* build_track_bus_context_menu (nframes64_t); - Gtk::Menu* build_track_region_context_menu (nframes64_t frame); - Gtk::Menu* build_track_crossfade_context_menu (nframes64_t); - Gtk::Menu* build_track_selection_context_menu (nframes64_t); + void popup_track_context_menu (int, int, ItemType, bool); + Gtk::Menu* build_track_context_menu (); + Gtk::Menu* build_track_bus_context_menu (); + Gtk::Menu* build_track_region_context_menu (); + Gtk::Menu* build_track_crossfade_context_menu (); + Gtk::Menu* build_track_selection_context_menu (); void add_dstream_context_items (Gtk::Menu_Helpers::MenuList&); void add_bus_context_items (Gtk::Menu_Helpers::MenuList&); - void add_region_context_items (StreamView*, boost::shared_ptr, Gtk::Menu_Helpers::MenuList&); + void add_region_context_items (Gtk::Menu_Helpers::MenuList&, boost::shared_ptr); void add_crossfade_context_items (AudioStreamView*, boost::shared_ptr, Gtk::Menu_Helpers::MenuList&, bool many); void add_selection_context_items (Gtk::Menu_Helpers::MenuList&); + Gtk::MenuItem* _popup_region_menu_item; void handle_new_route (ARDOUR::RouteList&); void timeaxisview_deleted (TimeAxisView *); @@ -679,24 +690,18 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD Gtk::VBox vpacker; Gdk::Cursor* current_canvas_cursor; - void set_canvas_cursor (); Gdk::Cursor* which_grabber_cursor (); + void set_canvas_cursor (); ArdourCanvas::Canvas* track_canvas; - ArdourCanvas::NoEventText* verbose_canvas_cursor; - bool verbose_cursor_visible; + friend class VerboseCursor; + VerboseCursor* _verbose_cursor; void parameter_changed (std::string); bool track_canvas_motion (GdkEvent*); - void set_verbose_canvas_cursor (const std::string &, double x, double y); - void set_verbose_canvas_cursor_text (const std::string &); - void show_verbose_canvas_cursor(); - - bool verbose_cursor_on; // so far unused - Gtk::EventBox time_canvas_event_box; Gtk::EventBox track_canvas_event_box; Gtk::EventBox time_button_event_box; @@ -743,7 +748,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD enum RulerType { ruler_metric_timecode = 0, ruler_metric_bbt = 1, - ruler_metric_frames = 2, + ruler_metric_samples = 2, ruler_metric_minsec = 3, ruler_time_tempo = 4, @@ -767,9 +772,9 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD Glib::RefPtr ruler_cd_marker_action; bool no_ruler_shown_update; - gint ruler_button_press (GdkEventButton*); - gint ruler_button_release (GdkEventButton*); - gint ruler_mouse_motion (GdkEventMotion*); + bool ruler_button_press (GdkEventButton*); + bool ruler_button_release (GdkEventButton*); + bool ruler_mouse_motion (GdkEventMotion*); bool ruler_scroll (GdkEventScroll* event); Gtk::Widget * ruler_grabbed_widget; @@ -779,18 +784,18 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void compute_fixed_ruler_scale (); //calculates the RulerScale of the fixed rulers void update_fixed_rulers (); void update_tempo_based_rulers (); - void popup_ruler_menu (nframes64_t where = 0, ItemType type = RegionItem); + void popup_ruler_menu (framepos_t where = 0, ItemType type = RegionItem); void update_ruler_visibility (); void set_ruler_visible (RulerType, bool); void toggle_ruler_visibility (RulerType rt); void ruler_toggled (int); - gint ruler_label_button_release (GdkEventButton*); + bool ruler_label_button_release (GdkEventButton*); void store_ruler_visibility (); void restore_ruler_visibility (); static gint _metric_get_timecode (GtkCustomRulerMark **, gdouble, gdouble, gint); static gint _metric_get_bbt (GtkCustomRulerMark **, gdouble, gdouble, gint); - static gint _metric_get_frames (GtkCustomRulerMark **, gdouble, gdouble, gint); + static gint _metric_get_samples (GtkCustomRulerMark **, gdouble, gdouble, gint); static gint _metric_get_minsec (GtkCustomRulerMark **, gdouble, gdouble, gint); enum MinsecRulerScale { @@ -802,10 +807,10 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD MinsecRulerScale minsec_ruler_scale; - nframes_t minsec_mark_interval; + framecnt_t minsec_mark_interval; gint minsec_mark_modulo; gint minsec_nmarks; - void set_minsec_ruler_scale (gdouble lower, gdouble upper); + void set_minsec_ruler_scale (framepos_t, framepos_t); enum TimecodeRulerScale { timecode_show_bits, @@ -817,10 +822,12 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD TimecodeRulerScale timecode_ruler_scale; - nframes_t timecode_mark_interval; gint timecode_mark_modulo; gint timecode_nmarks; - void set_timecode_ruler_scale (gdouble lower, gdouble upper); + void set_timecode_ruler_scale (framepos_t, framepos_t); + + framecnt_t _samples_ruler_interval; + void set_samples_ruler_scale (framepos_t, framepos_t); enum BBTRulerScale { bbt_over, @@ -840,21 +847,21 @@ 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 (nframes64_t lower, nframes64_t upper); + void compute_bbt_ruler_scale (framepos_t lower, framepos_t upper); gint metric_get_timecode (GtkCustomRulerMark **, gdouble, gdouble, gint); gint metric_get_bbt (GtkCustomRulerMark **, gdouble, gdouble, gint); - gint metric_get_frames (GtkCustomRulerMark **, gdouble, gdouble, gint); + gint metric_get_samples (GtkCustomRulerMark **, gdouble, gdouble, gint); gint metric_get_minsec (GtkCustomRulerMark **, gdouble, gdouble, gint); Gtk::Widget *_ruler_separator; GtkWidget *_timecode_ruler; GtkWidget *_bbt_ruler; - GtkWidget *_frames_ruler; + GtkWidget *_samples_ruler; GtkWidget *_minsec_ruler; Gtk::Widget *timecode_ruler; Gtk::Widget *bbt_ruler; - Gtk::Widget *frames_ruler; + Gtk::Widget *samples_ruler; Gtk::Widget *minsec_ruler; static Editor *ruler_editor; @@ -874,7 +881,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD Gtk::Label minsec_label; Gtk::Label bbt_label; Gtk::Label timecode_label; - Gtk::Label frame_label; + Gtk::Label samples_label; Gtk::Label tempo_label; Gtk::Label meter_label; Gtk::Label mark_label; @@ -890,7 +897,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD EditorCursor* playhead_cursor; ArdourCanvas::Group* cursor_group; - nframes64_t get_region_boundary (nframes64_t pos, int32_t dir, bool with_selection, bool only_onscreen); + framepos_t get_region_boundary (framepos_t pos, int32_t dir, bool with_selection, bool only_onscreen); void cursor_to_region_boundary (bool with_selection, int32_t dir); void cursor_to_next_region_boundary (bool with_selection); @@ -915,10 +922,10 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void select_all_selectables_between (bool within); void select_range_between (); - boost::shared_ptr find_next_region (nframes64_t, ARDOUR::RegionPoint, int32_t dir, TrackViewList&, TimeAxisView ** = 0); - nframes64_t find_next_region_boundary (nframes64_t, int32_t dir, const TrackViewList&); + boost::shared_ptr find_next_region (ARDOUR::framepos_t, ARDOUR::RegionPoint, int32_t dir, TrackViewList&, TimeAxisView ** = 0); + ARDOUR::framepos_t find_next_region_boundary (ARDOUR::framepos_t, int32_t dir, const TrackViewList&); - std::vector region_boundary_cache; + std::vector region_boundary_cache; void build_region_boundary_cache (); Gtk::HBox top_hbox; @@ -927,26 +934,31 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD Gtk::Table edit_packer; Gtk::Adjustment vertical_adjustment; - + Gtk::Layout controls_layout; bool control_layout_scroll (GdkEventScroll* ev); - void controls_layout_size_request (Gtk::Requisition*); - sigc::connection controls_layout_size_request_connection; - - bool horizontal_scroll_left_press (); - void horizontal_scroll_left_release (); - bool horizontal_scroll_right_press (); - void horizontal_scroll_right_release (); + void reset_controls_layout_width (); + void reset_controls_layout_height (int32_t height); + + enum Direction { + LEFT, + RIGHT, + UP, + DOWN + }; + + bool scroll_press (Direction); + void scroll_release (); sigc::connection _scroll_connection; int _scroll_callbacks; double _canvas_width; - double _canvas_height; - double full_canvas_height; + double _canvas_height; ///< height of the visible area of the track canvas + double full_canvas_height; ///< full height of the canvas bool track_canvas_map_handler (GdkEventAny*); - gint edit_controls_button_release (GdkEventButton*); + bool edit_controls_button_release (GdkEventButton*); Gtk::Menu *edit_controls_left_menu; Gtk::Menu *edit_controls_right_menu; @@ -958,7 +970,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void control_scroll (float); void access_action (std::string,std::string); - bool deferred_control_scroll (nframes64_t); + bool deferred_control_scroll (framepos_t); sigc::connection control_scroll_connection; gdouble get_trackview_group_vertical_offset () const { return vertical_adjustment.get_value () - canvas_timebars_vsize;} @@ -979,7 +991,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD }; Type pending; - nframes64_t time_origin; + framepos_t time_origin; double frames_per_unit; double y_origin; @@ -997,7 +1009,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD static int _idle_visual_changer (void *arg); int idle_visual_changer (); - void queue_visual_change (nframes64_t); + void queue_visual_change (framepos_t); void queue_visual_change (double); void queue_visual_change_y (double); void ensure_visual_change_idle_handler (); @@ -1009,33 +1021,41 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD TrackViewList get_tracks_for_range_action () const; - static void build_cursors (); - sigc::connection super_rapid_screen_update_connection; - nframes64_t last_update_frame; - void center_screen_internal (nframes64_t, float); + framepos_t last_update_frame; + void center_screen_internal (framepos_t, float); void super_rapid_screen_update (); void session_going_away (); - nframes64_t cut_buffer_start; - nframes64_t cut_buffer_length; + framepos_t cut_buffer_start; + framecnt_t cut_buffer_length; + + Gdk::Cursor* pre_press_cursor; + boost::weak_ptr _trimmable; + boost::weak_ptr _movable; bool typed_event (ArdourCanvas::Item*, GdkEvent*, ItemType); bool button_press_handler (ArdourCanvas::Item*, GdkEvent*, ItemType); bool button_press_handler_1 (ArdourCanvas::Item *, GdkEvent *, ItemType); bool button_press_handler_2 (ArdourCanvas::Item *, GdkEvent *, ItemType); bool button_release_handler (ArdourCanvas::Item*, GdkEvent*, ItemType); + bool button_press_dispatch (GdkEventButton*); + bool button_release_dispatch (GdkEventButton*); bool motion_handler (ArdourCanvas::Item*, GdkEvent*, bool from_autoscroll = false); bool enter_handler (ArdourCanvas::Item*, GdkEvent*, ItemType); bool leave_handler (ArdourCanvas::Item*, GdkEvent*, ItemType); + Gtkmm2ext::Bindings* button_bindings; + XMLNode* button_settings () const; + /* KEYMAP HANDLING */ void register_actions (); + void register_region_actions (); - int ensure_cursor (nframes64_t* pos); + int ensure_cursor (framepos_t* pos); void cut_copy (Editing::CutCopyOp); bool can_cut_copy () const; @@ -1045,35 +1065,35 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void cut_copy_midi (Editing::CutCopyOp); void mouse_paste (); - void paste_internal (nframes64_t position, float times); + void paste_internal (framepos_t position, float times); /* EDITING OPERATIONS */ void reset_point_selection (); - void toggle_region_mute (); void toggle_region_lock (); - void toggle_region_opaque (); + void toggle_opaque_region (); void toggle_record_enable (); void toggle_region_lock_style (); void raise_region (); void raise_region_to_top (); + void change_region_layering_order (); void lower_region (); void lower_region_to_bottom (); - void split_regions_at (nframes64_t, RegionSelection&); + 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); + 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 (nframes64_t start, nframes64_t end); - void set_sync_point (nframes64_t, const RegionSelection&); - void set_region_sync_from_edit_point (); + void crop_region_to (framepos_t start, framepos_t end); + void set_sync_point (framepos_t, const RegionSelection&); + void set_region_sync_position (); void remove_region_sync(); - void align_selection (ARDOUR::RegionPoint, nframes64_t position, const RegionSelection&); - void align_selection_relative (ARDOUR::RegionPoint point, nframes64_t position, const RegionSelection&); - void align_region (boost::shared_ptr, ARDOUR::RegionPoint point, nframes64_t position); - void align_region_internal (boost::shared_ptr, ARDOUR::RegionPoint point, nframes64_t position); + void align_regions (ARDOUR::RegionPoint); + void align_regions_relative (ARDOUR::RegionPoint point); + void align_region (boost::shared_ptr, ARDOUR::RegionPoint point, framepos_t position); + void align_region_internal (boost::shared_ptr, ARDOUR::RegionPoint point, framepos_t position); void remove_selected_regions (); void remove_clicked_region (); - void edit_region (); + void show_region_properties (); void show_midi_list_editor (); void rename_region (); void duplicate_some_regions (RegionSelection&, float times); @@ -1087,42 +1107,42 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void reverse_region (); void strip_region_silence (); void normalize_region (); - double _last_normalization_value; void reset_region_scale_amplitude (); - void adjust_region_scale_amplitude (bool up); + void adjust_region_gain (bool up); void quantize_region (); + void insert_patch_change (); void fork_region (); void do_insert_time (); - void insert_time (nframes64_t, nframes64_t, Editing::InsertTimeOption, bool, bool, bool); + void insert_time (framepos_t, framecnt_t, Editing::InsertTimeOption, bool, bool, bool, bool, bool); void tab_to_transient (bool forward); - void use_region_as_bar (); + void set_tempo_from_region (); void use_range_as_bar (); - void define_one_bar (nframes64_t start, nframes64_t end); + void define_one_bar (framepos_t start, framepos_t end); void audition_region_from_region_list (); void hide_region_from_region_list (); void show_region_in_region_list (); - void align (ARDOUR::RegionPoint); - void align_relative (ARDOUR::RegionPoint); - void naturalize (); + void naturalize_region (); void reset_focus (); - void split (); + void split_region (); void cut (); void copy (); void paste (float times); - - int get_prefix (float&, bool&); + + void place_transient (); + void remove_transient (ArdourCanvas::Item* item); + void snap_regions_to_grid (); + void close_region_gaps (); void keyboard_paste (); - void keyboard_insert_region_list_selection (); void region_from_selection (); void create_region_from_selection (std::vector >&); @@ -1132,7 +1152,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void play_from_edit_point_and_return (); void play_selected_region (); void play_edit_range (); - void loop_selected_region (); void play_location (ARDOUR::Location&); void loop_location (ARDOUR::Location&); @@ -1141,11 +1160,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void zoom_to_region (bool both_axes); void temporal_zoom_session (); void temporal_zoom (gdouble scale); - void temporal_zoom_by_frame (nframes64_t start, nframes64_t end, const std::string & op); - void temporal_zoom_to_frame (bool coarser, nframes64_t frame); - - void amplitude_zoom (gdouble scale); - void amplitude_zoom_step (bool in); + void temporal_zoom_by_frame (framepos_t start, framepos_t end, const std::string & op); + void temporal_zoom_to_frame (bool coarser, framepos_t frame); void insert_region_list_drag (boost::shared_ptr, int x, int y); void insert_region_list_selection (float times); @@ -1159,23 +1175,23 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void session_import_dialog (); int check_whether_and_how_to_import(std::string, bool all_or_nothing = true); - bool check_multichannel_status (const std::vector& paths); + bool check_multichannel_status (const std::vector& paths); SoundFileOmega* sfbrowser; - void bring_in_external_audio (Editing::ImportMode mode, nframes64_t& pos); + void bring_in_external_audio (Editing::ImportMode mode, framepos_t& pos); - bool idle_drop_paths (std::vector paths, nframes64_t frame, double ypos); - void drop_paths_part_two (const std::vector& paths, nframes64_t frame, double ypos); + bool idle_drop_paths (std::vector paths, framepos_t frame, double ypos); + void drop_paths_part_two (const std::vector& paths, framepos_t frame, double ypos); - int import_sndfiles (std::vector paths, Editing::ImportMode mode, ARDOUR::SrcQuality, nframes64_t& pos, + int import_sndfiles (std::vector paths, 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::ImportMode mode, - nframes64_t& pos, int target_regions, int target_tracks, boost::shared_ptr&); + int embed_sndfiles (std::vector paths, bool multiple_files, bool& check_sample_rate, Editing::ImportMode mode, + framepos_t& pos, int target_regions, int target_tracks, boost::shared_ptr&); - int add_sources (std::vector paths, ARDOUR::SourceList& sources, nframes64_t& pos, Editing::ImportMode, + int add_sources (std::vector paths, ARDOUR::SourceList& sources, framepos_t& pos, 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, nframes64_t& pos, Editing::ImportMode mode, + int finish_bringing_in_material (boost::shared_ptr region, uint32_t, uint32_t, framepos_t& pos, Editing::ImportMode mode, boost::shared_ptr& existing_track); boost::shared_ptr get_nth_selected_audio_track (int nth) const; @@ -1189,7 +1205,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD struct EditorImportStatus : public ARDOUR::ImportStatus { Editing::ImportMode mode; - nframes64_t pos; + framepos_t pos; int target_tracks; int target_regions; boost::shared_ptr track; @@ -1204,29 +1220,19 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD /* to support this ... */ void import_audio (bool as_tracks); - void do_import (std::vector paths, bool split, bool as_tracks); + void do_import (std::vector paths, bool split, bool as_tracks); void move_to_start (); void move_to_end (); - void goto_frame (); void center_playhead (); void center_edit_point (); - void edit_cursor_backward (); - void edit_cursor_forward (); void playhead_forward_to_grid (); void playhead_backward_to_grid (); - void playhead_backward (); - void playhead_forward (); void scroll_playhead (bool forward); void scroll_backward (float pages=0.8f); void scroll_forward (float pages=0.8f); void scroll_tracks_down (); void scroll_tracks_up (); - void delete_sample_forward (); - void delete_sample_backward (); - void delete_screen (); - void search_backwards (); - void search_forwards (); void set_mark (); void clear_markers (); void clear_ranges (); @@ -1246,9 +1252,9 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void set_selection_from_loop (); void set_selection_from_region (); - void add_location_mark (nframes64_t where); - void add_location_from_audio_region (); - void add_locations_from_audio_region (); + void add_location_mark (framepos_t where); + void add_location_from_region (); + void add_locations_from_region (); void add_location_from_selection (); void set_loop_from_selection (bool play); void set_punch_from_selection (); @@ -1258,8 +1264,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void set_loop_from_region (bool play); void set_punch_from_edit_range (); - void set_loop_range (nframes64_t start, nframes64_t end, std::string cmd); - void set_punch_range (nframes64_t start, nframes64_t end, std::string cmd); + 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 add_location_from_playhead_cursor (); bool select_new_marker; @@ -1271,16 +1277,14 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD int scrubbing_direction; int scrub_reversals; int scrub_reverse_distance; - void scrub (nframes64_t, double); + void scrub (framepos_t, double); void keyboard_selection_begin (); void keyboard_selection_finish (bool add); bool have_pending_keyboard_selection; - nframes64_t pending_keyboard_selection_start; + framepos_t pending_keyboard_selection_start; - boost::shared_ptr select_region_for_operation (int dir, TimeAxisView **tv); - void extend_selection_to_end_of_region (bool next); - void extend_selection_to_start_of_region (bool previous); + void move_range_selection_start_or_end_to_region_boundary (bool, bool); Editing::SnapType _snap_type; Editing::SnapMode _snap_mode; @@ -1297,11 +1301,10 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD Gtk::Menu fade_context_menu; void popup_fade_context_menu (int, int, ArdourCanvas::Item*, ItemType); - void set_fade_in_shape (ARDOUR::AudioRegion::FadeShape); - void set_fade_out_shape (ARDOUR::AudioRegion::FadeShape); + void set_fade_in_shape (ARDOUR::FadeShape); + void set_fade_out_shape (ARDOUR::FadeShape); void set_fade_length (bool in); - void toggle_fade_active (bool in); void set_fade_in_active (bool); void set_fade_out_active (bool); @@ -1326,13 +1329,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void remove_gain_control_point (ArdourCanvas::Item*, GdkEvent*); void remove_control_point (ArdourCanvas::Item*, GdkEvent*); - void mouse_brush_insert_region (RegionView*, nframes64_t pos); - void brush (nframes64_t); - - void show_verbose_time_cursor (nframes64_t frame, double offset = 0, double xpos=-1, double ypos=-1); - void show_verbose_duration_cursor (nframes64_t start, nframes64_t end, double offset = 0, double xpos=-1, double ypos=-1); - double clamp_verbose_cursor_x (double); - double clamp_verbose_cursor_y (double); + void mouse_brush_insert_region (RegionView*, framepos_t pos); /* Canvas event handlers */ @@ -1346,18 +1343,11 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD bool canvas_fade_in_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*); bool canvas_fade_out_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*); bool canvas_fade_out_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*); - - - // These variables are used to detect a feedback loop and break it to avoid a gui hang -private: - ArdourCanvas::Item *last_item_entered; - int last_item_entered_n; - -public: bool canvas_region_view_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*); bool canvas_frame_handle_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*); bool canvas_region_view_name_highlight_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*); bool canvas_region_view_name_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*); + 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*); @@ -1381,12 +1371,19 @@ public: bool canvas_markerview_item_view_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*); bool canvas_markerview_start_handle_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*); bool canvas_markerview_end_handle_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*); + + PBD::Signal0 EditorFreeze; + PBD::Signal0 EditorThaw; private: friend class DragManager; friend class EditorRouteGroups; friend class EditorRegions; + ArdourCanvas::Item *last_item_entered; + /** true if the mouse is over a place where region trim can happen */ + bool _over_region_trim_target; + /* non-public event handlers */ bool canvas_playhead_cursor_event (GdkEvent* event, ArdourCanvas::Item*); @@ -1401,15 +1398,12 @@ public: void track_canvas_allocate (Gtk::Allocation alloc); bool track_canvas_size_allocated (); bool track_canvas_drag_motion (Glib::RefPtr const &, int, int, guint); + bool track_canvas_key_press (GdkEventKey *); + bool track_canvas_key_release (GdkEventKey *); void set_playhead_cursor (); - void kbd_driver (sigc::slot, bool use_track_canvas = true, bool use_time_canvas = true, bool can_select = true); - void kbd_mute_unmute_region (); - void kbd_brush (); - - void kbd_do_brush (GdkEvent*); - void kbd_do_audition (GdkEvent*); + void toggle_region_mute (); void initialize_canvas (); @@ -1433,8 +1427,8 @@ public: void new_tempo_section (); - void mouse_add_new_tempo_event (nframes64_t where); - void mouse_add_new_meter_event (nframes64_t where); + 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*); @@ -1446,11 +1440,13 @@ public: void edit_tempo_marker (ArdourCanvas::Item*); void edit_meter_marker (ArdourCanvas::Item*); void edit_control_point (ArdourCanvas::Item*); + void edit_note (ArdourCanvas::Item *); void marker_menu_edit (); void marker_menu_remove (); void marker_menu_rename (); - void marker_menu_lock (bool yn); + void toggle_marker_menu_lock (); + void toggle_marker_menu_glue (); void marker_menu_hide (); void marker_menu_loop_range (); void marker_menu_select_all_selectables_using_range (); @@ -1471,15 +1467,14 @@ public: void tempo_or_meter_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*); void transport_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*); void new_transport_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*); - void build_range_marker_menu (bool loop_or_punch); - void build_marker_menu (bool); + void build_range_marker_menu (bool); + void build_marker_menu (ARDOUR::Location *); void build_tempo_or_meter_marker_menu (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* marker_menu; - Gtk::Menu* session_range_marker_menu; Gtk::Menu* range_marker_menu; Gtk::Menu* transport_marker_menu; Gtk::Menu* new_transport_marker_menu; @@ -1492,7 +1487,7 @@ public: void remove_metric_marks (); void draw_metric_marks (const ARDOUR::Metrics& metrics); - void compute_current_bbt_points (nframes_t left, nframes_t right); + void compute_current_bbt_points (framepos_t left, framepos_t right); void tempo_map_changed (const PBD::PropertyChange&); void redisplay_tempo (bool immediate_redraw); @@ -1520,21 +1515,22 @@ public: Gtk::Label toolbar_selection_cursor_label; Gtkmm2ext::TearOff* _mouse_mode_tearoff; - Gtk::ToggleButton mouse_select_button; - Gtk::ToggleButton mouse_move_button; - Gtk::ToggleButton mouse_gain_button; - Gtk::ToggleButton mouse_zoom_button; - Gtk::ToggleButton mouse_timefx_button; - Gtk::ToggleButton mouse_audition_button; - Gtk::ToggleButton join_object_range_button; + Gtkmm2ext::StatefulToggleButton mouse_select_button; + Gtkmm2ext::StatefulToggleButton mouse_move_button; + Gtkmm2ext::StatefulToggleButton mouse_gain_button; + Gtkmm2ext::StatefulToggleButton mouse_zoom_button; + Gtkmm2ext::StatefulToggleButton mouse_timefx_button; + Gtkmm2ext::StatefulToggleButton mouse_audition_button; + Gtkmm2ext::StatefulToggleButton join_object_range_button; void mouse_mode_toggled (Editing::MouseMode m); + void mouse_mode_object_range_toggled () {} bool ignore_mouse_mode_toggle; - Gtk::ToggleButton internal_edit_button; + Gtkmm2ext::StatefulToggleButton internal_edit_button; void toggle_internal_editing (); - gint mouse_select_button_release (GdkEventButton*); + bool mouse_select_button_release (GdkEventButton*); Gtk::VBox automation_box; Gtk::Button automation_mode_button; @@ -1542,6 +1538,7 @@ public: Gtk::ComboBoxText edit_mode_selector; Gtk::VBox edit_mode_box; + std::vector edit_mode_strings; void set_edit_mode (ARDOUR::EditMode); void cycle_edit_mode (); @@ -1572,10 +1569,8 @@ public: Glib::RefPtr zoom_focus_action (Editing::ZoomFocus); - Gtk::HBox zoom_box; - Gtk::HBox track_zoom_box; - Gtk::VBox zoom_vbox; - + Gtk::HBox _zoom_box; + Gtkmm2ext::TearOff* _zoom_tearoff; void zoom_adjustment_changed(); void setup_toolbar (); @@ -1586,7 +1581,8 @@ public: Gtk::HBox toolbar_hbox; Gtk::EventBox toolbar_base; Gtk::Frame toolbar_frame; - + Gtk::Viewport _toolbar_viewport; + /* midi toolbar */ Gtk::HBox panic_box; @@ -1606,17 +1602,21 @@ public: void track_selection_changed (); void region_selection_changed (); sigc::connection editor_regions_selection_changed_connection; - void sensitize_the_right_region_actions (bool have_selected_regions); + void sensitize_all_region_actions (bool); + void sensitize_the_right_region_actions (); + bool _all_region_actions_sensitized; + /** Flag to block region action handlers from doing what they normally do; + * I tried Gtk::Action::block_activate() but this doesn't work (ie it doesn't + * block) when setting a ToggleAction's active state. + */ + bool _ignore_region_action; + bool _last_region_menu_was_main; void point_selection_changed (); void marker_selection_changed (); void cancel_selection (); - void region_selection_op (void (ARDOUR::Region::*pmf)(void)); - void region_selection_op (void (ARDOUR::Region::*pmf)(void*), void*); - void region_selection_op (void (ARDOUR::Region::*pmf)(bool), bool); - - bool audio_region_selection_covers (nframes64_t where); + bool audio_region_selection_covers (framepos_t where); /* transport range select process */ @@ -1644,14 +1644,14 @@ public: /* object rubberband select process */ - bool select_all_within (nframes64_t, nframes64_t, double, double, TrackViewList const &, Selection::Operation op); + void select_all_within (framepos_t, framepos_t, double, double, TrackViewList const &, Selection::Operation, bool); ArdourCanvas::SimpleRect *rubberband_rect; /* mouse zoom process */ ArdourCanvas::SimpleRect *zoom_rect; - void reposition_zoom_rect (nframes64_t start, nframes64_t end); + void reposition_zoom_rect (framepos_t start, framepos_t end); EditorRouteGroups* _route_groups; EditorRoutes* _routes; @@ -1678,30 +1678,21 @@ public: int last_autoscroll_x; int last_autoscroll_y; uint32_t autoscroll_cnt; - nframes64_t autoscroll_x_distance; + framecnt_t autoscroll_x_distance; double autoscroll_y_distance; static gint _autoscroll_canvas (void *); bool autoscroll_canvas (); void start_canvas_autoscroll (int x, int y); void stop_canvas_autoscroll (); - void maybe_autoscroll (GdkEventMotion*, bool); - bool allow_vertical_scroll; /* trimming */ - void point_trim (GdkEvent *, nframes64_t); - void single_contents_trim (RegionView&, nframes64_t, bool, bool); - void single_start_trim (RegionView&, nframes64_t, bool); - void single_end_trim (RegionView&, nframes64_t, bool); - - void thaw_region_after_trim (RegionView& rv); + void point_trim (GdkEvent *, framepos_t); void trim_region_front(); void trim_region_back(); void trim_region (bool front); - void trim_region_to_edit_point (); - void trim_region_from_edit_point (); void trim_region_to_loop (); void trim_region_to_punch (); void trim_region_to_location (const ARDOUR::Location&, const char* cmd); @@ -1715,46 +1706,46 @@ public: /* 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 */ int write_region_selection(RegionSelection&); @@ -1794,20 +1785,15 @@ public: void freeze_route (); void unfreeze_route (); - /* route-group solo + mute */ - - void set_route_group_solo (ARDOUR::Route&, bool); - void set_route_group_mute (ARDOUR::Route&, bool); - /* duplication */ void duplicate_dialog (bool with_dialog); - nframes64_t event_frame (GdkEvent const *, double* px = 0, double* py = 0) const; + framepos_t event_frame (GdkEvent const *, double* px = 0, double* py = 0) const; /* returns false if mouse pointer is not in track or marker canvas */ - bool mouse_frame (nframes64_t&, bool& in_track_canvas) const; + bool mouse_frame (framepos_t&, bool& in_track_canvas) const; /* "whats mine is yours" */ @@ -1818,9 +1804,11 @@ public: int time_stretch (RegionSelection&, float fraction); int pitch_shift (RegionSelection&, float cents); - void pitch_shift_regions (); + void pitch_shift_region (); int time_fx (RegionSelection&, float val, bool pitching); + void transpose_region (); + /* editor-mixer strip */ MixerStrip *current_mixer_strip; @@ -1905,7 +1893,7 @@ public: /* audio filters */ - void apply_filter (ARDOUR::Filter&, std::string cmd); + 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); @@ -1924,6 +1912,9 @@ public: sigc::connection step_timeout; TimeAxisView* entered_track; + /** If the mouse is over a RegionView or one of its child canvas items, this is set up + to point to the RegionView. Otherwise it is 0. + */ RegionView* entered_regionview; @@ -1967,13 +1958,15 @@ public: void selected_marker_moved (ARDOUR::Location*); - bool get_edit_op_range (nframes64_t& start, nframes64_t& end) const; - - void get_regions_at (RegionSelection&, nframes64_t where, const TrackViewList& ts) const; - void get_regions_after (RegionSelection&, nframes64_t where, const TrackViewList& ts) const; + bool get_edit_op_range (framepos_t& start, framepos_t& end) const; - void get_regions_for_action (RegionSelection&, bool allow_entered = false, bool allow_edit_position = true); + void get_regions_at (RegionSelection&, framepos_t where, const TrackViewList& ts) const; + void get_regions_after (RegionSelection&, framepos_t where, const TrackViewList& ts) const; + RegionSelection get_regions_from_selection (); + RegionSelection get_regions_from_selection_and_edit_point (); + RegionSelection get_regions_from_selection_and_entered (); + void start_updating_meters (); void stop_updating_meters (); bool meters_running; @@ -1981,12 +1974,11 @@ public: void select_next_route (); void select_prev_route (); - void snap_to_internal (nframes64_t& first, int32_t direction = 0, bool for_mark = false); - void timecode_snap_to_internal (nframes64_t& first, int32_t direction = 0, bool for_mark = false); + 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); RhythmFerret* rhythm_ferret; BundleManager* _bundle_manager; - GlobalPortMatrixWindow* _global_port_matrix[ARDOUR::DataType::num_types]; void fit_tracks (TrackViewList &); void fit_selected_tracks (); @@ -2017,18 +2009,49 @@ public: Gtk::HBox _summary_hbox; EditorSummary* _summary; + void region_view_added (RegionView *); + void region_view_removed (); void update_canvas_now (); EditorGroupTabs* _group_tabs; void fit_route_group (ARDOUR::RouteGroup *); + void step_edit_status_change (bool); void start_step_editing (); void stop_step_editing (); bool check_step_edit (); sigc::connection step_edit_connection; + double _last_motion_y; + + RegionLayeringOrderEditor* layering_order_editor; + void update_region_layering_order_editor (); + + /** Track that was the source for the last cut/copy operation. Used as a place + to paste things iff there is no selected track. + */ + TimeAxisView* _last_cut_copy_source_track; + + /** true if a change in Selection->regions should change the selection in the region list. + See EditorRegions::selection_changed. + */ + bool _region_selection_change_updates_region_list; + + void setup_fade_images (); + std::map _fade_in_images; + std::map _fade_out_images; + + Gtk::MenuItem& action_menu_item (std::string const &); + void action_pre_activated (Glib::RefPtr const &); + + void set_canvas_cursor_for_region_view (double, RegionView *); + + MouseCursors* _cursors; + + void resize_text_widgets (); + friend class Drag; friend class RegionDrag; friend class RegionMoveDrag; @@ -2057,6 +2080,7 @@ public: friend class EditorGroupTabs; friend class EditorRoutes; + friend class RhythmFerret; }; #endif /* __ardour_editor_h__ */