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__
29 #include <boost/optional.hpp>
31 #include <libgnomecanvasmm/canvas.h>
32 #include <libgnomecanvasmm/group.h>
33 #include <libgnomecanvasmm/line.h>
34 #include <libgnomecanvasmm/pixbuf.h>
38 #include <gtkmm/comboboxtext.h>
39 #include <gtkmm/layout.h>
41 #include "gtkmm2ext/selector.h"
42 #include "gtkmm2ext/click_box.h"
43 #include "gtkmm2ext/dndtreeview.h"
44 #include "gtkmm2ext/stateful_button.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/types.h"
54 #include "audio_clock.h"
55 #include "gtk-custom-ruler.h"
56 #include "ardour_dialog.h"
57 #include "public_editor.h"
60 #include "editor_items.h"
61 #include "region_selection.h"
63 #include "window_proxy.h"
65 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;
135 /* <CMT Additions> */
136 class ImageFrameView;
137 class ImageFrameTimeAxisView;
138 class ImageFrameTimeAxis;
139 class MarkerTimeAxis ;
141 class ImageFrameSocketHandler ;
142 class TimeAxisViewItem ;
143 /* </CMT Additions> */
145 class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARDOUR::SessionHandlePtr
151 void set_session (ARDOUR::Session *);
152 ARDOUR::Session* session() const { return _session; }
155 virtual bool have_idled () const { return _have_idled; }
157 framepos_t leftmost_position() const { return leftmost_frame; }
159 framecnt_t current_page_frames() const {
160 return (framecnt_t) floor (_canvas_width * frames_per_unit);
163 double canvas_height () const {
164 return _canvas_height;
167 void cycle_snap_mode ();
168 void cycle_snap_choice ();
169 void set_snap_to (Editing::SnapType);
170 void set_snap_mode (Editing::SnapMode);
171 void set_snap_threshold (double pixel_distance) {snap_threshold = pixel_distance;}
173 Editing::SnapMode snap_mode () const;
174 Editing::SnapType snap_type () const;
176 void undo (uint32_t n = 1);
177 void redo (uint32_t n = 1);
179 XMLNode& get_state ();
180 int set_state (const XMLNode&, int version);
182 void set_mouse_mode (Editing::MouseMode, bool force=true);
183 void step_mouse_mode (bool next);
184 Editing::MouseMode current_mouse_mode () const { return mouse_mode; }
185 Editing::MidiEditMode current_midi_edit_mode () const;
186 void remove_midi_note (ArdourCanvas::Item *, GdkEvent *);
188 bool internal_editing() const { return _internal_editing ; }
189 void set_internal_edit (bool yn);
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) ;
196 TimeAxisView* get_named_time_axis(const std::string & name) ;
197 #endif /* WITH_CMT */
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_route_id (PBD::ID& id) const;
204 void consider_auditioning (boost::shared_ptr<ARDOUR::Region>);
205 void hide_a_region (boost::shared_ptr<ARDOUR::Region>);
206 void show_a_region (boost::shared_ptr<ARDOUR::Region>);
208 #ifdef USE_RUBBERBAND
209 std::vector<std::string> rb_opt_strings;
213 /* things that need to be public to be used in the main menubar */
215 void new_region_from_selection ();
216 void separate_regions_between (const TimeSelection&);
217 void separate_region_from_selection ();
218 void separate_under_selected_regions ();
219 void separate_region_from_punch ();
220 void separate_region_from_loop ();
221 void separate_regions_using_location (ARDOUR::Location&);
222 void transition_to_rolling (bool forward);
226 framepos_t unit_to_frame (double unit) const {
227 return (framepos_t) rint (unit * frames_per_unit);
230 double frame_to_unit (framepos_t frame) const {
231 return rint ((double) frame / (double) frames_per_unit);
234 double frame_to_unit (double frame) const {
235 return rint (frame / frames_per_unit);
238 /* NOTE: these functions assume that the "pixel" coordinate is
239 the result of using the world->canvas affine transform on a
240 world coordinate. These coordinates already take into
241 account any scrolling carried out by adjusting the
245 framepos_t pixel_to_frame (double pixel) const {
247 /* pixel can be less than zero when motion events
248 are processed. since we've already run the world->canvas
249 affine, that means that the location *really* is "off
250 to the right" and thus really is "before the start".
254 return (framepos_t) rint (pixel * frames_per_unit * GNOME_CANVAS(track_canvas->gobj())->pixels_per_unit);
260 gulong frame_to_pixel (framepos_t frame) const {
261 return (gulong) rint ((frame / (frames_per_unit * GNOME_CANVAS(track_canvas->gobj())->pixels_per_unit)));
264 void flush_canvas ();
268 Selection& get_selection() const { return *selection; }
269 Selection& get_cut_buffer() const { return *cut_buffer; }
271 bool extend_selection_to_track (TimeAxisView&);
273 void play_selection ();
274 void select_all_in_track (Selection::Operation op);
275 void select_all (Selection::Operation op);
276 void invert_selection_in_track ();
277 void invert_selection ();
278 void deselect_all ();
280 void set_selected_regionview_from_region_list (boost::shared_ptr<ARDOUR::Region> region, Selection::Operation op = Selection::Set);
284 void set_show_measures (bool yn);
285 bool show_measures () const { return _show_measures; }
287 /* analysis window */
289 void analyze_region_selection();
290 void analyze_range_selection();
294 void export_audio ();
296 void export_selection ();
297 void export_range ();
298 void export_region ();
300 void add_toplevel_controls (Gtk::Container&);
301 Gtk::HBox& get_status_bar_packer() { return status_bar_hpacker; }
303 void set_zoom_focus (Editing::ZoomFocus);
304 Editing::ZoomFocus get_zoom_focus () const { return zoom_focus; }
305 double get_current_zoom () const { return frames_per_unit; }
307 void temporal_zoom_step (bool coarser);
308 void tav_zoom_step (bool coarser);
310 /* stuff that AudioTimeAxisView and related classes use */
312 PlaylistSelector& playlist_selector() const;
313 void clear_playlist (boost::shared_ptr<ARDOUR::Playlist>);
315 void new_playlists (TimeAxisView* v);
316 void copy_playlists (TimeAxisView* v);
317 void clear_playlists (TimeAxisView* v);
319 void get_onscreen_tracks (TrackViewList&);
321 Width editor_mixer_strip_width;
322 void maybe_add_mixer_strip_width (XMLNode&);
323 void show_editor_mixer (bool yn);
324 void create_editor_mixer ();
325 void show_editor_list (bool yn);
326 void set_selected_mixer_strip (TimeAxisView&);
327 void mixer_strip_width_changed ();
328 void hide_track_in_display (TimeAxisView* tv, bool apply_to_selection = false);
330 /* nudge is initiated by transport controls owned by ARDOUR_UI */
332 framecnt_t get_nudge_distance (framepos_t pos, framecnt_t& next);
333 Evoral::MusicalTime get_grid_type_as_beats (bool& success, framepos_t position);
335 void nudge_forward (bool next, bool force_playhead);
336 void nudge_backward (bool next, bool force_playhead);
338 /* nudge initiated from context menu */
340 void nudge_forward_capture_offset ();
341 void nudge_backward_capture_offset ();
343 /* playhead/screen stuff */
345 void set_stationary_playhead (bool yn);
346 void toggle_stationary_playhead ();
347 bool stationary_playhead() const { return _stationary_playhead; }
349 void set_follow_playhead (bool yn, bool catch_up = true);
350 void toggle_follow_playhead ();
351 bool follow_playhead() const { return _follow_playhead; }
352 bool dragging_playhead () const { return _dragging_playhead; }
354 void toggle_zero_line_visibility ();
356 void set_group_tabs ();
357 void toggle_measure_visibility ();
358 void toggle_logo_visibility ();
362 void toggle_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 void prepare_for_cleanup ();
381 void finish_cleanup ();
383 void maximise_editing_space();
384 void restore_editing_space();
386 void reset_x_origin (framepos_t);
387 void reset_x_origin_to_follow_playhead ();
388 void reset_y_origin (double);
389 void reset_zoom (double);
390 void reposition_and_zoom (framepos_t, double);
392 framepos_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();
401 void goto_visual_state (uint32_t);
402 void save_visual_state (uint32_t);
404 void queue_draw_resize_line (int at);
405 void start_resize_line_ops ();
406 void end_resize_line_ops ();
408 TrackViewList const & get_track_views () {
412 int get_regionview_count_from_region_list (boost::shared_ptr<ARDOUR::Region>);
414 void do_import (std::vector<std::string> paths, Editing::ImportDisposition, Editing::ImportMode mode, ARDOUR::SrcQuality, framepos_t&);
415 void do_embed (std::vector<std::string> paths, Editing::ImportDisposition, Editing::ImportMode mode, framepos_t&);
417 void get_regions_corresponding_to (boost::shared_ptr<ARDOUR::Region> region, std::vector<RegionView*>& regions);
419 void center_screen (framepos_t);
421 TrackViewList axis_views_from_routes (boost::shared_ptr<ARDOUR::RouteList>) const;
422 Gtkmm2ext::TearOff* mouse_mode_tearoff () const { return _mouse_mode_tearoff; }
423 Gtkmm2ext::TearOff* tools_tearoff () const { return _tools_tearoff; }
425 void snap_to (framepos_t& first, int32_t direction = 0, bool for_mark = false);
426 void snap_to_with_modifier (framepos_t& first, GdkEvent const *, int32_t direction = 0, bool for_mark = false);
427 void snap_to (framepos_t& first, framepos_t& last, int32_t direction = 0, bool for_mark = false);
429 void begin_reversible_command (std::string cmd_name);
430 void begin_reversible_command (GQuark);
431 void commit_reversible_command ();
433 DragManager* drags () const {
437 void maybe_autoscroll (bool, bool);
439 Gdk::Cursor* get_canvas_cursor () const { return current_canvas_cursor; }
440 void set_canvas_cursor (Gdk::Cursor*, bool save=false);
441 void set_current_trimmable (boost::shared_ptr<ARDOUR::Trimmable>);
442 void set_current_movable (boost::shared_ptr<ARDOUR::Movable>);
444 MouseCursors const * cursors () const {
448 VerboseCursor* verbose_cursor () const {
449 return _verbose_cursor;
452 void get_pointer_position (double &, double &) const;
455 void map_transport_state ();
456 void map_position_change (framepos_t);
462 void color_handler ();
466 // to keep track of the playhead position for control_scroll
467 boost::optional<framepos_t> _control_scroll_target;
469 PlaylistSelector* _playlist_selector;
471 typedef std::pair<TimeAxisView*,XMLNode*> TAVState;
475 double frames_per_unit;
476 framepos_t leftmost_frame;
477 Editing::ZoomFocus zoom_focus;
478 std::list<TAVState> track_states;
481 std::list<VisualState*> undo_visual_stack;
482 std::list<VisualState*> redo_visual_stack;
483 VisualState* current_visual_state (bool with_tracks = true);
484 void undo_visual_state ();
485 void redo_visual_state ();
486 void use_visual_state (VisualState&);
488 void swap_visual_state ();
490 std::vector<VisualState*> visual_states;
491 sigc::connection visual_state_op_connection;
492 void start_visual_state_op (uint32_t n);
493 void cancel_visual_state_op (uint32_t n);
494 bool end_visual_state_op (uint32_t n);
496 framepos_t leftmost_frame;
497 double frames_per_unit;
498 Editing::ZoomFocus zoom_focus;
500 void set_frames_per_unit (double);
503 Editing::MouseMode mouse_mode;
504 Editing::MouseMode pre_internal_mouse_mode;
505 bool _internal_editing;
506 Editing::MouseMode effective_mouse_mode () const;
508 enum JoinObjectRangeState {
509 JOIN_OBJECT_RANGE_NONE,
510 /** `join object/range' mode is active and the mouse is over a place where object mode should happen */
511 JOIN_OBJECT_RANGE_OBJECT,
512 /** `join object/range' mode is active and the mouse is over a place where range mode should happen */
513 JOIN_OBJECT_RANGE_RANGE
516 JoinObjectRangeState _join_object_range_state;
518 void update_join_object_range_location (double, double);
520 int post_maximal_editor_width;
521 int post_maximal_editor_height;
522 int post_maximal_horizontal_pane_position;
523 int post_maximal_vertical_pane_position;
524 int pre_maximal_horizontal_pane_position;
525 int pre_maximal_vertical_pane_position;
526 int pre_maximal_editor_width;
527 int pre_maximal_editor_height;
528 void pane_allocation_handler (Gtk::Allocation&, Gtk::Paned*);
530 Gtk::Notebook _the_notebook;
531 bool _notebook_shrunk;
532 void add_notebook_page (std::string const &, Gtk::Widget &);
533 bool notebook_tab_clicked (GdkEventButton *, Gtk::Widget *);
535 Gtk::HPaned edit_pane;
536 Gtk::VPaned editor_summary_pane;
538 Gtk::EventBox meter_base;
540 Gtk::EventBox marker_base;
541 Gtk::HBox marker_box;
542 Gtk::VBox scrollers_rulers_markers_box;
544 void location_changed (ARDOUR::Location *);
545 void location_flags_changed (ARDOUR::Location *, void *);
546 void refresh_location_display ();
547 void refresh_location_display_internal (ARDOUR::Locations::LocationList&);
548 void add_new_location (ARDOUR::Location *);
549 ArdourCanvas::Group* add_new_location_internal (ARDOUR::Location *);
550 void location_gone (ARDOUR::Location *);
551 void remove_marker (ArdourCanvas::Item&, GdkEvent*);
552 gint really_remove_marker (ARDOUR::Location* loc);
553 void goto_nth_marker (int nth);
554 void toggle_marker_lines ();
555 void set_marker_line_visibility (bool);
557 uint32_t location_marker_color;
558 uint32_t location_range_color;
559 uint32_t location_loop_color;
560 uint32_t location_punch_color;
561 uint32_t location_cd_marker_color;
563 struct LocationMarkers {
568 LocationMarkers () : start(0), end(0), valid (true) {}
575 void set_show_lines (bool);
576 void set_selected (bool);
577 void canvas_height_set (double);
580 void set_name (const std::string&);
581 void set_position (framepos_t start, framepos_t end = 0);
582 void set_color_rgba (uint32_t);
585 LocationMarkers *find_location_markers (ARDOUR::Location *) const;
586 ARDOUR::Location* find_location_from_marker (Marker *, bool& is_start) const;
587 Marker* entered_marker;
588 bool _show_marker_lines;
590 typedef std::map<ARDOUR::Location*,LocationMarkers *> LocationMarkerMap;
591 LocationMarkerMap location_markers;
593 void update_marker_labels ();
594 void update_marker_labels (ArdourCanvas::Group *);
595 void check_marker_label (Marker *);
597 /** A set of lists of Markers that are in each of the canvas groups
598 * for the marker sections at the top of the editor. These lists
599 * are kept sorted in time order between marker movements, so that after
600 * a marker has moved we can decide whether we need to update the labels
601 * for all markers or for just a few.
603 std::map<ArdourCanvas::Group *, std::list<Marker *> > _sorted_marker_lists;
604 void remove_sorted_marker (Marker *);
606 void hide_marker (ArdourCanvas::Item*, GdkEvent*);
607 void clear_marker_display ();
608 void mouse_add_new_marker (framepos_t where, bool is_cd=false, bool is_xrun=false);
609 bool choose_new_marker_name(std::string &name);
610 void update_cd_marker_display ();
611 void ensure_cd_marker_updated (LocationMarkers * lam, ARDOUR::Location * location);
613 TimeAxisView* clicked_axisview;
614 RouteTimeAxisView* clicked_routeview;
615 /** The last RegionView that was clicked on, or 0 if the last click was not
616 * on a RegionView. This is set up by the canvas event handlers in
617 * editor_canvas_events.cc
619 RegionView* clicked_regionview;
620 RegionSelection latest_regionviews;
621 uint32_t clicked_selection;
622 CrossfadeView* clicked_crossfadeview;
623 ControlPoint* clicked_control_point;
625 void sort_track_selection (TrackViewList* sel = 0);
627 void get_equivalent_regions (RegionView* rv, std::vector<RegionView*> &, PBD::PropertyID) const;
628 RegionSelection get_equivalent_regions (RegionSelection &, PBD::PropertyID) const;
629 void mapover_tracks (sigc::slot<void,RouteTimeAxisView&,uint32_t> sl, TimeAxisView*, PBD::PropertyID) const;
631 /* functions to be passed to mapover_tracks(), possibly with sigc::bind()-supplied arguments */
633 void mapped_get_equivalent_regions (RouteTimeAxisView&, uint32_t, RegionView *, std::vector<RegionView*>*) const;
634 void mapped_use_new_playlist (RouteTimeAxisView&, uint32_t, std::vector<boost::shared_ptr<ARDOUR::Playlist> > const &);
635 void mapped_use_copy_playlist (RouteTimeAxisView&, uint32_t, std::vector<boost::shared_ptr<ARDOUR::Playlist> > const &);
636 void mapped_clear_playlist (RouteTimeAxisView&, uint32_t);
640 void button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type);
641 bool button_release_can_deselect;
643 void catch_vanishing_regionview (RegionView *);
645 void set_selected_track (TimeAxisView&, Selection::Operation op = Selection::Set, bool no_remove=false);
646 void select_all_tracks ();
647 void select_all_internal_edit (Selection::Operation);
649 bool set_selected_control_point_from_click (Selection::Operation op = Selection::Set, bool no_remove=false);
650 void set_selected_track_from_click (bool press, Selection::Operation op = Selection::Set, bool no_remove=false);
651 void set_selected_track_as_side_effect (Selection::Operation op, bool force = false);
652 bool set_selected_regionview_from_click (bool press, Selection::Operation op = Selection::Set, bool no_track_remove=false);
654 bool set_selected_regionview_from_map_event (GdkEventAny*, StreamView*, boost::weak_ptr<ARDOUR::Region>);
655 void collect_new_region_view (RegionView *);
656 void collect_and_select_new_region_view (RegionView *);
658 long select_range_around_region (RegionView *);
660 Gtk::Menu track_context_menu;
661 Gtk::Menu track_region_context_menu;
662 Gtk::Menu track_selection_context_menu;
663 Gtk::Menu track_crossfade_context_menu;
665 Gtk::MenuItem* region_edit_menu_split_item;
666 Gtk::MenuItem* region_edit_menu_split_multichannel_item;
667 Gtk::Menu * track_region_edit_playlist_menu;
668 Gtk::Menu * track_edit_playlist_submenu;
669 Gtk::Menu * track_selection_edit_playlist_submenu;
671 void popup_track_context_menu (int, int, ItemType, bool);
672 Gtk::Menu* build_track_context_menu ();
673 Gtk::Menu* build_track_bus_context_menu ();
674 Gtk::Menu* build_track_region_context_menu ();
675 Gtk::Menu* build_track_crossfade_context_menu ();
676 Gtk::Menu* build_track_selection_context_menu ();
677 void add_dstream_context_items (Gtk::Menu_Helpers::MenuList&);
678 void add_bus_context_items (Gtk::Menu_Helpers::MenuList&);
679 void add_region_context_items (Gtk::Menu_Helpers::MenuList&, boost::shared_ptr<ARDOUR::Track>);
680 void add_crossfade_context_items (AudioStreamView*, boost::shared_ptr<ARDOUR::Crossfade>, Gtk::Menu_Helpers::MenuList&, bool many);
681 void add_selection_context_items (Gtk::Menu_Helpers::MenuList&);
682 Gtk::MenuItem* _popup_region_menu_item;
684 void handle_new_route (ARDOUR::RouteList&);
685 void timeaxisview_deleted (TimeAxisView *);
687 Gtk::HBox global_hpacker;
688 Gtk::VBox global_vpacker;
691 Gdk::Cursor* current_canvas_cursor;
692 Gdk::Cursor* which_grabber_cursor ();
693 void set_canvas_cursor ();
695 ArdourCanvas::Canvas* track_canvas;
697 friend class VerboseCursor;
698 VerboseCursor* _verbose_cursor;
700 void parameter_changed (std::string);
702 bool track_canvas_motion (GdkEvent*);
704 Gtk::EventBox time_canvas_event_box;
705 Gtk::EventBox track_canvas_event_box;
706 Gtk::EventBox time_button_event_box;
707 Gtk::EventBox ruler_label_event_box;
709 ArdourCanvas::Group *minsec_group;
710 ArdourCanvas::Pixbuf *logo_item;
711 ArdourCanvas::Group *bbt_group;
712 ArdourCanvas::Group *timecode_group;
713 ArdourCanvas::Group *frame_group;
714 ArdourCanvas::Group *tempo_group;
715 ArdourCanvas::Group *meter_group;
716 ArdourCanvas::Group *marker_group;
717 ArdourCanvas::Group *range_marker_group;
718 ArdourCanvas::Group *transport_marker_group;
719 ArdourCanvas::Group* cd_marker_group;
721 ArdourCanvas::Group* timebar_group;
723 /* These bars never need to be scrolled */
724 ArdourCanvas::Group* meter_bar_group;
725 ArdourCanvas::Group* tempo_bar_group;
726 ArdourCanvas::Group* marker_bar_group;
727 ArdourCanvas::Group* range_marker_bar_group;
728 ArdourCanvas::Group* transport_marker_bar_group;
729 ArdourCanvas::Group* cd_marker_bar_group;
731 /** The group containing all items that require horizontal scrolling. */
732 ArdourCanvas::Group* _background_group;
734 The _master_group is the group containing all items
735 that require horizontal scrolling..
736 It is primarily used to separate canvas items
737 that require horizontal scrolling from those that do not.
739 ArdourCanvas::Group* _master_group;
741 /* The group containing all trackviews. Only scrolled vertically. */
742 ArdourCanvas::Group* _trackview_group;
744 /* The group used for region motion. Sits on top of _trackview_group */
745 ArdourCanvas::Group* _region_motion_group;
748 ruler_metric_timecode = 0,
749 ruler_metric_bbt = 1,
750 ruler_metric_samples = 2,
751 ruler_metric_minsec = 3,
753 ruler_time_tempo = 4,
754 ruler_time_meter = 5,
755 ruler_time_marker = 6,
756 ruler_time_range_marker = 7,
757 ruler_time_transport_marker = 8,
758 ruler_time_cd_marker = 9,
761 static GtkCustomMetric ruler_metrics[4];
762 Glib::RefPtr<Gtk::ToggleAction> ruler_timecode_action;
763 Glib::RefPtr<Gtk::ToggleAction> ruler_bbt_action;
764 Glib::RefPtr<Gtk::ToggleAction> ruler_samples_action;
765 Glib::RefPtr<Gtk::ToggleAction> ruler_minsec_action;
766 Glib::RefPtr<Gtk::ToggleAction> ruler_tempo_action;
767 Glib::RefPtr<Gtk::ToggleAction> ruler_meter_action;
768 Glib::RefPtr<Gtk::ToggleAction> ruler_marker_action;
769 Glib::RefPtr<Gtk::ToggleAction> ruler_range_action;
770 Glib::RefPtr<Gtk::ToggleAction> ruler_loop_punch_action;
771 Glib::RefPtr<Gtk::ToggleAction> ruler_cd_marker_action;
772 bool no_ruler_shown_update;
774 bool ruler_button_press (GdkEventButton*);
775 bool ruler_button_release (GdkEventButton*);
776 bool ruler_mouse_motion (GdkEventMotion*);
777 bool ruler_scroll (GdkEventScroll* event);
779 Gtk::Widget * ruler_grabbed_widget;
781 void initialize_rulers ();
782 void update_just_timecode ();
783 void compute_fixed_ruler_scale (); //calculates the RulerScale of the fixed rulers
784 void update_fixed_rulers ();
785 void update_tempo_based_rulers ();
786 void popup_ruler_menu (framepos_t where = 0, ItemType type = RegionItem);
787 void update_ruler_visibility ();
788 void set_ruler_visible (RulerType, bool);
789 void toggle_ruler_visibility (RulerType rt);
790 void ruler_toggled (int);
791 bool ruler_label_button_release (GdkEventButton*);
792 void store_ruler_visibility ();
793 void restore_ruler_visibility ();
795 static gint _metric_get_timecode (GtkCustomRulerMark **, gdouble, gdouble, gint);
796 static gint _metric_get_bbt (GtkCustomRulerMark **, gdouble, gdouble, gint);
797 static gint _metric_get_samples (GtkCustomRulerMark **, gdouble, gdouble, gint);
798 static gint _metric_get_minsec (GtkCustomRulerMark **, gdouble, gdouble, gint);
800 enum MinsecRulerScale {
807 MinsecRulerScale minsec_ruler_scale;
809 framecnt_t minsec_mark_interval;
810 gint minsec_mark_modulo;
812 void set_minsec_ruler_scale (framepos_t, framepos_t);
814 enum TimecodeRulerScale {
816 timecode_show_frames,
817 timecode_show_seconds,
818 timecode_show_minutes,
822 TimecodeRulerScale timecode_ruler_scale;
824 gint timecode_mark_modulo;
825 gint timecode_nmarks;
826 void set_timecode_ruler_scale (framepos_t, framepos_t);
828 framecnt_t _samples_ruler_interval;
829 void set_samples_ruler_scale (framepos_t, framepos_t);
839 bbt_show_ticks_detail,
840 bbt_show_ticks_super_detail
843 BBTRulerScale bbt_ruler_scale;
847 uint32_t bbt_bar_helper_on;
848 uint32_t bbt_accent_modulo;
849 void compute_bbt_ruler_scale (framepos_t lower, framepos_t upper);
851 gint metric_get_timecode (GtkCustomRulerMark **, gdouble, gdouble, gint);
852 gint metric_get_bbt (GtkCustomRulerMark **, gdouble, gdouble, gint);
853 gint metric_get_samples (GtkCustomRulerMark **, gdouble, gdouble, gint);
854 gint metric_get_minsec (GtkCustomRulerMark **, gdouble, gdouble, gint);
856 Gtk::Widget *_ruler_separator;
857 GtkWidget *_timecode_ruler;
858 GtkWidget *_bbt_ruler;
859 GtkWidget *_samples_ruler;
860 GtkWidget *_minsec_ruler;
861 Gtk::Widget *timecode_ruler;
862 Gtk::Widget *bbt_ruler;
863 Gtk::Widget *samples_ruler;
864 Gtk::Widget *minsec_ruler;
865 static Editor *ruler_editor;
867 static const double timebar_height;
868 guint32 visible_timebars;
869 gdouble canvas_timebars_vsize;
870 gdouble get_canvas_timebars_vsize () const { return canvas_timebars_vsize; }
871 Gtk::Menu *editor_ruler_menu;
873 ArdourCanvas::SimpleRect* tempo_bar;
874 ArdourCanvas::SimpleRect* meter_bar;
875 ArdourCanvas::SimpleRect* marker_bar;
876 ArdourCanvas::SimpleRect* range_marker_bar;
877 ArdourCanvas::SimpleRect* transport_marker_bar;
878 ArdourCanvas::SimpleRect* cd_marker_bar;
880 Gtk::Label minsec_label;
881 Gtk::Label bbt_label;
882 Gtk::Label timecode_label;
883 Gtk::Label samples_label;
884 Gtk::Label tempo_label;
885 Gtk::Label meter_label;
886 Gtk::Label mark_label;
887 Gtk::Label range_mark_label;
888 Gtk::Label transport_mark_label;
889 Gtk::Label cd_mark_label;
891 Gtk::VBox time_button_vbox;
892 Gtk::HBox time_button_hbox;
894 friend class EditorCursor;
896 EditorCursor* playhead_cursor;
897 ArdourCanvas::Group* cursor_group;
899 framepos_t get_region_boundary (framepos_t pos, int32_t dir, bool with_selection, bool only_onscreen);
901 void cursor_to_region_boundary (bool with_selection, int32_t dir);
902 void cursor_to_next_region_boundary (bool with_selection);
903 void cursor_to_previous_region_boundary (bool with_selection);
904 void cursor_to_next_region_point (EditorCursor*, ARDOUR::RegionPoint);
905 void cursor_to_previous_region_point (EditorCursor*, ARDOUR::RegionPoint);
906 void cursor_to_region_point (EditorCursor*, ARDOUR::RegionPoint, int32_t dir);
907 void cursor_to_selection_start (EditorCursor *);
908 void cursor_to_selection_end (EditorCursor *);
910 void selected_marker_to_region_boundary (bool with_selection, int32_t dir);
911 void selected_marker_to_next_region_boundary (bool with_selection);
912 void selected_marker_to_previous_region_boundary (bool with_selection);
913 void selected_marker_to_next_region_point (ARDOUR::RegionPoint);
914 void selected_marker_to_previous_region_point (ARDOUR::RegionPoint);
915 void selected_marker_to_region_point (ARDOUR::RegionPoint, int32_t dir);
916 void selected_marker_to_selection_start ();
917 void selected_marker_to_selection_end ();
919 void select_all_selectables_using_cursor (EditorCursor *, bool);
920 void select_all_selectables_using_edit (bool);
921 void select_all_selectables_between (bool within);
922 void select_range_between ();
924 boost::shared_ptr<ARDOUR::Region> find_next_region (ARDOUR::framepos_t, ARDOUR::RegionPoint, int32_t dir, TrackViewList&, TimeAxisView ** = 0);
925 ARDOUR::framepos_t find_next_region_boundary (ARDOUR::framepos_t, int32_t dir, const TrackViewList&);
927 std::vector<ARDOUR::framepos_t> region_boundary_cache;
928 void build_region_boundary_cache ();
931 Gtk::HBox bottom_hbox;
933 Gtk::Table edit_packer;
935 Gtk::Adjustment vertical_adjustment;
937 Gtk::Layout controls_layout;
938 bool control_layout_scroll (GdkEventScroll* ev);
939 void reset_controls_layout_width ();
940 void reset_controls_layout_height (int32_t height);
949 bool scroll_press (Direction);
950 void scroll_release ();
951 sigc::connection _scroll_connection;
952 int _scroll_callbacks;
954 double _canvas_width;
955 double _canvas_height; ///< height of the visible area of the track canvas
956 double full_canvas_height; ///< full height of the canvas
958 bool track_canvas_map_handler (GdkEventAny*);
960 bool edit_controls_button_release (GdkEventButton*);
961 Gtk::Menu *edit_controls_left_menu;
962 Gtk::Menu *edit_controls_right_menu;
964 Gtk::VBox ruler_label_vbox;
965 Gtk::VBox track_canvas_vbox;
966 Gtk::VBox time_canvas_vbox;
967 Gtk::VBox edit_controls_vbox;
968 Gtk::HBox edit_controls_hbox;
970 void control_scroll (float);
971 void access_action (std::string,std::string);
972 bool deferred_control_scroll (framepos_t);
973 sigc::connection control_scroll_connection;
975 gdouble get_trackview_group_vertical_offset () const { return vertical_adjustment.get_value () - canvas_timebars_vsize;}
977 ArdourCanvas::Group* get_background_group () const { return _background_group; }
978 ArdourCanvas::Group* get_trackview_group () const { return _trackview_group; }
979 double last_trackview_group_vertical_offset;
980 void tie_vertical_scrolling ();
981 void set_horizontal_position (double);
982 double horizontal_position () const;
983 void scroll_canvas_vertically ();
985 struct VisualChange {
993 framepos_t time_origin;
994 double frames_per_unit;
999 VisualChange() : pending ((VisualChange::Type) 0), time_origin (0), frames_per_unit (0), idle_handler_id (-1) {}
1001 pending = Type (pending | t);
1006 VisualChange pending_visual_change;
1008 static int _idle_visual_changer (void *arg);
1009 int idle_visual_changer ();
1011 void queue_visual_change (framepos_t);
1012 void queue_visual_change (double);
1013 void queue_visual_change_y (double);
1014 void ensure_visual_change_idle_handler ();
1017 TrackViewList track_views;
1018 std::pair<TimeAxisView*, ARDOUR::layer_t> trackview_by_y_position (double);
1019 TimeAxisView* axis_view_from_route (boost::shared_ptr<ARDOUR::Route>) const;
1021 TrackViewList get_tracks_for_range_action () const;
1023 sigc::connection super_rapid_screen_update_connection;
1024 framepos_t last_update_frame;
1025 void center_screen_internal (framepos_t, float);
1027 void super_rapid_screen_update ();
1029 void session_going_away ();
1031 framepos_t cut_buffer_start;
1032 framecnt_t cut_buffer_length;
1034 Gdk::Cursor* pre_press_cursor;
1035 boost::weak_ptr<ARDOUR::Trimmable> _trimmable;
1036 boost::weak_ptr<ARDOUR::Movable> _movable;
1038 bool typed_event (ArdourCanvas::Item*, GdkEvent*, ItemType);
1039 bool button_press_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
1040 bool button_press_handler_1 (ArdourCanvas::Item *, GdkEvent *, ItemType);
1041 bool button_press_handler_2 (ArdourCanvas::Item *, GdkEvent *, ItemType);
1042 bool button_release_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
1043 bool button_press_dispatch (GdkEventButton*);
1044 bool button_release_dispatch (GdkEventButton*);
1045 bool motion_handler (ArdourCanvas::Item*, GdkEvent*, bool from_autoscroll = false);
1046 bool enter_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
1047 bool leave_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
1049 Gtkmm2ext::Bindings* button_bindings;
1050 XMLNode* button_settings () const;
1052 /* KEYMAP HANDLING */
1054 void register_actions ();
1055 void register_region_actions ();
1057 int ensure_cursor (framepos_t* pos);
1059 void cut_copy (Editing::CutCopyOp);
1060 bool can_cut_copy () const;
1061 void cut_copy_points (Editing::CutCopyOp);
1062 void cut_copy_regions (Editing::CutCopyOp, RegionSelection&);
1063 void cut_copy_ranges (Editing::CutCopyOp);
1064 void cut_copy_midi (Editing::CutCopyOp);
1066 void mouse_paste ();
1067 void paste_internal (framepos_t position, float times);
1069 /* EDITING OPERATIONS */
1071 void reset_point_selection ();
1072 void toggle_region_lock ();
1073 void toggle_opaque_region ();
1074 void toggle_record_enable ();
1075 void toggle_region_lock_style ();
1076 void raise_region ();
1077 void raise_region_to_top ();
1078 void change_region_layering_order ();
1079 void lower_region ();
1080 void lower_region_to_bottom ();
1081 void split_regions_at (framepos_t, RegionSelection&);
1082 void split_region_at_transients ();
1083 void split_region_at_points (boost::shared_ptr<ARDOUR::Region>, ARDOUR::AnalysisFeatureList&, bool can_ferret, bool select_new = false);
1084 void crop_region_to_selection ();
1085 void crop_region_to (framepos_t start, framepos_t end);
1086 void set_sync_point (framepos_t, const RegionSelection&);
1087 void set_region_sync_position ();
1088 void remove_region_sync();
1089 void align_regions (ARDOUR::RegionPoint);
1090 void align_regions_relative (ARDOUR::RegionPoint point);
1091 void align_region (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, framepos_t position);
1092 void align_region_internal (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, framepos_t position);
1093 void remove_selected_regions ();
1094 void remove_clicked_region ();
1095 void show_region_properties ();
1096 void show_midi_list_editor ();
1097 void rename_region ();
1098 void duplicate_some_regions (RegionSelection&, float times);
1099 void duplicate_selection (float times);
1100 void region_fill_selection ();
1101 void combine_regions ();
1102 void uncombine_regions ();
1104 void region_fill_track ();
1105 void audition_playlist_region_standalone (boost::shared_ptr<ARDOUR::Region>);
1106 void audition_playlist_region_via_route (boost::shared_ptr<ARDOUR::Region>, ARDOUR::Route&);
1107 void split_multichannel_region();
1108 void reverse_region ();
1109 void strip_region_silence ();
1110 void normalize_region ();
1111 void reset_region_scale_amplitude ();
1112 void adjust_region_gain (bool up);
1113 void quantize_region ();
1114 void insert_patch_change ();
1115 void fork_region ();
1117 void do_insert_time ();
1118 void insert_time (framepos_t, framecnt_t, Editing::InsertTimeOption, bool, bool, bool, bool, bool);
1120 void tab_to_transient (bool forward);
1122 void set_tempo_from_region ();
1123 void use_range_as_bar ();
1125 void define_one_bar (framepos_t start, framepos_t end);
1127 void audition_region_from_region_list ();
1128 void hide_region_from_region_list ();
1129 void show_region_in_region_list ();
1131 void naturalize_region ();
1133 void reset_focus ();
1135 void split_region ();
1139 void paste (float times);
1141 void place_transient ();
1142 void remove_transient (ArdourCanvas::Item* item);
1143 void snap_regions_to_grid ();
1144 void close_region_gaps ();
1146 void keyboard_paste ();
1148 void region_from_selection ();
1149 void create_region_from_selection (std::vector<boost::shared_ptr<ARDOUR::Region> >&);
1151 void play_from_start ();
1152 void play_from_edit_point ();
1153 void play_from_edit_point_and_return ();
1154 void play_selected_region ();
1155 void play_edit_range ();
1156 void play_location (ARDOUR::Location&);
1157 void loop_location (ARDOUR::Location&);
1159 void temporal_zoom_selection ();
1160 void temporal_zoom_region (bool both_axes);
1161 void zoom_to_region (bool both_axes);
1162 void temporal_zoom_session ();
1163 void temporal_zoom (gdouble scale);
1164 void temporal_zoom_by_frame (framepos_t start, framepos_t end, const std::string & op);
1165 void temporal_zoom_to_frame (bool coarser, framepos_t frame);
1167 void insert_region_list_drag (boost::shared_ptr<ARDOUR::Region>, int x, int y);
1168 void insert_region_list_selection (float times);
1170 void insert_route_list_drag (boost::shared_ptr<ARDOUR::Route>, int x, int y);
1172 /* import & embed */
1174 void add_external_audio_action (Editing::ImportMode);
1175 void external_audio_dialog ();
1176 void session_import_dialog ();
1178 int check_whether_and_how_to_import(std::string, bool all_or_nothing = true);
1179 bool check_multichannel_status (const std::vector<std::string>& paths);
1181 SoundFileOmega* sfbrowser;
1183 void bring_in_external_audio (Editing::ImportMode mode, framepos_t& pos);
1185 bool idle_drop_paths (std::vector<std::string> paths, framepos_t frame, double ypos);
1186 void drop_paths_part_two (const std::vector<std::string>& paths, framepos_t frame, double ypos);
1188 int import_sndfiles (std::vector<std::string> paths, Editing::ImportMode mode, ARDOUR::SrcQuality, framepos_t& pos,
1189 int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>&, bool);
1190 int embed_sndfiles (std::vector<std::string> paths, bool multiple_files, bool& check_sample_rate, Editing::ImportMode mode,
1191 framepos_t& pos, int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>&);
1193 int add_sources (std::vector<std::string> paths, ARDOUR::SourceList& sources, framepos_t& pos, Editing::ImportMode,
1194 int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>&, bool add_channel_suffix);
1195 int finish_bringing_in_material (boost::shared_ptr<ARDOUR::Region> region, uint32_t, uint32_t, framepos_t& pos, Editing::ImportMode mode,
1196 boost::shared_ptr<ARDOUR::Track>& existing_track);
1198 boost::shared_ptr<ARDOUR::AudioTrack> get_nth_selected_audio_track (int nth) const;
1199 boost::shared_ptr<ARDOUR::MidiTrack> get_nth_selected_midi_track (int nth) const;
1201 ARDOUR::InterThreadInfo* current_interthread_info;
1203 AnalysisWindow* analysis_window;
1205 /* import specific info */
1207 struct EditorImportStatus : public ARDOUR::ImportStatus {
1208 Editing::ImportMode mode;
1212 boost::shared_ptr<ARDOUR::Track> track;
1216 EditorImportStatus import_status;
1217 static void *_import_thread (void *);
1218 void* import_thread ();
1219 void finish_import ();
1221 /* to support this ... */
1223 void import_audio (bool as_tracks);
1224 void do_import (std::vector<std::string> paths, bool split, bool as_tracks);
1226 void move_to_start ();
1227 void move_to_end ();
1228 void center_playhead ();
1229 void center_edit_point ();
1230 void playhead_forward_to_grid ();
1231 void playhead_backward_to_grid ();
1232 void scroll_playhead (bool forward);
1233 void scroll_backward (float pages=0.8f);
1234 void scroll_forward (float pages=0.8f);
1235 void scroll_tracks_down ();
1236 void scroll_tracks_up ();
1238 void clear_markers ();
1239 void clear_ranges ();
1240 void clear_locations ();
1241 void unhide_markers ();
1242 void unhide_ranges ();
1243 void jump_forward_to_mark ();
1244 void jump_backward_to_mark ();
1245 void cursor_align (bool playhead_to_edit);
1247 void remove_last_capture ();
1248 void select_all_selectables_using_time_selection ();
1249 void select_all_selectables_using_loop();
1250 void select_all_selectables_using_punch();
1251 void set_selection_from_range (ARDOUR::Location&);
1252 void set_selection_from_punch ();
1253 void set_selection_from_loop ();
1254 void set_selection_from_region ();
1256 void add_location_mark (framepos_t where);
1257 void add_location_from_region ();
1258 void add_locations_from_region ();
1259 void add_location_from_selection ();
1260 void set_loop_from_selection (bool play);
1261 void set_punch_from_selection ();
1262 void set_punch_from_region ();
1264 void set_loop_from_edit_range (bool play);
1265 void set_loop_from_region (bool play);
1266 void set_punch_from_edit_range ();
1268 void set_loop_range (framepos_t start, framepos_t end, std::string cmd);
1269 void set_punch_range (framepos_t start, framepos_t end, std::string cmd);
1271 void add_location_from_playhead_cursor ();
1272 bool select_new_marker;
1274 void reverse_selection ();
1275 void edit_envelope ();
1277 double last_scrub_x;
1278 int scrubbing_direction;
1279 int scrub_reversals;
1280 int scrub_reverse_distance;
1281 void scrub (framepos_t, double);
1283 void keyboard_selection_begin ();
1284 void keyboard_selection_finish (bool add);
1285 bool have_pending_keyboard_selection;
1286 framepos_t pending_keyboard_selection_start;
1288 void move_range_selection_start_or_end_to_region_boundary (bool, bool);
1290 Editing::SnapType _snap_type;
1291 Editing::SnapMode _snap_mode;
1293 /// Snap threshold in pixels
1294 double snap_threshold;
1296 bool ignore_gui_changes;
1298 DragManager* _drags;
1302 Gtk::Menu fade_context_menu;
1303 void popup_fade_context_menu (int, int, ArdourCanvas::Item*, ItemType);
1305 void set_fade_in_shape (ARDOUR::FadeShape);
1306 void set_fade_out_shape (ARDOUR::FadeShape);
1308 void set_fade_length (bool in);
1309 void set_fade_in_active (bool);
1310 void set_fade_out_active (bool);
1312 std::set<boost::shared_ptr<ARDOUR::Playlist> > motion_frozen_playlists;
1314 bool _dragging_playhead;
1315 bool _dragging_edit_point;
1317 void marker_drag_motion_callback (GdkEvent*);
1318 void marker_drag_finished_callback (GdkEvent*);
1320 gint mouse_rename_region (ArdourCanvas::Item*, GdkEvent*);
1322 void add_region_drag (ArdourCanvas::Item*, GdkEvent*, RegionView*);
1323 void start_create_region_grab (ArdourCanvas::Item*, GdkEvent*);
1324 void add_region_copy_drag (ArdourCanvas::Item*, GdkEvent*, RegionView*);
1325 void add_region_brush_drag (ArdourCanvas::Item*, GdkEvent*, RegionView*);
1326 void start_selection_grab (ArdourCanvas::Item*, GdkEvent*);
1328 void region_view_item_click (AudioRegionView&, GdkEventButton*);
1330 void remove_gain_control_point (ArdourCanvas::Item*, GdkEvent*);
1331 void remove_control_point (ArdourCanvas::Item*, GdkEvent*);
1333 void mouse_brush_insert_region (RegionView*, framepos_t pos);
1335 /* Canvas event handlers */
1337 bool canvas_control_point_event (GdkEvent* event,ArdourCanvas::Item*, ControlPoint*);
1338 bool canvas_line_event (GdkEvent* event,ArdourCanvas::Item*, AutomationLine*);
1339 bool canvas_selection_rect_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1340 bool canvas_selection_start_trim_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1341 bool canvas_selection_end_trim_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1342 bool canvas_crossfade_view_event (GdkEvent* event,ArdourCanvas::Item*, CrossfadeView*);
1343 bool canvas_fade_in_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1344 bool canvas_fade_in_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1345 bool canvas_fade_out_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1346 bool canvas_fade_out_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1347 bool canvas_region_view_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1348 bool canvas_frame_handle_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1349 bool canvas_region_view_name_highlight_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1350 bool canvas_region_view_name_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1351 bool canvas_feature_line_event (GdkEvent* event, ArdourCanvas::Item*, RegionView*);
1352 bool canvas_stream_view_event (GdkEvent* event,ArdourCanvas::Item*, RouteTimeAxisView*);
1353 bool canvas_marker_event (GdkEvent* event,ArdourCanvas::Item*, Marker*);
1354 bool canvas_zoom_rect_event (GdkEvent* event,ArdourCanvas::Item*);
1355 bool canvas_tempo_marker_event (GdkEvent* event,ArdourCanvas::Item*, TempoMarker*);
1356 bool canvas_meter_marker_event (GdkEvent* event,ArdourCanvas::Item*, MeterMarker*);
1357 bool canvas_automation_track_event(GdkEvent* event, ArdourCanvas::Item*, AutomationTimeAxisView*) ;
1358 bool canvas_note_event (GdkEvent* event, ArdourCanvas::Item*);
1360 bool canvas_tempo_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1361 bool canvas_meter_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1362 bool canvas_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1363 bool canvas_range_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1364 bool canvas_transport_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1365 bool canvas_cd_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1367 bool canvas_imageframe_item_view_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1368 bool canvas_imageframe_view_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameTimeAxis*);
1369 bool canvas_imageframe_start_handle_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1370 bool canvas_imageframe_end_handle_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1371 bool canvas_marker_time_axis_view_event(GdkEvent* event, ArdourCanvas::Item*,MarkerTimeAxis*);
1372 bool canvas_markerview_item_view_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1373 bool canvas_markerview_start_handle_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1374 bool canvas_markerview_end_handle_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1376 PBD::Signal0<void> EditorFreeze;
1377 PBD::Signal0<void> EditorThaw;
1380 friend class DragManager;
1381 friend class EditorRouteGroups;
1382 friend class EditorRegions;
1384 ArdourCanvas::Item *last_item_entered;
1385 /** true if the mouse is over a place where region trim can happen */
1386 bool _over_region_trim_target;
1388 /* non-public event handlers */
1390 bool canvas_playhead_cursor_event (GdkEvent* event, ArdourCanvas::Item*);
1391 bool track_canvas_scroll (GdkEventScroll* event);
1393 bool track_canvas_scroll_event (GdkEventScroll* event);
1394 bool track_canvas_button_press_event (GdkEventButton* event);
1395 bool track_canvas_button_release_event (GdkEventButton* event);
1396 bool track_canvas_motion_notify_event (GdkEventMotion* event);
1398 Gtk::Allocation canvas_allocation;
1399 void track_canvas_allocate (Gtk::Allocation alloc);
1400 bool track_canvas_size_allocated ();
1401 bool track_canvas_drag_motion (Glib::RefPtr<Gdk::DragContext> const &, int, int, guint);
1402 bool track_canvas_key_press (GdkEventKey *);
1403 bool track_canvas_key_release (GdkEventKey *);
1405 void set_playhead_cursor ();
1407 void toggle_region_mute ();
1409 void initialize_canvas ();
1411 /* display control */
1413 bool _show_measures;
1414 /// true if the editor should follow the playhead, otherwise false
1415 bool _follow_playhead;
1416 /// true if we scroll the tracks rather than the playhead
1417 bool _stationary_playhead;
1419 ARDOUR::TempoMap::BBTPointList *current_bbt_points;
1421 TempoLines* tempo_lines;
1423 ArdourCanvas::Group* time_line_group;
1425 void hide_measures ();
1426 void draw_measures ();
1427 bool redraw_measures ();
1429 void new_tempo_section ();
1431 void mouse_add_new_tempo_event (framepos_t where);
1432 void mouse_add_new_meter_event (framepos_t where);
1434 void remove_tempo_marker (ArdourCanvas::Item*);
1435 void remove_meter_marker (ArdourCanvas::Item*);
1436 gint real_remove_tempo_marker (ARDOUR::TempoSection*);
1437 gint real_remove_meter_marker (ARDOUR::MeterSection*);
1439 void edit_tempo_section (ARDOUR::TempoSection*);
1440 void edit_meter_section (ARDOUR::MeterSection*);
1441 void edit_tempo_marker (ArdourCanvas::Item*);
1442 void edit_meter_marker (ArdourCanvas::Item*);
1443 void edit_control_point (ArdourCanvas::Item*);
1444 void edit_note (ArdourCanvas::Item *);
1446 void marker_menu_edit ();
1447 void marker_menu_remove ();
1448 void marker_menu_rename ();
1449 void toggle_marker_menu_lock ();
1450 void toggle_marker_menu_glue ();
1451 void marker_menu_hide ();
1452 void marker_menu_loop_range ();
1453 void marker_menu_select_all_selectables_using_range ();
1454 void marker_menu_select_using_range ();
1455 void marker_menu_separate_regions_using_location ();
1456 void marker_menu_play_from ();
1457 void marker_menu_play_range ();
1458 void marker_menu_set_playhead ();
1459 void marker_menu_set_from_playhead ();
1460 void marker_menu_set_from_selection ();
1461 void marker_menu_range_to_next ();
1462 void new_transport_marker_menu_set_loop ();
1463 void new_transport_marker_menu_set_punch ();
1464 void update_loop_range_view (bool visibility=false);
1465 void update_punch_range_view (bool visibility=false);
1466 void new_transport_marker_menu_popdown ();
1467 void marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1468 void tempo_or_meter_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1469 void transport_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1470 void new_transport_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1471 void build_range_marker_menu (bool);
1472 void build_marker_menu (ARDOUR::Location *);
1473 void build_tempo_or_meter_marker_menu (bool);
1474 void build_new_transport_marker_menu ();
1475 void dynamic_cast_marker_object (void*, MeterMarker**, TempoMarker**) const;
1477 Gtk::Menu* tempo_or_meter_marker_menu;
1478 Gtk::Menu* marker_menu;
1479 Gtk::Menu* range_marker_menu;
1480 Gtk::Menu* transport_marker_menu;
1481 Gtk::Menu* new_transport_marker_menu;
1482 Gtk::Menu* cd_marker_menu;
1483 ArdourCanvas::Item* marker_menu_item;
1485 typedef std::list<Marker*> Marks;
1488 void remove_metric_marks ();
1489 void draw_metric_marks (const ARDOUR::Metrics& metrics);
1491 void compute_current_bbt_points (framepos_t left, framepos_t right);
1492 void tempo_map_changed (const PBD::PropertyChange&);
1493 void redisplay_tempo (bool immediate_redraw);
1495 uint32_t bbt_beat_subdivision;
1499 Gtk::ToggleButton editor_mixer_button;
1500 Gtk::ToggleButton editor_list_button;
1501 void editor_mixer_button_toggled ();
1502 void editor_list_button_toggled ();
1504 AudioClock zoom_range_clock;
1505 Gtk::Button zoom_in_button;
1506 Gtk::Button zoom_out_button;
1507 Gtk::Button zoom_out_full_button;
1508 Gtk::Button zoom_onetoone_button;
1510 Gtk::Button tav_expand_button;
1511 Gtk::Button tav_shrink_button;
1513 Gtk::VBox toolbar_clock_vbox;
1514 Gtk::VBox toolbar_selection_clock_vbox;
1515 Gtk::Table toolbar_selection_clock_table;
1516 Gtk::Label toolbar_selection_cursor_label;
1518 Gtkmm2ext::TearOff* _mouse_mode_tearoff;
1519 Gtkmm2ext::StatefulToggleButton mouse_select_button;
1520 Gtkmm2ext::StatefulToggleButton mouse_move_button;
1521 Gtkmm2ext::StatefulToggleButton mouse_gain_button;
1522 Gtkmm2ext::StatefulToggleButton mouse_zoom_button;
1523 Gtkmm2ext::StatefulToggleButton mouse_timefx_button;
1524 Gtkmm2ext::StatefulToggleButton mouse_audition_button;
1525 Gtkmm2ext::StatefulToggleButton join_object_range_button;
1527 void mouse_mode_toggled (Editing::MouseMode m);
1528 void mouse_mode_object_range_toggled () {}
1529 bool ignore_mouse_mode_toggle;
1531 Gtkmm2ext::StatefulToggleButton internal_edit_button;
1532 void toggle_internal_editing ();
1534 bool mouse_select_button_release (GdkEventButton*);
1536 Gtk::VBox automation_box;
1537 Gtk::Button automation_mode_button;
1538 Gtk::ToggleButton global_automation_button;
1540 Gtk::ComboBoxText edit_mode_selector;
1541 Gtk::VBox edit_mode_box;
1542 std::vector<std::string> edit_mode_strings;
1544 void set_edit_mode (ARDOUR::EditMode);
1545 void cycle_edit_mode ();
1546 void edit_mode_selection_done ();
1548 Gtk::ComboBoxText snap_type_selector;
1549 Gtk::ComboBoxText snap_mode_selector;
1552 std::vector<std::string> snap_type_strings;
1553 std::vector<std::string> snap_mode_strings;
1555 void snap_type_selection_done ();
1556 void snap_mode_selection_done ();
1557 void snap_mode_chosen (Editing::SnapMode);
1558 void snap_type_chosen (Editing::SnapType);
1560 Glib::RefPtr<Gtk::RadioAction> snap_type_action (Editing::SnapType);
1561 Glib::RefPtr<Gtk::RadioAction> snap_mode_action (Editing::SnapMode);
1563 Gtk::ComboBoxText zoom_focus_selector;
1564 Gtk::VBox zoom_focus_box;
1566 std::vector<std::string> zoom_focus_strings;
1568 void zoom_focus_selection_done ();
1569 void zoom_focus_chosen (Editing::ZoomFocus);
1571 Glib::RefPtr<Gtk::RadioAction> zoom_focus_action (Editing::ZoomFocus);
1573 Gtk::HBox _zoom_box;
1574 Gtkmm2ext::TearOff* _zoom_tearoff;
1575 void zoom_adjustment_changed();
1577 void setup_toolbar ();
1579 void setup_tooltips ();
1581 Gtkmm2ext::TearOff* _tools_tearoff;
1582 Gtk::HBox toolbar_hbox;
1583 Gtk::EventBox toolbar_base;
1584 Gtk::Frame toolbar_frame;
1585 Gtk::Viewport _toolbar_viewport;
1589 Gtk::HBox panic_box;
1590 Gtk::Button midi_panic_button;
1591 Gtk::ToggleButton midi_sound_notes;
1593 bool sound_notes () const { return midi_sound_notes.get_active(); }
1595 void setup_midi_toolbar ();
1597 /* selection process */
1599 Selection* selection;
1600 Selection* cut_buffer;
1602 void time_selection_changed ();
1603 void track_selection_changed ();
1604 void region_selection_changed ();
1605 sigc::connection editor_regions_selection_changed_connection;
1606 void sensitize_all_region_actions (bool);
1607 void sensitize_the_right_region_actions ();
1608 bool _all_region_actions_sensitized;
1609 /** Flag to block region action handlers from doing what they normally do;
1610 * I tried Gtk::Action::block_activate() but this doesn't work (ie it doesn't
1611 * block) when setting a ToggleAction's active state.
1613 bool _ignore_region_action;
1614 bool _last_region_menu_was_main;
1615 void point_selection_changed ();
1616 void marker_selection_changed ();
1618 void cancel_selection ();
1620 bool audio_region_selection_covers (framepos_t where);
1622 /* transport range select process */
1624 ArdourCanvas::SimpleRect* cd_marker_bar_drag_rect;
1625 ArdourCanvas::SimpleRect* range_bar_drag_rect;
1626 ArdourCanvas::SimpleRect* transport_bar_drag_rect;
1629 ArdourCanvas::SimpleRect *bogus_background_rect;
1631 ArdourCanvas::SimpleRect *transport_bar_range_rect;
1632 ArdourCanvas::SimpleRect *transport_bar_preroll_rect;
1633 ArdourCanvas::SimpleRect *transport_bar_postroll_rect;
1634 ArdourCanvas::SimpleRect *transport_loop_range_rect;
1635 ArdourCanvas::SimpleRect *transport_punch_range_rect;
1636 ArdourCanvas::SimpleLine *transport_punchin_line;
1637 ArdourCanvas::SimpleLine *transport_punchout_line;
1638 ArdourCanvas::SimpleRect *transport_preroll_rect;
1639 ArdourCanvas::SimpleRect *transport_postroll_rect;
1641 ARDOUR::Location* transport_loop_location();
1642 ARDOUR::Location* transport_punch_location();
1644 ARDOUR::Location *temp_location;
1646 /* object rubberband select process */
1648 void select_all_within (framepos_t, framepos_t, double, double, TrackViewList const &, Selection::Operation, bool);
1650 ArdourCanvas::SimpleRect *rubberband_rect;
1652 /* mouse zoom process */
1654 ArdourCanvas::SimpleRect *zoom_rect;
1655 void reposition_zoom_rect (framepos_t start, framepos_t end);
1657 EditorRouteGroups* _route_groups;
1658 EditorRoutes* _routes;
1659 EditorRegions* _regions;
1660 EditorSnapshots* _snapshots;
1661 EditorLocations* _locations;
1663 /* diskstream/route display management */
1664 Glib::RefPtr<Gdk::Pixbuf> rec_enabled_icon;
1665 Glib::RefPtr<Gdk::Pixbuf> rec_disabled_icon;
1667 Glib::RefPtr<Gtk::TreeSelection> route_display_selection;
1669 bool sync_track_view_list_and_routes ();
1671 Gtk::VBox list_vpacker;
1675 bool autoscroll_active;
1676 int autoscroll_timeout_tag;
1679 int last_autoscroll_x;
1680 int last_autoscroll_y;
1681 uint32_t autoscroll_cnt;
1682 framecnt_t autoscroll_x_distance;
1683 double autoscroll_y_distance;
1685 static gint _autoscroll_canvas (void *);
1686 bool autoscroll_canvas ();
1687 void start_canvas_autoscroll (int x, int y);
1688 void stop_canvas_autoscroll ();
1691 void point_trim (GdkEvent *, framepos_t);
1693 void trim_region_front();
1694 void trim_region_back();
1695 void trim_region (bool front);
1697 void trim_region_to_loop ();
1698 void trim_region_to_punch ();
1699 void trim_region_to_location (const ARDOUR::Location&, const char* cmd);
1701 void trim_to_region(bool forward);
1702 void trim_region_to_previous_region_end();
1703 void trim_region_to_next_region_start();
1705 bool show_gain_after_trim;
1709 int convert_drop_to_paths (
1710 std::vector<std::string>& paths,
1711 const Glib::RefPtr<Gdk::DragContext>& context,
1714 const Gtk::SelectionData& data,
1718 void track_canvas_drag_data_received (
1719 const Glib::RefPtr<Gdk::DragContext>& context,
1722 const Gtk::SelectionData& data,
1727 const Glib::RefPtr<Gdk::DragContext>& context,
1730 const Gtk::SelectionData& data,
1735 const Glib::RefPtr<Gdk::DragContext>& context,
1738 const Gtk::SelectionData& data,
1743 const Glib::RefPtr<Gdk::DragContext>& context,
1746 const Gtk::SelectionData& data,
1752 int write_region_selection(RegionSelection&);
1753 bool write_region (std::string path, boost::shared_ptr<ARDOUR::AudioRegion>);
1754 void bounce_region_selection (bool with_processing);
1755 void bounce_range_selection (bool replace, bool enable_processing);
1756 void external_edit_region ();
1758 int write_audio_selection (TimeSelection&);
1759 bool write_audio_range (ARDOUR::AudioPlaylist&, const ARDOUR::ChanCount& channels, std::list<ARDOUR::AudioRange>&);
1761 void write_selection ();
1763 XMLNode *before; /* used in *_reversible_command */
1765 void update_title ();
1766 void update_title_s (const std::string & snapshot_name);
1769 Selection* selection;
1770 double frames_per_unit;
1772 State (PublicEditor const * e);
1776 void instant_save ();
1778 boost::shared_ptr<ARDOUR::AudioRegion> last_audition_region;
1780 /* freeze operations */
1782 ARDOUR::InterThreadInfo freeze_status;
1783 static void* _freeze_thread (void*);
1784 void* freeze_thread ();
1786 void freeze_route ();
1787 void unfreeze_route ();
1791 void duplicate_dialog (bool with_dialog);
1793 framepos_t event_frame (GdkEvent const *, double* px = 0, double* py = 0) const;
1795 /* returns false if mouse pointer is not in track or marker canvas
1797 bool mouse_frame (framepos_t&, bool& in_track_canvas) const;
1799 /* "whats mine is yours" */
1801 TimeFXDialog* current_timefx;
1803 static void* timefx_thread (void *arg);
1804 void do_timefx (TimeFXDialog&);
1806 int time_stretch (RegionSelection&, float fraction);
1807 int pitch_shift (RegionSelection&, float cents);
1808 void pitch_shift_region ();
1809 int time_fx (RegionSelection&, float val, bool pitching);
1811 void transpose_region ();
1813 /* editor-mixer strip */
1815 MixerStrip *current_mixer_strip;
1816 bool show_editor_mixer_when_tracks_arrive;
1817 Gtk::VBox current_mixer_strip_vbox;
1818 void cms_new (boost::shared_ptr<ARDOUR::Route>);
1819 void current_mixer_strip_hidden ();
1821 void detach_tearoff (Gtk::Box* b, Gtk::Window* w);
1822 void reattach_tearoff (Gtk::Box* b, Gtk::Window* w, int32_t n);
1824 void ensure_all_elements_drawn ();
1826 /* nudging tracks */
1828 void nudge_track (bool use_edit_point, bool forwards);
1832 bool _xfade_visibility;
1835 void handle_new_imageframe_time_axis_view(const std::string & track_name, void* src) ;
1836 void handle_new_imageframe_marker_time_axis_view(const std::string & track_name, TimeAxisView* marked_track) ;
1838 void start_imageframe_grab(ArdourCanvas::Item*, GdkEvent*) ;
1839 void start_markerview_grab(ArdourCanvas::Item*, GdkEvent*) ;
1841 void imageframe_drag_motion_callback(ArdourCanvas::Item*, GdkEvent*) ;
1842 void markerview_drag_motion_callback(ArdourCanvas::Item*, GdkEvent*) ;
1843 void timeaxis_item_drag_finished_callback(ArdourCanvas::Item*, GdkEvent*) ;
1845 gint canvas_imageframe_item_view_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameView* ifv);
1846 gint canvas_imageframe_view_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameTimeAxis* ifta);
1847 gint canvas_imageframe_start_handle_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameView* ifv);
1848 gint canvas_imageframe_end_handle_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameView* ifv);
1850 gint canvas_marker_time_axis_view_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerTimeAxis* mta);
1851 gint canvas_markerview_item_view_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerView* mv);
1852 gint canvas_markerview_start_handle_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerView* mv);
1853 gint canvas_markerview_end_handle_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerView* mv);
1855 void imageframe_start_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1856 void imageframe_end_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1857 void imageframe_start_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1858 void imageframe_start_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1859 void imageframe_end_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1860 void imageframe_end_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1862 void markerview_item_start_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1863 void markerview_item_end_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1864 void markerview_start_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1865 void markerview_start_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1866 void markerview_end_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1867 void markerview_end_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1869 void popup_imageframe_edit_menu(int button, int32_t time, ArdourCanvas::Item* ifv, bool with_frame) ;
1870 void popup_marker_time_axis_edit_menu(int button, int32_t time, ArdourCanvas::Item* ifv, bool with_frame) ;
1872 ImageFrameSocketHandler* image_socket_listener ;
1875 void toggle_xfade_active (boost::weak_ptr<ARDOUR::Crossfade>);
1876 void toggle_xfade_length (boost::weak_ptr<ARDOUR::Crossfade>);
1877 void edit_xfade (boost::weak_ptr<ARDOUR::Crossfade>);
1878 void xfade_edit_left_region ();
1879 void xfade_edit_right_region ();
1881 static const int32_t default_width = 995;
1882 static const int32_t default_height = 765;
1886 Gtk::Button nudge_forward_button;
1887 Gtk::Button nudge_backward_button;
1888 Gtk::HBox nudge_hbox;
1889 Gtk::VBox nudge_vbox;
1890 AudioClock nudge_clock;
1892 bool nudge_forward_release (GdkEventButton*);
1893 bool nudge_backward_release (GdkEventButton*);
1897 void apply_filter (ARDOUR::Filter&, std::string cmd, ProgressReporter* progress = 0);
1899 Command* apply_midi_note_edit_op_to_region (ARDOUR::MidiOperator& op, MidiRegionView& mrv);
1900 void apply_midi_note_edit_op (ARDOUR::MidiOperator& op);
1902 /* handling cleanup */
1904 int playlist_deletion_dialog (boost::shared_ptr<ARDOUR::Playlist>);
1906 PBD::ScopedConnectionList session_connections;
1908 /* tracking step changes of track height */
1910 TimeAxisView* current_stepping_trackview;
1911 ARDOUR::microseconds_t last_track_height_step_timestamp;
1912 gint track_height_step_timeout();
1913 sigc::connection step_timeout;
1915 TimeAxisView* entered_track;
1916 /** If the mouse is over a RegionView or one of its child canvas items, this is set up
1917 to point to the RegionView. Otherwise it is 0.
1919 RegionView* entered_regionview;
1922 void ensure_entered_track_selected (bool op_acts_on_objects = false);
1923 bool clear_entered_track;
1924 bool left_track_canvas (GdkEventCrossing*);
1925 bool entered_track_canvas (GdkEventCrossing*);
1926 void set_entered_track (TimeAxisView*);
1927 void set_entered_regionview (RegionView*);
1928 void ensure_track_visible (TimeAxisView*);
1929 gint left_automation_track ();
1931 void reset_canvas_action_sensitivity (bool);
1932 void toggle_gain_envelope_visibility ();
1933 void toggle_gain_envelope_active ();
1934 void reset_region_gain_envelopes ();
1936 bool on_key_press_event (GdkEventKey*);
1937 bool on_key_release_event (GdkEventKey*);
1939 void session_state_saved (std::string);
1941 Glib::RefPtr<Gtk::Action> undo_action;
1942 Glib::RefPtr<Gtk::Action> redo_action;
1944 void history_changed ();
1946 Gtk::HBox status_bar_hpacker;
1948 Editing::EditPoint _edit_point;
1950 Gtk::ComboBoxText edit_point_selector;
1952 void set_edit_point_preference (Editing::EditPoint ep, bool force = false);
1953 void cycle_edit_point (bool with_marker);
1954 void set_edit_point ();
1955 void edit_point_selection_done ();
1956 void edit_point_chosen (Editing::EditPoint);
1957 Glib::RefPtr<Gtk::RadioAction> edit_point_action (Editing::EditPoint);
1958 std::vector<std::string> edit_point_strings;
1960 void selected_marker_moved (ARDOUR::Location*);
1962 bool get_edit_op_range (framepos_t& start, framepos_t& end) const;
1964 void get_regions_at (RegionSelection&, framepos_t where, const TrackViewList& ts) const;
1965 void get_regions_after (RegionSelection&, framepos_t where, const TrackViewList& ts) const;
1967 RegionSelection get_regions_from_selection ();
1968 RegionSelection get_regions_from_selection_and_edit_point ();
1969 RegionSelection get_regions_from_selection_and_entered ();
1971 void start_updating_meters ();
1972 void stop_updating_meters ();
1973 bool meters_running;
1975 void select_next_route ();
1976 void select_prev_route ();
1978 void snap_to_internal (framepos_t& first, int32_t direction = 0, bool for_mark = false);
1979 void timecode_snap_to_internal (framepos_t& first, int32_t direction = 0, bool for_mark = false);
1981 RhythmFerret* rhythm_ferret;
1983 void fit_tracks (TrackViewList &);
1984 void fit_selected_tracks ();
1985 void set_track_height (Height);
1987 void remove_tracks ();
1988 void toggle_tracks_active ();
1992 static gboolean _idle_resize (gpointer);
1994 int32_t _pending_resize_amount;
1995 TimeAxisView* _pending_resize_view;
1997 void visible_order_range (int*, int*) const;
2001 /** true if we've made a locate request that hasn't yet been processed */
2002 bool _pending_locate_request;
2004 /** if true, there is a pending Session locate which is the initial one when loading a session;
2005 we need to know this so that we don't (necessarily) set the viewport to show the playhead
2008 bool _pending_initial_locate;
2010 Gtk::HBox _summary_hbox;
2011 EditorSummary* _summary;
2013 void region_view_added (RegionView *);
2014 void region_view_removed ();
2016 void update_canvas_now ();
2018 EditorGroupTabs* _group_tabs;
2019 void fit_route_group (ARDOUR::RouteGroup *);
2021 void step_edit_status_change (bool);
2022 void start_step_editing ();
2023 void stop_step_editing ();
2024 bool check_step_edit ();
2025 sigc::connection step_edit_connection;
2027 double _last_motion_y;
2029 RegionLayeringOrderEditor* layering_order_editor;
2030 void update_region_layering_order_editor ();
2032 /** Track that was the source for the last cut/copy operation. Used as a place
2033 to paste things iff there is no selected track.
2035 TimeAxisView* _last_cut_copy_source_track;
2037 /** true if a change in Selection->regions should change the selection in the region list.
2038 See EditorRegions::selection_changed.
2040 bool _region_selection_change_updates_region_list;
2042 void setup_fade_images ();
2043 std::map<ARDOUR::FadeShape, Gtk::Image*> _fade_in_images;
2044 std::map<ARDOUR::FadeShape, Gtk::Image*> _fade_out_images;
2046 Gtk::MenuItem& action_menu_item (std::string const &);
2047 void action_pre_activated (Glib::RefPtr<Gtk::Action> const &);
2049 void set_canvas_cursor_for_region_view (double, RegionView *);
2051 MouseCursors* _cursors;
2053 void resize_text_widgets ();
2056 friend class RegionDrag;
2057 friend class RegionMoveDrag;
2058 friend class RegionSpliceDrag;
2059 friend class TrimDrag;
2060 friend class MeterMarkerDrag;
2061 friend class TempoMarkerDrag;
2062 friend class CursorDrag;
2063 friend class FadeInDrag;
2064 friend class FadeOutDrag;
2065 friend class MarkerDrag;
2066 friend class RegionGainDrag;
2067 friend class ControlPointDrag;
2068 friend class LineDrag;
2069 friend class RubberbandSelectDrag;
2070 friend class TimeFXDrag;
2071 friend class ScrubDrag;
2072 friend class SelectionDrag;
2073 friend class RangeMarkerBarDrag;
2074 friend class MouseZoomDrag;
2075 friend class RegionCreateDrag;
2076 friend class RegionMotionDrag;
2077 friend class RegionInsertDrag;
2079 friend class EditorSummary;
2080 friend class EditorGroupTabs;
2082 friend class EditorRoutes;
2083 friend class RhythmFerret;
2086 #endif /* __ardour_editor_h__ */