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"
68 namespace Gnome { namespace Canvas {
77 class AudioDiskstream;
99 class AudioRegionView;
100 class AudioStreamView;
101 class AudioTimeAxisView;
102 class AutomationLine;
103 class AutomationSelection;
104 class AutomationTimeAxisView;
109 class GlobalPortMatrixWindow;
110 class GroupedButtons;
112 class MidiRegionView;
114 class PlaylistSelector;
115 class PluginSelector;
118 class SoundFileOmega;
124 class TrackSelection;
125 class EditorGroupTabs;
127 class EditorRouteGroups;
129 class EditorLocations;
130 class EditorSnapshots;
132 /* <CMT Additions> */
133 class ImageFrameView;
134 class ImageFrameTimeAxisView;
135 class ImageFrameTimeAxis;
136 class MarkerTimeAxis ;
138 class ImageFrameSocketHandler ;
139 class TimeAxisViewItem ;
140 /* </CMT Additions> */
142 struct EditorCursor {
144 ArdourCanvas::Points points;
145 ArdourCanvas::Line canvas_item;
146 nframes64_t current_frame;
149 EditorCursor (Editor&, bool (Editor::*)(GdkEvent*,ArdourCanvas::Item*));
152 void set_position (nframes64_t);
153 void set_length (double units);
154 void set_y_axis (double position);
156 sigc::signal<void, nframes64_t> PositionChanged;
159 class Editor : public PublicEditor
165 void connect_to_session (ARDOUR::Session *);
166 ARDOUR::Session* current_session() const { return session; }
168 virtual bool have_idled () const { return _have_idled; }
170 nframes64_t leftmost_position() const { return leftmost_frame; }
172 nframes64_t current_page_frames() const {
173 return (nframes64_t) floor (_canvas_width * frames_per_unit);
176 double canvas_height () const {
177 return _canvas_height;
180 void cycle_snap_mode ();
181 void cycle_snap_choice ();
182 void set_snap_to (Editing::SnapType);
183 void set_snap_mode (Editing::SnapMode);
184 void set_snap_threshold (double pixel_distance) {snap_threshold = pixel_distance;}
186 Editing::SnapMode snap_mode () const;
187 Editing::SnapType snap_type () const;
189 void undo (uint32_t n = 1);
190 void redo (uint32_t n = 1);
192 XMLNode& get_state ();
193 int set_state (const XMLNode&, int version);
195 void set_mouse_mode (Editing::MouseMode, bool force=true);
196 void step_mouse_mode (bool next);
197 Editing::MouseMode current_mouse_mode () const { return mouse_mode; }
198 Editing::MidiEditMode current_midi_edit_mode () const;
200 bool internal_editing() const { return _internal_editing ; }
201 void set_internal_edit (bool yn);
204 void add_imageframe_time_axis(const std::string & track_name, void*) ;
205 void add_imageframe_marker_time_axis(const std::string & track_name, TimeAxisView* marked_track, void*) ;
206 void connect_to_image_compositor() ;
207 void scroll_timeaxis_to_imageframe_item(const TimeAxisViewItem* item) ;
208 TimeAxisView* get_named_time_axis(const std::string & name) ;
209 #endif /* WITH_CMT */
211 void foreach_time_axis_view (sigc::slot<void,TimeAxisView&>);
212 void add_to_idle_resize (TimeAxisView*, int32_t);
214 RouteTimeAxisView* get_route_view_by_id (PBD::ID& id);
216 void consider_auditioning (boost::shared_ptr<ARDOUR::Region>);
217 void hide_a_region (boost::shared_ptr<ARDOUR::Region>);
218 void remove_a_region (boost::shared_ptr<ARDOUR::Region>);
220 #ifdef USE_RUBBERBAND
221 std::vector<std::string> rb_opt_strings;
224 /* option editor-access */
226 void set_show_waveforms_recording (bool yn);
227 bool show_waveforms_recording() const { return _show_waveforms_recording; }
229 /* things that need to be public to be used in the main menubar */
231 void new_region_from_selection ();
232 void separate_regions_between (const TimeSelection&);
233 void separate_region_from_selection ();
234 void separate_region_from_punch ();
235 void separate_region_from_loop ();
236 void separate_regions_using_location (ARDOUR::Location&);
237 void transition_to_rolling (bool forward);
241 nframes64_t unit_to_frame (double unit) const {
242 return (nframes64_t) rint (unit * frames_per_unit);
245 double frame_to_unit (nframes64_t frame) const {
246 return rint ((double) frame / (double) frames_per_unit);
249 double frame_to_unit (double frame) const {
250 return rint (frame / frames_per_unit);
253 /* NOTE: these functions assume that the "pixel" coordinate is
254 the result of using the world->canvas affine transform on a
255 world coordinate. These coordinates already take into
256 account any scrolling carried out by adjusting the
260 nframes64_t pixel_to_frame (double pixel) const {
262 /* pixel can be less than zero when motion events
263 are processed. since we've already run the world->canvas
264 affine, that means that the location *really* is "off
265 to the right" and thus really is "before the start".
269 return (nframes64_t) rint (pixel * frames_per_unit * GNOME_CANVAS(track_canvas->gobj())->pixels_per_unit);
275 gulong frame_to_pixel (nframes64_t frame) const {
276 return (gulong) rint ((frame / (frames_per_unit * GNOME_CANVAS(track_canvas->gobj())->pixels_per_unit)));
279 void flush_canvas ();
283 Selection& get_selection() const { return *selection; }
284 Selection& get_cut_buffer() const { return *cut_buffer; }
286 bool extend_selection_to_track (TimeAxisView&);
288 void play_selection ();
289 void select_all_in_track (Selection::Operation op);
290 void select_all (Selection::Operation op);
291 void invert_selection_in_track ();
292 void invert_selection ();
293 void deselect_all ();
295 void set_selected_regionview_from_region_list (boost::shared_ptr<ARDOUR::Region> region, Selection::Operation op = Selection::Set);
299 void set_show_measures (bool yn);
300 bool show_measures () const { return _show_measures; }
302 /* analysis window */
304 void analyze_region_selection();
305 void analyze_range_selection();
309 void export_audio ();
310 void export_selection ();
311 void export_range ();
312 void export_region ();
314 void add_toplevel_controls (Gtk::Container&);
315 Gtk::HBox& get_status_bar_packer() { return status_bar_hpacker; }
317 void set_zoom_focus (Editing::ZoomFocus);
318 Editing::ZoomFocus get_zoom_focus () const { return zoom_focus; }
319 double get_current_zoom () const { return frames_per_unit; }
321 void temporal_zoom_step (bool coarser);
322 void tav_zoom_step (bool coarser);
324 /* stuff that AudioTimeAxisView and related classes use */
326 PlaylistSelector& playlist_selector() const;
327 void clear_playlist (boost::shared_ptr<ARDOUR::Playlist>);
329 void new_playlists (TimeAxisView* v);
330 void copy_playlists (TimeAxisView* v);
331 void clear_playlists (TimeAxisView* v);
333 TrackViewList* get_valid_views (TimeAxisView*, ARDOUR::RouteGroup* grp = 0);
334 void get_onscreen_tracks (TrackViewList&);
336 Width editor_mixer_strip_width;
337 void maybe_add_mixer_strip_width (XMLNode&);
338 void show_editor_mixer (bool yn);
339 void create_editor_mixer ();
340 void show_editor_list (bool yn);
341 void set_selected_mixer_strip (TimeAxisView&);
342 void hide_track_in_display (TimeAxisView& tv, bool temporary = false);
344 /* nudge is initiated by transport controls owned by ARDOUR_UI */
346 nframes64_t get_nudge_distance (nframes64_t pos, nframes64_t& next);
347 Evoral::MusicalTime get_grid_type_as_beats (bool& success, nframes64_t position);
349 void nudge_forward (bool next, bool force_playhead);
350 void nudge_backward (bool next, bool force_playhead);
352 /* nudge initiated from context menu */
354 void nudge_forward_capture_offset ();
355 void nudge_backward_capture_offset ();
357 /* playhead/screen stuff */
359 void set_follow_playhead (bool yn);
360 void toggle_follow_playhead ();
361 bool follow_playhead() const { return _follow_playhead; }
362 bool dragging_playhead () const { return _dragging_playhead; }
364 void toggle_zero_line_visibility ();
365 void toggle_waveforms_while_recording ();
367 void set_group_tabs ();
368 void toggle_measure_visibility ();
369 void toggle_logo_visibility ();
371 double get_physical_screen_width () const { return physical_screen_width; };
372 double physical_screen_width;
373 double physical_screen_height;
377 void toggle_selected_region_fades (int dir);
378 void update_region_fade_visibility ();
379 bool xfade_visibility() const { return _xfade_visibility; }
380 void update_xfade_visibility ();
382 /* redirect shared ops menu. caller must free returned menu */
384 Gtk::Menu* redirect_menu ();
386 /* floating windows/transient */
388 void ensure_float (Gtk::Window&);
392 void scroll_tracks_down_line ();
393 void scroll_tracks_up_line ();
395 bool new_regionviews_display_gain () { return _new_regionviews_show_envelope; }
396 void prepare_for_cleanup ();
397 void finish_cleanup ();
399 void maximise_editing_space();
400 void restore_editing_space();
402 void reset_x_origin (nframes64_t);
403 void reset_y_origin (double);
404 void reset_zoom (double);
405 void reposition_and_zoom (nframes64_t, double);
407 nframes64_t get_preferred_edit_position (bool ignore_playhead = false);
409 bool update_mouse_speed ();
410 bool decelerate_mouse_speed ();
412 void toggle_meter_updating();
414 void show_rhythm_ferret();
415 void show_global_port_matrix (ARDOUR::DataType);
417 void goto_visual_state (uint32_t);
418 void save_visual_state (uint32_t);
420 TrackViewList const & get_track_views () {
424 int get_regionview_count_from_region_list (boost::shared_ptr<ARDOUR::Region>);
426 void do_import (std::vector<Glib::ustring> paths, Editing::ImportDisposition, Editing::ImportMode mode, ARDOUR::SrcQuality, nframes64_t&);
427 void do_embed (std::vector<Glib::ustring> paths, Editing::ImportDisposition, Editing::ImportMode mode, nframes64_t&);
429 void get_regions_corresponding_to (boost::shared_ptr<ARDOUR::Region> region, std::vector<RegionView*>& regions);
431 void show_verbose_canvas_cursor_with (const std::string& txt);
432 void hide_verbose_canvas_cursor();
434 void center_screen (nframes64_t);
437 void map_transport_state ();
438 void map_position_change (nframes64_t);
444 void color_handler ();
446 ARDOUR::Session *session; ///< The session that we are editing, or 0
449 // to keep track of the playhead position for control_scroll
450 boost::optional<nframes64_t> _control_scroll_target;
452 PlaylistSelector* _playlist_selector;
454 typedef std::pair<TimeAxisView*,XMLNode*> TAVState;
458 double frames_per_unit;
459 nframes64_t leftmost_frame;
460 Editing::ZoomFocus zoom_focus;
461 std::list<TAVState> track_states;
464 std::list<VisualState*> undo_visual_stack;
465 std::list<VisualState*> redo_visual_stack;
466 VisualState* current_visual_state (bool with_tracks = true);
467 void undo_visual_state ();
468 void redo_visual_state ();
469 void use_visual_state (VisualState&);
471 void swap_visual_state ();
473 std::vector<VisualState*> visual_states;
474 sigc::connection visual_state_op_connection;
475 void start_visual_state_op (uint32_t n);
476 void cancel_visual_state_op (uint32_t n);
477 bool end_visual_state_op (uint32_t n);
479 nframes64_t leftmost_frame;
480 double frames_per_unit;
481 Editing::ZoomFocus zoom_focus;
483 void set_frames_per_unit (double);
486 Editing::MouseMode mouse_mode;
487 bool _internal_editing;
489 int post_maximal_editor_width;
490 int post_maximal_pane_position;
491 int pre_maximal_pane_position;
492 int pre_maximal_editor_width;
493 void pane_allocation_handler (Gtk::Allocation&, Gtk::Paned*);
495 Gtk::Notebook the_notebook;
496 Gtk::HPaned edit_pane;
498 Gtk::EventBox meter_base;
500 Gtk::EventBox marker_base;
501 Gtk::HBox marker_box;
502 Gtk::VBox scrollers_rulers_markers_box;
504 void location_changed (ARDOUR::Location *);
505 void location_flags_changed (ARDOUR::Location *, void *);
506 void refresh_location_display ();
507 void refresh_location_display_s (ARDOUR::Change);
508 void refresh_location_display_internal (ARDOUR::Locations::LocationList&);
509 void add_new_location (ARDOUR::Location *);
510 void location_gone (ARDOUR::Location *);
511 void remove_marker (ArdourCanvas::Item&, GdkEvent*);
512 gint really_remove_marker (ARDOUR::Location* loc);
513 void goto_nth_marker (int nth);
515 uint32_t location_marker_color;
516 uint32_t location_range_color;
517 uint32_t location_loop_color;
518 uint32_t location_punch_color;
519 uint32_t location_cd_marker_color;
521 struct LocationMarkers {
526 LocationMarkers () : start(0), end(0), valid (true) {}
532 void set_name (const std::string&);
533 void set_position (nframes64_t start, nframes64_t end = 0);
534 void set_color_rgba (uint32_t);
537 LocationMarkers *find_location_markers (ARDOUR::Location *) const;
538 ARDOUR::Location* find_location_from_marker (Marker *, bool& is_start) const;
539 Marker* entered_marker;
541 typedef std::map<ARDOUR::Location*,LocationMarkers *> LocationMarkerMap;
542 LocationMarkerMap location_markers;
544 void hide_marker (ArdourCanvas::Item*, GdkEvent*);
545 void clear_marker_display ();
546 void mouse_add_new_marker (nframes64_t where, bool is_cd=false, bool is_xrun=false);
547 bool choose_new_marker_name(std::string &name);
548 void update_cd_marker_display ();
549 void ensure_cd_marker_updated (LocationMarkers * lam, ARDOUR::Location * location);
551 TimeAxisView* clicked_axisview;
552 RouteTimeAxisView* clicked_routeview;
553 /** The last RegionView that was clicked on, or 0 if the last click was not
554 * on a RegionView. This is set up by the canvas event handlers in
555 * editor_canvas_events.cc
557 RegionView* clicked_regionview;
558 RegionSelection latest_regionviews;
559 uint32_t clicked_selection;
560 CrossfadeView* clicked_crossfadeview;
561 ControlPoint* clicked_control_point;
563 void sort_track_selection (TrackSelection* sel = 0);
565 void get_relevant_tracks (std::set<RouteTimeAxisView*>& relevant_tracks) const;
566 void get_equivalent_tracks (RouteTimeAxisView*, std::set<RouteTimeAxisView*> &, ARDOUR::RouteGroup::Property) const;
567 void get_equivalent_regions (RegionView* rv, std::vector<RegionView*> &, ARDOUR::RouteGroup::Property) const;
568 RegionSelection get_equivalent_regions (RegionSelection &, ARDOUR::RouteGroup::Property) const;
569 void mapover_tracks (sigc::slot<void,RouteTimeAxisView&,uint32_t> sl, TimeAxisView*, ARDOUR::RouteGroup::Property) const;
571 /* functions to be passed to mapover_tracks(), possibly with sigc::bind()-supplied arguments */
573 void mapped_get_equivalent_regions (RouteTimeAxisView&, uint32_t, RegionView *, std::vector<RegionView*>*) const;
574 void mapped_use_new_playlist (RouteTimeAxisView&, uint32_t, std::vector<boost::shared_ptr<ARDOUR::Playlist> > const &);
575 void mapped_use_copy_playlist (RouteTimeAxisView&, uint32_t, std::vector<boost::shared_ptr<ARDOUR::Playlist> > const &);
576 void mapped_clear_playlist (RouteTimeAxisView&, uint32_t);
580 void button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type);
581 bool button_release_can_deselect;
583 void catch_vanishing_regionview (RegionView *);
585 void set_selected_track (TimeAxisView&, Selection::Operation op = Selection::Set, bool no_remove=false);
586 void select_all_tracks ();
588 bool set_selected_control_point_from_click (Selection::Operation op = Selection::Set, bool no_remove=false);
589 void set_selected_track_from_click (bool press, Selection::Operation op = Selection::Set, bool no_remove=false);
590 void set_selected_track_as_side_effect (bool force = false);
591 bool set_selected_regionview_from_click (bool press, Selection::Operation op = Selection::Set, bool no_track_remove=false);
593 bool set_selected_regionview_from_map_event (GdkEventAny*, StreamView*, boost::weak_ptr<ARDOUR::Region>);
594 void collect_new_region_view (RegionView *);
595 void collect_and_select_new_region_view (RegionView *);
597 Gtk::Menu track_context_menu;
598 Gtk::Menu track_region_context_menu;
599 Gtk::Menu track_selection_context_menu;
600 Gtk::Menu track_crossfade_context_menu;
602 Gtk::MenuItem* region_edit_menu_split_item;
603 Gtk::MenuItem* region_edit_menu_split_multichannel_item;
604 Gtk::Menu * track_region_edit_playlist_menu;
605 Gtk::Menu * track_edit_playlist_submenu;
606 Gtk::Menu * track_selection_edit_playlist_submenu;
608 void popup_track_context_menu (int, int, ItemType, bool, nframes64_t);
609 Gtk::Menu* build_track_context_menu (nframes64_t);
610 Gtk::Menu* build_track_bus_context_menu (nframes64_t);
611 Gtk::Menu* build_track_region_context_menu (nframes64_t frame);
612 Gtk::Menu* build_track_crossfade_context_menu (nframes64_t);
613 Gtk::Menu* build_track_selection_context_menu (nframes64_t);
614 void add_dstream_context_items (Gtk::Menu_Helpers::MenuList&);
615 void add_bus_context_items (Gtk::Menu_Helpers::MenuList&);
616 void add_region_context_items (StreamView*, boost::shared_ptr<ARDOUR::Region>, Gtk::Menu_Helpers::MenuList&);
617 void add_crossfade_context_items (AudioStreamView*, boost::shared_ptr<ARDOUR::Crossfade>, Gtk::Menu_Helpers::MenuList&, bool many);
618 void add_selection_context_items (Gtk::Menu_Helpers::MenuList&);
620 void handle_new_route (ARDOUR::RouteList&);
621 void remove_route (TimeAxisView *);
624 Gtk::HBox global_hpacker;
625 Gtk::VBox global_vpacker;
628 Gdk::Cursor* current_canvas_cursor;
629 void set_canvas_cursor ();
630 Gdk::Cursor* which_grabber_cursor ();
632 ArdourCanvas::Canvas* track_canvas;
634 ArdourCanvas::NoEventText* verbose_canvas_cursor;
635 bool verbose_cursor_visible;
637 void parameter_changed (std::string);
639 bool track_canvas_motion (GdkEvent*);
641 void set_verbose_canvas_cursor (const std::string &, double x, double y);
642 void set_verbose_canvas_cursor_text (const std::string &);
643 void show_verbose_canvas_cursor();
645 bool verbose_cursor_on; // so far unused
647 Gtk::EventBox time_canvas_event_box;
648 Gtk::EventBox track_canvas_event_box;
649 Gtk::EventBox time_button_event_box;
650 Gtk::EventBox ruler_label_event_box;
652 ArdourCanvas::Group *minsec_group;
653 ArdourCanvas::Pixbuf *logo_item;
654 ArdourCanvas::Group *bbt_group;
655 ArdourCanvas::Group *timecode_group;
656 ArdourCanvas::Group *frame_group;
657 ArdourCanvas::Group *tempo_group;
658 ArdourCanvas::Group *meter_group;
659 ArdourCanvas::Group *marker_group;
660 ArdourCanvas::Group *range_marker_group;
661 ArdourCanvas::Group *transport_marker_group;
662 ArdourCanvas::Group* cd_marker_group;
664 ArdourCanvas::Group* timebar_group;
666 /* These bars never need to be scrolled */
667 ArdourCanvas::Group* meter_bar_group;
668 ArdourCanvas::Group* tempo_bar_group;
669 ArdourCanvas::Group* marker_bar_group;
670 ArdourCanvas::Group* range_marker_bar_group;
671 ArdourCanvas::Group* transport_marker_bar_group;
672 ArdourCanvas::Group* cd_marker_bar_group;
674 /** The group containing all items that require horizontal scrolling. */
675 ArdourCanvas::Group* _background_group;
677 The _master_group is the group containing all items
678 that require horizontal scrolling..
679 It is primarily used to separate canvas items
680 that require horizontal scrolling from those that do not.
682 ArdourCanvas::Group* _master_group;
684 /* The group containing all trackviews. Only scrolled vertically. */
685 ArdourCanvas::Group* _trackview_group;
687 /* The group used for region motion. Sits on top of _trackview_group */
688 ArdourCanvas::Group* _region_motion_group;
691 ruler_metric_timecode = 0,
692 ruler_metric_bbt = 1,
693 ruler_metric_frames = 2,
694 ruler_metric_minsec = 3,
696 ruler_time_tempo = 4,
697 ruler_time_meter = 5,
698 ruler_time_marker = 6,
699 ruler_time_range_marker = 7,
700 ruler_time_transport_marker = 8,
701 ruler_time_cd_marker = 9,
704 static GtkCustomMetric ruler_metrics[4];
705 Glib::RefPtr<Gtk::ToggleAction> ruler_timecode_action;
706 Glib::RefPtr<Gtk::ToggleAction> ruler_bbt_action;
707 Glib::RefPtr<Gtk::ToggleAction> ruler_samples_action;
708 Glib::RefPtr<Gtk::ToggleAction> ruler_minsec_action;
709 Glib::RefPtr<Gtk::ToggleAction> ruler_tempo_action;
710 Glib::RefPtr<Gtk::ToggleAction> ruler_meter_action;
711 Glib::RefPtr<Gtk::ToggleAction> ruler_marker_action;
712 Glib::RefPtr<Gtk::ToggleAction> ruler_range_action;
713 Glib::RefPtr<Gtk::ToggleAction> ruler_loop_punch_action;
714 Glib::RefPtr<Gtk::ToggleAction> ruler_cd_marker_action;
715 bool no_ruler_shown_update;
717 gint ruler_button_press (GdkEventButton*);
718 gint ruler_button_release (GdkEventButton*);
719 gint ruler_mouse_motion (GdkEventMotion*);
720 bool ruler_scroll (GdkEventScroll* event);
722 Gtk::Widget * ruler_grabbed_widget;
724 void initialize_rulers ();
725 void update_just_timecode ();
726 void compute_fixed_ruler_scale (); //calculates the RulerScale of the fixed rulers
727 void update_fixed_rulers ();
728 void update_tempo_based_rulers ();
729 void popup_ruler_menu (nframes64_t where = 0, ItemType type = RegionItem);
730 void update_ruler_visibility ();
731 void set_ruler_visible (RulerType, bool);
732 void toggle_ruler_visibility (RulerType rt);
733 void ruler_toggled (int);
734 gint ruler_label_button_release (GdkEventButton*);
735 void store_ruler_visibility ();
736 void restore_ruler_visibility ();
738 static gint _metric_get_timecode (GtkCustomRulerMark **, gdouble, gdouble, gint);
739 static gint _metric_get_bbt (GtkCustomRulerMark **, gdouble, gdouble, gint);
740 static gint _metric_get_frames (GtkCustomRulerMark **, gdouble, gdouble, gint);
741 static gint _metric_get_minsec (GtkCustomRulerMark **, gdouble, gdouble, gint);
743 enum MinsecRulerScale {
750 MinsecRulerScale minsec_ruler_scale;
752 nframes_t minsec_mark_interval;
753 gint minsec_mark_modulo;
755 void set_minsec_ruler_scale (gdouble lower, gdouble upper);
757 enum TimecodeRulerScale {
759 timecode_show_frames,
760 timecode_show_seconds,
761 timecode_show_minutes,
765 TimecodeRulerScale timecode_ruler_scale;
767 nframes_t timecode_mark_interval;
768 gint timecode_mark_modulo;
769 gint timecode_nmarks;
770 void set_timecode_ruler_scale (gdouble lower, gdouble upper);
780 bbt_show_ticks_detail,
781 bbt_show_ticks_super_detail
784 BBTRulerScale bbt_ruler_scale;
788 uint32_t bbt_bar_helper_on;
789 uint32_t bbt_accent_modulo;
790 void compute_bbt_ruler_scale (nframes64_t lower, nframes64_t upper);
792 gint metric_get_timecode (GtkCustomRulerMark **, gdouble, gdouble, gint);
793 gint metric_get_bbt (GtkCustomRulerMark **, gdouble, gdouble, gint);
794 gint metric_get_frames (GtkCustomRulerMark **, gdouble, gdouble, gint);
795 gint metric_get_minsec (GtkCustomRulerMark **, gdouble, gdouble, gint);
797 Gtk::Widget *_ruler_separator;
798 GtkWidget *_timecode_ruler;
799 GtkWidget *_bbt_ruler;
800 GtkWidget *_frames_ruler;
801 GtkWidget *_minsec_ruler;
802 Gtk::Widget *timecode_ruler;
803 Gtk::Widget *bbt_ruler;
804 Gtk::Widget *frames_ruler;
805 Gtk::Widget *minsec_ruler;
806 static Editor *ruler_editor;
808 static const double timebar_height;
809 guint32 visible_timebars;
810 gdouble canvas_timebars_vsize;
811 gdouble get_canvas_timebars_vsize () const { return canvas_timebars_vsize; }
812 Gtk::Menu *editor_ruler_menu;
814 ArdourCanvas::SimpleRect* tempo_bar;
815 ArdourCanvas::SimpleRect* meter_bar;
816 ArdourCanvas::SimpleRect* marker_bar;
817 ArdourCanvas::SimpleRect* range_marker_bar;
818 ArdourCanvas::SimpleRect* transport_marker_bar;
819 ArdourCanvas::SimpleRect* cd_marker_bar;
821 Gtk::Label minsec_label;
822 Gtk::Label bbt_label;
823 Gtk::Label timecode_label;
824 Gtk::Label frame_label;
825 Gtk::Label tempo_label;
826 Gtk::Label meter_label;
827 Gtk::Label mark_label;
828 Gtk::Label range_mark_label;
829 Gtk::Label transport_mark_label;
830 Gtk::Label cd_mark_label;
832 Gtk::VBox time_button_vbox;
833 Gtk::HBox time_button_hbox;
835 friend class EditorCursor;
837 EditorCursor* playhead_cursor;
838 ArdourCanvas::Group* cursor_group;
840 nframes64_t get_region_boundary (nframes64_t pos, int32_t dir, bool with_selection, bool only_onscreen);
842 void cursor_to_region_boundary (bool with_selection, int32_t dir);
843 void cursor_to_next_region_boundary (bool with_selection);
844 void cursor_to_previous_region_boundary (bool with_selection);
845 void cursor_to_next_region_point (EditorCursor*, ARDOUR::RegionPoint);
846 void cursor_to_previous_region_point (EditorCursor*, ARDOUR::RegionPoint);
847 void cursor_to_region_point (EditorCursor*, ARDOUR::RegionPoint, int32_t dir);
848 void cursor_to_selection_start (EditorCursor *);
849 void cursor_to_selection_end (EditorCursor *);
851 void selected_marker_to_region_boundary (bool with_selection, int32_t dir);
852 void selected_marker_to_next_region_boundary (bool with_selection);
853 void selected_marker_to_previous_region_boundary (bool with_selection);
854 void selected_marker_to_next_region_point (ARDOUR::RegionPoint);
855 void selected_marker_to_previous_region_point (ARDOUR::RegionPoint);
856 void selected_marker_to_region_point (ARDOUR::RegionPoint, int32_t dir);
857 void selected_marker_to_selection_start ();
858 void selected_marker_to_selection_end ();
860 void select_all_selectables_using_cursor (EditorCursor *, bool);
861 void select_all_selectables_using_edit (bool);
862 void select_all_selectables_between (bool within);
863 void select_range_between ();
865 boost::shared_ptr<ARDOUR::Region> find_next_region (nframes64_t, ARDOUR::RegionPoint, int32_t dir, TrackViewList&, TimeAxisView ** = 0);
866 nframes64_t find_next_region_boundary (nframes64_t, int32_t dir, const TrackViewList&);
868 std::vector<nframes64_t> region_boundary_cache;
869 void build_region_boundary_cache ();
872 Gtk::HBox bottom_hbox;
874 Gtk::Table edit_packer;
875 Gtk::VScrollbar edit_vscrollbar;
877 Gtk::Adjustment vertical_adjustment;
878 Gtk::Adjustment horizontal_adjustment;
880 Gtk::Layout controls_layout;
881 bool control_layout_scroll (GdkEventScroll* ev);
882 void controls_layout_size_request (Gtk::Requisition*);
883 sigc::connection controls_layout_size_request_connection;
885 Gtk::HScrollbar edit_hscrollbar;
886 bool _dragging_hscrollbar;
888 void reset_hscrollbar_stepping ();
890 bool hscrollbar_button_press (GdkEventButton*);
891 bool hscrollbar_button_release (GdkEventButton*);
892 void hscrollbar_allocate (Gtk::Allocation &alloc);
894 double _canvas_width;
895 double _canvas_height;
896 double full_canvas_height;
898 bool track_canvas_map_handler (GdkEventAny*);
900 gint edit_controls_button_release (GdkEventButton*);
901 Gtk::Menu *edit_controls_left_menu;
902 Gtk::Menu *edit_controls_right_menu;
904 Gtk::VBox ruler_label_vbox;
905 Gtk::VBox track_canvas_vbox;
906 Gtk::VBox time_canvas_vbox;
907 Gtk::VBox edit_controls_vbox;
908 Gtk::HBox edit_controls_hbox;
910 void control_scroll (float);
911 void access_action (std::string,std::string);
912 bool deferred_control_scroll (nframes64_t);
913 sigc::connection control_scroll_connection;
915 gdouble get_trackview_group_vertical_offset () const { return vertical_adjustment.get_value () - canvas_timebars_vsize;}
917 ArdourCanvas::Group* get_background_group () const { return _background_group; }
918 ArdourCanvas::Group* get_trackview_group () const { return _trackview_group; }
919 double last_trackview_group_vertical_offset;
920 void tie_vertical_scrolling ();
921 void scroll_canvas_horizontally ();
922 void scroll_canvas_vertically ();
924 struct VisualChange {
932 nframes64_t time_origin;
933 double frames_per_unit;
938 VisualChange() : pending ((VisualChange::Type) 0), time_origin (0), frames_per_unit (0), idle_handler_id (-1) {}
940 pending = Type (pending | t);
945 VisualChange pending_visual_change;
947 static int _idle_visual_changer (void *arg);
948 int idle_visual_changer ();
950 void queue_visual_change (nframes64_t);
951 void queue_visual_change (double);
952 void queue_visual_change_y (double);
953 void ensure_visual_change_idle_handler ();
955 void end_location_changed (ARDOUR::Location*);
958 TrackViewList track_views;
959 std::pair<TimeAxisView*, ARDOUR::layer_t> trackview_by_y_position (double);
960 TimeAxisView* axis_view_from_route (ARDOUR::Route *) const;
961 TrackSelection axis_views_from_routes (std::list<ARDOUR::Route *>) const;
963 TrackSelection get_tracks_for_range_action () const;
965 static Gdk::Cursor* cross_hair_cursor;
966 static Gdk::Cursor* trimmer_cursor;
967 static Gdk::Cursor* selector_cursor;
968 static Gdk::Cursor* grabber_cursor;
969 static Gdk::Cursor* grabber_edit_point_cursor;
970 static Gdk::Cursor* zoom_cursor;
971 static Gdk::Cursor* time_fx_cursor;
972 static Gdk::Cursor* fader_cursor;
973 static Gdk::Cursor* speaker_cursor;
974 static Gdk::Cursor* midi_pencil_cursor;
975 static Gdk::Cursor* midi_select_cursor;
976 static Gdk::Cursor* midi_resize_cursor;
977 static Gdk::Cursor* midi_erase_cursor;
978 static Gdk::Cursor* wait_cursor;
979 static Gdk::Cursor* timebar_cursor;
980 static Gdk::Cursor* transparent_cursor;
982 static void build_cursors ();
984 sigc::connection scroll_connection;
985 nframes64_t last_update_frame;
986 void center_screen_internal (nframes64_t, float);
988 void update_current_screen ();
990 void session_going_away ();
992 nframes64_t cut_buffer_start;
993 nframes64_t cut_buffer_length;
995 bool typed_event (ArdourCanvas::Item*, GdkEvent*, ItemType);
996 bool button_press_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
997 bool button_press_handler_1 (ArdourCanvas::Item *, GdkEvent *, ItemType);
998 bool button_press_handler_2 (ArdourCanvas::Item *, GdkEvent *, ItemType);
999 bool button_release_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
1000 bool motion_handler (ArdourCanvas::Item*, GdkEvent*, bool from_autoscroll = false);
1001 bool enter_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
1002 bool leave_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
1004 /* KEYMAP HANDLING */
1006 void register_actions ();
1008 int ensure_cursor (nframes64_t* pos);
1010 void cut_copy (Editing::CutCopyOp);
1011 bool can_cut_copy () const;
1012 void cut_copy_points (Editing::CutCopyOp);
1013 void cut_copy_regions (Editing::CutCopyOp, RegionSelection&);
1014 void cut_copy_ranges (Editing::CutCopyOp);
1015 void cut_copy_midi (Editing::CutCopyOp);
1017 void mouse_paste ();
1018 void paste_internal (nframes64_t position, float times);
1020 /* EDITING OPERATIONS */
1022 void reset_point_selection ();
1023 void toggle_region_mute ();
1024 void toggle_region_lock ();
1025 void toggle_region_opaque ();
1026 void toggle_record_enable ();
1027 void set_region_lock_style (ARDOUR::Region::PositionLockStyle);
1028 void raise_region ();
1029 void raise_region_to_top ();
1030 void lower_region ();
1031 void lower_region_to_bottom ();
1032 void split_regions_at (nframes64_t, RegionSelection&);
1033 void split_region_at_transients ();
1034 void split_region_at_points (boost::shared_ptr<ARDOUR::Region>, ARDOUR::AnalysisFeatureList&, bool can_ferret);
1035 void crop_region_to_selection ();
1036 void crop_region_to (nframes64_t start, nframes64_t end);
1037 void set_sync_point (nframes64_t, const RegionSelection&);
1038 void set_region_sync_from_edit_point ();
1039 void remove_region_sync();
1040 void align_selection (ARDOUR::RegionPoint, nframes64_t position, const RegionSelection&);
1041 void align_selection_relative (ARDOUR::RegionPoint point, nframes64_t position, const RegionSelection&);
1042 void align_region (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, nframes64_t position);
1043 void align_region_internal (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, nframes64_t position);
1044 void remove_selected_regions ();
1045 void remove_clicked_region ();
1046 void edit_region ();
1047 void show_midi_list_editor ();
1048 void rename_region ();
1049 void duplicate_some_regions (RegionSelection&, float times);
1050 void duplicate_selection (float times);
1051 void region_fill_selection ();
1053 void region_fill_track ();
1054 void audition_playlist_region_standalone (boost::shared_ptr<ARDOUR::Region>);
1055 void audition_playlist_region_via_route (boost::shared_ptr<ARDOUR::Region>, ARDOUR::Route&);
1056 void split_multichannel_region();
1057 void reverse_region ();
1058 void strip_region_silence ();
1059 void normalize_region ();
1060 double _last_normalization_value;
1061 void reset_region_scale_amplitude ();
1062 void adjust_region_scale_amplitude (bool up);
1063 void quantize_region ();
1065 void do_insert_time ();
1066 void insert_time (nframes64_t, nframes64_t, Editing::InsertTimeOption, bool, bool, bool);
1068 void tab_to_transient (bool forward);
1070 void use_region_as_bar ();
1071 void use_range_as_bar ();
1073 void define_one_bar (nframes64_t start, nframes64_t end);
1075 void audition_region_from_region_list ();
1076 void hide_region_from_region_list ();
1078 void align (ARDOUR::RegionPoint);
1079 void align_relative (ARDOUR::RegionPoint);
1082 void reset_focus ();
1088 void paste (float times);
1090 int get_prefix (float&, bool&);
1092 void keyboard_paste ();
1093 void keyboard_insert_region_list_selection ();
1095 void region_from_selection ();
1096 void create_region_from_selection (std::vector<boost::shared_ptr<ARDOUR::Region> >&);
1098 void play_from_start ();
1099 void play_from_edit_point ();
1100 void play_from_edit_point_and_return ();
1101 void play_selected_region ();
1102 void play_edit_range ();
1103 void loop_selected_region ();
1104 void play_location (ARDOUR::Location&);
1105 void loop_location (ARDOUR::Location&);
1107 void temporal_zoom_selection ();
1108 void temporal_zoom_region (bool both_axes);
1109 void zoom_to_region (bool both_axes);
1110 void temporal_zoom_session ();
1111 void temporal_zoom (gdouble scale);
1112 void temporal_zoom_by_frame (nframes64_t start, nframes64_t end, const std::string & op);
1113 void temporal_zoom_to_frame (bool coarser, nframes64_t frame);
1115 void amplitude_zoom (gdouble scale);
1116 void amplitude_zoom_step (bool in);
1118 void insert_region_list_drag (boost::shared_ptr<ARDOUR::Region>, int x, int y);
1119 void insert_region_list_selection (float times);
1121 void insert_route_list_drag (boost::shared_ptr<ARDOUR::Route>, int x, int y);
1123 /* import & embed */
1125 void add_external_audio_action (Editing::ImportMode);
1126 void external_audio_dialog ();
1127 void session_import_dialog ();
1129 int check_whether_and_how_to_import(std::string, bool all_or_nothing = true);
1130 bool check_multichannel_status (const std::vector<Glib::ustring>& paths);
1132 SoundFileOmega* sfbrowser;
1134 void bring_in_external_audio (Editing::ImportMode mode, nframes64_t& pos);
1136 bool idle_drop_paths (std::vector<Glib::ustring> paths, nframes64_t frame, double ypos);
1137 void drop_paths_part_two (const std::vector<Glib::ustring>& paths, nframes64_t frame, double ypos);
1139 int import_sndfiles (std::vector<Glib::ustring> paths, Editing::ImportMode mode, ARDOUR::SrcQuality, nframes64_t& pos,
1140 int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>, bool, uint32_t total);
1141 int embed_sndfiles (std::vector<Glib::ustring> paths, bool multiple_files, bool& check_sample_rate, Editing::ImportMode mode,
1142 nframes64_t& pos, int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>&);
1144 int add_sources (std::vector<Glib::ustring> paths, ARDOUR::SourceList& sources, nframes64_t& pos, Editing::ImportMode,
1145 int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>&, bool add_channel_suffix);
1146 int finish_bringing_in_material (boost::shared_ptr<ARDOUR::Region> region, uint32_t, uint32_t, nframes64_t& pos, Editing::ImportMode mode,
1147 boost::shared_ptr<ARDOUR::Track>& existing_track);
1149 boost::shared_ptr<ARDOUR::AudioTrack> get_nth_selected_audio_track (int nth) const;
1150 boost::shared_ptr<ARDOUR::MidiTrack> get_nth_selected_midi_track (int nth) const;
1152 /* generic interthread progress window */
1154 ArdourDialog* interthread_progress_window;
1155 Gtk::Label interthread_progress_label;
1156 Gtk::VBox interthread_progress_vbox;
1157 Gtk::ProgressBar interthread_progress_bar;
1158 Gtk::Button interthread_cancel_button;
1159 Gtk::Label interthread_cancel_label;
1160 sigc::connection interthread_progress_connection;
1161 void interthread_cancel_clicked ();
1162 void build_interthread_progress_window ();
1163 ARDOUR::InterThreadInfo* current_interthread_info;
1165 AnalysisWindow* analysis_window;
1167 /* import specific info */
1169 struct EditorImportStatus : public ARDOUR::ImportStatus {
1170 Editing::ImportMode mode;
1174 boost::shared_ptr<ARDOUR::Track> track;
1178 EditorImportStatus import_status;
1179 gint import_progress_timeout (void *);
1180 static void *_import_thread (void *);
1181 void* import_thread ();
1182 void finish_import ();
1184 /* to support this ... */
1186 void import_audio (bool as_tracks);
1187 void do_import (std::vector<Glib::ustring> paths, bool split, bool as_tracks);
1189 void move_to_start ();
1190 void move_to_end ();
1192 void center_playhead ();
1193 void center_edit_point ();
1194 void edit_cursor_backward ();
1195 void edit_cursor_forward ();
1196 void playhead_forward_to_grid ();
1197 void playhead_backward_to_grid ();
1198 void playhead_backward ();
1199 void playhead_forward ();
1200 void scroll_playhead (bool forward);
1201 void scroll_backward (float pages=0.8f);
1202 void scroll_forward (float pages=0.8f);
1203 void scroll_tracks_down ();
1204 void scroll_tracks_up ();
1205 void delete_sample_forward ();
1206 void delete_sample_backward ();
1207 void delete_screen ();
1208 void search_backwards ();
1209 void search_forwards ();
1211 void clear_markers ();
1212 void clear_ranges ();
1213 void clear_locations ();
1214 void unhide_markers ();
1215 void unhide_ranges ();
1216 void jump_forward_to_mark ();
1217 void jump_backward_to_mark ();
1218 void cursor_align (bool playhead_to_edit);
1220 void remove_last_capture ();
1221 void select_all_selectables_using_time_selection ();
1222 void select_all_selectables_using_loop();
1223 void select_all_selectables_using_punch();
1224 void set_selection_from_range (ARDOUR::Location&);
1225 void set_selection_from_punch ();
1226 void set_selection_from_loop ();
1227 void set_selection_from_region ();
1229 void add_location_mark (nframes64_t where);
1230 void add_location_from_audio_region ();
1231 void add_locations_from_audio_region ();
1232 void add_location_from_selection ();
1233 void set_loop_from_selection (bool play);
1234 void set_punch_from_selection ();
1235 void set_punch_from_region ();
1237 void set_loop_from_edit_range (bool play);
1238 void set_loop_from_region (bool play);
1239 void set_punch_from_edit_range ();
1241 void set_loop_range (nframes64_t start, nframes64_t end, std::string cmd);
1242 void set_punch_range (nframes64_t start, nframes64_t end, std::string cmd);
1244 void add_location_from_playhead_cursor ();
1245 bool select_new_marker;
1247 void reverse_selection ();
1248 void edit_envelope ();
1250 void start_scrolling ();
1251 void stop_scrolling ();
1253 double last_scrub_x;
1254 int scrubbing_direction;
1255 int scrub_reversals;
1256 int scrub_reverse_distance;
1259 void keyboard_selection_begin ();
1260 void keyboard_selection_finish (bool add);
1261 bool have_pending_keyboard_selection;
1262 nframes64_t pending_keyboard_selection_start;
1264 boost::shared_ptr<ARDOUR::Region> select_region_for_operation (int dir, TimeAxisView **tv);
1265 void extend_selection_to_end_of_region (bool next);
1266 void extend_selection_to_start_of_region (bool previous);
1268 Editing::SnapType _snap_type;
1269 Editing::SnapMode _snap_mode;
1271 /// Snap threshold in pixels
1272 double snap_threshold;
1274 bool ignore_gui_changes;
1280 Gtk::Menu fade_context_menu;
1281 void popup_fade_context_menu (int, int, ArdourCanvas::Item*, ItemType);
1283 void set_fade_in_shape (ARDOUR::AudioRegion::FadeShape);
1284 void set_fade_out_shape (ARDOUR::AudioRegion::FadeShape);
1286 void set_fade_length (bool in);
1287 void toggle_fade_active (bool in);
1288 void set_fade_in_active (bool);
1289 void set_fade_out_active (bool);
1291 std::set<boost::shared_ptr<ARDOUR::Playlist> > motion_frozen_playlists;
1292 RegionSelection pre_drag_region_selection;
1294 bool _dragging_playhead;
1295 bool _dragging_edit_point;
1297 void marker_drag_motion_callback (GdkEvent*);
1298 void marker_drag_finished_callback (GdkEvent*);
1300 gint mouse_rename_region (ArdourCanvas::Item*, GdkEvent*);
1302 void start_region_grab (ArdourCanvas::Item*, GdkEvent*, RegionView*);
1303 void start_create_region_grab (ArdourCanvas::Item*, GdkEvent*);
1304 void start_region_copy_grab (ArdourCanvas::Item*, GdkEvent*, RegionView*);
1305 void start_region_brush_grab (ArdourCanvas::Item*, GdkEvent*, RegionView*);
1306 void start_selection_grab (ArdourCanvas::Item*, GdkEvent*);
1308 void region_view_item_click (AudioRegionView&, GdkEventButton*);
1310 void remove_gain_control_point (ArdourCanvas::Item*, GdkEvent*);
1311 void remove_control_point (ArdourCanvas::Item*, GdkEvent*);
1313 void mouse_brush_insert_region (RegionView*, nframes64_t pos);
1314 void brush (nframes64_t);
1316 void show_verbose_time_cursor (nframes64_t frame, double offset = 0, double xpos=-1, double ypos=-1);
1317 void show_verbose_duration_cursor (nframes64_t start, nframes64_t end, double offset = 0, double xpos=-1, double ypos=-1);
1318 double clamp_verbose_cursor_x (double);
1319 double clamp_verbose_cursor_y (double);
1321 /* Canvas event handlers */
1323 bool canvas_control_point_event (GdkEvent* event,ArdourCanvas::Item*, ControlPoint*);
1324 bool canvas_line_event (GdkEvent* event,ArdourCanvas::Item*, AutomationLine*);
1325 bool canvas_selection_rect_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1326 bool canvas_selection_start_trim_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1327 bool canvas_selection_end_trim_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1328 bool canvas_crossfade_view_event (GdkEvent* event,ArdourCanvas::Item*, CrossfadeView*);
1329 bool canvas_fade_in_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1330 bool canvas_fade_in_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1331 bool canvas_fade_out_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1332 bool canvas_fade_out_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1335 // These variables are used to detect a feedback loop and break it to avoid a gui hang
1337 ArdourCanvas::Item *last_item_entered;
1338 int last_item_entered_n;
1341 bool canvas_region_view_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1342 bool canvas_frame_handle_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1343 bool canvas_region_view_name_highlight_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1344 bool canvas_region_view_name_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1345 bool canvas_stream_view_event (GdkEvent* event,ArdourCanvas::Item*, RouteTimeAxisView*);
1346 bool canvas_marker_event (GdkEvent* event,ArdourCanvas::Item*, Marker*);
1347 bool canvas_zoom_rect_event (GdkEvent* event,ArdourCanvas::Item*);
1348 bool canvas_tempo_marker_event (GdkEvent* event,ArdourCanvas::Item*, TempoMarker*);
1349 bool canvas_meter_marker_event (GdkEvent* event,ArdourCanvas::Item*, MeterMarker*);
1350 bool canvas_automation_track_event(GdkEvent* event, ArdourCanvas::Item*, AutomationTimeAxisView*) ;
1351 bool canvas_note_event (GdkEvent* event, ArdourCanvas::Item*);
1353 bool canvas_tempo_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1354 bool canvas_meter_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1355 bool canvas_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1356 bool canvas_range_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1357 bool canvas_transport_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1358 bool canvas_cd_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1360 bool canvas_imageframe_item_view_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1361 bool canvas_imageframe_view_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameTimeAxis*);
1362 bool canvas_imageframe_start_handle_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1363 bool canvas_imageframe_end_handle_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1364 bool canvas_marker_time_axis_view_event(GdkEvent* event, ArdourCanvas::Item*,MarkerTimeAxis*);
1365 bool canvas_markerview_item_view_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1366 bool canvas_markerview_start_handle_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1367 bool canvas_markerview_end_handle_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1369 /* non-public event handlers */
1371 bool canvas_playhead_cursor_event (GdkEvent* event, ArdourCanvas::Item*);
1372 bool track_canvas_scroll (GdkEventScroll* event);
1374 bool track_canvas_scroll_event (GdkEventScroll* event);
1375 bool track_canvas_button_press_event (GdkEventButton* event);
1376 bool track_canvas_button_release_event (GdkEventButton* event);
1377 bool track_canvas_motion_notify_event (GdkEventMotion* event);
1379 Gtk::Allocation canvas_allocation;
1380 void track_canvas_allocate (Gtk::Allocation alloc);
1381 bool track_canvas_size_allocated ();
1382 bool track_canvas_drag_motion (Glib::RefPtr<Gdk::DragContext> const &, int, int, guint);
1384 void set_playhead_cursor ();
1386 void kbd_driver (sigc::slot<void,GdkEvent*>, bool use_track_canvas = true, bool use_time_canvas = true, bool can_select = true);
1387 void kbd_mute_unmute_region ();
1390 void kbd_do_brush (GdkEvent*);
1391 void kbd_do_audition (GdkEvent*);
1393 void handle_new_duration ();
1394 void initialize_canvas ();
1396 /* display control */
1398 bool _show_measures;
1399 /// true if the editor should follow the playhead, otherwise false
1400 bool _follow_playhead;
1401 /// true if waveforms should be shown while recording audio tracks, otherwise false
1402 bool _show_waveforms_recording;
1404 ARDOUR::TempoMap::BBTPointList *current_bbt_points;
1406 TempoLines* tempo_lines;
1408 ArdourCanvas::Group* time_line_group;
1410 void hide_measures ();
1411 void draw_measures ();
1412 bool redraw_measures ();
1414 void new_tempo_section ();
1416 void mouse_add_new_tempo_event (nframes64_t where);
1417 void mouse_add_new_meter_event (nframes64_t where);
1419 void remove_tempo_marker (ArdourCanvas::Item*);
1420 void remove_meter_marker (ArdourCanvas::Item*);
1421 gint real_remove_tempo_marker (ARDOUR::TempoSection*);
1422 gint real_remove_meter_marker (ARDOUR::MeterSection*);
1424 void edit_tempo_section (ARDOUR::TempoSection*);
1425 void edit_meter_section (ARDOUR::MeterSection*);
1426 void edit_tempo_marker (ArdourCanvas::Item*);
1427 void edit_meter_marker (ArdourCanvas::Item*);
1428 void edit_control_point (ArdourCanvas::Item*);
1430 void marker_menu_edit ();
1431 void marker_menu_remove ();
1432 void marker_menu_rename ();
1433 void marker_menu_lock (bool yn);
1434 void marker_menu_hide ();
1435 void marker_menu_loop_range ();
1436 void marker_menu_select_all_selectables_using_range ();
1437 void marker_menu_select_using_range ();
1438 void marker_menu_separate_regions_using_location ();
1439 void marker_menu_play_from ();
1440 void marker_menu_play_range ();
1441 void marker_menu_set_playhead ();
1442 void marker_menu_set_from_playhead ();
1443 void marker_menu_set_from_selection ();
1444 void marker_menu_range_to_next ();
1445 void new_transport_marker_menu_set_loop ();
1446 void new_transport_marker_menu_set_punch ();
1447 void update_loop_range_view (bool visibility=false);
1448 void update_punch_range_view (bool visibility=false);
1449 void new_transport_marker_menu_popdown ();
1450 void marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1451 void tm_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1452 void transport_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1453 void new_transport_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1454 void build_range_marker_menu (bool loop_or_punch);
1455 void build_marker_menu (bool start_or_end);
1456 void build_tm_marker_menu ();
1457 void build_new_transport_marker_menu ();
1459 Gtk::Menu* tm_marker_menu;
1460 Gtk::Menu* marker_menu;
1461 Gtk::Menu* start_end_marker_menu;
1462 Gtk::Menu* range_marker_menu;
1463 Gtk::Menu* transport_marker_menu;
1464 Gtk::Menu* new_transport_marker_menu;
1465 Gtk::Menu* cd_marker_menu;
1466 ArdourCanvas::Item* marker_menu_item;
1468 typedef std::list<Marker*> Marks;
1471 void remove_metric_marks ();
1472 void draw_metric_marks (const ARDOUR::Metrics& metrics);
1474 void compute_current_bbt_points (nframes_t left, nframes_t right);
1475 void tempo_map_changed (ARDOUR::Change);
1476 void redisplay_tempo (bool immediate_redraw);
1478 void snap_to (nframes64_t& first, int32_t direction = 0, bool for_mark = false);
1479 void snap_to_with_modifier (nframes64_t& first, GdkEvent const *, int32_t direction = 0, bool for_mark = false);
1480 void snap_to (nframes64_t& first, nframes64_t& last, int32_t direction = 0, bool for_mark = false);
1482 uint32_t bbt_beat_subdivision;
1486 Gtk::ToggleButton editor_mixer_button;
1487 Gtk::ToggleButton editor_list_button;
1488 void editor_mixer_button_toggled ();
1489 void editor_list_button_toggled ();
1491 AudioClock zoom_range_clock;
1492 Gtk::Button zoom_in_button;
1493 Gtk::Button zoom_out_button;
1494 Gtk::Button zoom_out_full_button;
1495 Gtk::Button zoom_onetoone_button;
1497 Gtk::Button tav_expand_button;
1498 Gtk::Button tav_shrink_button;
1500 Gtk::VBox toolbar_clock_vbox;
1501 Gtk::VBox toolbar_selection_clock_vbox;
1502 Gtk::Table toolbar_selection_clock_table;
1503 Gtk::Label toolbar_selection_cursor_label;
1505 Gtk::HBox mouse_mode_button_box;
1506 Gtkmm2ext::TearOff* mouse_mode_tearoff;
1507 Gtk::ToggleButton mouse_select_button;
1508 Gtk::ToggleButton mouse_move_button;
1509 Gtk::ToggleButton mouse_gain_button;
1510 Gtk::ToggleButton mouse_zoom_button;
1511 Gtk::ToggleButton mouse_timefx_button;
1512 Gtk::ToggleButton mouse_audition_button;
1514 void mouse_mode_toggled (Editing::MouseMode m);
1515 bool ignore_mouse_mode_toggle;
1517 Gtk::ToggleButton internal_edit_button;
1518 void toggle_internal_editing ();
1520 gint mouse_select_button_release (GdkEventButton*);
1522 Gtk::VBox automation_box;
1523 Gtk::Button automation_mode_button;
1524 Gtk::ToggleButton global_automation_button;
1526 Gtk::ComboBoxText edit_mode_selector;
1527 Gtk::VBox edit_mode_box;
1529 void set_edit_mode (ARDOUR::EditMode);
1530 void cycle_edit_mode ();
1531 void edit_mode_selection_done ();
1533 Gtk::ComboBoxText snap_type_selector;
1534 Gtk::ComboBoxText snap_mode_selector;
1537 std::vector<std::string> snap_type_strings;
1538 std::vector<std::string> snap_mode_strings;
1540 void snap_type_selection_done ();
1541 void snap_mode_selection_done ();
1542 void snap_mode_chosen (Editing::SnapMode);
1543 void snap_type_chosen (Editing::SnapType);
1545 Glib::RefPtr<Gtk::RadioAction> snap_type_action (Editing::SnapType);
1546 Glib::RefPtr<Gtk::RadioAction> snap_mode_action (Editing::SnapMode);
1548 Gtk::ComboBoxText zoom_focus_selector;
1549 Gtk::VBox zoom_focus_box;
1551 std::vector<std::string> zoom_focus_strings;
1553 void zoom_focus_selection_done ();
1554 void zoom_focus_chosen (Editing::ZoomFocus);
1556 Glib::RefPtr<Gtk::RadioAction> zoom_focus_action (Editing::ZoomFocus);
1559 Gtk::HBox track_zoom_box;
1560 Gtk::VBox zoom_vbox;
1562 void zoom_adjustment_changed();
1564 void setup_toolbar ();
1566 Gtkmm2ext::TearOff* tools_tearoff;
1567 Gtk::HBox toolbar_hbox;
1568 Gtk::EventBox toolbar_base;
1569 Gtk::Frame toolbar_frame;
1573 Gtk::HBox panic_box;
1574 Gtk::Button midi_panic_button;
1575 Gtk::ToggleButton midi_sound_notes;
1577 bool sound_notes () const { return midi_sound_notes.get_active(); }
1579 void setup_midi_toolbar ();
1581 /* selection process */
1583 Selection* selection;
1584 Selection* cut_buffer;
1586 void time_selection_changed ();
1587 void track_selection_changed ();
1588 void region_selection_changed ();
1589 sigc::connection editor_regions_selection_changed_connection;
1590 void sensitize_the_right_region_actions (bool have_selected_regions);
1591 void point_selection_changed ();
1592 void marker_selection_changed ();
1594 void cancel_selection ();
1596 void region_selection_op (void (ARDOUR::Region::*pmf)(void));
1597 void region_selection_op (void (ARDOUR::Region::*pmf)(void*), void*);
1598 void region_selection_op (void (ARDOUR::Region::*pmf)(bool), bool);
1600 bool audio_region_selection_covers (nframes64_t where);
1602 /* transport range select process */
1604 ArdourCanvas::SimpleRect* cd_marker_bar_drag_rect;
1605 ArdourCanvas::SimpleRect* range_bar_drag_rect;
1606 ArdourCanvas::SimpleRect* transport_bar_drag_rect;
1609 ArdourCanvas::SimpleRect *bogus_background_rect;
1611 ArdourCanvas::SimpleRect *transport_bar_range_rect;
1612 ArdourCanvas::SimpleRect *transport_bar_preroll_rect;
1613 ArdourCanvas::SimpleRect *transport_bar_postroll_rect;
1614 ArdourCanvas::SimpleRect *transport_loop_range_rect;
1615 ArdourCanvas::SimpleRect *transport_punch_range_rect;
1616 ArdourCanvas::SimpleLine *transport_punchin_line;
1617 ArdourCanvas::SimpleLine *transport_punchout_line;
1618 ArdourCanvas::SimpleRect *transport_preroll_rect;
1619 ArdourCanvas::SimpleRect *transport_postroll_rect;
1621 ARDOUR::Location* transport_loop_location();
1622 ARDOUR::Location* transport_punch_location();
1624 ARDOUR::Location *temp_location;
1626 /* object rubberband select process */
1628 bool select_all_within (nframes64_t start, nframes64_t end, gdouble topy, gdouble boty, const TrackViewList&, Selection::Operation op);
1630 ArdourCanvas::SimpleRect *rubberband_rect;
1632 /* mouse zoom process */
1634 ArdourCanvas::SimpleRect *zoom_rect;
1635 void reposition_zoom_rect (nframes64_t start, nframes64_t end);
1637 EditorRouteGroups* _route_groups;
1638 EditorRoutes* _routes;
1639 EditorRegions* _regions;
1640 EditorSnapshots* _snapshots;
1641 EditorLocations* _locations;
1643 /* diskstream/route display management */
1644 Glib::RefPtr<Gdk::Pixbuf> rec_enabled_icon;
1645 Glib::RefPtr<Gdk::Pixbuf> rec_disabled_icon;
1647 Glib::RefPtr<Gtk::TreeSelection> route_display_selection;
1649 bool sync_track_view_list_and_routes ();
1651 Gtk::VBox list_vpacker;
1655 bool autoscroll_active;
1656 int autoscroll_timeout_tag;
1659 int last_autoscroll_x;
1660 int last_autoscroll_y;
1661 uint32_t autoscroll_cnt;
1662 nframes64_t autoscroll_x_distance;
1663 double autoscroll_y_distance;
1665 static gint _autoscroll_canvas (void *);
1666 bool autoscroll_canvas ();
1667 void start_canvas_autoscroll (int x, int y);
1668 void stop_canvas_autoscroll ();
1669 void maybe_autoscroll (GdkEventMotion*, bool);
1670 bool allow_vertical_scroll;
1673 void point_trim (GdkEvent*);
1674 void single_contents_trim (RegionView&, nframes64_t, bool, bool, bool);
1675 void single_start_trim (RegionView&, nframes64_t, bool, bool, bool);
1676 void single_end_trim (RegionView&, nframes64_t, bool, bool, bool);
1678 void thaw_region_after_trim (RegionView& rv);
1680 void trim_region_front();
1681 void trim_region_back();
1682 void trim_region (bool front);
1684 void trim_region_to_edit_point ();
1685 void trim_region_from_edit_point ();
1686 void trim_region_to_loop ();
1687 void trim_region_to_punch ();
1688 void trim_region_to_location (const ARDOUR::Location&, const char* cmd);
1690 void trim_to_region(bool forward);
1691 void trim_region_to_previous_region_end();
1692 void trim_region_to_next_region_start();
1694 bool show_gain_after_trim;
1698 int convert_drop_to_paths (
1699 std::vector<Glib::ustring>& paths,
1700 const Glib::RefPtr<Gdk::DragContext>& context,
1703 const Gtk::SelectionData& data,
1707 void track_canvas_drag_data_received (
1708 const Glib::RefPtr<Gdk::DragContext>& context,
1711 const Gtk::SelectionData& data,
1716 const Glib::RefPtr<Gdk::DragContext>& context,
1719 const Gtk::SelectionData& data,
1724 const Glib::RefPtr<Gdk::DragContext>& context,
1727 const Gtk::SelectionData& data,
1732 const Glib::RefPtr<Gdk::DragContext>& context,
1735 const Gtk::SelectionData& data,
1741 int write_region_selection(RegionSelection&);
1742 bool write_region (std::string path, boost::shared_ptr<ARDOUR::AudioRegion>);
1743 void bounce_region_selection ();
1744 void bounce_range_selection (bool replace, bool enable_processing);
1745 void external_edit_region ();
1747 int write_audio_selection (TimeSelection&);
1748 bool write_audio_range (ARDOUR::AudioPlaylist&, const ARDOUR::ChanCount& channels, std::list<ARDOUR::AudioRange>&);
1750 void write_selection ();
1752 XMLNode *before; /* used in *_reversible_command */
1754 void begin_reversible_command (std::string cmd_name);
1755 void commit_reversible_command ();
1757 void update_title ();
1758 void update_title_s (const std::string & snapshot_name);
1761 Selection* selection;
1762 double frames_per_unit;
1764 State (PublicEditor const * e);
1768 void store_state (State&) const;
1769 void restore_state (State *);
1771 void instant_save ();
1773 boost::shared_ptr<ARDOUR::AudioRegion> last_audition_region;
1775 /* freeze operations */
1777 ARDOUR::InterThreadInfo freeze_status;
1778 gint freeze_progress_timeout (void *);
1779 static void* _freeze_thread (void*);
1780 void* freeze_thread ();
1782 void freeze_route ();
1783 void unfreeze_route ();
1785 /* route-group solo + mute */
1787 void set_route_group_solo (ARDOUR::Route&, bool);
1788 void set_route_group_mute (ARDOUR::Route&, bool);
1792 void duplicate_dialog (bool with_dialog);
1794 nframes64_t event_frame (GdkEvent const *, double* px = 0, double* py = 0) const;
1796 /* returns false if mouse pointer is not in track or marker canvas
1798 bool mouse_frame (nframes64_t&, bool& in_track_canvas) const;
1800 /* "whats mine is yours" */
1802 TimeFXDialog* current_timefx;
1804 static void* timefx_thread (void *arg);
1805 void do_timefx (TimeFXDialog&);
1807 int time_stretch (RegionSelection&, float fraction);
1808 int pitch_shift (RegionSelection&, float cents);
1809 void pitch_shift_regions ();
1810 int time_fx (RegionSelection&, float val, bool pitching);
1812 /* editor-mixer strip */
1814 MixerStrip *current_mixer_strip;
1815 bool show_editor_mixer_when_tracks_arrive;
1816 Gtk::VBox current_mixer_strip_vbox;
1817 void cms_new (boost::shared_ptr<ARDOUR::Route>);
1818 void cms_deleted ();
1819 void current_mixer_strip_hidden ();
1820 void current_mixer_strip_removed ();
1822 void detach_tearoff (Gtk::Box* b, Gtk::Window* w);
1823 void reattach_tearoff (Gtk::Box* b, Gtk::Window* w, int32_t n);
1825 void ensure_all_elements_drawn ();
1827 /* nudging tracks */
1829 void nudge_track (bool use_edit_point, bool forwards);
1833 bool _xfade_visibility;
1836 void handle_new_imageframe_time_axis_view(const std::string & track_name, void* src) ;
1837 void handle_new_imageframe_marker_time_axis_view(const std::string & track_name, TimeAxisView* marked_track) ;
1839 void start_imageframe_grab(ArdourCanvas::Item*, GdkEvent*) ;
1840 void start_markerview_grab(ArdourCanvas::Item*, GdkEvent*) ;
1842 void imageframe_drag_motion_callback(ArdourCanvas::Item*, GdkEvent*) ;
1843 void markerview_drag_motion_callback(ArdourCanvas::Item*, GdkEvent*) ;
1844 void timeaxis_item_drag_finished_callback(ArdourCanvas::Item*, GdkEvent*) ;
1846 gint canvas_imageframe_item_view_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameView* ifv);
1847 gint canvas_imageframe_view_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameTimeAxis* ifta);
1848 gint canvas_imageframe_start_handle_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameView* ifv);
1849 gint canvas_imageframe_end_handle_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameView* ifv);
1851 gint canvas_marker_time_axis_view_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerTimeAxis* mta);
1852 gint canvas_markerview_item_view_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerView* mv);
1853 gint canvas_markerview_start_handle_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerView* mv);
1854 gint canvas_markerview_end_handle_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerView* mv);
1856 void imageframe_start_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1857 void imageframe_end_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1858 void imageframe_start_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1859 void imageframe_start_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1860 void imageframe_end_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1861 void imageframe_end_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1863 void markerview_item_start_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1864 void markerview_item_end_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1865 void markerview_start_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1866 void markerview_start_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1867 void markerview_end_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1868 void markerview_end_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1870 void popup_imageframe_edit_menu(int button, int32_t time, ArdourCanvas::Item* ifv, bool with_frame) ;
1871 void popup_marker_time_axis_edit_menu(int button, int32_t time, ArdourCanvas::Item* ifv, bool with_frame) ;
1873 ImageFrameSocketHandler* image_socket_listener ;
1876 void toggle_xfade_active (boost::weak_ptr<ARDOUR::Crossfade>);
1877 void toggle_xfade_length (boost::weak_ptr<ARDOUR::Crossfade>);
1878 void edit_xfade (boost::weak_ptr<ARDOUR::Crossfade>);
1879 void xfade_edit_left_region ();
1880 void xfade_edit_right_region ();
1882 static const int32_t default_width = 995;
1883 static const int32_t default_height = 765;
1887 Gtk::Button nudge_forward_button;
1888 Gtk::Button nudge_backward_button;
1889 Gtk::HBox nudge_hbox;
1890 Gtk::VBox nudge_vbox;
1891 AudioClock nudge_clock;
1893 bool nudge_forward_release (GdkEventButton*);
1894 bool nudge_backward_release (GdkEventButton*);
1898 void apply_filter (ARDOUR::Filter&, std::string cmd);
1900 Command* apply_midi_note_edit_op_to_region (ARDOUR::MidiOperator& op, MidiRegionView& mrv);
1901 void apply_midi_note_edit_op (ARDOUR::MidiOperator& op);
1903 /* handling cleanup */
1905 int playlist_deletion_dialog (boost::shared_ptr<ARDOUR::Playlist>);
1907 std::vector<sigc::connection> session_connections;
1909 /* tracking step changes of track height */
1911 TimeAxisView* current_stepping_trackview;
1912 ARDOUR::microseconds_t last_track_height_step_timestamp;
1913 gint track_height_step_timeout();
1914 sigc::connection step_timeout;
1916 TimeAxisView* entered_track;
1917 RegionView* entered_regionview;
1920 void ensure_entered_track_selected (bool op_acts_on_objects = false);
1921 bool clear_entered_track;
1922 bool left_track_canvas (GdkEventCrossing*);
1923 bool entered_track_canvas (GdkEventCrossing*);
1924 void set_entered_track (TimeAxisView*);
1925 void set_entered_regionview (RegionView*);
1926 void ensure_track_visible (TimeAxisView*);
1927 gint left_automation_track ();
1929 bool _new_regionviews_show_envelope;
1931 void reset_canvas_action_sensitivity (bool);
1932 void toggle_gain_envelope_visibility ();
1933 void toggle_gain_envelope_active ();
1934 void reset_region_gain_envelopes ();
1936 bool on_key_press_event (GdkEventKey*);
1937 bool on_key_release_event (GdkEventKey*);
1939 void session_state_saved (std::string);
1941 Glib::RefPtr<Gtk::Action> undo_action;
1942 Glib::RefPtr<Gtk::Action> redo_action;
1944 void history_changed ();
1946 Gtk::HBox status_bar_hpacker;
1948 Editing::EditPoint _edit_point;
1950 Gtk::ComboBoxText edit_point_selector;
1952 void set_edit_point_preference (Editing::EditPoint ep, bool force = false);
1953 void cycle_edit_point (bool with_marker);
1954 void set_edit_point ();
1955 void edit_point_selection_done ();
1956 void edit_point_chosen (Editing::EditPoint);
1957 Glib::RefPtr<Gtk::RadioAction> edit_point_action (Editing::EditPoint);
1958 std::vector<std::string> edit_point_strings;
1960 void selected_marker_moved (ARDOUR::Location*);
1962 bool get_edit_op_range (nframes64_t& start, nframes64_t& end) const;
1964 void get_regions_at (RegionSelection&, nframes64_t where, const TrackSelection& ts) const;
1965 void get_regions_after (RegionSelection&, nframes64_t where, const TrackSelection& ts) const;
1967 void get_regions_for_action (RegionSelection&, bool allow_entered = false, bool allow_edit_position = true);
1969 sigc::connection fast_screen_update_connection;
1970 gint start_updating ();
1971 gint stop_updating ();
1972 void fast_update_strips ();
1973 bool meters_running;
1975 void select_next_route ();
1976 void select_prev_route ();
1978 void snap_to_internal (nframes64_t& first, int32_t direction = 0, bool for_mark = false);
1979 void timecode_snap_to_internal (nframes64_t& first, int32_t direction = 0, bool for_mark = false);
1981 RhythmFerret* rhythm_ferret;
1982 BundleManager* _bundle_manager;
1983 GlobalPortMatrixWindow* _global_port_matrix[ARDOUR::DataType::num_types];
1985 void fit_tracks (TrackSelection &);
1986 void fit_selected_tracks ();
1987 void set_track_height (uint32_t h);
1989 void remove_tracks ();
1990 void toggle_tracks_active ();
1995 friend gboolean _idle_resize (gpointer);
1996 int32_t _pending_resize_amount;
1997 TimeAxisView* _pending_resize_view;
1999 void visible_order_range (int*, int*) const;
2002 bool _pending_locate_request;
2004 EditorSummary* _summary;
2005 void region_view_added (RegionView *);
2007 void update_canvas_now ();
2008 void streamview_height_changed ();
2010 EditorGroupTabs* _group_tabs;
2011 void fit_route_group (ARDOUR::RouteGroup *);
2013 void start_step_editing ();
2014 void stop_step_editing ();
2015 bool check_step_edit ();
2016 sigc::connection step_edit_connection;
2019 friend class RegionDrag;
2020 friend class RegionMoveDrag;
2021 friend class RegionSpliceDrag;
2022 friend class TrimDrag;
2023 friend class MeterMarkerDrag;
2024 friend class TempoMarkerDrag;
2025 friend class CursorDrag;
2026 friend class FadeInDrag;
2027 friend class FadeOutDrag;
2028 friend class MarkerDrag;
2029 friend class RegionGainDrag;
2030 friend class ControlPointDrag;
2031 friend class LineDrag;
2032 friend class RubberbandSelectDrag;
2033 friend class TimeFXDrag;
2034 friend class ScrubDrag;
2035 friend class SelectionDrag;
2036 friend class RangeMarkerBarDrag;
2037 friend class MouseZoomDrag;
2038 friend class RegionCreateDrag;
2039 friend class RegionMotionDrag;
2040 friend class RegionInsertDrag;
2042 friend class EditorSummary;
2043 friend class EditorGroupTabs;
2045 friend class EditorRoutes;
2048 #endif /* __ardour_editor_h__ */