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