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/import_status.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 "canvas-noevent-text.h"
65 #include "region_selection.h"
67 #include "editor_summary.h"
74 class AudioDiskstream;
96 class AudioRegionView;
97 class AudioStreamView;
98 class AudioTimeAxisView;
100 class AutomationSelection;
101 class AutomationTimeAxisView;
106 class GlobalPortMatrixWindow;
107 class GroupedButtons;
109 class MidiRegionView;
111 class PlaylistSelector;
112 class PluginSelector;
115 class SoundFileOmega;
121 class TrackSelection;
122 class EditorGroupTabs;
124 class EditorRouteGroups;
126 class EditorLocations;
127 class EditorSnapshots;
129 /* <CMT Additions> */
130 class ImageFrameView;
131 class ImageFrameTimeAxisView;
132 class ImageFrameTimeAxis;
133 class MarkerTimeAxis ;
135 class ImageFrameSocketHandler ;
136 class TimeAxisViewItem ;
137 /* </CMT Additions> */
139 struct EditorCursor {
141 ArdourCanvas::Points points;
142 ArdourCanvas::Line canvas_item;
143 nframes64_t current_frame;
146 EditorCursor (Editor&, bool (Editor::*)(GdkEvent*,ArdourCanvas::Item*));
149 void set_position (nframes64_t);
150 void set_length (double units);
151 void set_y_axis (double position);
153 sigc::signal<void, nframes64_t> PositionChanged;
156 class Editor : public PublicEditor
162 void connect_to_session (ARDOUR::Session *);
163 ARDOUR::Session* current_session() const { return session; }
165 virtual bool have_idled () const { return _have_idled; }
167 nframes64_t leftmost_position() const { return leftmost_frame; }
169 nframes64_t current_page_frames() const {
170 return (nframes64_t) floor (_canvas_width * frames_per_unit);
173 double canvas_height () const {
174 return _canvas_height;
177 void cycle_snap_mode ();
178 void cycle_snap_choice ();
179 void set_snap_to (Editing::SnapType);
180 void set_snap_mode (Editing::SnapMode);
181 void set_snap_threshold (double pixel_distance) {snap_threshold = pixel_distance;}
183 Editing::SnapMode snap_mode () const;
184 Editing::SnapType snap_type () const;
186 void undo (uint32_t n = 1);
187 void redo (uint32_t n = 1);
189 XMLNode& get_state ();
190 int set_state (const XMLNode&, int version);
192 void set_mouse_mode (Editing::MouseMode, bool force=true);
193 void step_mouse_mode (bool next);
194 Editing::MouseMode current_mouse_mode () const { return mouse_mode; }
195 Editing::MidiEditMode current_midi_edit_mode () const;
197 bool internal_editing() const { return _internal_editing ; }
198 void set_internal_edit (bool yn);
201 void add_imageframe_time_axis(const std::string & track_name, void*) ;
202 void add_imageframe_marker_time_axis(const std::string & track_name, TimeAxisView* marked_track, void*) ;
203 void connect_to_image_compositor() ;
204 void scroll_timeaxis_to_imageframe_item(const TimeAxisViewItem* item) ;
205 TimeAxisView* get_named_time_axis(const std::string & name) ;
206 #endif /* WITH_CMT */
208 void foreach_time_axis_view (sigc::slot<void,TimeAxisView&>);
209 void add_to_idle_resize (TimeAxisView*, int32_t);
211 RouteTimeAxisView* get_route_view_by_id (PBD::ID& id);
213 void consider_auditioning (boost::shared_ptr<ARDOUR::Region>);
214 void hide_a_region (boost::shared_ptr<ARDOUR::Region>);
215 void remove_a_region (boost::shared_ptr<ARDOUR::Region>);
217 #ifdef USE_RUBBERBAND
218 std::vector<std::string> rb_opt_strings;
221 /* option editor-access */
223 void set_show_waveforms_recording (bool yn);
224 bool show_waveforms_recording() const { return _show_waveforms_recording; }
226 /* things that need to be public to be used in the main menubar */
228 void new_region_from_selection ();
229 void separate_regions_between (const TimeSelection&);
230 void separate_region_from_selection ();
231 void separate_region_from_punch ();
232 void separate_region_from_loop ();
233 void separate_regions_using_location (ARDOUR::Location&);
234 void transition_to_rolling (bool forward);
238 nframes64_t unit_to_frame (double unit) const {
239 return (nframes64_t) rint (unit * frames_per_unit);
242 double frame_to_unit (nframes64_t frame) const {
243 return rint ((double) frame / (double) frames_per_unit);
246 double frame_to_unit (double frame) const {
247 return rint (frame / frames_per_unit);
250 /* NOTE: these functions assume that the "pixel" coordinate is
251 the result of using the world->canvas affine transform on a
252 world coordinate. These coordinates already take into
253 account any scrolling carried out by adjusting the
257 nframes64_t pixel_to_frame (double pixel) const {
259 /* pixel can be less than zero when motion events
260 are processed. since we've already run the world->canvas
261 affine, that means that the location *really* is "off
262 to the right" and thus really is "before the start".
266 return (nframes64_t) rint (pixel * frames_per_unit * GNOME_CANVAS(track_canvas->gobj())->pixels_per_unit);
272 gulong frame_to_pixel (nframes64_t frame) const {
273 return (gulong) rint ((frame / (frames_per_unit * GNOME_CANVAS(track_canvas->gobj())->pixels_per_unit)));
276 void flush_canvas ();
280 Selection& get_selection() const { return *selection; }
281 Selection& get_cut_buffer() const { return *cut_buffer; }
283 bool extend_selection_to_track (TimeAxisView&);
285 void play_selection ();
286 void select_all_in_track (Selection::Operation op);
287 void select_all (Selection::Operation op);
288 void invert_selection_in_track ();
289 void invert_selection ();
290 void deselect_all ();
292 void set_selected_regionview_from_region_list (boost::shared_ptr<ARDOUR::Region> region, Selection::Operation op = Selection::Set);
296 void set_show_measures (bool yn);
297 bool show_measures () const { return _show_measures; }
299 /* analysis window */
301 void analyze_region_selection();
302 void analyze_range_selection();
306 void export_audio ();
307 void export_selection ();
308 void export_range ();
309 void export_region ();
311 void add_toplevel_controls (Gtk::Container&);
312 Gtk::HBox& get_status_bar_packer() { return status_bar_hpacker; }
314 void set_zoom_focus (Editing::ZoomFocus);
315 Editing::ZoomFocus get_zoom_focus () const { return zoom_focus; }
316 double get_current_zoom () const { return frames_per_unit; }
318 void temporal_zoom_step (bool coarser);
319 void tav_zoom_step (bool coarser);
321 /* stuff that AudioTimeAxisView and related classes use */
323 PlaylistSelector& playlist_selector() const;
324 void clear_playlist (boost::shared_ptr<ARDOUR::Playlist>);
326 void new_playlists (TimeAxisView* v);
327 void copy_playlists (TimeAxisView* v);
328 void clear_playlists (TimeAxisView* v);
330 TrackViewList* get_valid_views (TimeAxisView*, ARDOUR::RouteGroup* grp = 0);
331 void get_onscreen_tracks (TrackViewList&);
333 Width editor_mixer_strip_width;
334 void maybe_add_mixer_strip_width (XMLNode&);
335 void show_editor_mixer (bool yn);
336 void create_editor_mixer ();
337 void show_editor_list (bool yn);
338 void set_selected_mixer_strip (TimeAxisView&);
339 void hide_track_in_display (TimeAxisView& tv, bool temporary = false);
341 /* nudge is initiated by transport controls owned by ARDOUR_UI */
343 nframes64_t get_nudge_distance (nframes64_t pos, nframes64_t& next);
344 Evoral::MusicalTime get_grid_type_as_beats (bool& success, nframes64_t position);
346 void nudge_forward (bool next, bool force_playhead);
347 void nudge_backward (bool next, bool force_playhead);
349 /* nudge initiated from context menu */
351 void nudge_forward_capture_offset ();
352 void nudge_backward_capture_offset ();
354 /* playhead/screen stuff */
356 void set_follow_playhead (bool yn);
357 void toggle_follow_playhead ();
358 bool follow_playhead() const { return _follow_playhead; }
359 bool dragging_playhead () const { return _dragging_playhead; }
361 void toggle_zero_line_visibility ();
362 void toggle_waveforms_while_recording ();
364 void set_group_tabs ();
365 void toggle_measure_visibility ();
366 void toggle_logo_visibility ();
368 double get_physical_screen_width () const { return physical_screen_width; };
369 double physical_screen_width;
370 double physical_screen_height;
374 void toggle_selected_region_fades (int dir);
375 void update_region_fade_visibility ();
376 bool xfade_visibility() const { return _xfade_visibility; }
377 void update_xfade_visibility ();
379 /* redirect shared ops menu. caller must free returned menu */
381 Gtk::Menu* redirect_menu ();
383 /* floating windows/transient */
385 void ensure_float (Gtk::Window&);
389 void scroll_tracks_down_line ();
390 void scroll_tracks_up_line ();
392 bool new_regionviews_display_gain () { return _new_regionviews_show_envelope; }
393 void prepare_for_cleanup ();
394 void finish_cleanup ();
396 void maximise_editing_space();
397 void restore_editing_space();
399 void reset_x_origin (nframes64_t);
400 void reset_y_origin (double);
401 void reset_zoom (double);
402 void reposition_and_zoom (nframes64_t, double);
404 nframes64_t get_preferred_edit_position (bool ignore_playhead = false);
406 bool update_mouse_speed ();
407 bool decelerate_mouse_speed ();
409 void toggle_meter_updating();
411 void show_rhythm_ferret();
412 void show_bundle_manager ();
413 void show_global_port_matrix (ARDOUR::DataType);
415 void goto_visual_state (uint32_t);
416 void save_visual_state (uint32_t);
418 TrackViewList const & get_track_views () {
422 int get_regionview_count_from_region_list (boost::shared_ptr<ARDOUR::Region>);
424 void do_import (std::vector<Glib::ustring> paths, Editing::ImportDisposition, Editing::ImportMode mode, ARDOUR::SrcQuality, nframes64_t&);
425 void do_embed (std::vector<Glib::ustring> paths, Editing::ImportDisposition, Editing::ImportMode mode, nframes64_t&);
427 void get_regions_corresponding_to (boost::shared_ptr<ARDOUR::Region> region, std::vector<RegionView*>& regions);
429 void show_verbose_canvas_cursor_with (const std::string& txt);
430 void hide_verbose_canvas_cursor();
433 void map_transport_state ();
434 void map_position_change (nframes64_t);
440 void color_handler ();
442 ARDOUR::Session *session; ///< The session that we are editing, or 0
445 // to keep track of the playhead position for control_scroll
446 boost::optional<nframes64_t> _control_scroll_target;
448 PlaylistSelector* _playlist_selector;
450 typedef std::pair<TimeAxisView*,XMLNode*> TAVState;
454 double frames_per_unit;
455 nframes64_t leftmost_frame;
456 Editing::ZoomFocus zoom_focus;
457 std::list<TAVState> track_states;
460 std::list<VisualState*> undo_visual_stack;
461 std::list<VisualState*> redo_visual_stack;
462 VisualState* current_visual_state (bool with_tracks = true);
463 void undo_visual_state ();
464 void redo_visual_state ();
465 void use_visual_state (VisualState&);
467 void swap_visual_state ();
469 std::vector<VisualState*> visual_states;
470 sigc::connection visual_state_op_connection;
471 void start_visual_state_op (uint32_t n);
472 void cancel_visual_state_op (uint32_t n);
473 bool end_visual_state_op (uint32_t n);
475 nframes64_t leftmost_frame;
476 double frames_per_unit;
477 Editing::ZoomFocus zoom_focus;
479 void set_frames_per_unit (double);
482 Editing::MouseMode mouse_mode;
483 bool _internal_editing;
485 int post_maximal_editor_width;
486 int post_maximal_pane_position;
487 int pre_maximal_pane_position;
488 int pre_maximal_editor_width;
489 void pane_allocation_handler (Gtk::Allocation&, Gtk::Paned*);
491 Gtk::Notebook the_notebook;
492 Gtk::HPaned edit_pane;
494 Gtk::EventBox meter_base;
496 Gtk::EventBox marker_base;
497 Gtk::HBox marker_box;
498 Gtk::VBox scrollers_rulers_markers_box;
500 void location_changed (ARDOUR::Location *);
501 void location_flags_changed (ARDOUR::Location *, void *);
502 void refresh_location_display ();
503 void refresh_location_display_s (ARDOUR::Change);
504 void refresh_location_display_internal (ARDOUR::Locations::LocationList&);
505 void add_new_location (ARDOUR::Location *);
506 void location_gone (ARDOUR::Location *);
507 void remove_marker (ArdourCanvas::Item&, GdkEvent*);
508 gint really_remove_marker (ARDOUR::Location* loc);
509 void goto_nth_marker (int nth);
511 uint32_t location_marker_color;
512 uint32_t location_range_color;
513 uint32_t location_loop_color;
514 uint32_t location_punch_color;
515 uint32_t location_cd_marker_color;
517 struct LocationMarkers {
522 LocationMarkers () : start(0), end(0), valid (true) {}
528 void set_name (const std::string&);
529 void set_position (nframes64_t start, nframes64_t end = 0);
530 void set_color_rgba (uint32_t);
533 LocationMarkers *find_location_markers (ARDOUR::Location *) const;
534 ARDOUR::Location* find_location_from_marker (Marker *, bool& is_start) const;
535 Marker* entered_marker;
537 typedef std::map<ARDOUR::Location*,LocationMarkers *> LocationMarkerMap;
538 LocationMarkerMap location_markers;
540 void hide_marker (ArdourCanvas::Item*, GdkEvent*);
541 void clear_marker_display ();
542 void mouse_add_new_marker (nframes64_t where, bool is_cd=false, bool is_xrun=false);
543 bool choose_new_marker_name(std::string &name);
544 void update_cd_marker_display ();
545 void ensure_cd_marker_updated (LocationMarkers * lam, ARDOUR::Location * location);
547 TimeAxisView* clicked_axisview;
548 RouteTimeAxisView* clicked_routeview;
549 /** The last RegionView that was clicked on, or 0 if the last click was not
550 * on a RegionView. This is set up by the canvas event handlers in
551 * editor_canvas_events.cc
553 RegionView* clicked_regionview;
554 RegionSelection latest_regionviews;
555 uint32_t clicked_selection;
556 CrossfadeView* clicked_crossfadeview;
557 ControlPoint* clicked_control_point;
559 void sort_track_selection (TrackSelection* sel = 0);
561 void get_relevant_tracks (std::set<RouteTimeAxisView*>& relevant_tracks) const;
562 void get_equivalent_tracks (RouteTimeAxisView*, std::set<RouteTimeAxisView*> &, ARDOUR::RouteGroup::Property) const;
563 void get_equivalent_regions (RegionView* rv, std::vector<RegionView*> &, ARDOUR::RouteGroup::Property) const;
564 RegionSelection get_equivalent_regions (RegionSelection &, ARDOUR::RouteGroup::Property) const;
565 void mapover_tracks (sigc::slot<void,RouteTimeAxisView&,uint32_t> sl, TimeAxisView*, ARDOUR::RouteGroup::Property) const;
567 /* functions to be passed to mapover_tracks(), possibly with sigc::bind()-supplied arguments */
569 void mapped_get_equivalent_regions (RouteTimeAxisView&, uint32_t, RegionView *, std::vector<RegionView*>*) const;
570 void mapped_use_new_playlist (RouteTimeAxisView&, uint32_t, std::vector<boost::shared_ptr<ARDOUR::Playlist> > const &);
571 void mapped_use_copy_playlist (RouteTimeAxisView&, uint32_t, std::vector<boost::shared_ptr<ARDOUR::Playlist> > const &);
572 void mapped_clear_playlist (RouteTimeAxisView&, uint32_t);
576 void button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type);
577 bool button_release_can_deselect;
579 void catch_vanishing_regionview (RegionView *);
581 void set_selected_track (TimeAxisView&, Selection::Operation op = Selection::Set, bool no_remove=false);
582 void select_all_tracks ();
584 bool set_selected_control_point_from_click (Selection::Operation op = Selection::Set, bool no_remove=false);
585 void set_selected_track_from_click (bool press, Selection::Operation op = Selection::Set, bool no_remove=false);
586 void set_selected_track_as_side_effect (bool force = false);
587 bool set_selected_regionview_from_click (bool press, Selection::Operation op = Selection::Set, bool no_track_remove=false);
589 bool set_selected_regionview_from_map_event (GdkEventAny*, StreamView*, boost::weak_ptr<ARDOUR::Region>);
590 void collect_new_region_view (RegionView *);
591 void collect_and_select_new_region_view (RegionView *);
593 Gtk::Menu track_context_menu;
594 Gtk::Menu track_region_context_menu;
595 Gtk::Menu track_selection_context_menu;
596 Gtk::Menu track_crossfade_context_menu;
598 Gtk::MenuItem* region_edit_menu_split_item;
599 Gtk::MenuItem* region_edit_menu_split_multichannel_item;
600 Gtk::Menu * track_region_edit_playlist_menu;
601 Gtk::Menu * track_edit_playlist_submenu;
602 Gtk::Menu * track_selection_edit_playlist_submenu;
604 void popup_track_context_menu (int, int, ItemType, bool, nframes64_t);
605 Gtk::Menu* build_track_context_menu (nframes64_t);
606 Gtk::Menu* build_track_bus_context_menu (nframes64_t);
607 Gtk::Menu* build_track_region_context_menu (nframes64_t frame);
608 Gtk::Menu* build_track_crossfade_context_menu (nframes64_t);
609 Gtk::Menu* build_track_selection_context_menu (nframes64_t);
610 void add_dstream_context_items (Gtk::Menu_Helpers::MenuList&);
611 void add_bus_context_items (Gtk::Menu_Helpers::MenuList&);
612 void add_region_context_items (StreamView*, boost::shared_ptr<ARDOUR::Region>, Gtk::Menu_Helpers::MenuList&);
613 void add_crossfade_context_items (AudioStreamView*, boost::shared_ptr<ARDOUR::Crossfade>, Gtk::Menu_Helpers::MenuList&, bool many);
614 void add_selection_context_items (Gtk::Menu_Helpers::MenuList&);
616 void handle_new_route (ARDOUR::RouteList&);
617 void remove_route (TimeAxisView *);
620 Gtk::HBox global_hpacker;
621 Gtk::VBox global_vpacker;
624 Gdk::Cursor* current_canvas_cursor;
625 void set_canvas_cursor ();
626 Gdk::Cursor* which_grabber_cursor ();
628 ArdourCanvas::Canvas* track_canvas;
630 ArdourCanvas::NoEventText* verbose_canvas_cursor;
631 bool verbose_cursor_visible;
633 void parameter_changed (std::string);
635 bool track_canvas_motion (GdkEvent*);
637 void set_verbose_canvas_cursor (const std::string &, double x, double y);
638 void set_verbose_canvas_cursor_text (const std::string &);
639 void show_verbose_canvas_cursor();
641 bool verbose_cursor_on; // so far unused
643 Gtk::EventBox time_canvas_event_box;
644 Gtk::EventBox track_canvas_event_box;
645 Gtk::EventBox time_button_event_box;
646 Gtk::EventBox ruler_label_event_box;
648 ArdourCanvas::Group *minsec_group;
649 ArdourCanvas::Pixbuf *logo_item;
650 ArdourCanvas::Group *bbt_group;
651 ArdourCanvas::Group *timecode_group;
652 ArdourCanvas::Group *frame_group;
653 ArdourCanvas::Group *tempo_group;
654 ArdourCanvas::Group *meter_group;
655 ArdourCanvas::Group *marker_group;
656 ArdourCanvas::Group *range_marker_group;
657 ArdourCanvas::Group *transport_marker_group;
658 ArdourCanvas::Group* cd_marker_group;
660 ArdourCanvas::Group* timebar_group;
662 /* These bars never need to be scrolled */
663 ArdourCanvas::Group* meter_bar_group;
664 ArdourCanvas::Group* tempo_bar_group;
665 ArdourCanvas::Group* marker_bar_group;
666 ArdourCanvas::Group* range_marker_bar_group;
667 ArdourCanvas::Group* transport_marker_bar_group;
668 ArdourCanvas::Group* cd_marker_bar_group;
670 /** The group containing all items that require horizontal scrolling. */
671 ArdourCanvas::Group* _background_group;
673 The _master_group is the group containing all items
674 that require horizontal scrolling..
675 It is primarily used to separate canvas items
676 that require horizontal scrolling from those that do not.
678 ArdourCanvas::Group* _master_group;
680 /* The group containing all trackviews. Only scrolled vertically. */
681 ArdourCanvas::Group* _trackview_group;
683 /* The group used for region motion. Sits on top of _trackview_group */
684 ArdourCanvas::Group* _region_motion_group;
687 ruler_metric_timecode = 0,
688 ruler_metric_bbt = 1,
689 ruler_metric_frames = 2,
690 ruler_metric_minsec = 3,
692 ruler_time_tempo = 4,
693 ruler_time_meter = 5,
694 ruler_time_marker = 6,
695 ruler_time_range_marker = 7,
696 ruler_time_transport_marker = 8,
697 ruler_time_cd_marker = 9,
700 static GtkCustomMetric ruler_metrics[4];
701 Glib::RefPtr<Gtk::ToggleAction> ruler_timecode_action;
702 Glib::RefPtr<Gtk::ToggleAction> ruler_bbt_action;
703 Glib::RefPtr<Gtk::ToggleAction> ruler_samples_action;
704 Glib::RefPtr<Gtk::ToggleAction> ruler_minsec_action;
705 Glib::RefPtr<Gtk::ToggleAction> ruler_tempo_action;
706 Glib::RefPtr<Gtk::ToggleAction> ruler_meter_action;
707 Glib::RefPtr<Gtk::ToggleAction> ruler_marker_action;
708 Glib::RefPtr<Gtk::ToggleAction> ruler_range_action;
709 Glib::RefPtr<Gtk::ToggleAction> ruler_loop_punch_action;
710 Glib::RefPtr<Gtk::ToggleAction> ruler_cd_marker_action;
711 bool no_ruler_shown_update;
713 gint ruler_button_press (GdkEventButton*);
714 gint ruler_button_release (GdkEventButton*);
715 gint ruler_mouse_motion (GdkEventMotion*);
716 bool ruler_scroll (GdkEventScroll* event);
718 Gtk::Widget * ruler_grabbed_widget;
720 void initialize_rulers ();
721 void update_just_timecode ();
722 void compute_fixed_ruler_scale (); //calculates the RulerScale of the fixed rulers
723 void update_fixed_rulers ();
724 void update_tempo_based_rulers ();
725 void popup_ruler_menu (nframes64_t where = 0, ItemType type = RegionItem);
726 void update_ruler_visibility ();
727 void set_ruler_visible (RulerType, bool);
728 void toggle_ruler_visibility (RulerType rt);
729 void ruler_toggled (int);
730 gint ruler_label_button_release (GdkEventButton*);
731 void store_ruler_visibility ();
732 void restore_ruler_visibility ();
734 static gint _metric_get_timecode (GtkCustomRulerMark **, gdouble, gdouble, gint);
735 static gint _metric_get_bbt (GtkCustomRulerMark **, gdouble, gdouble, gint);
736 static gint _metric_get_frames (GtkCustomRulerMark **, gdouble, gdouble, gint);
737 static gint _metric_get_minsec (GtkCustomRulerMark **, gdouble, gdouble, gint);
739 enum MinsecRulerScale {
746 MinsecRulerScale minsec_ruler_scale;
748 nframes_t minsec_mark_interval;
749 gint minsec_mark_modulo;
751 void set_minsec_ruler_scale (gdouble lower, gdouble upper);
753 enum TimecodeRulerScale {
755 timecode_show_frames,
756 timecode_show_seconds,
757 timecode_show_minutes,
761 TimecodeRulerScale timecode_ruler_scale;
763 nframes_t timecode_mark_interval;
764 gint timecode_mark_modulo;
765 gint timecode_nmarks;
766 void set_timecode_ruler_scale (gdouble lower, gdouble upper);
776 bbt_show_ticks_detail,
777 bbt_show_ticks_super_detail
780 BBTRulerScale bbt_ruler_scale;
784 uint32_t bbt_bar_helper_on;
785 uint32_t bbt_accent_modulo;
786 void compute_bbt_ruler_scale (nframes64_t lower, nframes64_t upper);
788 gint metric_get_timecode (GtkCustomRulerMark **, gdouble, gdouble, gint);
789 gint metric_get_bbt (GtkCustomRulerMark **, gdouble, gdouble, gint);
790 gint metric_get_frames (GtkCustomRulerMark **, gdouble, gdouble, gint);
791 gint metric_get_minsec (GtkCustomRulerMark **, gdouble, gdouble, gint);
793 Gtk::Widget *_ruler_separator;
794 GtkWidget *_timecode_ruler;
795 GtkWidget *_bbt_ruler;
796 GtkWidget *_frames_ruler;
797 GtkWidget *_minsec_ruler;
798 Gtk::Widget *timecode_ruler;
799 Gtk::Widget *bbt_ruler;
800 Gtk::Widget *frames_ruler;
801 Gtk::Widget *minsec_ruler;
802 static Editor *ruler_editor;
804 static const double timebar_height;
805 guint32 visible_timebars;
806 gdouble canvas_timebars_vsize;
807 gdouble get_canvas_timebars_vsize () const { return canvas_timebars_vsize; }
808 Gtk::Menu *editor_ruler_menu;
810 ArdourCanvas::SimpleRect* tempo_bar;
811 ArdourCanvas::SimpleRect* meter_bar;
812 ArdourCanvas::SimpleRect* marker_bar;
813 ArdourCanvas::SimpleRect* range_marker_bar;
814 ArdourCanvas::SimpleRect* transport_marker_bar;
815 ArdourCanvas::SimpleRect* cd_marker_bar;
817 Gtk::Label minsec_label;
818 Gtk::Label bbt_label;
819 Gtk::Label timecode_label;
820 Gtk::Label frame_label;
821 Gtk::Label tempo_label;
822 Gtk::Label meter_label;
823 Gtk::Label mark_label;
824 Gtk::Label range_mark_label;
825 Gtk::Label transport_mark_label;
826 Gtk::Label cd_mark_label;
828 Gtk::VBox time_button_vbox;
829 Gtk::HBox time_button_hbox;
831 friend class EditorCursor;
833 EditorCursor* playhead_cursor;
834 ArdourCanvas::Group* cursor_group;
836 nframes64_t get_region_boundary (nframes64_t pos, int32_t dir, bool with_selection, bool only_onscreen);
838 void cursor_to_region_boundary (bool with_selection, int32_t dir);
839 void cursor_to_next_region_boundary (bool with_selection);
840 void cursor_to_previous_region_boundary (bool with_selection);
841 void cursor_to_next_region_point (EditorCursor*, ARDOUR::RegionPoint);
842 void cursor_to_previous_region_point (EditorCursor*, ARDOUR::RegionPoint);
843 void cursor_to_region_point (EditorCursor*, ARDOUR::RegionPoint, int32_t dir);
844 void cursor_to_selection_start (EditorCursor *);
845 void cursor_to_selection_end (EditorCursor *);
847 void selected_marker_to_region_boundary (bool with_selection, int32_t dir);
848 void selected_marker_to_next_region_boundary (bool with_selection);
849 void selected_marker_to_previous_region_boundary (bool with_selection);
850 void selected_marker_to_next_region_point (ARDOUR::RegionPoint);
851 void selected_marker_to_previous_region_point (ARDOUR::RegionPoint);
852 void selected_marker_to_region_point (ARDOUR::RegionPoint, int32_t dir);
853 void selected_marker_to_selection_start ();
854 void selected_marker_to_selection_end ();
856 void select_all_selectables_using_cursor (EditorCursor *, bool);
857 void select_all_selectables_using_edit (bool);
858 void select_all_selectables_between (bool within);
859 void select_range_between ();
861 boost::shared_ptr<ARDOUR::Region> find_next_region (nframes64_t, ARDOUR::RegionPoint, int32_t dir, TrackViewList&, TimeAxisView ** = 0);
862 nframes64_t find_next_region_boundary (nframes64_t, int32_t dir, const TrackViewList&);
864 std::vector<nframes64_t> region_boundary_cache;
865 void build_region_boundary_cache ();
868 Gtk::HBox bottom_hbox;
870 Gtk::Table edit_packer;
871 Gtk::VScrollbar edit_vscrollbar;
873 Gtk::Adjustment vertical_adjustment;
874 Gtk::Adjustment horizontal_adjustment;
876 Gtk::Layout controls_layout;
877 bool control_layout_scroll (GdkEventScroll* ev);
878 void controls_layout_size_request (Gtk::Requisition*);
879 sigc::connection controls_layout_size_request_connection;
881 Gtk::HScrollbar edit_hscrollbar;
882 bool _dragging_hscrollbar;
884 void reset_hscrollbar_stepping ();
886 bool hscrollbar_button_press (GdkEventButton*);
887 bool hscrollbar_button_release (GdkEventButton*);
888 void hscrollbar_allocate (Gtk::Allocation &alloc);
890 double _canvas_width;
891 double _canvas_height;
892 double full_canvas_height;
894 bool track_canvas_map_handler (GdkEventAny*);
896 gint edit_controls_button_release (GdkEventButton*);
897 Gtk::Menu *edit_controls_left_menu;
898 Gtk::Menu *edit_controls_right_menu;
900 Gtk::VBox ruler_label_vbox;
901 Gtk::VBox track_canvas_vbox;
902 Gtk::VBox time_canvas_vbox;
903 Gtk::VBox edit_controls_vbox;
904 Gtk::HBox edit_controls_hbox;
906 void control_scroll (float);
907 void access_action (std::string,std::string);
908 bool deferred_control_scroll (nframes64_t);
909 sigc::connection control_scroll_connection;
911 gdouble get_trackview_group_vertical_offset () const { return vertical_adjustment.get_value () - canvas_timebars_vsize;}
913 ArdourCanvas::Group* get_background_group () const { return _background_group; }
914 ArdourCanvas::Group* get_trackview_group () const { return _trackview_group; }
915 double last_trackview_group_vertical_offset;
916 void tie_vertical_scrolling ();
917 void scroll_canvas_horizontally ();
918 void scroll_canvas_vertically ();
920 struct VisualChange {
928 nframes64_t time_origin;
929 double frames_per_unit;
934 VisualChange() : pending ((VisualChange::Type) 0), time_origin (0), frames_per_unit (0), idle_handler_id (-1) {}
936 pending = Type (pending | t);
941 VisualChange pending_visual_change;
943 static int _idle_visual_changer (void *arg);
944 int idle_visual_changer ();
946 void queue_visual_change (nframes64_t);
947 void queue_visual_change (double);
948 void queue_visual_change_y (double);
949 void ensure_visual_change_idle_handler ();
951 void end_location_changed (ARDOUR::Location*);
954 TrackViewList track_views;
955 std::pair<TimeAxisView*, ARDOUR::layer_t> trackview_by_y_position (double);
956 TimeAxisView* axis_view_from_route (ARDOUR::Route *) const;
957 TrackSelection axis_views_from_routes (std::list<ARDOUR::Route *>) const;
959 TrackSelection get_tracks_for_range_action () const;
961 static Gdk::Cursor* cross_hair_cursor;
962 static Gdk::Cursor* trimmer_cursor;
963 static Gdk::Cursor* selector_cursor;
964 static Gdk::Cursor* grabber_cursor;
965 static Gdk::Cursor* grabber_edit_point_cursor;
966 static Gdk::Cursor* zoom_cursor;
967 static Gdk::Cursor* time_fx_cursor;
968 static Gdk::Cursor* fader_cursor;
969 static Gdk::Cursor* speaker_cursor;
970 static Gdk::Cursor* midi_pencil_cursor;
971 static Gdk::Cursor* midi_select_cursor;
972 static Gdk::Cursor* midi_resize_cursor;
973 static Gdk::Cursor* midi_erase_cursor;
974 static Gdk::Cursor* wait_cursor;
975 static Gdk::Cursor* timebar_cursor;
976 static Gdk::Cursor* transparent_cursor;
978 static void build_cursors ();
980 sigc::connection scroll_connection;
981 nframes64_t last_update_frame;
982 void center_screen (nframes64_t);
983 void center_screen_internal (nframes64_t, float);
985 void update_current_screen ();
987 void session_going_away ();
989 nframes64_t cut_buffer_start;
990 nframes64_t cut_buffer_length;
992 bool typed_event (ArdourCanvas::Item*, GdkEvent*, ItemType);
993 bool button_press_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
994 bool button_press_handler_1 (ArdourCanvas::Item *, GdkEvent *, ItemType);
995 bool button_press_handler_2 (ArdourCanvas::Item *, GdkEvent *, ItemType);
996 bool button_release_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
997 bool motion_handler (ArdourCanvas::Item*, GdkEvent*, bool from_autoscroll = false);
998 bool enter_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
999 bool leave_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
1001 /* KEYMAP HANDLING */
1003 void register_actions ();
1005 int ensure_cursor (nframes64_t* pos);
1007 void cut_copy (Editing::CutCopyOp);
1008 bool can_cut_copy () const;
1009 void cut_copy_points (Editing::CutCopyOp);
1010 void cut_copy_regions (Editing::CutCopyOp, RegionSelection&);
1011 void cut_copy_ranges (Editing::CutCopyOp);
1012 void cut_copy_midi (Editing::CutCopyOp);
1014 void mouse_paste ();
1015 void paste_internal (nframes64_t position, float times);
1017 /* EDITING OPERATIONS */
1019 void reset_point_selection ();
1020 void toggle_region_mute ();
1021 void toggle_region_lock ();
1022 void toggle_region_opaque ();
1023 void toggle_record_enable ();
1024 void set_region_lock_style (ARDOUR::Region::PositionLockStyle);
1025 void raise_region ();
1026 void raise_region_to_top ();
1027 void lower_region ();
1028 void lower_region_to_bottom ();
1029 void split_regions_at (nframes64_t, RegionSelection&);
1030 void split_region_at_transients ();
1031 void split_region_at_points (boost::shared_ptr<ARDOUR::Region>, ARDOUR::AnalysisFeatureList&, bool can_ferret);
1032 void crop_region_to_selection ();
1033 void crop_region_to (nframes64_t start, nframes64_t end);
1034 void set_sync_point (nframes64_t, const RegionSelection&);
1035 void set_region_sync_from_edit_point ();
1036 void remove_region_sync();
1037 void align_selection (ARDOUR::RegionPoint, nframes64_t position, const RegionSelection&);
1038 void align_selection_relative (ARDOUR::RegionPoint point, nframes64_t position, const RegionSelection&);
1039 void align_region (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, nframes64_t position);
1040 void align_region_internal (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, nframes64_t position);
1041 void remove_selected_regions ();
1042 void remove_clicked_region ();
1043 void edit_region ();
1044 void show_midi_list_editor ();
1045 void rename_region ();
1046 void duplicate_some_regions (RegionSelection&, float times);
1047 void duplicate_selection (float times);
1048 void region_fill_selection ();
1050 void region_fill_track ();
1051 void audition_playlist_region_standalone (boost::shared_ptr<ARDOUR::Region>);
1052 void audition_playlist_region_via_route (boost::shared_ptr<ARDOUR::Region>, ARDOUR::Route&);
1053 void split_multichannel_region();
1054 void reverse_region ();
1055 void strip_region_silence ();
1056 void normalize_region ();
1057 double _last_normalization_value;
1058 void reset_region_scale_amplitude ();
1059 void adjust_region_scale_amplitude (bool up);
1060 void quantize_region ();
1062 void do_insert_time ();
1063 void insert_time (nframes64_t, nframes64_t, Editing::InsertTimeOption, bool, bool, bool);
1065 void tab_to_transient (bool forward);
1067 void use_region_as_bar ();
1068 void use_range_as_bar ();
1070 void define_one_bar (nframes64_t start, nframes64_t end);
1072 void audition_region_from_region_list ();
1073 void hide_region_from_region_list ();
1075 void align (ARDOUR::RegionPoint);
1076 void align_relative (ARDOUR::RegionPoint);
1079 void reset_focus ();
1085 void paste (float times);
1087 int get_prefix (float&, bool&);
1089 void keyboard_paste ();
1090 void keyboard_insert_region_list_selection ();
1092 void region_from_selection ();
1093 void create_region_from_selection (std::vector<boost::shared_ptr<ARDOUR::Region> >&);
1095 void play_from_start ();
1096 void play_from_edit_point ();
1097 void play_from_edit_point_and_return ();
1098 void play_selected_region ();
1099 void play_edit_range ();
1100 void loop_selected_region ();
1101 void play_location (ARDOUR::Location&);
1102 void loop_location (ARDOUR::Location&);
1104 void temporal_zoom_selection ();
1105 void temporal_zoom_region (bool both_axes);
1106 void zoom_to_region (bool both_axes);
1107 void temporal_zoom_session ();
1108 void temporal_zoom (gdouble scale);
1109 void temporal_zoom_by_frame (nframes64_t start, nframes64_t end, const std::string & op);
1110 void temporal_zoom_to_frame (bool coarser, nframes64_t frame);
1112 void amplitude_zoom (gdouble scale);
1113 void amplitude_zoom_step (bool in);
1115 void insert_region_list_drag (boost::shared_ptr<ARDOUR::Region>, int x, int y);
1116 void insert_region_list_selection (float times);
1118 void insert_route_list_drag (boost::shared_ptr<ARDOUR::Route>, int x, int y);
1120 /* import & embed */
1122 void add_external_audio_action (Editing::ImportMode);
1123 void external_audio_dialog ();
1124 void session_import_dialog ();
1126 int check_whether_and_how_to_import(std::string, bool all_or_nothing = true);
1127 bool check_multichannel_status (const std::vector<Glib::ustring>& paths);
1129 SoundFileOmega* sfbrowser;
1131 void bring_in_external_audio (Editing::ImportMode mode, nframes64_t& pos);
1133 bool idle_drop_paths (std::vector<Glib::ustring> paths, nframes64_t frame, double ypos);
1134 void drop_paths_part_two (const std::vector<Glib::ustring>& paths, nframes64_t frame, double ypos);
1136 int import_sndfiles (std::vector<Glib::ustring> paths, Editing::ImportMode mode, ARDOUR::SrcQuality, nframes64_t& pos,
1137 int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>, bool, uint32_t total);
1138 int embed_sndfiles (std::vector<Glib::ustring> paths, bool multiple_files, bool& check_sample_rate, Editing::ImportMode mode,
1139 nframes64_t& pos, int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>&);
1141 int add_sources (std::vector<Glib::ustring> paths, ARDOUR::SourceList& sources, nframes64_t& pos, Editing::ImportMode,
1142 int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>&, bool add_channel_suffix);
1143 int finish_bringing_in_material (boost::shared_ptr<ARDOUR::Region> region, uint32_t, uint32_t, nframes64_t& pos, Editing::ImportMode mode,
1144 boost::shared_ptr<ARDOUR::Track>& existing_track);
1146 boost::shared_ptr<ARDOUR::AudioTrack> get_nth_selected_audio_track (int nth) const;
1147 boost::shared_ptr<ARDOUR::MidiTrack> get_nth_selected_midi_track (int nth) const;
1149 /* generic interthread progress window */
1151 ArdourDialog* interthread_progress_window;
1152 Gtk::Label interthread_progress_label;
1153 Gtk::VBox interthread_progress_vbox;
1154 Gtk::ProgressBar interthread_progress_bar;
1155 Gtk::Button interthread_cancel_button;
1156 Gtk::Label interthread_cancel_label;
1157 sigc::connection interthread_progress_connection;
1158 void interthread_cancel_clicked ();
1159 void build_interthread_progress_window ();
1160 ARDOUR::InterThreadInfo* current_interthread_info;
1162 AnalysisWindow* analysis_window;
1164 /* import specific info */
1166 struct EditorImportStatus : public ARDOUR::ImportStatus {
1167 Editing::ImportMode mode;
1171 boost::shared_ptr<ARDOUR::Track> track;
1175 EditorImportStatus import_status;
1176 gint import_progress_timeout (void *);
1177 static void *_import_thread (void *);
1178 void* import_thread ();
1179 void finish_import ();
1181 /* to support this ... */
1183 void import_audio (bool as_tracks);
1184 void do_import (std::vector<Glib::ustring> paths, bool split, bool as_tracks);
1186 void move_to_start ();
1187 void move_to_end ();
1189 void center_playhead ();
1190 void center_edit_point ();
1191 void edit_cursor_backward ();
1192 void edit_cursor_forward ();
1193 void playhead_forward_to_grid ();
1194 void playhead_backward_to_grid ();
1195 void playhead_backward ();
1196 void playhead_forward ();
1197 void scroll_playhead (bool forward);
1198 void scroll_backward (float pages=0.8f);
1199 void scroll_forward (float pages=0.8f);
1200 void scroll_tracks_down ();
1201 void scroll_tracks_up ();
1202 void delete_sample_forward ();
1203 void delete_sample_backward ();
1204 void delete_screen ();
1205 void search_backwards ();
1206 void search_forwards ();
1208 void clear_markers ();
1209 void clear_ranges ();
1210 void clear_locations ();
1211 void unhide_markers ();
1212 void unhide_ranges ();
1213 void jump_forward_to_mark ();
1214 void jump_backward_to_mark ();
1215 void cursor_align (bool playhead_to_edit);
1217 void remove_last_capture ();
1218 void select_all_selectables_using_time_selection ();
1219 void select_all_selectables_using_loop();
1220 void select_all_selectables_using_punch();
1221 void set_selection_from_range (ARDOUR::Location&);
1222 void set_selection_from_punch ();
1223 void set_selection_from_loop ();
1224 void set_selection_from_region ();
1226 void add_location_mark (nframes64_t where);
1227 void add_location_from_audio_region ();
1228 void add_locations_from_audio_region ();
1229 void add_location_from_selection ();
1230 void set_loop_from_selection (bool play);
1231 void set_punch_from_selection ();
1232 void set_punch_from_region ();
1234 void set_loop_from_edit_range (bool play);
1235 void set_loop_from_region (bool play);
1236 void set_punch_from_edit_range ();
1238 void set_loop_range (nframes64_t start, nframes64_t end, std::string cmd);
1239 void set_punch_range (nframes64_t start, nframes64_t end, std::string cmd);
1241 void add_location_from_playhead_cursor ();
1242 bool select_new_marker;
1244 void reverse_selection ();
1245 void edit_envelope ();
1247 void start_scrolling ();
1248 void stop_scrolling ();
1250 double last_scrub_x;
1251 int scrubbing_direction;
1252 int scrub_reversals;
1253 int scrub_reverse_distance;
1256 void keyboard_selection_begin ();
1257 void keyboard_selection_finish (bool add);
1258 bool have_pending_keyboard_selection;
1259 nframes64_t pending_keyboard_selection_start;
1261 boost::shared_ptr<ARDOUR::Region> select_region_for_operation (int dir, TimeAxisView **tv);
1262 void extend_selection_to_end_of_region (bool next);
1263 void extend_selection_to_start_of_region (bool previous);
1265 Editing::SnapType _snap_type;
1266 Editing::SnapMode _snap_mode;
1268 /// Snap threshold in pixels
1269 double snap_threshold;
1271 bool ignore_gui_changes;
1277 Gtk::Menu fade_context_menu;
1278 void popup_fade_context_menu (int, int, ArdourCanvas::Item*, ItemType);
1280 void set_fade_in_shape (ARDOUR::AudioRegion::FadeShape);
1281 void set_fade_out_shape (ARDOUR::AudioRegion::FadeShape);
1283 void set_fade_length (bool in);
1284 void toggle_fade_active (bool in);
1285 void set_fade_in_active (bool);
1286 void set_fade_out_active (bool);
1288 std::set<boost::shared_ptr<ARDOUR::Playlist> > motion_frozen_playlists;
1289 RegionSelection pre_drag_region_selection;
1291 bool _dragging_playhead;
1292 bool _dragging_edit_point;
1294 void marker_drag_motion_callback (GdkEvent*);
1295 void marker_drag_finished_callback (GdkEvent*);
1297 gint mouse_rename_region (ArdourCanvas::Item*, GdkEvent*);
1299 void start_region_grab (ArdourCanvas::Item*, GdkEvent*, RegionView*);
1300 void start_create_region_grab (ArdourCanvas::Item*, GdkEvent*);
1301 void start_region_copy_grab (ArdourCanvas::Item*, GdkEvent*, RegionView*);
1302 void start_region_brush_grab (ArdourCanvas::Item*, GdkEvent*, RegionView*);
1303 void start_selection_grab (ArdourCanvas::Item*, GdkEvent*);
1305 void region_view_item_click (AudioRegionView&, GdkEventButton*);
1307 void remove_gain_control_point (ArdourCanvas::Item*, GdkEvent*);
1308 void remove_control_point (ArdourCanvas::Item*, GdkEvent*);
1310 void mouse_brush_insert_region (RegionView*, nframes64_t pos);
1311 void brush (nframes64_t);
1313 void show_verbose_time_cursor (nframes64_t frame, double offset = 0, double xpos=-1, double ypos=-1);
1314 void show_verbose_duration_cursor (nframes64_t start, nframes64_t end, double offset = 0, double xpos=-1, double ypos=-1);
1315 double clamp_verbose_cursor_x (double);
1316 double clamp_verbose_cursor_y (double);
1318 /* Canvas event handlers */
1320 bool canvas_control_point_event (GdkEvent* event,ArdourCanvas::Item*, ControlPoint*);
1321 bool canvas_line_event (GdkEvent* event,ArdourCanvas::Item*, AutomationLine*);
1322 bool canvas_selection_rect_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1323 bool canvas_selection_start_trim_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1324 bool canvas_selection_end_trim_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1325 bool canvas_crossfade_view_event (GdkEvent* event,ArdourCanvas::Item*, CrossfadeView*);
1326 bool canvas_fade_in_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1327 bool canvas_fade_in_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1328 bool canvas_fade_out_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1329 bool canvas_fade_out_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1332 // These variables are used to detect a feedback loop and break it to avoid a gui hang
1334 ArdourCanvas::Item *last_item_entered;
1335 int last_item_entered_n;
1338 bool canvas_region_view_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1339 bool canvas_frame_handle_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1340 bool canvas_region_view_name_highlight_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1341 bool canvas_region_view_name_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1342 bool canvas_stream_view_event (GdkEvent* event,ArdourCanvas::Item*, RouteTimeAxisView*);
1343 bool canvas_marker_event (GdkEvent* event,ArdourCanvas::Item*, Marker*);
1344 bool canvas_zoom_rect_event (GdkEvent* event,ArdourCanvas::Item*);
1345 bool canvas_tempo_marker_event (GdkEvent* event,ArdourCanvas::Item*, TempoMarker*);
1346 bool canvas_meter_marker_event (GdkEvent* event,ArdourCanvas::Item*, MeterMarker*);
1347 bool canvas_automation_track_event(GdkEvent* event, ArdourCanvas::Item*, AutomationTimeAxisView*) ;
1348 bool canvas_note_event (GdkEvent* event, ArdourCanvas::Item*);
1350 bool canvas_tempo_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1351 bool canvas_meter_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1352 bool canvas_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1353 bool canvas_range_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1354 bool canvas_transport_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1355 bool canvas_cd_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1357 bool canvas_imageframe_item_view_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1358 bool canvas_imageframe_view_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameTimeAxis*);
1359 bool canvas_imageframe_start_handle_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1360 bool canvas_imageframe_end_handle_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1361 bool canvas_marker_time_axis_view_event(GdkEvent* event, ArdourCanvas::Item*,MarkerTimeAxis*);
1362 bool canvas_markerview_item_view_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1363 bool canvas_markerview_start_handle_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1364 bool canvas_markerview_end_handle_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1366 /* non-public event handlers */
1368 bool canvas_playhead_cursor_event (GdkEvent* event, ArdourCanvas::Item*);
1369 bool track_canvas_scroll (GdkEventScroll* event);
1371 bool track_canvas_scroll_event (GdkEventScroll* event);
1372 bool track_canvas_button_press_event (GdkEventButton* event);
1373 bool track_canvas_button_release_event (GdkEventButton* event);
1374 bool track_canvas_motion_notify_event (GdkEventMotion* event);
1376 Gtk::Allocation canvas_allocation;
1377 void track_canvas_allocate (Gtk::Allocation alloc);
1378 bool track_canvas_size_allocated ();
1379 bool track_canvas_drag_motion (Glib::RefPtr<Gdk::DragContext> const &, int, int, guint);
1381 void set_playhead_cursor ();
1383 void kbd_driver (sigc::slot<void,GdkEvent*>, bool use_track_canvas = true, bool use_time_canvas = true, bool can_select = true);
1384 void kbd_mute_unmute_region ();
1387 void kbd_do_brush (GdkEvent*);
1388 void kbd_do_audition (GdkEvent*);
1390 void handle_new_duration ();
1391 void initialize_canvas ();
1393 /* display control */
1395 bool _show_measures;
1396 /// true if the editor should follow the playhead, otherwise false
1397 bool _follow_playhead;
1398 /// true if waveforms should be shown while recording audio tracks, otherwise false
1399 bool _show_waveforms_recording;
1401 ARDOUR::TempoMap::BBTPointList *current_bbt_points;
1403 TempoLines* tempo_lines;
1405 ArdourCanvas::Group* time_line_group;
1407 void hide_measures ();
1408 void draw_measures ();
1409 bool redraw_measures ();
1411 void new_tempo_section ();
1413 void mouse_add_new_tempo_event (nframes64_t where);
1414 void mouse_add_new_meter_event (nframes64_t where);
1416 void remove_tempo_marker (ArdourCanvas::Item*);
1417 void remove_meter_marker (ArdourCanvas::Item*);
1418 gint real_remove_tempo_marker (ARDOUR::TempoSection*);
1419 gint real_remove_meter_marker (ARDOUR::MeterSection*);
1421 void edit_tempo_section (ARDOUR::TempoSection*);
1422 void edit_meter_section (ARDOUR::MeterSection*);
1423 void edit_tempo_marker (ArdourCanvas::Item*);
1424 void edit_meter_marker (ArdourCanvas::Item*);
1425 void edit_control_point (ArdourCanvas::Item*);
1427 void marker_menu_edit ();
1428 void marker_menu_remove ();
1429 void marker_menu_rename ();
1430 void marker_menu_lock (bool yn);
1431 void marker_menu_hide ();
1432 void marker_menu_loop_range ();
1433 void marker_menu_select_all_selectables_using_range ();
1434 void marker_menu_select_using_range ();
1435 void marker_menu_separate_regions_using_location ();
1436 void marker_menu_play_from ();
1437 void marker_menu_play_range ();
1438 void marker_menu_set_playhead ();
1439 void marker_menu_set_from_playhead ();
1440 void marker_menu_set_from_selection ();
1441 void marker_menu_range_to_next ();
1442 void new_transport_marker_menu_set_loop ();
1443 void new_transport_marker_menu_set_punch ();
1444 void update_loop_range_view (bool visibility=false);
1445 void update_punch_range_view (bool visibility=false);
1446 void new_transport_marker_menu_popdown ();
1447 void marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1448 void tm_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1449 void transport_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1450 void new_transport_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1451 void build_range_marker_menu (bool loop_or_punch);
1452 void build_marker_menu (bool start_or_end);
1453 void build_tm_marker_menu ();
1454 void build_new_transport_marker_menu ();
1456 Gtk::Menu* tm_marker_menu;
1457 Gtk::Menu* marker_menu;
1458 Gtk::Menu* start_end_marker_menu;
1459 Gtk::Menu* range_marker_menu;
1460 Gtk::Menu* transport_marker_menu;
1461 Gtk::Menu* new_transport_marker_menu;
1462 Gtk::Menu* cd_marker_menu;
1463 ArdourCanvas::Item* marker_menu_item;
1465 typedef std::list<Marker*> Marks;
1468 void remove_metric_marks ();
1469 void draw_metric_marks (const ARDOUR::Metrics& metrics);
1471 void compute_current_bbt_points (nframes_t left, nframes_t right);
1472 void tempo_map_changed (ARDOUR::Change);
1473 void redisplay_tempo (bool immediate_redraw);
1475 void snap_to (nframes64_t& first, int32_t direction = 0, bool for_mark = false);
1476 void snap_to_with_modifier (nframes64_t& first, GdkEvent const *, int32_t direction = 0, bool for_mark = false);
1477 void snap_to (nframes64_t& first, nframes64_t& last, int32_t direction = 0, bool for_mark = false);
1479 uint32_t bbt_beat_subdivision;
1483 Gtk::ToggleButton editor_mixer_button;
1484 Gtk::ToggleButton editor_list_button;
1485 void editor_mixer_button_toggled ();
1486 void editor_list_button_toggled ();
1488 AudioClock zoom_range_clock;
1489 Gtk::Button zoom_in_button;
1490 Gtk::Button zoom_out_button;
1491 Gtk::Button zoom_out_full_button;
1492 Gtk::Button zoom_onetoone_button;
1494 Gtk::Button tav_expand_button;
1495 Gtk::Button tav_shrink_button;
1497 Gtk::VBox toolbar_clock_vbox;
1498 Gtk::VBox toolbar_selection_clock_vbox;
1499 Gtk::Table toolbar_selection_clock_table;
1500 Gtk::Label toolbar_selection_cursor_label;
1502 Gtk::HBox mouse_mode_button_box;
1503 Gtkmm2ext::TearOff* mouse_mode_tearoff;
1504 Gtk::ToggleButton mouse_select_button;
1505 Gtk::ToggleButton mouse_move_button;
1506 Gtk::ToggleButton mouse_gain_button;
1507 Gtk::ToggleButton mouse_zoom_button;
1508 Gtk::ToggleButton mouse_timefx_button;
1509 Gtk::ToggleButton mouse_audition_button;
1511 void mouse_mode_toggled (Editing::MouseMode m);
1512 bool ignore_mouse_mode_toggle;
1514 Gtk::ToggleButton internal_edit_button;
1515 void toggle_internal_editing ();
1517 gint mouse_select_button_release (GdkEventButton*);
1519 Gtk::VBox automation_box;
1520 Gtk::Button automation_mode_button;
1521 Gtk::ToggleButton global_automation_button;
1523 Gtk::ComboBoxText edit_mode_selector;
1524 Gtk::VBox edit_mode_box;
1526 void set_edit_mode (ARDOUR::EditMode);
1527 void cycle_edit_mode ();
1528 void edit_mode_selection_done ();
1530 Gtk::ComboBoxText snap_type_selector;
1531 Gtk::ComboBoxText snap_mode_selector;
1534 std::vector<std::string> snap_type_strings;
1535 std::vector<std::string> snap_mode_strings;
1537 void snap_type_selection_done ();
1538 void snap_mode_selection_done ();
1539 void snap_mode_chosen (Editing::SnapMode);
1540 void snap_type_chosen (Editing::SnapType);
1542 Glib::RefPtr<Gtk::RadioAction> snap_type_action (Editing::SnapType);
1543 Glib::RefPtr<Gtk::RadioAction> snap_mode_action (Editing::SnapMode);
1545 Gtk::ComboBoxText zoom_focus_selector;
1546 Gtk::VBox zoom_focus_box;
1548 std::vector<std::string> zoom_focus_strings;
1550 void zoom_focus_selection_done ();
1551 void zoom_focus_chosen (Editing::ZoomFocus);
1553 Glib::RefPtr<Gtk::RadioAction> zoom_focus_action (Editing::ZoomFocus);
1556 Gtk::HBox track_zoom_box;
1557 Gtk::VBox zoom_vbox;
1559 void zoom_adjustment_changed();
1561 void setup_toolbar ();
1563 Gtkmm2ext::TearOff* tools_tearoff;
1564 Gtk::HBox toolbar_hbox;
1565 Gtk::EventBox toolbar_base;
1566 Gtk::Frame toolbar_frame;
1570 Gtk::HBox panic_box;
1571 Gtk::Button midi_panic_button;
1572 Gtk::ToggleButton midi_sound_notes;
1574 bool sound_notes () const { return midi_sound_notes.get_active(); }
1576 void setup_midi_toolbar ();
1578 /* selection process */
1580 Selection* selection;
1581 Selection* cut_buffer;
1583 void time_selection_changed ();
1584 void track_selection_changed ();
1585 void region_selection_changed ();
1586 sigc::connection editor_regions_selection_changed_connection;
1587 void sensitize_the_right_region_actions (bool have_selected_regions);
1588 void point_selection_changed ();
1589 void marker_selection_changed ();
1591 void cancel_selection ();
1593 void region_selection_op (void (ARDOUR::Region::*pmf)(void));
1594 void region_selection_op (void (ARDOUR::Region::*pmf)(void*), void*);
1595 void region_selection_op (void (ARDOUR::Region::*pmf)(bool), bool);
1597 bool audio_region_selection_covers (nframes64_t where);
1599 /* transport range select process */
1601 ArdourCanvas::SimpleRect* cd_marker_bar_drag_rect;
1602 ArdourCanvas::SimpleRect* range_bar_drag_rect;
1603 ArdourCanvas::SimpleRect* transport_bar_drag_rect;
1606 ArdourCanvas::SimpleRect *bogus_background_rect;
1608 ArdourCanvas::SimpleRect *transport_bar_range_rect;
1609 ArdourCanvas::SimpleRect *transport_bar_preroll_rect;
1610 ArdourCanvas::SimpleRect *transport_bar_postroll_rect;
1611 ArdourCanvas::SimpleRect *transport_loop_range_rect;
1612 ArdourCanvas::SimpleRect *transport_punch_range_rect;
1613 ArdourCanvas::SimpleLine *transport_punchin_line;
1614 ArdourCanvas::SimpleLine *transport_punchout_line;
1615 ArdourCanvas::SimpleRect *transport_preroll_rect;
1616 ArdourCanvas::SimpleRect *transport_postroll_rect;
1618 ARDOUR::Location* transport_loop_location();
1619 ARDOUR::Location* transport_punch_location();
1621 ARDOUR::Location *temp_location;
1623 /* object rubberband select process */
1625 bool select_all_within (nframes64_t start, nframes64_t end, gdouble topy, gdouble boty, const TrackViewList&, Selection::Operation op);
1627 ArdourCanvas::SimpleRect *rubberband_rect;
1629 /* mouse zoom process */
1631 ArdourCanvas::SimpleRect *zoom_rect;
1632 void reposition_zoom_rect (nframes64_t start, nframes64_t end);
1634 EditorRouteGroups* _route_groups;
1635 EditorRoutes* _routes;
1636 EditorRegions* _regions;
1637 EditorSnapshots* _snapshots;
1638 EditorLocations* _locations;
1640 /* diskstream/route display management */
1641 Glib::RefPtr<Gdk::Pixbuf> rec_enabled_icon;
1642 Glib::RefPtr<Gdk::Pixbuf> rec_disabled_icon;
1644 Glib::RefPtr<Gtk::TreeSelection> route_display_selection;
1646 bool sync_track_view_list_and_routes ();
1648 Gtk::VBox list_vpacker;
1652 bool autoscroll_active;
1653 int autoscroll_timeout_tag;
1656 int last_autoscroll_x;
1657 int last_autoscroll_y;
1658 uint32_t autoscroll_cnt;
1659 nframes64_t autoscroll_x_distance;
1660 double autoscroll_y_distance;
1662 static gint _autoscroll_canvas (void *);
1663 bool autoscroll_canvas ();
1664 void start_canvas_autoscroll (int x, int y);
1665 void stop_canvas_autoscroll ();
1666 void maybe_autoscroll (GdkEventMotion*, bool);
1667 bool allow_vertical_scroll;
1670 void point_trim (GdkEvent*);
1671 void single_contents_trim (RegionView&, nframes64_t, bool, bool, bool);
1672 void single_start_trim (RegionView&, nframes64_t, bool, bool, bool);
1673 void single_end_trim (RegionView&, nframes64_t, bool, bool, bool);
1675 void thaw_region_after_trim (RegionView& rv);
1677 void trim_region_front();
1678 void trim_region_back();
1679 void trim_region (bool front);
1681 void trim_region_to_edit_point ();
1682 void trim_region_from_edit_point ();
1683 void trim_region_to_loop ();
1684 void trim_region_to_punch ();
1685 void trim_region_to_location (const ARDOUR::Location&, const char* cmd);
1687 void trim_to_region(bool forward);
1688 void trim_region_to_previous_region_end();
1689 void trim_region_to_next_region_start();
1691 bool show_gain_after_trim;
1695 int convert_drop_to_paths (
1696 std::vector<Glib::ustring>& paths,
1697 const Glib::RefPtr<Gdk::DragContext>& context,
1700 const Gtk::SelectionData& data,
1704 void track_canvas_drag_data_received (
1705 const Glib::RefPtr<Gdk::DragContext>& context,
1708 const Gtk::SelectionData& data,
1713 const Glib::RefPtr<Gdk::DragContext>& context,
1716 const Gtk::SelectionData& data,
1721 const Glib::RefPtr<Gdk::DragContext>& context,
1724 const Gtk::SelectionData& data,
1729 const Glib::RefPtr<Gdk::DragContext>& context,
1732 const Gtk::SelectionData& data,
1738 int write_region_selection(RegionSelection&);
1739 bool write_region (std::string path, boost::shared_ptr<ARDOUR::AudioRegion>);
1740 void bounce_region_selection ();
1741 void bounce_range_selection (bool replace, bool enable_processing);
1742 void external_edit_region ();
1744 int write_audio_selection (TimeSelection&);
1745 bool write_audio_range (ARDOUR::AudioPlaylist&, const ARDOUR::ChanCount& channels, std::list<ARDOUR::AudioRange>&);
1747 void write_selection ();
1749 XMLNode *before; /* used in *_reversible_command */
1751 void begin_reversible_command (std::string cmd_name);
1752 void commit_reversible_command ();
1754 void update_title ();
1755 void update_title_s (const std::string & snapshot_name);
1758 Selection* selection;
1759 double frames_per_unit;
1761 State (PublicEditor const * e);
1765 void store_state (State&) const;
1766 void restore_state (State *);
1768 void instant_save ();
1770 boost::shared_ptr<ARDOUR::AudioRegion> last_audition_region;
1772 /* freeze operations */
1774 ARDOUR::InterThreadInfo freeze_status;
1775 gint freeze_progress_timeout (void *);
1776 static void* _freeze_thread (void*);
1777 void* freeze_thread ();
1779 void freeze_route ();
1780 void unfreeze_route ();
1782 /* route-group solo + mute */
1784 void set_route_group_solo (ARDOUR::Route&, bool);
1785 void set_route_group_mute (ARDOUR::Route&, bool);
1789 void duplicate_dialog (bool with_dialog);
1791 nframes64_t event_frame (GdkEvent const *, double* px = 0, double* py = 0) const;
1793 /* returns false if mouse pointer is not in track or marker canvas
1795 bool mouse_frame (nframes64_t&, bool& in_track_canvas) const;
1797 /* "whats mine is yours" */
1799 TimeFXDialog* current_timefx;
1801 static void* timefx_thread (void *arg);
1802 void do_timefx (TimeFXDialog&);
1804 int time_stretch (RegionSelection&, float fraction);
1805 int pitch_shift (RegionSelection&, float cents);
1806 void pitch_shift_regions ();
1807 int time_fx (RegionSelection&, float val, bool pitching);
1809 /* editor-mixer strip */
1811 MixerStrip *current_mixer_strip;
1812 bool show_editor_mixer_when_tracks_arrive;
1813 Gtk::VBox current_mixer_strip_vbox;
1814 void cms_new (boost::shared_ptr<ARDOUR::Route>);
1815 void cms_deleted ();
1816 void current_mixer_strip_hidden ();
1817 void current_mixer_strip_removed ();
1819 void detach_tearoff (Gtk::Box* b, Gtk::Window* w);
1820 void reattach_tearoff (Gtk::Box* b, Gtk::Window* w, int32_t n);
1822 void ensure_all_elements_drawn ();
1824 /* nudging tracks */
1826 void nudge_track (bool use_edit_point, bool forwards);
1830 bool _xfade_visibility;
1833 void handle_new_imageframe_time_axis_view(const std::string & track_name, void* src) ;
1834 void handle_new_imageframe_marker_time_axis_view(const std::string & track_name, TimeAxisView* marked_track) ;
1836 void start_imageframe_grab(ArdourCanvas::Item*, GdkEvent*) ;
1837 void start_markerview_grab(ArdourCanvas::Item*, GdkEvent*) ;
1839 void imageframe_drag_motion_callback(ArdourCanvas::Item*, GdkEvent*) ;
1840 void markerview_drag_motion_callback(ArdourCanvas::Item*, GdkEvent*) ;
1841 void timeaxis_item_drag_finished_callback(ArdourCanvas::Item*, GdkEvent*) ;
1843 gint canvas_imageframe_item_view_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameView* ifv);
1844 gint canvas_imageframe_view_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameTimeAxis* ifta);
1845 gint canvas_imageframe_start_handle_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameView* ifv);
1846 gint canvas_imageframe_end_handle_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameView* ifv);
1848 gint canvas_marker_time_axis_view_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerTimeAxis* mta);
1849 gint canvas_markerview_item_view_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerView* mv);
1850 gint canvas_markerview_start_handle_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerView* mv);
1851 gint canvas_markerview_end_handle_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerView* mv);
1853 void imageframe_start_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1854 void imageframe_end_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1855 void imageframe_start_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1856 void imageframe_start_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1857 void imageframe_end_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1858 void imageframe_end_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1860 void markerview_item_start_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1861 void markerview_item_end_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1862 void markerview_start_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1863 void markerview_start_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1864 void markerview_end_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1865 void markerview_end_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1867 void popup_imageframe_edit_menu(int button, int32_t time, ArdourCanvas::Item* ifv, bool with_frame) ;
1868 void popup_marker_time_axis_edit_menu(int button, int32_t time, ArdourCanvas::Item* ifv, bool with_frame) ;
1870 ImageFrameSocketHandler* image_socket_listener ;
1873 void toggle_xfade_active (boost::weak_ptr<ARDOUR::Crossfade>);
1874 void toggle_xfade_length (boost::weak_ptr<ARDOUR::Crossfade>);
1875 void edit_xfade (boost::weak_ptr<ARDOUR::Crossfade>);
1876 void xfade_edit_left_region ();
1877 void xfade_edit_right_region ();
1879 static const int32_t default_width = 995;
1880 static const int32_t default_height = 765;
1884 Gtk::Button nudge_forward_button;
1885 Gtk::Button nudge_backward_button;
1886 Gtk::HBox nudge_hbox;
1887 Gtk::VBox nudge_vbox;
1888 AudioClock nudge_clock;
1890 bool nudge_forward_release (GdkEventButton*);
1891 bool nudge_backward_release (GdkEventButton*);
1895 void apply_filter (ARDOUR::Filter&, std::string cmd);
1897 Command* apply_midi_note_edit_op_to_region (ARDOUR::MidiOperator& op, MidiRegionView& mrv);
1898 void apply_midi_note_edit_op (ARDOUR::MidiOperator& op);
1900 /* handling cleanup */
1902 int playlist_deletion_dialog (boost::shared_ptr<ARDOUR::Playlist>);
1904 std::vector<sigc::connection> session_connections;
1906 /* tracking step changes of track height */
1908 TimeAxisView* current_stepping_trackview;
1909 ARDOUR::microseconds_t last_track_height_step_timestamp;
1910 gint track_height_step_timeout();
1911 sigc::connection step_timeout;
1913 TimeAxisView* entered_track;
1914 RegionView* entered_regionview;
1917 void ensure_entered_track_selected (bool op_acts_on_objects = false);
1918 bool clear_entered_track;
1919 bool left_track_canvas (GdkEventCrossing*);
1920 bool entered_track_canvas (GdkEventCrossing*);
1921 void set_entered_track (TimeAxisView*);
1922 void set_entered_regionview (RegionView*);
1923 void ensure_track_visible (TimeAxisView*);
1924 gint left_automation_track ();
1926 bool _new_regionviews_show_envelope;
1928 void reset_canvas_action_sensitivity (bool);
1929 void toggle_gain_envelope_visibility ();
1930 void toggle_gain_envelope_active ();
1931 void reset_region_gain_envelopes ();
1933 bool on_key_press_event (GdkEventKey*);
1934 bool on_key_release_event (GdkEventKey*);
1936 void session_state_saved (std::string);
1938 Glib::RefPtr<Gtk::Action> undo_action;
1939 Glib::RefPtr<Gtk::Action> redo_action;
1941 void history_changed ();
1943 Gtk::HBox status_bar_hpacker;
1945 Editing::EditPoint _edit_point;
1947 Gtk::ComboBoxText edit_point_selector;
1949 void set_edit_point_preference (Editing::EditPoint ep, bool force = false);
1950 void cycle_edit_point (bool with_marker);
1951 void set_edit_point ();
1952 void edit_point_selection_done ();
1953 void edit_point_chosen (Editing::EditPoint);
1954 Glib::RefPtr<Gtk::RadioAction> edit_point_action (Editing::EditPoint);
1955 std::vector<std::string> edit_point_strings;
1957 void selected_marker_moved (ARDOUR::Location*);
1959 bool get_edit_op_range (nframes64_t& start, nframes64_t& end) const;
1961 void get_regions_at (RegionSelection&, nframes64_t where, const TrackSelection& ts) const;
1962 void get_regions_after (RegionSelection&, nframes64_t where, const TrackSelection& ts) const;
1964 void get_regions_for_action (RegionSelection&, bool allow_entered = false, bool allow_edit_position = true);
1966 sigc::connection fast_screen_update_connection;
1967 gint start_updating ();
1968 gint stop_updating ();
1969 void fast_update_strips ();
1970 bool meters_running;
1972 void select_next_route ();
1973 void select_prev_route ();
1975 void snap_to_internal (nframes64_t& first, int32_t direction = 0, bool for_mark = false);
1976 void timecode_snap_to_internal (nframes64_t& first, int32_t direction = 0, bool for_mark = false);
1978 RhythmFerret* rhythm_ferret;
1979 BundleManager* _bundle_manager;
1980 GlobalPortMatrixWindow* _global_port_matrix[ARDOUR::DataType::num_types];
1982 void fit_tracks (TrackSelection &);
1983 void fit_selected_tracks ();
1984 void set_track_height (uint32_t h);
1986 void remove_tracks ();
1987 void toggle_tracks_active ();
1992 friend gboolean _idle_resize (gpointer);
1993 int32_t _pending_resize_amount;
1994 TimeAxisView* _pending_resize_view;
1996 void visible_order_range (int*, int*) const;
1999 bool _pending_locate_request;
2001 EditorSummary* _summary;
2002 void region_view_added (RegionView *);
2004 void update_canvas_now ();
2005 void streamview_height_changed ();
2007 EditorGroupTabs* _group_tabs;
2008 void fit_route_group (ARDOUR::RouteGroup *);
2010 void start_step_editing ();
2011 void stop_step_editing ();
2012 bool check_step_edit ();
2013 sigc::connection step_edit_connection;
2016 friend class RegionDrag;
2017 friend class RegionMoveDrag;
2018 friend class RegionSpliceDrag;
2019 friend class TrimDrag;
2020 friend class MeterMarkerDrag;
2021 friend class TempoMarkerDrag;
2022 friend class CursorDrag;
2023 friend class FadeInDrag;
2024 friend class FadeOutDrag;
2025 friend class MarkerDrag;
2026 friend class RegionGainDrag;
2027 friend class ControlPointDrag;
2028 friend class LineDrag;
2029 friend class RubberbandSelectDrag;
2030 friend class TimeFXDrag;
2031 friend class ScrubDrag;
2032 friend class SelectionDrag;
2033 friend class RangeMarkerBarDrag;
2034 friend class MouseZoomDrag;
2035 friend class RegionCreateDrag;
2036 friend class RegionMotionDrag;
2037 friend class RegionInsertDrag;
2039 friend class EditorSummary;
2040 friend class EditorGroupTabs;
2042 friend class EditorRoutes;
2045 #endif /* __ardour_editor_h__ */