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/layout.h>
42 #include <gtkmm/comboboxtext.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/session.h"
50 #include "ardour/tempo.h"
51 #include "ardour/stretch.h"
52 #include "ardour/location.h"
53 #include "ardour/audioregion.h"
54 #include "ardour/track.h"
55 #include "ardour/types.h"
56 #include "ardour/route_group.h"
58 #include "audio_clock.h"
59 #include "gtk-custom-ruler.h"
60 #include "ardour_dialog.h"
61 #include "public_editor.h"
64 #include "editor_items.h"
65 #include "region_selection.h"
67 #include "editor_summary.h"
74 class AudioDiskstream;
93 class AudioRegionView;
94 class AudioStreamView;
95 class AudioTimeAxisView;
97 class AutomationSelection;
98 class AutomationTimeAxisView;
103 class GlobalPortMatrixWindow;
104 class GroupedButtons;
107 class PlaylistSelector;
108 class PluginSelector;
111 class SoundFileOmega;
117 class TrackSelection;
118 class EditorGroupTabs;
120 class EditorRouteGroups;
123 /* <CMT Additions> */
124 class ImageFrameView;
125 class ImageFrameTimeAxisView;
126 class ImageFrameTimeAxis;
127 class MarkerTimeAxis ;
129 class ImageFrameSocketHandler ;
130 class TimeAxisViewItem ;
131 /* </CMT Additions> */
133 struct EditorCursor {
135 ArdourCanvas::Points points;
136 ArdourCanvas::Line canvas_item;
137 nframes64_t current_frame;
140 EditorCursor (Editor&, bool (Editor::*)(GdkEvent*,ArdourCanvas::Item*));
143 void set_position (nframes64_t);
144 void set_length (double units);
145 void set_y_axis (double position);
147 sigc::signal<void, nframes64_t> PositionChanged;
150 class Editor : public PublicEditor
156 void connect_to_session (ARDOUR::Session *);
157 ARDOUR::Session* current_session() const { return session; }
159 virtual bool have_idled () const { return _have_idled; }
161 nframes64_t leftmost_position() const { return leftmost_frame; }
163 nframes64_t current_page_frames() const {
164 return (nframes64_t) floor (_canvas_width * frames_per_unit);
167 double canvas_height () const {
168 return _canvas_height;
171 void cycle_snap_mode ();
172 void cycle_snap_choice ();
173 void set_snap_to (Editing::SnapType);
174 void set_snap_mode (Editing::SnapMode);
175 void set_snap_threshold (double pixel_distance) {snap_threshold = pixel_distance;}
177 void undo (uint32_t n = 1);
178 void redo (uint32_t n = 1);
180 XMLNode& get_state ();
181 int set_state (const XMLNode& );
183 void set_mouse_mode (Editing::MouseMode, bool force=true);
184 void step_mouse_mode (bool next);
185 Editing::MouseMode current_mouse_mode () const { return mouse_mode; }
187 void set_midi_edit_cursor (Editing::MidiEditMode);
188 void set_midi_edit_mode (Editing::MidiEditMode, bool force=true);
189 Editing::MidiEditMode current_midi_edit_mode () const { return midi_edit_mode; }
192 void add_imageframe_time_axis(const std::string & track_name, void*) ;
193 void add_imageframe_marker_time_axis(const std::string & track_name, TimeAxisView* marked_track, void*) ;
194 void connect_to_image_compositor() ;
195 void scroll_timeaxis_to_imageframe_item(const TimeAxisViewItem* item) ;
198 TimeAxisView* get_named_time_axis(const std::string & name) ;
199 void foreach_time_axis_view (sigc::slot<void,TimeAxisView&>);
200 void add_to_idle_resize (TimeAxisView*, int32_t);
202 RouteTimeAxisView* get_route_view_by_id (PBD::ID& id);
204 void consider_auditioning (boost::shared_ptr<ARDOUR::Region>);
205 void hide_a_region (boost::shared_ptr<ARDOUR::Region>);
206 void remove_a_region (boost::shared_ptr<ARDOUR::Region>);
208 #ifdef USE_RUBBERBAND
209 std::vector<std::string> rb_opt_strings;
212 /* option editor-access */
214 void set_show_waveforms_recording (bool yn);
215 bool show_waveforms_recording() const { return _show_waveforms_recording; }
217 /* things that need to be public to be used in the main menubar */
219 void new_region_from_selection ();
220 void separate_regions_between (const TimeSelection&);
221 void separate_region_from_selection ();
222 void separate_region_from_punch ();
223 void separate_region_from_loop ();
224 void separate_regions_using_location (ARDOUR::Location&);
225 void toggle_playback (bool with_abort);
226 void transition_to_rolling (bool forward);
230 nframes64_t unit_to_frame (double unit) const {
231 return (nframes64_t) rint (unit * frames_per_unit);
234 double frame_to_unit (nframes64_t frame) const {
235 return rint ((double) frame / (double) frames_per_unit);
238 double frame_to_unit (double frame) const {
239 return rint (frame / frames_per_unit);
242 /* NOTE: these functions assume that the "pixel" coordinate is
243 the result of using the world->canvas affine transform on a
244 world coordinate. These coordinates already take into
245 account any scrolling carried out by adjusting the
249 nframes64_t pixel_to_frame (double pixel) const {
251 /* pixel can be less than zero when motion events
252 are processed. since we've already run the world->canvas
253 affine, that means that the location *really* is "off
254 to the right" and thus really is "before the start".
258 return (nframes64_t) rint (pixel * frames_per_unit * GNOME_CANVAS(track_canvas->gobj())->pixels_per_unit);
264 gulong frame_to_pixel (nframes64_t frame) const {
265 return (gulong) rint ((frame / (frames_per_unit * GNOME_CANVAS(track_canvas->gobj())->pixels_per_unit)));
268 void flush_canvas ();
272 Selection& get_selection() const { return *selection; }
273 Selection& get_cut_buffer() const { return *cut_buffer; }
275 bool extend_selection_to_track (TimeAxisView&);
277 void play_selection ();
278 void select_all_in_track (Selection::Operation op);
279 void select_all (Selection::Operation op);
280 void invert_selection_in_track ();
281 void invert_selection ();
282 void deselect_all ();
284 void set_selected_regionview_from_region_list (boost::shared_ptr<ARDOUR::Region> region, Selection::Operation op = Selection::Set);
288 void set_show_measures (bool yn);
289 bool show_measures () const { return _show_measures; }
291 /* analysis window */
293 void analyze_region_selection();
294 void analyze_range_selection();
298 void export_audio ();
299 void export_selection ();
300 void export_range ();
301 void export_region ();
303 void add_toplevel_controls (Gtk::Container&);
304 Gtk::HBox& get_status_bar_packer() { return status_bar_hpacker; }
306 void set_zoom_focus (Editing::ZoomFocus);
307 Editing::ZoomFocus get_zoom_focus () const { return zoom_focus; }
308 double get_current_zoom () const { return frames_per_unit; }
310 void temporal_zoom_step (bool coarser);
312 /* stuff that AudioTimeAxisView and related classes use */
314 PlaylistSelector& playlist_selector() const;
315 void clear_playlist (boost::shared_ptr<ARDOUR::Playlist>);
317 void new_playlists (TimeAxisView* v);
318 void copy_playlists (TimeAxisView* v);
319 void clear_playlists (TimeAxisView* v);
321 TrackViewList* get_valid_views (TimeAxisView*, ARDOUR::RouteGroup* grp = 0);
322 void get_onscreen_tracks (TrackViewList&);
324 Width editor_mixer_strip_width;
325 void maybe_add_mixer_strip_width (XMLNode&);
326 void show_editor_mixer (bool yn);
327 void create_editor_mixer ();
328 void show_editor_list (bool yn);
329 void set_selected_mixer_strip (TimeAxisView&);
330 void hide_track_in_display (TimeAxisView& tv, bool temporary = false);
332 /* nudge is initiated by transport controls owned by ARDOUR_UI */
334 void nudge_forward (bool next, bool force_playhead);
335 void nudge_backward (bool next, bool force_playhead);
337 /* nudge initiated from context menu */
339 void nudge_forward_capture_offset ();
340 void nudge_backward_capture_offset ();
342 /* playhead/screen stuff */
344 void set_follow_playhead (bool yn);
345 void toggle_follow_playhead ();
346 bool follow_playhead() const { return _follow_playhead; }
347 bool dragging_playhead () const { return _dragging_playhead; }
349 void toggle_zero_line_visibility ();
350 void toggle_waveforms_while_recording ();
352 void set_group_tabs ();
353 void toggle_measure_visibility ();
354 void toggle_logo_visibility ();
356 double get_physical_screen_width () const { return physical_screen_width; };
357 double physical_screen_width;
358 double physical_screen_height;
362 void toggle_selected_region_fades (int dir);
363 void update_region_fade_visibility ();
364 bool xfade_visibility() const { return _xfade_visibility; }
365 void update_xfade_visibility ();
367 /* redirect shared ops menu. caller must free returned menu */
369 Gtk::Menu* redirect_menu ();
371 /* floating windows/transient */
373 void ensure_float (Gtk::Window&);
377 void scroll_tracks_down_line ();
378 void scroll_tracks_up_line ();
380 bool new_regionviews_display_gain () { return _new_regionviews_show_envelope; }
381 void prepare_for_cleanup ();
382 void finish_cleanup ();
384 void maximise_editing_space();
385 void restore_editing_space();
387 void reset_x_origin (nframes64_t);
388 void reset_y_origin (double);
389 void reset_zoom (double);
390 void reposition_and_zoom (nframes64_t, double);
392 nframes64_t get_preferred_edit_position (bool ignore_playhead = false);
394 bool update_mouse_speed ();
395 bool decelerate_mouse_speed ();
397 void toggle_meter_updating();
399 void show_rhythm_ferret();
400 void show_bundle_manager ();
401 void show_global_port_matrix (ARDOUR::DataType);
403 void goto_visual_state (uint32_t);
404 void save_visual_state (uint32_t);
406 TrackViewList const & get_track_views () {
410 int get_regionview_count_from_region_list (boost::shared_ptr<ARDOUR::Region>);
412 void do_import (std::vector<Glib::ustring> paths, Editing::ImportDisposition, Editing::ImportMode mode, ARDOUR::SrcQuality, nframes64_t&);
413 void do_embed (std::vector<Glib::ustring> paths, Editing::ImportDisposition, Editing::ImportMode mode, nframes64_t&);
415 void get_regions_corresponding_to (boost::shared_ptr<ARDOUR::Region> region, std::vector<RegionView*>& regions);
418 void map_transport_state ();
419 void map_position_change (nframes64_t);
425 void color_handler ();
427 ARDOUR::Session *session; ///< The session that we are editing, or 0
430 // to keep track of the playhead position for control_scroll
431 boost::optional<nframes64_t> _control_scroll_target;
433 PlaylistSelector* _playlist_selector;
435 typedef std::pair<TimeAxisView*,XMLNode*> TAVState;
439 double frames_per_unit;
440 nframes64_t leftmost_frame;
441 Editing::ZoomFocus zoom_focus;
442 bool zoomed_to_region;
443 std::list<TAVState> track_states;
446 std::list<VisualState*> undo_visual_stack;
447 std::list<VisualState*> redo_visual_stack;
448 VisualState* current_visual_state (bool with_tracks = true);
449 void undo_visual_state ();
450 void redo_visual_state ();
451 void use_visual_state (VisualState&);
453 void swap_visual_state ();
455 std::vector<VisualState*> visual_states;
456 sigc::connection visual_state_op_connection;
457 void start_visual_state_op (uint32_t n);
458 void cancel_visual_state_op (uint32_t n);
459 bool end_visual_state_op (uint32_t n);
461 nframes64_t leftmost_frame;
462 double frames_per_unit;
463 Editing::ZoomFocus zoom_focus;
465 void set_frames_per_unit (double);
468 Editing::MouseMode mouse_mode;
469 Editing::MidiEditMode midi_edit_mode;
471 int post_maximal_editor_width;
472 int post_maximal_pane_position;
473 int pre_maximal_pane_position;
474 int pre_maximal_editor_width;
475 void pane_allocation_handler (Gtk::Allocation&, Gtk::Paned*);
477 Gtk::Notebook the_notebook;
478 Gtk::HPaned edit_pane;
480 Gtk::EventBox meter_base;
482 Gtk::EventBox marker_base;
483 Gtk::HBox marker_box;
484 Gtk::VBox scrollers_rulers_markers_box;
486 void location_changed (ARDOUR::Location *);
487 void location_flags_changed (ARDOUR::Location *, void *);
488 void refresh_location_display ();
489 void refresh_location_display_s (ARDOUR::Change);
490 void refresh_location_display_internal (ARDOUR::Locations::LocationList&);
491 void add_new_location (ARDOUR::Location *);
492 void location_gone (ARDOUR::Location *);
493 void remove_marker (ArdourCanvas::Item&, GdkEvent*);
494 gint really_remove_marker (ARDOUR::Location* loc);
495 void goto_nth_marker (int nth);
497 uint32_t location_marker_color;
498 uint32_t location_range_color;
499 uint32_t location_loop_color;
500 uint32_t location_punch_color;
501 uint32_t location_cd_marker_color;
503 struct LocationMarkers {
508 LocationMarkers () : start(0), end(0), valid (true) {}
514 void set_name (const std::string&);
515 void set_position (nframes64_t start, nframes64_t end = 0);
516 void set_color_rgba (uint32_t);
519 LocationMarkers *find_location_markers (ARDOUR::Location *) const;
520 ARDOUR::Location* find_location_from_marker (Marker *, bool& is_start) const;
521 Marker* entered_marker;
523 typedef std::map<ARDOUR::Location*,LocationMarkers *> LocationMarkerMap;
524 LocationMarkerMap location_markers;
526 void hide_marker (ArdourCanvas::Item*, GdkEvent*);
527 void clear_marker_display ();
528 void mouse_add_new_marker (nframes64_t where, bool is_cd=false, bool is_xrun=false);
529 bool choose_new_marker_name(std::string &name);
530 void update_cd_marker_display ();
531 void ensure_cd_marker_updated (LocationMarkers * lam, ARDOUR::Location * location);
533 TimeAxisView* clicked_axisview;
534 RouteTimeAxisView* clicked_routeview;
535 /** The last RegionView that was clicked on, or 0 if the last click was not
536 * on a RegionView. This is set up by the canvas event handlers in
537 * editor_canvas_events.cc
539 RegionView* clicked_regionview;
540 RegionSelection latest_regionviews;
541 uint32_t clicked_selection;
542 CrossfadeView* clicked_crossfadeview;
543 ControlPoint* clicked_control_point;
545 void sort_track_selection (TrackSelection* sel = 0);
547 void get_relevant_tracks (std::set<RouteTimeAxisView*>& relevant_tracks) const;
548 void get_equivalent_tracks (RouteTimeAxisView*, std::set<RouteTimeAxisView*> &, ARDOUR::RouteGroup::Property) const;
549 void get_equivalent_regions (RegionView* rv, std::vector<RegionView*> &, ARDOUR::RouteGroup::Property) const;
550 RegionSelection get_equivalent_regions (RegionSelection &, ARDOUR::RouteGroup::Property) const;
551 void mapover_tracks (sigc::slot<void,RouteTimeAxisView&,uint32_t> sl, TimeAxisView*, ARDOUR::RouteGroup::Property) const;
553 /* functions to be passed to mapover_tracks(), possibly with sigc::bind()-supplied arguments */
555 void mapped_get_equivalent_regions (RouteTimeAxisView&, uint32_t, RegionView *, std::vector<RegionView*>*) const;
556 void mapped_use_new_playlist (RouteTimeAxisView&, uint32_t, std::vector<boost::shared_ptr<ARDOUR::Playlist> > const &);
557 void mapped_use_copy_playlist (RouteTimeAxisView&, uint32_t, std::vector<boost::shared_ptr<ARDOUR::Playlist> > const &);
558 void mapped_clear_playlist (RouteTimeAxisView&, uint32_t);
562 void button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type);
563 bool button_release_can_deselect;
565 void catch_vanishing_regionview (RegionView *);
567 void set_selected_track (TimeAxisView&, Selection::Operation op = Selection::Set, bool no_remove=false);
568 void select_all_tracks ();
570 bool set_selected_control_point_from_click (Selection::Operation op = Selection::Set, bool no_remove=false);
571 void set_selected_track_from_click (bool press, Selection::Operation op = Selection::Set, bool no_remove=false);
572 void set_selected_track_as_side_effect (bool force = false);
573 bool set_selected_regionview_from_click (bool press, Selection::Operation op = Selection::Set, bool no_track_remove=false);
575 bool set_selected_regionview_from_map_event (GdkEventAny*, StreamView*, boost::weak_ptr<ARDOUR::Region>);
576 void collect_new_region_view (RegionView *);
577 void collect_and_select_new_region_view (RegionView *);
579 Gtk::Menu track_context_menu;
580 Gtk::Menu track_region_context_menu;
581 Gtk::Menu track_selection_context_menu;
582 Gtk::Menu track_crossfade_context_menu;
584 Gtk::MenuItem* region_edit_menu_split_item;
585 Gtk::MenuItem* region_edit_menu_split_multichannel_item;
586 Gtk::Menu * track_region_edit_playlist_menu;
587 Gtk::Menu * track_edit_playlist_submenu;
588 Gtk::Menu * track_selection_edit_playlist_submenu;
590 void popup_track_context_menu (int, int, ItemType, bool, nframes64_t);
591 Gtk::Menu* build_track_context_menu (nframes64_t);
592 Gtk::Menu* build_track_bus_context_menu (nframes64_t);
593 Gtk::Menu* build_track_region_context_menu (nframes64_t frame);
594 Gtk::Menu* build_track_crossfade_context_menu (nframes64_t);
595 Gtk::Menu* build_track_selection_context_menu (nframes64_t);
596 void add_dstream_context_items (Gtk::Menu_Helpers::MenuList&);
597 void add_bus_context_items (Gtk::Menu_Helpers::MenuList&);
598 void add_region_context_items (StreamView*, boost::shared_ptr<ARDOUR::Region>, Gtk::Menu_Helpers::MenuList&);
599 void add_crossfade_context_items (AudioStreamView*, boost::shared_ptr<ARDOUR::Crossfade>, Gtk::Menu_Helpers::MenuList&, bool many);
600 void add_selection_context_items (Gtk::Menu_Helpers::MenuList&);
602 void add_item_with_sensitivity (Gtk::Menu_Helpers::MenuList&, Gtk::Menu_Helpers::MenuElem, bool) const;
604 void handle_new_route (ARDOUR::RouteList&);
605 void remove_route (TimeAxisView *);
608 Gtk::HBox global_hpacker;
609 Gtk::VBox global_vpacker;
612 Gdk::Cursor* current_canvas_cursor;
613 void set_canvas_cursor ();
614 Gdk::Cursor* which_grabber_cursor ();
616 ArdourCanvas::Canvas* track_canvas;
618 ArdourCanvas::Text* verbose_canvas_cursor;
619 bool verbose_cursor_visible;
621 void parameter_changed (std::string);
623 bool track_canvas_motion (GdkEvent*);
625 void set_verbose_canvas_cursor (const std::string &, double x, double y);
626 void set_verbose_canvas_cursor_text (const std::string &);
627 void show_verbose_canvas_cursor();
628 void hide_verbose_canvas_cursor();
630 bool verbose_cursor_on; // so far unused
632 Gtk::EventBox time_canvas_event_box;
633 Gtk::EventBox track_canvas_event_box;
634 Gtk::EventBox time_button_event_box;
635 Gtk::EventBox ruler_label_event_box;
637 ArdourCanvas::Group *minsec_group;
638 ArdourCanvas::Pixbuf *logo_item;
639 ArdourCanvas::Group *bbt_group;
640 ArdourCanvas::Group *smpte_group;
641 ArdourCanvas::Group *frame_group;
642 ArdourCanvas::Group *tempo_group;
643 ArdourCanvas::Group *meter_group;
644 ArdourCanvas::Group *marker_group;
645 ArdourCanvas::Group *range_marker_group;
646 ArdourCanvas::Group *transport_marker_group;
647 ArdourCanvas::Group* cd_marker_group;
649 ArdourCanvas::Group* timebar_group;
651 /* These bars never need to be scrolled */
652 ArdourCanvas::Group* meter_bar_group;
653 ArdourCanvas::Group* tempo_bar_group;
654 ArdourCanvas::Group* marker_bar_group;
655 ArdourCanvas::Group* range_marker_bar_group;
656 ArdourCanvas::Group* transport_marker_bar_group;
657 ArdourCanvas::Group* cd_marker_bar_group;
659 /** The group containing all items that require horizontal scrolling. */
660 ArdourCanvas::Group* _background_group;
662 The _master_group is the group containing all items
663 that require horizontal scrolling..
664 It is primarily used to separate canvas items
665 that require horizontal scrolling from those that do not.
667 ArdourCanvas::Group* _master_group;
669 /* The group containing all trackviews. Only scrolled vertically. */
670 ArdourCanvas::Group* _trackview_group;
672 /* The group used for region motion. Sits on top of _trackview_group */
673 ArdourCanvas::Group* _region_motion_group;
676 ruler_metric_smpte = 0,
677 ruler_metric_bbt = 1,
678 ruler_metric_frames = 2,
679 ruler_metric_minsec = 3,
681 ruler_time_tempo = 4,
682 ruler_time_meter = 5,
683 ruler_time_marker = 6,
684 ruler_time_range_marker = 7,
685 ruler_time_transport_marker = 8,
686 ruler_time_cd_marker = 9,
689 static GtkCustomMetric ruler_metrics[4];
690 Glib::RefPtr<Gtk::ToggleAction> ruler_timecode_action;
691 Glib::RefPtr<Gtk::ToggleAction> ruler_bbt_action;
692 Glib::RefPtr<Gtk::ToggleAction> ruler_samples_action;
693 Glib::RefPtr<Gtk::ToggleAction> ruler_minsec_action;
694 Glib::RefPtr<Gtk::ToggleAction> ruler_tempo_action;
695 Glib::RefPtr<Gtk::ToggleAction> ruler_meter_action;
696 Glib::RefPtr<Gtk::ToggleAction> ruler_marker_action;
697 Glib::RefPtr<Gtk::ToggleAction> ruler_range_action;
698 Glib::RefPtr<Gtk::ToggleAction> ruler_loop_punch_action;
699 Glib::RefPtr<Gtk::ToggleAction> ruler_cd_marker_action;
700 bool no_ruler_shown_update;
702 gint ruler_button_press (GdkEventButton*);
703 gint ruler_button_release (GdkEventButton*);
704 gint ruler_mouse_motion (GdkEventMotion*);
705 bool ruler_scroll (GdkEventScroll* event);
707 Gtk::Widget * ruler_grabbed_widget;
709 void initialize_rulers ();
710 void update_just_smpte ();
711 void compute_fixed_ruler_scale (); //calculates the RulerScale of the fixed rulers
712 void update_fixed_rulers ();
713 void update_tempo_based_rulers ();
714 void popup_ruler_menu (nframes64_t where = 0, ItemType type = RegionItem);
715 void update_ruler_visibility ();
716 void set_ruler_visible (RulerType, bool);
717 void toggle_ruler_visibility (RulerType rt);
718 void ruler_toggled (int);
719 gint ruler_label_button_release (GdkEventButton*);
720 void store_ruler_visibility ();
721 void restore_ruler_visibility ();
723 static gint _metric_get_smpte (GtkCustomRulerMark **, gdouble, gdouble, gint);
724 static gint _metric_get_bbt (GtkCustomRulerMark **, gdouble, gdouble, gint);
725 static gint _metric_get_frames (GtkCustomRulerMark **, gdouble, gdouble, gint);
726 static gint _metric_get_minsec (GtkCustomRulerMark **, gdouble, gdouble, gint);
728 enum MinsecRulerScale {
735 MinsecRulerScale minsec_ruler_scale;
737 nframes_t minsec_mark_interval;
738 gint minsec_mark_modulo;
740 void set_minsec_ruler_scale (gdouble lower, gdouble upper);
742 enum SMPTERulerScale {
750 SMPTERulerScale smpte_ruler_scale;
752 nframes_t smpte_mark_interval;
753 gint smpte_mark_modulo;
755 void set_smpte_ruler_scale (gdouble lower, gdouble upper);
765 bbt_show_ticks_detail,
766 bbt_show_ticks_super_detail
769 BBTRulerScale bbt_ruler_scale;
773 uint32_t bbt_bar_helper_on;
774 uint32_t bbt_accent_modulo;
775 void compute_bbt_ruler_scale (nframes64_t lower, nframes64_t upper);
777 gint metric_get_smpte (GtkCustomRulerMark **, gdouble, gdouble, gint);
778 gint metric_get_bbt (GtkCustomRulerMark **, gdouble, gdouble, gint);
779 gint metric_get_frames (GtkCustomRulerMark **, gdouble, gdouble, gint);
780 gint metric_get_minsec (GtkCustomRulerMark **, gdouble, gdouble, gint);
782 Gtk::Widget *_ruler_separator;
783 GtkWidget *_smpte_ruler;
784 GtkWidget *_bbt_ruler;
785 GtkWidget *_frames_ruler;
786 GtkWidget *_minsec_ruler;
787 Gtk::Widget *smpte_ruler;
788 Gtk::Widget *bbt_ruler;
789 Gtk::Widget *frames_ruler;
790 Gtk::Widget *minsec_ruler;
791 static Editor *ruler_editor;
793 static const double timebar_height;
794 guint32 visible_timebars;
795 gdouble canvas_timebars_vsize;
796 gdouble get_canvas_timebars_vsize () const { return canvas_timebars_vsize; }
797 Gtk::Menu *editor_ruler_menu;
799 ArdourCanvas::SimpleRect* tempo_bar;
800 ArdourCanvas::SimpleRect* meter_bar;
801 ArdourCanvas::SimpleRect* marker_bar;
802 ArdourCanvas::SimpleRect* range_marker_bar;
803 ArdourCanvas::SimpleRect* transport_marker_bar;
804 ArdourCanvas::SimpleRect* cd_marker_bar;
806 Gtk::Label minsec_label;
807 Gtk::Label bbt_label;
808 Gtk::Label smpte_label;
809 Gtk::Label frame_label;
810 Gtk::Label tempo_label;
811 Gtk::Label meter_label;
812 Gtk::Label mark_label;
813 Gtk::Label range_mark_label;
814 Gtk::Label transport_mark_label;
815 Gtk::Label cd_mark_label;
817 Gtk::VBox time_button_vbox;
818 Gtk::HBox time_button_hbox;
820 friend class EditorCursor;
822 EditorCursor* playhead_cursor;
823 ArdourCanvas::Group* cursor_group;
825 nframes64_t get_region_boundary (nframes64_t pos, int32_t dir, bool with_selection, bool only_onscreen);
827 void cursor_to_region_boundary (bool with_selection, int32_t dir);
828 void cursor_to_next_region_boundary (bool with_selection);
829 void cursor_to_previous_region_boundary (bool with_selection);
830 void cursor_to_next_region_point (EditorCursor*, ARDOUR::RegionPoint);
831 void cursor_to_previous_region_point (EditorCursor*, ARDOUR::RegionPoint);
832 void cursor_to_region_point (EditorCursor*, ARDOUR::RegionPoint, int32_t dir);
833 void cursor_to_selection_start (EditorCursor *);
834 void cursor_to_selection_end (EditorCursor *);
836 void selected_marker_to_region_boundary (bool with_selection, int32_t dir);
837 void selected_marker_to_next_region_boundary (bool with_selection);
838 void selected_marker_to_previous_region_boundary (bool with_selection);
839 void selected_marker_to_next_region_point (ARDOUR::RegionPoint);
840 void selected_marker_to_previous_region_point (ARDOUR::RegionPoint);
841 void selected_marker_to_region_point (ARDOUR::RegionPoint, int32_t dir);
842 void selected_marker_to_selection_start ();
843 void selected_marker_to_selection_end ();
845 void select_all_selectables_using_cursor (EditorCursor *, bool);
846 void select_all_selectables_using_edit (bool);
847 void select_all_selectables_between (bool within);
848 void select_range_between ();
850 boost::shared_ptr<ARDOUR::Region> find_next_region (nframes64_t, ARDOUR::RegionPoint, int32_t dir, TrackViewList&, TimeAxisView ** = 0);
851 nframes64_t find_next_region_boundary (nframes64_t, int32_t dir, const TrackViewList&);
853 std::vector<nframes64_t> region_boundary_cache;
854 void build_region_boundary_cache ();
857 Gtk::HBox bottom_hbox;
859 Gtk::Table edit_packer;
860 Gtk::VScrollbar edit_vscrollbar;
862 Gtk::Adjustment vertical_adjustment;
863 Gtk::Adjustment horizontal_adjustment;
865 Gtk::Layout controls_layout;
866 bool control_layout_scroll (GdkEventScroll* ev);
867 void controls_layout_size_request (Gtk::Requisition*);
868 sigc::connection controls_layout_size_request_connection;
870 Gtk::HScrollbar edit_hscrollbar;
871 bool _dragging_hscrollbar;
873 void reset_hscrollbar_stepping ();
875 bool hscrollbar_button_press (GdkEventButton*);
876 bool hscrollbar_button_release (GdkEventButton*);
877 void hscrollbar_allocate (Gtk::Allocation &alloc);
879 double _canvas_width;
880 double _canvas_height;
881 double full_canvas_height;
883 bool track_canvas_map_handler (GdkEventAny*);
885 gint edit_controls_button_release (GdkEventButton*);
886 Gtk::Menu *edit_controls_left_menu;
887 Gtk::Menu *edit_controls_right_menu;
889 Gtk::VBox ruler_label_vbox;
890 Gtk::VBox track_canvas_vbox;
891 Gtk::VBox time_canvas_vbox;
892 Gtk::VBox edit_controls_vbox;
893 Gtk::HBox edit_controls_hbox;
895 void control_scroll (float);
896 void access_action (std::string,std::string);
897 bool deferred_control_scroll (nframes64_t);
898 sigc::connection control_scroll_connection;
900 gdouble get_trackview_group_vertical_offset () const { return vertical_adjustment.get_value () - canvas_timebars_vsize;}
902 ArdourCanvas::Group* get_background_group () const { return _background_group; }
903 ArdourCanvas::Group* get_trackview_group () const { return _trackview_group; }
904 double last_trackview_group_vertical_offset;
905 void tie_vertical_scrolling ();
906 void scroll_canvas_horizontally ();
907 void scroll_canvas_vertically ();
909 struct VisualChange {
917 nframes64_t time_origin;
918 double frames_per_unit;
923 VisualChange() : pending ((VisualChange::Type) 0), time_origin (0), frames_per_unit (0), idle_handler_id (-1) {}
925 pending = Type (pending | t);
930 VisualChange pending_visual_change;
932 static int _idle_visual_changer (void *arg);
933 int idle_visual_changer ();
935 void queue_visual_change (nframes64_t);
936 void queue_visual_change (double);
937 void queue_visual_change_y (double);
938 void ensure_visual_change_idle_handler ();
940 void end_location_changed (ARDOUR::Location*);
944 Gtk::ScrolledWindow snapshot_display_scroller;
945 struct SnapshotDisplayModelColumns : public Gtk::TreeModel::ColumnRecord {
946 SnapshotDisplayModelColumns() {
950 Gtk::TreeModelColumn<Glib::ustring> visible_name;
951 Gtk::TreeModelColumn<Glib::ustring> real_name;
954 SnapshotDisplayModelColumns snapshot_display_columns;
955 Glib::RefPtr<Gtk::ListStore> snapshot_display_model;
956 Gtk::TreeView snapshot_display;
957 Gtk::Menu snapshot_context_menu;
959 bool snapshot_display_button_press (GdkEventButton*);
960 void snapshot_display_selection_changed ();
961 void redisplay_snapshots();
962 void popup_snapshot_context_menu (int, int32_t, Glib::ustring);
964 /* named selections */
966 struct NamedSelectionDisplayModelColumns : public Gtk::TreeModel::ColumnRecord {
967 NamedSelectionDisplayModelColumns() {
971 Gtk::TreeModelColumn<Glib::ustring> text;
972 Gtk::TreeModelColumn<ARDOUR::NamedSelection*> selection;
975 NamedSelectionDisplayModelColumns named_selection_columns;
976 Glib::RefPtr<Gtk::TreeStore> named_selection_model;
978 Gtkmm2ext::DnDTreeView<ARDOUR::NamedSelection*> named_selection_display;
979 Gtk::ScrolledWindow named_selection_scroller;
981 void create_named_selection ();
982 void paste_named_selection (float times);
983 void remove_selected_named_selections ();
984 void remove_snapshot (Glib::ustring);
985 void rename_snapshot (Glib::ustring);
987 void handle_new_named_selection ();
988 void add_named_selection_to_named_selection_display (ARDOUR::NamedSelection&);
989 void redisplay_named_selections ();
991 bool named_selection_display_button_release (GdkEventButton *ev);
992 bool named_selection_display_key_release (GdkEventKey *ev);
993 void named_selection_display_selection_changed ();
996 TrackViewList track_views;
997 std::pair<TimeAxisView*, ARDOUR::layer_t> trackview_by_y_position (double);
998 TrackSelection axis_views_from_routes (std::list<ARDOUR::Route *>) const;
1000 static Gdk::Cursor* cross_hair_cursor;
1001 static Gdk::Cursor* trimmer_cursor;
1002 static Gdk::Cursor* selector_cursor;
1003 static Gdk::Cursor* grabber_cursor;
1004 static Gdk::Cursor* grabber_edit_point_cursor;
1005 static Gdk::Cursor* zoom_cursor;
1006 static Gdk::Cursor* time_fx_cursor;
1007 static Gdk::Cursor* fader_cursor;
1008 static Gdk::Cursor* speaker_cursor;
1009 static Gdk::Cursor* midi_pencil_cursor;
1010 static Gdk::Cursor* midi_select_cursor;
1011 static Gdk::Cursor* midi_resize_cursor;
1012 static Gdk::Cursor* midi_erase_cursor;
1013 static Gdk::Cursor* wait_cursor;
1014 static Gdk::Cursor* timebar_cursor;
1015 static Gdk::Cursor* transparent_cursor;
1017 static void build_cursors ();
1019 sigc::connection scroll_connection;
1020 nframes64_t last_update_frame;
1021 void center_screen (nframes64_t);
1022 void center_screen_internal (nframes64_t, float);
1024 void update_current_screen ();
1026 void session_going_away ();
1028 nframes64_t cut_buffer_start;
1029 nframes64_t cut_buffer_length;
1031 bool typed_event (ArdourCanvas::Item*, GdkEvent*, ItemType);
1032 bool button_press_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
1033 bool button_release_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
1034 bool motion_handler (ArdourCanvas::Item*, GdkEvent*, bool from_autoscroll = false);
1035 bool enter_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
1036 bool leave_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
1038 /* KEYMAP HANDLING */
1040 void register_actions ();
1042 int ensure_cursor (nframes64_t* pos);
1044 void cut_copy (Editing::CutCopyOp);
1045 bool can_cut_copy () const;
1046 void cut_copy_points (Editing::CutCopyOp);
1047 void cut_copy_regions (Editing::CutCopyOp, RegionSelection&);
1048 void cut_copy_ranges (Editing::CutCopyOp);
1050 void mouse_paste ();
1051 void paste_internal (nframes64_t position, float times);
1053 /* EDITING OPERATIONS */
1055 void reset_point_selection ();
1056 void toggle_region_mute ();
1057 void toggle_region_lock ();
1058 void toggle_region_opaque ();
1059 void toggle_record_enable ();
1060 void set_region_lock_style (ARDOUR::Region::PositionLockStyle);
1061 void raise_region ();
1062 void raise_region_to_top ();
1063 void lower_region ();
1064 void lower_region_to_bottom ();
1065 void split_region ();
1066 void split_regions_at (nframes64_t, RegionSelection&);
1067 void split_region_at_transients ();
1068 void split_region_at_points (boost::shared_ptr<ARDOUR::Region>, ARDOUR::AnalysisFeatureList&, bool can_ferret);
1069 void crop_region_to_selection ();
1070 void crop_region_to (nframes64_t start, nframes64_t end);
1071 void set_sync_point (nframes64_t, const RegionSelection&);
1072 void set_region_sync_from_edit_point ();
1073 void remove_region_sync();
1074 void align_selection (ARDOUR::RegionPoint, nframes64_t position, const RegionSelection&);
1075 void align_selection_relative (ARDOUR::RegionPoint point, nframes64_t position, const RegionSelection&);
1076 void align_region (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, nframes64_t position);
1077 void align_region_internal (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, nframes64_t position);
1078 void remove_selected_regions ();
1079 void remove_clicked_region ();
1080 void edit_region ();
1081 void rename_region ();
1082 void duplicate_some_regions (RegionSelection&, float times);
1083 void duplicate_selection (float times);
1084 void region_fill_selection ();
1086 void region_fill_track ();
1087 void audition_playlist_region_standalone (boost::shared_ptr<ARDOUR::Region>);
1088 void audition_playlist_region_via_route (boost::shared_ptr<ARDOUR::Region>, ARDOUR::Route&);
1089 void split_multichannel_region();
1090 void reverse_region ();
1091 void strip_region_silence ();
1092 void normalize_region ();
1093 double _last_normalization_value;
1094 void denormalize_region ();
1095 void adjust_region_scale_amplitude (bool up);
1096 void quantize_region ();
1098 void do_insert_time ();
1099 void insert_time (nframes64_t, nframes64_t, Editing::InsertTimeOption, bool, bool, bool);
1101 void tab_to_transient (bool forward);
1103 void use_region_as_bar ();
1104 void use_range_as_bar ();
1106 void define_one_bar (nframes64_t start, nframes64_t end);
1108 void audition_region_from_region_list ();
1109 void hide_region_from_region_list ();
1111 void align (ARDOUR::RegionPoint);
1112 void align_relative (ARDOUR::RegionPoint);
1115 void reset_focus ();
1121 void paste (float times);
1123 int get_prefix (float&, bool&);
1125 void keyboard_paste ();
1126 void keyboard_insert_region_list_selection ();
1128 void region_from_selection ();
1129 void create_region_from_selection (std::vector<boost::shared_ptr<ARDOUR::Region> >&);
1131 void play_from_start ();
1132 void play_from_edit_point ();
1133 void play_from_edit_point_and_return ();
1134 void play_selected_region ();
1135 void play_edit_range ();
1136 void loop_selected_region ();
1137 void play_location (ARDOUR::Location&);
1138 void loop_location (ARDOUR::Location&);
1140 void temporal_zoom_selection ();
1141 void temporal_zoom_region (bool both_axes);
1142 void toggle_zoom_region (bool both_axes);
1143 bool zoomed_to_region;
1144 void temporal_zoom_session ();
1145 void temporal_zoom (gdouble scale);
1146 void temporal_zoom_by_frame (nframes64_t start, nframes64_t end, const std::string & op);
1147 void temporal_zoom_to_frame (bool coarser, nframes64_t frame);
1149 void amplitude_zoom (gdouble scale);
1150 void amplitude_zoom_step (bool in);
1152 void insert_region_list_drag (boost::shared_ptr<ARDOUR::Region>, int x, int y);
1153 void insert_region_list_selection (float times);
1155 void insert_route_list_drag (boost::shared_ptr<ARDOUR::Route>, int x, int y);
1157 /* import & embed */
1159 void add_external_audio_action (Editing::ImportMode);
1160 void external_audio_dialog ();
1161 void session_import_dialog ();
1163 int check_whether_and_how_to_import(std::string, bool all_or_nothing = true);
1164 bool check_multichannel_status (const std::vector<Glib::ustring>& paths);
1166 SoundFileOmega* sfbrowser;
1168 void bring_in_external_audio (Editing::ImportMode mode, nframes64_t& pos);
1170 bool idle_drop_paths (std::vector<Glib::ustring> paths, nframes64_t frame, double ypos);
1171 void drop_paths_part_two (const std::vector<Glib::ustring>& paths, nframes64_t frame, double ypos);
1173 int import_sndfiles (std::vector<Glib::ustring> paths, Editing::ImportMode mode, ARDOUR::SrcQuality, nframes64_t& pos,
1174 int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>, bool, uint32_t total);
1175 int embed_sndfiles (std::vector<Glib::ustring> paths, bool multiple_files, bool& check_sample_rate, Editing::ImportMode mode,
1176 nframes64_t& pos, int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>&);
1178 int add_sources (std::vector<Glib::ustring> paths, ARDOUR::SourceList& sources, nframes64_t& pos, Editing::ImportMode,
1179 int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>&, bool add_channel_suffix);
1180 int finish_bringing_in_material (boost::shared_ptr<ARDOUR::Region> region, uint32_t, uint32_t, nframes64_t& pos, Editing::ImportMode mode,
1181 boost::shared_ptr<ARDOUR::Track>& existing_track);
1183 boost::shared_ptr<ARDOUR::AudioTrack> get_nth_selected_audio_track (int nth) const;
1184 boost::shared_ptr<ARDOUR::MidiTrack> get_nth_selected_midi_track (int nth) const;
1186 /* generic interthread progress window */
1188 ArdourDialog* interthread_progress_window;
1189 Gtk::Label interthread_progress_label;
1190 Gtk::VBox interthread_progress_vbox;
1191 Gtk::ProgressBar interthread_progress_bar;
1192 Gtk::Button interthread_cancel_button;
1193 Gtk::Label interthread_cancel_label;
1194 sigc::connection interthread_progress_connection;
1195 void interthread_cancel_clicked ();
1196 void build_interthread_progress_window ();
1197 ARDOUR::InterThreadInfo* current_interthread_info;
1199 AnalysisWindow* analysis_window;
1201 /* import specific info */
1203 struct EditorImportStatus : public ARDOUR::Session::ImportStatus {
1204 Editing::ImportMode mode;
1208 boost::shared_ptr<ARDOUR::Track> track;
1212 EditorImportStatus import_status;
1213 gint import_progress_timeout (void *);
1214 static void *_import_thread (void *);
1215 void* import_thread ();
1216 void finish_import ();
1218 /* to support this ... */
1220 void import_audio (bool as_tracks);
1221 void do_import (std::vector<Glib::ustring> paths, bool split, bool as_tracks);
1223 void move_to_start ();
1224 void move_to_end ();
1226 void center_playhead ();
1227 void center_edit_point ();
1228 void edit_cursor_backward ();
1229 void edit_cursor_forward ();
1230 void playhead_forward_to_grid ();
1231 void playhead_backward_to_grid ();
1232 void playhead_backward ();
1233 void playhead_forward ();
1234 void scroll_playhead (bool forward);
1235 void scroll_backward (float pages=0.8f);
1236 void scroll_forward (float pages=0.8f);
1237 void scroll_tracks_down ();
1238 void scroll_tracks_up ();
1239 void delete_sample_forward ();
1240 void delete_sample_backward ();
1241 void delete_screen ();
1242 void search_backwards ();
1243 void search_forwards ();
1245 void clear_markers ();
1246 void clear_ranges ();
1247 void clear_locations ();
1248 void unhide_markers ();
1249 void unhide_ranges ();
1250 void jump_forward_to_mark ();
1251 void jump_backward_to_mark ();
1252 void cursor_align (bool playhead_to_edit);
1254 void remove_last_capture ();
1255 void select_all_selectables_using_time_selection ();
1256 void select_all_selectables_using_loop();
1257 void select_all_selectables_using_punch();
1258 void set_selection_from_range (ARDOUR::Location&);
1259 void set_selection_from_punch ();
1260 void set_selection_from_loop ();
1261 void set_selection_from_region ();
1263 void add_location_mark (nframes64_t where);
1264 void add_location_from_audio_region ();
1265 void add_locations_from_audio_region ();
1266 void add_location_from_selection ();
1267 void set_loop_from_selection (bool play);
1268 void set_punch_from_selection ();
1269 void set_punch_from_region ();
1271 void set_loop_from_edit_range (bool play);
1272 void set_loop_from_region (bool play);
1273 void set_punch_from_edit_range ();
1275 void set_loop_range (nframes64_t start, nframes64_t end, std::string cmd);
1276 void set_punch_range (nframes64_t start, nframes64_t end, std::string cmd);
1278 void add_location_from_playhead_cursor ();
1279 bool select_new_marker;
1281 void reverse_selection ();
1282 void edit_envelope ();
1284 void start_scrolling ();
1285 void stop_scrolling ();
1287 double last_scrub_x;
1288 int scrubbing_direction;
1289 int scrub_reversals;
1290 int scrub_reverse_distance;
1293 void keyboard_selection_begin ();
1294 void keyboard_selection_finish (bool add);
1295 bool have_pending_keyboard_selection;
1296 nframes64_t pending_keyboard_selection_start;
1298 boost::shared_ptr<ARDOUR::Region> select_region_for_operation (int dir, TimeAxisView **tv);
1299 void extend_selection_to_end_of_region (bool next);
1300 void extend_selection_to_start_of_region (bool previous);
1302 Editing::SnapType snap_type;
1303 Editing::SnapMode snap_mode;
1305 /// Snap threshold in pixels
1306 double snap_threshold;
1308 bool ignore_gui_changes;
1314 Gtk::Menu fade_context_menu;
1315 void popup_fade_context_menu (int, int, ArdourCanvas::Item*, ItemType);
1317 void set_fade_in_shape (ARDOUR::AudioRegion::FadeShape);
1318 void set_fade_out_shape (ARDOUR::AudioRegion::FadeShape);
1320 void set_fade_length (bool in);
1321 void toggle_fade_active (bool in);
1322 void set_fade_in_active (bool);
1323 void set_fade_out_active (bool);
1325 std::set<boost::shared_ptr<ARDOUR::Playlist> > motion_frozen_playlists;
1326 RegionSelection pre_drag_region_selection;
1328 bool _dragging_playhead;
1329 bool _dragging_edit_point;
1331 void marker_drag_motion_callback (GdkEvent*);
1332 void marker_drag_finished_callback (GdkEvent*);
1334 gint mouse_rename_region (ArdourCanvas::Item*, GdkEvent*);
1336 void start_region_grab (ArdourCanvas::Item*, GdkEvent*, RegionView*);
1337 void start_create_region_grab (ArdourCanvas::Item*, GdkEvent*);
1338 void start_region_copy_grab (ArdourCanvas::Item*, GdkEvent*, RegionView*);
1339 void start_region_brush_grab (ArdourCanvas::Item*, GdkEvent*, RegionView*);
1340 void start_selection_grab (ArdourCanvas::Item*, GdkEvent*);
1342 void region_view_item_click (AudioRegionView&, GdkEventButton*);
1344 void remove_gain_control_point (ArdourCanvas::Item*, GdkEvent*);
1345 void remove_control_point (ArdourCanvas::Item*, GdkEvent*);
1347 void mouse_brush_insert_region (RegionView*, nframes64_t pos);
1348 void brush (nframes64_t);
1350 void show_verbose_time_cursor (nframes64_t frame, double offset = 0, double xpos=-1, double ypos=-1);
1351 void show_verbose_duration_cursor (nframes64_t start, nframes64_t end, double offset = 0, double xpos=-1, double ypos=-1);
1352 double clamp_verbose_cursor_x (double);
1353 double clamp_verbose_cursor_y (double);
1355 /* Canvas event handlers */
1357 bool canvas_control_point_event (GdkEvent* event,ArdourCanvas::Item*, ControlPoint*);
1358 bool canvas_line_event (GdkEvent* event,ArdourCanvas::Item*, AutomationLine*);
1359 bool canvas_selection_rect_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1360 bool canvas_selection_start_trim_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1361 bool canvas_selection_end_trim_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1362 bool canvas_crossfade_view_event (GdkEvent* event,ArdourCanvas::Item*, CrossfadeView*);
1363 bool canvas_fade_in_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1364 bool canvas_fade_in_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1365 bool canvas_fade_out_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1366 bool canvas_fade_out_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1369 // These variables are used to detect a feedback loop and break it to avoid a gui hang
1371 ArdourCanvas::Item *last_item_entered;
1372 int last_item_entered_n;
1375 bool canvas_region_view_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1376 bool canvas_region_view_name_highlight_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1377 bool canvas_region_view_name_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1378 bool canvas_stream_view_event (GdkEvent* event,ArdourCanvas::Item*, RouteTimeAxisView*);
1379 bool canvas_marker_event (GdkEvent* event,ArdourCanvas::Item*, Marker*);
1380 bool canvas_zoom_rect_event (GdkEvent* event,ArdourCanvas::Item*);
1381 bool canvas_tempo_marker_event (GdkEvent* event,ArdourCanvas::Item*, TempoMarker*);
1382 bool canvas_meter_marker_event (GdkEvent* event,ArdourCanvas::Item*, MeterMarker*);
1383 bool canvas_automation_track_event(GdkEvent* event, ArdourCanvas::Item*, AutomationTimeAxisView*) ;
1385 bool canvas_tempo_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1386 bool canvas_meter_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1387 bool canvas_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1388 bool canvas_range_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1389 bool canvas_transport_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1390 bool canvas_cd_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1392 bool canvas_imageframe_item_view_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1393 bool canvas_imageframe_view_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameTimeAxis*);
1394 bool canvas_imageframe_start_handle_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1395 bool canvas_imageframe_end_handle_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1396 bool canvas_marker_time_axis_view_event(GdkEvent* event, ArdourCanvas::Item*,MarkerTimeAxis*);
1397 bool canvas_markerview_item_view_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1398 bool canvas_markerview_start_handle_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1399 bool canvas_markerview_end_handle_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1401 /* non-public event handlers */
1403 bool canvas_playhead_cursor_event (GdkEvent* event, ArdourCanvas::Item*);
1404 bool track_canvas_scroll (GdkEventScroll* event);
1406 bool track_canvas_scroll_event (GdkEventScroll* event);
1407 bool track_canvas_button_press_event (GdkEventButton* event);
1408 bool track_canvas_button_release_event (GdkEventButton* event);
1409 bool track_canvas_motion_notify_event (GdkEventMotion* event);
1411 Gtk::Allocation canvas_allocation;
1412 void track_canvas_allocate (Gtk::Allocation alloc);
1413 bool track_canvas_size_allocated ();
1414 bool track_canvas_drag_motion (Glib::RefPtr<Gdk::DragContext> const &, int, int, guint);
1416 void set_playhead_cursor ();
1418 void kbd_driver (sigc::slot<void,GdkEvent*>, bool use_track_canvas = true, bool use_time_canvas = true, bool can_select = true);
1419 void kbd_mute_unmute_region ();
1422 void kbd_do_brush (GdkEvent*);
1423 void kbd_do_audition (GdkEvent*);
1425 void handle_new_duration ();
1426 void initialize_canvas ();
1428 /* display control */
1430 bool _show_measures;
1431 /// true if the editor should follow the playhead, otherwise false
1432 bool _follow_playhead;
1433 /// true if waveforms should be shown while recording audio tracks, otherwise false
1434 bool _show_waveforms_recording;
1436 ARDOUR::TempoMap::BBTPointList *current_bbt_points;
1438 TempoLines* tempo_lines;
1440 ArdourCanvas::Group* time_line_group;
1442 void hide_measures ();
1443 void draw_measures ();
1444 bool redraw_measures ();
1446 void new_tempo_section ();
1448 void mouse_add_new_tempo_event (nframes64_t where);
1449 void mouse_add_new_meter_event (nframes64_t where);
1451 void remove_tempo_marker (ArdourCanvas::Item*);
1452 void remove_meter_marker (ArdourCanvas::Item*);
1453 gint real_remove_tempo_marker (ARDOUR::TempoSection*);
1454 gint real_remove_meter_marker (ARDOUR::MeterSection*);
1456 void edit_tempo_section (ARDOUR::TempoSection*);
1457 void edit_meter_section (ARDOUR::MeterSection*);
1458 void edit_tempo_marker (ArdourCanvas::Item*);
1459 void edit_meter_marker (ArdourCanvas::Item*);
1460 void edit_control_point (ArdourCanvas::Item*);
1462 void marker_menu_edit ();
1463 void marker_menu_remove ();
1464 void marker_menu_rename ();
1465 void marker_menu_lock (bool yn);
1466 void marker_menu_hide ();
1467 void marker_menu_loop_range ();
1468 void marker_menu_select_all_selectables_using_range ();
1469 void marker_menu_select_using_range ();
1470 void marker_menu_separate_regions_using_location ();
1471 void marker_menu_play_from ();
1472 void marker_menu_play_range ();
1473 void marker_menu_set_playhead ();
1474 void marker_menu_set_from_playhead ();
1475 void marker_menu_set_from_selection ();
1476 void marker_menu_range_to_next ();
1477 void new_transport_marker_menu_set_loop ();
1478 void new_transport_marker_menu_set_punch ();
1479 void update_loop_range_view (bool visibility=false);
1480 void update_punch_range_view (bool visibility=false);
1481 void new_transport_marker_menu_popdown ();
1482 void marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1483 void tm_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1484 void transport_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1485 void new_transport_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1486 void build_range_marker_menu (bool loop_or_punch);
1487 void build_marker_menu (bool start_or_end);
1488 void build_tm_marker_menu ();
1489 void build_new_transport_marker_menu ();
1491 Gtk::Menu* tm_marker_menu;
1492 Gtk::Menu* marker_menu;
1493 Gtk::Menu* start_end_marker_menu;
1494 Gtk::Menu* range_marker_menu;
1495 Gtk::Menu* transport_marker_menu;
1496 Gtk::Menu* new_transport_marker_menu;
1497 Gtk::Menu* cd_marker_menu;
1498 ArdourCanvas::Item* marker_menu_item;
1500 typedef std::list<Marker*> Marks;
1503 void remove_metric_marks ();
1504 void draw_metric_marks (const ARDOUR::Metrics& metrics);
1506 void compute_current_bbt_points (nframes_t left, nframes_t right);
1507 void tempo_map_changed (ARDOUR::Change);
1508 void redisplay_tempo (bool immediate_redraw);
1510 void snap_to (nframes64_t& first, int32_t direction = 0, bool for_mark = false);
1511 void snap_to (nframes64_t& first, nframes64_t& last, int32_t direction = 0, bool for_mark = false);
1513 double snap_length_beats (nframes64_t start);
1515 uint32_t bbt_beat_subdivision;
1519 Gtk::ToggleButton editor_mixer_button;
1520 Gtk::ToggleButton editor_list_button;
1521 void editor_mixer_button_toggled ();
1522 void editor_list_button_toggled ();
1524 AudioClock edit_point_clock;
1525 AudioClock zoom_range_clock;
1526 Gtk::Button zoom_in_button;
1527 Gtk::Button zoom_out_button;
1528 Gtk::Button zoom_out_full_button;
1529 Gtk::Button zoom_onetoone_button;
1531 Gtk::VBox toolbar_clock_vbox;
1532 Gtk::VBox toolbar_selection_clock_vbox;
1533 Gtk::Table toolbar_selection_clock_table;
1534 Gtk::Label toolbar_selection_cursor_label;
1536 Gtk::HBox mouse_mode_button_box;
1537 Gtkmm2ext::TearOff* mouse_mode_tearoff;
1538 Gtk::ToggleButton mouse_select_button;
1539 Gtk::ToggleButton mouse_move_button;
1540 Gtk::ToggleButton mouse_gain_button;
1541 Gtk::ToggleButton mouse_zoom_button;
1542 Gtk::ToggleButton mouse_timefx_button;
1543 Gtk::ToggleButton mouse_audition_button;
1544 Gtk::ToggleButton mouse_note_button;
1545 GroupedButtons *mouse_mode_button_set;
1546 void mouse_mode_toggled (Editing::MouseMode m);
1547 bool ignore_mouse_mode_toggle;
1549 gint mouse_select_button_release (GdkEventButton*);
1551 Gtk::VBox automation_box;
1552 Gtk::Button automation_mode_button;
1553 Gtk::ToggleButton global_automation_button;
1555 Gtk::ComboBoxText edit_mode_selector;
1556 Gtk::VBox edit_mode_box;
1558 void set_edit_mode (ARDOUR::EditMode);
1559 void cycle_edit_mode ();
1560 void edit_mode_selection_done ();
1562 Gtk::ComboBoxText snap_type_selector;
1563 Gtk::ComboBoxText snap_mode_selector;
1566 std::vector<std::string> snap_type_strings;
1567 std::vector<std::string> snap_mode_strings;
1569 void snap_type_selection_done ();
1570 void snap_mode_selection_done ();
1571 void snap_mode_chosen (Editing::SnapMode);
1572 void snap_type_chosen (Editing::SnapType);
1574 Glib::RefPtr<Gtk::RadioAction> snap_type_action (Editing::SnapType);
1575 Glib::RefPtr<Gtk::RadioAction> snap_mode_action (Editing::SnapMode);
1577 Gtk::ComboBoxText zoom_focus_selector;
1578 Gtk::VBox zoom_focus_box;
1580 std::vector<std::string> zoom_focus_strings;
1582 void zoom_focus_selection_done ();
1583 void zoom_focus_chosen (Editing::ZoomFocus);
1585 Glib::RefPtr<Gtk::RadioAction> zoom_focus_action (Editing::ZoomFocus);
1588 Gtk::VBox zoom_vbox;
1590 void zoom_adjustment_changed();
1592 void edit_point_clock_changed();
1594 void setup_toolbar ();
1596 Gtkmm2ext::TearOff* tools_tearoff;
1597 Gtk::HBox toolbar_hbox;
1598 Gtk::EventBox toolbar_base;
1599 Gtk::Frame toolbar_frame;
1603 Gtk::HBox midi_tool_button_box;
1604 Gtk::ToggleButton midi_tool_pencil_button;
1605 Gtk::ToggleButton midi_tool_select_button;
1606 Gtk::ToggleButton midi_tool_resize_button;
1607 Gtk::ToggleButton midi_tool_erase_button;
1608 Gtk::Button midi_panic_button;
1609 Gtk::ToggleButton midi_sound_notes;
1610 GroupedButtons *midi_tool_button_set;
1611 void midi_edit_mode_toggled (Editing::MidiEditMode m);
1612 void midi_panic_button_pressed ();
1613 bool sound_notes () const { return midi_sound_notes.get_active(); }
1615 bool ignore_midi_edit_mode_toggle;
1617 Gtkmm2ext::TearOff* midi_tools_tearoff;
1618 Gtk::HBox midi_toolbar_hbox;
1619 Gtk::EventBox midi_toolbar_base;
1620 Gtk::Frame midi_toolbar_frame;
1622 void setup_midi_toolbar ();
1624 /* selection process */
1626 Selection* selection;
1627 Selection* cut_buffer;
1629 void time_selection_changed ();
1630 void track_selection_changed ();
1631 void region_selection_changed ();
1632 sigc::connection editor_regions_selection_changed_connection;
1633 void sensitize_the_right_region_actions (bool have_selected_regions);
1634 void point_selection_changed ();
1635 void marker_selection_changed ();
1637 void cancel_selection ();
1639 void region_selection_op (void (ARDOUR::Region::*pmf)(void));
1640 void region_selection_op (void (ARDOUR::Region::*pmf)(void*), void*);
1641 void region_selection_op (void (ARDOUR::Region::*pmf)(bool), bool);
1643 bool audio_region_selection_covers (nframes64_t where);
1645 /* transport range select process */
1647 ArdourCanvas::SimpleRect* cd_marker_bar_drag_rect;
1648 ArdourCanvas::SimpleRect* range_bar_drag_rect;
1649 ArdourCanvas::SimpleRect* transport_bar_drag_rect;
1652 ArdourCanvas::SimpleRect *bogus_background_rect;
1654 ArdourCanvas::SimpleRect *transport_bar_range_rect;
1655 ArdourCanvas::SimpleRect *transport_bar_preroll_rect;
1656 ArdourCanvas::SimpleRect *transport_bar_postroll_rect;
1657 ArdourCanvas::SimpleRect *transport_loop_range_rect;
1658 ArdourCanvas::SimpleRect *transport_punch_range_rect;
1659 ArdourCanvas::SimpleLine *transport_punchin_line;
1660 ArdourCanvas::SimpleLine *transport_punchout_line;
1661 ArdourCanvas::SimpleRect *transport_preroll_rect;
1662 ArdourCanvas::SimpleRect *transport_postroll_rect;
1664 ARDOUR::Location* transport_loop_location();
1665 ARDOUR::Location* transport_punch_location();
1667 ARDOUR::Location *temp_location;
1669 /* object rubberband select process */
1671 bool select_all_within (nframes64_t start, nframes64_t end, gdouble topy, gdouble boty, const TrackViewList&, Selection::Operation op);
1673 ArdourCanvas::SimpleRect *rubberband_rect;
1675 /* mouse zoom process */
1677 ArdourCanvas::SimpleRect *zoom_rect;
1678 void reposition_zoom_rect (nframes64_t start, nframes64_t end);
1680 EditorRouteGroups* _route_groups;
1681 EditorRoutes* _routes;
1682 EditorRegions* _regions;
1684 /* diskstream/route display management */
1685 Glib::RefPtr<Gdk::Pixbuf> rec_enabled_icon;
1686 Glib::RefPtr<Gdk::Pixbuf> rec_disabled_icon;
1688 Glib::RefPtr<Gtk::TreeSelection> route_display_selection;
1690 bool sync_track_view_list_and_routes ();
1692 Gtk::VBox list_vpacker;
1696 bool autoscroll_active;
1697 int autoscroll_timeout_tag;
1700 int last_autoscroll_x;
1701 int last_autoscroll_y;
1702 uint32_t autoscroll_cnt;
1703 nframes64_t autoscroll_x_distance;
1704 double autoscroll_y_distance;
1706 static gint _autoscroll_canvas (void *);
1707 bool autoscroll_canvas ();
1708 void start_canvas_autoscroll (int x, int y);
1709 void stop_canvas_autoscroll ();
1710 void maybe_autoscroll (GdkEventMotion*, bool);
1711 bool allow_vertical_scroll;
1714 void point_trim (GdkEvent*);
1715 void single_contents_trim (RegionView&, nframes64_t, bool, bool, bool);
1716 void single_start_trim (RegionView&, nframes64_t, bool, bool, bool);
1717 void single_end_trim (RegionView&, nframes64_t, bool, bool, bool);
1719 void thaw_region_after_trim (RegionView& rv);
1721 void trim_region_front();
1722 void trim_region_back();
1723 void trim_region (bool front);
1725 void trim_region_to_edit_point ();
1726 void trim_region_from_edit_point ();
1727 void trim_region_to_loop ();
1728 void trim_region_to_punch ();
1729 void trim_region_to_location (const ARDOUR::Location&, const char* cmd);
1731 void trim_to_region(bool forward);
1732 void trim_region_to_previous_region_end();
1733 void trim_region_to_next_region_start();
1735 bool show_gain_after_trim;
1739 int convert_drop_to_paths (
1740 std::vector<Glib::ustring>& paths,
1741 const Glib::RefPtr<Gdk::DragContext>& context,
1744 const Gtk::SelectionData& data,
1748 void track_canvas_drag_data_received (
1749 const Glib::RefPtr<Gdk::DragContext>& context,
1752 const Gtk::SelectionData& data,
1757 const Glib::RefPtr<Gdk::DragContext>& context,
1760 const Gtk::SelectionData& data,
1765 const Glib::RefPtr<Gdk::DragContext>& context,
1768 const Gtk::SelectionData& data,
1773 const Glib::RefPtr<Gdk::DragContext>& context,
1776 const Gtk::SelectionData& data,
1782 int write_region_selection(RegionSelection&);
1783 bool write_region (std::string path, boost::shared_ptr<ARDOUR::AudioRegion>);
1784 void bounce_region_selection ();
1785 void bounce_range_selection (bool replace, bool enable_processing);
1786 void external_edit_region ();
1788 int write_audio_selection (TimeSelection&);
1789 bool write_audio_range (ARDOUR::AudioPlaylist&, const ARDOUR::ChanCount& channels, std::list<ARDOUR::AudioRange>&);
1791 void write_selection ();
1793 XMLNode *before; /* used in *_reversible_command */
1795 void begin_reversible_command (std::string cmd_name);
1796 void commit_reversible_command ();
1798 void update_title ();
1799 void update_title_s (const std::string & snapshot_name);
1802 Selection* selection;
1803 double frames_per_unit;
1805 State (PublicEditor const * e);
1809 void store_state (State&) const;
1810 void restore_state (State *);
1812 void instant_save ();
1814 boost::shared_ptr<ARDOUR::AudioRegion> last_audition_region;
1816 /* freeze operations */
1818 ARDOUR::InterThreadInfo freeze_status;
1819 gint freeze_progress_timeout (void *);
1820 static void* _freeze_thread (void*);
1821 void* freeze_thread ();
1823 void freeze_route ();
1824 void unfreeze_route ();
1826 /* route-group solo + mute */
1828 void set_route_group_solo (ARDOUR::Route&, bool);
1829 void set_route_group_mute (ARDOUR::Route&, bool);
1833 void duplicate_dialog (bool with_dialog);
1835 nframes64_t event_frame (GdkEvent const *, double* px = 0, double* py = 0) const;
1837 /* returns false if mouse pointer is not in track or marker canvas
1839 bool mouse_frame (nframes64_t&, bool& in_track_canvas) const;
1841 /* "whats mine is yours" */
1843 TimeFXDialog* current_timefx;
1845 static void* timefx_thread (void *arg);
1846 void do_timefx (TimeFXDialog&);
1848 int time_stretch (RegionSelection&, float fraction);
1849 int pitch_shift (RegionSelection&, float cents);
1850 void pitch_shift_regions ();
1851 int time_fx (RegionSelection&, float val, bool pitching);
1853 /* editor-mixer strip */
1855 MixerStrip *current_mixer_strip;
1856 bool show_editor_mixer_when_tracks_arrive;
1857 Gtk::VBox current_mixer_strip_vbox;
1858 void cms_new (boost::shared_ptr<ARDOUR::Route>);
1859 void cms_deleted ();
1860 void current_mixer_strip_hidden ();
1861 void current_mixer_strip_removed ();
1863 void detach_tearoff (Gtk::Box* b, Gtk::Window* w);
1864 void reattach_tearoff (Gtk::Box* b, Gtk::Window* w, int32_t n);
1866 void ensure_all_elements_drawn ();
1868 /* nudging tracks */
1870 void nudge_track (bool use_edit_point, bool forwards);
1874 bool _xfade_visibility;
1877 void handle_new_imageframe_time_axis_view(const std::string & track_name, void* src) ;
1878 void handle_new_imageframe_marker_time_axis_view(const std::string & track_name, TimeAxisView* marked_track) ;
1880 void start_imageframe_grab(ArdourCanvas::Item*, GdkEvent*) ;
1881 void start_markerview_grab(ArdourCanvas::Item*, GdkEvent*) ;
1883 void imageframe_drag_motion_callback(ArdourCanvas::Item*, GdkEvent*) ;
1884 void markerview_drag_motion_callback(ArdourCanvas::Item*, GdkEvent*) ;
1885 void timeaxis_item_drag_finished_callback(ArdourCanvas::Item*, GdkEvent*) ;
1887 gint canvas_imageframe_item_view_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameView* ifv);
1888 gint canvas_imageframe_view_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameTimeAxis* ifta);
1889 gint canvas_imageframe_start_handle_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameView* ifv);
1890 gint canvas_imageframe_end_handle_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameView* ifv);
1892 gint canvas_marker_time_axis_view_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerTimeAxis* mta);
1893 gint canvas_markerview_item_view_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerView* mv);
1894 gint canvas_markerview_start_handle_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerView* mv);
1895 gint canvas_markerview_end_handle_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerView* mv);
1897 void imageframe_start_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1898 void imageframe_end_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1899 void imageframe_start_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1900 void imageframe_start_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1901 void imageframe_end_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1902 void imageframe_end_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1904 void markerview_item_start_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1905 void markerview_item_end_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1906 void markerview_start_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1907 void markerview_start_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1908 void markerview_end_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1909 void markerview_end_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1911 void popup_imageframe_edit_menu(int button, int32_t time, ArdourCanvas::Item* ifv, bool with_frame) ;
1912 void popup_marker_time_axis_edit_menu(int button, int32_t time, ArdourCanvas::Item* ifv, bool with_frame) ;
1914 ImageFrameSocketHandler* image_socket_listener ;
1917 void toggle_xfade_active (boost::weak_ptr<ARDOUR::Crossfade>);
1918 void toggle_xfade_length (boost::weak_ptr<ARDOUR::Crossfade>);
1919 void edit_xfade (boost::weak_ptr<ARDOUR::Crossfade>);
1920 void xfade_edit_left_region ();
1921 void xfade_edit_right_region ();
1923 static const int32_t default_width = 995;
1924 static const int32_t default_height = 765;
1928 Gtk::Button nudge_forward_button;
1929 Gtk::Button nudge_backward_button;
1930 Gtk::HBox nudge_hbox;
1931 Gtk::VBox nudge_vbox;
1932 AudioClock nudge_clock;
1934 nframes64_t get_nudge_distance (nframes64_t pos, nframes64_t& next);
1936 bool nudge_forward_release (GdkEventButton*);
1937 bool nudge_backward_release (GdkEventButton*);
1941 void apply_filter (ARDOUR::Filter&, std::string cmd);
1943 /* handling cleanup */
1945 int playlist_deletion_dialog (boost::shared_ptr<ARDOUR::Playlist>);
1947 std::vector<sigc::connection> session_connections;
1949 /* tracking step changes of track height */
1951 TimeAxisView* current_stepping_trackview;
1952 ARDOUR::microseconds_t last_track_height_step_timestamp;
1953 gint track_height_step_timeout();
1954 sigc::connection step_timeout;
1956 TimeAxisView* entered_track;
1957 RegionView* entered_regionview;
1960 void ensure_entered_track_selected (bool op_acts_on_objects = false);
1961 bool clear_entered_track;
1962 bool left_track_canvas (GdkEventCrossing*);
1963 bool entered_track_canvas (GdkEventCrossing*);
1964 void set_entered_track (TimeAxisView*);
1965 void set_entered_regionview (RegionView*);
1966 void ensure_track_visible (TimeAxisView*);
1967 gint left_automation_track ();
1969 bool _new_regionviews_show_envelope;
1971 void reset_canvas_action_sensitivity (bool);
1972 void toggle_gain_envelope_visibility ();
1973 void toggle_gain_envelope_active ();
1974 void reset_region_gain_envelopes ();
1976 bool on_key_press_event (GdkEventKey*);
1977 bool on_key_release_event (GdkEventKey*);
1979 void session_state_saved (std::string);
1981 Glib::RefPtr<Gtk::Action> undo_action;
1982 Glib::RefPtr<Gtk::Action> redo_action;
1984 void history_changed ();
1986 Gtk::HBox status_bar_hpacker;
1988 Editing::EditPoint _edit_point;
1990 Gtk::ComboBoxText edit_point_selector;
1992 void set_edit_point_preference (Editing::EditPoint ep, bool force = false);
1993 void cycle_edit_point (bool with_marker);
1994 void set_edit_point ();
1995 void edit_point_selection_done ();
1996 void edit_point_chosen (Editing::EditPoint);
1997 Glib::RefPtr<Gtk::RadioAction> edit_point_action (Editing::EditPoint);
1998 std::vector<std::string> edit_point_strings;
2000 void selected_marker_moved (ARDOUR::Location*);
2001 sigc::connection edit_point_clock_connection_a;
2002 sigc::connection edit_point_clock_connection_b;
2004 bool get_edit_op_range (nframes64_t& start, nframes64_t& end) const;
2006 void get_regions_at (RegionSelection&, nframes64_t where, const TrackSelection& ts) const;
2007 void get_regions_after (RegionSelection&, nframes64_t where, const TrackSelection& ts) const;
2009 void get_regions_for_action (RegionSelection&, bool allowed_entered_regionview = false);
2011 sigc::connection fast_screen_update_connection;
2012 gint start_updating ();
2013 gint stop_updating ();
2014 void fast_update_strips ();
2015 bool meters_running;
2017 void select_next_route ();
2018 void select_prev_route ();
2020 void snap_to_internal (nframes64_t& first, int32_t direction = 0, bool for_mark = false);
2022 RhythmFerret* rhythm_ferret;
2023 BundleManager* _bundle_manager;
2024 GlobalPortMatrixWindow* _global_port_matrix[ARDOUR::DataType::num_types];
2026 void fit_tracks (TrackSelection &);
2027 void fit_selected_tracks ();
2028 void set_track_height (uint32_t h);
2030 void remove_tracks ();
2031 void toggle_tracks_active ();
2036 friend gboolean _idle_resize (gpointer);
2037 int32_t _pending_resize_amount;
2038 TimeAxisView* _pending_resize_view;
2040 void visible_order_range (int*, int*) const;
2043 bool _pending_locate_request;
2045 EditorSummary* _summary;
2046 void region_view_added (RegionView *);
2048 void update_canvas_now ();
2049 void streamview_height_changed ();
2051 EditorGroupTabs* _group_tabs;
2052 void fit_route_group (ARDOUR::RouteGroup *);
2055 friend class RegionDrag;
2056 friend class RegionMoveDrag;
2057 friend class RegionSpliceDrag;
2058 friend class TrimDrag;
2059 friend class MeterMarkerDrag;
2060 friend class TempoMarkerDrag;
2061 friend class CursorDrag;
2062 friend class FadeInDrag;
2063 friend class FadeOutDrag;
2064 friend class MarkerDrag;
2065 friend class RegionGainDrag;
2066 friend class ControlPointDrag;
2067 friend class LineDrag;
2068 friend class RubberbandSelectDrag;
2069 friend class TimeFXDrag;
2070 friend class ScrubDrag;
2071 friend class SelectionDrag;
2072 friend class RangeMarkerBarDrag;
2073 friend class MouseZoomDrag;
2074 friend class RegionCreateDrag;
2075 friend class RegionMotionDrag;
2076 friend class RegionInsertDrag;
2078 friend class EditorSummary;
2079 friend class EditorGroupTabs;
2081 friend class EditorRoutes;
2084 #endif /* __ardour_editor_h__ */