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 "pbd/signals.h"
51 #include "ardour/import_status.h"
52 #include "ardour/tempo.h"
53 #include "ardour/location.h"
54 #include "ardour/audioregion.h"
55 #include "ardour/track.h"
56 #include "ardour/types.h"
57 #include "ardour/route_group.h"
59 #include "audio_clock.h"
60 #include "gtk-custom-ruler.h"
61 #include "ardour_dialog.h"
62 #include "public_editor.h"
65 #include "editor_items.h"
66 #include "region_selection.h"
68 #include "editor_summary.h"
70 namespace Gnome { namespace Canvas {
100 class AudioRegionView;
101 class AudioStreamView;
102 class AudioTimeAxisView;
103 class AutomationLine;
104 class AutomationSelection;
105 class AutomationTimeAxisView;
110 class GlobalPortMatrixWindow;
111 class GroupedButtons;
113 class MidiRegionView;
115 class PlaylistSelector;
116 class PluginSelector;
119 class SoundFileOmega;
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 PBD::Signal1<void, nframes64_t> PositionChanged;
159 class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARDOUR::SessionHandlePtr
165 void set_session (ARDOUR::Session *);
166 ARDOUR::Session* session() const { return _session; }
169 virtual bool have_idled () const { return _have_idled; }
171 nframes64_t leftmost_position() const { return leftmost_frame; }
173 nframes64_t current_page_frames() const {
174 return (nframes64_t) floor (_canvas_width * frames_per_unit);
177 double canvas_height () const {
178 return _canvas_height;
181 void cycle_snap_mode ();
182 void cycle_snap_choice ();
183 void set_snap_to (Editing::SnapType);
184 void set_snap_mode (Editing::SnapMode);
185 void set_snap_threshold (double pixel_distance) {snap_threshold = pixel_distance;}
187 Editing::SnapMode snap_mode () const;
188 Editing::SnapType snap_type () const;
190 void undo (uint32_t n = 1);
191 void redo (uint32_t n = 1);
193 XMLNode& get_state ();
194 int set_state (const XMLNode&, int version);
196 void set_mouse_mode (Editing::MouseMode, bool force=true);
197 void step_mouse_mode (bool next);
198 Editing::MouseMode current_mouse_mode () const { return mouse_mode; }
199 Editing::MidiEditMode current_midi_edit_mode () const;
200 void remove_midi_note (ArdourCanvas::Item *, GdkEvent *);
202 bool internal_editing() const { return _internal_editing ; }
203 void set_internal_edit (bool yn);
206 void add_imageframe_time_axis(const std::string & track_name, void*) ;
207 void add_imageframe_marker_time_axis(const std::string & track_name, TimeAxisView* marked_track, void*) ;
208 void connect_to_image_compositor() ;
209 void scroll_timeaxis_to_imageframe_item(const TimeAxisViewItem* item) ;
210 TimeAxisView* get_named_time_axis(const std::string & name) ;
211 #endif /* WITH_CMT */
213 void foreach_time_axis_view (sigc::slot<void,TimeAxisView&>);
214 void add_to_idle_resize (TimeAxisView*, int32_t);
216 RouteTimeAxisView* get_route_view_by_id (PBD::ID& id);
218 void consider_auditioning (boost::shared_ptr<ARDOUR::Region>);
219 void hide_a_region (boost::shared_ptr<ARDOUR::Region>);
220 void show_a_region (boost::shared_ptr<ARDOUR::Region>);
222 #ifdef USE_RUBBERBAND
223 std::vector<std::string> rb_opt_strings;
226 /* things that need to be public to be used in the main menubar */
228 void new_region_from_selection ();
229 void separate_regions_between (const TimeSelection&);
230 void separate_region_from_selection ();
231 void separate_region_from_punch ();
232 void separate_region_from_loop ();
233 void separate_regions_using_location (ARDOUR::Location&);
234 void transition_to_rolling (bool forward);
238 nframes64_t unit_to_frame (double unit) const {
239 return (nframes64_t) rint (unit * frames_per_unit);
242 double frame_to_unit (nframes64_t frame) const {
243 return rint ((double) frame / (double) frames_per_unit);
246 double frame_to_unit (double frame) const {
247 return rint (frame / frames_per_unit);
250 /* NOTE: these functions assume that the "pixel" coordinate is
251 the result of using the world->canvas affine transform on a
252 world coordinate. These coordinates already take into
253 account any scrolling carried out by adjusting the
257 nframes64_t pixel_to_frame (double pixel) const {
259 /* pixel can be less than zero when motion events
260 are processed. since we've already run the world->canvas
261 affine, that means that the location *really* is "off
262 to the right" and thus really is "before the start".
266 return (nframes64_t) rint (pixel * frames_per_unit * GNOME_CANVAS(track_canvas->gobj())->pixels_per_unit);
272 gulong frame_to_pixel (nframes64_t frame) const {
273 return (gulong) rint ((frame / (frames_per_unit * GNOME_CANVAS(track_canvas->gobj())->pixels_per_unit)));
276 void flush_canvas ();
280 Selection& get_selection() const { return *selection; }
281 Selection& get_cut_buffer() const { return *cut_buffer; }
283 bool extend_selection_to_track (TimeAxisView&);
285 void play_selection ();
286 void select_all_in_track (Selection::Operation op);
287 void select_all (Selection::Operation op);
288 void invert_selection_in_track ();
289 void invert_selection ();
290 void deselect_all ();
292 void set_selected_regionview_from_region_list (boost::shared_ptr<ARDOUR::Region> region, Selection::Operation op = Selection::Set);
296 void set_show_measures (bool yn);
297 bool show_measures () const { return _show_measures; }
299 /* analysis window */
301 void analyze_region_selection();
302 void analyze_range_selection();
306 void export_audio ();
307 void export_selection ();
308 void export_range ();
309 void export_region ();
311 void add_toplevel_controls (Gtk::Container&);
312 Gtk::HBox& get_status_bar_packer() { return status_bar_hpacker; }
314 void set_zoom_focus (Editing::ZoomFocus);
315 Editing::ZoomFocus get_zoom_focus () const { return zoom_focus; }
316 double get_current_zoom () const { return frames_per_unit; }
318 void temporal_zoom_step (bool coarser);
319 void tav_zoom_step (bool coarser);
321 /* stuff that AudioTimeAxisView and related classes use */
323 PlaylistSelector& playlist_selector() const;
324 void clear_playlist (boost::shared_ptr<ARDOUR::Playlist>);
326 void new_playlists (TimeAxisView* v);
327 void copy_playlists (TimeAxisView* v);
328 void clear_playlists (TimeAxisView* v);
330 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_stationary_playhead (bool yn);
356 void toggle_stationary_playhead ();
357 bool stationary_playhead() const { return _stationary_playhead; }
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 ();
366 void set_group_tabs ();
367 void toggle_measure_visibility ();
368 void toggle_logo_visibility ();
370 double get_physical_screen_width () const { return physical_screen_width; };
371 double physical_screen_width;
372 double physical_screen_height;
376 void toggle_selected_region_fades (int dir);
377 void update_region_fade_visibility ();
378 bool xfade_visibility() const { return _xfade_visibility; }
379 void update_xfade_visibility ();
381 /* redirect shared ops menu. caller must free returned menu */
383 Gtk::Menu* redirect_menu ();
385 /* floating windows/transient */
387 void ensure_float (Gtk::Window&);
391 void scroll_tracks_down_line ();
392 void scroll_tracks_up_line ();
394 void prepare_for_cleanup ();
395 void finish_cleanup ();
397 void maximise_editing_space();
398 void restore_editing_space();
400 void reset_x_origin (nframes64_t);
401 void reset_x_origin_to_follow_playhead ();
402 void reset_y_origin (double);
403 void reset_zoom (double);
404 void reposition_and_zoom (nframes64_t, double);
406 nframes64_t get_preferred_edit_position (bool ignore_playhead = false);
408 bool update_mouse_speed ();
409 bool decelerate_mouse_speed ();
411 void toggle_meter_updating();
413 void show_rhythm_ferret();
414 void show_global_port_matrix (ARDOUR::DataType);
416 void goto_visual_state (uint32_t);
417 void save_visual_state (uint32_t);
419 void queue_draw_resize_line (int at);
420 void start_resize_line_ops ();
421 void end_resize_line_ops ();
423 TrackViewList const & get_track_views () {
427 int get_regionview_count_from_region_list (boost::shared_ptr<ARDOUR::Region>);
429 void do_import (std::vector<Glib::ustring> paths, Editing::ImportDisposition, Editing::ImportMode mode, ARDOUR::SrcQuality, nframes64_t&);
430 void do_embed (std::vector<Glib::ustring> paths, Editing::ImportDisposition, Editing::ImportMode mode, nframes64_t&);
432 void get_regions_corresponding_to (boost::shared_ptr<ARDOUR::Region> region, std::vector<RegionView*>& regions);
434 void show_verbose_canvas_cursor_with (const std::string& txt);
435 void hide_verbose_canvas_cursor();
437 void center_screen (nframes64_t);
439 TrackViewList axis_views_from_routes (boost::shared_ptr<ARDOUR::RouteList>) const;
440 Gtkmm2ext::TearOff* mouse_mode_tearoff () const { return _mouse_mode_tearoff; }
441 Gtkmm2ext::TearOff* tools_tearoff () const { return _tools_tearoff; }
443 void snap_to (nframes64_t& first, int32_t direction = 0, bool for_mark = false);
444 void snap_to_with_modifier (nframes64_t& first, GdkEvent const *, int32_t direction = 0, bool for_mark = false);
445 void snap_to (nframes64_t& first, nframes64_t& last, int32_t direction = 0, bool for_mark = false);
447 void begin_reversible_command (std::string cmd_name);
448 void commit_reversible_command ();
451 void map_transport_state ();
452 void map_position_change (nframes64_t);
458 void color_handler ();
462 // to keep track of the playhead position for control_scroll
463 boost::optional<nframes64_t> _control_scroll_target;
465 PlaylistSelector* _playlist_selector;
467 typedef std::pair<TimeAxisView*,XMLNode*> TAVState;
471 double frames_per_unit;
472 nframes64_t leftmost_frame;
473 Editing::ZoomFocus zoom_focus;
474 std::list<TAVState> track_states;
477 std::list<VisualState*> undo_visual_stack;
478 std::list<VisualState*> redo_visual_stack;
479 VisualState* current_visual_state (bool with_tracks = true);
480 void undo_visual_state ();
481 void redo_visual_state ();
482 void use_visual_state (VisualState&);
484 void swap_visual_state ();
486 std::vector<VisualState*> visual_states;
487 sigc::connection visual_state_op_connection;
488 void start_visual_state_op (uint32_t n);
489 void cancel_visual_state_op (uint32_t n);
490 bool end_visual_state_op (uint32_t n);
492 nframes64_t leftmost_frame;
493 double frames_per_unit;
494 Editing::ZoomFocus zoom_focus;
496 void set_frames_per_unit (double);
499 Editing::MouseMode mouse_mode;
500 bool _internal_editing;
501 Editing::MouseMode effective_mouse_mode () const;
503 enum JoinObjectRangeState {
504 JOIN_OBJECT_RANGE_NONE,
505 /** `join object/range' mode is active and the mouse is over a place where object mode should happen */
506 JOIN_OBJECT_RANGE_OBJECT,
507 /** `join object/range' mode is active and the mouse is over a place where range mode should happen */
508 JOIN_OBJECT_RANGE_RANGE
511 JoinObjectRangeState _join_object_range_state;
513 void update_join_object_range_location (double, double);
515 int post_maximal_editor_width;
516 int post_maximal_pane_position;
517 int pre_maximal_pane_position;
518 int pre_maximal_editor_width;
519 void pane_allocation_handler (Gtk::Allocation&, Gtk::Paned*);
521 Gtk::Notebook the_notebook;
522 Gtk::HPaned edit_pane;
524 Gtk::EventBox meter_base;
526 Gtk::EventBox marker_base;
527 Gtk::HBox marker_box;
528 Gtk::VBox scrollers_rulers_markers_box;
530 void location_changed (ARDOUR::Location *);
531 void location_flags_changed (ARDOUR::Location *, void *);
532 void refresh_location_display ();
533 void refresh_location_display_s (const PBD::PropertyChange&);
534 void refresh_location_display_internal (ARDOUR::Locations::LocationList&);
535 void add_new_location (ARDOUR::Location *);
536 void location_gone (ARDOUR::Location *);
537 void remove_marker (ArdourCanvas::Item&, GdkEvent*);
538 gint really_remove_marker (ARDOUR::Location* loc);
539 void goto_nth_marker (int nth);
541 uint32_t location_marker_color;
542 uint32_t location_range_color;
543 uint32_t location_loop_color;
544 uint32_t location_punch_color;
545 uint32_t location_cd_marker_color;
547 struct LocationMarkers {
552 LocationMarkers () : start(0), end(0), valid (true) {}
558 void set_name (const std::string&);
559 void set_position (nframes64_t start, nframes64_t end = 0);
560 void set_color_rgba (uint32_t);
563 LocationMarkers *find_location_markers (ARDOUR::Location *) const;
564 ARDOUR::Location* find_location_from_marker (Marker *, bool& is_start) const;
565 Marker* entered_marker;
567 typedef std::map<ARDOUR::Location*,LocationMarkers *> LocationMarkerMap;
568 LocationMarkerMap location_markers;
570 void hide_marker (ArdourCanvas::Item*, GdkEvent*);
571 void clear_marker_display ();
572 void mouse_add_new_marker (nframes64_t where, bool is_cd=false, bool is_xrun=false);
573 bool choose_new_marker_name(std::string &name);
574 void update_cd_marker_display ();
575 void ensure_cd_marker_updated (LocationMarkers * lam, ARDOUR::Location * location);
577 TimeAxisView* clicked_axisview;
578 RouteTimeAxisView* clicked_routeview;
579 /** The last RegionView that was clicked on, or 0 if the last click was not
580 * on a RegionView. This is set up by the canvas event handlers in
581 * editor_canvas_events.cc
583 RegionView* clicked_regionview;
584 RegionSelection latest_regionviews;
585 uint32_t clicked_selection;
586 CrossfadeView* clicked_crossfadeview;
587 ControlPoint* clicked_control_point;
589 void sort_track_selection (TrackViewList* sel = 0);
591 void get_equivalent_regions (RegionView* rv, std::vector<RegionView*> &, PBD::PropertyID) const;
592 RegionSelection get_equivalent_regions (RegionSelection &, PBD::PropertyID) const;
593 void mapover_tracks (sigc::slot<void,RouteTimeAxisView&,uint32_t> sl, TimeAxisView*, PBD::PropertyID) const;
595 /* functions to be passed to mapover_tracks(), possibly with sigc::bind()-supplied arguments */
597 void mapped_get_equivalent_regions (RouteTimeAxisView&, uint32_t, RegionView *, std::vector<RegionView*>*) const;
598 void mapped_use_new_playlist (RouteTimeAxisView&, uint32_t, std::vector<boost::shared_ptr<ARDOUR::Playlist> > const &);
599 void mapped_use_copy_playlist (RouteTimeAxisView&, uint32_t, std::vector<boost::shared_ptr<ARDOUR::Playlist> > const &);
600 void mapped_clear_playlist (RouteTimeAxisView&, uint32_t);
604 void button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type);
605 bool button_release_can_deselect;
607 void catch_vanishing_regionview (RegionView *);
609 void set_selected_track (TimeAxisView&, Selection::Operation op = Selection::Set, bool no_remove=false);
610 void select_all_tracks ();
612 bool set_selected_control_point_from_click (Selection::Operation op = Selection::Set, bool no_remove=false);
613 void set_selected_track_from_click (bool press, Selection::Operation op = Selection::Set, bool no_remove=false);
614 void set_selected_track_as_side_effect (bool force = false);
615 bool set_selected_regionview_from_click (bool press, Selection::Operation op = Selection::Set, bool no_track_remove=false);
617 bool set_selected_regionview_from_map_event (GdkEventAny*, StreamView*, boost::weak_ptr<ARDOUR::Region>);
618 void collect_new_region_view (RegionView *);
619 void collect_and_select_new_region_view (RegionView *);
621 long select_range_around_region (RegionView *);
623 Gtk::Menu track_context_menu;
624 Gtk::Menu track_region_context_menu;
625 Gtk::Menu track_selection_context_menu;
626 Gtk::Menu track_crossfade_context_menu;
628 Gtk::MenuItem* region_edit_menu_split_item;
629 Gtk::MenuItem* region_edit_menu_split_multichannel_item;
630 Gtk::Menu * track_region_edit_playlist_menu;
631 Gtk::Menu * track_edit_playlist_submenu;
632 Gtk::Menu * track_selection_edit_playlist_submenu;
634 void popup_track_context_menu (int, int, ItemType, bool, nframes64_t);
635 Gtk::Menu* build_track_context_menu (nframes64_t);
636 Gtk::Menu* build_track_bus_context_menu (nframes64_t);
637 Gtk::Menu* build_track_region_context_menu (nframes64_t frame);
638 Gtk::Menu* build_track_crossfade_context_menu (nframes64_t);
639 Gtk::Menu* build_track_selection_context_menu (nframes64_t);
640 void add_dstream_context_items (Gtk::Menu_Helpers::MenuList&);
641 void add_bus_context_items (Gtk::Menu_Helpers::MenuList&);
642 void add_region_context_items (StreamView*, boost::shared_ptr<ARDOUR::Region>, Gtk::Menu_Helpers::MenuList&);
643 void add_crossfade_context_items (AudioStreamView*, boost::shared_ptr<ARDOUR::Crossfade>, Gtk::Menu_Helpers::MenuList&, bool many);
644 void add_selection_context_items (Gtk::Menu_Helpers::MenuList&);
646 void handle_new_route (ARDOUR::RouteList&);
647 void timeaxisview_deleted (TimeAxisView *);
649 Gtk::HBox global_hpacker;
650 Gtk::VBox global_vpacker;
653 Gdk::Cursor* current_canvas_cursor;
654 void set_canvas_cursor ();
655 Gdk::Cursor* which_grabber_cursor ();
657 ArdourCanvas::Canvas* track_canvas;
659 ArdourCanvas::NoEventText* verbose_canvas_cursor;
660 bool verbose_cursor_visible;
662 void parameter_changed (std::string);
664 bool track_canvas_motion (GdkEvent*);
666 void set_verbose_canvas_cursor (const std::string &, double x, double y);
667 void set_verbose_canvas_cursor_text (const std::string &);
668 void show_verbose_canvas_cursor();
670 bool verbose_cursor_on; // so far unused
672 Gtk::EventBox time_canvas_event_box;
673 Gtk::EventBox track_canvas_event_box;
674 Gtk::EventBox time_button_event_box;
675 Gtk::EventBox ruler_label_event_box;
677 ArdourCanvas::Group *minsec_group;
678 ArdourCanvas::Pixbuf *logo_item;
679 ArdourCanvas::Group *bbt_group;
680 ArdourCanvas::Group *timecode_group;
681 ArdourCanvas::Group *frame_group;
682 ArdourCanvas::Group *tempo_group;
683 ArdourCanvas::Group *meter_group;
684 ArdourCanvas::Group *marker_group;
685 ArdourCanvas::Group *range_marker_group;
686 ArdourCanvas::Group *transport_marker_group;
687 ArdourCanvas::Group* cd_marker_group;
689 ArdourCanvas::Group* timebar_group;
691 /* These bars never need to be scrolled */
692 ArdourCanvas::Group* meter_bar_group;
693 ArdourCanvas::Group* tempo_bar_group;
694 ArdourCanvas::Group* marker_bar_group;
695 ArdourCanvas::Group* range_marker_bar_group;
696 ArdourCanvas::Group* transport_marker_bar_group;
697 ArdourCanvas::Group* cd_marker_bar_group;
699 /** The group containing all items that require horizontal scrolling. */
700 ArdourCanvas::Group* _background_group;
702 The _master_group is the group containing all items
703 that require horizontal scrolling..
704 It is primarily used to separate canvas items
705 that require horizontal scrolling from those that do not.
707 ArdourCanvas::Group* _master_group;
709 /* The group containing all trackviews. Only scrolled vertically. */
710 ArdourCanvas::Group* _trackview_group;
712 /* The group used for region motion. Sits on top of _trackview_group */
713 ArdourCanvas::Group* _region_motion_group;
716 ruler_metric_timecode = 0,
717 ruler_metric_bbt = 1,
718 ruler_metric_frames = 2,
719 ruler_metric_minsec = 3,
721 ruler_time_tempo = 4,
722 ruler_time_meter = 5,
723 ruler_time_marker = 6,
724 ruler_time_range_marker = 7,
725 ruler_time_transport_marker = 8,
726 ruler_time_cd_marker = 9,
729 static GtkCustomMetric ruler_metrics[4];
730 Glib::RefPtr<Gtk::ToggleAction> ruler_timecode_action;
731 Glib::RefPtr<Gtk::ToggleAction> ruler_bbt_action;
732 Glib::RefPtr<Gtk::ToggleAction> ruler_samples_action;
733 Glib::RefPtr<Gtk::ToggleAction> ruler_minsec_action;
734 Glib::RefPtr<Gtk::ToggleAction> ruler_tempo_action;
735 Glib::RefPtr<Gtk::ToggleAction> ruler_meter_action;
736 Glib::RefPtr<Gtk::ToggleAction> ruler_marker_action;
737 Glib::RefPtr<Gtk::ToggleAction> ruler_range_action;
738 Glib::RefPtr<Gtk::ToggleAction> ruler_loop_punch_action;
739 Glib::RefPtr<Gtk::ToggleAction> ruler_cd_marker_action;
740 bool no_ruler_shown_update;
742 gint ruler_button_press (GdkEventButton*);
743 gint ruler_button_release (GdkEventButton*);
744 gint ruler_mouse_motion (GdkEventMotion*);
745 bool ruler_scroll (GdkEventScroll* event);
747 Gtk::Widget * ruler_grabbed_widget;
749 void initialize_rulers ();
750 void update_just_timecode ();
751 void compute_fixed_ruler_scale (); //calculates the RulerScale of the fixed rulers
752 void update_fixed_rulers ();
753 void update_tempo_based_rulers ();
754 void popup_ruler_menu (nframes64_t where = 0, ItemType type = RegionItem);
755 void update_ruler_visibility ();
756 void set_ruler_visible (RulerType, bool);
757 void toggle_ruler_visibility (RulerType rt);
758 void ruler_toggled (int);
759 gint ruler_label_button_release (GdkEventButton*);
760 void store_ruler_visibility ();
761 void restore_ruler_visibility ();
763 static gint _metric_get_timecode (GtkCustomRulerMark **, gdouble, gdouble, gint);
764 static gint _metric_get_bbt (GtkCustomRulerMark **, gdouble, gdouble, gint);
765 static gint _metric_get_frames (GtkCustomRulerMark **, gdouble, gdouble, gint);
766 static gint _metric_get_minsec (GtkCustomRulerMark **, gdouble, gdouble, gint);
768 enum MinsecRulerScale {
775 MinsecRulerScale minsec_ruler_scale;
777 nframes_t minsec_mark_interval;
778 gint minsec_mark_modulo;
780 void set_minsec_ruler_scale (gdouble lower, gdouble upper);
782 enum TimecodeRulerScale {
784 timecode_show_frames,
785 timecode_show_seconds,
786 timecode_show_minutes,
790 TimecodeRulerScale timecode_ruler_scale;
792 nframes_t timecode_mark_interval;
793 gint timecode_mark_modulo;
794 gint timecode_nmarks;
795 void set_timecode_ruler_scale (gdouble lower, gdouble upper);
805 bbt_show_ticks_detail,
806 bbt_show_ticks_super_detail
809 BBTRulerScale bbt_ruler_scale;
813 uint32_t bbt_bar_helper_on;
814 uint32_t bbt_accent_modulo;
815 void compute_bbt_ruler_scale (nframes64_t lower, nframes64_t upper);
817 gint metric_get_timecode (GtkCustomRulerMark **, gdouble, gdouble, gint);
818 gint metric_get_bbt (GtkCustomRulerMark **, gdouble, gdouble, gint);
819 gint metric_get_frames (GtkCustomRulerMark **, gdouble, gdouble, gint);
820 gint metric_get_minsec (GtkCustomRulerMark **, gdouble, gdouble, gint);
822 Gtk::Widget *_ruler_separator;
823 GtkWidget *_timecode_ruler;
824 GtkWidget *_bbt_ruler;
825 GtkWidget *_frames_ruler;
826 GtkWidget *_minsec_ruler;
827 Gtk::Widget *timecode_ruler;
828 Gtk::Widget *bbt_ruler;
829 Gtk::Widget *frames_ruler;
830 Gtk::Widget *minsec_ruler;
831 static Editor *ruler_editor;
833 static const double timebar_height;
834 guint32 visible_timebars;
835 gdouble canvas_timebars_vsize;
836 gdouble get_canvas_timebars_vsize () const { return canvas_timebars_vsize; }
837 Gtk::Menu *editor_ruler_menu;
839 ArdourCanvas::SimpleRect* tempo_bar;
840 ArdourCanvas::SimpleRect* meter_bar;
841 ArdourCanvas::SimpleRect* marker_bar;
842 ArdourCanvas::SimpleRect* range_marker_bar;
843 ArdourCanvas::SimpleRect* transport_marker_bar;
844 ArdourCanvas::SimpleRect* cd_marker_bar;
846 Gtk::Label minsec_label;
847 Gtk::Label bbt_label;
848 Gtk::Label timecode_label;
849 Gtk::Label frame_label;
850 Gtk::Label tempo_label;
851 Gtk::Label meter_label;
852 Gtk::Label mark_label;
853 Gtk::Label range_mark_label;
854 Gtk::Label transport_mark_label;
855 Gtk::Label cd_mark_label;
857 Gtk::VBox time_button_vbox;
858 Gtk::HBox time_button_hbox;
860 friend class EditorCursor;
862 EditorCursor* playhead_cursor;
863 ArdourCanvas::Group* cursor_group;
865 nframes64_t get_region_boundary (nframes64_t pos, int32_t dir, bool with_selection, bool only_onscreen);
867 void cursor_to_region_boundary (bool with_selection, int32_t dir);
868 void cursor_to_next_region_boundary (bool with_selection);
869 void cursor_to_previous_region_boundary (bool with_selection);
870 void cursor_to_next_region_point (EditorCursor*, ARDOUR::RegionPoint);
871 void cursor_to_previous_region_point (EditorCursor*, ARDOUR::RegionPoint);
872 void cursor_to_region_point (EditorCursor*, ARDOUR::RegionPoint, int32_t dir);
873 void cursor_to_selection_start (EditorCursor *);
874 void cursor_to_selection_end (EditorCursor *);
876 void selected_marker_to_region_boundary (bool with_selection, int32_t dir);
877 void selected_marker_to_next_region_boundary (bool with_selection);
878 void selected_marker_to_previous_region_boundary (bool with_selection);
879 void selected_marker_to_next_region_point (ARDOUR::RegionPoint);
880 void selected_marker_to_previous_region_point (ARDOUR::RegionPoint);
881 void selected_marker_to_region_point (ARDOUR::RegionPoint, int32_t dir);
882 void selected_marker_to_selection_start ();
883 void selected_marker_to_selection_end ();
885 void select_all_selectables_using_cursor (EditorCursor *, bool);
886 void select_all_selectables_using_edit (bool);
887 void select_all_selectables_between (bool within);
888 void select_range_between ();
890 boost::shared_ptr<ARDOUR::Region> find_next_region (nframes64_t, ARDOUR::RegionPoint, int32_t dir, TrackViewList&, TimeAxisView ** = 0);
891 nframes64_t find_next_region_boundary (nframes64_t, int32_t dir, const TrackViewList&);
893 std::vector<nframes64_t> region_boundary_cache;
894 void build_region_boundary_cache ();
897 Gtk::HBox bottom_hbox;
899 Gtk::Table edit_packer;
901 Gtk::Adjustment vertical_adjustment;
903 Gtk::Layout controls_layout;
904 bool control_layout_scroll (GdkEventScroll* ev);
905 void controls_layout_size_request (Gtk::Requisition*);
906 sigc::connection controls_layout_size_request_connection;
908 void horizontal_scroll_left ();
909 void horizontal_scroll_right ();
911 double _canvas_width;
912 double _canvas_height;
913 double full_canvas_height;
915 bool track_canvas_map_handler (GdkEventAny*);
917 gint edit_controls_button_release (GdkEventButton*);
918 Gtk::Menu *edit_controls_left_menu;
919 Gtk::Menu *edit_controls_right_menu;
921 Gtk::VBox ruler_label_vbox;
922 Gtk::VBox track_canvas_vbox;
923 Gtk::VBox time_canvas_vbox;
924 Gtk::VBox edit_controls_vbox;
925 Gtk::HBox edit_controls_hbox;
927 void control_scroll (float);
928 void access_action (std::string,std::string);
929 bool deferred_control_scroll (nframes64_t);
930 sigc::connection control_scroll_connection;
932 gdouble get_trackview_group_vertical_offset () const { return vertical_adjustment.get_value () - canvas_timebars_vsize;}
934 ArdourCanvas::Group* get_background_group () const { return _background_group; }
935 ArdourCanvas::Group* get_trackview_group () const { return _trackview_group; }
936 double last_trackview_group_vertical_offset;
937 void tie_vertical_scrolling ();
938 void set_horizontal_position (double);
939 double horizontal_position () const;
940 void scroll_canvas_vertically ();
942 struct VisualChange {
950 nframes64_t time_origin;
951 double frames_per_unit;
956 VisualChange() : pending ((VisualChange::Type) 0), time_origin (0), frames_per_unit (0), idle_handler_id (-1) {}
958 pending = Type (pending | t);
963 VisualChange pending_visual_change;
965 static int _idle_visual_changer (void *arg);
966 int idle_visual_changer ();
968 void queue_visual_change (nframes64_t);
969 void queue_visual_change (double);
970 void queue_visual_change_y (double);
971 void ensure_visual_change_idle_handler ();
974 TrackViewList track_views;
975 std::pair<TimeAxisView*, ARDOUR::layer_t> trackview_by_y_position (double);
976 TimeAxisView* axis_view_from_route (boost::shared_ptr<ARDOUR::Route>) const;
978 TrackViewList get_tracks_for_range_action () const;
980 static Gdk::Cursor* cross_hair_cursor;
981 static Gdk::Cursor* trimmer_cursor;
982 static Gdk::Cursor* selector_cursor;
983 static Gdk::Cursor* grabber_cursor;
984 static Gdk::Cursor* grabber_edit_point_cursor;
985 static Gdk::Cursor* zoom_cursor;
986 static Gdk::Cursor* time_fx_cursor;
987 static Gdk::Cursor* fader_cursor;
988 static Gdk::Cursor* speaker_cursor;
989 static Gdk::Cursor* midi_pencil_cursor;
990 static Gdk::Cursor* midi_select_cursor;
991 static Gdk::Cursor* midi_resize_cursor;
992 static Gdk::Cursor* midi_erase_cursor;
993 static Gdk::Cursor* wait_cursor;
994 static Gdk::Cursor* timebar_cursor;
995 static Gdk::Cursor* transparent_cursor;
997 static void build_cursors ();
999 sigc::connection super_rapid_screen_update_connection;
1000 nframes64_t last_update_frame;
1001 void center_screen_internal (nframes64_t, float);
1003 void super_rapid_screen_update ();
1005 void session_going_away ();
1007 nframes64_t cut_buffer_start;
1008 nframes64_t cut_buffer_length;
1010 bool typed_event (ArdourCanvas::Item*, GdkEvent*, ItemType);
1011 bool button_press_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
1012 bool button_press_handler_1 (ArdourCanvas::Item *, GdkEvent *, ItemType);
1013 bool button_press_handler_2 (ArdourCanvas::Item *, GdkEvent *, ItemType);
1014 bool button_release_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
1015 bool motion_handler (ArdourCanvas::Item*, GdkEvent*, bool from_autoscroll = false);
1016 bool enter_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
1017 bool leave_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
1019 /* KEYMAP HANDLING */
1021 void register_actions ();
1023 int ensure_cursor (nframes64_t* pos);
1025 void cut_copy (Editing::CutCopyOp);
1026 bool can_cut_copy () const;
1027 void cut_copy_points (Editing::CutCopyOp);
1028 void cut_copy_regions (Editing::CutCopyOp, RegionSelection&);
1029 void cut_copy_ranges (Editing::CutCopyOp);
1030 void cut_copy_midi (Editing::CutCopyOp);
1032 void mouse_paste ();
1033 void paste_internal (nframes64_t position, float times);
1035 /* EDITING OPERATIONS */
1037 void reset_point_selection ();
1038 void toggle_region_mute ();
1039 void toggle_region_lock ();
1040 void toggle_region_opaque ();
1041 void toggle_record_enable ();
1042 void toggle_region_lock_style ();
1043 void raise_region ();
1044 void raise_region_to_top ();
1045 void lower_region ();
1046 void lower_region_to_bottom ();
1047 void split_regions_at (nframes64_t, RegionSelection&);
1048 void split_region_at_transients ();
1049 void split_region_at_points (boost::shared_ptr<ARDOUR::Region>, ARDOUR::AnalysisFeatureList&, bool can_ferret);
1050 void crop_region_to_selection ();
1051 void crop_region_to (nframes64_t start, nframes64_t end);
1052 void set_sync_point (nframes64_t, const RegionSelection&);
1053 void set_region_sync_from_edit_point ();
1054 void remove_region_sync();
1055 void align_selection (ARDOUR::RegionPoint, nframes64_t position, const RegionSelection&);
1056 void align_selection_relative (ARDOUR::RegionPoint point, nframes64_t position, const RegionSelection&);
1057 void align_region (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, nframes64_t position);
1058 void align_region_internal (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, nframes64_t position);
1059 void remove_selected_regions ();
1060 void remove_clicked_region ();
1061 void edit_region ();
1062 void show_midi_list_editor ();
1063 void rename_region ();
1064 void duplicate_some_regions (RegionSelection&, float times);
1065 void duplicate_selection (float times);
1066 void region_fill_selection ();
1068 void region_fill_track ();
1069 void audition_playlist_region_standalone (boost::shared_ptr<ARDOUR::Region>);
1070 void audition_playlist_region_via_route (boost::shared_ptr<ARDOUR::Region>, ARDOUR::Route&);
1071 void split_multichannel_region();
1072 void reverse_region ();
1073 void strip_region_silence ();
1074 void normalize_region ();
1075 double _last_normalization_value;
1076 void reset_region_scale_amplitude ();
1077 void adjust_region_scale_amplitude (bool up);
1078 void quantize_region ();
1079 void fork_region ();
1081 void do_insert_time ();
1082 void insert_time (nframes64_t, nframes64_t, Editing::InsertTimeOption, bool, bool, bool);
1084 void tab_to_transient (bool forward);
1086 void use_region_as_bar ();
1087 void use_range_as_bar ();
1089 void define_one_bar (nframes64_t start, nframes64_t end);
1091 void audition_region_from_region_list ();
1092 void hide_region_from_region_list ();
1093 void show_region_in_region_list ();
1095 void align (ARDOUR::RegionPoint);
1096 void align_relative (ARDOUR::RegionPoint);
1099 void reset_focus ();
1105 void paste (float times);
1107 int get_prefix (float&, bool&);
1109 void keyboard_paste ();
1110 void keyboard_insert_region_list_selection ();
1112 void region_from_selection ();
1113 void create_region_from_selection (std::vector<boost::shared_ptr<ARDOUR::Region> >&);
1115 void play_from_start ();
1116 void play_from_edit_point ();
1117 void play_from_edit_point_and_return ();
1118 void play_selected_region ();
1119 void play_edit_range ();
1120 void loop_selected_region ();
1121 void play_location (ARDOUR::Location&);
1122 void loop_location (ARDOUR::Location&);
1124 void temporal_zoom_selection ();
1125 void temporal_zoom_region (bool both_axes);
1126 void zoom_to_region (bool both_axes);
1127 void temporal_zoom_session ();
1128 void temporal_zoom (gdouble scale);
1129 void temporal_zoom_by_frame (nframes64_t start, nframes64_t end, const std::string & op);
1130 void temporal_zoom_to_frame (bool coarser, nframes64_t frame);
1132 void amplitude_zoom (gdouble scale);
1133 void amplitude_zoom_step (bool in);
1135 void insert_region_list_drag (boost::shared_ptr<ARDOUR::Region>, int x, int y);
1136 void insert_region_list_selection (float times);
1138 void insert_route_list_drag (boost::shared_ptr<ARDOUR::Route>, int x, int y);
1140 /* import & embed */
1142 void add_external_audio_action (Editing::ImportMode);
1143 void external_audio_dialog ();
1144 void session_import_dialog ();
1146 int check_whether_and_how_to_import(std::string, bool all_or_nothing = true);
1147 bool check_multichannel_status (const std::vector<Glib::ustring>& paths);
1149 SoundFileOmega* sfbrowser;
1151 void bring_in_external_audio (Editing::ImportMode mode, nframes64_t& pos);
1153 bool idle_drop_paths (std::vector<Glib::ustring> paths, nframes64_t frame, double ypos);
1154 void drop_paths_part_two (const std::vector<Glib::ustring>& paths, nframes64_t frame, double ypos);
1156 int import_sndfiles (std::vector<Glib::ustring> paths, Editing::ImportMode mode, ARDOUR::SrcQuality, nframes64_t& pos,
1157 int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>&, bool);
1158 int embed_sndfiles (std::vector<Glib::ustring> paths, bool multiple_files, bool& check_sample_rate, Editing::ImportMode mode,
1159 nframes64_t& pos, int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>&);
1161 int add_sources (std::vector<Glib::ustring> paths, ARDOUR::SourceList& sources, nframes64_t& pos, Editing::ImportMode,
1162 int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>&, bool add_channel_suffix);
1163 int finish_bringing_in_material (boost::shared_ptr<ARDOUR::Region> region, uint32_t, uint32_t, nframes64_t& pos, Editing::ImportMode mode,
1164 boost::shared_ptr<ARDOUR::Track>& existing_track);
1166 boost::shared_ptr<ARDOUR::AudioTrack> get_nth_selected_audio_track (int nth) const;
1167 boost::shared_ptr<ARDOUR::MidiTrack> get_nth_selected_midi_track (int nth) const;
1169 ARDOUR::InterThreadInfo* current_interthread_info;
1171 AnalysisWindow* analysis_window;
1173 /* import specific info */
1175 struct EditorImportStatus : public ARDOUR::ImportStatus {
1176 Editing::ImportMode mode;
1180 boost::shared_ptr<ARDOUR::Track> track;
1184 EditorImportStatus import_status;
1185 static void *_import_thread (void *);
1186 void* import_thread ();
1187 void finish_import ();
1189 /* to support this ... */
1191 void import_audio (bool as_tracks);
1192 void do_import (std::vector<Glib::ustring> paths, bool split, bool as_tracks);
1194 void move_to_start ();
1195 void move_to_end ();
1197 void center_playhead ();
1198 void center_edit_point ();
1199 void edit_cursor_backward ();
1200 void edit_cursor_forward ();
1201 void playhead_forward_to_grid ();
1202 void playhead_backward_to_grid ();
1203 void playhead_backward ();
1204 void playhead_forward ();
1205 void scroll_playhead (bool forward);
1206 void scroll_backward (float pages=0.8f);
1207 void scroll_forward (float pages=0.8f);
1208 void scroll_tracks_down ();
1209 void scroll_tracks_up ();
1210 void delete_sample_forward ();
1211 void delete_sample_backward ();
1212 void delete_screen ();
1213 void search_backwards ();
1214 void search_forwards ();
1216 void clear_markers ();
1217 void clear_ranges ();
1218 void clear_locations ();
1219 void unhide_markers ();
1220 void unhide_ranges ();
1221 void jump_forward_to_mark ();
1222 void jump_backward_to_mark ();
1223 void cursor_align (bool playhead_to_edit);
1225 void remove_last_capture ();
1226 void select_all_selectables_using_time_selection ();
1227 void select_all_selectables_using_loop();
1228 void select_all_selectables_using_punch();
1229 void set_selection_from_range (ARDOUR::Location&);
1230 void set_selection_from_punch ();
1231 void set_selection_from_loop ();
1232 void set_selection_from_region ();
1234 void add_location_mark (nframes64_t where);
1235 void add_location_from_audio_region ();
1236 void add_locations_from_audio_region ();
1237 void add_location_from_selection ();
1238 void set_loop_from_selection (bool play);
1239 void set_punch_from_selection ();
1240 void set_punch_from_region ();
1242 void set_loop_from_edit_range (bool play);
1243 void set_loop_from_region (bool play);
1244 void set_punch_from_edit_range ();
1246 void set_loop_range (nframes64_t start, nframes64_t end, std::string cmd);
1247 void set_punch_range (nframes64_t start, nframes64_t end, std::string cmd);
1249 void add_location_from_playhead_cursor ();
1250 bool select_new_marker;
1252 void reverse_selection ();
1253 void edit_envelope ();
1255 double last_scrub_x;
1256 int scrubbing_direction;
1257 int scrub_reversals;
1258 int scrub_reverse_distance;
1259 void scrub (nframes64_t, double);
1261 void keyboard_selection_begin ();
1262 void keyboard_selection_finish (bool add);
1263 bool have_pending_keyboard_selection;
1264 nframes64_t pending_keyboard_selection_start;
1266 boost::shared_ptr<ARDOUR::Region> select_region_for_operation (int dir, TimeAxisView **tv);
1267 void extend_selection_to_end_of_region (bool next);
1268 void extend_selection_to_start_of_region (bool previous);
1270 Editing::SnapType _snap_type;
1271 Editing::SnapMode _snap_mode;
1273 /// Snap threshold in pixels
1274 double snap_threshold;
1276 bool ignore_gui_changes;
1278 DragManager* _drags;
1282 Gtk::Menu fade_context_menu;
1283 void popup_fade_context_menu (int, int, ArdourCanvas::Item*, ItemType);
1285 void set_fade_in_shape (ARDOUR::AudioRegion::FadeShape);
1286 void set_fade_out_shape (ARDOUR::AudioRegion::FadeShape);
1288 void set_fade_length (bool in);
1289 void toggle_fade_active (bool in);
1290 void set_fade_in_active (bool);
1291 void set_fade_out_active (bool);
1293 std::set<boost::shared_ptr<ARDOUR::Playlist> > motion_frozen_playlists;
1295 bool _dragging_playhead;
1296 bool _dragging_edit_point;
1298 void marker_drag_motion_callback (GdkEvent*);
1299 void marker_drag_finished_callback (GdkEvent*);
1301 gint mouse_rename_region (ArdourCanvas::Item*, GdkEvent*);
1303 void add_region_drag (ArdourCanvas::Item*, GdkEvent*, RegionView*);
1304 void start_create_region_grab (ArdourCanvas::Item*, GdkEvent*);
1305 void add_region_copy_drag (ArdourCanvas::Item*, GdkEvent*, RegionView*);
1306 void add_region_brush_drag (ArdourCanvas::Item*, GdkEvent*, RegionView*);
1307 void start_selection_grab (ArdourCanvas::Item*, GdkEvent*);
1309 void region_view_item_click (AudioRegionView&, GdkEventButton*);
1311 void remove_gain_control_point (ArdourCanvas::Item*, GdkEvent*);
1312 void remove_control_point (ArdourCanvas::Item*, GdkEvent*);
1314 void mouse_brush_insert_region (RegionView*, nframes64_t pos);
1315 void brush (nframes64_t);
1317 void show_verbose_time_cursor (nframes64_t frame, double offset = 0, double xpos=-1, double ypos=-1);
1318 void show_verbose_duration_cursor (nframes64_t start, nframes64_t end, double offset = 0, double xpos=-1, double ypos=-1);
1319 double clamp_verbose_cursor_x (double);
1320 double clamp_verbose_cursor_y (double);
1322 /* Canvas event handlers */
1324 bool canvas_control_point_event (GdkEvent* event,ArdourCanvas::Item*, ControlPoint*);
1325 bool canvas_line_event (GdkEvent* event,ArdourCanvas::Item*, AutomationLine*);
1326 bool canvas_selection_rect_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1327 bool canvas_selection_start_trim_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1328 bool canvas_selection_end_trim_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1329 bool canvas_crossfade_view_event (GdkEvent* event,ArdourCanvas::Item*, CrossfadeView*);
1330 bool canvas_fade_in_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1331 bool canvas_fade_in_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1332 bool canvas_fade_out_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1333 bool canvas_fade_out_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1336 // These variables are used to detect a feedback loop and break it to avoid a gui hang
1338 ArdourCanvas::Item *last_item_entered;
1339 int last_item_entered_n;
1342 bool canvas_region_view_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1343 bool canvas_frame_handle_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1344 bool canvas_region_view_name_highlight_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1345 bool canvas_region_view_name_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1346 bool canvas_stream_view_event (GdkEvent* event,ArdourCanvas::Item*, RouteTimeAxisView*);
1347 bool canvas_marker_event (GdkEvent* event,ArdourCanvas::Item*, Marker*);
1348 bool canvas_zoom_rect_event (GdkEvent* event,ArdourCanvas::Item*);
1349 bool canvas_tempo_marker_event (GdkEvent* event,ArdourCanvas::Item*, TempoMarker*);
1350 bool canvas_meter_marker_event (GdkEvent* event,ArdourCanvas::Item*, MeterMarker*);
1351 bool canvas_automation_track_event(GdkEvent* event, ArdourCanvas::Item*, AutomationTimeAxisView*) ;
1352 bool canvas_note_event (GdkEvent* event, ArdourCanvas::Item*);
1354 bool canvas_tempo_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1355 bool canvas_meter_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1356 bool canvas_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1357 bool canvas_range_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1358 bool canvas_transport_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1359 bool canvas_cd_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1361 bool canvas_imageframe_item_view_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1362 bool canvas_imageframe_view_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameTimeAxis*);
1363 bool canvas_imageframe_start_handle_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1364 bool canvas_imageframe_end_handle_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1365 bool canvas_marker_time_axis_view_event(GdkEvent* event, ArdourCanvas::Item*,MarkerTimeAxis*);
1366 bool canvas_markerview_item_view_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1367 bool canvas_markerview_start_handle_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1368 bool canvas_markerview_end_handle_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1371 friend class DragManager;
1372 friend class EditorRouteGroups;
1373 friend class EditorRegions;
1375 /* non-public event handlers */
1377 bool canvas_playhead_cursor_event (GdkEvent* event, ArdourCanvas::Item*);
1378 bool track_canvas_scroll (GdkEventScroll* event);
1380 bool track_canvas_scroll_event (GdkEventScroll* event);
1381 bool track_canvas_button_press_event (GdkEventButton* event);
1382 bool track_canvas_button_release_event (GdkEventButton* event);
1383 bool track_canvas_motion_notify_event (GdkEventMotion* event);
1385 Gtk::Allocation canvas_allocation;
1386 void track_canvas_allocate (Gtk::Allocation alloc);
1387 bool track_canvas_size_allocated ();
1388 bool track_canvas_drag_motion (Glib::RefPtr<Gdk::DragContext> const &, int, int, guint);
1390 void set_playhead_cursor ();
1392 void kbd_driver (sigc::slot<void,GdkEvent*>, bool use_track_canvas = true, bool use_time_canvas = true, bool can_select = true);
1393 void kbd_mute_unmute_region ();
1396 void kbd_do_brush (GdkEvent*);
1397 void kbd_do_audition (GdkEvent*);
1399 void initialize_canvas ();
1401 /* display control */
1403 bool _show_measures;
1404 /// true if the editor should follow the playhead, otherwise false
1405 bool _follow_playhead;
1406 /// true if we scroll the tracks rather than the playhead
1407 bool _stationary_playhead;
1409 ARDOUR::TempoMap::BBTPointList *current_bbt_points;
1411 TempoLines* tempo_lines;
1413 ArdourCanvas::Group* time_line_group;
1415 void hide_measures ();
1416 void draw_measures ();
1417 bool redraw_measures ();
1419 void new_tempo_section ();
1421 void mouse_add_new_tempo_event (nframes64_t where);
1422 void mouse_add_new_meter_event (nframes64_t where);
1424 void remove_tempo_marker (ArdourCanvas::Item*);
1425 void remove_meter_marker (ArdourCanvas::Item*);
1426 gint real_remove_tempo_marker (ARDOUR::TempoSection*);
1427 gint real_remove_meter_marker (ARDOUR::MeterSection*);
1429 void edit_tempo_section (ARDOUR::TempoSection*);
1430 void edit_meter_section (ARDOUR::MeterSection*);
1431 void edit_tempo_marker (ArdourCanvas::Item*);
1432 void edit_meter_marker (ArdourCanvas::Item*);
1433 void edit_control_point (ArdourCanvas::Item*);
1435 void marker_menu_edit ();
1436 void marker_menu_remove ();
1437 void marker_menu_rename ();
1438 void marker_menu_lock (bool yn);
1439 void marker_menu_hide ();
1440 void marker_menu_loop_range ();
1441 void marker_menu_select_all_selectables_using_range ();
1442 void marker_menu_select_using_range ();
1443 void marker_menu_separate_regions_using_location ();
1444 void marker_menu_play_from ();
1445 void marker_menu_play_range ();
1446 void marker_menu_set_playhead ();
1447 void marker_menu_set_from_playhead ();
1448 void marker_menu_set_from_selection ();
1449 void marker_menu_range_to_next ();
1450 void new_transport_marker_menu_set_loop ();
1451 void new_transport_marker_menu_set_punch ();
1452 void update_loop_range_view (bool visibility=false);
1453 void update_punch_range_view (bool visibility=false);
1454 void new_transport_marker_menu_popdown ();
1455 void marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1456 void tempo_or_meter_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1457 void transport_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1458 void new_transport_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1459 void build_range_marker_menu (bool loop_or_punch);
1460 void build_marker_menu (bool);
1461 void build_tempo_or_meter_marker_menu (bool);
1462 void build_new_transport_marker_menu ();
1463 void dynamic_cast_marker_object (void*, MeterMarker**, TempoMarker**) const;
1465 Gtk::Menu* tempo_or_meter_marker_menu;
1466 Gtk::Menu* marker_menu;
1467 Gtk::Menu* session_range_marker_menu;
1468 Gtk::Menu* range_marker_menu;
1469 Gtk::Menu* transport_marker_menu;
1470 Gtk::Menu* new_transport_marker_menu;
1471 Gtk::Menu* cd_marker_menu;
1472 ArdourCanvas::Item* marker_menu_item;
1474 typedef std::list<Marker*> Marks;
1477 void remove_metric_marks ();
1478 void draw_metric_marks (const ARDOUR::Metrics& metrics);
1480 void compute_current_bbt_points (nframes_t left, nframes_t right);
1481 void tempo_map_changed (const PBD::PropertyChange&);
1482 void redisplay_tempo (bool immediate_redraw);
1484 uint32_t bbt_beat_subdivision;
1488 Gtk::ToggleButton editor_mixer_button;
1489 Gtk::ToggleButton editor_list_button;
1490 void editor_mixer_button_toggled ();
1491 void editor_list_button_toggled ();
1493 AudioClock zoom_range_clock;
1494 Gtk::Button zoom_in_button;
1495 Gtk::Button zoom_out_button;
1496 Gtk::Button zoom_out_full_button;
1497 Gtk::Button zoom_onetoone_button;
1499 Gtk::Button tav_expand_button;
1500 Gtk::Button tav_shrink_button;
1502 Gtk::VBox toolbar_clock_vbox;
1503 Gtk::VBox toolbar_selection_clock_vbox;
1504 Gtk::Table toolbar_selection_clock_table;
1505 Gtk::Label toolbar_selection_cursor_label;
1507 Gtkmm2ext::TearOff* _mouse_mode_tearoff;
1508 Gtk::ToggleButton mouse_select_button;
1509 Gtk::ToggleButton mouse_move_button;
1510 Gtk::ToggleButton mouse_gain_button;
1511 Gtk::ToggleButton mouse_zoom_button;
1512 Gtk::ToggleButton mouse_timefx_button;
1513 Gtk::ToggleButton mouse_audition_button;
1514 Gtk::ToggleButton join_object_range_button;
1516 void mouse_mode_toggled (Editing::MouseMode m);
1517 bool ignore_mouse_mode_toggle;
1519 Gtk::ToggleButton internal_edit_button;
1520 void toggle_internal_editing ();
1522 gint mouse_select_button_release (GdkEventButton*);
1524 Gtk::VBox automation_box;
1525 Gtk::Button automation_mode_button;
1526 Gtk::ToggleButton global_automation_button;
1528 Gtk::ComboBoxText edit_mode_selector;
1529 Gtk::VBox edit_mode_box;
1531 void set_edit_mode (ARDOUR::EditMode);
1532 void cycle_edit_mode ();
1533 void edit_mode_selection_done ();
1535 Gtk::ComboBoxText snap_type_selector;
1536 Gtk::ComboBoxText snap_mode_selector;
1539 std::vector<std::string> snap_type_strings;
1540 std::vector<std::string> snap_mode_strings;
1542 void snap_type_selection_done ();
1543 void snap_mode_selection_done ();
1544 void snap_mode_chosen (Editing::SnapMode);
1545 void snap_type_chosen (Editing::SnapType);
1547 Glib::RefPtr<Gtk::RadioAction> snap_type_action (Editing::SnapType);
1548 Glib::RefPtr<Gtk::RadioAction> snap_mode_action (Editing::SnapMode);
1550 Gtk::ComboBoxText zoom_focus_selector;
1551 Gtk::VBox zoom_focus_box;
1553 std::vector<std::string> zoom_focus_strings;
1555 void zoom_focus_selection_done ();
1556 void zoom_focus_chosen (Editing::ZoomFocus);
1558 Glib::RefPtr<Gtk::RadioAction> zoom_focus_action (Editing::ZoomFocus);
1561 Gtk::HBox track_zoom_box;
1562 Gtk::VBox zoom_vbox;
1564 void zoom_adjustment_changed();
1566 void setup_toolbar ();
1568 void setup_tooltips ();
1570 Gtkmm2ext::TearOff* _tools_tearoff;
1571 Gtk::HBox toolbar_hbox;
1572 Gtk::EventBox toolbar_base;
1573 Gtk::Frame toolbar_frame;
1577 Gtk::HBox panic_box;
1578 Gtk::Button midi_panic_button;
1579 Gtk::ToggleButton midi_sound_notes;
1581 bool sound_notes () const { return midi_sound_notes.get_active(); }
1583 void setup_midi_toolbar ();
1585 /* selection process */
1587 Selection* selection;
1588 Selection* cut_buffer;
1590 void time_selection_changed ();
1591 void track_selection_changed ();
1592 void region_selection_changed ();
1593 sigc::connection editor_regions_selection_changed_connection;
1594 void sensitize_the_right_region_actions (bool have_selected_regions);
1595 void point_selection_changed ();
1596 void marker_selection_changed ();
1598 void cancel_selection ();
1600 void region_selection_op (void (ARDOUR::Region::*pmf)(void));
1601 void region_selection_op (void (ARDOUR::Region::*pmf)(void*), void*);
1602 void region_selection_op (void (ARDOUR::Region::*pmf)(bool), bool);
1604 bool audio_region_selection_covers (nframes64_t where);
1606 /* transport range select process */
1608 ArdourCanvas::SimpleRect* cd_marker_bar_drag_rect;
1609 ArdourCanvas::SimpleRect* range_bar_drag_rect;
1610 ArdourCanvas::SimpleRect* transport_bar_drag_rect;
1613 ArdourCanvas::SimpleRect *bogus_background_rect;
1615 ArdourCanvas::SimpleRect *transport_bar_range_rect;
1616 ArdourCanvas::SimpleRect *transport_bar_preroll_rect;
1617 ArdourCanvas::SimpleRect *transport_bar_postroll_rect;
1618 ArdourCanvas::SimpleRect *transport_loop_range_rect;
1619 ArdourCanvas::SimpleRect *transport_punch_range_rect;
1620 ArdourCanvas::SimpleLine *transport_punchin_line;
1621 ArdourCanvas::SimpleLine *transport_punchout_line;
1622 ArdourCanvas::SimpleRect *transport_preroll_rect;
1623 ArdourCanvas::SimpleRect *transport_postroll_rect;
1625 ARDOUR::Location* transport_loop_location();
1626 ARDOUR::Location* transport_punch_location();
1628 ARDOUR::Location *temp_location;
1630 /* object rubberband select process */
1632 bool select_all_within (nframes64_t, nframes64_t, double, double, TrackViewList const &, Selection::Operation op);
1634 ArdourCanvas::SimpleRect *rubberband_rect;
1636 /* mouse zoom process */
1638 ArdourCanvas::SimpleRect *zoom_rect;
1639 void reposition_zoom_rect (nframes64_t start, nframes64_t end);
1641 EditorRouteGroups* _route_groups;
1642 EditorRoutes* _routes;
1643 EditorRegions* _regions;
1644 EditorSnapshots* _snapshots;
1645 EditorLocations* _locations;
1647 /* diskstream/route display management */
1648 Glib::RefPtr<Gdk::Pixbuf> rec_enabled_icon;
1649 Glib::RefPtr<Gdk::Pixbuf> rec_disabled_icon;
1651 Glib::RefPtr<Gtk::TreeSelection> route_display_selection;
1653 bool sync_track_view_list_and_routes ();
1655 Gtk::VBox list_vpacker;
1659 bool autoscroll_active;
1660 int autoscroll_timeout_tag;
1663 int last_autoscroll_x;
1664 int last_autoscroll_y;
1665 uint32_t autoscroll_cnt;
1666 nframes64_t autoscroll_x_distance;
1667 double autoscroll_y_distance;
1669 static gint _autoscroll_canvas (void *);
1670 bool autoscroll_canvas ();
1671 void start_canvas_autoscroll (int x, int y);
1672 void stop_canvas_autoscroll ();
1673 void maybe_autoscroll (GdkEventMotion*, bool);
1674 bool allow_vertical_scroll;
1677 void point_trim (GdkEvent *, nframes64_t);
1678 void single_contents_trim (RegionView&, nframes64_t, bool, bool);
1679 void single_start_trim (RegionView&, nframes64_t, bool);
1680 void single_end_trim (RegionView&, nframes64_t, bool);
1682 void thaw_region_after_trim (RegionView& rv);
1684 void trim_region_front();
1685 void trim_region_back();
1686 void trim_region (bool front);
1688 void trim_region_to_edit_point ();
1689 void trim_region_from_edit_point ();
1690 void trim_region_to_loop ();
1691 void trim_region_to_punch ();
1692 void trim_region_to_location (const ARDOUR::Location&, const char* cmd);
1694 void trim_to_region(bool forward);
1695 void trim_region_to_previous_region_end();
1696 void trim_region_to_next_region_start();
1698 bool show_gain_after_trim;
1702 int convert_drop_to_paths (
1703 std::vector<Glib::ustring>& paths,
1704 const Glib::RefPtr<Gdk::DragContext>& context,
1707 const Gtk::SelectionData& data,
1711 void track_canvas_drag_data_received (
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,
1736 const Glib::RefPtr<Gdk::DragContext>& context,
1739 const Gtk::SelectionData& data,
1745 int write_region_selection(RegionSelection&);
1746 bool write_region (std::string path, boost::shared_ptr<ARDOUR::AudioRegion>);
1747 void bounce_region_selection ();
1748 void bounce_range_selection (bool replace, bool enable_processing);
1749 void external_edit_region ();
1751 int write_audio_selection (TimeSelection&);
1752 bool write_audio_range (ARDOUR::AudioPlaylist&, const ARDOUR::ChanCount& channels, std::list<ARDOUR::AudioRange>&);
1754 void write_selection ();
1756 XMLNode *before; /* used in *_reversible_command */
1758 void update_title ();
1759 void update_title_s (const std::string & snapshot_name);
1762 Selection* selection;
1763 double frames_per_unit;
1765 State (PublicEditor const * e);
1769 void instant_save ();
1771 boost::shared_ptr<ARDOUR::AudioRegion> last_audition_region;
1773 /* freeze operations */
1775 ARDOUR::InterThreadInfo freeze_status;
1776 static void* _freeze_thread (void*);
1777 void* freeze_thread ();
1779 void freeze_route ();
1780 void unfreeze_route ();
1782 /* route-group solo + mute */
1784 void set_route_group_solo (ARDOUR::Route&, bool);
1785 void set_route_group_mute (ARDOUR::Route&, bool);
1789 void duplicate_dialog (bool with_dialog);
1791 nframes64_t event_frame (GdkEvent const *, double* px = 0, double* py = 0) const;
1793 /* returns false if mouse pointer is not in track or marker canvas
1795 bool mouse_frame (nframes64_t&, bool& in_track_canvas) const;
1797 /* "whats mine is yours" */
1799 TimeFXDialog* current_timefx;
1801 static void* timefx_thread (void *arg);
1802 void do_timefx (TimeFXDialog&);
1804 int time_stretch (RegionSelection&, float fraction);
1805 int pitch_shift (RegionSelection&, float cents);
1806 void pitch_shift_regions ();
1807 int time_fx (RegionSelection&, float val, bool pitching);
1809 /* editor-mixer strip */
1811 MixerStrip *current_mixer_strip;
1812 bool show_editor_mixer_when_tracks_arrive;
1813 Gtk::VBox current_mixer_strip_vbox;
1814 void cms_new (boost::shared_ptr<ARDOUR::Route>);
1815 void current_mixer_strip_hidden ();
1817 void detach_tearoff (Gtk::Box* b, Gtk::Window* w);
1818 void reattach_tearoff (Gtk::Box* b, Gtk::Window* w, int32_t n);
1820 void ensure_all_elements_drawn ();
1822 /* nudging tracks */
1824 void nudge_track (bool use_edit_point, bool forwards);
1828 bool _xfade_visibility;
1831 void handle_new_imageframe_time_axis_view(const std::string & track_name, void* src) ;
1832 void handle_new_imageframe_marker_time_axis_view(const std::string & track_name, TimeAxisView* marked_track) ;
1834 void start_imageframe_grab(ArdourCanvas::Item*, GdkEvent*) ;
1835 void start_markerview_grab(ArdourCanvas::Item*, GdkEvent*) ;
1837 void imageframe_drag_motion_callback(ArdourCanvas::Item*, GdkEvent*) ;
1838 void markerview_drag_motion_callback(ArdourCanvas::Item*, GdkEvent*) ;
1839 void timeaxis_item_drag_finished_callback(ArdourCanvas::Item*, GdkEvent*) ;
1841 gint canvas_imageframe_item_view_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameView* ifv);
1842 gint canvas_imageframe_view_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameTimeAxis* ifta);
1843 gint canvas_imageframe_start_handle_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameView* ifv);
1844 gint canvas_imageframe_end_handle_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameView* ifv);
1846 gint canvas_marker_time_axis_view_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerTimeAxis* mta);
1847 gint canvas_markerview_item_view_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerView* mv);
1848 gint canvas_markerview_start_handle_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerView* mv);
1849 gint canvas_markerview_end_handle_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerView* mv);
1851 void imageframe_start_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1852 void imageframe_end_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1853 void imageframe_start_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1854 void imageframe_start_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1855 void imageframe_end_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1856 void imageframe_end_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1858 void markerview_item_start_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1859 void markerview_item_end_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1860 void markerview_start_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1861 void markerview_start_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1862 void markerview_end_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1863 void markerview_end_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1865 void popup_imageframe_edit_menu(int button, int32_t time, ArdourCanvas::Item* ifv, bool with_frame) ;
1866 void popup_marker_time_axis_edit_menu(int button, int32_t time, ArdourCanvas::Item* ifv, bool with_frame) ;
1868 ImageFrameSocketHandler* image_socket_listener ;
1871 void toggle_xfade_active (boost::weak_ptr<ARDOUR::Crossfade>);
1872 void toggle_xfade_length (boost::weak_ptr<ARDOUR::Crossfade>);
1873 void edit_xfade (boost::weak_ptr<ARDOUR::Crossfade>);
1874 void xfade_edit_left_region ();
1875 void xfade_edit_right_region ();
1877 static const int32_t default_width = 995;
1878 static const int32_t default_height = 765;
1882 Gtk::Button nudge_forward_button;
1883 Gtk::Button nudge_backward_button;
1884 Gtk::HBox nudge_hbox;
1885 Gtk::VBox nudge_vbox;
1886 AudioClock nudge_clock;
1888 bool nudge_forward_release (GdkEventButton*);
1889 bool nudge_backward_release (GdkEventButton*);
1893 void apply_filter (ARDOUR::Filter&, std::string cmd);
1895 Command* apply_midi_note_edit_op_to_region (ARDOUR::MidiOperator& op, MidiRegionView& mrv);
1896 void apply_midi_note_edit_op (ARDOUR::MidiOperator& op);
1898 /* handling cleanup */
1900 int playlist_deletion_dialog (boost::shared_ptr<ARDOUR::Playlist>);
1902 PBD::ScopedConnectionList session_connections;
1904 /* tracking step changes of track height */
1906 TimeAxisView* current_stepping_trackview;
1907 ARDOUR::microseconds_t last_track_height_step_timestamp;
1908 gint track_height_step_timeout();
1909 sigc::connection step_timeout;
1911 TimeAxisView* entered_track;
1912 RegionView* entered_regionview;
1915 void ensure_entered_track_selected (bool op_acts_on_objects = false);
1916 bool clear_entered_track;
1917 bool left_track_canvas (GdkEventCrossing*);
1918 bool entered_track_canvas (GdkEventCrossing*);
1919 void set_entered_track (TimeAxisView*);
1920 void set_entered_regionview (RegionView*);
1921 void ensure_track_visible (TimeAxisView*);
1922 gint left_automation_track ();
1924 void reset_canvas_action_sensitivity (bool);
1925 void toggle_gain_envelope_visibility ();
1926 void toggle_gain_envelope_active ();
1927 void reset_region_gain_envelopes ();
1929 bool on_key_press_event (GdkEventKey*);
1930 bool on_key_release_event (GdkEventKey*);
1932 void session_state_saved (std::string);
1934 Glib::RefPtr<Gtk::Action> undo_action;
1935 Glib::RefPtr<Gtk::Action> redo_action;
1937 void history_changed ();
1939 Gtk::HBox status_bar_hpacker;
1941 Editing::EditPoint _edit_point;
1943 Gtk::ComboBoxText edit_point_selector;
1945 void set_edit_point_preference (Editing::EditPoint ep, bool force = false);
1946 void cycle_edit_point (bool with_marker);
1947 void set_edit_point ();
1948 void edit_point_selection_done ();
1949 void edit_point_chosen (Editing::EditPoint);
1950 Glib::RefPtr<Gtk::RadioAction> edit_point_action (Editing::EditPoint);
1951 std::vector<std::string> edit_point_strings;
1953 void selected_marker_moved (ARDOUR::Location*);
1955 bool get_edit_op_range (nframes64_t& start, nframes64_t& end) const;
1957 void get_regions_at (RegionSelection&, nframes64_t where, const TrackViewList& ts) const;
1958 void get_regions_after (RegionSelection&, nframes64_t where, const TrackViewList& ts) const;
1960 void get_regions_for_action (RegionSelection&, bool allow_entered = false, bool allow_edit_position = true);
1962 void start_updating_meters ();
1963 void stop_updating_meters ();
1964 bool meters_running;
1966 void select_next_route ();
1967 void select_prev_route ();
1969 void snap_to_internal (nframes64_t& first, int32_t direction = 0, bool for_mark = false);
1970 void timecode_snap_to_internal (nframes64_t& first, int32_t direction = 0, bool for_mark = false);
1972 RhythmFerret* rhythm_ferret;
1973 BundleManager* _bundle_manager;
1974 GlobalPortMatrixWindow* _global_port_matrix[ARDOUR::DataType::num_types];
1976 void fit_tracks (TrackViewList &);
1977 void fit_selected_tracks ();
1978 void set_track_height (Height);
1980 void remove_tracks ();
1981 void toggle_tracks_active ();
1985 static gboolean _idle_resize (gpointer);
1987 int32_t _pending_resize_amount;
1988 TimeAxisView* _pending_resize_view;
1990 void visible_order_range (int*, int*) const;
1994 /** true if we've made a locate request that hasn't yet been processed */
1995 bool _pending_locate_request;
1997 /** if true, there is a pending Session locate which is the initial one when loading a session;
1998 we need to know this so that we don't (necessarily) set the viewport to show the playhead
2001 bool _pending_initial_locate;
2003 Gtk::HBox _summary_hbox;
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__ */