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 <boost/optional.hpp>
32 #include <libgnomecanvasmm/canvas.h>
33 #include <libgnomecanvasmm/group.h>
34 #include <libgnomecanvasmm/line.h>
35 #include <libgnomecanvasmm/pixbuf.h>
39 #include <gtkmm/comboboxtext.h>
40 #include <gtkmm/layout.h>
42 #include <gtkmm2ext/selector.h>
43 #include <gtkmm2ext/click_box.h>
44 #include <gtkmm2ext/dndtreeview.h>
46 #include "pbd/stateful.h"
47 #include "pbd/signals.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 "window_proxy.h"
68 namespace Gnome { namespace Canvas {
98 class AudioRegionView;
99 class AudioStreamView;
100 class AudioTimeAxisView;
101 class AutomationLine;
102 class AutomationSelection;
103 class AutomationTimeAxisView;
108 class GroupedButtons;
110 class MidiRegionView;
112 class PlaylistSelector;
113 class PluginSelector;
116 class SoundFileOmega;
122 class EditorGroupTabs;
124 class EditorRouteGroups;
126 class EditorLocations;
127 class EditorSnapshots;
129 class RegionLayeringOrderEditor;
130 class ProgressReporter;
132 /* <CMT Additions> */
133 class ImageFrameView;
134 class ImageFrameTimeAxisView;
135 class ImageFrameTimeAxis;
136 class MarkerTimeAxis ;
138 class ImageFrameSocketHandler ;
139 class TimeAxisViewItem ;
140 /* </CMT Additions> */
142 struct EditorCursor {
144 ArdourCanvas::Points points;
145 ArdourCanvas::Line canvas_item;
146 framepos_t current_frame;
149 EditorCursor (Editor&, bool (Editor::*)(GdkEvent*,ArdourCanvas::Item*));
152 void set_position (framepos_t);
153 void set_length (double units);
154 void set_y_axis (double position);
156 PBD::Signal1<void, framepos_t> PositionChanged;
159 class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARDOUR::SessionHandlePtr
165 void set_session (ARDOUR::Session *);
166 ARDOUR::Session* session() const { return _session; }
169 virtual bool have_idled () const { return _have_idled; }
171 framepos_t leftmost_position() const { return leftmost_frame; }
173 framecnt_t current_page_frames() const {
174 return (framecnt_t) floor (_canvas_width * frames_per_unit);
177 double canvas_height () const {
178 return _canvas_height;
181 void cycle_snap_mode ();
182 void cycle_snap_choice ();
183 void set_snap_to (Editing::SnapType);
184 void set_snap_mode (Editing::SnapMode);
185 void set_snap_threshold (double pixel_distance) {snap_threshold = pixel_distance;}
187 Editing::SnapMode snap_mode () const;
188 Editing::SnapType snap_type () const;
190 void undo (uint32_t n = 1);
191 void redo (uint32_t n = 1);
193 XMLNode& get_state ();
194 int set_state (const XMLNode&, int version);
196 void set_mouse_mode (Editing::MouseMode, bool force=true);
197 void step_mouse_mode (bool next);
198 Editing::MouseMode current_mouse_mode () const { return mouse_mode; }
199 Editing::MidiEditMode current_midi_edit_mode () const;
200 void remove_midi_note (ArdourCanvas::Item *, GdkEvent *);
202 bool internal_editing() const { return _internal_editing ; }
203 void set_internal_edit (bool yn);
206 void add_imageframe_time_axis(const std::string & track_name, void*) ;
207 void add_imageframe_marker_time_axis(const std::string & track_name, TimeAxisView* marked_track, void*) ;
208 void connect_to_image_compositor() ;
209 void scroll_timeaxis_to_imageframe_item(const TimeAxisViewItem* item) ;
210 TimeAxisView* get_named_time_axis(const std::string & name) ;
211 #endif /* WITH_CMT */
213 void foreach_time_axis_view (sigc::slot<void,TimeAxisView&>);
214 void add_to_idle_resize (TimeAxisView*, int32_t);
216 RouteTimeAxisView* get_route_view_by_route_id (PBD::ID& id) const;
218 void consider_auditioning (boost::shared_ptr<ARDOUR::Region>);
219 void hide_a_region (boost::shared_ptr<ARDOUR::Region>);
220 void show_a_region (boost::shared_ptr<ARDOUR::Region>);
222 #ifdef USE_RUBBERBAND
223 std::vector<std::string> rb_opt_strings;
227 /* things that need to be public to be used in the main menubar */
229 void new_region_from_selection ();
230 void separate_regions_between (const TimeSelection&);
231 void separate_region_from_selection ();
232 void separate_under_selected_regions ();
233 void separate_region_from_punch ();
234 void separate_region_from_loop ();
235 void separate_regions_using_location (ARDOUR::Location&);
236 void transition_to_rolling (bool forward);
240 framepos_t unit_to_frame (double unit) const {
241 return (framepos_t) rint (unit * frames_per_unit);
244 double frame_to_unit (framepos_t frame) const {
245 return rint ((double) frame / (double) frames_per_unit);
248 double frame_to_unit (double frame) const {
249 return rint (frame / frames_per_unit);
252 /* NOTE: these functions assume that the "pixel" coordinate is
253 the result of using the world->canvas affine transform on a
254 world coordinate. These coordinates already take into
255 account any scrolling carried out by adjusting the
259 framepos_t pixel_to_frame (double pixel) const {
261 /* pixel can be less than zero when motion events
262 are processed. since we've already run the world->canvas
263 affine, that means that the location *really* is "off
264 to the right" and thus really is "before the start".
268 return (framepos_t) rint (pixel * frames_per_unit * GNOME_CANVAS(track_canvas->gobj())->pixels_per_unit);
274 gulong frame_to_pixel (framepos_t frame) const {
275 return (gulong) rint ((frame / (frames_per_unit * GNOME_CANVAS(track_canvas->gobj())->pixels_per_unit)));
278 void flush_canvas ();
282 Selection& get_selection() const { return *selection; }
283 Selection& get_cut_buffer() const { return *cut_buffer; }
285 bool extend_selection_to_track (TimeAxisView&);
287 void play_selection ();
288 void select_all_in_track (Selection::Operation op);
289 void select_all (Selection::Operation op);
290 void invert_selection_in_track ();
291 void invert_selection ();
292 void deselect_all ();
294 void set_selected_regionview_from_region_list (boost::shared_ptr<ARDOUR::Region> region, Selection::Operation op = Selection::Set);
298 void set_show_measures (bool yn);
299 bool show_measures () const { return _show_measures; }
301 /* analysis window */
303 void analyze_region_selection();
304 void analyze_range_selection();
308 void export_audio ();
309 void export_selection ();
310 void export_range ();
311 void export_region ();
313 void add_toplevel_controls (Gtk::Container&);
314 Gtk::HBox& get_status_bar_packer() { return status_bar_hpacker; }
316 void set_zoom_focus (Editing::ZoomFocus);
317 Editing::ZoomFocus get_zoom_focus () const { return zoom_focus; }
318 double get_current_zoom () const { return frames_per_unit; }
320 void temporal_zoom_step (bool coarser);
321 void tav_zoom_step (bool coarser);
323 /* stuff that AudioTimeAxisView and related classes use */
325 PlaylistSelector& playlist_selector() const;
326 void clear_playlist (boost::shared_ptr<ARDOUR::Playlist>);
328 void new_playlists (TimeAxisView* v);
329 void copy_playlists (TimeAxisView* v);
330 void clear_playlists (TimeAxisView* v);
332 void get_onscreen_tracks (TrackViewList&);
334 Width editor_mixer_strip_width;
335 void maybe_add_mixer_strip_width (XMLNode&);
336 void show_editor_mixer (bool yn);
337 void create_editor_mixer ();
338 void show_editor_list (bool yn);
339 void set_selected_mixer_strip (TimeAxisView&);
340 void hide_track_in_display (TimeAxisView* tv, bool temporary = false);
342 /* nudge is initiated by transport controls owned by ARDOUR_UI */
344 framecnt_t get_nudge_distance (framepos_t pos, framecnt_t& next);
345 Evoral::MusicalTime get_grid_type_as_beats (bool& success, framepos_t position);
347 void nudge_forward (bool next, bool force_playhead);
348 void nudge_backward (bool next, bool force_playhead);
350 /* nudge initiated from context menu */
352 void nudge_forward_capture_offset ();
353 void nudge_backward_capture_offset ();
355 /* playhead/screen stuff */
357 void set_stationary_playhead (bool yn);
358 void toggle_stationary_playhead ();
359 bool stationary_playhead() const { return _stationary_playhead; }
361 void set_follow_playhead (bool yn);
362 void toggle_follow_playhead ();
363 bool follow_playhead() const { return _follow_playhead; }
364 bool dragging_playhead () const { return _dragging_playhead; }
366 void toggle_zero_line_visibility ();
368 void set_group_tabs ();
369 void toggle_measure_visibility ();
370 void toggle_logo_visibility ();
374 void toggle_selected_region_fades (int dir);
375 void update_region_fade_visibility ();
376 bool xfade_visibility() const { return _xfade_visibility; }
377 void update_xfade_visibility ();
379 /* redirect shared ops menu. caller must free returned menu */
381 Gtk::Menu* redirect_menu ();
383 /* floating windows/transient */
385 void ensure_float (Gtk::Window&);
389 void scroll_tracks_down_line ();
390 void scroll_tracks_up_line ();
392 void prepare_for_cleanup ();
393 void finish_cleanup ();
395 void maximise_editing_space();
396 void restore_editing_space();
398 void reset_x_origin (framepos_t);
399 void reset_x_origin_to_follow_playhead ();
400 void reset_y_origin (double);
401 void reset_zoom (double);
402 void reposition_and_zoom (framepos_t, double);
404 framepos_t get_preferred_edit_position (bool ignore_playhead = false);
406 bool update_mouse_speed ();
407 bool decelerate_mouse_speed ();
409 void toggle_meter_updating();
411 void show_rhythm_ferret();
413 void goto_visual_state (uint32_t);
414 void save_visual_state (uint32_t);
416 void queue_draw_resize_line (int at);
417 void start_resize_line_ops ();
418 void end_resize_line_ops ();
420 TrackViewList const & get_track_views () {
424 int get_regionview_count_from_region_list (boost::shared_ptr<ARDOUR::Region>);
426 void do_import (std::vector<std::string> paths, Editing::ImportDisposition, Editing::ImportMode mode, ARDOUR::SrcQuality, framepos_t&);
427 void do_embed (std::vector<std::string> paths, Editing::ImportDisposition, Editing::ImportMode mode, framepos_t&);
429 void get_regions_corresponding_to (boost::shared_ptr<ARDOUR::Region> region, std::vector<RegionView*>& regions);
431 void show_verbose_canvas_cursor_with (const std::string& txt);
432 void hide_verbose_canvas_cursor();
434 void center_screen (framepos_t);
436 TrackViewList axis_views_from_routes (boost::shared_ptr<ARDOUR::RouteList>) const;
437 Gtkmm2ext::TearOff* mouse_mode_tearoff () const { return _mouse_mode_tearoff; }
438 Gtkmm2ext::TearOff* tools_tearoff () const { return _tools_tearoff; }
440 void snap_to (framepos_t& first, int32_t direction = 0, bool for_mark = false);
441 void snap_to_with_modifier (framepos_t& first, GdkEvent const *, int32_t direction = 0, bool for_mark = false);
442 void snap_to (framepos_t& first, framepos_t& last, int32_t direction = 0, bool for_mark = false);
444 void begin_reversible_command (std::string cmd_name);
445 void commit_reversible_command ();
447 DragManager* drags () const {
451 void maybe_autoscroll (bool, bool);
453 /* handy cursors for everyone to use */
455 static Gdk::Cursor* cross_hair_cursor;
456 static Gdk::Cursor* trimmer_cursor;
457 static Gdk::Cursor* right_side_trim_cursor;
458 static Gdk::Cursor* left_side_trim_cursor;
459 static Gdk::Cursor* fade_in_cursor;
460 static Gdk::Cursor* fade_out_cursor;
461 static Gdk::Cursor* selector_cursor;
462 static Gdk::Cursor* grabber_cursor;
463 static Gdk::Cursor* grabber_note_cursor;
464 static Gdk::Cursor* grabber_edit_point_cursor;
465 static Gdk::Cursor* zoom_in_cursor;
466 static Gdk::Cursor* zoom_out_cursor;
467 static Gdk::Cursor* time_fx_cursor;
468 static Gdk::Cursor* fader_cursor;
469 static Gdk::Cursor* speaker_cursor;
470 static Gdk::Cursor* midi_pencil_cursor;
471 static Gdk::Cursor* midi_select_cursor;
472 static Gdk::Cursor* midi_resize_cursor;
473 static Gdk::Cursor* midi_erase_cursor;
474 static Gdk::Cursor* up_down_cursor;
475 static Gdk::Cursor* wait_cursor;
476 static Gdk::Cursor* timebar_cursor;
477 static Gdk::Cursor* transparent_cursor;
480 void map_transport_state ();
481 void map_position_change (framepos_t);
487 void color_handler ();
491 // to keep track of the playhead position for control_scroll
492 boost::optional<framepos_t> _control_scroll_target;
494 PlaylistSelector* _playlist_selector;
496 typedef std::pair<TimeAxisView*,XMLNode*> TAVState;
500 double frames_per_unit;
501 framepos_t leftmost_frame;
502 Editing::ZoomFocus zoom_focus;
503 std::list<TAVState> track_states;
506 std::list<VisualState*> undo_visual_stack;
507 std::list<VisualState*> redo_visual_stack;
508 VisualState* current_visual_state (bool with_tracks = true);
509 void undo_visual_state ();
510 void redo_visual_state ();
511 void use_visual_state (VisualState&);
513 void swap_visual_state ();
515 std::vector<VisualState*> visual_states;
516 sigc::connection visual_state_op_connection;
517 void start_visual_state_op (uint32_t n);
518 void cancel_visual_state_op (uint32_t n);
519 bool end_visual_state_op (uint32_t n);
521 framepos_t leftmost_frame;
522 double frames_per_unit;
523 Editing::ZoomFocus zoom_focus;
525 void set_frames_per_unit (double);
528 Editing::MouseMode mouse_mode;
529 bool _internal_editing;
530 Editing::MouseMode effective_mouse_mode () const;
532 enum JoinObjectRangeState {
533 JOIN_OBJECT_RANGE_NONE,
534 /** `join object/range' mode is active and the mouse is over a place where object mode should happen */
535 JOIN_OBJECT_RANGE_OBJECT,
536 /** `join object/range' mode is active and the mouse is over a place where range mode should happen */
537 JOIN_OBJECT_RANGE_RANGE
540 JoinObjectRangeState _join_object_range_state;
542 void update_join_object_range_location (double, double);
544 int post_maximal_editor_width;
545 int post_maximal_editor_height;
546 int post_maximal_horizontal_pane_position;
547 int post_maximal_vertical_pane_position;
548 int pre_maximal_horizontal_pane_position;
549 int pre_maximal_vertical_pane_position;
550 int pre_maximal_editor_width;
551 int pre_maximal_editor_height;
552 void pane_allocation_handler (Gtk::Allocation&, Gtk::Paned*);
554 Gtk::Notebook the_notebook;
555 Gtk::HPaned edit_pane;
556 Gtk::VPaned editor_summary_pane;
558 Gtk::EventBox meter_base;
560 Gtk::EventBox marker_base;
561 Gtk::HBox marker_box;
562 Gtk::VBox scrollers_rulers_markers_box;
564 void location_changed (ARDOUR::Location *);
565 void location_flags_changed (ARDOUR::Location *, void *);
566 void refresh_location_display ();
567 void refresh_location_display_s (const PBD::PropertyChange&);
568 void refresh_location_display_internal (ARDOUR::Locations::LocationList&);
569 void add_new_location (ARDOUR::Location *);
570 void location_gone (ARDOUR::Location *);
571 void remove_marker (ArdourCanvas::Item&, GdkEvent*);
572 gint really_remove_marker (ARDOUR::Location* loc);
573 void goto_nth_marker (int nth);
575 uint32_t location_marker_color;
576 uint32_t location_range_color;
577 uint32_t location_loop_color;
578 uint32_t location_punch_color;
579 uint32_t location_cd_marker_color;
581 struct LocationMarkers {
586 LocationMarkers () : start(0), end(0), valid (true) {}
592 void set_name (const std::string&);
593 void set_position (framepos_t start, framepos_t end = 0);
594 void set_color_rgba (uint32_t);
597 LocationMarkers *find_location_markers (ARDOUR::Location *) const;
598 ARDOUR::Location* find_location_from_marker (Marker *, bool& is_start) const;
599 Marker* entered_marker;
601 typedef std::map<ARDOUR::Location*,LocationMarkers *> LocationMarkerMap;
602 LocationMarkerMap location_markers;
604 void hide_marker (ArdourCanvas::Item*, GdkEvent*);
605 void clear_marker_display ();
606 void mouse_add_new_marker (framepos_t where, bool is_cd=false, bool is_xrun=false);
607 bool choose_new_marker_name(std::string &name);
608 void update_cd_marker_display ();
609 void ensure_cd_marker_updated (LocationMarkers * lam, ARDOUR::Location * location);
611 TimeAxisView* clicked_axisview;
612 RouteTimeAxisView* clicked_routeview;
613 /** The last RegionView that was clicked on, or 0 if the last click was not
614 * on a RegionView. This is set up by the canvas event handlers in
615 * editor_canvas_events.cc
617 RegionView* clicked_regionview;
618 RegionSelection latest_regionviews;
619 uint32_t clicked_selection;
620 CrossfadeView* clicked_crossfadeview;
621 ControlPoint* clicked_control_point;
623 void sort_track_selection (TrackViewList* sel = 0);
625 void get_equivalent_regions (RegionView* rv, std::vector<RegionView*> &, PBD::PropertyID) const;
626 RegionSelection get_equivalent_regions (RegionSelection &, PBD::PropertyID) const;
627 void mapover_tracks (sigc::slot<void,RouteTimeAxisView&,uint32_t> sl, TimeAxisView*, PBD::PropertyID) const;
629 /* functions to be passed to mapover_tracks(), possibly with sigc::bind()-supplied arguments */
631 void mapped_get_equivalent_regions (RouteTimeAxisView&, uint32_t, RegionView *, std::vector<RegionView*>*) const;
632 void mapped_use_new_playlist (RouteTimeAxisView&, uint32_t, std::vector<boost::shared_ptr<ARDOUR::Playlist> > const &);
633 void mapped_use_copy_playlist (RouteTimeAxisView&, uint32_t, std::vector<boost::shared_ptr<ARDOUR::Playlist> > const &);
634 void mapped_clear_playlist (RouteTimeAxisView&, uint32_t);
638 void button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type);
639 bool button_release_can_deselect;
641 void catch_vanishing_regionview (RegionView *);
643 void set_selected_track (TimeAxisView&, Selection::Operation op = Selection::Set, bool no_remove=false);
644 void select_all_tracks ();
646 bool set_selected_control_point_from_click (Selection::Operation op = Selection::Set, bool no_remove=false);
647 void set_selected_track_from_click (bool press, Selection::Operation op = Selection::Set, bool no_remove=false);
648 void set_selected_track_as_side_effect (Selection::Operation op, bool force = false);
649 bool set_selected_regionview_from_click (bool press, Selection::Operation op = Selection::Set, bool no_track_remove=false);
651 bool set_selected_regionview_from_map_event (GdkEventAny*, StreamView*, boost::weak_ptr<ARDOUR::Region>);
652 void collect_new_region_view (RegionView *);
653 void collect_and_select_new_region_view (RegionView *);
655 long select_range_around_region (RegionView *);
657 Gtk::Menu track_context_menu;
658 Gtk::Menu track_region_context_menu;
659 Gtk::Menu track_selection_context_menu;
660 Gtk::Menu track_crossfade_context_menu;
662 Gtk::MenuItem* region_edit_menu_split_item;
663 Gtk::MenuItem* region_edit_menu_split_multichannel_item;
664 Gtk::Menu * track_region_edit_playlist_menu;
665 Gtk::Menu * track_edit_playlist_submenu;
666 Gtk::Menu * track_selection_edit_playlist_submenu;
668 void popup_track_context_menu (int, int, ItemType, bool, framepos_t);
669 Gtk::Menu* build_track_context_menu (framepos_t);
670 Gtk::Menu* build_track_bus_context_menu (framepos_t);
671 Gtk::Menu* build_track_region_context_menu (framepos_t frame);
672 Gtk::Menu* build_track_crossfade_context_menu (framepos_t);
673 Gtk::Menu* build_track_selection_context_menu (framepos_t);
674 void add_dstream_context_items (Gtk::Menu_Helpers::MenuList&);
675 void add_bus_context_items (Gtk::Menu_Helpers::MenuList&);
676 void add_region_context_items (StreamView*, std::list<boost::shared_ptr<ARDOUR::Region> >, Gtk::Menu_Helpers::MenuList&,
677 ARDOUR::framepos_t, bool);
678 void add_crossfade_context_items (AudioStreamView*, boost::shared_ptr<ARDOUR::Crossfade>, Gtk::Menu_Helpers::MenuList&, bool many);
679 void add_selection_context_items (Gtk::Menu_Helpers::MenuList&);
681 void handle_new_route (ARDOUR::RouteList&);
682 void timeaxisview_deleted (TimeAxisView *);
684 Gtk::HBox global_hpacker;
685 Gtk::VBox global_vpacker;
688 Gdk::Cursor* current_canvas_cursor;
689 void set_canvas_cursor ();
690 Gdk::Cursor* which_grabber_cursor ();
692 ArdourCanvas::Canvas* track_canvas;
694 ArdourCanvas::NoEventText* verbose_canvas_cursor;
695 bool verbose_cursor_visible;
697 void parameter_changed (std::string);
699 bool track_canvas_motion (GdkEvent*);
701 void set_verbose_canvas_cursor (const std::string &, double x, double y);
702 void set_verbose_canvas_cursor_text (const std::string &);
703 void show_verbose_canvas_cursor();
705 bool verbose_cursor_on; // so far unused
707 Gtk::EventBox time_canvas_event_box;
708 Gtk::EventBox track_canvas_event_box;
709 Gtk::EventBox time_button_event_box;
710 Gtk::EventBox ruler_label_event_box;
712 ArdourCanvas::Group *minsec_group;
713 ArdourCanvas::Pixbuf *logo_item;
714 ArdourCanvas::Group *bbt_group;
715 ArdourCanvas::Group *timecode_group;
716 ArdourCanvas::Group *frame_group;
717 ArdourCanvas::Group *tempo_group;
718 ArdourCanvas::Group *meter_group;
719 ArdourCanvas::Group *marker_group;
720 ArdourCanvas::Group *range_marker_group;
721 ArdourCanvas::Group *transport_marker_group;
722 ArdourCanvas::Group* cd_marker_group;
724 ArdourCanvas::Group* timebar_group;
726 /* These bars never need to be scrolled */
727 ArdourCanvas::Group* meter_bar_group;
728 ArdourCanvas::Group* tempo_bar_group;
729 ArdourCanvas::Group* marker_bar_group;
730 ArdourCanvas::Group* range_marker_bar_group;
731 ArdourCanvas::Group* transport_marker_bar_group;
732 ArdourCanvas::Group* cd_marker_bar_group;
734 /** The group containing all items that require horizontal scrolling. */
735 ArdourCanvas::Group* _background_group;
737 The _master_group is the group containing all items
738 that require horizontal scrolling..
739 It is primarily used to separate canvas items
740 that require horizontal scrolling from those that do not.
742 ArdourCanvas::Group* _master_group;
744 /* The group containing all trackviews. Only scrolled vertically. */
745 ArdourCanvas::Group* _trackview_group;
747 /* The group used for region motion. Sits on top of _trackview_group */
748 ArdourCanvas::Group* _region_motion_group;
751 ruler_metric_timecode = 0,
752 ruler_metric_bbt = 1,
753 ruler_metric_frames = 2,
754 ruler_metric_minsec = 3,
756 ruler_time_tempo = 4,
757 ruler_time_meter = 5,
758 ruler_time_marker = 6,
759 ruler_time_range_marker = 7,
760 ruler_time_transport_marker = 8,
761 ruler_time_cd_marker = 9,
764 static GtkCustomMetric ruler_metrics[4];
765 Glib::RefPtr<Gtk::ToggleAction> ruler_timecode_action;
766 Glib::RefPtr<Gtk::ToggleAction> ruler_bbt_action;
767 Glib::RefPtr<Gtk::ToggleAction> ruler_samples_action;
768 Glib::RefPtr<Gtk::ToggleAction> ruler_minsec_action;
769 Glib::RefPtr<Gtk::ToggleAction> ruler_tempo_action;
770 Glib::RefPtr<Gtk::ToggleAction> ruler_meter_action;
771 Glib::RefPtr<Gtk::ToggleAction> ruler_marker_action;
772 Glib::RefPtr<Gtk::ToggleAction> ruler_range_action;
773 Glib::RefPtr<Gtk::ToggleAction> ruler_loop_punch_action;
774 Glib::RefPtr<Gtk::ToggleAction> ruler_cd_marker_action;
775 bool no_ruler_shown_update;
777 gint ruler_button_press (GdkEventButton*);
778 gint ruler_button_release (GdkEventButton*);
779 gint ruler_mouse_motion (GdkEventMotion*);
780 bool ruler_scroll (GdkEventScroll* event);
782 Gtk::Widget * ruler_grabbed_widget;
784 void initialize_rulers ();
785 void update_just_timecode ();
786 void compute_fixed_ruler_scale (); //calculates the RulerScale of the fixed rulers
787 void update_fixed_rulers ();
788 void update_tempo_based_rulers ();
789 void popup_ruler_menu (framepos_t where = 0, ItemType type = RegionItem);
790 void update_ruler_visibility ();
791 void set_ruler_visible (RulerType, bool);
792 void toggle_ruler_visibility (RulerType rt);
793 void ruler_toggled (int);
794 gint ruler_label_button_release (GdkEventButton*);
795 void store_ruler_visibility ();
796 void restore_ruler_visibility ();
798 static gint _metric_get_timecode (GtkCustomRulerMark **, gdouble, gdouble, gint);
799 static gint _metric_get_bbt (GtkCustomRulerMark **, gdouble, gdouble, gint);
800 static gint _metric_get_frames (GtkCustomRulerMark **, gdouble, gdouble, gint);
801 static gint _metric_get_minsec (GtkCustomRulerMark **, gdouble, gdouble, gint);
803 enum MinsecRulerScale {
810 MinsecRulerScale minsec_ruler_scale;
812 nframes_t minsec_mark_interval;
813 gint minsec_mark_modulo;
815 void set_minsec_ruler_scale (gdouble lower, gdouble upper);
817 enum TimecodeRulerScale {
819 timecode_show_frames,
820 timecode_show_seconds,
821 timecode_show_minutes,
825 TimecodeRulerScale timecode_ruler_scale;
827 nframes_t timecode_mark_interval;
828 gint timecode_mark_modulo;
829 gint timecode_nmarks;
830 void set_timecode_ruler_scale (gdouble lower, gdouble upper);
840 bbt_show_ticks_detail,
841 bbt_show_ticks_super_detail
844 BBTRulerScale bbt_ruler_scale;
848 uint32_t bbt_bar_helper_on;
849 uint32_t bbt_accent_modulo;
850 void compute_bbt_ruler_scale (framepos_t lower, framepos_t upper);
852 gint metric_get_timecode (GtkCustomRulerMark **, gdouble, gdouble, gint);
853 gint metric_get_bbt (GtkCustomRulerMark **, gdouble, gdouble, gint);
854 gint metric_get_frames (GtkCustomRulerMark **, gdouble, gdouble, gint);
855 gint metric_get_minsec (GtkCustomRulerMark **, gdouble, gdouble, gint);
857 Gtk::Widget *_ruler_separator;
858 GtkWidget *_timecode_ruler;
859 GtkWidget *_bbt_ruler;
860 GtkWidget *_frames_ruler;
861 GtkWidget *_minsec_ruler;
862 Gtk::Widget *timecode_ruler;
863 Gtk::Widget *bbt_ruler;
864 Gtk::Widget *frames_ruler;
865 Gtk::Widget *minsec_ruler;
866 static Editor *ruler_editor;
868 static const double timebar_height;
869 guint32 visible_timebars;
870 gdouble canvas_timebars_vsize;
871 gdouble get_canvas_timebars_vsize () const { return canvas_timebars_vsize; }
872 Gtk::Menu *editor_ruler_menu;
874 ArdourCanvas::SimpleRect* tempo_bar;
875 ArdourCanvas::SimpleRect* meter_bar;
876 ArdourCanvas::SimpleRect* marker_bar;
877 ArdourCanvas::SimpleRect* range_marker_bar;
878 ArdourCanvas::SimpleRect* transport_marker_bar;
879 ArdourCanvas::SimpleRect* cd_marker_bar;
881 Gtk::Label minsec_label;
882 Gtk::Label bbt_label;
883 Gtk::Label timecode_label;
884 Gtk::Label frame_label;
885 Gtk::Label tempo_label;
886 Gtk::Label meter_label;
887 Gtk::Label mark_label;
888 Gtk::Label range_mark_label;
889 Gtk::Label transport_mark_label;
890 Gtk::Label cd_mark_label;
892 Gtk::VBox time_button_vbox;
893 Gtk::HBox time_button_hbox;
895 friend class EditorCursor;
897 EditorCursor* playhead_cursor;
898 ArdourCanvas::Group* cursor_group;
900 framepos_t get_region_boundary (framepos_t pos, int32_t dir, bool with_selection, bool only_onscreen);
902 void cursor_to_region_boundary (bool with_selection, int32_t dir);
903 void cursor_to_next_region_boundary (bool with_selection);
904 void cursor_to_previous_region_boundary (bool with_selection);
905 void cursor_to_next_region_point (EditorCursor*, ARDOUR::RegionPoint);
906 void cursor_to_previous_region_point (EditorCursor*, ARDOUR::RegionPoint);
907 void cursor_to_region_point (EditorCursor*, ARDOUR::RegionPoint, int32_t dir);
908 void cursor_to_selection_start (EditorCursor *);
909 void cursor_to_selection_end (EditorCursor *);
911 void selected_marker_to_region_boundary (bool with_selection, int32_t dir);
912 void selected_marker_to_next_region_boundary (bool with_selection);
913 void selected_marker_to_previous_region_boundary (bool with_selection);
914 void selected_marker_to_next_region_point (ARDOUR::RegionPoint);
915 void selected_marker_to_previous_region_point (ARDOUR::RegionPoint);
916 void selected_marker_to_region_point (ARDOUR::RegionPoint, int32_t dir);
917 void selected_marker_to_selection_start ();
918 void selected_marker_to_selection_end ();
920 void select_all_selectables_using_cursor (EditorCursor *, bool);
921 void select_all_selectables_using_edit (bool);
922 void select_all_selectables_between (bool within);
923 void select_range_between ();
925 boost::shared_ptr<ARDOUR::Region> find_next_region (ARDOUR::framepos_t, ARDOUR::RegionPoint, int32_t dir, TrackViewList&, TimeAxisView ** = 0);
926 ARDOUR::framepos_t find_next_region_boundary (ARDOUR::framepos_t, int32_t dir, const TrackViewList&);
928 std::vector<ARDOUR::framepos_t> region_boundary_cache;
929 void build_region_boundary_cache ();
932 Gtk::HBox bottom_hbox;
934 Gtk::Table edit_packer;
936 Gtk::Adjustment vertical_adjustment;
938 Gtk::Layout controls_layout;
939 bool control_layout_scroll (GdkEventScroll* ev);
940 void controls_layout_size_request (Gtk::Requisition*);
941 sigc::connection controls_layout_size_request_connection;
943 bool horizontal_scroll_left_press ();
944 void horizontal_scroll_left_release ();
945 bool horizontal_scroll_right_press ();
946 void horizontal_scroll_right_release ();
947 sigc::connection _scroll_connection;
948 int _scroll_callbacks;
950 double _canvas_width;
951 double _canvas_height; ///< height of the visible area of the track canvas
952 double full_canvas_height; ///< full height of the canvas
954 bool track_canvas_map_handler (GdkEventAny*);
956 gint edit_controls_button_release (GdkEventButton*);
957 Gtk::Menu *edit_controls_left_menu;
958 Gtk::Menu *edit_controls_right_menu;
960 Gtk::VBox ruler_label_vbox;
961 Gtk::VBox track_canvas_vbox;
962 Gtk::VBox time_canvas_vbox;
963 Gtk::VBox edit_controls_vbox;
964 Gtk::HBox edit_controls_hbox;
966 void control_scroll (float);
967 void access_action (std::string,std::string);
968 bool deferred_control_scroll (framepos_t);
969 sigc::connection control_scroll_connection;
971 gdouble get_trackview_group_vertical_offset () const { return vertical_adjustment.get_value () - canvas_timebars_vsize;}
973 ArdourCanvas::Group* get_background_group () const { return _background_group; }
974 ArdourCanvas::Group* get_trackview_group () const { return _trackview_group; }
975 double last_trackview_group_vertical_offset;
976 void tie_vertical_scrolling ();
977 void set_horizontal_position (double);
978 double horizontal_position () const;
979 void scroll_canvas_vertically ();
981 struct VisualChange {
989 framepos_t time_origin;
990 double frames_per_unit;
995 VisualChange() : pending ((VisualChange::Type) 0), time_origin (0), frames_per_unit (0), idle_handler_id (-1) {}
997 pending = Type (pending | t);
1002 VisualChange pending_visual_change;
1004 static int _idle_visual_changer (void *arg);
1005 int idle_visual_changer ();
1007 void queue_visual_change (framepos_t);
1008 void queue_visual_change (double);
1009 void queue_visual_change_y (double);
1010 void ensure_visual_change_idle_handler ();
1013 TrackViewList track_views;
1014 std::pair<TimeAxisView*, ARDOUR::layer_t> trackview_by_y_position (double);
1015 TimeAxisView* axis_view_from_route (boost::shared_ptr<ARDOUR::Route>) const;
1017 TrackViewList get_tracks_for_range_action () const;
1019 static void build_cursors ();
1021 sigc::connection super_rapid_screen_update_connection;
1022 framepos_t last_update_frame;
1023 void center_screen_internal (framepos_t, float);
1025 void super_rapid_screen_update ();
1027 void session_going_away ();
1029 framepos_t cut_buffer_start;
1030 framecnt_t cut_buffer_length;
1032 bool typed_event (ArdourCanvas::Item*, GdkEvent*, ItemType);
1033 bool button_press_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
1034 bool button_press_handler_1 (ArdourCanvas::Item *, GdkEvent *, ItemType);
1035 bool button_press_handler_2 (ArdourCanvas::Item *, GdkEvent *, ItemType);
1036 bool button_release_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
1037 bool motion_handler (ArdourCanvas::Item*, GdkEvent*, bool from_autoscroll = false);
1038 bool enter_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
1039 bool leave_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
1041 /* KEYMAP HANDLING */
1043 void register_actions ();
1045 int ensure_cursor (framepos_t* pos);
1047 void cut_copy (Editing::CutCopyOp);
1048 bool can_cut_copy () const;
1049 void cut_copy_points (Editing::CutCopyOp);
1050 void cut_copy_regions (Editing::CutCopyOp, RegionSelection&);
1051 void cut_copy_ranges (Editing::CutCopyOp);
1052 void cut_copy_midi (Editing::CutCopyOp);
1054 void mouse_paste ();
1055 void paste_internal (framepos_t position, float times);
1057 /* EDITING OPERATIONS */
1059 void reset_point_selection ();
1060 void toggle_region_mute ();
1061 void toggle_region_lock ();
1062 void toggle_region_opaque ();
1063 void toggle_record_enable ();
1064 void toggle_region_lock_style ();
1065 void raise_region ();
1066 void raise_region_to_top ();
1067 void change_region_layering_order (ARDOUR::framepos_t);
1068 void lower_region ();
1069 void lower_region_to_bottom ();
1070 void split_regions_at (framepos_t, RegionSelection&);
1071 void split_region_at_transients ();
1072 void split_region_at_points (boost::shared_ptr<ARDOUR::Region>, ARDOUR::AnalysisFeatureList&, bool can_ferret);
1073 void crop_region_to_selection ();
1074 void crop_region_to (framepos_t start, framepos_t end);
1075 void set_sync_point (framepos_t, const RegionSelection&);
1076 void set_region_sync_from_edit_point ();
1077 void remove_region_sync();
1078 void align_selection (ARDOUR::RegionPoint, framepos_t position, const RegionSelection&);
1079 void align_selection_relative (ARDOUR::RegionPoint point, framepos_t position, const RegionSelection&);
1080 void align_region (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, framepos_t position);
1081 void align_region_internal (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, framepos_t position);
1082 void remove_selected_regions ();
1083 void remove_clicked_region ();
1084 void edit_region ();
1085 void show_midi_list_editor ();
1086 void rename_region ();
1087 void duplicate_some_regions (RegionSelection&, float times);
1088 void duplicate_selection (float times);
1089 void region_fill_selection ();
1091 void region_fill_track ();
1092 void audition_playlist_region_standalone (boost::shared_ptr<ARDOUR::Region>);
1093 void audition_playlist_region_via_route (boost::shared_ptr<ARDOUR::Region>, ARDOUR::Route&);
1094 void split_multichannel_region();
1095 void reverse_region ();
1096 void strip_region_silence ();
1097 void normalize_region ();
1098 double _last_normalization_value;
1099 void reset_region_scale_amplitude ();
1100 void adjust_region_scale_amplitude (bool up);
1101 void quantize_region ();
1102 void fork_region ();
1104 void do_insert_time ();
1105 void insert_time (framepos_t, framecnt_t, Editing::InsertTimeOption, bool, bool, bool, bool, bool);
1107 void tab_to_transient (bool forward);
1109 void use_region_as_bar ();
1110 void use_range_as_bar ();
1112 void define_one_bar (framepos_t start, framepos_t end);
1114 void audition_region_from_region_list ();
1115 void hide_region_from_region_list ();
1116 void show_region_in_region_list ();
1118 void align (ARDOUR::RegionPoint);
1119 void align_relative (ARDOUR::RegionPoint);
1122 void reset_focus ();
1128 void paste (float times);
1130 void place_transient ();
1131 void remove_transient (ArdourCanvas::Item* item);
1132 void snap_regions_to_grid ();
1133 void close_region_gaps ();
1135 int get_prefix (float&, bool&);
1137 void keyboard_paste ();
1138 void keyboard_insert_region_list_selection ();
1140 void region_from_selection ();
1141 void create_region_from_selection (std::vector<boost::shared_ptr<ARDOUR::Region> >&);
1143 void play_from_start ();
1144 void play_from_edit_point ();
1145 void play_from_edit_point_and_return ();
1146 void play_selected_region ();
1147 void play_edit_range ();
1148 void loop_selected_region ();
1149 void play_location (ARDOUR::Location&);
1150 void loop_location (ARDOUR::Location&);
1152 void temporal_zoom_selection ();
1153 void temporal_zoom_region (bool both_axes);
1154 void zoom_to_region (bool both_axes);
1155 void temporal_zoom_session ();
1156 void temporal_zoom (gdouble scale);
1157 void temporal_zoom_by_frame (framepos_t start, framepos_t end, const std::string & op);
1158 void temporal_zoom_to_frame (bool coarser, framepos_t frame);
1160 void amplitude_zoom (gdouble scale);
1161 void amplitude_zoom_step (bool in);
1163 void insert_region_list_drag (boost::shared_ptr<ARDOUR::Region>, int x, int y);
1164 void insert_region_list_selection (float times);
1166 void insert_route_list_drag (boost::shared_ptr<ARDOUR::Route>, int x, int y);
1168 /* import & embed */
1170 void add_external_audio_action (Editing::ImportMode);
1171 void external_audio_dialog ();
1172 void session_import_dialog ();
1174 int check_whether_and_how_to_import(std::string, bool all_or_nothing = true);
1175 bool check_multichannel_status (const std::vector<std::string>& paths);
1177 SoundFileOmega* sfbrowser;
1179 void bring_in_external_audio (Editing::ImportMode mode, framepos_t& pos);
1181 bool idle_drop_paths (std::vector<std::string> paths, framepos_t frame, double ypos);
1182 void drop_paths_part_two (const std::vector<std::string>& paths, framepos_t frame, double ypos);
1184 int import_sndfiles (std::vector<std::string> paths, Editing::ImportMode mode, ARDOUR::SrcQuality, framepos_t& pos,
1185 int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>&, bool);
1186 int embed_sndfiles (std::vector<std::string> paths, bool multiple_files, bool& check_sample_rate, Editing::ImportMode mode,
1187 framepos_t& pos, int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>&);
1189 int add_sources (std::vector<std::string> paths, ARDOUR::SourceList& sources, framepos_t& pos, Editing::ImportMode,
1190 int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>&, bool add_channel_suffix);
1191 int finish_bringing_in_material (boost::shared_ptr<ARDOUR::Region> region, uint32_t, uint32_t, framepos_t& pos, Editing::ImportMode mode,
1192 boost::shared_ptr<ARDOUR::Track>& existing_track);
1194 boost::shared_ptr<ARDOUR::AudioTrack> get_nth_selected_audio_track (int nth) const;
1195 boost::shared_ptr<ARDOUR::MidiTrack> get_nth_selected_midi_track (int nth) const;
1197 ARDOUR::InterThreadInfo* current_interthread_info;
1199 AnalysisWindow* analysis_window;
1201 /* import specific info */
1203 struct EditorImportStatus : public ARDOUR::ImportStatus {
1204 Editing::ImportMode mode;
1208 boost::shared_ptr<ARDOUR::Track> track;
1212 EditorImportStatus import_status;
1213 static void *_import_thread (void *);
1214 void* import_thread ();
1215 void finish_import ();
1217 /* to support this ... */
1219 void import_audio (bool as_tracks);
1220 void do_import (std::vector<std::string> paths, bool split, bool as_tracks);
1222 void move_to_start ();
1223 void move_to_end ();
1225 void center_playhead ();
1226 void center_edit_point ();
1227 void edit_cursor_backward ();
1228 void edit_cursor_forward ();
1229 void playhead_forward_to_grid ();
1230 void playhead_backward_to_grid ();
1231 void playhead_backward ();
1232 void playhead_forward ();
1233 void scroll_playhead (bool forward);
1234 void scroll_backward (float pages=0.8f);
1235 void scroll_forward (float pages=0.8f);
1236 void scroll_tracks_down ();
1237 void scroll_tracks_up ();
1238 void delete_sample_forward ();
1239 void delete_sample_backward ();
1240 void delete_screen ();
1241 void search_backwards ();
1242 void search_forwards ();
1244 void clear_markers ();
1245 void clear_ranges ();
1246 void clear_locations ();
1247 void unhide_markers ();
1248 void unhide_ranges ();
1249 void jump_forward_to_mark ();
1250 void jump_backward_to_mark ();
1251 void cursor_align (bool playhead_to_edit);
1253 void remove_last_capture ();
1254 void select_all_selectables_using_time_selection ();
1255 void select_all_selectables_using_loop();
1256 void select_all_selectables_using_punch();
1257 void set_selection_from_range (ARDOUR::Location&);
1258 void set_selection_from_punch ();
1259 void set_selection_from_loop ();
1260 void set_selection_from_region ();
1262 void add_location_mark (framepos_t where);
1263 void add_location_from_audio_region ();
1264 void add_locations_from_audio_region ();
1265 void add_location_from_selection ();
1266 void set_loop_from_selection (bool play);
1267 void set_punch_from_selection ();
1268 void set_punch_from_region ();
1270 void set_loop_from_edit_range (bool play);
1271 void set_loop_from_region (bool play);
1272 void set_punch_from_edit_range ();
1274 void set_loop_range (framepos_t start, framepos_t end, std::string cmd);
1275 void set_punch_range (framepos_t start, framepos_t end, std::string cmd);
1277 void add_location_from_playhead_cursor ();
1278 bool select_new_marker;
1280 void reverse_selection ();
1281 void edit_envelope ();
1283 double last_scrub_x;
1284 int scrubbing_direction;
1285 int scrub_reversals;
1286 int scrub_reverse_distance;
1287 void scrub (framepos_t, double);
1289 void keyboard_selection_begin ();
1290 void keyboard_selection_finish (bool add);
1291 bool have_pending_keyboard_selection;
1292 framepos_t pending_keyboard_selection_start;
1294 boost::shared_ptr<ARDOUR::Region> select_region_for_operation (int dir, TimeAxisView **tv);
1295 void extend_selection_to_end_of_region (bool next);
1296 void extend_selection_to_start_of_region (bool previous);
1298 Editing::SnapType _snap_type;
1299 Editing::SnapMode _snap_mode;
1301 /// Snap threshold in pixels
1302 double snap_threshold;
1304 bool ignore_gui_changes;
1306 DragManager* _drags;
1310 Gtk::Menu fade_context_menu;
1311 void popup_fade_context_menu (int, int, ArdourCanvas::Item*, ItemType);
1313 void set_fade_in_shape (ARDOUR::FadeShape);
1314 void set_fade_out_shape (ARDOUR::FadeShape);
1316 void set_fade_length (bool in);
1317 void toggle_fade_active (bool in);
1318 void set_fade_in_active (bool);
1319 void set_fade_out_active (bool);
1321 std::set<boost::shared_ptr<ARDOUR::Playlist> > motion_frozen_playlists;
1323 bool _dragging_playhead;
1324 bool _dragging_edit_point;
1326 void marker_drag_motion_callback (GdkEvent*);
1327 void marker_drag_finished_callback (GdkEvent*);
1329 gint mouse_rename_region (ArdourCanvas::Item*, GdkEvent*);
1331 void add_region_drag (ArdourCanvas::Item*, GdkEvent*, RegionView*);
1332 void start_create_region_grab (ArdourCanvas::Item*, GdkEvent*);
1333 void add_region_copy_drag (ArdourCanvas::Item*, GdkEvent*, RegionView*);
1334 void add_region_brush_drag (ArdourCanvas::Item*, GdkEvent*, RegionView*);
1335 void start_selection_grab (ArdourCanvas::Item*, GdkEvent*);
1337 void region_view_item_click (AudioRegionView&, GdkEventButton*);
1339 void remove_gain_control_point (ArdourCanvas::Item*, GdkEvent*);
1340 void remove_control_point (ArdourCanvas::Item*, GdkEvent*);
1342 void mouse_brush_insert_region (RegionView*, framepos_t pos);
1343 void brush (framepos_t);
1345 void show_verbose_time_cursor (framepos_t frame, double offset = 0, double xpos=-1, double ypos=-1);
1346 void show_verbose_duration_cursor (framepos_t start, framepos_t end, double offset = 0, double xpos=-1, double ypos=-1);
1347 double clamp_verbose_cursor_x (double);
1348 double clamp_verbose_cursor_y (double);
1350 /* Canvas event handlers */
1352 bool canvas_control_point_event (GdkEvent* event,ArdourCanvas::Item*, ControlPoint*);
1353 bool canvas_line_event (GdkEvent* event,ArdourCanvas::Item*, AutomationLine*);
1354 bool canvas_selection_rect_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1355 bool canvas_selection_start_trim_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1356 bool canvas_selection_end_trim_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1357 bool canvas_crossfade_view_event (GdkEvent* event,ArdourCanvas::Item*, CrossfadeView*);
1358 bool canvas_fade_in_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1359 bool canvas_fade_in_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1360 bool canvas_fade_out_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1361 bool canvas_fade_out_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1362 bool canvas_region_view_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1363 bool canvas_frame_handle_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1364 bool canvas_region_view_name_highlight_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1365 bool canvas_region_view_name_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1366 bool canvas_feature_line_event (GdkEvent* event, ArdourCanvas::Item*, RegionView*);
1367 bool canvas_stream_view_event (GdkEvent* event,ArdourCanvas::Item*, RouteTimeAxisView*);
1368 bool canvas_marker_event (GdkEvent* event,ArdourCanvas::Item*, Marker*);
1369 bool canvas_zoom_rect_event (GdkEvent* event,ArdourCanvas::Item*);
1370 bool canvas_tempo_marker_event (GdkEvent* event,ArdourCanvas::Item*, TempoMarker*);
1371 bool canvas_meter_marker_event (GdkEvent* event,ArdourCanvas::Item*, MeterMarker*);
1372 bool canvas_automation_track_event(GdkEvent* event, ArdourCanvas::Item*, AutomationTimeAxisView*) ;
1373 bool canvas_note_event (GdkEvent* event, ArdourCanvas::Item*);
1375 bool canvas_tempo_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1376 bool canvas_meter_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1377 bool canvas_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1378 bool canvas_range_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1379 bool canvas_transport_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1380 bool canvas_cd_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1382 bool canvas_imageframe_item_view_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1383 bool canvas_imageframe_view_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameTimeAxis*);
1384 bool canvas_imageframe_start_handle_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1385 bool canvas_imageframe_end_handle_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1386 bool canvas_marker_time_axis_view_event(GdkEvent* event, ArdourCanvas::Item*,MarkerTimeAxis*);
1387 bool canvas_markerview_item_view_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1388 bool canvas_markerview_start_handle_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1389 bool canvas_markerview_end_handle_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1392 friend class DragManager;
1393 friend class EditorRouteGroups;
1394 friend class EditorRegions;
1396 ArdourCanvas::Item *last_item_entered;
1398 /* non-public event handlers */
1400 bool canvas_playhead_cursor_event (GdkEvent* event, ArdourCanvas::Item*);
1401 bool track_canvas_scroll (GdkEventScroll* event);
1403 bool track_canvas_scroll_event (GdkEventScroll* event);
1404 bool track_canvas_button_press_event (GdkEventButton* event);
1405 bool track_canvas_button_release_event (GdkEventButton* event);
1406 bool track_canvas_motion_notify_event (GdkEventMotion* event);
1408 Gtk::Allocation canvas_allocation;
1409 void track_canvas_allocate (Gtk::Allocation alloc);
1410 bool track_canvas_size_allocated ();
1411 bool track_canvas_drag_motion (Glib::RefPtr<Gdk::DragContext> const &, int, int, guint);
1412 bool track_canvas_key_press (GdkEventKey *);
1413 bool track_canvas_key_release (GdkEventKey *);
1415 void set_playhead_cursor ();
1417 void kbd_driver (sigc::slot<void,GdkEvent*>, bool use_track_canvas = true, bool use_time_canvas = true, bool can_select = true);
1418 void kbd_mute_unmute_region ();
1421 void kbd_do_brush (GdkEvent*);
1422 void kbd_do_audition (GdkEvent*);
1424 void initialize_canvas ();
1426 /* display control */
1428 bool _show_measures;
1429 /// true if the editor should follow the playhead, otherwise false
1430 bool _follow_playhead;
1431 /// true if we scroll the tracks rather than the playhead
1432 bool _stationary_playhead;
1434 ARDOUR::TempoMap::BBTPointList *current_bbt_points;
1436 TempoLines* tempo_lines;
1438 ArdourCanvas::Group* time_line_group;
1440 void hide_measures ();
1441 void draw_measures ();
1442 bool redraw_measures ();
1444 void new_tempo_section ();
1446 void mouse_add_new_tempo_event (framepos_t where);
1447 void mouse_add_new_meter_event (framepos_t where);
1449 void remove_tempo_marker (ArdourCanvas::Item*);
1450 void remove_meter_marker (ArdourCanvas::Item*);
1451 gint real_remove_tempo_marker (ARDOUR::TempoSection*);
1452 gint real_remove_meter_marker (ARDOUR::MeterSection*);
1454 void edit_tempo_section (ARDOUR::TempoSection*);
1455 void edit_meter_section (ARDOUR::MeterSection*);
1456 void edit_tempo_marker (ArdourCanvas::Item*);
1457 void edit_meter_marker (ArdourCanvas::Item*);
1458 void edit_control_point (ArdourCanvas::Item*);
1459 void edit_note (ArdourCanvas::Item *);
1461 void marker_menu_edit ();
1462 void marker_menu_remove ();
1463 void marker_menu_rename ();
1464 void toggle_marker_menu_lock ();
1465 void toggle_marker_menu_glue ();
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 tempo_or_meter_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, ARDOUR::Location *);
1488 void build_tempo_or_meter_marker_menu (bool);
1489 void build_new_transport_marker_menu ();
1490 void dynamic_cast_marker_object (void*, MeterMarker**, TempoMarker**) const;
1492 Gtk::Menu* tempo_or_meter_marker_menu;
1493 Gtk::Menu* marker_menu;
1494 Gtk::Menu* session_range_marker_menu;
1495 Gtk::Menu* range_marker_menu;
1496 Gtk::Menu* transport_marker_menu;
1497 Gtk::Menu* new_transport_marker_menu;
1498 Gtk::Menu* cd_marker_menu;
1499 ArdourCanvas::Item* marker_menu_item;
1501 typedef std::list<Marker*> Marks;
1504 void remove_metric_marks ();
1505 void draw_metric_marks (const ARDOUR::Metrics& metrics);
1507 void compute_current_bbt_points (nframes_t left, nframes_t right);
1508 void tempo_map_changed (const PBD::PropertyChange&);
1509 void redisplay_tempo (bool immediate_redraw);
1511 uint32_t bbt_beat_subdivision;
1515 Gtk::ToggleButton editor_mixer_button;
1516 Gtk::ToggleButton editor_list_button;
1517 void editor_mixer_button_toggled ();
1518 void editor_list_button_toggled ();
1520 AudioClock zoom_range_clock;
1521 Gtk::Button zoom_in_button;
1522 Gtk::Button zoom_out_button;
1523 Gtk::Button zoom_out_full_button;
1524 Gtk::Button zoom_onetoone_button;
1526 Gtk::Button tav_expand_button;
1527 Gtk::Button tav_shrink_button;
1529 Gtk::VBox toolbar_clock_vbox;
1530 Gtk::VBox toolbar_selection_clock_vbox;
1531 Gtk::Table toolbar_selection_clock_table;
1532 Gtk::Label toolbar_selection_cursor_label;
1534 Gtkmm2ext::TearOff* _mouse_mode_tearoff;
1535 Gtk::ToggleButton mouse_select_button;
1536 Gtk::ToggleButton mouse_move_button;
1537 Gtk::ToggleButton mouse_gain_button;
1538 Gtk::ToggleButton mouse_zoom_button;
1539 Gtk::ToggleButton mouse_timefx_button;
1540 Gtk::ToggleButton mouse_audition_button;
1541 Gtk::ToggleButton join_object_range_button;
1543 void mouse_mode_toggled (Editing::MouseMode m);
1544 void mouse_mode_object_range_toggled () {}
1545 bool ignore_mouse_mode_toggle;
1547 Gtk::ToggleButton internal_edit_button;
1548 void toggle_internal_editing ();
1550 gint mouse_select_button_release (GdkEventButton*);
1552 Gtk::VBox automation_box;
1553 Gtk::Button automation_mode_button;
1554 Gtk::ToggleButton global_automation_button;
1556 Gtk::ComboBoxText edit_mode_selector;
1557 Gtk::VBox edit_mode_box;
1559 void set_edit_mode (ARDOUR::EditMode);
1560 void cycle_edit_mode ();
1561 void edit_mode_selection_done ();
1563 Gtk::ComboBoxText snap_type_selector;
1564 Gtk::ComboBoxText snap_mode_selector;
1567 std::vector<std::string> snap_type_strings;
1568 std::vector<std::string> snap_mode_strings;
1570 void snap_type_selection_done ();
1571 void snap_mode_selection_done ();
1572 void snap_mode_chosen (Editing::SnapMode);
1573 void snap_type_chosen (Editing::SnapType);
1575 Glib::RefPtr<Gtk::RadioAction> snap_type_action (Editing::SnapType);
1576 Glib::RefPtr<Gtk::RadioAction> snap_mode_action (Editing::SnapMode);
1578 Gtk::ComboBoxText zoom_focus_selector;
1579 Gtk::VBox zoom_focus_box;
1581 std::vector<std::string> zoom_focus_strings;
1583 void zoom_focus_selection_done ();
1584 void zoom_focus_chosen (Editing::ZoomFocus);
1586 Glib::RefPtr<Gtk::RadioAction> zoom_focus_action (Editing::ZoomFocus);
1588 Gtk::HBox _zoom_box;
1589 Gtkmm2ext::TearOff* _zoom_tearoff;
1590 void zoom_adjustment_changed();
1592 void setup_toolbar ();
1594 void setup_tooltips ();
1596 Gtkmm2ext::TearOff* _tools_tearoff;
1597 Gtk::HBox toolbar_hbox;
1598 Gtk::EventBox toolbar_base;
1599 Gtk::Frame toolbar_frame;
1603 Gtk::HBox panic_box;
1604 Gtk::Button midi_panic_button;
1605 Gtk::ToggleButton midi_sound_notes;
1607 bool sound_notes () const { return midi_sound_notes.get_active(); }
1609 void setup_midi_toolbar ();
1611 /* selection process */
1613 Selection* selection;
1614 Selection* cut_buffer;
1616 void time_selection_changed ();
1617 void track_selection_changed ();
1618 void region_selection_changed ();
1619 sigc::connection editor_regions_selection_changed_connection;
1620 void sensitize_the_right_region_actions (bool have_selected_regions);
1621 void point_selection_changed ();
1622 void marker_selection_changed ();
1624 void cancel_selection ();
1626 void region_selection_op (void (ARDOUR::Region::*pmf)(void));
1627 void region_selection_op (void (ARDOUR::Region::*pmf)(void*), void*);
1628 void region_selection_op (void (ARDOUR::Region::*pmf)(bool), bool);
1630 bool audio_region_selection_covers (framepos_t where);
1632 /* transport range select process */
1634 ArdourCanvas::SimpleRect* cd_marker_bar_drag_rect;
1635 ArdourCanvas::SimpleRect* range_bar_drag_rect;
1636 ArdourCanvas::SimpleRect* transport_bar_drag_rect;
1639 ArdourCanvas::SimpleRect *bogus_background_rect;
1641 ArdourCanvas::SimpleRect *transport_bar_range_rect;
1642 ArdourCanvas::SimpleRect *transport_bar_preroll_rect;
1643 ArdourCanvas::SimpleRect *transport_bar_postroll_rect;
1644 ArdourCanvas::SimpleRect *transport_loop_range_rect;
1645 ArdourCanvas::SimpleRect *transport_punch_range_rect;
1646 ArdourCanvas::SimpleLine *transport_punchin_line;
1647 ArdourCanvas::SimpleLine *transport_punchout_line;
1648 ArdourCanvas::SimpleRect *transport_preroll_rect;
1649 ArdourCanvas::SimpleRect *transport_postroll_rect;
1651 ARDOUR::Location* transport_loop_location();
1652 ARDOUR::Location* transport_punch_location();
1654 ARDOUR::Location *temp_location;
1656 /* object rubberband select process */
1658 bool select_all_within (framepos_t, framepos_t, double, double, TrackViewList const &, Selection::Operation, bool);
1660 ArdourCanvas::SimpleRect *rubberband_rect;
1662 /* mouse zoom process */
1664 ArdourCanvas::SimpleRect *zoom_rect;
1665 void reposition_zoom_rect (framepos_t start, framepos_t end);
1667 EditorRouteGroups* _route_groups;
1668 EditorRoutes* _routes;
1669 EditorRegions* _regions;
1670 EditorSnapshots* _snapshots;
1671 EditorLocations* _locations;
1673 /* diskstream/route display management */
1674 Glib::RefPtr<Gdk::Pixbuf> rec_enabled_icon;
1675 Glib::RefPtr<Gdk::Pixbuf> rec_disabled_icon;
1677 Glib::RefPtr<Gtk::TreeSelection> route_display_selection;
1679 bool sync_track_view_list_and_routes ();
1681 Gtk::VBox list_vpacker;
1685 bool autoscroll_active;
1686 int autoscroll_timeout_tag;
1689 int last_autoscroll_x;
1690 int last_autoscroll_y;
1691 uint32_t autoscroll_cnt;
1692 framecnt_t autoscroll_x_distance;
1693 double autoscroll_y_distance;
1695 static gint _autoscroll_canvas (void *);
1696 bool autoscroll_canvas ();
1697 void start_canvas_autoscroll (int x, int y);
1698 void stop_canvas_autoscroll ();
1701 void point_trim (GdkEvent *, framepos_t);
1702 void single_contents_trim (RegionView&, framepos_t, bool, bool);
1703 void single_start_trim (RegionView&, framepos_t, bool);
1704 void single_end_trim (RegionView&, framepos_t, bool);
1706 void thaw_region_after_trim (RegionView& rv);
1708 void trim_region_front();
1709 void trim_region_back();
1710 void trim_region (bool front);
1712 void trim_region_to_edit_point ();
1713 void trim_region_from_edit_point ();
1714 void trim_region_to_loop ();
1715 void trim_region_to_punch ();
1716 void trim_region_to_location (const ARDOUR::Location&, const char* cmd);
1718 void trim_to_region(bool forward);
1719 void trim_region_to_previous_region_end();
1720 void trim_region_to_next_region_start();
1722 bool show_gain_after_trim;
1726 int convert_drop_to_paths (
1727 std::vector<std::string>& paths,
1728 const Glib::RefPtr<Gdk::DragContext>& context,
1731 const Gtk::SelectionData& data,
1735 void track_canvas_drag_data_received (
1736 const Glib::RefPtr<Gdk::DragContext>& context,
1739 const Gtk::SelectionData& data,
1744 const Glib::RefPtr<Gdk::DragContext>& context,
1747 const Gtk::SelectionData& data,
1752 const Glib::RefPtr<Gdk::DragContext>& context,
1755 const Gtk::SelectionData& data,
1760 const Glib::RefPtr<Gdk::DragContext>& context,
1763 const Gtk::SelectionData& data,
1769 int write_region_selection(RegionSelection&);
1770 bool write_region (std::string path, boost::shared_ptr<ARDOUR::AudioRegion>);
1771 void bounce_region_selection ();
1772 void bounce_range_selection (bool replace, bool enable_processing);
1773 void external_edit_region ();
1775 int write_audio_selection (TimeSelection&);
1776 bool write_audio_range (ARDOUR::AudioPlaylist&, const ARDOUR::ChanCount& channels, std::list<ARDOUR::AudioRange>&);
1778 void write_selection ();
1780 XMLNode *before; /* used in *_reversible_command */
1782 void update_title ();
1783 void update_title_s (const std::string & snapshot_name);
1786 Selection* selection;
1787 double frames_per_unit;
1789 State (PublicEditor const * e);
1793 void instant_save ();
1795 boost::shared_ptr<ARDOUR::AudioRegion> last_audition_region;
1797 /* freeze operations */
1799 ARDOUR::InterThreadInfo freeze_status;
1800 static void* _freeze_thread (void*);
1801 void* freeze_thread ();
1803 void freeze_route ();
1804 void unfreeze_route ();
1806 /* route-group solo + mute */
1808 void set_route_group_solo (ARDOUR::Route&, bool);
1809 void set_route_group_mute (ARDOUR::Route&, bool);
1813 void duplicate_dialog (bool with_dialog);
1815 framepos_t event_frame (GdkEvent const *, double* px = 0, double* py = 0) const;
1817 /* returns false if mouse pointer is not in track or marker canvas
1819 bool mouse_frame (framepos_t&, bool& in_track_canvas) const;
1821 /* "whats mine is yours" */
1823 TimeFXDialog* current_timefx;
1825 static void* timefx_thread (void *arg);
1826 void do_timefx (TimeFXDialog&);
1828 int time_stretch (RegionSelection&, float fraction);
1829 int pitch_shift (RegionSelection&, float cents);
1830 void pitch_shift_regions ();
1831 int time_fx (RegionSelection&, float val, bool pitching);
1833 /* editor-mixer strip */
1835 MixerStrip *current_mixer_strip;
1836 bool show_editor_mixer_when_tracks_arrive;
1837 Gtk::VBox current_mixer_strip_vbox;
1838 void cms_new (boost::shared_ptr<ARDOUR::Route>);
1839 void current_mixer_strip_hidden ();
1841 void detach_tearoff (Gtk::Box* b, Gtk::Window* w);
1842 void reattach_tearoff (Gtk::Box* b, Gtk::Window* w, int32_t n);
1844 void ensure_all_elements_drawn ();
1846 /* nudging tracks */
1848 void nudge_track (bool use_edit_point, bool forwards);
1852 bool _xfade_visibility;
1855 void handle_new_imageframe_time_axis_view(const std::string & track_name, void* src) ;
1856 void handle_new_imageframe_marker_time_axis_view(const std::string & track_name, TimeAxisView* marked_track) ;
1858 void start_imageframe_grab(ArdourCanvas::Item*, GdkEvent*) ;
1859 void start_markerview_grab(ArdourCanvas::Item*, GdkEvent*) ;
1861 void imageframe_drag_motion_callback(ArdourCanvas::Item*, GdkEvent*) ;
1862 void markerview_drag_motion_callback(ArdourCanvas::Item*, GdkEvent*) ;
1863 void timeaxis_item_drag_finished_callback(ArdourCanvas::Item*, GdkEvent*) ;
1865 gint canvas_imageframe_item_view_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameView* ifv);
1866 gint canvas_imageframe_view_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameTimeAxis* ifta);
1867 gint canvas_imageframe_start_handle_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameView* ifv);
1868 gint canvas_imageframe_end_handle_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameView* ifv);
1870 gint canvas_marker_time_axis_view_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerTimeAxis* mta);
1871 gint canvas_markerview_item_view_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerView* mv);
1872 gint canvas_markerview_start_handle_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerView* mv);
1873 gint canvas_markerview_end_handle_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerView* mv);
1875 void imageframe_start_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1876 void imageframe_end_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1877 void imageframe_start_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1878 void imageframe_start_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1879 void imageframe_end_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1880 void imageframe_end_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1882 void markerview_item_start_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1883 void markerview_item_end_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1884 void markerview_start_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1885 void markerview_start_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1886 void markerview_end_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1887 void markerview_end_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1889 void popup_imageframe_edit_menu(int button, int32_t time, ArdourCanvas::Item* ifv, bool with_frame) ;
1890 void popup_marker_time_axis_edit_menu(int button, int32_t time, ArdourCanvas::Item* ifv, bool with_frame) ;
1892 ImageFrameSocketHandler* image_socket_listener ;
1895 void toggle_xfade_active (boost::weak_ptr<ARDOUR::Crossfade>);
1896 void toggle_xfade_length (boost::weak_ptr<ARDOUR::Crossfade>);
1897 void edit_xfade (boost::weak_ptr<ARDOUR::Crossfade>);
1898 void xfade_edit_left_region ();
1899 void xfade_edit_right_region ();
1901 static const int32_t default_width = 995;
1902 static const int32_t default_height = 765;
1906 Gtk::Button nudge_forward_button;
1907 Gtk::Button nudge_backward_button;
1908 Gtk::HBox nudge_hbox;
1909 Gtk::VBox nudge_vbox;
1910 AudioClock nudge_clock;
1912 bool nudge_forward_release (GdkEventButton*);
1913 bool nudge_backward_release (GdkEventButton*);
1917 void apply_filter (ARDOUR::Filter&, std::string cmd, ProgressReporter* progress = 0);
1919 Command* apply_midi_note_edit_op_to_region (ARDOUR::MidiOperator& op, MidiRegionView& mrv);
1920 void apply_midi_note_edit_op (ARDOUR::MidiOperator& op);
1922 /* handling cleanup */
1924 int playlist_deletion_dialog (boost::shared_ptr<ARDOUR::Playlist>);
1926 PBD::ScopedConnectionList session_connections;
1928 /* tracking step changes of track height */
1930 TimeAxisView* current_stepping_trackview;
1931 ARDOUR::microseconds_t last_track_height_step_timestamp;
1932 gint track_height_step_timeout();
1933 sigc::connection step_timeout;
1935 TimeAxisView* entered_track;
1936 /** If the mouse is over a RegionView or one of its child canvas items, this is set up
1937 to point to the RegionView. Otherwise it is 0.
1939 RegionView* entered_regionview;
1942 void ensure_entered_track_selected (bool op_acts_on_objects = false);
1943 bool clear_entered_track;
1944 bool left_track_canvas (GdkEventCrossing*);
1945 bool entered_track_canvas (GdkEventCrossing*);
1946 void set_entered_track (TimeAxisView*);
1947 void set_entered_regionview (RegionView*);
1948 void ensure_track_visible (TimeAxisView*);
1949 gint left_automation_track ();
1951 void reset_canvas_action_sensitivity (bool);
1952 void toggle_gain_envelope_visibility ();
1953 void toggle_gain_envelope_active ();
1954 void reset_region_gain_envelopes ();
1956 bool on_key_press_event (GdkEventKey*);
1957 bool on_key_release_event (GdkEventKey*);
1959 void session_state_saved (std::string);
1961 Glib::RefPtr<Gtk::Action> undo_action;
1962 Glib::RefPtr<Gtk::Action> redo_action;
1964 void history_changed ();
1966 Gtk::HBox status_bar_hpacker;
1968 Editing::EditPoint _edit_point;
1970 Gtk::ComboBoxText edit_point_selector;
1972 void set_edit_point_preference (Editing::EditPoint ep, bool force = false);
1973 void cycle_edit_point (bool with_marker);
1974 void set_edit_point ();
1975 void edit_point_selection_done ();
1976 void edit_point_chosen (Editing::EditPoint);
1977 Glib::RefPtr<Gtk::RadioAction> edit_point_action (Editing::EditPoint);
1978 std::vector<std::string> edit_point_strings;
1980 void selected_marker_moved (ARDOUR::Location*);
1982 bool get_edit_op_range (framepos_t& start, framepos_t& end) const;
1984 void get_regions_at (RegionSelection&, framepos_t where, const TrackViewList& ts) const;
1985 void get_regions_after (RegionSelection&, framepos_t where, const TrackViewList& ts) const;
1987 void get_regions_for_action (RegionSelection&, bool allow_entered = false, bool allow_edit_position = true);
1989 void start_updating_meters ();
1990 void stop_updating_meters ();
1991 bool meters_running;
1993 void select_next_route ();
1994 void select_prev_route ();
1996 void snap_to_internal (framepos_t& first, int32_t direction = 0, bool for_mark = false);
1997 void timecode_snap_to_internal (framepos_t& first, int32_t direction = 0, bool for_mark = false);
1999 RhythmFerret* rhythm_ferret;
2000 BundleManager* _bundle_manager;
2002 void fit_tracks (TrackViewList &);
2003 void fit_selected_tracks ();
2004 void set_track_height (Height);
2006 void remove_tracks ();
2007 void toggle_tracks_active ();
2011 static gboolean _idle_resize (gpointer);
2013 int32_t _pending_resize_amount;
2014 TimeAxisView* _pending_resize_view;
2016 void visible_order_range (int*, int*) const;
2020 /** true if we've made a locate request that hasn't yet been processed */
2021 bool _pending_locate_request;
2023 /** if true, there is a pending Session locate which is the initial one when loading a session;
2024 we need to know this so that we don't (necessarily) set the viewport to show the playhead
2027 bool _pending_initial_locate;
2029 Gtk::HBox _summary_hbox;
2030 EditorSummary* _summary;
2031 void region_view_added (RegionView *);
2033 void update_canvas_now ();
2035 EditorGroupTabs* _group_tabs;
2036 void fit_route_group (ARDOUR::RouteGroup *);
2038 void step_edit_status_change (bool);
2039 void start_step_editing ();
2040 void stop_step_editing ();
2041 bool check_step_edit ();
2042 sigc::connection step_edit_connection;
2044 double _last_motion_y;
2046 RegionLayeringOrderEditor* layering_order_editor;
2047 void update_region_layering_order_editor (ARDOUR::framepos_t);
2049 /** Track that was the source for the last cut/copy operation. Used as a place
2050 to paste things iff there is no selected track.
2052 TimeAxisView* _last_cut_copy_source_track;
2054 /** true if the update of the region list's selection from the current Selection
2055 should be blocked if the Selection is empty. See EditorRegions::selection_changed.
2057 bool _block_region_list_update_if_empty;
2059 void setup_fade_images ();
2060 std::map<ARDOUR::FadeShape, Gtk::Image*> _fade_in_images;
2061 std::map<ARDOUR::FadeShape, Gtk::Image*> _fade_out_images;
2064 friend class RegionDrag;
2065 friend class RegionMoveDrag;
2066 friend class RegionSpliceDrag;
2067 friend class TrimDrag;
2068 friend class MeterMarkerDrag;
2069 friend class TempoMarkerDrag;
2070 friend class CursorDrag;
2071 friend class FadeInDrag;
2072 friend class FadeOutDrag;
2073 friend class MarkerDrag;
2074 friend class RegionGainDrag;
2075 friend class ControlPointDrag;
2076 friend class LineDrag;
2077 friend class RubberbandSelectDrag;
2078 friend class TimeFXDrag;
2079 friend class ScrubDrag;
2080 friend class SelectionDrag;
2081 friend class RangeMarkerBarDrag;
2082 friend class MouseZoomDrag;
2083 friend class RegionCreateDrag;
2084 friend class RegionMotionDrag;
2085 friend class RegionInsertDrag;
2087 friend class EditorSummary;
2088 friend class EditorGroupTabs;
2090 friend class EditorRoutes;
2091 friend class RhythmFerret;
2094 #endif /* __ardour_editor_h__ */