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 "region_selection.h"
66 #include "editor_summary.h"
73 class AudioDiskstream;
95 class AudioRegionView;
96 class AudioStreamView;
97 class AudioTimeAxisView;
99 class AutomationSelection;
100 class AutomationTimeAxisView;
105 class GlobalPortMatrixWindow;
106 class GroupedButtons;
108 class MidiRegionView;
110 class PlaylistSelector;
111 class PluginSelector;
114 class SoundFileOmega;
120 class TrackSelection;
121 class EditorGroupTabs;
123 class EditorRouteGroups;
125 class EditorLocations;
126 class EditorSnapshots;
128 /* <CMT Additions> */
129 class ImageFrameView;
130 class ImageFrameTimeAxisView;
131 class ImageFrameTimeAxis;
132 class MarkerTimeAxis ;
134 class ImageFrameSocketHandler ;
135 class TimeAxisViewItem ;
136 /* </CMT Additions> */
138 struct EditorCursor {
140 ArdourCanvas::Points points;
141 ArdourCanvas::Line canvas_item;
142 nframes64_t current_frame;
145 EditorCursor (Editor&, bool (Editor::*)(GdkEvent*,ArdourCanvas::Item*));
148 void set_position (nframes64_t);
149 void set_length (double units);
150 void set_y_axis (double position);
152 sigc::signal<void, nframes64_t> PositionChanged;
155 class Editor : public PublicEditor
161 void connect_to_session (ARDOUR::Session *);
162 ARDOUR::Session* current_session() const { return session; }
164 virtual bool have_idled () const { return _have_idled; }
166 nframes64_t leftmost_position() const { return leftmost_frame; }
168 nframes64_t current_page_frames() const {
169 return (nframes64_t) floor (_canvas_width * frames_per_unit);
172 double canvas_height () const {
173 return _canvas_height;
176 void cycle_snap_mode ();
177 void cycle_snap_choice ();
178 void set_snap_to (Editing::SnapType);
179 void set_snap_mode (Editing::SnapMode);
180 void set_snap_threshold (double pixel_distance) {snap_threshold = pixel_distance;}
182 Editing::SnapMode snap_mode () const;
183 Editing::SnapType snap_type () const;
185 void undo (uint32_t n = 1);
186 void redo (uint32_t n = 1);
188 XMLNode& get_state ();
189 int set_state (const XMLNode&, int version);
191 void set_mouse_mode (Editing::MouseMode, bool force=true);
192 void step_mouse_mode (bool next);
193 Editing::MouseMode current_mouse_mode () const { return mouse_mode; }
194 Editing::MidiEditMode current_midi_edit_mode () const;
196 bool internal_editing() const { return _internal_editing ; }
197 void set_internal_edit (bool yn);
200 void add_imageframe_time_axis(const std::string & track_name, void*) ;
201 void add_imageframe_marker_time_axis(const std::string & track_name, TimeAxisView* marked_track, void*) ;
202 void connect_to_image_compositor() ;
203 void scroll_timeaxis_to_imageframe_item(const TimeAxisViewItem* item) ;
204 TimeAxisView* get_named_time_axis(const std::string & name) ;
205 #endif /* WITH_CMT */
207 void foreach_time_axis_view (sigc::slot<void,TimeAxisView&>);
208 void add_to_idle_resize (TimeAxisView*, int32_t);
210 RouteTimeAxisView* get_route_view_by_id (PBD::ID& id);
212 void consider_auditioning (boost::shared_ptr<ARDOUR::Region>);
213 void hide_a_region (boost::shared_ptr<ARDOUR::Region>);
214 void remove_a_region (boost::shared_ptr<ARDOUR::Region>);
216 #ifdef USE_RUBBERBAND
217 std::vector<std::string> rb_opt_strings;
220 /* option editor-access */
222 void set_show_waveforms_recording (bool yn);
223 bool show_waveforms_recording() const { return _show_waveforms_recording; }
225 /* things that need to be public to be used in the main menubar */
227 void new_region_from_selection ();
228 void separate_regions_between (const TimeSelection&);
229 void separate_region_from_selection ();
230 void separate_region_from_punch ();
231 void separate_region_from_loop ();
232 void separate_regions_using_location (ARDOUR::Location&);
233 void transition_to_rolling (bool forward);
237 nframes64_t unit_to_frame (double unit) const {
238 return (nframes64_t) rint (unit * frames_per_unit);
241 double frame_to_unit (nframes64_t frame) const {
242 return rint ((double) frame / (double) frames_per_unit);
245 double frame_to_unit (double frame) const {
246 return rint (frame / frames_per_unit);
249 /* NOTE: these functions assume that the "pixel" coordinate is
250 the result of using the world->canvas affine transform on a
251 world coordinate. These coordinates already take into
252 account any scrolling carried out by adjusting the
256 nframes64_t pixel_to_frame (double pixel) const {
258 /* pixel can be less than zero when motion events
259 are processed. since we've already run the world->canvas
260 affine, that means that the location *really* is "off
261 to the right" and thus really is "before the start".
265 return (nframes64_t) rint (pixel * frames_per_unit * GNOME_CANVAS(track_canvas->gobj())->pixels_per_unit);
271 gulong frame_to_pixel (nframes64_t frame) const {
272 return (gulong) rint ((frame / (frames_per_unit * GNOME_CANVAS(track_canvas->gobj())->pixels_per_unit)));
275 void flush_canvas ();
279 Selection& get_selection() const { return *selection; }
280 Selection& get_cut_buffer() const { return *cut_buffer; }
282 bool extend_selection_to_track (TimeAxisView&);
284 void play_selection ();
285 void select_all_in_track (Selection::Operation op);
286 void select_all (Selection::Operation op);
287 void invert_selection_in_track ();
288 void invert_selection ();
289 void deselect_all ();
291 void set_selected_regionview_from_region_list (boost::shared_ptr<ARDOUR::Region> region, Selection::Operation op = Selection::Set);
295 void set_show_measures (bool yn);
296 bool show_measures () const { return _show_measures; }
298 /* analysis window */
300 void analyze_region_selection();
301 void analyze_range_selection();
305 void export_audio ();
306 void export_selection ();
307 void export_range ();
308 void export_region ();
310 void add_toplevel_controls (Gtk::Container&);
311 Gtk::HBox& get_status_bar_packer() { return status_bar_hpacker; }
313 void set_zoom_focus (Editing::ZoomFocus);
314 Editing::ZoomFocus get_zoom_focus () const { return zoom_focus; }
315 double get_current_zoom () const { return frames_per_unit; }
317 void temporal_zoom_step (bool coarser);
318 void tav_zoom_step (bool coarser);
320 /* stuff that AudioTimeAxisView and related classes use */
322 PlaylistSelector& playlist_selector() const;
323 void clear_playlist (boost::shared_ptr<ARDOUR::Playlist>);
325 void new_playlists (TimeAxisView* v);
326 void copy_playlists (TimeAxisView* v);
327 void clear_playlists (TimeAxisView* v);
329 TrackViewList* get_valid_views (TimeAxisView*, ARDOUR::RouteGroup* grp = 0);
330 void get_onscreen_tracks (TrackViewList&);
332 Width editor_mixer_strip_width;
333 void maybe_add_mixer_strip_width (XMLNode&);
334 void show_editor_mixer (bool yn);
335 void create_editor_mixer ();
336 void show_editor_list (bool yn);
337 void set_selected_mixer_strip (TimeAxisView&);
338 void hide_track_in_display (TimeAxisView& tv, bool temporary = false);
340 /* nudge is initiated by transport controls owned by ARDOUR_UI */
342 nframes64_t get_nudge_distance (nframes64_t pos, nframes64_t& next);
343 Evoral::MusicalTime get_grid_type_as_beats (bool& success, nframes64_t position);
345 void nudge_forward (bool next, bool force_playhead);
346 void nudge_backward (bool next, bool force_playhead);
348 /* nudge initiated from context menu */
350 void nudge_forward_capture_offset ();
351 void nudge_backward_capture_offset ();
353 /* playhead/screen stuff */
355 void set_follow_playhead (bool yn);
356 void toggle_follow_playhead ();
357 bool follow_playhead() const { return _follow_playhead; }
358 bool dragging_playhead () const { return _dragging_playhead; }
360 void toggle_zero_line_visibility ();
361 void toggle_waveforms_while_recording ();
363 void set_group_tabs ();
364 void toggle_measure_visibility ();
365 void toggle_logo_visibility ();
367 double get_physical_screen_width () const { return physical_screen_width; };
368 double physical_screen_width;
369 double physical_screen_height;
373 void toggle_selected_region_fades (int dir);
374 void update_region_fade_visibility ();
375 bool xfade_visibility() const { return _xfade_visibility; }
376 void update_xfade_visibility ();
378 /* redirect shared ops menu. caller must free returned menu */
380 Gtk::Menu* redirect_menu ();
382 /* floating windows/transient */
384 void ensure_float (Gtk::Window&);
388 void scroll_tracks_down_line ();
389 void scroll_tracks_up_line ();
391 bool new_regionviews_display_gain () { return _new_regionviews_show_envelope; }
392 void prepare_for_cleanup ();
393 void finish_cleanup ();
395 void maximise_editing_space();
396 void restore_editing_space();
398 void reset_x_origin (nframes64_t);
399 void reset_y_origin (double);
400 void reset_zoom (double);
401 void reposition_and_zoom (nframes64_t, double);
403 nframes64_t get_preferred_edit_position (bool ignore_playhead = false);
405 bool update_mouse_speed ();
406 bool decelerate_mouse_speed ();
408 void toggle_meter_updating();
410 void show_rhythm_ferret();
411 void show_bundle_manager ();
412 void show_global_port_matrix (ARDOUR::DataType);
414 void goto_visual_state (uint32_t);
415 void save_visual_state (uint32_t);
417 TrackViewList const & get_track_views () {
421 int get_regionview_count_from_region_list (boost::shared_ptr<ARDOUR::Region>);
423 void do_import (std::vector<Glib::ustring> paths, Editing::ImportDisposition, Editing::ImportMode mode, ARDOUR::SrcQuality, nframes64_t&);
424 void do_embed (std::vector<Glib::ustring> paths, Editing::ImportDisposition, Editing::ImportMode mode, nframes64_t&);
426 void get_regions_corresponding_to (boost::shared_ptr<ARDOUR::Region> region, std::vector<RegionView*>& regions);
428 void show_verbose_canvas_cursor_with (const std::string& txt);
429 void hide_verbose_canvas_cursor();
432 void map_transport_state ();
433 void map_position_change (nframes64_t);
439 void color_handler ();
441 ARDOUR::Session *session; ///< The session that we are editing, or 0
444 // to keep track of the playhead position for control_scroll
445 boost::optional<nframes64_t> _control_scroll_target;
447 PlaylistSelector* _playlist_selector;
449 typedef std::pair<TimeAxisView*,XMLNode*> TAVState;
453 double frames_per_unit;
454 nframes64_t leftmost_frame;
455 Editing::ZoomFocus zoom_focus;
456 std::list<TAVState> track_states;
459 std::list<VisualState*> undo_visual_stack;
460 std::list<VisualState*> redo_visual_stack;
461 VisualState* current_visual_state (bool with_tracks = true);
462 void undo_visual_state ();
463 void redo_visual_state ();
464 void use_visual_state (VisualState&);
466 void swap_visual_state ();
468 std::vector<VisualState*> visual_states;
469 sigc::connection visual_state_op_connection;
470 void start_visual_state_op (uint32_t n);
471 void cancel_visual_state_op (uint32_t n);
472 bool end_visual_state_op (uint32_t n);
474 nframes64_t leftmost_frame;
475 double frames_per_unit;
476 Editing::ZoomFocus zoom_focus;
478 void set_frames_per_unit (double);
481 Editing::MouseMode mouse_mode;
482 bool _internal_editing;
484 int post_maximal_editor_width;
485 int post_maximal_pane_position;
486 int pre_maximal_pane_position;
487 int pre_maximal_editor_width;
488 void pane_allocation_handler (Gtk::Allocation&, Gtk::Paned*);
490 Gtk::Notebook the_notebook;
491 Gtk::HPaned edit_pane;
493 Gtk::EventBox meter_base;
495 Gtk::EventBox marker_base;
496 Gtk::HBox marker_box;
497 Gtk::VBox scrollers_rulers_markers_box;
499 void location_changed (ARDOUR::Location *);
500 void location_flags_changed (ARDOUR::Location *, void *);
501 void refresh_location_display ();
502 void refresh_location_display_s (ARDOUR::Change);
503 void refresh_location_display_internal (ARDOUR::Locations::LocationList&);
504 void add_new_location (ARDOUR::Location *);
505 void location_gone (ARDOUR::Location *);
506 void remove_marker (ArdourCanvas::Item&, GdkEvent*);
507 gint really_remove_marker (ARDOUR::Location* loc);
508 void goto_nth_marker (int nth);
510 uint32_t location_marker_color;
511 uint32_t location_range_color;
512 uint32_t location_loop_color;
513 uint32_t location_punch_color;
514 uint32_t location_cd_marker_color;
516 struct LocationMarkers {
521 LocationMarkers () : start(0), end(0), valid (true) {}
527 void set_name (const std::string&);
528 void set_position (nframes64_t start, nframes64_t end = 0);
529 void set_color_rgba (uint32_t);
532 LocationMarkers *find_location_markers (ARDOUR::Location *) const;
533 ARDOUR::Location* find_location_from_marker (Marker *, bool& is_start) const;
534 Marker* entered_marker;
536 typedef std::map<ARDOUR::Location*,LocationMarkers *> LocationMarkerMap;
537 LocationMarkerMap location_markers;
539 void hide_marker (ArdourCanvas::Item*, GdkEvent*);
540 void clear_marker_display ();
541 void mouse_add_new_marker (nframes64_t where, bool is_cd=false, bool is_xrun=false);
542 bool choose_new_marker_name(std::string &name);
543 void update_cd_marker_display ();
544 void ensure_cd_marker_updated (LocationMarkers * lam, ARDOUR::Location * location);
546 TimeAxisView* clicked_axisview;
547 RouteTimeAxisView* clicked_routeview;
548 /** The last RegionView that was clicked on, or 0 if the last click was not
549 * on a RegionView. This is set up by the canvas event handlers in
550 * editor_canvas_events.cc
552 RegionView* clicked_regionview;
553 RegionSelection latest_regionviews;
554 uint32_t clicked_selection;
555 CrossfadeView* clicked_crossfadeview;
556 ControlPoint* clicked_control_point;
558 void sort_track_selection (TrackSelection* sel = 0);
560 void get_relevant_tracks (std::set<RouteTimeAxisView*>& relevant_tracks) const;
561 void get_equivalent_tracks (RouteTimeAxisView*, std::set<RouteTimeAxisView*> &, ARDOUR::RouteGroup::Property) const;
562 void get_equivalent_regions (RegionView* rv, std::vector<RegionView*> &, ARDOUR::RouteGroup::Property) const;
563 RegionSelection get_equivalent_regions (RegionSelection &, ARDOUR::RouteGroup::Property) const;
564 void mapover_tracks (sigc::slot<void,RouteTimeAxisView&,uint32_t> sl, TimeAxisView*, ARDOUR::RouteGroup::Property) const;
566 /* functions to be passed to mapover_tracks(), possibly with sigc::bind()-supplied arguments */
568 void mapped_get_equivalent_regions (RouteTimeAxisView&, uint32_t, RegionView *, std::vector<RegionView*>*) const;
569 void mapped_use_new_playlist (RouteTimeAxisView&, uint32_t, std::vector<boost::shared_ptr<ARDOUR::Playlist> > const &);
570 void mapped_use_copy_playlist (RouteTimeAxisView&, uint32_t, std::vector<boost::shared_ptr<ARDOUR::Playlist> > const &);
571 void mapped_clear_playlist (RouteTimeAxisView&, uint32_t);
575 void button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type);
576 bool button_release_can_deselect;
578 void catch_vanishing_regionview (RegionView *);
580 void set_selected_track (TimeAxisView&, Selection::Operation op = Selection::Set, bool no_remove=false);
581 void select_all_tracks ();
583 bool set_selected_control_point_from_click (Selection::Operation op = Selection::Set, bool no_remove=false);
584 void set_selected_track_from_click (bool press, Selection::Operation op = Selection::Set, bool no_remove=false);
585 void set_selected_track_as_side_effect (bool force = false);
586 bool set_selected_regionview_from_click (bool press, Selection::Operation op = Selection::Set, bool no_track_remove=false);
588 bool set_selected_regionview_from_map_event (GdkEventAny*, StreamView*, boost::weak_ptr<ARDOUR::Region>);
589 void collect_new_region_view (RegionView *);
590 void collect_and_select_new_region_view (RegionView *);
592 Gtk::Menu track_context_menu;
593 Gtk::Menu track_region_context_menu;
594 Gtk::Menu track_selection_context_menu;
595 Gtk::Menu track_crossfade_context_menu;
597 Gtk::MenuItem* region_edit_menu_split_item;
598 Gtk::MenuItem* region_edit_menu_split_multichannel_item;
599 Gtk::Menu * track_region_edit_playlist_menu;
600 Gtk::Menu * track_edit_playlist_submenu;
601 Gtk::Menu * track_selection_edit_playlist_submenu;
603 void popup_track_context_menu (int, int, ItemType, bool, nframes64_t);
604 Gtk::Menu* build_track_context_menu (nframes64_t);
605 Gtk::Menu* build_track_bus_context_menu (nframes64_t);
606 Gtk::Menu* build_track_region_context_menu (nframes64_t frame);
607 Gtk::Menu* build_track_crossfade_context_menu (nframes64_t);
608 Gtk::Menu* build_track_selection_context_menu (nframes64_t);
609 void add_dstream_context_items (Gtk::Menu_Helpers::MenuList&);
610 void add_bus_context_items (Gtk::Menu_Helpers::MenuList&);
611 void add_region_context_items (StreamView*, boost::shared_ptr<ARDOUR::Region>, Gtk::Menu_Helpers::MenuList&);
612 void add_crossfade_context_items (AudioStreamView*, boost::shared_ptr<ARDOUR::Crossfade>, Gtk::Menu_Helpers::MenuList&, bool many);
613 void add_selection_context_items (Gtk::Menu_Helpers::MenuList&);
615 void handle_new_route (ARDOUR::RouteList&);
616 void remove_route (TimeAxisView *);
619 Gtk::HBox global_hpacker;
620 Gtk::VBox global_vpacker;
623 Gdk::Cursor* current_canvas_cursor;
624 void set_canvas_cursor ();
625 Gdk::Cursor* which_grabber_cursor ();
627 ArdourCanvas::Canvas* track_canvas;
629 ArdourCanvas::Text* verbose_canvas_cursor;
630 bool verbose_cursor_visible;
632 void parameter_changed (std::string);
634 bool track_canvas_motion (GdkEvent*);
636 void set_verbose_canvas_cursor (const std::string &, double x, double y);
637 void set_verbose_canvas_cursor_text (const std::string &);
638 void show_verbose_canvas_cursor();
640 bool verbose_cursor_on; // so far unused
642 Gtk::EventBox time_canvas_event_box;
643 Gtk::EventBox track_canvas_event_box;
644 Gtk::EventBox time_button_event_box;
645 Gtk::EventBox ruler_label_event_box;
647 ArdourCanvas::Group *minsec_group;
648 ArdourCanvas::Pixbuf *logo_item;
649 ArdourCanvas::Group *bbt_group;
650 ArdourCanvas::Group *timecode_group;
651 ArdourCanvas::Group *frame_group;
652 ArdourCanvas::Group *tempo_group;
653 ArdourCanvas::Group *meter_group;
654 ArdourCanvas::Group *marker_group;
655 ArdourCanvas::Group *range_marker_group;
656 ArdourCanvas::Group *transport_marker_group;
657 ArdourCanvas::Group* cd_marker_group;
659 ArdourCanvas::Group* timebar_group;
661 /* These bars never need to be scrolled */
662 ArdourCanvas::Group* meter_bar_group;
663 ArdourCanvas::Group* tempo_bar_group;
664 ArdourCanvas::Group* marker_bar_group;
665 ArdourCanvas::Group* range_marker_bar_group;
666 ArdourCanvas::Group* transport_marker_bar_group;
667 ArdourCanvas::Group* cd_marker_bar_group;
669 /** The group containing all items that require horizontal scrolling. */
670 ArdourCanvas::Group* _background_group;
672 The _master_group is the group containing all items
673 that require horizontal scrolling..
674 It is primarily used to separate canvas items
675 that require horizontal scrolling from those that do not.
677 ArdourCanvas::Group* _master_group;
679 /* The group containing all trackviews. Only scrolled vertically. */
680 ArdourCanvas::Group* _trackview_group;
682 /* The group used for region motion. Sits on top of _trackview_group */
683 ArdourCanvas::Group* _region_motion_group;
686 ruler_metric_timecode = 0,
687 ruler_metric_bbt = 1,
688 ruler_metric_frames = 2,
689 ruler_metric_minsec = 3,
691 ruler_time_tempo = 4,
692 ruler_time_meter = 5,
693 ruler_time_marker = 6,
694 ruler_time_range_marker = 7,
695 ruler_time_transport_marker = 8,
696 ruler_time_cd_marker = 9,
699 static GtkCustomMetric ruler_metrics[4];
700 Glib::RefPtr<Gtk::ToggleAction> ruler_timecode_action;
701 Glib::RefPtr<Gtk::ToggleAction> ruler_bbt_action;
702 Glib::RefPtr<Gtk::ToggleAction> ruler_samples_action;
703 Glib::RefPtr<Gtk::ToggleAction> ruler_minsec_action;
704 Glib::RefPtr<Gtk::ToggleAction> ruler_tempo_action;
705 Glib::RefPtr<Gtk::ToggleAction> ruler_meter_action;
706 Glib::RefPtr<Gtk::ToggleAction> ruler_marker_action;
707 Glib::RefPtr<Gtk::ToggleAction> ruler_range_action;
708 Glib::RefPtr<Gtk::ToggleAction> ruler_loop_punch_action;
709 Glib::RefPtr<Gtk::ToggleAction> ruler_cd_marker_action;
710 bool no_ruler_shown_update;
712 gint ruler_button_press (GdkEventButton*);
713 gint ruler_button_release (GdkEventButton*);
714 gint ruler_mouse_motion (GdkEventMotion*);
715 bool ruler_scroll (GdkEventScroll* event);
717 Gtk::Widget * ruler_grabbed_widget;
719 void initialize_rulers ();
720 void update_just_timecode ();
721 void compute_fixed_ruler_scale (); //calculates the RulerScale of the fixed rulers
722 void update_fixed_rulers ();
723 void update_tempo_based_rulers ();
724 void popup_ruler_menu (nframes64_t where = 0, ItemType type = RegionItem);
725 void update_ruler_visibility ();
726 void set_ruler_visible (RulerType, bool);
727 void toggle_ruler_visibility (RulerType rt);
728 void ruler_toggled (int);
729 gint ruler_label_button_release (GdkEventButton*);
730 void store_ruler_visibility ();
731 void restore_ruler_visibility ();
733 static gint _metric_get_timecode (GtkCustomRulerMark **, gdouble, gdouble, gint);
734 static gint _metric_get_bbt (GtkCustomRulerMark **, gdouble, gdouble, gint);
735 static gint _metric_get_frames (GtkCustomRulerMark **, gdouble, gdouble, gint);
736 static gint _metric_get_minsec (GtkCustomRulerMark **, gdouble, gdouble, gint);
738 enum MinsecRulerScale {
745 MinsecRulerScale minsec_ruler_scale;
747 nframes_t minsec_mark_interval;
748 gint minsec_mark_modulo;
750 void set_minsec_ruler_scale (gdouble lower, gdouble upper);
752 enum TimecodeRulerScale {
754 timecode_show_frames,
755 timecode_show_seconds,
756 timecode_show_minutes,
760 TimecodeRulerScale timecode_ruler_scale;
762 nframes_t timecode_mark_interval;
763 gint timecode_mark_modulo;
764 gint timecode_nmarks;
765 void set_timecode_ruler_scale (gdouble lower, gdouble upper);
775 bbt_show_ticks_detail,
776 bbt_show_ticks_super_detail
779 BBTRulerScale bbt_ruler_scale;
783 uint32_t bbt_bar_helper_on;
784 uint32_t bbt_accent_modulo;
785 void compute_bbt_ruler_scale (nframes64_t lower, nframes64_t upper);
787 gint metric_get_timecode (GtkCustomRulerMark **, gdouble, gdouble, gint);
788 gint metric_get_bbt (GtkCustomRulerMark **, gdouble, gdouble, gint);
789 gint metric_get_frames (GtkCustomRulerMark **, gdouble, gdouble, gint);
790 gint metric_get_minsec (GtkCustomRulerMark **, gdouble, gdouble, gint);
792 Gtk::Widget *_ruler_separator;
793 GtkWidget *_timecode_ruler;
794 GtkWidget *_bbt_ruler;
795 GtkWidget *_frames_ruler;
796 GtkWidget *_minsec_ruler;
797 Gtk::Widget *timecode_ruler;
798 Gtk::Widget *bbt_ruler;
799 Gtk::Widget *frames_ruler;
800 Gtk::Widget *minsec_ruler;
801 static Editor *ruler_editor;
803 static const double timebar_height;
804 guint32 visible_timebars;
805 gdouble canvas_timebars_vsize;
806 gdouble get_canvas_timebars_vsize () const { return canvas_timebars_vsize; }
807 Gtk::Menu *editor_ruler_menu;
809 ArdourCanvas::SimpleRect* tempo_bar;
810 ArdourCanvas::SimpleRect* meter_bar;
811 ArdourCanvas::SimpleRect* marker_bar;
812 ArdourCanvas::SimpleRect* range_marker_bar;
813 ArdourCanvas::SimpleRect* transport_marker_bar;
814 ArdourCanvas::SimpleRect* cd_marker_bar;
816 Gtk::Label minsec_label;
817 Gtk::Label bbt_label;
818 Gtk::Label timecode_label;
819 Gtk::Label frame_label;
820 Gtk::Label tempo_label;
821 Gtk::Label meter_label;
822 Gtk::Label mark_label;
823 Gtk::Label range_mark_label;
824 Gtk::Label transport_mark_label;
825 Gtk::Label cd_mark_label;
827 Gtk::VBox time_button_vbox;
828 Gtk::HBox time_button_hbox;
830 friend class EditorCursor;
832 EditorCursor* playhead_cursor;
833 ArdourCanvas::Group* cursor_group;
835 nframes64_t get_region_boundary (nframes64_t pos, int32_t dir, bool with_selection, bool only_onscreen);
837 void cursor_to_region_boundary (bool with_selection, int32_t dir);
838 void cursor_to_next_region_boundary (bool with_selection);
839 void cursor_to_previous_region_boundary (bool with_selection);
840 void cursor_to_next_region_point (EditorCursor*, ARDOUR::RegionPoint);
841 void cursor_to_previous_region_point (EditorCursor*, ARDOUR::RegionPoint);
842 void cursor_to_region_point (EditorCursor*, ARDOUR::RegionPoint, int32_t dir);
843 void cursor_to_selection_start (EditorCursor *);
844 void cursor_to_selection_end (EditorCursor *);
846 void selected_marker_to_region_boundary (bool with_selection, int32_t dir);
847 void selected_marker_to_next_region_boundary (bool with_selection);
848 void selected_marker_to_previous_region_boundary (bool with_selection);
849 void selected_marker_to_next_region_point (ARDOUR::RegionPoint);
850 void selected_marker_to_previous_region_point (ARDOUR::RegionPoint);
851 void selected_marker_to_region_point (ARDOUR::RegionPoint, int32_t dir);
852 void selected_marker_to_selection_start ();
853 void selected_marker_to_selection_end ();
855 void select_all_selectables_using_cursor (EditorCursor *, bool);
856 void select_all_selectables_using_edit (bool);
857 void select_all_selectables_between (bool within);
858 void select_range_between ();
860 boost::shared_ptr<ARDOUR::Region> find_next_region (nframes64_t, ARDOUR::RegionPoint, int32_t dir, TrackViewList&, TimeAxisView ** = 0);
861 nframes64_t find_next_region_boundary (nframes64_t, int32_t dir, const TrackViewList&);
863 std::vector<nframes64_t> region_boundary_cache;
864 void build_region_boundary_cache ();
867 Gtk::HBox bottom_hbox;
869 Gtk::Table edit_packer;
870 Gtk::VScrollbar edit_vscrollbar;
872 Gtk::Adjustment vertical_adjustment;
873 Gtk::Adjustment horizontal_adjustment;
875 Gtk::Layout controls_layout;
876 bool control_layout_scroll (GdkEventScroll* ev);
877 void controls_layout_size_request (Gtk::Requisition*);
878 sigc::connection controls_layout_size_request_connection;
880 Gtk::HScrollbar edit_hscrollbar;
881 bool _dragging_hscrollbar;
883 void reset_hscrollbar_stepping ();
885 bool hscrollbar_button_press (GdkEventButton*);
886 bool hscrollbar_button_release (GdkEventButton*);
887 void hscrollbar_allocate (Gtk::Allocation &alloc);
889 double _canvas_width;
890 double _canvas_height;
891 double full_canvas_height;
893 bool track_canvas_map_handler (GdkEventAny*);
895 gint edit_controls_button_release (GdkEventButton*);
896 Gtk::Menu *edit_controls_left_menu;
897 Gtk::Menu *edit_controls_right_menu;
899 Gtk::VBox ruler_label_vbox;
900 Gtk::VBox track_canvas_vbox;
901 Gtk::VBox time_canvas_vbox;
902 Gtk::VBox edit_controls_vbox;
903 Gtk::HBox edit_controls_hbox;
905 void control_scroll (float);
906 void access_action (std::string,std::string);
907 bool deferred_control_scroll (nframes64_t);
908 sigc::connection control_scroll_connection;
910 gdouble get_trackview_group_vertical_offset () const { return vertical_adjustment.get_value () - canvas_timebars_vsize;}
912 ArdourCanvas::Group* get_background_group () const { return _background_group; }
913 ArdourCanvas::Group* get_trackview_group () const { return _trackview_group; }
914 double last_trackview_group_vertical_offset;
915 void tie_vertical_scrolling ();
916 void scroll_canvas_horizontally ();
917 void scroll_canvas_vertically ();
919 struct VisualChange {
927 nframes64_t time_origin;
928 double frames_per_unit;
933 VisualChange() : pending ((VisualChange::Type) 0), time_origin (0), frames_per_unit (0), idle_handler_id (-1) {}
935 pending = Type (pending | t);
940 VisualChange pending_visual_change;
942 static int _idle_visual_changer (void *arg);
943 int idle_visual_changer ();
945 void queue_visual_change (nframes64_t);
946 void queue_visual_change (double);
947 void queue_visual_change_y (double);
948 void ensure_visual_change_idle_handler ();
950 void end_location_changed (ARDOUR::Location*);
953 TrackViewList track_views;
954 std::pair<TimeAxisView*, ARDOUR::layer_t> trackview_by_y_position (double);
955 TimeAxisView* axis_view_from_route (ARDOUR::Route *) const;
956 TrackSelection axis_views_from_routes (std::list<ARDOUR::Route *>) const;
958 TrackSelection get_tracks_for_range_action () const;
960 static Gdk::Cursor* cross_hair_cursor;
961 static Gdk::Cursor* trimmer_cursor;
962 static Gdk::Cursor* selector_cursor;
963 static Gdk::Cursor* grabber_cursor;
964 static Gdk::Cursor* grabber_edit_point_cursor;
965 static Gdk::Cursor* zoom_cursor;
966 static Gdk::Cursor* time_fx_cursor;
967 static Gdk::Cursor* fader_cursor;
968 static Gdk::Cursor* speaker_cursor;
969 static Gdk::Cursor* midi_pencil_cursor;
970 static Gdk::Cursor* midi_select_cursor;
971 static Gdk::Cursor* midi_resize_cursor;
972 static Gdk::Cursor* midi_erase_cursor;
973 static Gdk::Cursor* wait_cursor;
974 static Gdk::Cursor* timebar_cursor;
975 static Gdk::Cursor* transparent_cursor;
977 static void build_cursors ();
979 sigc::connection scroll_connection;
980 nframes64_t last_update_frame;
981 void center_screen (nframes64_t);
982 void center_screen_internal (nframes64_t, float);
984 void update_current_screen ();
986 void session_going_away ();
988 nframes64_t cut_buffer_start;
989 nframes64_t cut_buffer_length;
991 bool typed_event (ArdourCanvas::Item*, GdkEvent*, ItemType);
992 bool button_press_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
993 bool button_press_handler_1 (ArdourCanvas::Item *, GdkEvent *, ItemType);
994 bool button_press_handler_2 (ArdourCanvas::Item *, GdkEvent *, ItemType);
995 bool button_release_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
996 bool motion_handler (ArdourCanvas::Item*, GdkEvent*, bool from_autoscroll = false);
997 bool enter_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
998 bool leave_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
1000 /* KEYMAP HANDLING */
1002 void register_actions ();
1004 int ensure_cursor (nframes64_t* pos);
1006 void cut_copy (Editing::CutCopyOp);
1007 bool can_cut_copy () const;
1008 void cut_copy_points (Editing::CutCopyOp);
1009 void cut_copy_regions (Editing::CutCopyOp, RegionSelection&);
1010 void cut_copy_ranges (Editing::CutCopyOp);
1011 void cut_copy_midi (Editing::CutCopyOp);
1013 void mouse_paste ();
1014 void paste_internal (nframes64_t position, float times);
1016 /* EDITING OPERATIONS */
1018 void reset_point_selection ();
1019 void toggle_region_mute ();
1020 void toggle_region_lock ();
1021 void toggle_region_opaque ();
1022 void toggle_record_enable ();
1023 void set_region_lock_style (ARDOUR::Region::PositionLockStyle);
1024 void raise_region ();
1025 void raise_region_to_top ();
1026 void lower_region ();
1027 void lower_region_to_bottom ();
1028 void split_regions_at (nframes64_t, RegionSelection&);
1029 void split_region_at_transients ();
1030 void split_region_at_points (boost::shared_ptr<ARDOUR::Region>, ARDOUR::AnalysisFeatureList&, bool can_ferret);
1031 void crop_region_to_selection ();
1032 void crop_region_to (nframes64_t start, nframes64_t end);
1033 void set_sync_point (nframes64_t, const RegionSelection&);
1034 void set_region_sync_from_edit_point ();
1035 void remove_region_sync();
1036 void align_selection (ARDOUR::RegionPoint, nframes64_t position, const RegionSelection&);
1037 void align_selection_relative (ARDOUR::RegionPoint point, nframes64_t position, const RegionSelection&);
1038 void align_region (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, nframes64_t position);
1039 void align_region_internal (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, nframes64_t position);
1040 void remove_selected_regions ();
1041 void remove_clicked_region ();
1042 void edit_region ();
1043 void show_midi_list_editor ();
1044 void rename_region ();
1045 void duplicate_some_regions (RegionSelection&, float times);
1046 void duplicate_selection (float times);
1047 void region_fill_selection ();
1049 void region_fill_track ();
1050 void audition_playlist_region_standalone (boost::shared_ptr<ARDOUR::Region>);
1051 void audition_playlist_region_via_route (boost::shared_ptr<ARDOUR::Region>, ARDOUR::Route&);
1052 void split_multichannel_region();
1053 void reverse_region ();
1054 void strip_region_silence ();
1055 void normalize_region ();
1056 double _last_normalization_value;
1057 void reset_region_scale_amplitude ();
1058 void adjust_region_scale_amplitude (bool up);
1059 void quantize_region ();
1061 void do_insert_time ();
1062 void insert_time (nframes64_t, nframes64_t, Editing::InsertTimeOption, bool, bool, bool);
1064 void tab_to_transient (bool forward);
1066 void use_region_as_bar ();
1067 void use_range_as_bar ();
1069 void define_one_bar (nframes64_t start, nframes64_t end);
1071 void audition_region_from_region_list ();
1072 void hide_region_from_region_list ();
1074 void align (ARDOUR::RegionPoint);
1075 void align_relative (ARDOUR::RegionPoint);
1078 void reset_focus ();
1084 void paste (float times);
1086 int get_prefix (float&, bool&);
1088 void keyboard_paste ();
1089 void keyboard_insert_region_list_selection ();
1091 void region_from_selection ();
1092 void create_region_from_selection (std::vector<boost::shared_ptr<ARDOUR::Region> >&);
1094 void play_from_start ();
1095 void play_from_edit_point ();
1096 void play_from_edit_point_and_return ();
1097 void play_selected_region ();
1098 void play_edit_range ();
1099 void loop_selected_region ();
1100 void play_location (ARDOUR::Location&);
1101 void loop_location (ARDOUR::Location&);
1103 void temporal_zoom_selection ();
1104 void temporal_zoom_region (bool both_axes);
1105 void zoom_to_region (bool both_axes);
1106 void temporal_zoom_session ();
1107 void temporal_zoom (gdouble scale);
1108 void temporal_zoom_by_frame (nframes64_t start, nframes64_t end, const std::string & op);
1109 void temporal_zoom_to_frame (bool coarser, nframes64_t frame);
1111 void amplitude_zoom (gdouble scale);
1112 void amplitude_zoom_step (bool in);
1114 void insert_region_list_drag (boost::shared_ptr<ARDOUR::Region>, int x, int y);
1115 void insert_region_list_selection (float times);
1117 void insert_route_list_drag (boost::shared_ptr<ARDOUR::Route>, int x, int y);
1119 /* import & embed */
1121 void add_external_audio_action (Editing::ImportMode);
1122 void external_audio_dialog ();
1123 void session_import_dialog ();
1125 int check_whether_and_how_to_import(std::string, bool all_or_nothing = true);
1126 bool check_multichannel_status (const std::vector<Glib::ustring>& paths);
1128 SoundFileOmega* sfbrowser;
1130 void bring_in_external_audio (Editing::ImportMode mode, nframes64_t& pos);
1132 bool idle_drop_paths (std::vector<Glib::ustring> paths, nframes64_t frame, double ypos);
1133 void drop_paths_part_two (const std::vector<Glib::ustring>& paths, nframes64_t frame, double ypos);
1135 int import_sndfiles (std::vector<Glib::ustring> paths, Editing::ImportMode mode, ARDOUR::SrcQuality, nframes64_t& pos,
1136 int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>, bool, uint32_t total);
1137 int embed_sndfiles (std::vector<Glib::ustring> paths, bool multiple_files, bool& check_sample_rate, Editing::ImportMode mode,
1138 nframes64_t& pos, int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>&);
1140 int add_sources (std::vector<Glib::ustring> paths, ARDOUR::SourceList& sources, nframes64_t& pos, Editing::ImportMode,
1141 int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>&, bool add_channel_suffix);
1142 int finish_bringing_in_material (boost::shared_ptr<ARDOUR::Region> region, uint32_t, uint32_t, nframes64_t& pos, Editing::ImportMode mode,
1143 boost::shared_ptr<ARDOUR::Track>& existing_track);
1145 boost::shared_ptr<ARDOUR::AudioTrack> get_nth_selected_audio_track (int nth) const;
1146 boost::shared_ptr<ARDOUR::MidiTrack> get_nth_selected_midi_track (int nth) const;
1148 /* generic interthread progress window */
1150 ArdourDialog* interthread_progress_window;
1151 Gtk::Label interthread_progress_label;
1152 Gtk::VBox interthread_progress_vbox;
1153 Gtk::ProgressBar interthread_progress_bar;
1154 Gtk::Button interthread_cancel_button;
1155 Gtk::Label interthread_cancel_label;
1156 sigc::connection interthread_progress_connection;
1157 void interthread_cancel_clicked ();
1158 void build_interthread_progress_window ();
1159 ARDOUR::InterThreadInfo* current_interthread_info;
1161 AnalysisWindow* analysis_window;
1163 /* import specific info */
1165 struct EditorImportStatus : public ARDOUR::ImportStatus {
1166 Editing::ImportMode mode;
1170 boost::shared_ptr<ARDOUR::Track> track;
1174 EditorImportStatus import_status;
1175 gint import_progress_timeout (void *);
1176 static void *_import_thread (void *);
1177 void* import_thread ();
1178 void finish_import ();
1180 /* to support this ... */
1182 void import_audio (bool as_tracks);
1183 void do_import (std::vector<Glib::ustring> paths, bool split, bool as_tracks);
1185 void move_to_start ();
1186 void move_to_end ();
1188 void center_playhead ();
1189 void center_edit_point ();
1190 void edit_cursor_backward ();
1191 void edit_cursor_forward ();
1192 void playhead_forward_to_grid ();
1193 void playhead_backward_to_grid ();
1194 void playhead_backward ();
1195 void playhead_forward ();
1196 void scroll_playhead (bool forward);
1197 void scroll_backward (float pages=0.8f);
1198 void scroll_forward (float pages=0.8f);
1199 void scroll_tracks_down ();
1200 void scroll_tracks_up ();
1201 void delete_sample_forward ();
1202 void delete_sample_backward ();
1203 void delete_screen ();
1204 void search_backwards ();
1205 void search_forwards ();
1207 void clear_markers ();
1208 void clear_ranges ();
1209 void clear_locations ();
1210 void unhide_markers ();
1211 void unhide_ranges ();
1212 void jump_forward_to_mark ();
1213 void jump_backward_to_mark ();
1214 void cursor_align (bool playhead_to_edit);
1216 void remove_last_capture ();
1217 void select_all_selectables_using_time_selection ();
1218 void select_all_selectables_using_loop();
1219 void select_all_selectables_using_punch();
1220 void set_selection_from_range (ARDOUR::Location&);
1221 void set_selection_from_punch ();
1222 void set_selection_from_loop ();
1223 void set_selection_from_region ();
1225 void add_location_mark (nframes64_t where);
1226 void add_location_from_audio_region ();
1227 void add_locations_from_audio_region ();
1228 void add_location_from_selection ();
1229 void set_loop_from_selection (bool play);
1230 void set_punch_from_selection ();
1231 void set_punch_from_region ();
1233 void set_loop_from_edit_range (bool play);
1234 void set_loop_from_region (bool play);
1235 void set_punch_from_edit_range ();
1237 void set_loop_range (nframes64_t start, nframes64_t end, std::string cmd);
1238 void set_punch_range (nframes64_t start, nframes64_t end, std::string cmd);
1240 void add_location_from_playhead_cursor ();
1241 bool select_new_marker;
1243 void reverse_selection ();
1244 void edit_envelope ();
1246 void start_scrolling ();
1247 void stop_scrolling ();
1249 double last_scrub_x;
1250 int scrubbing_direction;
1251 int scrub_reversals;
1252 int scrub_reverse_distance;
1255 void keyboard_selection_begin ();
1256 void keyboard_selection_finish (bool add);
1257 bool have_pending_keyboard_selection;
1258 nframes64_t pending_keyboard_selection_start;
1260 boost::shared_ptr<ARDOUR::Region> select_region_for_operation (int dir, TimeAxisView **tv);
1261 void extend_selection_to_end_of_region (bool next);
1262 void extend_selection_to_start_of_region (bool previous);
1264 Editing::SnapType _snap_type;
1265 Editing::SnapMode _snap_mode;
1267 /// Snap threshold in pixels
1268 double snap_threshold;
1270 bool ignore_gui_changes;
1276 Gtk::Menu fade_context_menu;
1277 void popup_fade_context_menu (int, int, ArdourCanvas::Item*, ItemType);
1279 void set_fade_in_shape (ARDOUR::AudioRegion::FadeShape);
1280 void set_fade_out_shape (ARDOUR::AudioRegion::FadeShape);
1282 void set_fade_length (bool in);
1283 void toggle_fade_active (bool in);
1284 void set_fade_in_active (bool);
1285 void set_fade_out_active (bool);
1287 std::set<boost::shared_ptr<ARDOUR::Playlist> > motion_frozen_playlists;
1288 RegionSelection pre_drag_region_selection;
1290 bool _dragging_playhead;
1291 bool _dragging_edit_point;
1293 void marker_drag_motion_callback (GdkEvent*);
1294 void marker_drag_finished_callback (GdkEvent*);
1296 gint mouse_rename_region (ArdourCanvas::Item*, GdkEvent*);
1298 void start_region_grab (ArdourCanvas::Item*, GdkEvent*, RegionView*);
1299 void start_create_region_grab (ArdourCanvas::Item*, GdkEvent*);
1300 void start_region_copy_grab (ArdourCanvas::Item*, GdkEvent*, RegionView*);
1301 void start_region_brush_grab (ArdourCanvas::Item*, GdkEvent*, RegionView*);
1302 void start_selection_grab (ArdourCanvas::Item*, GdkEvent*);
1304 void region_view_item_click (AudioRegionView&, GdkEventButton*);
1306 void remove_gain_control_point (ArdourCanvas::Item*, GdkEvent*);
1307 void remove_control_point (ArdourCanvas::Item*, GdkEvent*);
1309 void mouse_brush_insert_region (RegionView*, nframes64_t pos);
1310 void brush (nframes64_t);
1312 void show_verbose_time_cursor (nframes64_t frame, double offset = 0, double xpos=-1, double ypos=-1);
1313 void show_verbose_duration_cursor (nframes64_t start, nframes64_t end, double offset = 0, double xpos=-1, double ypos=-1);
1314 double clamp_verbose_cursor_x (double);
1315 double clamp_verbose_cursor_y (double);
1317 /* Canvas event handlers */
1319 bool canvas_control_point_event (GdkEvent* event,ArdourCanvas::Item*, ControlPoint*);
1320 bool canvas_line_event (GdkEvent* event,ArdourCanvas::Item*, AutomationLine*);
1321 bool canvas_selection_rect_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1322 bool canvas_selection_start_trim_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1323 bool canvas_selection_end_trim_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1324 bool canvas_crossfade_view_event (GdkEvent* event,ArdourCanvas::Item*, CrossfadeView*);
1325 bool canvas_fade_in_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1326 bool canvas_fade_in_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1327 bool canvas_fade_out_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1328 bool canvas_fade_out_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1331 // These variables are used to detect a feedback loop and break it to avoid a gui hang
1333 ArdourCanvas::Item *last_item_entered;
1334 int last_item_entered_n;
1337 bool canvas_region_view_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1338 bool canvas_frame_handle_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1339 bool canvas_region_view_name_highlight_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1340 bool canvas_region_view_name_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1341 bool canvas_stream_view_event (GdkEvent* event,ArdourCanvas::Item*, RouteTimeAxisView*);
1342 bool canvas_marker_event (GdkEvent* event,ArdourCanvas::Item*, Marker*);
1343 bool canvas_zoom_rect_event (GdkEvent* event,ArdourCanvas::Item*);
1344 bool canvas_tempo_marker_event (GdkEvent* event,ArdourCanvas::Item*, TempoMarker*);
1345 bool canvas_meter_marker_event (GdkEvent* event,ArdourCanvas::Item*, MeterMarker*);
1346 bool canvas_automation_track_event(GdkEvent* event, ArdourCanvas::Item*, AutomationTimeAxisView*) ;
1347 bool canvas_note_event (GdkEvent* event, ArdourCanvas::Item*);
1349 bool canvas_tempo_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1350 bool canvas_meter_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1351 bool canvas_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1352 bool canvas_range_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1353 bool canvas_transport_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1354 bool canvas_cd_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1356 bool canvas_imageframe_item_view_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1357 bool canvas_imageframe_view_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameTimeAxis*);
1358 bool canvas_imageframe_start_handle_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1359 bool canvas_imageframe_end_handle_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1360 bool canvas_marker_time_axis_view_event(GdkEvent* event, ArdourCanvas::Item*,MarkerTimeAxis*);
1361 bool canvas_markerview_item_view_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1362 bool canvas_markerview_start_handle_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1363 bool canvas_markerview_end_handle_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1365 /* non-public event handlers */
1367 bool canvas_playhead_cursor_event (GdkEvent* event, ArdourCanvas::Item*);
1368 bool track_canvas_scroll (GdkEventScroll* event);
1370 bool track_canvas_scroll_event (GdkEventScroll* event);
1371 bool track_canvas_button_press_event (GdkEventButton* event);
1372 bool track_canvas_button_release_event (GdkEventButton* event);
1373 bool track_canvas_motion_notify_event (GdkEventMotion* event);
1375 Gtk::Allocation canvas_allocation;
1376 void track_canvas_allocate (Gtk::Allocation alloc);
1377 bool track_canvas_size_allocated ();
1378 bool track_canvas_drag_motion (Glib::RefPtr<Gdk::DragContext> const &, int, int, guint);
1380 void set_playhead_cursor ();
1382 void kbd_driver (sigc::slot<void,GdkEvent*>, bool use_track_canvas = true, bool use_time_canvas = true, bool can_select = true);
1383 void kbd_mute_unmute_region ();
1386 void kbd_do_brush (GdkEvent*);
1387 void kbd_do_audition (GdkEvent*);
1389 void handle_new_duration ();
1390 void initialize_canvas ();
1392 /* display control */
1394 bool _show_measures;
1395 /// true if the editor should follow the playhead, otherwise false
1396 bool _follow_playhead;
1397 /// true if waveforms should be shown while recording audio tracks, otherwise false
1398 bool _show_waveforms_recording;
1400 ARDOUR::TempoMap::BBTPointList *current_bbt_points;
1402 TempoLines* tempo_lines;
1404 ArdourCanvas::Group* time_line_group;
1406 void hide_measures ();
1407 void draw_measures ();
1408 bool redraw_measures ();
1410 void new_tempo_section ();
1412 void mouse_add_new_tempo_event (nframes64_t where);
1413 void mouse_add_new_meter_event (nframes64_t where);
1415 void remove_tempo_marker (ArdourCanvas::Item*);
1416 void remove_meter_marker (ArdourCanvas::Item*);
1417 gint real_remove_tempo_marker (ARDOUR::TempoSection*);
1418 gint real_remove_meter_marker (ARDOUR::MeterSection*);
1420 void edit_tempo_section (ARDOUR::TempoSection*);
1421 void edit_meter_section (ARDOUR::MeterSection*);
1422 void edit_tempo_marker (ArdourCanvas::Item*);
1423 void edit_meter_marker (ArdourCanvas::Item*);
1424 void edit_control_point (ArdourCanvas::Item*);
1426 void marker_menu_edit ();
1427 void marker_menu_remove ();
1428 void marker_menu_rename ();
1429 void marker_menu_lock (bool yn);
1430 void marker_menu_hide ();
1431 void marker_menu_loop_range ();
1432 void marker_menu_select_all_selectables_using_range ();
1433 void marker_menu_select_using_range ();
1434 void marker_menu_separate_regions_using_location ();
1435 void marker_menu_play_from ();
1436 void marker_menu_play_range ();
1437 void marker_menu_set_playhead ();
1438 void marker_menu_set_from_playhead ();
1439 void marker_menu_set_from_selection ();
1440 void marker_menu_range_to_next ();
1441 void new_transport_marker_menu_set_loop ();
1442 void new_transport_marker_menu_set_punch ();
1443 void update_loop_range_view (bool visibility=false);
1444 void update_punch_range_view (bool visibility=false);
1445 void new_transport_marker_menu_popdown ();
1446 void marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1447 void tm_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1448 void transport_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1449 void new_transport_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1450 void build_range_marker_menu (bool loop_or_punch);
1451 void build_marker_menu (bool start_or_end);
1452 void build_tm_marker_menu ();
1453 void build_new_transport_marker_menu ();
1455 Gtk::Menu* tm_marker_menu;
1456 Gtk::Menu* marker_menu;
1457 Gtk::Menu* start_end_marker_menu;
1458 Gtk::Menu* range_marker_menu;
1459 Gtk::Menu* transport_marker_menu;
1460 Gtk::Menu* new_transport_marker_menu;
1461 Gtk::Menu* cd_marker_menu;
1462 ArdourCanvas::Item* marker_menu_item;
1464 typedef std::list<Marker*> Marks;
1467 void remove_metric_marks ();
1468 void draw_metric_marks (const ARDOUR::Metrics& metrics);
1470 void compute_current_bbt_points (nframes_t left, nframes_t right);
1471 void tempo_map_changed (ARDOUR::Change);
1472 void redisplay_tempo (bool immediate_redraw);
1474 void snap_to (nframes64_t& first, int32_t direction = 0, bool for_mark = false);
1475 void snap_to_with_modifier (nframes64_t& first, GdkEvent const *, int32_t direction = 0, bool for_mark = false);
1476 void snap_to (nframes64_t& first, nframes64_t& last, int32_t direction = 0, bool for_mark = false);
1478 uint32_t bbt_beat_subdivision;
1482 Gtk::ToggleButton editor_mixer_button;
1483 Gtk::ToggleButton editor_list_button;
1484 void editor_mixer_button_toggled ();
1485 void editor_list_button_toggled ();
1487 AudioClock zoom_range_clock;
1488 Gtk::Button zoom_in_button;
1489 Gtk::Button zoom_out_button;
1490 Gtk::Button zoom_out_full_button;
1491 Gtk::Button zoom_onetoone_button;
1493 Gtk::Button tav_expand_button;
1494 Gtk::Button tav_shrink_button;
1496 Gtk::VBox toolbar_clock_vbox;
1497 Gtk::VBox toolbar_selection_clock_vbox;
1498 Gtk::Table toolbar_selection_clock_table;
1499 Gtk::Label toolbar_selection_cursor_label;
1501 Gtk::HBox mouse_mode_button_box;
1502 Gtkmm2ext::TearOff* mouse_mode_tearoff;
1503 Gtk::ToggleButton mouse_select_button;
1504 Gtk::ToggleButton mouse_move_button;
1505 Gtk::ToggleButton mouse_gain_button;
1506 Gtk::ToggleButton mouse_zoom_button;
1507 Gtk::ToggleButton mouse_timefx_button;
1508 Gtk::ToggleButton mouse_audition_button;
1510 void mouse_mode_toggled (Editing::MouseMode m);
1511 bool ignore_mouse_mode_toggle;
1513 Gtk::ToggleButton internal_edit_button;
1514 void toggle_internal_editing ();
1516 gint mouse_select_button_release (GdkEventButton*);
1518 Gtk::VBox automation_box;
1519 Gtk::Button automation_mode_button;
1520 Gtk::ToggleButton global_automation_button;
1522 Gtk::ComboBoxText edit_mode_selector;
1523 Gtk::VBox edit_mode_box;
1525 void set_edit_mode (ARDOUR::EditMode);
1526 void cycle_edit_mode ();
1527 void edit_mode_selection_done ();
1529 Gtk::ComboBoxText snap_type_selector;
1530 Gtk::ComboBoxText snap_mode_selector;
1533 std::vector<std::string> snap_type_strings;
1534 std::vector<std::string> snap_mode_strings;
1536 void snap_type_selection_done ();
1537 void snap_mode_selection_done ();
1538 void snap_mode_chosen (Editing::SnapMode);
1539 void snap_type_chosen (Editing::SnapType);
1541 Glib::RefPtr<Gtk::RadioAction> snap_type_action (Editing::SnapType);
1542 Glib::RefPtr<Gtk::RadioAction> snap_mode_action (Editing::SnapMode);
1544 Gtk::ComboBoxText zoom_focus_selector;
1545 Gtk::VBox zoom_focus_box;
1547 std::vector<std::string> zoom_focus_strings;
1549 void zoom_focus_selection_done ();
1550 void zoom_focus_chosen (Editing::ZoomFocus);
1552 Glib::RefPtr<Gtk::RadioAction> zoom_focus_action (Editing::ZoomFocus);
1555 Gtk::HBox track_zoom_box;
1556 Gtk::VBox zoom_vbox;
1558 void zoom_adjustment_changed();
1560 void setup_toolbar ();
1562 Gtkmm2ext::TearOff* tools_tearoff;
1563 Gtk::HBox toolbar_hbox;
1564 Gtk::EventBox toolbar_base;
1565 Gtk::Frame toolbar_frame;
1569 Gtk::HBox panic_box;
1570 Gtk::Button midi_panic_button;
1571 Gtk::ToggleButton midi_sound_notes;
1573 bool sound_notes () const { return midi_sound_notes.get_active(); }
1575 void setup_midi_toolbar ();
1577 /* selection process */
1579 Selection* selection;
1580 Selection* cut_buffer;
1582 void time_selection_changed ();
1583 void track_selection_changed ();
1584 void region_selection_changed ();
1585 sigc::connection editor_regions_selection_changed_connection;
1586 void sensitize_the_right_region_actions (bool have_selected_regions);
1587 void point_selection_changed ();
1588 void marker_selection_changed ();
1590 void cancel_selection ();
1592 void region_selection_op (void (ARDOUR::Region::*pmf)(void));
1593 void region_selection_op (void (ARDOUR::Region::*pmf)(void*), void*);
1594 void region_selection_op (void (ARDOUR::Region::*pmf)(bool), bool);
1596 bool audio_region_selection_covers (nframes64_t where);
1598 /* transport range select process */
1600 ArdourCanvas::SimpleRect* cd_marker_bar_drag_rect;
1601 ArdourCanvas::SimpleRect* range_bar_drag_rect;
1602 ArdourCanvas::SimpleRect* transport_bar_drag_rect;
1605 ArdourCanvas::SimpleRect *bogus_background_rect;
1607 ArdourCanvas::SimpleRect *transport_bar_range_rect;
1608 ArdourCanvas::SimpleRect *transport_bar_preroll_rect;
1609 ArdourCanvas::SimpleRect *transport_bar_postroll_rect;
1610 ArdourCanvas::SimpleRect *transport_loop_range_rect;
1611 ArdourCanvas::SimpleRect *transport_punch_range_rect;
1612 ArdourCanvas::SimpleLine *transport_punchin_line;
1613 ArdourCanvas::SimpleLine *transport_punchout_line;
1614 ArdourCanvas::SimpleRect *transport_preroll_rect;
1615 ArdourCanvas::SimpleRect *transport_postroll_rect;
1617 ARDOUR::Location* transport_loop_location();
1618 ARDOUR::Location* transport_punch_location();
1620 ARDOUR::Location *temp_location;
1622 /* object rubberband select process */
1624 bool select_all_within (nframes64_t start, nframes64_t end, gdouble topy, gdouble boty, const TrackViewList&, Selection::Operation op);
1626 ArdourCanvas::SimpleRect *rubberband_rect;
1628 /* mouse zoom process */
1630 ArdourCanvas::SimpleRect *zoom_rect;
1631 void reposition_zoom_rect (nframes64_t start, nframes64_t end);
1633 EditorRouteGroups* _route_groups;
1634 EditorRoutes* _routes;
1635 EditorRegions* _regions;
1636 EditorSnapshots* _snapshots;
1637 EditorLocations* _locations;
1639 /* diskstream/route display management */
1640 Glib::RefPtr<Gdk::Pixbuf> rec_enabled_icon;
1641 Glib::RefPtr<Gdk::Pixbuf> rec_disabled_icon;
1643 Glib::RefPtr<Gtk::TreeSelection> route_display_selection;
1645 bool sync_track_view_list_and_routes ();
1647 Gtk::VBox list_vpacker;
1651 bool autoscroll_active;
1652 int autoscroll_timeout_tag;
1655 int last_autoscroll_x;
1656 int last_autoscroll_y;
1657 uint32_t autoscroll_cnt;
1658 nframes64_t autoscroll_x_distance;
1659 double autoscroll_y_distance;
1661 static gint _autoscroll_canvas (void *);
1662 bool autoscroll_canvas ();
1663 void start_canvas_autoscroll (int x, int y);
1664 void stop_canvas_autoscroll ();
1665 void maybe_autoscroll (GdkEventMotion*, bool);
1666 bool allow_vertical_scroll;
1669 void point_trim (GdkEvent*);
1670 void single_contents_trim (RegionView&, nframes64_t, bool, bool, bool);
1671 void single_start_trim (RegionView&, nframes64_t, bool, bool, bool);
1672 void single_end_trim (RegionView&, nframes64_t, bool, bool, bool);
1674 void thaw_region_after_trim (RegionView& rv);
1676 void trim_region_front();
1677 void trim_region_back();
1678 void trim_region (bool front);
1680 void trim_region_to_edit_point ();
1681 void trim_region_from_edit_point ();
1682 void trim_region_to_loop ();
1683 void trim_region_to_punch ();
1684 void trim_region_to_location (const ARDOUR::Location&, const char* cmd);
1686 void trim_to_region(bool forward);
1687 void trim_region_to_previous_region_end();
1688 void trim_region_to_next_region_start();
1690 bool show_gain_after_trim;
1694 int convert_drop_to_paths (
1695 std::vector<Glib::ustring>& paths,
1696 const Glib::RefPtr<Gdk::DragContext>& context,
1699 const Gtk::SelectionData& data,
1703 void track_canvas_drag_data_received (
1704 const Glib::RefPtr<Gdk::DragContext>& context,
1707 const Gtk::SelectionData& data,
1712 const Glib::RefPtr<Gdk::DragContext>& context,
1715 const Gtk::SelectionData& data,
1720 const Glib::RefPtr<Gdk::DragContext>& context,
1723 const Gtk::SelectionData& data,
1728 const Glib::RefPtr<Gdk::DragContext>& context,
1731 const Gtk::SelectionData& data,
1737 int write_region_selection(RegionSelection&);
1738 bool write_region (std::string path, boost::shared_ptr<ARDOUR::AudioRegion>);
1739 void bounce_region_selection ();
1740 void bounce_range_selection (bool replace, bool enable_processing);
1741 void external_edit_region ();
1743 int write_audio_selection (TimeSelection&);
1744 bool write_audio_range (ARDOUR::AudioPlaylist&, const ARDOUR::ChanCount& channels, std::list<ARDOUR::AudioRange>&);
1746 void write_selection ();
1748 XMLNode *before; /* used in *_reversible_command */
1750 void begin_reversible_command (std::string cmd_name);
1751 void commit_reversible_command ();
1753 void update_title ();
1754 void update_title_s (const std::string & snapshot_name);
1757 Selection* selection;
1758 double frames_per_unit;
1760 State (PublicEditor const * e);
1764 void store_state (State&) const;
1765 void restore_state (State *);
1767 void instant_save ();
1769 boost::shared_ptr<ARDOUR::AudioRegion> last_audition_region;
1771 /* freeze operations */
1773 ARDOUR::InterThreadInfo freeze_status;
1774 gint freeze_progress_timeout (void *);
1775 static void* _freeze_thread (void*);
1776 void* freeze_thread ();
1778 void freeze_route ();
1779 void unfreeze_route ();
1781 /* route-group solo + mute */
1783 void set_route_group_solo (ARDOUR::Route&, bool);
1784 void set_route_group_mute (ARDOUR::Route&, bool);
1788 void duplicate_dialog (bool with_dialog);
1790 nframes64_t event_frame (GdkEvent const *, double* px = 0, double* py = 0) const;
1792 /* returns false if mouse pointer is not in track or marker canvas
1794 bool mouse_frame (nframes64_t&, bool& in_track_canvas) const;
1796 /* "whats mine is yours" */
1798 TimeFXDialog* current_timefx;
1800 static void* timefx_thread (void *arg);
1801 void do_timefx (TimeFXDialog&);
1803 int time_stretch (RegionSelection&, float fraction);
1804 int pitch_shift (RegionSelection&, float cents);
1805 void pitch_shift_regions ();
1806 int time_fx (RegionSelection&, float val, bool pitching);
1808 /* editor-mixer strip */
1810 MixerStrip *current_mixer_strip;
1811 bool show_editor_mixer_when_tracks_arrive;
1812 Gtk::VBox current_mixer_strip_vbox;
1813 void cms_new (boost::shared_ptr<ARDOUR::Route>);
1814 void cms_deleted ();
1815 void current_mixer_strip_hidden ();
1816 void current_mixer_strip_removed ();
1818 void detach_tearoff (Gtk::Box* b, Gtk::Window* w);
1819 void reattach_tearoff (Gtk::Box* b, Gtk::Window* w, int32_t n);
1821 void ensure_all_elements_drawn ();
1823 /* nudging tracks */
1825 void nudge_track (bool use_edit_point, bool forwards);
1829 bool _xfade_visibility;
1832 void handle_new_imageframe_time_axis_view(const std::string & track_name, void* src) ;
1833 void handle_new_imageframe_marker_time_axis_view(const std::string & track_name, TimeAxisView* marked_track) ;
1835 void start_imageframe_grab(ArdourCanvas::Item*, GdkEvent*) ;
1836 void start_markerview_grab(ArdourCanvas::Item*, GdkEvent*) ;
1838 void imageframe_drag_motion_callback(ArdourCanvas::Item*, GdkEvent*) ;
1839 void markerview_drag_motion_callback(ArdourCanvas::Item*, GdkEvent*) ;
1840 void timeaxis_item_drag_finished_callback(ArdourCanvas::Item*, GdkEvent*) ;
1842 gint canvas_imageframe_item_view_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameView* ifv);
1843 gint canvas_imageframe_view_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameTimeAxis* ifta);
1844 gint canvas_imageframe_start_handle_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameView* ifv);
1845 gint canvas_imageframe_end_handle_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameView* ifv);
1847 gint canvas_marker_time_axis_view_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerTimeAxis* mta);
1848 gint canvas_markerview_item_view_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerView* mv);
1849 gint canvas_markerview_start_handle_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerView* mv);
1850 gint canvas_markerview_end_handle_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerView* mv);
1852 void imageframe_start_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1853 void imageframe_end_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1854 void imageframe_start_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1855 void imageframe_start_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1856 void imageframe_end_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1857 void imageframe_end_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1859 void markerview_item_start_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1860 void markerview_item_end_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1861 void markerview_start_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1862 void markerview_start_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1863 void markerview_end_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1864 void markerview_end_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1866 void popup_imageframe_edit_menu(int button, int32_t time, ArdourCanvas::Item* ifv, bool with_frame) ;
1867 void popup_marker_time_axis_edit_menu(int button, int32_t time, ArdourCanvas::Item* ifv, bool with_frame) ;
1869 ImageFrameSocketHandler* image_socket_listener ;
1872 void toggle_xfade_active (boost::weak_ptr<ARDOUR::Crossfade>);
1873 void toggle_xfade_length (boost::weak_ptr<ARDOUR::Crossfade>);
1874 void edit_xfade (boost::weak_ptr<ARDOUR::Crossfade>);
1875 void xfade_edit_left_region ();
1876 void xfade_edit_right_region ();
1878 static const int32_t default_width = 995;
1879 static const int32_t default_height = 765;
1883 Gtk::Button nudge_forward_button;
1884 Gtk::Button nudge_backward_button;
1885 Gtk::HBox nudge_hbox;
1886 Gtk::VBox nudge_vbox;
1887 AudioClock nudge_clock;
1889 bool nudge_forward_release (GdkEventButton*);
1890 bool nudge_backward_release (GdkEventButton*);
1894 void apply_filter (ARDOUR::Filter&, std::string cmd);
1896 Command* apply_midi_note_edit_op_to_region (ARDOUR::MidiOperator& op, MidiRegionView& mrv);
1897 void apply_midi_note_edit_op (ARDOUR::MidiOperator& op);
1899 /* handling cleanup */
1901 int playlist_deletion_dialog (boost::shared_ptr<ARDOUR::Playlist>);
1903 std::vector<sigc::connection> session_connections;
1905 /* tracking step changes of track height */
1907 TimeAxisView* current_stepping_trackview;
1908 ARDOUR::microseconds_t last_track_height_step_timestamp;
1909 gint track_height_step_timeout();
1910 sigc::connection step_timeout;
1912 TimeAxisView* entered_track;
1913 RegionView* entered_regionview;
1916 void ensure_entered_track_selected (bool op_acts_on_objects = false);
1917 bool clear_entered_track;
1918 bool left_track_canvas (GdkEventCrossing*);
1919 bool entered_track_canvas (GdkEventCrossing*);
1920 void set_entered_track (TimeAxisView*);
1921 void set_entered_regionview (RegionView*);
1922 void ensure_track_visible (TimeAxisView*);
1923 gint left_automation_track ();
1925 bool _new_regionviews_show_envelope;
1927 void reset_canvas_action_sensitivity (bool);
1928 void toggle_gain_envelope_visibility ();
1929 void toggle_gain_envelope_active ();
1930 void reset_region_gain_envelopes ();
1932 bool on_key_press_event (GdkEventKey*);
1933 bool on_key_release_event (GdkEventKey*);
1935 void session_state_saved (std::string);
1937 Glib::RefPtr<Gtk::Action> undo_action;
1938 Glib::RefPtr<Gtk::Action> redo_action;
1940 void history_changed ();
1942 Gtk::HBox status_bar_hpacker;
1944 Editing::EditPoint _edit_point;
1946 Gtk::ComboBoxText edit_point_selector;
1948 void set_edit_point_preference (Editing::EditPoint ep, bool force = false);
1949 void cycle_edit_point (bool with_marker);
1950 void set_edit_point ();
1951 void edit_point_selection_done ();
1952 void edit_point_chosen (Editing::EditPoint);
1953 Glib::RefPtr<Gtk::RadioAction> edit_point_action (Editing::EditPoint);
1954 std::vector<std::string> edit_point_strings;
1956 void selected_marker_moved (ARDOUR::Location*);
1958 bool get_edit_op_range (nframes64_t& start, nframes64_t& end) const;
1960 void get_regions_at (RegionSelection&, nframes64_t where, const TrackSelection& ts) const;
1961 void get_regions_after (RegionSelection&, nframes64_t where, const TrackSelection& ts) const;
1963 void get_regions_for_action (RegionSelection&, bool allow_entered = false, bool allow_edit_position = true);
1965 sigc::connection fast_screen_update_connection;
1966 gint start_updating ();
1967 gint stop_updating ();
1968 void fast_update_strips ();
1969 bool meters_running;
1971 void select_next_route ();
1972 void select_prev_route ();
1974 void snap_to_internal (nframes64_t& first, int32_t direction = 0, bool for_mark = false);
1975 void timecode_snap_to_internal (nframes64_t& first, int32_t direction = 0, bool for_mark = false);
1977 RhythmFerret* rhythm_ferret;
1978 BundleManager* _bundle_manager;
1979 GlobalPortMatrixWindow* _global_port_matrix[ARDOUR::DataType::num_types];
1981 void fit_tracks (TrackSelection &);
1982 void fit_selected_tracks ();
1983 void set_track_height (uint32_t h);
1985 void remove_tracks ();
1986 void toggle_tracks_active ();
1991 friend gboolean _idle_resize (gpointer);
1992 int32_t _pending_resize_amount;
1993 TimeAxisView* _pending_resize_view;
1995 void visible_order_range (int*, int*) const;
1998 bool _pending_locate_request;
2000 EditorSummary* _summary;
2001 void region_view_added (RegionView *);
2003 void update_canvas_now ();
2004 void streamview_height_changed ();
2006 EditorGroupTabs* _group_tabs;
2007 void fit_route_group (ARDOUR::RouteGroup *);
2009 void start_step_editing ();
2010 void stop_step_editing ();
2011 bool check_step_edit ();
2012 sigc::connection step_edit_connection;
2015 friend class RegionDrag;
2016 friend class RegionMoveDrag;
2017 friend class RegionSpliceDrag;
2018 friend class TrimDrag;
2019 friend class MeterMarkerDrag;
2020 friend class TempoMarkerDrag;
2021 friend class CursorDrag;
2022 friend class FadeInDrag;
2023 friend class FadeOutDrag;
2024 friend class MarkerDrag;
2025 friend class RegionGainDrag;
2026 friend class ControlPointDrag;
2027 friend class LineDrag;
2028 friend class RubberbandSelectDrag;
2029 friend class TimeFXDrag;
2030 friend class ScrubDrag;
2031 friend class SelectionDrag;
2032 friend class RangeMarkerBarDrag;
2033 friend class MouseZoomDrag;
2034 friend class RegionCreateDrag;
2035 friend class RegionMotionDrag;
2036 friend class RegionInsertDrag;
2038 friend class EditorSummary;
2039 friend class EditorGroupTabs;
2041 friend class EditorRoutes;
2044 #endif /* __ardour_editor_h__ */