2 Copyright (C) 2000-2003 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __ardour_editor_h__
21 #define __ardour_editor_h__
30 #include <glibmm/ustring.h>
32 #include <boost/optional.hpp>
34 #include <libgnomecanvasmm/canvas.h>
35 #include <libgnomecanvasmm/group.h>
36 #include <libgnomecanvasmm/line.h>
37 #include <libgnomecanvasmm/pixbuf.h>
41 #include <gtkmm/comboboxtext.h>
42 #include <gtkmm/layout.h>
44 #include <gtkmm2ext/selector.h>
45 #include <gtkmm2ext/click_box.h>
46 #include <gtkmm2ext/dndtreeview.h>
48 #include "pbd/stateful.h"
49 #include "ardour/session.h"
50 #include "ardour/tempo.h"
51 #include "ardour/location.h"
52 #include "ardour/audioregion.h"
53 #include "ardour/track.h"
54 #include "ardour/types.h"
55 #include "ardour/route_group.h"
57 #include "audio_clock.h"
58 #include "gtk-custom-ruler.h"
59 #include "ardour_dialog.h"
60 #include "public_editor.h"
63 #include "editor_items.h"
64 #include "region_selection.h"
66 #include "editor_summary.h"
73 class AudioDiskstream;
93 class AudioRegionView;
94 class AudioStreamView;
95 class AudioTimeAxisView;
97 class AutomationSelection;
98 class AutomationTimeAxisView;
103 class GlobalPortMatrixWindow;
104 class GroupedButtons;
106 class MidiRegionView;
108 class PlaylistSelector;
109 class PluginSelector;
112 class SoundFileOmega;
118 class TrackSelection;
119 class EditorGroupTabs;
121 class EditorRouteGroups;
123 class EditorSnapshots;
125 /* <CMT Additions> */
126 class ImageFrameView;
127 class ImageFrameTimeAxisView;
128 class ImageFrameTimeAxis;
129 class MarkerTimeAxis ;
131 class ImageFrameSocketHandler ;
132 class TimeAxisViewItem ;
133 /* </CMT Additions> */
135 struct EditorCursor {
137 ArdourCanvas::Points points;
138 ArdourCanvas::Line canvas_item;
139 nframes64_t current_frame;
142 EditorCursor (Editor&, bool (Editor::*)(GdkEvent*,ArdourCanvas::Item*));
145 void set_position (nframes64_t);
146 void set_length (double units);
147 void set_y_axis (double position);
149 sigc::signal<void, nframes64_t> PositionChanged;
152 class Editor : public PublicEditor
158 void connect_to_session (ARDOUR::Session *);
159 ARDOUR::Session* current_session() const { return session; }
161 virtual bool have_idled () const { return _have_idled; }
163 nframes64_t leftmost_position() const { return leftmost_frame; }
165 nframes64_t current_page_frames() const {
166 return (nframes64_t) floor (_canvas_width * frames_per_unit);
169 double canvas_height () const {
170 return _canvas_height;
173 void cycle_snap_mode ();
174 void cycle_snap_choice ();
175 void set_snap_to (Editing::SnapType);
176 void set_snap_mode (Editing::SnapMode);
177 void set_snap_threshold (double pixel_distance) {snap_threshold = pixel_distance;}
179 void undo (uint32_t n = 1);
180 void redo (uint32_t n = 1);
182 XMLNode& get_state ();
183 int set_state (const XMLNode& );
185 void set_mouse_mode (Editing::MouseMode, bool force=true);
186 void step_mouse_mode (bool next);
187 Editing::MouseMode current_mouse_mode () const { return mouse_mode; }
188 Editing::MidiEditMode current_midi_edit_mode () const;
190 bool internal_editing() const { return _internal_editing ; }
191 void set_internal_edit (bool yn);
194 void add_imageframe_time_axis(const std::string & track_name, void*) ;
195 void add_imageframe_marker_time_axis(const std::string & track_name, TimeAxisView* marked_track, void*) ;
196 void connect_to_image_compositor() ;
197 void scroll_timeaxis_to_imageframe_item(const TimeAxisViewItem* item) ;
200 TimeAxisView* get_named_time_axis(const std::string & name) ;
201 void foreach_time_axis_view (sigc::slot<void,TimeAxisView&>);
202 void add_to_idle_resize (TimeAxisView*, int32_t);
204 RouteTimeAxisView* get_route_view_by_id (PBD::ID& id);
206 void consider_auditioning (boost::shared_ptr<ARDOUR::Region>);
207 void hide_a_region (boost::shared_ptr<ARDOUR::Region>);
208 void remove_a_region (boost::shared_ptr<ARDOUR::Region>);
210 #ifdef USE_RUBBERBAND
211 std::vector<std::string> rb_opt_strings;
214 /* option editor-access */
216 void set_show_waveforms_recording (bool yn);
217 bool show_waveforms_recording() const { return _show_waveforms_recording; }
219 /* things that need to be public to be used in the main menubar */
221 void new_region_from_selection ();
222 void separate_regions_between (const TimeSelection&);
223 void separate_region_from_selection ();
224 void separate_region_from_punch ();
225 void separate_region_from_loop ();
226 void separate_regions_using_location (ARDOUR::Location&);
227 void toggle_playback (bool with_abort);
228 void transition_to_rolling (bool forward);
232 nframes64_t unit_to_frame (double unit) const {
233 return (nframes64_t) rint (unit * frames_per_unit);
236 double frame_to_unit (nframes64_t frame) const {
237 return rint ((double) frame / (double) frames_per_unit);
240 double frame_to_unit (double frame) const {
241 return rint (frame / frames_per_unit);
244 /* NOTE: these functions assume that the "pixel" coordinate is
245 the result of using the world->canvas affine transform on a
246 world coordinate. These coordinates already take into
247 account any scrolling carried out by adjusting the
251 nframes64_t pixel_to_frame (double pixel) const {
253 /* pixel can be less than zero when motion events
254 are processed. since we've already run the world->canvas
255 affine, that means that the location *really* is "off
256 to the right" and thus really is "before the start".
260 return (nframes64_t) rint (pixel * frames_per_unit * GNOME_CANVAS(track_canvas->gobj())->pixels_per_unit);
266 gulong frame_to_pixel (nframes64_t frame) const {
267 return (gulong) rint ((frame / (frames_per_unit * GNOME_CANVAS(track_canvas->gobj())->pixels_per_unit)));
270 void flush_canvas ();
274 Selection& get_selection() const { return *selection; }
275 Selection& get_cut_buffer() const { return *cut_buffer; }
277 bool extend_selection_to_track (TimeAxisView&);
279 void play_selection ();
280 void select_all_in_track (Selection::Operation op);
281 void select_all (Selection::Operation op);
282 void invert_selection_in_track ();
283 void invert_selection ();
284 void deselect_all ();
286 void set_selected_regionview_from_region_list (boost::shared_ptr<ARDOUR::Region> region, Selection::Operation op = Selection::Set);
290 void set_show_measures (bool yn);
291 bool show_measures () const { return _show_measures; }
293 /* analysis window */
295 void analyze_region_selection();
296 void analyze_range_selection();
300 void export_audio ();
301 void export_selection ();
302 void export_range ();
303 void export_region ();
305 void add_toplevel_controls (Gtk::Container&);
306 Gtk::HBox& get_status_bar_packer() { return status_bar_hpacker; }
308 void set_zoom_focus (Editing::ZoomFocus);
309 Editing::ZoomFocus get_zoom_focus () const { return zoom_focus; }
310 double get_current_zoom () const { return frames_per_unit; }
312 void temporal_zoom_step (bool coarser);
313 void tav_zoom_step (bool coarser);
315 /* stuff that AudioTimeAxisView and related classes use */
317 PlaylistSelector& playlist_selector() const;
318 void clear_playlist (boost::shared_ptr<ARDOUR::Playlist>);
320 void new_playlists (TimeAxisView* v);
321 void copy_playlists (TimeAxisView* v);
322 void clear_playlists (TimeAxisView* v);
324 TrackViewList* get_valid_views (TimeAxisView*, ARDOUR::RouteGroup* grp = 0);
325 void get_onscreen_tracks (TrackViewList&);
327 Width editor_mixer_strip_width;
328 void maybe_add_mixer_strip_width (XMLNode&);
329 void show_editor_mixer (bool yn);
330 void create_editor_mixer ();
331 void show_editor_list (bool yn);
332 void set_selected_mixer_strip (TimeAxisView&);
333 void hide_track_in_display (TimeAxisView& tv, bool temporary = false);
335 /* nudge is initiated by transport controls owned by ARDOUR_UI */
337 nframes64_t get_nudge_distance (nframes64_t pos, nframes64_t& next);
338 Evoral::MusicalTime get_grid_type_as_beats (bool& success, nframes64_t position);
340 void nudge_forward (bool next, bool force_playhead);
341 void nudge_backward (bool next, bool force_playhead);
343 /* nudge initiated from context menu */
345 void nudge_forward_capture_offset ();
346 void nudge_backward_capture_offset ();
348 /* playhead/screen stuff */
350 void set_follow_playhead (bool yn);
351 void toggle_follow_playhead ();
352 bool follow_playhead() const { return _follow_playhead; }
353 bool dragging_playhead () const { return _dragging_playhead; }
355 void toggle_zero_line_visibility ();
356 void toggle_waveforms_while_recording ();
358 void set_group_tabs ();
359 void toggle_measure_visibility ();
360 void toggle_logo_visibility ();
362 double get_physical_screen_width () const { return physical_screen_width; };
363 double physical_screen_width;
364 double physical_screen_height;
368 void toggle_selected_region_fades (int dir);
369 void update_region_fade_visibility ();
370 bool xfade_visibility() const { return _xfade_visibility; }
371 void update_xfade_visibility ();
373 /* redirect shared ops menu. caller must free returned menu */
375 Gtk::Menu* redirect_menu ();
377 /* floating windows/transient */
379 void ensure_float (Gtk::Window&);
383 void scroll_tracks_down_line ();
384 void scroll_tracks_up_line ();
386 bool new_regionviews_display_gain () { return _new_regionviews_show_envelope; }
387 void prepare_for_cleanup ();
388 void finish_cleanup ();
390 void maximise_editing_space();
391 void restore_editing_space();
393 void reset_x_origin (nframes64_t);
394 void reset_y_origin (double);
395 void reset_zoom (double);
396 void reposition_and_zoom (nframes64_t, double);
398 nframes64_t get_preferred_edit_position (bool ignore_playhead = false);
400 bool update_mouse_speed ();
401 bool decelerate_mouse_speed ();
403 void toggle_meter_updating();
405 void show_rhythm_ferret();
406 void show_bundle_manager ();
407 void show_global_port_matrix (ARDOUR::DataType);
409 void goto_visual_state (uint32_t);
410 void save_visual_state (uint32_t);
412 TrackViewList const & get_track_views () {
416 int get_regionview_count_from_region_list (boost::shared_ptr<ARDOUR::Region>);
418 void do_import (std::vector<Glib::ustring> paths, Editing::ImportDisposition, Editing::ImportMode mode, ARDOUR::SrcQuality, nframes64_t&);
419 void do_embed (std::vector<Glib::ustring> paths, Editing::ImportDisposition, Editing::ImportMode mode, nframes64_t&);
421 void get_regions_corresponding_to (boost::shared_ptr<ARDOUR::Region> region, std::vector<RegionView*>& regions);
423 void show_verbose_canvas_cursor_with (const std::string& txt);
424 void hide_verbose_canvas_cursor();
427 void map_transport_state ();
428 void map_position_change (nframes64_t);
434 void color_handler ();
436 ARDOUR::Session *session; ///< The session that we are editing, or 0
439 // to keep track of the playhead position for control_scroll
440 boost::optional<nframes64_t> _control_scroll_target;
442 PlaylistSelector* _playlist_selector;
444 typedef std::pair<TimeAxisView*,XMLNode*> TAVState;
448 double frames_per_unit;
449 nframes64_t leftmost_frame;
450 Editing::ZoomFocus zoom_focus;
451 bool zoomed_to_region;
452 std::list<TAVState> track_states;
455 std::list<VisualState*> undo_visual_stack;
456 std::list<VisualState*> redo_visual_stack;
457 VisualState* current_visual_state (bool with_tracks = true);
458 void undo_visual_state ();
459 void redo_visual_state ();
460 void use_visual_state (VisualState&);
462 void swap_visual_state ();
464 std::vector<VisualState*> visual_states;
465 sigc::connection visual_state_op_connection;
466 void start_visual_state_op (uint32_t n);
467 void cancel_visual_state_op (uint32_t n);
468 bool end_visual_state_op (uint32_t n);
470 nframes64_t leftmost_frame;
471 double frames_per_unit;
472 Editing::ZoomFocus zoom_focus;
474 void set_frames_per_unit (double);
477 Editing::MouseMode mouse_mode;
478 bool _internal_editing;
480 int post_maximal_editor_width;
481 int post_maximal_pane_position;
482 int pre_maximal_pane_position;
483 int pre_maximal_editor_width;
484 void pane_allocation_handler (Gtk::Allocation&, Gtk::Paned*);
486 Gtk::Notebook the_notebook;
487 Gtk::HPaned edit_pane;
489 Gtk::EventBox meter_base;
491 Gtk::EventBox marker_base;
492 Gtk::HBox marker_box;
493 Gtk::VBox scrollers_rulers_markers_box;
495 void location_changed (ARDOUR::Location *);
496 void location_flags_changed (ARDOUR::Location *, void *);
497 void refresh_location_display ();
498 void refresh_location_display_s (ARDOUR::Change);
499 void refresh_location_display_internal (ARDOUR::Locations::LocationList&);
500 void add_new_location (ARDOUR::Location *);
501 void location_gone (ARDOUR::Location *);
502 void remove_marker (ArdourCanvas::Item&, GdkEvent*);
503 gint really_remove_marker (ARDOUR::Location* loc);
504 void goto_nth_marker (int nth);
506 uint32_t location_marker_color;
507 uint32_t location_range_color;
508 uint32_t location_loop_color;
509 uint32_t location_punch_color;
510 uint32_t location_cd_marker_color;
512 struct LocationMarkers {
517 LocationMarkers () : start(0), end(0), valid (true) {}
523 void set_name (const std::string&);
524 void set_position (nframes64_t start, nframes64_t end = 0);
525 void set_color_rgba (uint32_t);
528 LocationMarkers *find_location_markers (ARDOUR::Location *) const;
529 ARDOUR::Location* find_location_from_marker (Marker *, bool& is_start) const;
530 Marker* entered_marker;
532 typedef std::map<ARDOUR::Location*,LocationMarkers *> LocationMarkerMap;
533 LocationMarkerMap location_markers;
535 void hide_marker (ArdourCanvas::Item*, GdkEvent*);
536 void clear_marker_display ();
537 void mouse_add_new_marker (nframes64_t where, bool is_cd=false, bool is_xrun=false);
538 bool choose_new_marker_name(std::string &name);
539 void update_cd_marker_display ();
540 void ensure_cd_marker_updated (LocationMarkers * lam, ARDOUR::Location * location);
542 TimeAxisView* clicked_axisview;
543 RouteTimeAxisView* clicked_routeview;
544 /** The last RegionView that was clicked on, or 0 if the last click was not
545 * on a RegionView. This is set up by the canvas event handlers in
546 * editor_canvas_events.cc
548 RegionView* clicked_regionview;
549 RegionSelection latest_regionviews;
550 uint32_t clicked_selection;
551 CrossfadeView* clicked_crossfadeview;
552 ControlPoint* clicked_control_point;
554 void sort_track_selection (TrackSelection* sel = 0);
556 void get_relevant_tracks (std::set<RouteTimeAxisView*>& relevant_tracks) const;
557 void get_equivalent_tracks (RouteTimeAxisView*, std::set<RouteTimeAxisView*> &, ARDOUR::RouteGroup::Property) const;
558 void get_equivalent_regions (RegionView* rv, std::vector<RegionView*> &, ARDOUR::RouteGroup::Property) const;
559 RegionSelection get_equivalent_regions (RegionSelection &, ARDOUR::RouteGroup::Property) const;
560 void mapover_tracks (sigc::slot<void,RouteTimeAxisView&,uint32_t> sl, TimeAxisView*, ARDOUR::RouteGroup::Property) const;
562 /* functions to be passed to mapover_tracks(), possibly with sigc::bind()-supplied arguments */
564 void mapped_get_equivalent_regions (RouteTimeAxisView&, uint32_t, RegionView *, std::vector<RegionView*>*) const;
565 void mapped_use_new_playlist (RouteTimeAxisView&, uint32_t, std::vector<boost::shared_ptr<ARDOUR::Playlist> > const &);
566 void mapped_use_copy_playlist (RouteTimeAxisView&, uint32_t, std::vector<boost::shared_ptr<ARDOUR::Playlist> > const &);
567 void mapped_clear_playlist (RouteTimeAxisView&, uint32_t);
571 void button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type);
572 bool button_release_can_deselect;
574 void catch_vanishing_regionview (RegionView *);
576 void set_selected_track (TimeAxisView&, Selection::Operation op = Selection::Set, bool no_remove=false);
577 void select_all_tracks ();
579 bool set_selected_control_point_from_click (Selection::Operation op = Selection::Set, bool no_remove=false);
580 void set_selected_track_from_click (bool press, Selection::Operation op = Selection::Set, bool no_remove=false);
581 void set_selected_track_as_side_effect (bool force = false);
582 bool set_selected_regionview_from_click (bool press, Selection::Operation op = Selection::Set, bool no_track_remove=false);
584 bool set_selected_regionview_from_map_event (GdkEventAny*, StreamView*, boost::weak_ptr<ARDOUR::Region>);
585 void collect_new_region_view (RegionView *);
586 void collect_and_select_new_region_view (RegionView *);
588 Gtk::Menu track_context_menu;
589 Gtk::Menu track_region_context_menu;
590 Gtk::Menu track_selection_context_menu;
591 Gtk::Menu track_crossfade_context_menu;
593 Gtk::MenuItem* region_edit_menu_split_item;
594 Gtk::MenuItem* region_edit_menu_split_multichannel_item;
595 Gtk::Menu * track_region_edit_playlist_menu;
596 Gtk::Menu * track_edit_playlist_submenu;
597 Gtk::Menu * track_selection_edit_playlist_submenu;
599 void popup_track_context_menu (int, int, ItemType, bool, nframes64_t);
600 Gtk::Menu* build_track_context_menu (nframes64_t);
601 Gtk::Menu* build_track_bus_context_menu (nframes64_t);
602 Gtk::Menu* build_track_region_context_menu (nframes64_t frame);
603 Gtk::Menu* build_track_crossfade_context_menu (nframes64_t);
604 Gtk::Menu* build_track_selection_context_menu (nframes64_t);
605 void add_dstream_context_items (Gtk::Menu_Helpers::MenuList&);
606 void add_bus_context_items (Gtk::Menu_Helpers::MenuList&);
607 void add_region_context_items (StreamView*, boost::shared_ptr<ARDOUR::Region>, Gtk::Menu_Helpers::MenuList&);
608 void add_crossfade_context_items (AudioStreamView*, boost::shared_ptr<ARDOUR::Crossfade>, Gtk::Menu_Helpers::MenuList&, bool many);
609 void add_selection_context_items (Gtk::Menu_Helpers::MenuList&);
611 void handle_new_route (ARDOUR::RouteList&);
612 void remove_route (TimeAxisView *);
615 Gtk::HBox global_hpacker;
616 Gtk::VBox global_vpacker;
619 Gdk::Cursor* current_canvas_cursor;
620 void set_canvas_cursor ();
621 Gdk::Cursor* which_grabber_cursor ();
623 ArdourCanvas::Canvas* track_canvas;
625 ArdourCanvas::Text* verbose_canvas_cursor;
626 bool verbose_cursor_visible;
628 void parameter_changed (std::string);
630 bool track_canvas_motion (GdkEvent*);
632 void set_verbose_canvas_cursor (const std::string &, double x, double y);
633 void set_verbose_canvas_cursor_text (const std::string &);
634 void show_verbose_canvas_cursor();
636 bool verbose_cursor_on; // so far unused
638 Gtk::EventBox time_canvas_event_box;
639 Gtk::EventBox track_canvas_event_box;
640 Gtk::EventBox time_button_event_box;
641 Gtk::EventBox ruler_label_event_box;
643 ArdourCanvas::Group *minsec_group;
644 ArdourCanvas::Pixbuf *logo_item;
645 ArdourCanvas::Group *bbt_group;
646 ArdourCanvas::Group *smpte_group;
647 ArdourCanvas::Group *frame_group;
648 ArdourCanvas::Group *tempo_group;
649 ArdourCanvas::Group *meter_group;
650 ArdourCanvas::Group *marker_group;
651 ArdourCanvas::Group *range_marker_group;
652 ArdourCanvas::Group *transport_marker_group;
653 ArdourCanvas::Group* cd_marker_group;
655 ArdourCanvas::Group* timebar_group;
657 /* These bars never need to be scrolled */
658 ArdourCanvas::Group* meter_bar_group;
659 ArdourCanvas::Group* tempo_bar_group;
660 ArdourCanvas::Group* marker_bar_group;
661 ArdourCanvas::Group* range_marker_bar_group;
662 ArdourCanvas::Group* transport_marker_bar_group;
663 ArdourCanvas::Group* cd_marker_bar_group;
665 /** The group containing all items that require horizontal scrolling. */
666 ArdourCanvas::Group* _background_group;
668 The _master_group is the group containing all items
669 that require horizontal scrolling..
670 It is primarily used to separate canvas items
671 that require horizontal scrolling from those that do not.
673 ArdourCanvas::Group* _master_group;
675 /* The group containing all trackviews. Only scrolled vertically. */
676 ArdourCanvas::Group* _trackview_group;
678 /* The group used for region motion. Sits on top of _trackview_group */
679 ArdourCanvas::Group* _region_motion_group;
682 ruler_metric_smpte = 0,
683 ruler_metric_bbt = 1,
684 ruler_metric_frames = 2,
685 ruler_metric_minsec = 3,
687 ruler_time_tempo = 4,
688 ruler_time_meter = 5,
689 ruler_time_marker = 6,
690 ruler_time_range_marker = 7,
691 ruler_time_transport_marker = 8,
692 ruler_time_cd_marker = 9,
695 static GtkCustomMetric ruler_metrics[4];
696 Glib::RefPtr<Gtk::ToggleAction> ruler_timecode_action;
697 Glib::RefPtr<Gtk::ToggleAction> ruler_bbt_action;
698 Glib::RefPtr<Gtk::ToggleAction> ruler_samples_action;
699 Glib::RefPtr<Gtk::ToggleAction> ruler_minsec_action;
700 Glib::RefPtr<Gtk::ToggleAction> ruler_tempo_action;
701 Glib::RefPtr<Gtk::ToggleAction> ruler_meter_action;
702 Glib::RefPtr<Gtk::ToggleAction> ruler_marker_action;
703 Glib::RefPtr<Gtk::ToggleAction> ruler_range_action;
704 Glib::RefPtr<Gtk::ToggleAction> ruler_loop_punch_action;
705 Glib::RefPtr<Gtk::ToggleAction> ruler_cd_marker_action;
706 bool no_ruler_shown_update;
708 gint ruler_button_press (GdkEventButton*);
709 gint ruler_button_release (GdkEventButton*);
710 gint ruler_mouse_motion (GdkEventMotion*);
711 bool ruler_scroll (GdkEventScroll* event);
713 Gtk::Widget * ruler_grabbed_widget;
715 void initialize_rulers ();
716 void update_just_smpte ();
717 void compute_fixed_ruler_scale (); //calculates the RulerScale of the fixed rulers
718 void update_fixed_rulers ();
719 void update_tempo_based_rulers ();
720 void popup_ruler_menu (nframes64_t where = 0, ItemType type = RegionItem);
721 void update_ruler_visibility ();
722 void set_ruler_visible (RulerType, bool);
723 void toggle_ruler_visibility (RulerType rt);
724 void ruler_toggled (int);
725 gint ruler_label_button_release (GdkEventButton*);
726 void store_ruler_visibility ();
727 void restore_ruler_visibility ();
729 static gint _metric_get_smpte (GtkCustomRulerMark **, gdouble, gdouble, gint);
730 static gint _metric_get_bbt (GtkCustomRulerMark **, gdouble, gdouble, gint);
731 static gint _metric_get_frames (GtkCustomRulerMark **, gdouble, gdouble, gint);
732 static gint _metric_get_minsec (GtkCustomRulerMark **, gdouble, gdouble, gint);
734 enum MinsecRulerScale {
741 MinsecRulerScale minsec_ruler_scale;
743 nframes_t minsec_mark_interval;
744 gint minsec_mark_modulo;
746 void set_minsec_ruler_scale (gdouble lower, gdouble upper);
748 enum SMPTERulerScale {
756 SMPTERulerScale smpte_ruler_scale;
758 nframes_t smpte_mark_interval;
759 gint smpte_mark_modulo;
761 void set_smpte_ruler_scale (gdouble lower, gdouble upper);
771 bbt_show_ticks_detail,
772 bbt_show_ticks_super_detail
775 BBTRulerScale bbt_ruler_scale;
779 uint32_t bbt_bar_helper_on;
780 uint32_t bbt_accent_modulo;
781 void compute_bbt_ruler_scale (nframes64_t lower, nframes64_t upper);
783 gint metric_get_smpte (GtkCustomRulerMark **, gdouble, gdouble, gint);
784 gint metric_get_bbt (GtkCustomRulerMark **, gdouble, gdouble, gint);
785 gint metric_get_frames (GtkCustomRulerMark **, gdouble, gdouble, gint);
786 gint metric_get_minsec (GtkCustomRulerMark **, gdouble, gdouble, gint);
788 Gtk::Widget *_ruler_separator;
789 GtkWidget *_smpte_ruler;
790 GtkWidget *_bbt_ruler;
791 GtkWidget *_frames_ruler;
792 GtkWidget *_minsec_ruler;
793 Gtk::Widget *smpte_ruler;
794 Gtk::Widget *bbt_ruler;
795 Gtk::Widget *frames_ruler;
796 Gtk::Widget *minsec_ruler;
797 static Editor *ruler_editor;
799 static const double timebar_height;
800 guint32 visible_timebars;
801 gdouble canvas_timebars_vsize;
802 gdouble get_canvas_timebars_vsize () const { return canvas_timebars_vsize; }
803 Gtk::Menu *editor_ruler_menu;
805 ArdourCanvas::SimpleRect* tempo_bar;
806 ArdourCanvas::SimpleRect* meter_bar;
807 ArdourCanvas::SimpleRect* marker_bar;
808 ArdourCanvas::SimpleRect* range_marker_bar;
809 ArdourCanvas::SimpleRect* transport_marker_bar;
810 ArdourCanvas::SimpleRect* cd_marker_bar;
812 Gtk::Label minsec_label;
813 Gtk::Label bbt_label;
814 Gtk::Label smpte_label;
815 Gtk::Label frame_label;
816 Gtk::Label tempo_label;
817 Gtk::Label meter_label;
818 Gtk::Label mark_label;
819 Gtk::Label range_mark_label;
820 Gtk::Label transport_mark_label;
821 Gtk::Label cd_mark_label;
823 Gtk::VBox time_button_vbox;
824 Gtk::HBox time_button_hbox;
826 friend class EditorCursor;
828 EditorCursor* playhead_cursor;
829 ArdourCanvas::Group* cursor_group;
831 nframes64_t get_region_boundary (nframes64_t pos, int32_t dir, bool with_selection, bool only_onscreen);
833 void cursor_to_region_boundary (bool with_selection, int32_t dir);
834 void cursor_to_next_region_boundary (bool with_selection);
835 void cursor_to_previous_region_boundary (bool with_selection);
836 void cursor_to_next_region_point (EditorCursor*, ARDOUR::RegionPoint);
837 void cursor_to_previous_region_point (EditorCursor*, ARDOUR::RegionPoint);
838 void cursor_to_region_point (EditorCursor*, ARDOUR::RegionPoint, int32_t dir);
839 void cursor_to_selection_start (EditorCursor *);
840 void cursor_to_selection_end (EditorCursor *);
842 void selected_marker_to_region_boundary (bool with_selection, int32_t dir);
843 void selected_marker_to_next_region_boundary (bool with_selection);
844 void selected_marker_to_previous_region_boundary (bool with_selection);
845 void selected_marker_to_next_region_point (ARDOUR::RegionPoint);
846 void selected_marker_to_previous_region_point (ARDOUR::RegionPoint);
847 void selected_marker_to_region_point (ARDOUR::RegionPoint, int32_t dir);
848 void selected_marker_to_selection_start ();
849 void selected_marker_to_selection_end ();
851 void select_all_selectables_using_cursor (EditorCursor *, bool);
852 void select_all_selectables_using_edit (bool);
853 void select_all_selectables_between (bool within);
854 void select_range_between ();
856 boost::shared_ptr<ARDOUR::Region> find_next_region (nframes64_t, ARDOUR::RegionPoint, int32_t dir, TrackViewList&, TimeAxisView ** = 0);
857 nframes64_t find_next_region_boundary (nframes64_t, int32_t dir, const TrackViewList&);
859 std::vector<nframes64_t> region_boundary_cache;
860 void build_region_boundary_cache ();
863 Gtk::HBox bottom_hbox;
865 Gtk::Table edit_packer;
866 Gtk::VScrollbar edit_vscrollbar;
868 Gtk::Adjustment vertical_adjustment;
869 Gtk::Adjustment horizontal_adjustment;
871 Gtk::Layout controls_layout;
872 bool control_layout_scroll (GdkEventScroll* ev);
873 void controls_layout_size_request (Gtk::Requisition*);
874 sigc::connection controls_layout_size_request_connection;
876 Gtk::HScrollbar edit_hscrollbar;
877 bool _dragging_hscrollbar;
879 void reset_hscrollbar_stepping ();
881 bool hscrollbar_button_press (GdkEventButton*);
882 bool hscrollbar_button_release (GdkEventButton*);
883 void hscrollbar_allocate (Gtk::Allocation &alloc);
885 double _canvas_width;
886 double _canvas_height;
887 double full_canvas_height;
889 bool track_canvas_map_handler (GdkEventAny*);
891 gint edit_controls_button_release (GdkEventButton*);
892 Gtk::Menu *edit_controls_left_menu;
893 Gtk::Menu *edit_controls_right_menu;
895 Gtk::VBox ruler_label_vbox;
896 Gtk::VBox track_canvas_vbox;
897 Gtk::VBox time_canvas_vbox;
898 Gtk::VBox edit_controls_vbox;
899 Gtk::HBox edit_controls_hbox;
901 void control_scroll (float);
902 void access_action (std::string,std::string);
903 bool deferred_control_scroll (nframes64_t);
904 sigc::connection control_scroll_connection;
906 gdouble get_trackview_group_vertical_offset () const { return vertical_adjustment.get_value () - canvas_timebars_vsize;}
908 ArdourCanvas::Group* get_background_group () const { return _background_group; }
909 ArdourCanvas::Group* get_trackview_group () const { return _trackview_group; }
910 double last_trackview_group_vertical_offset;
911 void tie_vertical_scrolling ();
912 void scroll_canvas_horizontally ();
913 void scroll_canvas_vertically ();
915 struct VisualChange {
923 nframes64_t time_origin;
924 double frames_per_unit;
929 VisualChange() : pending ((VisualChange::Type) 0), time_origin (0), frames_per_unit (0), idle_handler_id (-1) {}
931 pending = Type (pending | t);
936 VisualChange pending_visual_change;
938 static int _idle_visual_changer (void *arg);
939 int idle_visual_changer ();
941 void queue_visual_change (nframes64_t);
942 void queue_visual_change (double);
943 void queue_visual_change_y (double);
944 void ensure_visual_change_idle_handler ();
946 void end_location_changed (ARDOUR::Location*);
948 /* named selections */
950 struct NamedSelectionDisplayModelColumns : public Gtk::TreeModel::ColumnRecord {
951 NamedSelectionDisplayModelColumns() {
955 Gtk::TreeModelColumn<Glib::ustring> text;
956 Gtk::TreeModelColumn<ARDOUR::NamedSelection*> selection;
959 NamedSelectionDisplayModelColumns named_selection_columns;
960 Glib::RefPtr<Gtk::TreeStore> named_selection_model;
962 Gtkmm2ext::DnDTreeView<ARDOUR::NamedSelection*> named_selection_display;
963 Gtk::ScrolledWindow named_selection_scroller;
965 void create_named_selection ();
966 void paste_named_selection (float times);
967 void remove_selected_named_selections ();
969 void handle_new_named_selection ();
970 void add_named_selection_to_named_selection_display (ARDOUR::NamedSelection&);
971 void redisplay_named_selections ();
973 bool named_selection_display_button_release (GdkEventButton *ev);
974 bool named_selection_display_key_release (GdkEventKey *ev);
975 void named_selection_display_selection_changed ();
978 TrackViewList track_views;
979 std::pair<TimeAxisView*, ARDOUR::layer_t> trackview_by_y_position (double);
980 TimeAxisView* axis_view_from_route (ARDOUR::Route *) const;
981 TrackSelection axis_views_from_routes (std::list<ARDOUR::Route *>) const;
983 TrackSelection get_tracks_for_range_action () const;
985 static Gdk::Cursor* cross_hair_cursor;
986 static Gdk::Cursor* trimmer_cursor;
987 static Gdk::Cursor* selector_cursor;
988 static Gdk::Cursor* grabber_cursor;
989 static Gdk::Cursor* grabber_edit_point_cursor;
990 static Gdk::Cursor* zoom_cursor;
991 static Gdk::Cursor* time_fx_cursor;
992 static Gdk::Cursor* fader_cursor;
993 static Gdk::Cursor* speaker_cursor;
994 static Gdk::Cursor* midi_pencil_cursor;
995 static Gdk::Cursor* midi_select_cursor;
996 static Gdk::Cursor* midi_resize_cursor;
997 static Gdk::Cursor* midi_erase_cursor;
998 static Gdk::Cursor* wait_cursor;
999 static Gdk::Cursor* timebar_cursor;
1000 static Gdk::Cursor* transparent_cursor;
1002 static void build_cursors ();
1004 sigc::connection scroll_connection;
1005 nframes64_t last_update_frame;
1006 void center_screen (nframes64_t);
1007 void center_screen_internal (nframes64_t, float);
1009 void update_current_screen ();
1011 void session_going_away ();
1013 nframes64_t cut_buffer_start;
1014 nframes64_t cut_buffer_length;
1016 bool typed_event (ArdourCanvas::Item*, GdkEvent*, ItemType);
1017 bool button_press_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
1018 bool button_press_handler_1 (ArdourCanvas::Item *, GdkEvent *, ItemType);
1019 bool button_press_handler_2 (ArdourCanvas::Item *, GdkEvent *, ItemType);
1020 bool button_release_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
1021 bool motion_handler (ArdourCanvas::Item*, GdkEvent*, bool from_autoscroll = false);
1022 bool enter_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
1023 bool leave_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
1025 /* KEYMAP HANDLING */
1027 void register_actions ();
1029 int ensure_cursor (nframes64_t* pos);
1031 void cut_copy (Editing::CutCopyOp);
1032 bool can_cut_copy () const;
1033 void cut_copy_points (Editing::CutCopyOp);
1034 void cut_copy_regions (Editing::CutCopyOp, RegionSelection&);
1035 void cut_copy_ranges (Editing::CutCopyOp);
1036 void cut_copy_midi (Editing::CutCopyOp);
1038 void mouse_paste ();
1039 void paste_internal (nframes64_t position, float times);
1041 /* EDITING OPERATIONS */
1043 void reset_point_selection ();
1044 void toggle_region_mute ();
1045 void toggle_region_lock ();
1046 void toggle_region_opaque ();
1047 void toggle_record_enable ();
1048 void set_region_lock_style (ARDOUR::Region::PositionLockStyle);
1049 void raise_region ();
1050 void raise_region_to_top ();
1051 void lower_region ();
1052 void lower_region_to_bottom ();
1053 void split_regions_at (nframes64_t, RegionSelection&);
1054 void split_region_at_transients ();
1055 void split_region_at_points (boost::shared_ptr<ARDOUR::Region>, ARDOUR::AnalysisFeatureList&, bool can_ferret);
1056 void crop_region_to_selection ();
1057 void crop_region_to (nframes64_t start, nframes64_t end);
1058 void set_sync_point (nframes64_t, const RegionSelection&);
1059 void set_region_sync_from_edit_point ();
1060 void remove_region_sync();
1061 void align_selection (ARDOUR::RegionPoint, nframes64_t position, const RegionSelection&);
1062 void align_selection_relative (ARDOUR::RegionPoint point, nframes64_t position, const RegionSelection&);
1063 void align_region (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, nframes64_t position);
1064 void align_region_internal (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, nframes64_t position);
1065 void remove_selected_regions ();
1066 void remove_clicked_region ();
1067 void edit_region ();
1068 void show_midi_list_editor ();
1069 void rename_region ();
1070 void duplicate_some_regions (RegionSelection&, float times);
1071 void duplicate_selection (float times);
1072 void region_fill_selection ();
1074 void region_fill_track ();
1075 void audition_playlist_region_standalone (boost::shared_ptr<ARDOUR::Region>);
1076 void audition_playlist_region_via_route (boost::shared_ptr<ARDOUR::Region>, ARDOUR::Route&);
1077 void split_multichannel_region();
1078 void reverse_region ();
1079 void strip_region_silence ();
1080 void normalize_region ();
1081 double _last_normalization_value;
1082 void denormalize_region ();
1083 void adjust_region_scale_amplitude (bool up);
1084 void quantize_region ();
1086 void do_insert_time ();
1087 void insert_time (nframes64_t, nframes64_t, Editing::InsertTimeOption, bool, bool, bool);
1089 void tab_to_transient (bool forward);
1091 void use_region_as_bar ();
1092 void use_range_as_bar ();
1094 void define_one_bar (nframes64_t start, nframes64_t end);
1096 void audition_region_from_region_list ();
1097 void hide_region_from_region_list ();
1099 void align (ARDOUR::RegionPoint);
1100 void align_relative (ARDOUR::RegionPoint);
1103 void reset_focus ();
1109 void paste (float times);
1111 int get_prefix (float&, bool&);
1113 void keyboard_paste ();
1114 void keyboard_insert_region_list_selection ();
1116 void region_from_selection ();
1117 void create_region_from_selection (std::vector<boost::shared_ptr<ARDOUR::Region> >&);
1119 void play_from_start ();
1120 void play_from_edit_point ();
1121 void play_from_edit_point_and_return ();
1122 void play_selected_region ();
1123 void play_edit_range ();
1124 void loop_selected_region ();
1125 void play_location (ARDOUR::Location&);
1126 void loop_location (ARDOUR::Location&);
1128 void temporal_zoom_selection ();
1129 void temporal_zoom_region (bool both_axes);
1130 void toggle_zoom_region (bool both_axes);
1131 bool zoomed_to_region;
1132 void temporal_zoom_session ();
1133 void temporal_zoom (gdouble scale);
1134 void temporal_zoom_by_frame (nframes64_t start, nframes64_t end, const std::string & op);
1135 void temporal_zoom_to_frame (bool coarser, nframes64_t frame);
1137 void amplitude_zoom (gdouble scale);
1138 void amplitude_zoom_step (bool in);
1140 void insert_region_list_drag (boost::shared_ptr<ARDOUR::Region>, int x, int y);
1141 void insert_region_list_selection (float times);
1143 void insert_route_list_drag (boost::shared_ptr<ARDOUR::Route>, int x, int y);
1145 /* import & embed */
1147 void add_external_audio_action (Editing::ImportMode);
1148 void external_audio_dialog ();
1149 void session_import_dialog ();
1151 int check_whether_and_how_to_import(std::string, bool all_or_nothing = true);
1152 bool check_multichannel_status (const std::vector<Glib::ustring>& paths);
1154 SoundFileOmega* sfbrowser;
1156 void bring_in_external_audio (Editing::ImportMode mode, nframes64_t& pos);
1158 bool idle_drop_paths (std::vector<Glib::ustring> paths, nframes64_t frame, double ypos);
1159 void drop_paths_part_two (const std::vector<Glib::ustring>& paths, nframes64_t frame, double ypos);
1161 int import_sndfiles (std::vector<Glib::ustring> paths, Editing::ImportMode mode, ARDOUR::SrcQuality, nframes64_t& pos,
1162 int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>, bool, uint32_t total);
1163 int embed_sndfiles (std::vector<Glib::ustring> paths, bool multiple_files, bool& check_sample_rate, Editing::ImportMode mode,
1164 nframes64_t& pos, int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>&);
1166 int add_sources (std::vector<Glib::ustring> paths, ARDOUR::SourceList& sources, nframes64_t& pos, Editing::ImportMode,
1167 int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>&, bool add_channel_suffix);
1168 int finish_bringing_in_material (boost::shared_ptr<ARDOUR::Region> region, uint32_t, uint32_t, nframes64_t& pos, Editing::ImportMode mode,
1169 boost::shared_ptr<ARDOUR::Track>& existing_track);
1171 boost::shared_ptr<ARDOUR::AudioTrack> get_nth_selected_audio_track (int nth) const;
1172 boost::shared_ptr<ARDOUR::MidiTrack> get_nth_selected_midi_track (int nth) const;
1174 /* generic interthread progress window */
1176 ArdourDialog* interthread_progress_window;
1177 Gtk::Label interthread_progress_label;
1178 Gtk::VBox interthread_progress_vbox;
1179 Gtk::ProgressBar interthread_progress_bar;
1180 Gtk::Button interthread_cancel_button;
1181 Gtk::Label interthread_cancel_label;
1182 sigc::connection interthread_progress_connection;
1183 void interthread_cancel_clicked ();
1184 void build_interthread_progress_window ();
1185 ARDOUR::InterThreadInfo* current_interthread_info;
1187 AnalysisWindow* analysis_window;
1189 /* import specific info */
1191 struct EditorImportStatus : public ARDOUR::Session::ImportStatus {
1192 Editing::ImportMode mode;
1196 boost::shared_ptr<ARDOUR::Track> track;
1200 EditorImportStatus import_status;
1201 gint import_progress_timeout (void *);
1202 static void *_import_thread (void *);
1203 void* import_thread ();
1204 void finish_import ();
1206 /* to support this ... */
1208 void import_audio (bool as_tracks);
1209 void do_import (std::vector<Glib::ustring> paths, bool split, bool as_tracks);
1211 void move_to_start ();
1212 void move_to_end ();
1214 void center_playhead ();
1215 void center_edit_point ();
1216 void edit_cursor_backward ();
1217 void edit_cursor_forward ();
1218 void playhead_forward_to_grid ();
1219 void playhead_backward_to_grid ();
1220 void playhead_backward ();
1221 void playhead_forward ();
1222 void scroll_playhead (bool forward);
1223 void scroll_backward (float pages=0.8f);
1224 void scroll_forward (float pages=0.8f);
1225 void scroll_tracks_down ();
1226 void scroll_tracks_up ();
1227 void delete_sample_forward ();
1228 void delete_sample_backward ();
1229 void delete_screen ();
1230 void search_backwards ();
1231 void search_forwards ();
1233 void clear_markers ();
1234 void clear_ranges ();
1235 void clear_locations ();
1236 void unhide_markers ();
1237 void unhide_ranges ();
1238 void jump_forward_to_mark ();
1239 void jump_backward_to_mark ();
1240 void cursor_align (bool playhead_to_edit);
1242 void remove_last_capture ();
1243 void select_all_selectables_using_time_selection ();
1244 void select_all_selectables_using_loop();
1245 void select_all_selectables_using_punch();
1246 void set_selection_from_range (ARDOUR::Location&);
1247 void set_selection_from_punch ();
1248 void set_selection_from_loop ();
1249 void set_selection_from_region ();
1251 void add_location_mark (nframes64_t where);
1252 void add_location_from_audio_region ();
1253 void add_locations_from_audio_region ();
1254 void add_location_from_selection ();
1255 void set_loop_from_selection (bool play);
1256 void set_punch_from_selection ();
1257 void set_punch_from_region ();
1259 void set_loop_from_edit_range (bool play);
1260 void set_loop_from_region (bool play);
1261 void set_punch_from_edit_range ();
1263 void set_loop_range (nframes64_t start, nframes64_t end, std::string cmd);
1264 void set_punch_range (nframes64_t start, nframes64_t end, std::string cmd);
1266 void add_location_from_playhead_cursor ();
1267 bool select_new_marker;
1269 void reverse_selection ();
1270 void edit_envelope ();
1272 void start_scrolling ();
1273 void stop_scrolling ();
1275 double last_scrub_x;
1276 int scrubbing_direction;
1277 int scrub_reversals;
1278 int scrub_reverse_distance;
1281 void keyboard_selection_begin ();
1282 void keyboard_selection_finish (bool add);
1283 bool have_pending_keyboard_selection;
1284 nframes64_t pending_keyboard_selection_start;
1286 boost::shared_ptr<ARDOUR::Region> select_region_for_operation (int dir, TimeAxisView **tv);
1287 void extend_selection_to_end_of_region (bool next);
1288 void extend_selection_to_start_of_region (bool previous);
1290 Editing::SnapType snap_type;
1291 Editing::SnapMode snap_mode;
1293 /// Snap threshold in pixels
1294 double snap_threshold;
1296 bool ignore_gui_changes;
1302 Gtk::Menu fade_context_menu;
1303 void popup_fade_context_menu (int, int, ArdourCanvas::Item*, ItemType);
1305 void set_fade_in_shape (ARDOUR::AudioRegion::FadeShape);
1306 void set_fade_out_shape (ARDOUR::AudioRegion::FadeShape);
1308 void set_fade_length (bool in);
1309 void toggle_fade_active (bool in);
1310 void set_fade_in_active (bool);
1311 void set_fade_out_active (bool);
1313 std::set<boost::shared_ptr<ARDOUR::Playlist> > motion_frozen_playlists;
1314 RegionSelection pre_drag_region_selection;
1316 bool _dragging_playhead;
1317 bool _dragging_edit_point;
1319 void marker_drag_motion_callback (GdkEvent*);
1320 void marker_drag_finished_callback (GdkEvent*);
1322 gint mouse_rename_region (ArdourCanvas::Item*, GdkEvent*);
1324 void start_region_grab (ArdourCanvas::Item*, GdkEvent*, RegionView*);
1325 void start_create_region_grab (ArdourCanvas::Item*, GdkEvent*);
1326 void start_region_copy_grab (ArdourCanvas::Item*, GdkEvent*, RegionView*);
1327 void start_region_brush_grab (ArdourCanvas::Item*, GdkEvent*, RegionView*);
1328 void start_selection_grab (ArdourCanvas::Item*, GdkEvent*);
1330 void region_view_item_click (AudioRegionView&, GdkEventButton*);
1332 void remove_gain_control_point (ArdourCanvas::Item*, GdkEvent*);
1333 void remove_control_point (ArdourCanvas::Item*, GdkEvent*);
1335 void mouse_brush_insert_region (RegionView*, nframes64_t pos);
1336 void brush (nframes64_t);
1338 void show_verbose_time_cursor (nframes64_t frame, double offset = 0, double xpos=-1, double ypos=-1);
1339 void show_verbose_duration_cursor (nframes64_t start, nframes64_t end, double offset = 0, double xpos=-1, double ypos=-1);
1340 double clamp_verbose_cursor_x (double);
1341 double clamp_verbose_cursor_y (double);
1343 /* Canvas event handlers */
1345 bool canvas_control_point_event (GdkEvent* event,ArdourCanvas::Item*, ControlPoint*);
1346 bool canvas_line_event (GdkEvent* event,ArdourCanvas::Item*, AutomationLine*);
1347 bool canvas_selection_rect_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1348 bool canvas_selection_start_trim_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1349 bool canvas_selection_end_trim_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1350 bool canvas_crossfade_view_event (GdkEvent* event,ArdourCanvas::Item*, CrossfadeView*);
1351 bool canvas_fade_in_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1352 bool canvas_fade_in_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1353 bool canvas_fade_out_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1354 bool canvas_fade_out_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1357 // These variables are used to detect a feedback loop and break it to avoid a gui hang
1359 ArdourCanvas::Item *last_item_entered;
1360 int last_item_entered_n;
1363 bool canvas_region_view_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1364 bool canvas_frame_handle_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1365 bool canvas_region_view_name_highlight_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1366 bool canvas_region_view_name_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1367 bool canvas_stream_view_event (GdkEvent* event,ArdourCanvas::Item*, RouteTimeAxisView*);
1368 bool canvas_marker_event (GdkEvent* event,ArdourCanvas::Item*, Marker*);
1369 bool canvas_zoom_rect_event (GdkEvent* event,ArdourCanvas::Item*);
1370 bool canvas_tempo_marker_event (GdkEvent* event,ArdourCanvas::Item*, TempoMarker*);
1371 bool canvas_meter_marker_event (GdkEvent* event,ArdourCanvas::Item*, MeterMarker*);
1372 bool canvas_automation_track_event(GdkEvent* event, ArdourCanvas::Item*, AutomationTimeAxisView*) ;
1374 bool canvas_tempo_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1375 bool canvas_meter_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1376 bool canvas_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1377 bool canvas_range_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1378 bool canvas_transport_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1379 bool canvas_cd_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1381 bool canvas_imageframe_item_view_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1382 bool canvas_imageframe_view_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameTimeAxis*);
1383 bool canvas_imageframe_start_handle_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1384 bool canvas_imageframe_end_handle_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1385 bool canvas_marker_time_axis_view_event(GdkEvent* event, ArdourCanvas::Item*,MarkerTimeAxis*);
1386 bool canvas_markerview_item_view_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1387 bool canvas_markerview_start_handle_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1388 bool canvas_markerview_end_handle_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1390 /* non-public event handlers */
1392 bool canvas_playhead_cursor_event (GdkEvent* event, ArdourCanvas::Item*);
1393 bool track_canvas_scroll (GdkEventScroll* event);
1395 bool track_canvas_scroll_event (GdkEventScroll* event);
1396 bool track_canvas_button_press_event (GdkEventButton* event);
1397 bool track_canvas_button_release_event (GdkEventButton* event);
1398 bool track_canvas_motion_notify_event (GdkEventMotion* event);
1400 Gtk::Allocation canvas_allocation;
1401 void track_canvas_allocate (Gtk::Allocation alloc);
1402 bool track_canvas_size_allocated ();
1403 bool track_canvas_drag_motion (Glib::RefPtr<Gdk::DragContext> const &, int, int, guint);
1405 void set_playhead_cursor ();
1407 void kbd_driver (sigc::slot<void,GdkEvent*>, bool use_track_canvas = true, bool use_time_canvas = true, bool can_select = true);
1408 void kbd_mute_unmute_region ();
1411 void kbd_do_brush (GdkEvent*);
1412 void kbd_do_audition (GdkEvent*);
1414 void handle_new_duration ();
1415 void initialize_canvas ();
1417 /* display control */
1419 bool _show_measures;
1420 /// true if the editor should follow the playhead, otherwise false
1421 bool _follow_playhead;
1422 /// true if waveforms should be shown while recording audio tracks, otherwise false
1423 bool _show_waveforms_recording;
1425 ARDOUR::TempoMap::BBTPointList *current_bbt_points;
1427 TempoLines* tempo_lines;
1429 ArdourCanvas::Group* time_line_group;
1431 void hide_measures ();
1432 void draw_measures ();
1433 bool redraw_measures ();
1435 void new_tempo_section ();
1437 void mouse_add_new_tempo_event (nframes64_t where);
1438 void mouse_add_new_meter_event (nframes64_t where);
1440 void remove_tempo_marker (ArdourCanvas::Item*);
1441 void remove_meter_marker (ArdourCanvas::Item*);
1442 gint real_remove_tempo_marker (ARDOUR::TempoSection*);
1443 gint real_remove_meter_marker (ARDOUR::MeterSection*);
1445 void edit_tempo_section (ARDOUR::TempoSection*);
1446 void edit_meter_section (ARDOUR::MeterSection*);
1447 void edit_tempo_marker (ArdourCanvas::Item*);
1448 void edit_meter_marker (ArdourCanvas::Item*);
1449 void edit_control_point (ArdourCanvas::Item*);
1451 void marker_menu_edit ();
1452 void marker_menu_remove ();
1453 void marker_menu_rename ();
1454 void marker_menu_lock (bool yn);
1455 void marker_menu_hide ();
1456 void marker_menu_loop_range ();
1457 void marker_menu_select_all_selectables_using_range ();
1458 void marker_menu_select_using_range ();
1459 void marker_menu_separate_regions_using_location ();
1460 void marker_menu_play_from ();
1461 void marker_menu_play_range ();
1462 void marker_menu_set_playhead ();
1463 void marker_menu_set_from_playhead ();
1464 void marker_menu_set_from_selection ();
1465 void marker_menu_range_to_next ();
1466 void new_transport_marker_menu_set_loop ();
1467 void new_transport_marker_menu_set_punch ();
1468 void update_loop_range_view (bool visibility=false);
1469 void update_punch_range_view (bool visibility=false);
1470 void new_transport_marker_menu_popdown ();
1471 void marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1472 void tm_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1473 void transport_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1474 void new_transport_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1475 void build_range_marker_menu (bool loop_or_punch);
1476 void build_marker_menu (bool start_or_end);
1477 void build_tm_marker_menu ();
1478 void build_new_transport_marker_menu ();
1480 Gtk::Menu* tm_marker_menu;
1481 Gtk::Menu* marker_menu;
1482 Gtk::Menu* start_end_marker_menu;
1483 Gtk::Menu* range_marker_menu;
1484 Gtk::Menu* transport_marker_menu;
1485 Gtk::Menu* new_transport_marker_menu;
1486 Gtk::Menu* cd_marker_menu;
1487 ArdourCanvas::Item* marker_menu_item;
1489 typedef std::list<Marker*> Marks;
1492 void remove_metric_marks ();
1493 void draw_metric_marks (const ARDOUR::Metrics& metrics);
1495 void compute_current_bbt_points (nframes_t left, nframes_t right);
1496 void tempo_map_changed (ARDOUR::Change);
1497 void redisplay_tempo (bool immediate_redraw);
1499 void snap_to (nframes64_t& first, int32_t direction = 0, bool for_mark = false);
1500 void snap_to_with_modifier (nframes64_t& first, GdkEvent const *, int32_t direction = 0, bool for_mark = false);
1501 void snap_to (nframes64_t& first, nframes64_t& last, int32_t direction = 0, bool for_mark = false);
1503 uint32_t bbt_beat_subdivision;
1507 Gtk::ToggleButton editor_mixer_button;
1508 Gtk::ToggleButton editor_list_button;
1509 void editor_mixer_button_toggled ();
1510 void editor_list_button_toggled ();
1512 AudioClock edit_point_clock;
1513 AudioClock zoom_range_clock;
1514 Gtk::Button zoom_in_button;
1515 Gtk::Button zoom_out_button;
1516 Gtk::Button zoom_out_full_button;
1517 Gtk::Button zoom_onetoone_button;
1519 Gtk::Button tav_expand_button;
1520 Gtk::Button tav_shrink_button;
1522 Gtk::VBox toolbar_clock_vbox;
1523 Gtk::VBox toolbar_selection_clock_vbox;
1524 Gtk::Table toolbar_selection_clock_table;
1525 Gtk::Label toolbar_selection_cursor_label;
1527 Gtk::HBox mouse_mode_button_box;
1528 Gtkmm2ext::TearOff* mouse_mode_tearoff;
1529 Gtk::ToggleButton mouse_select_button;
1530 Gtk::ToggleButton mouse_move_button;
1531 Gtk::ToggleButton mouse_gain_button;
1532 Gtk::ToggleButton mouse_zoom_button;
1533 Gtk::ToggleButton mouse_timefx_button;
1534 Gtk::ToggleButton mouse_audition_button;
1536 void mouse_mode_toggled (Editing::MouseMode m);
1537 bool ignore_mouse_mode_toggle;
1539 Gtk::ToggleButton internal_edit_button;
1540 void toggle_internal_editing ();
1542 gint mouse_select_button_release (GdkEventButton*);
1544 Gtk::VBox automation_box;
1545 Gtk::Button automation_mode_button;
1546 Gtk::ToggleButton global_automation_button;
1548 Gtk::ComboBoxText edit_mode_selector;
1549 Gtk::VBox edit_mode_box;
1551 void set_edit_mode (ARDOUR::EditMode);
1552 void cycle_edit_mode ();
1553 void edit_mode_selection_done ();
1555 Gtk::ComboBoxText snap_type_selector;
1556 Gtk::ComboBoxText snap_mode_selector;
1559 std::vector<std::string> snap_type_strings;
1560 std::vector<std::string> snap_mode_strings;
1562 void snap_type_selection_done ();
1563 void snap_mode_selection_done ();
1564 void snap_mode_chosen (Editing::SnapMode);
1565 void snap_type_chosen (Editing::SnapType);
1567 Glib::RefPtr<Gtk::RadioAction> snap_type_action (Editing::SnapType);
1568 Glib::RefPtr<Gtk::RadioAction> snap_mode_action (Editing::SnapMode);
1570 Gtk::ComboBoxText zoom_focus_selector;
1571 Gtk::VBox zoom_focus_box;
1573 std::vector<std::string> zoom_focus_strings;
1575 void zoom_focus_selection_done ();
1576 void zoom_focus_chosen (Editing::ZoomFocus);
1578 Glib::RefPtr<Gtk::RadioAction> zoom_focus_action (Editing::ZoomFocus);
1581 Gtk::HBox track_zoom_box;
1582 Gtk::VBox zoom_vbox;
1584 void zoom_adjustment_changed();
1586 void edit_point_clock_changed();
1588 void setup_toolbar ();
1590 Gtkmm2ext::TearOff* tools_tearoff;
1591 Gtk::HBox toolbar_hbox;
1592 Gtk::EventBox toolbar_base;
1593 Gtk::Frame toolbar_frame;
1597 Gtk::HBox panic_box;
1598 Gtk::Button midi_panic_button;
1599 Gtk::ToggleButton midi_sound_notes;
1600 void midi_panic_button_pressed ();
1601 bool sound_notes () const { return midi_sound_notes.get_active(); }
1603 void setup_midi_toolbar ();
1605 /* selection process */
1607 Selection* selection;
1608 Selection* cut_buffer;
1610 void time_selection_changed ();
1611 void track_selection_changed ();
1612 void region_selection_changed ();
1613 sigc::connection editor_regions_selection_changed_connection;
1614 void sensitize_the_right_region_actions (bool have_selected_regions);
1615 void point_selection_changed ();
1616 void marker_selection_changed ();
1618 void cancel_selection ();
1620 void region_selection_op (void (ARDOUR::Region::*pmf)(void));
1621 void region_selection_op (void (ARDOUR::Region::*pmf)(void*), void*);
1622 void region_selection_op (void (ARDOUR::Region::*pmf)(bool), bool);
1624 bool audio_region_selection_covers (nframes64_t where);
1626 /* transport range select process */
1628 ArdourCanvas::SimpleRect* cd_marker_bar_drag_rect;
1629 ArdourCanvas::SimpleRect* range_bar_drag_rect;
1630 ArdourCanvas::SimpleRect* transport_bar_drag_rect;
1633 ArdourCanvas::SimpleRect *bogus_background_rect;
1635 ArdourCanvas::SimpleRect *transport_bar_range_rect;
1636 ArdourCanvas::SimpleRect *transport_bar_preroll_rect;
1637 ArdourCanvas::SimpleRect *transport_bar_postroll_rect;
1638 ArdourCanvas::SimpleRect *transport_loop_range_rect;
1639 ArdourCanvas::SimpleRect *transport_punch_range_rect;
1640 ArdourCanvas::SimpleLine *transport_punchin_line;
1641 ArdourCanvas::SimpleLine *transport_punchout_line;
1642 ArdourCanvas::SimpleRect *transport_preroll_rect;
1643 ArdourCanvas::SimpleRect *transport_postroll_rect;
1645 ARDOUR::Location* transport_loop_location();
1646 ARDOUR::Location* transport_punch_location();
1648 ARDOUR::Location *temp_location;
1650 /* object rubberband select process */
1652 bool select_all_within (nframes64_t start, nframes64_t end, gdouble topy, gdouble boty, const TrackViewList&, Selection::Operation op);
1654 ArdourCanvas::SimpleRect *rubberband_rect;
1656 /* mouse zoom process */
1658 ArdourCanvas::SimpleRect *zoom_rect;
1659 void reposition_zoom_rect (nframes64_t start, nframes64_t end);
1661 EditorRouteGroups* _route_groups;
1662 EditorRoutes* _routes;
1663 EditorRegions* _regions;
1664 EditorSnapshots* _snapshots;
1666 /* diskstream/route display management */
1667 Glib::RefPtr<Gdk::Pixbuf> rec_enabled_icon;
1668 Glib::RefPtr<Gdk::Pixbuf> rec_disabled_icon;
1670 Glib::RefPtr<Gtk::TreeSelection> route_display_selection;
1672 bool sync_track_view_list_and_routes ();
1674 Gtk::VBox list_vpacker;
1678 bool autoscroll_active;
1679 int autoscroll_timeout_tag;
1682 int last_autoscroll_x;
1683 int last_autoscroll_y;
1684 uint32_t autoscroll_cnt;
1685 nframes64_t autoscroll_x_distance;
1686 double autoscroll_y_distance;
1688 static gint _autoscroll_canvas (void *);
1689 bool autoscroll_canvas ();
1690 void start_canvas_autoscroll (int x, int y);
1691 void stop_canvas_autoscroll ();
1692 void maybe_autoscroll (GdkEventMotion*, bool);
1693 bool allow_vertical_scroll;
1696 void point_trim (GdkEvent*);
1697 void single_contents_trim (RegionView&, nframes64_t, bool, bool, bool);
1698 void single_start_trim (RegionView&, nframes64_t, bool, bool, bool);
1699 void single_end_trim (RegionView&, nframes64_t, bool, bool, bool);
1701 void thaw_region_after_trim (RegionView& rv);
1703 void trim_region_front();
1704 void trim_region_back();
1705 void trim_region (bool front);
1707 void trim_region_to_edit_point ();
1708 void trim_region_from_edit_point ();
1709 void trim_region_to_loop ();
1710 void trim_region_to_punch ();
1711 void trim_region_to_location (const ARDOUR::Location&, const char* cmd);
1713 void trim_to_region(bool forward);
1714 void trim_region_to_previous_region_end();
1715 void trim_region_to_next_region_start();
1717 bool show_gain_after_trim;
1721 int convert_drop_to_paths (
1722 std::vector<Glib::ustring>& paths,
1723 const Glib::RefPtr<Gdk::DragContext>& context,
1726 const Gtk::SelectionData& data,
1730 void track_canvas_drag_data_received (
1731 const Glib::RefPtr<Gdk::DragContext>& context,
1734 const Gtk::SelectionData& data,
1739 const Glib::RefPtr<Gdk::DragContext>& context,
1742 const Gtk::SelectionData& data,
1747 const Glib::RefPtr<Gdk::DragContext>& context,
1750 const Gtk::SelectionData& data,
1755 const Glib::RefPtr<Gdk::DragContext>& context,
1758 const Gtk::SelectionData& data,
1764 int write_region_selection(RegionSelection&);
1765 bool write_region (std::string path, boost::shared_ptr<ARDOUR::AudioRegion>);
1766 void bounce_region_selection ();
1767 void bounce_range_selection (bool replace, bool enable_processing);
1768 void external_edit_region ();
1770 int write_audio_selection (TimeSelection&);
1771 bool write_audio_range (ARDOUR::AudioPlaylist&, const ARDOUR::ChanCount& channels, std::list<ARDOUR::AudioRange>&);
1773 void write_selection ();
1775 XMLNode *before; /* used in *_reversible_command */
1777 void begin_reversible_command (std::string cmd_name);
1778 void commit_reversible_command ();
1780 void update_title ();
1781 void update_title_s (const std::string & snapshot_name);
1784 Selection* selection;
1785 double frames_per_unit;
1787 State (PublicEditor const * e);
1791 void store_state (State&) const;
1792 void restore_state (State *);
1794 void instant_save ();
1796 boost::shared_ptr<ARDOUR::AudioRegion> last_audition_region;
1798 /* freeze operations */
1800 ARDOUR::InterThreadInfo freeze_status;
1801 gint freeze_progress_timeout (void *);
1802 static void* _freeze_thread (void*);
1803 void* freeze_thread ();
1805 void freeze_route ();
1806 void unfreeze_route ();
1808 /* route-group solo + mute */
1810 void set_route_group_solo (ARDOUR::Route&, bool);
1811 void set_route_group_mute (ARDOUR::Route&, bool);
1815 void duplicate_dialog (bool with_dialog);
1817 nframes64_t event_frame (GdkEvent const *, double* px = 0, double* py = 0) const;
1819 /* returns false if mouse pointer is not in track or marker canvas
1821 bool mouse_frame (nframes64_t&, bool& in_track_canvas) const;
1823 /* "whats mine is yours" */
1825 TimeFXDialog* current_timefx;
1827 static void* timefx_thread (void *arg);
1828 void do_timefx (TimeFXDialog&);
1830 int time_stretch (RegionSelection&, float fraction);
1831 int pitch_shift (RegionSelection&, float cents);
1832 void pitch_shift_regions ();
1833 int time_fx (RegionSelection&, float val, bool pitching);
1835 /* editor-mixer strip */
1837 MixerStrip *current_mixer_strip;
1838 bool show_editor_mixer_when_tracks_arrive;
1839 Gtk::VBox current_mixer_strip_vbox;
1840 void cms_new (boost::shared_ptr<ARDOUR::Route>);
1841 void cms_deleted ();
1842 void current_mixer_strip_hidden ();
1843 void current_mixer_strip_removed ();
1845 void detach_tearoff (Gtk::Box* b, Gtk::Window* w);
1846 void reattach_tearoff (Gtk::Box* b, Gtk::Window* w, int32_t n);
1848 void ensure_all_elements_drawn ();
1850 /* nudging tracks */
1852 void nudge_track (bool use_edit_point, bool forwards);
1856 bool _xfade_visibility;
1859 void handle_new_imageframe_time_axis_view(const std::string & track_name, void* src) ;
1860 void handle_new_imageframe_marker_time_axis_view(const std::string & track_name, TimeAxisView* marked_track) ;
1862 void start_imageframe_grab(ArdourCanvas::Item*, GdkEvent*) ;
1863 void start_markerview_grab(ArdourCanvas::Item*, GdkEvent*) ;
1865 void imageframe_drag_motion_callback(ArdourCanvas::Item*, GdkEvent*) ;
1866 void markerview_drag_motion_callback(ArdourCanvas::Item*, GdkEvent*) ;
1867 void timeaxis_item_drag_finished_callback(ArdourCanvas::Item*, GdkEvent*) ;
1869 gint canvas_imageframe_item_view_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameView* ifv);
1870 gint canvas_imageframe_view_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameTimeAxis* ifta);
1871 gint canvas_imageframe_start_handle_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameView* ifv);
1872 gint canvas_imageframe_end_handle_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameView* ifv);
1874 gint canvas_marker_time_axis_view_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerTimeAxis* mta);
1875 gint canvas_markerview_item_view_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerView* mv);
1876 gint canvas_markerview_start_handle_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerView* mv);
1877 gint canvas_markerview_end_handle_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerView* mv);
1879 void imageframe_start_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1880 void imageframe_end_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1881 void imageframe_start_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1882 void imageframe_start_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1883 void imageframe_end_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1884 void imageframe_end_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1886 void markerview_item_start_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1887 void markerview_item_end_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1888 void markerview_start_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1889 void markerview_start_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1890 void markerview_end_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1891 void markerview_end_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1893 void popup_imageframe_edit_menu(int button, int32_t time, ArdourCanvas::Item* ifv, bool with_frame) ;
1894 void popup_marker_time_axis_edit_menu(int button, int32_t time, ArdourCanvas::Item* ifv, bool with_frame) ;
1896 ImageFrameSocketHandler* image_socket_listener ;
1899 void toggle_xfade_active (boost::weak_ptr<ARDOUR::Crossfade>);
1900 void toggle_xfade_length (boost::weak_ptr<ARDOUR::Crossfade>);
1901 void edit_xfade (boost::weak_ptr<ARDOUR::Crossfade>);
1902 void xfade_edit_left_region ();
1903 void xfade_edit_right_region ();
1905 static const int32_t default_width = 995;
1906 static const int32_t default_height = 765;
1910 Gtk::Button nudge_forward_button;
1911 Gtk::Button nudge_backward_button;
1912 Gtk::HBox nudge_hbox;
1913 Gtk::VBox nudge_vbox;
1914 AudioClock nudge_clock;
1916 bool nudge_forward_release (GdkEventButton*);
1917 bool nudge_backward_release (GdkEventButton*);
1921 void apply_filter (ARDOUR::Filter&, std::string cmd);
1923 Command* apply_midi_note_edit_op_to_region (ARDOUR::MidiOperator& op, MidiRegionView& mrv);
1924 void apply_midi_note_edit_op (ARDOUR::MidiOperator& op);
1926 /* handling cleanup */
1928 int playlist_deletion_dialog (boost::shared_ptr<ARDOUR::Playlist>);
1930 std::vector<sigc::connection> session_connections;
1932 /* tracking step changes of track height */
1934 TimeAxisView* current_stepping_trackview;
1935 ARDOUR::microseconds_t last_track_height_step_timestamp;
1936 gint track_height_step_timeout();
1937 sigc::connection step_timeout;
1939 TimeAxisView* entered_track;
1940 RegionView* entered_regionview;
1943 void ensure_entered_track_selected (bool op_acts_on_objects = false);
1944 bool clear_entered_track;
1945 bool left_track_canvas (GdkEventCrossing*);
1946 bool entered_track_canvas (GdkEventCrossing*);
1947 void set_entered_track (TimeAxisView*);
1948 void set_entered_regionview (RegionView*);
1949 void ensure_track_visible (TimeAxisView*);
1950 gint left_automation_track ();
1952 bool _new_regionviews_show_envelope;
1954 void reset_canvas_action_sensitivity (bool);
1955 void toggle_gain_envelope_visibility ();
1956 void toggle_gain_envelope_active ();
1957 void reset_region_gain_envelopes ();
1959 bool on_key_press_event (GdkEventKey*);
1960 bool on_key_release_event (GdkEventKey*);
1962 void session_state_saved (std::string);
1964 Glib::RefPtr<Gtk::Action> undo_action;
1965 Glib::RefPtr<Gtk::Action> redo_action;
1967 void history_changed ();
1969 Gtk::HBox status_bar_hpacker;
1971 Editing::EditPoint _edit_point;
1973 Gtk::ComboBoxText edit_point_selector;
1975 void set_edit_point_preference (Editing::EditPoint ep, bool force = false);
1976 void cycle_edit_point (bool with_marker);
1977 void set_edit_point ();
1978 void edit_point_selection_done ();
1979 void edit_point_chosen (Editing::EditPoint);
1980 Glib::RefPtr<Gtk::RadioAction> edit_point_action (Editing::EditPoint);
1981 std::vector<std::string> edit_point_strings;
1983 void selected_marker_moved (ARDOUR::Location*);
1984 sigc::connection edit_point_clock_connection_a;
1985 sigc::connection edit_point_clock_connection_b;
1987 bool get_edit_op_range (nframes64_t& start, nframes64_t& end) const;
1989 void get_regions_at (RegionSelection&, nframes64_t where, const TrackSelection& ts) const;
1990 void get_regions_after (RegionSelection&, nframes64_t where, const TrackSelection& ts) const;
1992 void get_regions_for_action (RegionSelection&, bool allow_entered = false, bool allow_edit_position = true);
1994 sigc::connection fast_screen_update_connection;
1995 gint start_updating ();
1996 gint stop_updating ();
1997 void fast_update_strips ();
1998 bool meters_running;
2000 void select_next_route ();
2001 void select_prev_route ();
2003 void snap_to_internal (nframes64_t& first, int32_t direction = 0, bool for_mark = false);
2005 RhythmFerret* rhythm_ferret;
2006 BundleManager* _bundle_manager;
2007 GlobalPortMatrixWindow* _global_port_matrix[ARDOUR::DataType::num_types];
2009 void fit_tracks (TrackSelection &);
2010 void fit_selected_tracks ();
2011 void set_track_height (uint32_t h);
2013 void remove_tracks ();
2014 void toggle_tracks_active ();
2019 friend gboolean _idle_resize (gpointer);
2020 int32_t _pending_resize_amount;
2021 TimeAxisView* _pending_resize_view;
2023 void visible_order_range (int*, int*) const;
2026 bool _pending_locate_request;
2028 EditorSummary* _summary;
2029 void region_view_added (RegionView *);
2031 void update_canvas_now ();
2032 void streamview_height_changed ();
2034 EditorGroupTabs* _group_tabs;
2035 void fit_route_group (ARDOUR::RouteGroup *);
2037 void start_step_editing ();
2038 void stop_step_editing ();
2039 bool check_step_edit ();
2040 sigc::connection step_edit_connection;
2043 friend class RegionDrag;
2044 friend class RegionMoveDrag;
2045 friend class RegionSpliceDrag;
2046 friend class TrimDrag;
2047 friend class MeterMarkerDrag;
2048 friend class TempoMarkerDrag;
2049 friend class CursorDrag;
2050 friend class FadeInDrag;
2051 friend class FadeOutDrag;
2052 friend class MarkerDrag;
2053 friend class RegionGainDrag;
2054 friend class ControlPointDrag;
2055 friend class LineDrag;
2056 friend class RubberbandSelectDrag;
2057 friend class TimeFXDrag;
2058 friend class ScrubDrag;
2059 friend class SelectionDrag;
2060 friend class RangeMarkerBarDrag;
2061 friend class MouseZoomDrag;
2062 friend class RegionCreateDrag;
2063 friend class RegionMotionDrag;
2064 friend class RegionInsertDrag;
2066 friend class EditorSummary;
2067 friend class EditorGroupTabs;
2069 friend class EditorRoutes;
2072 #endif /* __ardour_editor_h__ */