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;
876 Gtk::Adjustment vertical_adjustment;
877 Gtk::Adjustment horizontal_adjustment;
879 Gtk::Layout controls_layout;
880 bool control_layout_scroll (GdkEventScroll* ev);
881 void controls_layout_size_request (Gtk::Requisition*);
882 sigc::connection controls_layout_size_request_connection;
884 void horizontal_scroll_left ();
885 void horizontal_scroll_right ();
887 double _canvas_width;
888 double _canvas_height;
889 double full_canvas_height;
891 bool track_canvas_map_handler (GdkEventAny*);
893 gint edit_controls_button_release (GdkEventButton*);
894 Gtk::Menu *edit_controls_left_menu;
895 Gtk::Menu *edit_controls_right_menu;
897 Gtk::VBox ruler_label_vbox;
898 Gtk::VBox track_canvas_vbox;
899 Gtk::VBox time_canvas_vbox;
900 Gtk::VBox edit_controls_vbox;
901 Gtk::HBox edit_controls_hbox;
903 void control_scroll (float);
904 void access_action (std::string,std::string);
905 bool deferred_control_scroll (nframes64_t);
906 sigc::connection control_scroll_connection;
908 gdouble get_trackview_group_vertical_offset () const { return vertical_adjustment.get_value () - canvas_timebars_vsize;}
910 ArdourCanvas::Group* get_background_group () const { return _background_group; }
911 ArdourCanvas::Group* get_trackview_group () const { return _trackview_group; }
912 double last_trackview_group_vertical_offset;
913 void tie_vertical_scrolling ();
914 void scroll_canvas_horizontally ();
915 void scroll_canvas_vertically ();
917 struct VisualChange {
925 nframes64_t time_origin;
926 double frames_per_unit;
931 VisualChange() : pending ((VisualChange::Type) 0), time_origin (0), frames_per_unit (0), idle_handler_id (-1) {}
933 pending = Type (pending | t);
938 VisualChange pending_visual_change;
940 static int _idle_visual_changer (void *arg);
941 int idle_visual_changer ();
943 void queue_visual_change (nframes64_t);
944 void queue_visual_change (double);
945 void queue_visual_change_y (double);
946 void ensure_visual_change_idle_handler ();
948 void end_location_changed (ARDOUR::Location*);
951 TrackViewList track_views;
952 std::pair<TimeAxisView*, ARDOUR::layer_t> trackview_by_y_position (double);
953 TimeAxisView* axis_view_from_route (boost::shared_ptr<ARDOUR::Route>) const;
954 TrackSelection axis_views_from_routes (boost::shared_ptr<ARDOUR::RouteList>) const;
956 TrackSelection get_tracks_for_range_action () const;
958 static Gdk::Cursor* cross_hair_cursor;
959 static Gdk::Cursor* trimmer_cursor;
960 static Gdk::Cursor* selector_cursor;
961 static Gdk::Cursor* grabber_cursor;
962 static Gdk::Cursor* grabber_edit_point_cursor;
963 static Gdk::Cursor* zoom_cursor;
964 static Gdk::Cursor* time_fx_cursor;
965 static Gdk::Cursor* fader_cursor;
966 static Gdk::Cursor* speaker_cursor;
967 static Gdk::Cursor* midi_pencil_cursor;
968 static Gdk::Cursor* midi_select_cursor;
969 static Gdk::Cursor* midi_resize_cursor;
970 static Gdk::Cursor* midi_erase_cursor;
971 static Gdk::Cursor* wait_cursor;
972 static Gdk::Cursor* timebar_cursor;
973 static Gdk::Cursor* transparent_cursor;
975 static void build_cursors ();
977 sigc::connection scroll_connection;
978 nframes64_t last_update_frame;
979 void center_screen_internal (nframes64_t, float);
981 void update_current_screen ();
983 void session_going_away ();
985 nframes64_t cut_buffer_start;
986 nframes64_t cut_buffer_length;
988 bool typed_event (ArdourCanvas::Item*, GdkEvent*, ItemType);
989 bool button_press_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
990 bool button_press_handler_1 (ArdourCanvas::Item *, GdkEvent *, ItemType);
991 bool button_press_handler_2 (ArdourCanvas::Item *, GdkEvent *, ItemType);
992 bool button_release_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
993 bool motion_handler (ArdourCanvas::Item*, GdkEvent*, bool from_autoscroll = false);
994 bool enter_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
995 bool leave_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
997 /* KEYMAP HANDLING */
999 void register_actions ();
1001 int ensure_cursor (nframes64_t* pos);
1003 void cut_copy (Editing::CutCopyOp);
1004 bool can_cut_copy () const;
1005 void cut_copy_points (Editing::CutCopyOp);
1006 void cut_copy_regions (Editing::CutCopyOp, RegionSelection&);
1007 void cut_copy_ranges (Editing::CutCopyOp);
1008 void cut_copy_midi (Editing::CutCopyOp);
1010 void mouse_paste ();
1011 void paste_internal (nframes64_t position, float times);
1013 /* EDITING OPERATIONS */
1015 void reset_point_selection ();
1016 void toggle_region_mute ();
1017 void toggle_region_lock ();
1018 void toggle_region_opaque ();
1019 void toggle_record_enable ();
1020 void set_region_lock_style (ARDOUR::Region::PositionLockStyle);
1021 void raise_region ();
1022 void raise_region_to_top ();
1023 void lower_region ();
1024 void lower_region_to_bottom ();
1025 void split_regions_at (nframes64_t, RegionSelection&);
1026 void split_region_at_transients ();
1027 void split_region_at_points (boost::shared_ptr<ARDOUR::Region>, ARDOUR::AnalysisFeatureList&, bool can_ferret);
1028 void crop_region_to_selection ();
1029 void crop_region_to (nframes64_t start, nframes64_t end);
1030 void set_sync_point (nframes64_t, const RegionSelection&);
1031 void set_region_sync_from_edit_point ();
1032 void remove_region_sync();
1033 void align_selection (ARDOUR::RegionPoint, nframes64_t position, const RegionSelection&);
1034 void align_selection_relative (ARDOUR::RegionPoint point, nframes64_t position, const RegionSelection&);
1035 void align_region (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, nframes64_t position);
1036 void align_region_internal (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, nframes64_t position);
1037 void remove_selected_regions ();
1038 void remove_clicked_region ();
1039 void edit_region ();
1040 void show_midi_list_editor ();
1041 void rename_region ();
1042 void duplicate_some_regions (RegionSelection&, float times);
1043 void duplicate_selection (float times);
1044 void region_fill_selection ();
1046 void region_fill_track ();
1047 void audition_playlist_region_standalone (boost::shared_ptr<ARDOUR::Region>);
1048 void audition_playlist_region_via_route (boost::shared_ptr<ARDOUR::Region>, ARDOUR::Route&);
1049 void split_multichannel_region();
1050 void reverse_region ();
1051 void strip_region_silence ();
1052 void normalize_region ();
1053 double _last_normalization_value;
1054 void reset_region_scale_amplitude ();
1055 void adjust_region_scale_amplitude (bool up);
1056 void quantize_region ();
1058 void do_insert_time ();
1059 void insert_time (nframes64_t, nframes64_t, Editing::InsertTimeOption, bool, bool, bool);
1061 void tab_to_transient (bool forward);
1063 void use_region_as_bar ();
1064 void use_range_as_bar ();
1066 void define_one_bar (nframes64_t start, nframes64_t end);
1068 void audition_region_from_region_list ();
1069 void hide_region_from_region_list ();
1071 void align (ARDOUR::RegionPoint);
1072 void align_relative (ARDOUR::RegionPoint);
1075 void reset_focus ();
1081 void paste (float times);
1083 int get_prefix (float&, bool&);
1085 void keyboard_paste ();
1086 void keyboard_insert_region_list_selection ();
1088 void region_from_selection ();
1089 void create_region_from_selection (std::vector<boost::shared_ptr<ARDOUR::Region> >&);
1091 void play_from_start ();
1092 void play_from_edit_point ();
1093 void play_from_edit_point_and_return ();
1094 void play_selected_region ();
1095 void play_edit_range ();
1096 void loop_selected_region ();
1097 void play_location (ARDOUR::Location&);
1098 void loop_location (ARDOUR::Location&);
1100 void temporal_zoom_selection ();
1101 void temporal_zoom_region (bool both_axes);
1102 void zoom_to_region (bool both_axes);
1103 void temporal_zoom_session ();
1104 void temporal_zoom (gdouble scale);
1105 void temporal_zoom_by_frame (nframes64_t start, nframes64_t end, const std::string & op);
1106 void temporal_zoom_to_frame (bool coarser, nframes64_t frame);
1108 void amplitude_zoom (gdouble scale);
1109 void amplitude_zoom_step (bool in);
1111 void insert_region_list_drag (boost::shared_ptr<ARDOUR::Region>, int x, int y);
1112 void insert_region_list_selection (float times);
1114 void insert_route_list_drag (boost::shared_ptr<ARDOUR::Route>, int x, int y);
1116 /* import & embed */
1118 void add_external_audio_action (Editing::ImportMode);
1119 void external_audio_dialog ();
1120 void session_import_dialog ();
1122 int check_whether_and_how_to_import(std::string, bool all_or_nothing = true);
1123 bool check_multichannel_status (const std::vector<Glib::ustring>& paths);
1125 SoundFileOmega* sfbrowser;
1127 void bring_in_external_audio (Editing::ImportMode mode, nframes64_t& pos);
1129 bool idle_drop_paths (std::vector<Glib::ustring> paths, nframes64_t frame, double ypos);
1130 void drop_paths_part_two (const std::vector<Glib::ustring>& paths, nframes64_t frame, double ypos);
1132 int import_sndfiles (std::vector<Glib::ustring> paths, Editing::ImportMode mode, ARDOUR::SrcQuality, nframes64_t& pos,
1133 int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>, bool, uint32_t total);
1134 int embed_sndfiles (std::vector<Glib::ustring> paths, bool multiple_files, bool& check_sample_rate, Editing::ImportMode mode,
1135 nframes64_t& pos, int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>&);
1137 int add_sources (std::vector<Glib::ustring> paths, ARDOUR::SourceList& sources, nframes64_t& pos, Editing::ImportMode,
1138 int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>&, bool add_channel_suffix);
1139 int finish_bringing_in_material (boost::shared_ptr<ARDOUR::Region> region, uint32_t, uint32_t, nframes64_t& pos, Editing::ImportMode mode,
1140 boost::shared_ptr<ARDOUR::Track>& existing_track);
1142 boost::shared_ptr<ARDOUR::AudioTrack> get_nth_selected_audio_track (int nth) const;
1143 boost::shared_ptr<ARDOUR::MidiTrack> get_nth_selected_midi_track (int nth) const;
1145 /* generic interthread progress window */
1147 ArdourDialog* interthread_progress_window;
1148 Gtk::Label interthread_progress_label;
1149 Gtk::VBox interthread_progress_vbox;
1150 Gtk::ProgressBar interthread_progress_bar;
1151 Gtk::Button interthread_cancel_button;
1152 Gtk::Label interthread_cancel_label;
1153 sigc::connection interthread_progress_connection;
1154 void interthread_cancel_clicked ();
1155 void build_interthread_progress_window ();
1156 ARDOUR::InterThreadInfo* current_interthread_info;
1158 AnalysisWindow* analysis_window;
1160 /* import specific info */
1162 struct EditorImportStatus : public ARDOUR::ImportStatus {
1163 Editing::ImportMode mode;
1167 boost::shared_ptr<ARDOUR::Track> track;
1171 EditorImportStatus import_status;
1172 gint import_progress_timeout (void *);
1173 static void *_import_thread (void *);
1174 void* import_thread ();
1175 void finish_import ();
1177 /* to support this ... */
1179 void import_audio (bool as_tracks);
1180 void do_import (std::vector<Glib::ustring> paths, bool split, bool as_tracks);
1182 void move_to_start ();
1183 void move_to_end ();
1185 void center_playhead ();
1186 void center_edit_point ();
1187 void edit_cursor_backward ();
1188 void edit_cursor_forward ();
1189 void playhead_forward_to_grid ();
1190 void playhead_backward_to_grid ();
1191 void playhead_backward ();
1192 void playhead_forward ();
1193 void scroll_playhead (bool forward);
1194 void scroll_backward (float pages=0.8f);
1195 void scroll_forward (float pages=0.8f);
1196 void scroll_tracks_down ();
1197 void scroll_tracks_up ();
1198 void delete_sample_forward ();
1199 void delete_sample_backward ();
1200 void delete_screen ();
1201 void search_backwards ();
1202 void search_forwards ();
1204 void clear_markers ();
1205 void clear_ranges ();
1206 void clear_locations ();
1207 void unhide_markers ();
1208 void unhide_ranges ();
1209 void jump_forward_to_mark ();
1210 void jump_backward_to_mark ();
1211 void cursor_align (bool playhead_to_edit);
1213 void remove_last_capture ();
1214 void select_all_selectables_using_time_selection ();
1215 void select_all_selectables_using_loop();
1216 void select_all_selectables_using_punch();
1217 void set_selection_from_range (ARDOUR::Location&);
1218 void set_selection_from_punch ();
1219 void set_selection_from_loop ();
1220 void set_selection_from_region ();
1222 void add_location_mark (nframes64_t where);
1223 void add_location_from_audio_region ();
1224 void add_locations_from_audio_region ();
1225 void add_location_from_selection ();
1226 void set_loop_from_selection (bool play);
1227 void set_punch_from_selection ();
1228 void set_punch_from_region ();
1230 void set_loop_from_edit_range (bool play);
1231 void set_loop_from_region (bool play);
1232 void set_punch_from_edit_range ();
1234 void set_loop_range (nframes64_t start, nframes64_t end, std::string cmd);
1235 void set_punch_range (nframes64_t start, nframes64_t end, std::string cmd);
1237 void add_location_from_playhead_cursor ();
1238 bool select_new_marker;
1240 void reverse_selection ();
1241 void edit_envelope ();
1243 void start_scrolling ();
1244 void stop_scrolling ();
1246 double last_scrub_x;
1247 int scrubbing_direction;
1248 int scrub_reversals;
1249 int scrub_reverse_distance;
1252 void keyboard_selection_begin ();
1253 void keyboard_selection_finish (bool add);
1254 bool have_pending_keyboard_selection;
1255 nframes64_t pending_keyboard_selection_start;
1257 boost::shared_ptr<ARDOUR::Region> select_region_for_operation (int dir, TimeAxisView **tv);
1258 void extend_selection_to_end_of_region (bool next);
1259 void extend_selection_to_start_of_region (bool previous);
1261 Editing::SnapType _snap_type;
1262 Editing::SnapMode _snap_mode;
1264 /// Snap threshold in pixels
1265 double snap_threshold;
1267 bool ignore_gui_changes;
1273 Gtk::Menu fade_context_menu;
1274 void popup_fade_context_menu (int, int, ArdourCanvas::Item*, ItemType);
1276 void set_fade_in_shape (ARDOUR::AudioRegion::FadeShape);
1277 void set_fade_out_shape (ARDOUR::AudioRegion::FadeShape);
1279 void set_fade_length (bool in);
1280 void toggle_fade_active (bool in);
1281 void set_fade_in_active (bool);
1282 void set_fade_out_active (bool);
1284 std::set<boost::shared_ptr<ARDOUR::Playlist> > motion_frozen_playlists;
1286 bool _dragging_playhead;
1287 bool _dragging_edit_point;
1289 void marker_drag_motion_callback (GdkEvent*);
1290 void marker_drag_finished_callback (GdkEvent*);
1292 gint mouse_rename_region (ArdourCanvas::Item*, GdkEvent*);
1294 void start_region_grab (ArdourCanvas::Item*, GdkEvent*, RegionView*);
1295 void start_create_region_grab (ArdourCanvas::Item*, GdkEvent*);
1296 void start_region_copy_grab (ArdourCanvas::Item*, GdkEvent*, RegionView*);
1297 void start_region_brush_grab (ArdourCanvas::Item*, GdkEvent*, RegionView*);
1298 void start_selection_grab (ArdourCanvas::Item*, GdkEvent*);
1300 void region_view_item_click (AudioRegionView&, GdkEventButton*);
1302 void remove_gain_control_point (ArdourCanvas::Item*, GdkEvent*);
1303 void remove_control_point (ArdourCanvas::Item*, GdkEvent*);
1305 void mouse_brush_insert_region (RegionView*, nframes64_t pos);
1306 void brush (nframes64_t);
1308 void show_verbose_time_cursor (nframes64_t frame, double offset = 0, double xpos=-1, double ypos=-1);
1309 void show_verbose_duration_cursor (nframes64_t start, nframes64_t end, double offset = 0, double xpos=-1, double ypos=-1);
1310 double clamp_verbose_cursor_x (double);
1311 double clamp_verbose_cursor_y (double);
1313 /* Canvas event handlers */
1315 bool canvas_control_point_event (GdkEvent* event,ArdourCanvas::Item*, ControlPoint*);
1316 bool canvas_line_event (GdkEvent* event,ArdourCanvas::Item*, AutomationLine*);
1317 bool canvas_selection_rect_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1318 bool canvas_selection_start_trim_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1319 bool canvas_selection_end_trim_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1320 bool canvas_crossfade_view_event (GdkEvent* event,ArdourCanvas::Item*, CrossfadeView*);
1321 bool canvas_fade_in_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1322 bool canvas_fade_in_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1323 bool canvas_fade_out_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1324 bool canvas_fade_out_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1327 // These variables are used to detect a feedback loop and break it to avoid a gui hang
1329 ArdourCanvas::Item *last_item_entered;
1330 int last_item_entered_n;
1333 bool canvas_region_view_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1334 bool canvas_frame_handle_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1335 bool canvas_region_view_name_highlight_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1336 bool canvas_region_view_name_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1337 bool canvas_stream_view_event (GdkEvent* event,ArdourCanvas::Item*, RouteTimeAxisView*);
1338 bool canvas_marker_event (GdkEvent* event,ArdourCanvas::Item*, Marker*);
1339 bool canvas_zoom_rect_event (GdkEvent* event,ArdourCanvas::Item*);
1340 bool canvas_tempo_marker_event (GdkEvent* event,ArdourCanvas::Item*, TempoMarker*);
1341 bool canvas_meter_marker_event (GdkEvent* event,ArdourCanvas::Item*, MeterMarker*);
1342 bool canvas_automation_track_event(GdkEvent* event, ArdourCanvas::Item*, AutomationTimeAxisView*) ;
1343 bool canvas_note_event (GdkEvent* event, ArdourCanvas::Item*);
1345 bool canvas_tempo_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1346 bool canvas_meter_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1347 bool canvas_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1348 bool canvas_range_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1349 bool canvas_transport_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1350 bool canvas_cd_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1352 bool canvas_imageframe_item_view_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1353 bool canvas_imageframe_view_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameTimeAxis*);
1354 bool canvas_imageframe_start_handle_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1355 bool canvas_imageframe_end_handle_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1356 bool canvas_marker_time_axis_view_event(GdkEvent* event, ArdourCanvas::Item*,MarkerTimeAxis*);
1357 bool canvas_markerview_item_view_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1358 bool canvas_markerview_start_handle_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1359 bool canvas_markerview_end_handle_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1361 /* non-public event handlers */
1363 bool canvas_playhead_cursor_event (GdkEvent* event, ArdourCanvas::Item*);
1364 bool track_canvas_scroll (GdkEventScroll* event);
1366 bool track_canvas_scroll_event (GdkEventScroll* event);
1367 bool track_canvas_button_press_event (GdkEventButton* event);
1368 bool track_canvas_button_release_event (GdkEventButton* event);
1369 bool track_canvas_motion_notify_event (GdkEventMotion* event);
1371 Gtk::Allocation canvas_allocation;
1372 void track_canvas_allocate (Gtk::Allocation alloc);
1373 bool track_canvas_size_allocated ();
1374 bool track_canvas_drag_motion (Glib::RefPtr<Gdk::DragContext> const &, int, int, guint);
1376 void set_playhead_cursor ();
1378 void kbd_driver (sigc::slot<void,GdkEvent*>, bool use_track_canvas = true, bool use_time_canvas = true, bool can_select = true);
1379 void kbd_mute_unmute_region ();
1382 void kbd_do_brush (GdkEvent*);
1383 void kbd_do_audition (GdkEvent*);
1385 void handle_new_duration ();
1386 void initialize_canvas ();
1388 /* display control */
1390 bool _show_measures;
1391 /// true if the editor should follow the playhead, otherwise false
1392 bool _follow_playhead;
1393 /// true if waveforms should be shown while recording audio tracks, otherwise false
1394 bool _show_waveforms_recording;
1396 ARDOUR::TempoMap::BBTPointList *current_bbt_points;
1398 TempoLines* tempo_lines;
1400 ArdourCanvas::Group* time_line_group;
1402 void hide_measures ();
1403 void draw_measures ();
1404 bool redraw_measures ();
1406 void new_tempo_section ();
1408 void mouse_add_new_tempo_event (nframes64_t where);
1409 void mouse_add_new_meter_event (nframes64_t where);
1411 void remove_tempo_marker (ArdourCanvas::Item*);
1412 void remove_meter_marker (ArdourCanvas::Item*);
1413 gint real_remove_tempo_marker (ARDOUR::TempoSection*);
1414 gint real_remove_meter_marker (ARDOUR::MeterSection*);
1416 void edit_tempo_section (ARDOUR::TempoSection*);
1417 void edit_meter_section (ARDOUR::MeterSection*);
1418 void edit_tempo_marker (ArdourCanvas::Item*);
1419 void edit_meter_marker (ArdourCanvas::Item*);
1420 void edit_control_point (ArdourCanvas::Item*);
1422 void marker_menu_edit ();
1423 void marker_menu_remove ();
1424 void marker_menu_rename ();
1425 void marker_menu_lock (bool yn);
1426 void marker_menu_hide ();
1427 void marker_menu_loop_range ();
1428 void marker_menu_select_all_selectables_using_range ();
1429 void marker_menu_select_using_range ();
1430 void marker_menu_separate_regions_using_location ();
1431 void marker_menu_play_from ();
1432 void marker_menu_play_range ();
1433 void marker_menu_set_playhead ();
1434 void marker_menu_set_from_playhead ();
1435 void marker_menu_set_from_selection ();
1436 void marker_menu_range_to_next ();
1437 void new_transport_marker_menu_set_loop ();
1438 void new_transport_marker_menu_set_punch ();
1439 void update_loop_range_view (bool visibility=false);
1440 void update_punch_range_view (bool visibility=false);
1441 void new_transport_marker_menu_popdown ();
1442 void marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1443 void tm_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1444 void transport_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1445 void new_transport_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1446 void build_range_marker_menu (bool loop_or_punch);
1447 void build_marker_menu (bool start_or_end);
1448 void build_tm_marker_menu ();
1449 void build_new_transport_marker_menu ();
1451 Gtk::Menu* tm_marker_menu;
1452 Gtk::Menu* marker_menu;
1453 Gtk::Menu* start_end_marker_menu;
1454 Gtk::Menu* range_marker_menu;
1455 Gtk::Menu* transport_marker_menu;
1456 Gtk::Menu* new_transport_marker_menu;
1457 Gtk::Menu* cd_marker_menu;
1458 ArdourCanvas::Item* marker_menu_item;
1460 typedef std::list<Marker*> Marks;
1463 void remove_metric_marks ();
1464 void draw_metric_marks (const ARDOUR::Metrics& metrics);
1466 void compute_current_bbt_points (nframes_t left, nframes_t right);
1467 void tempo_map_changed (ARDOUR::Change);
1468 void redisplay_tempo (bool immediate_redraw);
1470 void snap_to (nframes64_t& first, int32_t direction = 0, bool for_mark = false);
1471 void snap_to_with_modifier (nframes64_t& first, GdkEvent const *, int32_t direction = 0, bool for_mark = false);
1472 void snap_to (nframes64_t& first, nframes64_t& last, int32_t direction = 0, bool for_mark = false);
1474 uint32_t bbt_beat_subdivision;
1478 Gtk::ToggleButton editor_mixer_button;
1479 Gtk::ToggleButton editor_list_button;
1480 void editor_mixer_button_toggled ();
1481 void editor_list_button_toggled ();
1483 AudioClock zoom_range_clock;
1484 Gtk::Button zoom_in_button;
1485 Gtk::Button zoom_out_button;
1486 Gtk::Button zoom_out_full_button;
1487 Gtk::Button zoom_onetoone_button;
1489 Gtk::Button tav_expand_button;
1490 Gtk::Button tav_shrink_button;
1492 Gtk::VBox toolbar_clock_vbox;
1493 Gtk::VBox toolbar_selection_clock_vbox;
1494 Gtk::Table toolbar_selection_clock_table;
1495 Gtk::Label toolbar_selection_cursor_label;
1497 Gtk::HBox mouse_mode_button_box;
1498 Gtkmm2ext::TearOff* mouse_mode_tearoff;
1499 Gtk::ToggleButton mouse_select_button;
1500 Gtk::ToggleButton mouse_move_button;
1501 Gtk::ToggleButton mouse_gain_button;
1502 Gtk::ToggleButton mouse_zoom_button;
1503 Gtk::ToggleButton mouse_timefx_button;
1504 Gtk::ToggleButton mouse_audition_button;
1506 void mouse_mode_toggled (Editing::MouseMode m);
1507 bool ignore_mouse_mode_toggle;
1509 Gtk::ToggleButton internal_edit_button;
1510 void toggle_internal_editing ();
1512 gint mouse_select_button_release (GdkEventButton*);
1514 Gtk::VBox automation_box;
1515 Gtk::Button automation_mode_button;
1516 Gtk::ToggleButton global_automation_button;
1518 Gtk::ComboBoxText edit_mode_selector;
1519 Gtk::VBox edit_mode_box;
1521 void set_edit_mode (ARDOUR::EditMode);
1522 void cycle_edit_mode ();
1523 void edit_mode_selection_done ();
1525 Gtk::ComboBoxText snap_type_selector;
1526 Gtk::ComboBoxText snap_mode_selector;
1529 std::vector<std::string> snap_type_strings;
1530 std::vector<std::string> snap_mode_strings;
1532 void snap_type_selection_done ();
1533 void snap_mode_selection_done ();
1534 void snap_mode_chosen (Editing::SnapMode);
1535 void snap_type_chosen (Editing::SnapType);
1537 Glib::RefPtr<Gtk::RadioAction> snap_type_action (Editing::SnapType);
1538 Glib::RefPtr<Gtk::RadioAction> snap_mode_action (Editing::SnapMode);
1540 Gtk::ComboBoxText zoom_focus_selector;
1541 Gtk::VBox zoom_focus_box;
1543 std::vector<std::string> zoom_focus_strings;
1545 void zoom_focus_selection_done ();
1546 void zoom_focus_chosen (Editing::ZoomFocus);
1548 Glib::RefPtr<Gtk::RadioAction> zoom_focus_action (Editing::ZoomFocus);
1551 Gtk::HBox track_zoom_box;
1552 Gtk::VBox zoom_vbox;
1554 void zoom_adjustment_changed();
1556 void setup_toolbar ();
1558 Gtkmm2ext::TearOff* tools_tearoff;
1559 Gtk::HBox toolbar_hbox;
1560 Gtk::EventBox toolbar_base;
1561 Gtk::Frame toolbar_frame;
1565 Gtk::HBox panic_box;
1566 Gtk::Button midi_panic_button;
1567 Gtk::ToggleButton midi_sound_notes;
1569 bool sound_notes () const { return midi_sound_notes.get_active(); }
1571 void setup_midi_toolbar ();
1573 /* selection process */
1575 Selection* selection;
1576 Selection* cut_buffer;
1578 void time_selection_changed ();
1579 void track_selection_changed ();
1580 void region_selection_changed ();
1581 sigc::connection editor_regions_selection_changed_connection;
1582 void sensitize_the_right_region_actions (bool have_selected_regions);
1583 void point_selection_changed ();
1584 void marker_selection_changed ();
1586 void cancel_selection ();
1588 void region_selection_op (void (ARDOUR::Region::*pmf)(void));
1589 void region_selection_op (void (ARDOUR::Region::*pmf)(void*), void*);
1590 void region_selection_op (void (ARDOUR::Region::*pmf)(bool), bool);
1592 bool audio_region_selection_covers (nframes64_t where);
1594 /* transport range select process */
1596 ArdourCanvas::SimpleRect* cd_marker_bar_drag_rect;
1597 ArdourCanvas::SimpleRect* range_bar_drag_rect;
1598 ArdourCanvas::SimpleRect* transport_bar_drag_rect;
1601 ArdourCanvas::SimpleRect *bogus_background_rect;
1603 ArdourCanvas::SimpleRect *transport_bar_range_rect;
1604 ArdourCanvas::SimpleRect *transport_bar_preroll_rect;
1605 ArdourCanvas::SimpleRect *transport_bar_postroll_rect;
1606 ArdourCanvas::SimpleRect *transport_loop_range_rect;
1607 ArdourCanvas::SimpleRect *transport_punch_range_rect;
1608 ArdourCanvas::SimpleLine *transport_punchin_line;
1609 ArdourCanvas::SimpleLine *transport_punchout_line;
1610 ArdourCanvas::SimpleRect *transport_preroll_rect;
1611 ArdourCanvas::SimpleRect *transport_postroll_rect;
1613 ARDOUR::Location* transport_loop_location();
1614 ARDOUR::Location* transport_punch_location();
1616 ARDOUR::Location *temp_location;
1618 /* object rubberband select process */
1620 bool select_all_within (nframes64_t start, nframes64_t end, gdouble topy, gdouble boty, const TrackViewList&, Selection::Operation op);
1622 ArdourCanvas::SimpleRect *rubberband_rect;
1624 /* mouse zoom process */
1626 ArdourCanvas::SimpleRect *zoom_rect;
1627 void reposition_zoom_rect (nframes64_t start, nframes64_t end);
1629 EditorRouteGroups* _route_groups;
1630 EditorRoutes* _routes;
1631 EditorRegions* _regions;
1632 EditorSnapshots* _snapshots;
1633 EditorLocations* _locations;
1635 /* diskstream/route display management */
1636 Glib::RefPtr<Gdk::Pixbuf> rec_enabled_icon;
1637 Glib::RefPtr<Gdk::Pixbuf> rec_disabled_icon;
1639 Glib::RefPtr<Gtk::TreeSelection> route_display_selection;
1641 bool sync_track_view_list_and_routes ();
1643 Gtk::VBox list_vpacker;
1647 bool autoscroll_active;
1648 int autoscroll_timeout_tag;
1651 int last_autoscroll_x;
1652 int last_autoscroll_y;
1653 uint32_t autoscroll_cnt;
1654 nframes64_t autoscroll_x_distance;
1655 double autoscroll_y_distance;
1657 static gint _autoscroll_canvas (void *);
1658 bool autoscroll_canvas ();
1659 void start_canvas_autoscroll (int x, int y);
1660 void stop_canvas_autoscroll ();
1661 void maybe_autoscroll (GdkEventMotion*, bool);
1662 bool allow_vertical_scroll;
1665 void point_trim (GdkEvent*);
1666 void single_contents_trim (RegionView&, nframes64_t, bool, bool, bool);
1667 void single_start_trim (RegionView&, nframes64_t, bool, bool, bool);
1668 void single_end_trim (RegionView&, nframes64_t, bool, bool, bool);
1670 void thaw_region_after_trim (RegionView& rv);
1672 void trim_region_front();
1673 void trim_region_back();
1674 void trim_region (bool front);
1676 void trim_region_to_edit_point ();
1677 void trim_region_from_edit_point ();
1678 void trim_region_to_loop ();
1679 void trim_region_to_punch ();
1680 void trim_region_to_location (const ARDOUR::Location&, const char* cmd);
1682 void trim_to_region(bool forward);
1683 void trim_region_to_previous_region_end();
1684 void trim_region_to_next_region_start();
1686 bool show_gain_after_trim;
1690 int convert_drop_to_paths (
1691 std::vector<Glib::ustring>& paths,
1692 const Glib::RefPtr<Gdk::DragContext>& context,
1695 const Gtk::SelectionData& data,
1699 void track_canvas_drag_data_received (
1700 const Glib::RefPtr<Gdk::DragContext>& context,
1703 const Gtk::SelectionData& data,
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,
1733 int write_region_selection(RegionSelection&);
1734 bool write_region (std::string path, boost::shared_ptr<ARDOUR::AudioRegion>);
1735 void bounce_region_selection ();
1736 void bounce_range_selection (bool replace, bool enable_processing);
1737 void external_edit_region ();
1739 int write_audio_selection (TimeSelection&);
1740 bool write_audio_range (ARDOUR::AudioPlaylist&, const ARDOUR::ChanCount& channels, std::list<ARDOUR::AudioRange>&);
1742 void write_selection ();
1744 XMLNode *before; /* used in *_reversible_command */
1746 void begin_reversible_command (std::string cmd_name);
1747 void commit_reversible_command ();
1749 void update_title ();
1750 void update_title_s (const std::string & snapshot_name);
1753 Selection* selection;
1754 double frames_per_unit;
1756 State (PublicEditor const * e);
1760 void store_state (State&) const;
1761 void restore_state (State *);
1763 void instant_save ();
1765 boost::shared_ptr<ARDOUR::AudioRegion> last_audition_region;
1767 /* freeze operations */
1769 ARDOUR::InterThreadInfo freeze_status;
1770 gint freeze_progress_timeout (void *);
1771 static void* _freeze_thread (void*);
1772 void* freeze_thread ();
1774 void freeze_route ();
1775 void unfreeze_route ();
1777 /* route-group solo + mute */
1779 void set_route_group_solo (ARDOUR::Route&, bool);
1780 void set_route_group_mute (ARDOUR::Route&, bool);
1784 void duplicate_dialog (bool with_dialog);
1786 nframes64_t event_frame (GdkEvent const *, double* px = 0, double* py = 0) const;
1788 /* returns false if mouse pointer is not in track or marker canvas
1790 bool mouse_frame (nframes64_t&, bool& in_track_canvas) const;
1792 /* "whats mine is yours" */
1794 TimeFXDialog* current_timefx;
1796 static void* timefx_thread (void *arg);
1797 void do_timefx (TimeFXDialog&);
1799 int time_stretch (RegionSelection&, float fraction);
1800 int pitch_shift (RegionSelection&, float cents);
1801 void pitch_shift_regions ();
1802 int time_fx (RegionSelection&, float val, bool pitching);
1804 /* editor-mixer strip */
1806 MixerStrip *current_mixer_strip;
1807 bool show_editor_mixer_when_tracks_arrive;
1808 Gtk::VBox current_mixer_strip_vbox;
1809 void cms_new (boost::shared_ptr<ARDOUR::Route>);
1810 void cms_deleted ();
1811 void current_mixer_strip_hidden ();
1812 void current_mixer_strip_removed ();
1814 void detach_tearoff (Gtk::Box* b, Gtk::Window* w);
1815 void reattach_tearoff (Gtk::Box* b, Gtk::Window* w, int32_t n);
1817 void ensure_all_elements_drawn ();
1819 /* nudging tracks */
1821 void nudge_track (bool use_edit_point, bool forwards);
1825 bool _xfade_visibility;
1828 void handle_new_imageframe_time_axis_view(const std::string & track_name, void* src) ;
1829 void handle_new_imageframe_marker_time_axis_view(const std::string & track_name, TimeAxisView* marked_track) ;
1831 void start_imageframe_grab(ArdourCanvas::Item*, GdkEvent*) ;
1832 void start_markerview_grab(ArdourCanvas::Item*, GdkEvent*) ;
1834 void imageframe_drag_motion_callback(ArdourCanvas::Item*, GdkEvent*) ;
1835 void markerview_drag_motion_callback(ArdourCanvas::Item*, GdkEvent*) ;
1836 void timeaxis_item_drag_finished_callback(ArdourCanvas::Item*, GdkEvent*) ;
1838 gint canvas_imageframe_item_view_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameView* ifv);
1839 gint canvas_imageframe_view_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameTimeAxis* ifta);
1840 gint canvas_imageframe_start_handle_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameView* ifv);
1841 gint canvas_imageframe_end_handle_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameView* ifv);
1843 gint canvas_marker_time_axis_view_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerTimeAxis* mta);
1844 gint canvas_markerview_item_view_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerView* mv);
1845 gint canvas_markerview_start_handle_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerView* mv);
1846 gint canvas_markerview_end_handle_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerView* mv);
1848 void imageframe_start_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1849 void imageframe_end_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1850 void imageframe_start_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1851 void imageframe_start_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1852 void imageframe_end_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1853 void imageframe_end_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1855 void markerview_item_start_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1856 void markerview_item_end_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1857 void markerview_start_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1858 void markerview_start_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1859 void markerview_end_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1860 void markerview_end_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1862 void popup_imageframe_edit_menu(int button, int32_t time, ArdourCanvas::Item* ifv, bool with_frame) ;
1863 void popup_marker_time_axis_edit_menu(int button, int32_t time, ArdourCanvas::Item* ifv, bool with_frame) ;
1865 ImageFrameSocketHandler* image_socket_listener ;
1868 void toggle_xfade_active (boost::weak_ptr<ARDOUR::Crossfade>);
1869 void toggle_xfade_length (boost::weak_ptr<ARDOUR::Crossfade>);
1870 void edit_xfade (boost::weak_ptr<ARDOUR::Crossfade>);
1871 void xfade_edit_left_region ();
1872 void xfade_edit_right_region ();
1874 static const int32_t default_width = 995;
1875 static const int32_t default_height = 765;
1879 Gtk::Button nudge_forward_button;
1880 Gtk::Button nudge_backward_button;
1881 Gtk::HBox nudge_hbox;
1882 Gtk::VBox nudge_vbox;
1883 AudioClock nudge_clock;
1885 bool nudge_forward_release (GdkEventButton*);
1886 bool nudge_backward_release (GdkEventButton*);
1890 void apply_filter (ARDOUR::Filter&, std::string cmd);
1892 Command* apply_midi_note_edit_op_to_region (ARDOUR::MidiOperator& op, MidiRegionView& mrv);
1893 void apply_midi_note_edit_op (ARDOUR::MidiOperator& op);
1895 /* handling cleanup */
1897 int playlist_deletion_dialog (boost::shared_ptr<ARDOUR::Playlist>);
1899 std::vector<sigc::connection> session_connections;
1901 /* tracking step changes of track height */
1903 TimeAxisView* current_stepping_trackview;
1904 ARDOUR::microseconds_t last_track_height_step_timestamp;
1905 gint track_height_step_timeout();
1906 sigc::connection step_timeout;
1908 TimeAxisView* entered_track;
1909 RegionView* entered_regionview;
1912 void ensure_entered_track_selected (bool op_acts_on_objects = false);
1913 bool clear_entered_track;
1914 bool left_track_canvas (GdkEventCrossing*);
1915 bool entered_track_canvas (GdkEventCrossing*);
1916 void set_entered_track (TimeAxisView*);
1917 void set_entered_regionview (RegionView*);
1918 void ensure_track_visible (TimeAxisView*);
1919 gint left_automation_track ();
1921 bool _new_regionviews_show_envelope;
1923 void reset_canvas_action_sensitivity (bool);
1924 void toggle_gain_envelope_visibility ();
1925 void toggle_gain_envelope_active ();
1926 void reset_region_gain_envelopes ();
1928 bool on_key_press_event (GdkEventKey*);
1929 bool on_key_release_event (GdkEventKey*);
1931 void session_state_saved (std::string);
1933 Glib::RefPtr<Gtk::Action> undo_action;
1934 Glib::RefPtr<Gtk::Action> redo_action;
1936 void history_changed ();
1938 Gtk::HBox status_bar_hpacker;
1940 Editing::EditPoint _edit_point;
1942 Gtk::ComboBoxText edit_point_selector;
1944 void set_edit_point_preference (Editing::EditPoint ep, bool force = false);
1945 void cycle_edit_point (bool with_marker);
1946 void set_edit_point ();
1947 void edit_point_selection_done ();
1948 void edit_point_chosen (Editing::EditPoint);
1949 Glib::RefPtr<Gtk::RadioAction> edit_point_action (Editing::EditPoint);
1950 std::vector<std::string> edit_point_strings;
1952 void selected_marker_moved (ARDOUR::Location*);
1954 bool get_edit_op_range (nframes64_t& start, nframes64_t& end) const;
1956 void get_regions_at (RegionSelection&, nframes64_t where, const TrackSelection& ts) const;
1957 void get_regions_after (RegionSelection&, nframes64_t where, const TrackSelection& ts) const;
1959 void get_regions_for_action (RegionSelection&, bool allow_entered = false, bool allow_edit_position = true);
1961 sigc::connection fast_screen_update_connection;
1962 gint start_updating ();
1963 gint stop_updating ();
1964 void fast_update_strips ();
1965 bool meters_running;
1967 void select_next_route ();
1968 void select_prev_route ();
1970 void snap_to_internal (nframes64_t& first, int32_t direction = 0, bool for_mark = false);
1971 void timecode_snap_to_internal (nframes64_t& first, int32_t direction = 0, bool for_mark = false);
1973 RhythmFerret* rhythm_ferret;
1974 BundleManager* _bundle_manager;
1975 GlobalPortMatrixWindow* _global_port_matrix[ARDOUR::DataType::num_types];
1977 void fit_tracks (TrackSelection &);
1978 void fit_selected_tracks ();
1979 void set_track_height (uint32_t h);
1981 void remove_tracks ();
1982 void toggle_tracks_active ();
1987 friend gboolean _idle_resize (gpointer);
1988 int32_t _pending_resize_amount;
1989 TimeAxisView* _pending_resize_view;
1991 void visible_order_range (int*, int*) const;
1994 bool _pending_locate_request;
1996 EditorSummary* _summary;
1997 void region_view_added (RegionView *);
1999 void update_canvas_now ();
2000 void streamview_height_changed ();
2002 EditorGroupTabs* _group_tabs;
2003 void fit_route_group (ARDOUR::RouteGroup *);
2005 void start_step_editing ();
2006 void stop_step_editing ();
2007 bool check_step_edit ();
2008 sigc::connection step_edit_connection;
2011 friend class RegionDrag;
2012 friend class RegionMoveDrag;
2013 friend class RegionSpliceDrag;
2014 friend class TrimDrag;
2015 friend class MeterMarkerDrag;
2016 friend class TempoMarkerDrag;
2017 friend class CursorDrag;
2018 friend class FadeInDrag;
2019 friend class FadeOutDrag;
2020 friend class MarkerDrag;
2021 friend class RegionGainDrag;
2022 friend class ControlPointDrag;
2023 friend class LineDrag;
2024 friend class RubberbandSelectDrag;
2025 friend class TimeFXDrag;
2026 friend class ScrubDrag;
2027 friend class SelectionDrag;
2028 friend class RangeMarkerBarDrag;
2029 friend class MouseZoomDrag;
2030 friend class RegionCreateDrag;
2031 friend class RegionMotionDrag;
2032 friend class RegionInsertDrag;
2034 friend class EditorSummary;
2035 friend class EditorGroupTabs;
2037 friend class EditorRoutes;
2040 #endif /* __ardour_editor_h__ */