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;
134 /* <CMT Additions> */
135 class ImageFrameView;
136 class ImageFrameTimeAxisView;
137 class ImageFrameTimeAxis;
138 class MarkerTimeAxis ;
140 class ImageFrameSocketHandler ;
141 class TimeAxisViewItem ;
142 /* </CMT Additions> */
144 class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARDOUR::SessionHandlePtr
150 void set_session (ARDOUR::Session *);
151 ARDOUR::Session* session() const { return _session; }
154 virtual bool have_idled () const { return _have_idled; }
156 framepos_t leftmost_position() const { return leftmost_frame; }
158 framecnt_t current_page_frames() const {
159 return (framecnt_t) floor (_canvas_width * frames_per_unit);
162 double canvas_height () const {
163 return _canvas_height;
166 void cycle_snap_mode ();
167 void cycle_snap_choice ();
168 void set_snap_to (Editing::SnapType);
169 void set_snap_mode (Editing::SnapMode);
170 void set_snap_threshold (double pixel_distance) {snap_threshold = pixel_distance;}
172 Editing::SnapMode snap_mode () const;
173 Editing::SnapType snap_type () const;
175 void undo (uint32_t n = 1);
176 void redo (uint32_t n = 1);
178 XMLNode& get_state ();
179 int set_state (const XMLNode&, int version);
181 void set_mouse_mode (Editing::MouseMode, bool force=true);
182 void step_mouse_mode (bool next);
183 Editing::MouseMode current_mouse_mode () const { return mouse_mode; }
184 Editing::MidiEditMode current_midi_edit_mode () const;
185 void remove_midi_note (ArdourCanvas::Item *, GdkEvent *);
187 bool internal_editing() const { return _internal_editing ; }
188 void set_internal_edit (bool yn);
191 void add_imageframe_time_axis(const std::string & track_name, void*) ;
192 void add_imageframe_marker_time_axis(const std::string & track_name, TimeAxisView* marked_track, void*) ;
193 void connect_to_image_compositor() ;
194 void scroll_timeaxis_to_imageframe_item(const TimeAxisViewItem* item) ;
195 TimeAxisView* get_named_time_axis(const std::string & name) ;
196 #endif /* WITH_CMT */
198 void foreach_time_axis_view (sigc::slot<void,TimeAxisView&>);
199 void add_to_idle_resize (TimeAxisView*, int32_t);
201 RouteTimeAxisView* get_route_view_by_route_id (PBD::ID& id) const;
203 void consider_auditioning (boost::shared_ptr<ARDOUR::Region>);
204 void hide_a_region (boost::shared_ptr<ARDOUR::Region>);
205 void show_a_region (boost::shared_ptr<ARDOUR::Region>);
207 #ifdef USE_RUBBERBAND
208 std::vector<std::string> rb_opt_strings;
212 /* things that need to be public to be used in the main menubar */
214 void new_region_from_selection ();
215 void separate_regions_between (const TimeSelection&);
216 void separate_region_from_selection ();
217 void separate_under_selected_regions ();
218 void separate_region_from_punch ();
219 void separate_region_from_loop ();
220 void separate_regions_using_location (ARDOUR::Location&);
221 void transition_to_rolling (bool forward);
225 framepos_t unit_to_frame (double unit) const {
226 return (framepos_t) rint (unit * frames_per_unit);
229 double frame_to_unit (framepos_t frame) const {
230 return rint ((double) frame / (double) frames_per_unit);
233 double frame_to_unit (double frame) const {
234 return rint (frame / frames_per_unit);
237 /* NOTE: these functions assume that the "pixel" coordinate is
238 the result of using the world->canvas affine transform on a
239 world coordinate. These coordinates already take into
240 account any scrolling carried out by adjusting the
244 framepos_t pixel_to_frame (double pixel) const {
246 /* pixel can be less than zero when motion events
247 are processed. since we've already run the world->canvas
248 affine, that means that the location *really* is "off
249 to the right" and thus really is "before the start".
253 return (framepos_t) rint (pixel * frames_per_unit * GNOME_CANVAS(track_canvas->gobj())->pixels_per_unit);
259 gulong frame_to_pixel (framepos_t frame) const {
260 return (gulong) rint ((frame / (frames_per_unit * GNOME_CANVAS(track_canvas->gobj())->pixels_per_unit)));
263 void flush_canvas ();
267 Selection& get_selection() const { return *selection; }
268 Selection& get_cut_buffer() const { return *cut_buffer; }
270 bool extend_selection_to_track (TimeAxisView&);
272 void play_selection ();
273 void select_all_in_track (Selection::Operation op);
274 void select_all (Selection::Operation op);
275 void invert_selection_in_track ();
276 void invert_selection ();
277 void deselect_all ();
279 void set_selected_regionview_from_region_list (boost::shared_ptr<ARDOUR::Region> region, Selection::Operation op = Selection::Set);
283 void set_show_measures (bool yn);
284 bool show_measures () const { return _show_measures; }
286 /* analysis window */
288 void analyze_region_selection();
289 void analyze_range_selection();
293 void export_audio ();
294 void export_selection ();
295 void export_range ();
296 void export_region ();
298 void add_toplevel_controls (Gtk::Container&);
299 Gtk::HBox& get_status_bar_packer() { return status_bar_hpacker; }
301 void set_zoom_focus (Editing::ZoomFocus);
302 Editing::ZoomFocus get_zoom_focus () const { return zoom_focus; }
303 double get_current_zoom () const { return frames_per_unit; }
305 void temporal_zoom_step (bool coarser);
306 void tav_zoom_step (bool coarser);
308 /* stuff that AudioTimeAxisView and related classes use */
310 PlaylistSelector& playlist_selector() const;
311 void clear_playlist (boost::shared_ptr<ARDOUR::Playlist>);
313 void new_playlists (TimeAxisView* v);
314 void copy_playlists (TimeAxisView* v);
315 void clear_playlists (TimeAxisView* v);
317 void get_onscreen_tracks (TrackViewList&);
319 Width editor_mixer_strip_width;
320 void maybe_add_mixer_strip_width (XMLNode&);
321 void show_editor_mixer (bool yn);
322 void create_editor_mixer ();
323 void show_editor_list (bool yn);
324 void set_selected_mixer_strip (TimeAxisView&);
325 void mixer_strip_width_changed ();
326 void hide_track_in_display (TimeAxisView* tv, bool temporary = false);
328 /* nudge is initiated by transport controls owned by ARDOUR_UI */
330 framecnt_t get_nudge_distance (framepos_t pos, framecnt_t& next);
331 Evoral::MusicalTime get_grid_type_as_beats (bool& success, framepos_t position);
333 void nudge_forward (bool next, bool force_playhead);
334 void nudge_backward (bool next, bool force_playhead);
336 /* nudge initiated from context menu */
338 void nudge_forward_capture_offset ();
339 void nudge_backward_capture_offset ();
341 /* playhead/screen stuff */
343 void set_stationary_playhead (bool yn);
344 void toggle_stationary_playhead ();
345 bool stationary_playhead() const { return _stationary_playhead; }
347 void set_follow_playhead (bool yn, bool catch_up = true);
348 void toggle_follow_playhead ();
349 bool follow_playhead() const { return _follow_playhead; }
350 bool dragging_playhead () const { return _dragging_playhead; }
352 void toggle_zero_line_visibility ();
354 void set_group_tabs ();
355 void toggle_measure_visibility ();
356 void toggle_logo_visibility ();
360 void toggle_region_fades (int dir);
361 void update_region_fade_visibility ();
362 bool xfade_visibility() const { return _xfade_visibility; }
363 void update_xfade_visibility ();
365 /* redirect shared ops menu. caller must free returned menu */
367 Gtk::Menu* redirect_menu ();
369 /* floating windows/transient */
371 void ensure_float (Gtk::Window&);
375 void scroll_tracks_down_line ();
376 void scroll_tracks_up_line ();
378 void prepare_for_cleanup ();
379 void finish_cleanup ();
381 void maximise_editing_space();
382 void restore_editing_space();
384 void reset_x_origin (framepos_t);
385 void reset_x_origin_to_follow_playhead ();
386 void reset_y_origin (double);
387 void reset_zoom (double);
388 void reposition_and_zoom (framepos_t, double);
390 framepos_t get_preferred_edit_position (bool ignore_playhead = false);
392 bool update_mouse_speed ();
393 bool decelerate_mouse_speed ();
395 void toggle_meter_updating();
397 void show_rhythm_ferret();
399 void goto_visual_state (uint32_t);
400 void save_visual_state (uint32_t);
402 void queue_draw_resize_line (int at);
403 void start_resize_line_ops ();
404 void end_resize_line_ops ();
406 TrackViewList const & get_track_views () {
410 int get_regionview_count_from_region_list (boost::shared_ptr<ARDOUR::Region>);
412 void do_import (std::vector<std::string> paths, Editing::ImportDisposition, Editing::ImportMode mode, ARDOUR::SrcQuality, framepos_t&);
413 void do_embed (std::vector<std::string> paths, Editing::ImportDisposition, Editing::ImportMode mode, framepos_t&);
415 void get_regions_corresponding_to (boost::shared_ptr<ARDOUR::Region> region, std::vector<RegionView*>& regions);
417 void show_verbose_canvas_cursor_with (const std::string& txt, int32_t xoffset = 0, int32_t yoffset = 0);
418 void hide_verbose_canvas_cursor();
420 void center_screen (framepos_t);
422 TrackViewList axis_views_from_routes (boost::shared_ptr<ARDOUR::RouteList>) const;
423 Gtkmm2ext::TearOff* mouse_mode_tearoff () const { return _mouse_mode_tearoff; }
424 Gtkmm2ext::TearOff* tools_tearoff () const { return _tools_tearoff; }
426 void snap_to (framepos_t& first, int32_t direction = 0, bool for_mark = false);
427 void snap_to_with_modifier (framepos_t& first, GdkEvent const *, int32_t direction = 0, bool for_mark = false);
428 void snap_to (framepos_t& first, framepos_t& last, int32_t direction = 0, bool for_mark = false);
430 void begin_reversible_command (std::string cmd_name);
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 {
449 void map_transport_state ();
450 void map_position_change (framepos_t);
456 void color_handler ();
460 // to keep track of the playhead position for control_scroll
461 boost::optional<framepos_t> _control_scroll_target;
463 PlaylistSelector* _playlist_selector;
465 typedef std::pair<TimeAxisView*,XMLNode*> TAVState;
469 double frames_per_unit;
470 framepos_t leftmost_frame;
471 Editing::ZoomFocus zoom_focus;
472 std::list<TAVState> track_states;
475 std::list<VisualState*> undo_visual_stack;
476 std::list<VisualState*> redo_visual_stack;
477 VisualState* current_visual_state (bool with_tracks = true);
478 void undo_visual_state ();
479 void redo_visual_state ();
480 void use_visual_state (VisualState&);
482 void swap_visual_state ();
484 std::vector<VisualState*> visual_states;
485 sigc::connection visual_state_op_connection;
486 void start_visual_state_op (uint32_t n);
487 void cancel_visual_state_op (uint32_t n);
488 bool end_visual_state_op (uint32_t n);
490 framepos_t leftmost_frame;
491 double frames_per_unit;
492 Editing::ZoomFocus zoom_focus;
494 void set_frames_per_unit (double);
497 Editing::MouseMode mouse_mode;
498 bool _internal_editing;
499 Editing::MouseMode effective_mouse_mode () const;
501 enum JoinObjectRangeState {
502 JOIN_OBJECT_RANGE_NONE,
503 /** `join object/range' mode is active and the mouse is over a place where object mode should happen */
504 JOIN_OBJECT_RANGE_OBJECT,
505 /** `join object/range' mode is active and the mouse is over a place where range mode should happen */
506 JOIN_OBJECT_RANGE_RANGE
509 JoinObjectRangeState _join_object_range_state;
511 void update_join_object_range_location (double, double);
513 int post_maximal_editor_width;
514 int post_maximal_editor_height;
515 int post_maximal_horizontal_pane_position;
516 int post_maximal_vertical_pane_position;
517 int pre_maximal_horizontal_pane_position;
518 int pre_maximal_vertical_pane_position;
519 int pre_maximal_editor_width;
520 int pre_maximal_editor_height;
521 void pane_allocation_handler (Gtk::Allocation&, Gtk::Paned*);
523 Gtk::Notebook _the_notebook;
524 bool _notebook_shrunk;
525 void add_notebook_page (std::string const &, Gtk::Widget &);
526 bool notebook_tab_clicked (GdkEventButton *, Gtk::Widget *);
528 Gtk::HPaned edit_pane;
529 Gtk::VPaned editor_summary_pane;
531 Gtk::EventBox meter_base;
533 Gtk::EventBox marker_base;
534 Gtk::HBox marker_box;
535 Gtk::VBox scrollers_rulers_markers_box;
537 void location_changed (ARDOUR::Location *);
538 void location_flags_changed (ARDOUR::Location *, void *);
539 void refresh_location_display ();
540 void refresh_location_display_s (const PBD::PropertyChange&);
541 void refresh_location_display_internal (ARDOUR::Locations::LocationList&);
542 void add_new_location (ARDOUR::Location *);
543 void location_gone (ARDOUR::Location *);
544 void remove_marker (ArdourCanvas::Item&, GdkEvent*);
545 gint really_remove_marker (ARDOUR::Location* loc);
546 void goto_nth_marker (int nth);
547 void toggle_marker_lines ();
548 void set_marker_line_visibility (bool);
550 uint32_t location_marker_color;
551 uint32_t location_range_color;
552 uint32_t location_loop_color;
553 uint32_t location_punch_color;
554 uint32_t location_cd_marker_color;
556 struct LocationMarkers {
561 LocationMarkers () : start(0), end(0), valid (true) {}
568 void set_show_lines (bool);
569 void set_selected (bool);
570 void canvas_height_set (double);
573 void set_name (const std::string&);
574 void set_position (framepos_t start, framepos_t end = 0);
575 void set_color_rgba (uint32_t);
578 LocationMarkers *find_location_markers (ARDOUR::Location *) const;
579 ARDOUR::Location* find_location_from_marker (Marker *, bool& is_start) const;
580 Marker* entered_marker;
581 bool _show_marker_lines;
583 typedef std::map<ARDOUR::Location*,LocationMarkers *> LocationMarkerMap;
584 LocationMarkerMap location_markers;
586 void update_marker_labels ();
587 void update_marker_labels (ArdourCanvas::Group *);
588 void check_marker_label (Marker *);
590 /** A set of lists of Markers that are in each of the canvas groups
591 * for the marker sections at the top of the editor. These lists
592 * are kept sorted in time order between marker movements, so that after
593 * a marker has moved we can decide whether we need to update the labels
594 * for all markers or for just a few.
596 std::map<ArdourCanvas::Group *, std::list<Marker *> > _sorted_marker_lists;
597 void remove_sorted_marker (Marker *);
599 void hide_marker (ArdourCanvas::Item*, GdkEvent*);
600 void clear_marker_display ();
601 void mouse_add_new_marker (framepos_t where, bool is_cd=false, bool is_xrun=false);
602 bool choose_new_marker_name(std::string &name);
603 void update_cd_marker_display ();
604 void ensure_cd_marker_updated (LocationMarkers * lam, ARDOUR::Location * location);
606 TimeAxisView* clicked_axisview;
607 RouteTimeAxisView* clicked_routeview;
608 /** The last RegionView that was clicked on, or 0 if the last click was not
609 * on a RegionView. This is set up by the canvas event handlers in
610 * editor_canvas_events.cc
612 RegionView* clicked_regionview;
613 RegionSelection latest_regionviews;
614 uint32_t clicked_selection;
615 CrossfadeView* clicked_crossfadeview;
616 ControlPoint* clicked_control_point;
618 void sort_track_selection (TrackViewList* sel = 0);
620 void get_equivalent_regions (RegionView* rv, std::vector<RegionView*> &, PBD::PropertyID) const;
621 RegionSelection get_equivalent_regions (RegionSelection &, PBD::PropertyID) const;
622 void mapover_tracks (sigc::slot<void,RouteTimeAxisView&,uint32_t> sl, TimeAxisView*, PBD::PropertyID) const;
624 /* functions to be passed to mapover_tracks(), possibly with sigc::bind()-supplied arguments */
626 void mapped_get_equivalent_regions (RouteTimeAxisView&, uint32_t, RegionView *, std::vector<RegionView*>*) const;
627 void mapped_use_new_playlist (RouteTimeAxisView&, uint32_t, std::vector<boost::shared_ptr<ARDOUR::Playlist> > const &);
628 void mapped_use_copy_playlist (RouteTimeAxisView&, uint32_t, std::vector<boost::shared_ptr<ARDOUR::Playlist> > const &);
629 void mapped_clear_playlist (RouteTimeAxisView&, uint32_t);
633 void button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type);
634 bool button_release_can_deselect;
636 void catch_vanishing_regionview (RegionView *);
638 void set_selected_track (TimeAxisView&, Selection::Operation op = Selection::Set, bool no_remove=false);
639 void select_all_tracks ();
641 bool set_selected_control_point_from_click (Selection::Operation op = Selection::Set, bool no_remove=false);
642 void set_selected_track_from_click (bool press, Selection::Operation op = Selection::Set, bool no_remove=false);
643 void set_selected_track_as_side_effect (Selection::Operation op, bool force = false);
644 bool set_selected_regionview_from_click (bool press, Selection::Operation op = Selection::Set, bool no_track_remove=false);
646 bool set_selected_regionview_from_map_event (GdkEventAny*, StreamView*, boost::weak_ptr<ARDOUR::Region>);
647 void collect_new_region_view (RegionView *);
648 void collect_and_select_new_region_view (RegionView *);
650 long select_range_around_region (RegionView *);
652 Gtk::Menu track_context_menu;
653 Gtk::Menu track_region_context_menu;
654 Gtk::Menu track_selection_context_menu;
655 Gtk::Menu track_crossfade_context_menu;
657 Gtk::MenuItem* region_edit_menu_split_item;
658 Gtk::MenuItem* region_edit_menu_split_multichannel_item;
659 Gtk::Menu * track_region_edit_playlist_menu;
660 Gtk::Menu * track_edit_playlist_submenu;
661 Gtk::Menu * track_selection_edit_playlist_submenu;
663 void popup_track_context_menu (int, int, ItemType, bool);
664 Gtk::Menu* build_track_context_menu ();
665 Gtk::Menu* build_track_bus_context_menu ();
666 Gtk::Menu* build_track_region_context_menu ();
667 Gtk::Menu* build_track_crossfade_context_menu ();
668 Gtk::Menu* build_track_selection_context_menu ();
669 void add_dstream_context_items (Gtk::Menu_Helpers::MenuList&);
670 void add_bus_context_items (Gtk::Menu_Helpers::MenuList&);
671 void add_region_context_items (Gtk::Menu_Helpers::MenuList&, bool);
672 void add_crossfade_context_items (AudioStreamView*, boost::shared_ptr<ARDOUR::Crossfade>, Gtk::Menu_Helpers::MenuList&, bool many);
673 void add_selection_context_items (Gtk::Menu_Helpers::MenuList&);
674 Gtk::MenuItem* _popup_region_menu_item;
676 void handle_new_route (ARDOUR::RouteList&);
677 void timeaxisview_deleted (TimeAxisView *);
679 Gtk::HBox global_hpacker;
680 Gtk::VBox global_vpacker;
683 Gdk::Cursor* current_canvas_cursor;
684 Gdk::Cursor* which_grabber_cursor ();
685 void set_canvas_cursor ();
687 ArdourCanvas::Canvas* track_canvas;
689 ArdourCanvas::NoEventText* verbose_canvas_cursor;
690 bool verbose_cursor_visible;
692 void parameter_changed (std::string);
694 bool track_canvas_motion (GdkEvent*);
696 void set_verbose_canvas_cursor (const std::string &, double x, double y);
697 void set_verbose_canvas_cursor_text (const std::string &);
698 void show_verbose_canvas_cursor();
700 bool verbose_cursor_on; // so far unused
702 Gtk::EventBox time_canvas_event_box;
703 Gtk::EventBox track_canvas_event_box;
704 Gtk::EventBox time_button_event_box;
705 Gtk::EventBox ruler_label_event_box;
707 ArdourCanvas::Group *minsec_group;
708 ArdourCanvas::Pixbuf *logo_item;
709 ArdourCanvas::Group *bbt_group;
710 ArdourCanvas::Group *timecode_group;
711 ArdourCanvas::Group *frame_group;
712 ArdourCanvas::Group *tempo_group;
713 ArdourCanvas::Group *meter_group;
714 ArdourCanvas::Group *marker_group;
715 ArdourCanvas::Group *range_marker_group;
716 ArdourCanvas::Group *transport_marker_group;
717 ArdourCanvas::Group* cd_marker_group;
719 ArdourCanvas::Group* timebar_group;
721 /* These bars never need to be scrolled */
722 ArdourCanvas::Group* meter_bar_group;
723 ArdourCanvas::Group* tempo_bar_group;
724 ArdourCanvas::Group* marker_bar_group;
725 ArdourCanvas::Group* range_marker_bar_group;
726 ArdourCanvas::Group* transport_marker_bar_group;
727 ArdourCanvas::Group* cd_marker_bar_group;
729 /** The group containing all items that require horizontal scrolling. */
730 ArdourCanvas::Group* _background_group;
732 The _master_group is the group containing all items
733 that require horizontal scrolling..
734 It is primarily used to separate canvas items
735 that require horizontal scrolling from those that do not.
737 ArdourCanvas::Group* _master_group;
739 /* The group containing all trackviews. Only scrolled vertically. */
740 ArdourCanvas::Group* _trackview_group;
742 /* The group used for region motion. Sits on top of _trackview_group */
743 ArdourCanvas::Group* _region_motion_group;
746 ruler_metric_timecode = 0,
747 ruler_metric_bbt = 1,
748 ruler_metric_frames = 2,
749 ruler_metric_minsec = 3,
751 ruler_time_tempo = 4,
752 ruler_time_meter = 5,
753 ruler_time_marker = 6,
754 ruler_time_range_marker = 7,
755 ruler_time_transport_marker = 8,
756 ruler_time_cd_marker = 9,
759 static GtkCustomMetric ruler_metrics[4];
760 Glib::RefPtr<Gtk::ToggleAction> ruler_timecode_action;
761 Glib::RefPtr<Gtk::ToggleAction> ruler_bbt_action;
762 Glib::RefPtr<Gtk::ToggleAction> ruler_samples_action;
763 Glib::RefPtr<Gtk::ToggleAction> ruler_minsec_action;
764 Glib::RefPtr<Gtk::ToggleAction> ruler_tempo_action;
765 Glib::RefPtr<Gtk::ToggleAction> ruler_meter_action;
766 Glib::RefPtr<Gtk::ToggleAction> ruler_marker_action;
767 Glib::RefPtr<Gtk::ToggleAction> ruler_range_action;
768 Glib::RefPtr<Gtk::ToggleAction> ruler_loop_punch_action;
769 Glib::RefPtr<Gtk::ToggleAction> ruler_cd_marker_action;
770 bool no_ruler_shown_update;
772 gint ruler_button_press (GdkEventButton*);
773 gint ruler_button_release (GdkEventButton*);
774 gint ruler_mouse_motion (GdkEventMotion*);
775 bool ruler_scroll (GdkEventScroll* event);
777 Gtk::Widget * ruler_grabbed_widget;
779 void initialize_rulers ();
780 void update_just_timecode ();
781 void compute_fixed_ruler_scale (); //calculates the RulerScale of the fixed rulers
782 void update_fixed_rulers ();
783 void update_tempo_based_rulers ();
784 void popup_ruler_menu (framepos_t where = 0, ItemType type = RegionItem);
785 void update_ruler_visibility ();
786 void set_ruler_visible (RulerType, bool);
787 void toggle_ruler_visibility (RulerType rt);
788 void ruler_toggled (int);
789 gint ruler_label_button_release (GdkEventButton*);
790 void store_ruler_visibility ();
791 void restore_ruler_visibility ();
793 static gint _metric_get_timecode (GtkCustomRulerMark **, gdouble, gdouble, gint);
794 static gint _metric_get_bbt (GtkCustomRulerMark **, gdouble, gdouble, gint);
795 static gint _metric_get_frames (GtkCustomRulerMark **, gdouble, gdouble, gint);
796 static gint _metric_get_minsec (GtkCustomRulerMark **, gdouble, gdouble, gint);
798 enum MinsecRulerScale {
805 MinsecRulerScale minsec_ruler_scale;
807 framecnt_t minsec_mark_interval;
808 gint minsec_mark_modulo;
810 void set_minsec_ruler_scale (gdouble lower, gdouble upper);
812 enum TimecodeRulerScale {
814 timecode_show_frames,
815 timecode_show_seconds,
816 timecode_show_minutes,
820 TimecodeRulerScale timecode_ruler_scale;
822 framecnt_t timecode_mark_interval;
823 gint timecode_mark_modulo;
824 gint timecode_nmarks;
825 void set_timecode_ruler_scale (gdouble lower, gdouble upper);
835 bbt_show_ticks_detail,
836 bbt_show_ticks_super_detail
839 BBTRulerScale bbt_ruler_scale;
843 uint32_t bbt_bar_helper_on;
844 uint32_t bbt_accent_modulo;
845 void compute_bbt_ruler_scale (framepos_t lower, framepos_t upper);
847 gint metric_get_timecode (GtkCustomRulerMark **, gdouble, gdouble, gint);
848 gint metric_get_bbt (GtkCustomRulerMark **, gdouble, gdouble, gint);
849 gint metric_get_frames (GtkCustomRulerMark **, gdouble, gdouble, gint);
850 gint metric_get_minsec (GtkCustomRulerMark **, gdouble, gdouble, gint);
852 Gtk::Widget *_ruler_separator;
853 GtkWidget *_timecode_ruler;
854 GtkWidget *_bbt_ruler;
855 GtkWidget *_frames_ruler;
856 GtkWidget *_minsec_ruler;
857 Gtk::Widget *timecode_ruler;
858 Gtk::Widget *bbt_ruler;
859 Gtk::Widget *frames_ruler;
860 Gtk::Widget *minsec_ruler;
861 static Editor *ruler_editor;
863 static const double timebar_height;
864 guint32 visible_timebars;
865 gdouble canvas_timebars_vsize;
866 gdouble get_canvas_timebars_vsize () const { return canvas_timebars_vsize; }
867 Gtk::Menu *editor_ruler_menu;
869 ArdourCanvas::SimpleRect* tempo_bar;
870 ArdourCanvas::SimpleRect* meter_bar;
871 ArdourCanvas::SimpleRect* marker_bar;
872 ArdourCanvas::SimpleRect* range_marker_bar;
873 ArdourCanvas::SimpleRect* transport_marker_bar;
874 ArdourCanvas::SimpleRect* cd_marker_bar;
876 Gtk::Label minsec_label;
877 Gtk::Label bbt_label;
878 Gtk::Label timecode_label;
879 Gtk::Label frame_label;
880 Gtk::Label tempo_label;
881 Gtk::Label meter_label;
882 Gtk::Label mark_label;
883 Gtk::Label range_mark_label;
884 Gtk::Label transport_mark_label;
885 Gtk::Label cd_mark_label;
887 Gtk::VBox time_button_vbox;
888 Gtk::HBox time_button_hbox;
890 friend class EditorCursor;
892 EditorCursor* playhead_cursor;
893 ArdourCanvas::Group* cursor_group;
895 framepos_t get_region_boundary (framepos_t pos, int32_t dir, bool with_selection, bool only_onscreen);
897 void cursor_to_region_boundary (bool with_selection, int32_t dir);
898 void cursor_to_next_region_boundary (bool with_selection);
899 void cursor_to_previous_region_boundary (bool with_selection);
900 void cursor_to_next_region_point (EditorCursor*, ARDOUR::RegionPoint);
901 void cursor_to_previous_region_point (EditorCursor*, ARDOUR::RegionPoint);
902 void cursor_to_region_point (EditorCursor*, ARDOUR::RegionPoint, int32_t dir);
903 void cursor_to_selection_start (EditorCursor *);
904 void cursor_to_selection_end (EditorCursor *);
906 void selected_marker_to_region_boundary (bool with_selection, int32_t dir);
907 void selected_marker_to_next_region_boundary (bool with_selection);
908 void selected_marker_to_previous_region_boundary (bool with_selection);
909 void selected_marker_to_next_region_point (ARDOUR::RegionPoint);
910 void selected_marker_to_previous_region_point (ARDOUR::RegionPoint);
911 void selected_marker_to_region_point (ARDOUR::RegionPoint, int32_t dir);
912 void selected_marker_to_selection_start ();
913 void selected_marker_to_selection_end ();
915 void select_all_selectables_using_cursor (EditorCursor *, bool);
916 void select_all_selectables_using_edit (bool);
917 void select_all_selectables_between (bool within);
918 void select_range_between ();
920 boost::shared_ptr<ARDOUR::Region> find_next_region (ARDOUR::framepos_t, ARDOUR::RegionPoint, int32_t dir, TrackViewList&, TimeAxisView ** = 0);
921 ARDOUR::framepos_t find_next_region_boundary (ARDOUR::framepos_t, int32_t dir, const TrackViewList&);
923 std::vector<ARDOUR::framepos_t> region_boundary_cache;
924 void build_region_boundary_cache ();
927 Gtk::HBox bottom_hbox;
929 Gtk::Table edit_packer;
931 Gtk::Adjustment vertical_adjustment;
933 Gtk::Layout controls_layout;
934 bool control_layout_scroll (GdkEventScroll* ev);
935 void controls_layout_size_request (Gtk::Requisition*);
936 sigc::connection controls_layout_size_request_connection;
938 bool horizontal_scroll_left_press ();
939 void horizontal_scroll_left_release ();
940 bool horizontal_scroll_right_press ();
941 void horizontal_scroll_right_release ();
942 sigc::connection _scroll_connection;
943 int _scroll_callbacks;
945 double _canvas_width;
946 double _canvas_height; ///< height of the visible area of the track canvas
947 double full_canvas_height; ///< full height of the canvas
949 bool track_canvas_map_handler (GdkEventAny*);
951 gint edit_controls_button_release (GdkEventButton*);
952 Gtk::Menu *edit_controls_left_menu;
953 Gtk::Menu *edit_controls_right_menu;
955 Gtk::VBox ruler_label_vbox;
956 Gtk::VBox track_canvas_vbox;
957 Gtk::VBox time_canvas_vbox;
958 Gtk::VBox edit_controls_vbox;
959 Gtk::HBox edit_controls_hbox;
961 void control_scroll (float);
962 void access_action (std::string,std::string);
963 bool deferred_control_scroll (framepos_t);
964 sigc::connection control_scroll_connection;
966 gdouble get_trackview_group_vertical_offset () const { return vertical_adjustment.get_value () - canvas_timebars_vsize;}
968 ArdourCanvas::Group* get_background_group () const { return _background_group; }
969 ArdourCanvas::Group* get_trackview_group () const { return _trackview_group; }
970 double last_trackview_group_vertical_offset;
971 void tie_vertical_scrolling ();
972 void set_horizontal_position (double);
973 double horizontal_position () const;
974 void scroll_canvas_vertically ();
976 struct VisualChange {
984 framepos_t time_origin;
985 double frames_per_unit;
990 VisualChange() : pending ((VisualChange::Type) 0), time_origin (0), frames_per_unit (0), idle_handler_id (-1) {}
992 pending = Type (pending | t);
997 VisualChange pending_visual_change;
999 static int _idle_visual_changer (void *arg);
1000 int idle_visual_changer ();
1002 void queue_visual_change (framepos_t);
1003 void queue_visual_change (double);
1004 void queue_visual_change_y (double);
1005 void ensure_visual_change_idle_handler ();
1008 TrackViewList track_views;
1009 std::pair<TimeAxisView*, ARDOUR::layer_t> trackview_by_y_position (double);
1010 TimeAxisView* axis_view_from_route (boost::shared_ptr<ARDOUR::Route>) const;
1012 TrackViewList get_tracks_for_range_action () const;
1014 sigc::connection super_rapid_screen_update_connection;
1015 framepos_t last_update_frame;
1016 void center_screen_internal (framepos_t, float);
1018 void super_rapid_screen_update ();
1020 void session_going_away ();
1022 framepos_t cut_buffer_start;
1023 framecnt_t cut_buffer_length;
1025 Gdk::Cursor* pre_press_cursor;
1026 boost::weak_ptr<ARDOUR::Trimmable> _trimmable;
1027 boost::weak_ptr<ARDOUR::Movable> _movable;
1029 bool typed_event (ArdourCanvas::Item*, GdkEvent*, ItemType);
1030 bool button_press_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
1031 bool button_press_handler_1 (ArdourCanvas::Item *, GdkEvent *, ItemType);
1032 bool button_press_handler_2 (ArdourCanvas::Item *, GdkEvent *, ItemType);
1033 bool button_release_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
1034 bool motion_handler (ArdourCanvas::Item*, GdkEvent*, bool from_autoscroll = false);
1035 bool enter_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
1036 bool leave_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
1038 /* KEYMAP HANDLING */
1040 void register_actions ();
1041 void register_region_actions ();
1043 int ensure_cursor (framepos_t* pos);
1045 void cut_copy (Editing::CutCopyOp);
1046 bool can_cut_copy () const;
1047 void cut_copy_points (Editing::CutCopyOp);
1048 void cut_copy_regions (Editing::CutCopyOp, RegionSelection&);
1049 void cut_copy_ranges (Editing::CutCopyOp);
1050 void cut_copy_midi (Editing::CutCopyOp);
1052 void mouse_paste ();
1053 void paste_internal (framepos_t position, float times);
1055 /* EDITING OPERATIONS */
1057 void reset_point_selection ();
1058 void toggle_region_lock ();
1059 void toggle_opaque_region ();
1060 void toggle_record_enable ();
1061 void toggle_region_lock_style ();
1062 void raise_region ();
1063 void raise_region_to_top ();
1064 void change_region_layering_order ();
1065 void lower_region ();
1066 void lower_region_to_bottom ();
1067 void split_regions_at (framepos_t, RegionSelection&);
1068 void split_region_at_transients ();
1069 void split_region_at_points (boost::shared_ptr<ARDOUR::Region>, ARDOUR::AnalysisFeatureList&, bool can_ferret);
1070 void crop_region_to_selection ();
1071 void crop_region_to (framepos_t start, framepos_t end);
1072 void set_sync_point (framepos_t, const RegionSelection&);
1073 void set_region_sync_position ();
1074 void remove_region_sync();
1075 void align_regions (ARDOUR::RegionPoint);
1076 void align_regions_relative (ARDOUR::RegionPoint point);
1077 void align_region (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, framepos_t position);
1078 void align_region_internal (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, framepos_t position);
1079 void remove_selected_regions ();
1080 void remove_clicked_region ();
1081 void show_region_properties ();
1082 void show_midi_list_editor ();
1083 void rename_region ();
1084 void duplicate_some_regions (RegionSelection&, float times);
1085 void duplicate_selection (float times);
1086 void region_fill_selection ();
1088 void region_fill_track ();
1089 void audition_playlist_region_standalone (boost::shared_ptr<ARDOUR::Region>);
1090 void audition_playlist_region_via_route (boost::shared_ptr<ARDOUR::Region>, ARDOUR::Route&);
1091 void split_multichannel_region();
1092 void reverse_region ();
1093 void strip_region_silence ();
1094 void normalize_region ();
1095 void reset_region_scale_amplitude ();
1096 void adjust_region_gain (bool up);
1097 void quantize_region ();
1098 void insert_patch_change ();
1099 void fork_region ();
1101 void do_insert_time ();
1102 void insert_time (framepos_t, framecnt_t, Editing::InsertTimeOption, bool, bool, bool, bool, bool);
1104 void tab_to_transient (bool forward);
1106 void set_tempo_from_region ();
1107 void use_range_as_bar ();
1109 void define_one_bar (framepos_t start, framepos_t end);
1111 void audition_region_from_region_list ();
1112 void hide_region_from_region_list ();
1113 void show_region_in_region_list ();
1115 void naturalize_region ();
1117 void reset_focus ();
1119 void split_region ();
1123 void paste (float times);
1125 void place_transient ();
1126 void remove_transient (ArdourCanvas::Item* item);
1127 void snap_regions_to_grid ();
1128 void close_region_gaps ();
1130 int get_prefix (float&, bool&);
1132 void keyboard_paste ();
1134 void region_from_selection ();
1135 void create_region_from_selection (std::vector<boost::shared_ptr<ARDOUR::Region> >&);
1137 void play_from_start ();
1138 void play_from_edit_point ();
1139 void play_from_edit_point_and_return ();
1140 void play_selected_region ();
1141 void play_edit_range ();
1142 void play_location (ARDOUR::Location&);
1143 void loop_location (ARDOUR::Location&);
1145 void temporal_zoom_selection ();
1146 void temporal_zoom_region (bool both_axes);
1147 void zoom_to_region (bool both_axes);
1148 void temporal_zoom_session ();
1149 void temporal_zoom (gdouble scale);
1150 void temporal_zoom_by_frame (framepos_t start, framepos_t end, const std::string & op);
1151 void temporal_zoom_to_frame (bool coarser, framepos_t frame);
1153 void amplitude_zoom (gdouble scale);
1154 void amplitude_zoom_step (bool in);
1156 void insert_region_list_drag (boost::shared_ptr<ARDOUR::Region>, int x, int y);
1157 void insert_region_list_selection (float times);
1159 void insert_route_list_drag (boost::shared_ptr<ARDOUR::Route>, int x, int y);
1161 /* import & embed */
1163 void add_external_audio_action (Editing::ImportMode);
1164 void external_audio_dialog ();
1165 void session_import_dialog ();
1167 int check_whether_and_how_to_import(std::string, bool all_or_nothing = true);
1168 bool check_multichannel_status (const std::vector<std::string>& paths);
1170 SoundFileOmega* sfbrowser;
1172 void bring_in_external_audio (Editing::ImportMode mode, framepos_t& pos);
1174 bool idle_drop_paths (std::vector<std::string> paths, framepos_t frame, double ypos);
1175 void drop_paths_part_two (const std::vector<std::string>& paths, framepos_t frame, double ypos);
1177 int import_sndfiles (std::vector<std::string> paths, Editing::ImportMode mode, ARDOUR::SrcQuality, framepos_t& pos,
1178 int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>&, bool);
1179 int embed_sndfiles (std::vector<std::string> paths, bool multiple_files, bool& check_sample_rate, Editing::ImportMode mode,
1180 framepos_t& pos, int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>&);
1182 int add_sources (std::vector<std::string> paths, ARDOUR::SourceList& sources, framepos_t& pos, Editing::ImportMode,
1183 int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::Track>&, bool add_channel_suffix);
1184 int finish_bringing_in_material (boost::shared_ptr<ARDOUR::Region> region, uint32_t, uint32_t, framepos_t& pos, Editing::ImportMode mode,
1185 boost::shared_ptr<ARDOUR::Track>& existing_track);
1187 boost::shared_ptr<ARDOUR::AudioTrack> get_nth_selected_audio_track (int nth) const;
1188 boost::shared_ptr<ARDOUR::MidiTrack> get_nth_selected_midi_track (int nth) const;
1190 ARDOUR::InterThreadInfo* current_interthread_info;
1192 AnalysisWindow* analysis_window;
1194 /* import specific info */
1196 struct EditorImportStatus : public ARDOUR::ImportStatus {
1197 Editing::ImportMode mode;
1201 boost::shared_ptr<ARDOUR::Track> track;
1205 EditorImportStatus import_status;
1206 static void *_import_thread (void *);
1207 void* import_thread ();
1208 void finish_import ();
1210 /* to support this ... */
1212 void import_audio (bool as_tracks);
1213 void do_import (std::vector<std::string> paths, bool split, bool as_tracks);
1215 void move_to_start ();
1216 void move_to_end ();
1218 void center_playhead ();
1219 void center_edit_point ();
1220 void edit_cursor_backward ();
1221 void edit_cursor_forward ();
1222 void playhead_forward_to_grid ();
1223 void playhead_backward_to_grid ();
1224 void playhead_backward ();
1225 void playhead_forward ();
1226 void scroll_playhead (bool forward);
1227 void scroll_backward (float pages=0.8f);
1228 void scroll_forward (float pages=0.8f);
1229 void scroll_tracks_down ();
1230 void scroll_tracks_up ();
1231 void delete_sample_forward ();
1232 void delete_sample_backward ();
1233 void delete_screen ();
1234 void search_backwards ();
1235 void search_forwards ();
1237 void clear_markers ();
1238 void clear_ranges ();
1239 void clear_locations ();
1240 void unhide_markers ();
1241 void unhide_ranges ();
1242 void jump_forward_to_mark ();
1243 void jump_backward_to_mark ();
1244 void cursor_align (bool playhead_to_edit);
1246 void remove_last_capture ();
1247 void select_all_selectables_using_time_selection ();
1248 void select_all_selectables_using_loop();
1249 void select_all_selectables_using_punch();
1250 void set_selection_from_range (ARDOUR::Location&);
1251 void set_selection_from_punch ();
1252 void set_selection_from_loop ();
1253 void set_selection_from_region ();
1255 void add_location_mark (framepos_t where);
1256 void add_location_from_region ();
1257 void add_locations_from_region ();
1258 void add_location_from_selection ();
1259 void set_loop_from_selection (bool play);
1260 void set_punch_from_selection ();
1261 void set_punch_from_region ();
1263 void set_loop_from_edit_range (bool play);
1264 void set_loop_from_region (bool play);
1265 void set_punch_from_edit_range ();
1267 void set_loop_range (framepos_t start, framepos_t end, std::string cmd);
1268 void set_punch_range (framepos_t start, framepos_t end, std::string cmd);
1270 void add_location_from_playhead_cursor ();
1271 bool select_new_marker;
1273 void reverse_selection ();
1274 void edit_envelope ();
1276 double last_scrub_x;
1277 int scrubbing_direction;
1278 int scrub_reversals;
1279 int scrub_reverse_distance;
1280 void scrub (framepos_t, double);
1282 void keyboard_selection_begin ();
1283 void keyboard_selection_finish (bool add);
1284 bool have_pending_keyboard_selection;
1285 framepos_t pending_keyboard_selection_start;
1287 boost::shared_ptr<ARDOUR::Region> select_region_for_operation (int dir, TimeAxisView **tv);
1288 void extend_selection_to_end_of_region (bool next);
1289 void extend_selection_to_start_of_region (bool previous);
1291 Editing::SnapType _snap_type;
1292 Editing::SnapMode _snap_mode;
1294 /// Snap threshold in pixels
1295 double snap_threshold;
1297 bool ignore_gui_changes;
1299 DragManager* _drags;
1303 Gtk::Menu fade_context_menu;
1304 void popup_fade_context_menu (int, int, ArdourCanvas::Item*, ItemType);
1306 void set_fade_in_shape (ARDOUR::FadeShape);
1307 void set_fade_out_shape (ARDOUR::FadeShape);
1309 void set_fade_length (bool in);
1310 void set_fade_in_active (bool);
1311 void set_fade_out_active (bool);
1313 std::set<boost::shared_ptr<ARDOUR::Playlist> > motion_frozen_playlists;
1315 bool _dragging_playhead;
1316 bool _dragging_edit_point;
1318 void marker_drag_motion_callback (GdkEvent*);
1319 void marker_drag_finished_callback (GdkEvent*);
1321 gint mouse_rename_region (ArdourCanvas::Item*, GdkEvent*);
1323 void add_region_drag (ArdourCanvas::Item*, GdkEvent*, RegionView*);
1324 void start_create_region_grab (ArdourCanvas::Item*, GdkEvent*);
1325 void add_region_copy_drag (ArdourCanvas::Item*, GdkEvent*, RegionView*);
1326 void add_region_brush_drag (ArdourCanvas::Item*, GdkEvent*, RegionView*);
1327 void start_selection_grab (ArdourCanvas::Item*, GdkEvent*);
1329 void region_view_item_click (AudioRegionView&, GdkEventButton*);
1331 void remove_gain_control_point (ArdourCanvas::Item*, GdkEvent*);
1332 void remove_control_point (ArdourCanvas::Item*, GdkEvent*);
1334 void mouse_brush_insert_region (RegionView*, framepos_t pos);
1335 void brush (framepos_t);
1337 void show_verbose_time_cursor (framepos_t frame, double offset = 0, double xpos=-1, double ypos=-1);
1338 void show_verbose_duration_cursor (framepos_t start, framepos_t end, double offset = 0, double xpos=-1, double ypos=-1);
1339 double clamp_verbose_cursor_x (double);
1340 double clamp_verbose_cursor_y (double);
1342 /* Canvas event handlers */
1344 bool canvas_control_point_event (GdkEvent* event,ArdourCanvas::Item*, ControlPoint*);
1345 bool canvas_line_event (GdkEvent* event,ArdourCanvas::Item*, AutomationLine*);
1346 bool canvas_selection_rect_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1347 bool canvas_selection_start_trim_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1348 bool canvas_selection_end_trim_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1349 bool canvas_crossfade_view_event (GdkEvent* event,ArdourCanvas::Item*, CrossfadeView*);
1350 bool canvas_fade_in_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1351 bool canvas_fade_in_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1352 bool canvas_fade_out_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1353 bool canvas_fade_out_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1354 bool canvas_region_view_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1355 bool canvas_frame_handle_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1356 bool canvas_region_view_name_highlight_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1357 bool canvas_region_view_name_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1358 bool canvas_feature_line_event (GdkEvent* event, ArdourCanvas::Item*, RegionView*);
1359 bool canvas_stream_view_event (GdkEvent* event,ArdourCanvas::Item*, RouteTimeAxisView*);
1360 bool canvas_marker_event (GdkEvent* event,ArdourCanvas::Item*, Marker*);
1361 bool canvas_zoom_rect_event (GdkEvent* event,ArdourCanvas::Item*);
1362 bool canvas_tempo_marker_event (GdkEvent* event,ArdourCanvas::Item*, TempoMarker*);
1363 bool canvas_meter_marker_event (GdkEvent* event,ArdourCanvas::Item*, MeterMarker*);
1364 bool canvas_automation_track_event(GdkEvent* event, ArdourCanvas::Item*, AutomationTimeAxisView*) ;
1365 bool canvas_note_event (GdkEvent* event, ArdourCanvas::Item*);
1367 bool canvas_tempo_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1368 bool canvas_meter_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1369 bool canvas_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1370 bool canvas_range_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1371 bool canvas_transport_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1372 bool canvas_cd_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1374 bool canvas_imageframe_item_view_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1375 bool canvas_imageframe_view_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameTimeAxis*);
1376 bool canvas_imageframe_start_handle_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1377 bool canvas_imageframe_end_handle_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1378 bool canvas_marker_time_axis_view_event(GdkEvent* event, ArdourCanvas::Item*,MarkerTimeAxis*);
1379 bool canvas_markerview_item_view_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1380 bool canvas_markerview_start_handle_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1381 bool canvas_markerview_end_handle_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1384 friend class DragManager;
1385 friend class EditorRouteGroups;
1386 friend class EditorRegions;
1388 ArdourCanvas::Item *last_item_entered;
1389 /** true if the mouse is over a place where region trim can happen */
1390 bool _over_region_trim_target;
1392 /* non-public event handlers */
1394 bool canvas_playhead_cursor_event (GdkEvent* event, ArdourCanvas::Item*);
1395 bool track_canvas_scroll (GdkEventScroll* event);
1397 bool track_canvas_scroll_event (GdkEventScroll* event);
1398 bool track_canvas_button_press_event (GdkEventButton* event);
1399 bool track_canvas_button_release_event (GdkEventButton* event);
1400 bool track_canvas_motion_notify_event (GdkEventMotion* event);
1402 Gtk::Allocation canvas_allocation;
1403 void track_canvas_allocate (Gtk::Allocation alloc);
1404 bool track_canvas_size_allocated ();
1405 bool track_canvas_drag_motion (Glib::RefPtr<Gdk::DragContext> const &, int, int, guint);
1406 bool track_canvas_key_press (GdkEventKey *);
1407 bool track_canvas_key_release (GdkEventKey *);
1409 void set_playhead_cursor ();
1411 void kbd_driver (sigc::slot<void,GdkEvent*>, bool use_track_canvas = true, bool use_time_canvas = true, bool can_select = true);
1412 void toggle_region_mute ();
1415 void kbd_do_brush (GdkEvent*);
1416 void kbd_do_audition (GdkEvent*);
1418 void initialize_canvas ();
1420 /* display control */
1422 bool _show_measures;
1423 /// true if the editor should follow the playhead, otherwise false
1424 bool _follow_playhead;
1425 /// true if we scroll the tracks rather than the playhead
1426 bool _stationary_playhead;
1428 ARDOUR::TempoMap::BBTPointList *current_bbt_points;
1430 TempoLines* tempo_lines;
1432 ArdourCanvas::Group* time_line_group;
1434 void hide_measures ();
1435 void draw_measures ();
1436 bool redraw_measures ();
1438 void new_tempo_section ();
1440 void mouse_add_new_tempo_event (framepos_t where);
1441 void mouse_add_new_meter_event (framepos_t where);
1443 void remove_tempo_marker (ArdourCanvas::Item*);
1444 void remove_meter_marker (ArdourCanvas::Item*);
1445 gint real_remove_tempo_marker (ARDOUR::TempoSection*);
1446 gint real_remove_meter_marker (ARDOUR::MeterSection*);
1448 void edit_tempo_section (ARDOUR::TempoSection*);
1449 void edit_meter_section (ARDOUR::MeterSection*);
1450 void edit_tempo_marker (ArdourCanvas::Item*);
1451 void edit_meter_marker (ArdourCanvas::Item*);
1452 void edit_control_point (ArdourCanvas::Item*);
1453 void edit_note (ArdourCanvas::Item *);
1455 void marker_menu_edit ();
1456 void marker_menu_remove ();
1457 void marker_menu_rename ();
1458 void toggle_marker_menu_lock ();
1459 void toggle_marker_menu_glue ();
1460 void marker_menu_hide ();
1461 void marker_menu_loop_range ();
1462 void marker_menu_select_all_selectables_using_range ();
1463 void marker_menu_select_using_range ();
1464 void marker_menu_separate_regions_using_location ();
1465 void marker_menu_play_from ();
1466 void marker_menu_play_range ();
1467 void marker_menu_set_playhead ();
1468 void marker_menu_set_from_playhead ();
1469 void marker_menu_set_from_selection ();
1470 void marker_menu_range_to_next ();
1471 void new_transport_marker_menu_set_loop ();
1472 void new_transport_marker_menu_set_punch ();
1473 void update_loop_range_view (bool visibility=false);
1474 void update_punch_range_view (bool visibility=false);
1475 void new_transport_marker_menu_popdown ();
1476 void marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1477 void tempo_or_meter_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1478 void transport_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1479 void new_transport_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1480 void build_range_marker_menu (bool);
1481 void build_marker_menu (ARDOUR::Location *);
1482 void build_tempo_or_meter_marker_menu (bool);
1483 void build_new_transport_marker_menu ();
1484 void dynamic_cast_marker_object (void*, MeterMarker**, TempoMarker**) const;
1486 Gtk::Menu* tempo_or_meter_marker_menu;
1487 Gtk::Menu* marker_menu;
1488 Gtk::Menu* range_marker_menu;
1489 Gtk::Menu* transport_marker_menu;
1490 Gtk::Menu* new_transport_marker_menu;
1491 Gtk::Menu* cd_marker_menu;
1492 ArdourCanvas::Item* marker_menu_item;
1494 typedef std::list<Marker*> Marks;
1497 void remove_metric_marks ();
1498 void draw_metric_marks (const ARDOUR::Metrics& metrics);
1500 void compute_current_bbt_points (framepos_t left, framepos_t right);
1501 void tempo_map_changed (const PBD::PropertyChange&);
1502 void redisplay_tempo (bool immediate_redraw);
1504 uint32_t bbt_beat_subdivision;
1508 Gtk::ToggleButton editor_mixer_button;
1509 Gtk::ToggleButton editor_list_button;
1510 void editor_mixer_button_toggled ();
1511 void editor_list_button_toggled ();
1513 AudioClock zoom_range_clock;
1514 Gtk::Button zoom_in_button;
1515 Gtk::Button zoom_out_button;
1516 Gtk::Button zoom_out_full_button;
1517 Gtk::Button zoom_onetoone_button;
1519 Gtk::Button tav_expand_button;
1520 Gtk::Button tav_shrink_button;
1522 Gtk::VBox toolbar_clock_vbox;
1523 Gtk::VBox toolbar_selection_clock_vbox;
1524 Gtk::Table toolbar_selection_clock_table;
1525 Gtk::Label toolbar_selection_cursor_label;
1527 Gtkmm2ext::TearOff* _mouse_mode_tearoff;
1528 Gtk::ToggleButton mouse_select_button;
1529 Gtk::ToggleButton mouse_move_button;
1530 Gtk::ToggleButton mouse_gain_button;
1531 Gtk::ToggleButton mouse_zoom_button;
1532 Gtk::ToggleButton mouse_timefx_button;
1533 Gtk::ToggleButton mouse_audition_button;
1534 Gtk::ToggleButton join_object_range_button;
1536 void mouse_mode_toggled (Editing::MouseMode m);
1537 void mouse_mode_object_range_toggled () {}
1538 bool ignore_mouse_mode_toggle;
1540 Gtk::ToggleButton internal_edit_button;
1541 void toggle_internal_editing ();
1543 gint mouse_select_button_release (GdkEventButton*);
1545 Gtk::VBox automation_box;
1546 Gtk::Button automation_mode_button;
1547 Gtk::ToggleButton global_automation_button;
1549 Gtk::ComboBoxText edit_mode_selector;
1550 Gtk::VBox edit_mode_box;
1551 std::vector<std::string> edit_mode_strings;
1553 void set_edit_mode (ARDOUR::EditMode);
1554 void cycle_edit_mode ();
1555 void edit_mode_selection_done ();
1557 Gtk::ComboBoxText snap_type_selector;
1558 Gtk::ComboBoxText snap_mode_selector;
1561 std::vector<std::string> snap_type_strings;
1562 std::vector<std::string> snap_mode_strings;
1564 void snap_type_selection_done ();
1565 void snap_mode_selection_done ();
1566 void snap_mode_chosen (Editing::SnapMode);
1567 void snap_type_chosen (Editing::SnapType);
1569 Glib::RefPtr<Gtk::RadioAction> snap_type_action (Editing::SnapType);
1570 Glib::RefPtr<Gtk::RadioAction> snap_mode_action (Editing::SnapMode);
1572 Gtk::ComboBoxText zoom_focus_selector;
1573 Gtk::VBox zoom_focus_box;
1575 std::vector<std::string> zoom_focus_strings;
1577 void zoom_focus_selection_done ();
1578 void zoom_focus_chosen (Editing::ZoomFocus);
1580 Glib::RefPtr<Gtk::RadioAction> zoom_focus_action (Editing::ZoomFocus);
1582 Gtk::HBox _zoom_box;
1583 Gtkmm2ext::TearOff* _zoom_tearoff;
1584 void zoom_adjustment_changed();
1586 void setup_toolbar ();
1588 void setup_tooltips ();
1590 Gtkmm2ext::TearOff* _tools_tearoff;
1591 Gtk::HBox toolbar_hbox;
1592 Gtk::EventBox toolbar_base;
1593 Gtk::Frame toolbar_frame;
1594 Gtk::Viewport _toolbar_viewport;
1598 Gtk::HBox panic_box;
1599 Gtk::Button midi_panic_button;
1600 Gtk::ToggleButton midi_sound_notes;
1602 bool sound_notes () const { return midi_sound_notes.get_active(); }
1604 void setup_midi_toolbar ();
1606 /* selection process */
1608 Selection* selection;
1609 Selection* cut_buffer;
1611 void time_selection_changed ();
1612 void track_selection_changed ();
1613 void region_selection_changed ();
1614 sigc::connection editor_regions_selection_changed_connection;
1615 void sensitize_all_region_actions (bool);
1616 void sensitize_the_right_region_actions ();
1617 bool _all_region_actions_sensitized;
1618 /** Flag to block region action handlers from doing what they normally do;
1619 * I tried Gtk::Action::block_activate() but this doesn't work (ie it doesn't
1620 * block) when setting a ToggleAction's active state.
1622 bool _ignore_region_action;
1623 bool _last_region_menu_was_main;
1624 void point_selection_changed ();
1625 void marker_selection_changed ();
1627 void cancel_selection ();
1629 bool audio_region_selection_covers (framepos_t where);
1631 /* transport range select process */
1633 ArdourCanvas::SimpleRect* cd_marker_bar_drag_rect;
1634 ArdourCanvas::SimpleRect* range_bar_drag_rect;
1635 ArdourCanvas::SimpleRect* transport_bar_drag_rect;
1638 ArdourCanvas::SimpleRect *bogus_background_rect;
1640 ArdourCanvas::SimpleRect *transport_bar_range_rect;
1641 ArdourCanvas::SimpleRect *transport_bar_preroll_rect;
1642 ArdourCanvas::SimpleRect *transport_bar_postroll_rect;
1643 ArdourCanvas::SimpleRect *transport_loop_range_rect;
1644 ArdourCanvas::SimpleRect *transport_punch_range_rect;
1645 ArdourCanvas::SimpleLine *transport_punchin_line;
1646 ArdourCanvas::SimpleLine *transport_punchout_line;
1647 ArdourCanvas::SimpleRect *transport_preroll_rect;
1648 ArdourCanvas::SimpleRect *transport_postroll_rect;
1650 ARDOUR::Location* transport_loop_location();
1651 ARDOUR::Location* transport_punch_location();
1653 ARDOUR::Location *temp_location;
1655 /* object rubberband select process */
1657 bool select_all_within (framepos_t, framepos_t, double, double, TrackViewList const &, Selection::Operation, bool);
1659 ArdourCanvas::SimpleRect *rubberband_rect;
1661 /* mouse zoom process */
1663 ArdourCanvas::SimpleRect *zoom_rect;
1664 void reposition_zoom_rect (framepos_t start, framepos_t end);
1666 EditorRouteGroups* _route_groups;
1667 EditorRoutes* _routes;
1668 EditorRegions* _regions;
1669 EditorSnapshots* _snapshots;
1670 EditorLocations* _locations;
1672 /* diskstream/route display management */
1673 Glib::RefPtr<Gdk::Pixbuf> rec_enabled_icon;
1674 Glib::RefPtr<Gdk::Pixbuf> rec_disabled_icon;
1676 Glib::RefPtr<Gtk::TreeSelection> route_display_selection;
1678 bool sync_track_view_list_and_routes ();
1680 Gtk::VBox list_vpacker;
1684 bool autoscroll_active;
1685 int autoscroll_timeout_tag;
1688 int last_autoscroll_x;
1689 int last_autoscroll_y;
1690 uint32_t autoscroll_cnt;
1691 framecnt_t autoscroll_x_distance;
1692 double autoscroll_y_distance;
1694 static gint _autoscroll_canvas (void *);
1695 bool autoscroll_canvas ();
1696 void start_canvas_autoscroll (int x, int y);
1697 void stop_canvas_autoscroll ();
1700 void point_trim (GdkEvent *, framepos_t);
1702 void trim_region_front();
1703 void trim_region_back();
1704 void trim_region (bool front);
1706 void trim_region_to_loop ();
1707 void trim_region_to_punch ();
1708 void trim_region_to_location (const ARDOUR::Location&, const char* cmd);
1710 void trim_to_region(bool forward);
1711 void trim_region_to_previous_region_end();
1712 void trim_region_to_next_region_start();
1714 bool show_gain_after_trim;
1718 int convert_drop_to_paths (
1719 std::vector<std::string>& paths,
1720 const Glib::RefPtr<Gdk::DragContext>& context,
1723 const Gtk::SelectionData& data,
1727 void track_canvas_drag_data_received (
1728 const Glib::RefPtr<Gdk::DragContext>& context,
1731 const Gtk::SelectionData& data,
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,
1761 int write_region_selection(RegionSelection&);
1762 bool write_region (std::string path, boost::shared_ptr<ARDOUR::AudioRegion>);
1763 void bounce_region_selection ();
1764 void bounce_range_selection (bool replace, bool enable_processing);
1765 void external_edit_region ();
1767 int write_audio_selection (TimeSelection&);
1768 bool write_audio_range (ARDOUR::AudioPlaylist&, const ARDOUR::ChanCount& channels, std::list<ARDOUR::AudioRange>&);
1770 void write_selection ();
1772 XMLNode *before; /* used in *_reversible_command */
1774 void update_title ();
1775 void update_title_s (const std::string & snapshot_name);
1778 Selection* selection;
1779 double frames_per_unit;
1781 State (PublicEditor const * e);
1785 void instant_save ();
1787 boost::shared_ptr<ARDOUR::AudioRegion> last_audition_region;
1789 /* freeze operations */
1791 ARDOUR::InterThreadInfo freeze_status;
1792 static void* _freeze_thread (void*);
1793 void* freeze_thread ();
1795 void freeze_route ();
1796 void unfreeze_route ();
1798 /* route-group solo + mute */
1800 void set_route_group_solo (ARDOUR::Route&, bool);
1801 void set_route_group_mute (ARDOUR::Route&, bool);
1805 void duplicate_dialog (bool with_dialog);
1807 framepos_t event_frame (GdkEvent const *, double* px = 0, double* py = 0) const;
1809 /* returns false if mouse pointer is not in track or marker canvas
1811 bool mouse_frame (framepos_t&, bool& in_track_canvas) const;
1813 /* "whats mine is yours" */
1815 TimeFXDialog* current_timefx;
1817 static void* timefx_thread (void *arg);
1818 void do_timefx (TimeFXDialog&);
1820 int time_stretch (RegionSelection&, float fraction);
1821 int pitch_shift (RegionSelection&, float cents);
1822 void pitch_shift_region ();
1823 int time_fx (RegionSelection&, float val, bool pitching);
1825 /* editor-mixer strip */
1827 MixerStrip *current_mixer_strip;
1828 bool show_editor_mixer_when_tracks_arrive;
1829 Gtk::VBox current_mixer_strip_vbox;
1830 void cms_new (boost::shared_ptr<ARDOUR::Route>);
1831 void current_mixer_strip_hidden ();
1833 void detach_tearoff (Gtk::Box* b, Gtk::Window* w);
1834 void reattach_tearoff (Gtk::Box* b, Gtk::Window* w, int32_t n);
1836 void ensure_all_elements_drawn ();
1838 /* nudging tracks */
1840 void nudge_track (bool use_edit_point, bool forwards);
1844 bool _xfade_visibility;
1847 void handle_new_imageframe_time_axis_view(const std::string & track_name, void* src) ;
1848 void handle_new_imageframe_marker_time_axis_view(const std::string & track_name, TimeAxisView* marked_track) ;
1850 void start_imageframe_grab(ArdourCanvas::Item*, GdkEvent*) ;
1851 void start_markerview_grab(ArdourCanvas::Item*, GdkEvent*) ;
1853 void imageframe_drag_motion_callback(ArdourCanvas::Item*, GdkEvent*) ;
1854 void markerview_drag_motion_callback(ArdourCanvas::Item*, GdkEvent*) ;
1855 void timeaxis_item_drag_finished_callback(ArdourCanvas::Item*, GdkEvent*) ;
1857 gint canvas_imageframe_item_view_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameView* ifv);
1858 gint canvas_imageframe_view_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameTimeAxis* ifta);
1859 gint canvas_imageframe_start_handle_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameView* ifv);
1860 gint canvas_imageframe_end_handle_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameView* ifv);
1862 gint canvas_marker_time_axis_view_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerTimeAxis* mta);
1863 gint canvas_markerview_item_view_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerView* mv);
1864 gint canvas_markerview_start_handle_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerView* mv);
1865 gint canvas_markerview_end_handle_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerView* mv);
1867 void imageframe_start_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1868 void imageframe_end_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1869 void imageframe_start_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1870 void imageframe_start_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1871 void imageframe_end_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1872 void imageframe_end_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1874 void markerview_item_start_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1875 void markerview_item_end_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1876 void markerview_start_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1877 void markerview_start_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1878 void markerview_end_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1879 void markerview_end_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1881 void popup_imageframe_edit_menu(int button, int32_t time, ArdourCanvas::Item* ifv, bool with_frame) ;
1882 void popup_marker_time_axis_edit_menu(int button, int32_t time, ArdourCanvas::Item* ifv, bool with_frame) ;
1884 ImageFrameSocketHandler* image_socket_listener ;
1887 void toggle_xfade_active (boost::weak_ptr<ARDOUR::Crossfade>);
1888 void toggle_xfade_length (boost::weak_ptr<ARDOUR::Crossfade>);
1889 void edit_xfade (boost::weak_ptr<ARDOUR::Crossfade>);
1890 void xfade_edit_left_region ();
1891 void xfade_edit_right_region ();
1893 static const int32_t default_width = 995;
1894 static const int32_t default_height = 765;
1898 Gtk::Button nudge_forward_button;
1899 Gtk::Button nudge_backward_button;
1900 Gtk::HBox nudge_hbox;
1901 Gtk::VBox nudge_vbox;
1902 AudioClock nudge_clock;
1904 bool nudge_forward_release (GdkEventButton*);
1905 bool nudge_backward_release (GdkEventButton*);
1909 void apply_filter (ARDOUR::Filter&, std::string cmd, ProgressReporter* progress = 0);
1911 Command* apply_midi_note_edit_op_to_region (ARDOUR::MidiOperator& op, MidiRegionView& mrv);
1912 void apply_midi_note_edit_op (ARDOUR::MidiOperator& op);
1914 /* handling cleanup */
1916 int playlist_deletion_dialog (boost::shared_ptr<ARDOUR::Playlist>);
1918 PBD::ScopedConnectionList session_connections;
1920 /* tracking step changes of track height */
1922 TimeAxisView* current_stepping_trackview;
1923 ARDOUR::microseconds_t last_track_height_step_timestamp;
1924 gint track_height_step_timeout();
1925 sigc::connection step_timeout;
1927 TimeAxisView* entered_track;
1928 /** If the mouse is over a RegionView or one of its child canvas items, this is set up
1929 to point to the RegionView. Otherwise it is 0.
1931 RegionView* entered_regionview;
1934 void ensure_entered_track_selected (bool op_acts_on_objects = false);
1935 bool clear_entered_track;
1936 bool left_track_canvas (GdkEventCrossing*);
1937 bool entered_track_canvas (GdkEventCrossing*);
1938 void set_entered_track (TimeAxisView*);
1939 void set_entered_regionview (RegionView*);
1940 void ensure_track_visible (TimeAxisView*);
1941 gint left_automation_track ();
1943 void reset_canvas_action_sensitivity (bool);
1944 void toggle_gain_envelope_visibility ();
1945 void toggle_gain_envelope_active ();
1946 void reset_region_gain_envelopes ();
1948 bool on_key_press_event (GdkEventKey*);
1949 bool on_key_release_event (GdkEventKey*);
1951 void session_state_saved (std::string);
1953 Glib::RefPtr<Gtk::Action> undo_action;
1954 Glib::RefPtr<Gtk::Action> redo_action;
1956 void history_changed ();
1958 Gtk::HBox status_bar_hpacker;
1960 Editing::EditPoint _edit_point;
1962 Gtk::ComboBoxText edit_point_selector;
1964 void set_edit_point_preference (Editing::EditPoint ep, bool force = false);
1965 void cycle_edit_point (bool with_marker);
1966 void set_edit_point ();
1967 void edit_point_selection_done ();
1968 void edit_point_chosen (Editing::EditPoint);
1969 Glib::RefPtr<Gtk::RadioAction> edit_point_action (Editing::EditPoint);
1970 std::vector<std::string> edit_point_strings;
1972 void selected_marker_moved (ARDOUR::Location*);
1974 bool get_edit_op_range (framepos_t& start, framepos_t& end) const;
1976 void get_regions_at (RegionSelection&, framepos_t where, const TrackViewList& ts) const;
1977 void get_regions_after (RegionSelection&, framepos_t where, const TrackViewList& ts) const;
1979 RegionSelection get_regions_from_selection_and_edit_point ();
1980 RegionSelection get_regions_from_selection_and_entered ();
1982 void start_updating_meters ();
1983 void stop_updating_meters ();
1984 bool meters_running;
1986 void select_next_route ();
1987 void select_prev_route ();
1989 void snap_to_internal (framepos_t& first, int32_t direction = 0, bool for_mark = false);
1990 void timecode_snap_to_internal (framepos_t& first, int32_t direction = 0, bool for_mark = false);
1992 RhythmFerret* rhythm_ferret;
1993 BundleManager* _bundle_manager;
1995 void fit_tracks (TrackViewList &);
1996 void fit_selected_tracks ();
1997 void set_track_height (Height);
1999 void remove_tracks ();
2000 void toggle_tracks_active ();
2004 static gboolean _idle_resize (gpointer);
2006 int32_t _pending_resize_amount;
2007 TimeAxisView* _pending_resize_view;
2009 void visible_order_range (int*, int*) const;
2013 /** true if we've made a locate request that hasn't yet been processed */
2014 bool _pending_locate_request;
2016 /** if true, there is a pending Session locate which is the initial one when loading a session;
2017 we need to know this so that we don't (necessarily) set the viewport to show the playhead
2020 bool _pending_initial_locate;
2022 Gtk::HBox _summary_hbox;
2023 EditorSummary* _summary;
2024 void region_view_added (RegionView *);
2026 void update_canvas_now ();
2028 EditorGroupTabs* _group_tabs;
2029 void fit_route_group (ARDOUR::RouteGroup *);
2031 void step_edit_status_change (bool);
2032 void start_step_editing ();
2033 void stop_step_editing ();
2034 bool check_step_edit ();
2035 sigc::connection step_edit_connection;
2037 double _last_motion_y;
2039 RegionLayeringOrderEditor* layering_order_editor;
2040 void update_region_layering_order_editor ();
2042 /** Track that was the source for the last cut/copy operation. Used as a place
2043 to paste things iff there is no selected track.
2045 TimeAxisView* _last_cut_copy_source_track;
2047 /** true if a change in Selection->regions should change the selection in the region list.
2048 See EditorRegions::selection_changed.
2050 bool _region_selection_change_updates_region_list;
2052 void setup_fade_images ();
2053 std::map<ARDOUR::FadeShape, Gtk::Image*> _fade_in_images;
2054 std::map<ARDOUR::FadeShape, Gtk::Image*> _fade_out_images;
2056 Gtk::MenuItem& action_menu_item (std::string const &);
2057 void action_pre_activated (Glib::RefPtr<Gtk::Action> const &);
2059 void set_canvas_cursor_for_region_view (double, RegionView *);
2061 MouseCursors* _cursors;
2063 void resize_text_widgets ();
2066 friend class RegionDrag;
2067 friend class RegionMoveDrag;
2068 friend class RegionSpliceDrag;
2069 friend class TrimDrag;
2070 friend class MeterMarkerDrag;
2071 friend class TempoMarkerDrag;
2072 friend class CursorDrag;
2073 friend class FadeInDrag;
2074 friend class FadeOutDrag;
2075 friend class MarkerDrag;
2076 friend class RegionGainDrag;
2077 friend class ControlPointDrag;
2078 friend class LineDrag;
2079 friend class RubberbandSelectDrag;
2080 friend class TimeFXDrag;
2081 friend class ScrubDrag;
2082 friend class SelectionDrag;
2083 friend class RangeMarkerBarDrag;
2084 friend class MouseZoomDrag;
2085 friend class RegionCreateDrag;
2086 friend class RegionMotionDrag;
2087 friend class RegionInsertDrag;
2089 friend class EditorSummary;
2090 friend class EditorGroupTabs;
2092 friend class EditorRoutes;
2093 friend class RhythmFerret;
2096 #endif /* __ardour_editor_h__ */