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__
28 #include <glibmm/ustring.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/layout.h>
40 #include <gtkmm/comboboxtext.h>
42 #include <gtkmm2ext/selector.h>
43 #include <gtkmm2ext/click_box.h>
44 #include <gtkmm2ext/dndtreeview.h>
46 #include <pbd/stateful.h>
47 #include <ardour/session.h>
48 #include <ardour/tempo.h>
49 #include <ardour/stretch.h>
50 #include <ardour/location.h>
51 #include <ardour/audioregion.h>
53 #include "audio_clock.h"
54 #include "gtk-custom-ruler.h"
55 #include "ardour_dialog.h"
56 #include "public_editor.h"
59 #include "editor_items.h"
60 #include "region_selection.h"
69 class AudioDiskstream;
87 class RouteTimeAxisView;
88 class AudioTimeAxisView;
89 class AutomationTimeAxisView;
90 class AudioRegionView;
93 class PlaylistSelector;
97 class UIExportSpecification;
101 class TrackSelection;
102 class AutomationSelection;
105 class AudioStreamView;
107 class SoundFileOmega;
109 class AnalysisWindow;
112 /* <CMT Additions> */
113 class ImageFrameView;
114 class ImageFrameTimeAxisView;
115 class ImageFrameTimeAxis;
116 class MarkerTimeAxis ;
118 class ImageFrameSocketHandler ;
119 class TimeAxisViewItem ;
120 /* </CMT Additions> */
123 class Editor : public PublicEditor
129 void connect_to_session (ARDOUR::Session *);
130 ARDOUR::Session* current_session() const { return session; }
132 nframes_t leftmost_position() const { return leftmost_frame; }
133 nframes_t current_page_frames() const {
134 return (nframes_t) floor (canvas_width * frames_per_unit);
137 void cycle_snap_mode ();
138 void cycle_snap_choice ();
139 void set_snap_to (Editing::SnapType);
140 void set_snap_mode (Editing::SnapMode);
141 void set_snap_threshold (double pixel_distance) {snap_threshold = pixel_distance;}
143 void undo (uint32_t n = 1);
144 void redo (uint32_t n = 1);
146 XMLNode& get_state ();
147 int set_state (const XMLNode& );
149 void set_mouse_mode (Editing::MouseMode, bool force=true);
150 void step_mouse_mode (bool next);
151 Editing::MouseMode current_mouse_mode () { return mouse_mode; }
153 void add_imageframe_time_axis(const std::string & track_name, void*) ;
154 void add_imageframe_marker_time_axis(const std::string & track_name, TimeAxisView* marked_track, void*) ;
155 void connect_to_image_compositor() ;
156 void scroll_timeaxis_to_imageframe_item(const TimeAxisViewItem* item) ;
157 TimeAxisView* get_named_time_axis(const std::string & name) ;
159 void consider_auditioning (boost::shared_ptr<ARDOUR::Region>);
160 void hide_a_region (boost::shared_ptr<ARDOUR::Region>);
161 void remove_a_region (boost::shared_ptr<ARDOUR::Region>);
163 /* option editor-access */
165 void set_show_waveforms (bool yn);
166 bool show_waveforms() const { return _show_waveforms; }
168 void set_show_waveforms_recording (bool yn);
169 bool show_waveforms_recording() const { return _show_waveforms_recording; }
171 /* things that need to be public to be used in the main menubar */
173 void new_region_from_selection ();
174 void separate_regions_between (const TimeSelection&);
175 void separate_region_from_selection ();
176 void separate_regions_using_location (ARDOUR::Location&);
177 void toggle_playback (bool with_abort);
178 void transition_to_rolling (bool forward);
182 nframes_t unit_to_frame (double unit) const {
183 return (nframes_t) rint (unit * frames_per_unit);
186 double frame_to_unit (nframes_t frame) const {
187 return rint ((double) frame / (double) frames_per_unit);
190 double frame_to_unit (double frame) const {
191 return rint (frame / frames_per_unit);
194 /* NOTE: these functions assume that the "pixel" coordinate is
195 the result of using the world->canvas affine transform on a
196 world coordinate. These coordinates already take into
197 account any scrolling carried out by adjusting the
201 nframes64_t pixel_to_frame (double pixel) const {
203 /* pixel can be less than zero when motion events
204 are processed. since we've already run the world->canvas
205 affine, that means that the location *really* is "off
206 to the right" and thus really is "before the start".
210 return (nframes_t) rint (pixel * frames_per_unit * GNOME_CANVAS(track_canvas.gobj())->pixels_per_unit);
216 gulong frame_to_pixel (nframes64_t frame) const {
217 return (gulong) rint ((frame / (frames_per_unit * GNOME_CANVAS(track_canvas.gobj())->pixels_per_unit)));
220 void flush_canvas ();
224 Selection& get_selection() const { return *selection; }
225 Selection& get_cut_buffer() const { return *cut_buffer; }
227 bool extend_selection_to_track (TimeAxisView&);
229 void play_selection ();
230 void select_all_in_track (Selection::Operation op);
231 void select_all (Selection::Operation op);
232 void invert_selection_in_track ();
233 void invert_selection ();
237 void set_show_measures (bool yn);
238 bool show_measures () const { return _show_measures; }
239 bool initial_ruler_update_required;
242 /* analysis window */
243 void analyze_region_selection();
244 void analyze_range_selection();
249 /* these initiate export ... */
251 void export_session();
252 void export_selection();
254 void add_toplevel_controls (Gtk::Container&);
255 Gtk::HBox& get_status_bar_packer() { return status_bar_hpacker; }
257 void set_zoom_focus (Editing::ZoomFocus);
258 Editing::ZoomFocus get_zoom_focus () const { return zoom_focus; }
259 gdouble get_current_zoom () { return frames_per_unit; }
261 void temporal_zoom_step (bool coarser);
263 /* stuff that AudioTimeAxisView and related classes use */
265 PlaylistSelector& playlist_selector() const;
266 void route_name_changed (TimeAxisView *);
267 gdouble frames_per_unit;
268 nframes_t leftmost_frame;
269 void clear_playlist (boost::shared_ptr<ARDOUR::Playlist>);
271 void new_playlists (TimeAxisView*);
272 void copy_playlists (TimeAxisView*);
273 void clear_playlists (TimeAxisView*);
275 TrackViewList* get_valid_views (TimeAxisView*, ARDOUR::RouteGroup* grp = 0);
277 Width editor_mixer_strip_width;
278 void maybe_add_mixer_strip_width (XMLNode&);
279 void show_editor_mixer (bool yn);
280 void set_selected_mixer_strip (TimeAxisView&);
281 void hide_track_in_display (TimeAxisView& tv);
282 void show_track_in_display (TimeAxisView& tv);
284 /* nudge is initiated by transport controls owned by ARDOUR_UI */
286 void nudge_forward (bool next);
287 void nudge_backward (bool next);
289 /* nudge initiated from context menu */
291 void nudge_forward_capture_offset ();
292 void nudge_backward_capture_offset ();
294 /* playhead/screen stuff */
296 void set_follow_playhead (bool yn);
297 void toggle_follow_playhead ();
298 bool follow_playhead() const { return _follow_playhead; }
299 bool dragging_playhead () const { return _dragging_playhead; }
301 void toggle_waveform_visibility ();
302 void toggle_waveforms_while_recording ();
303 void toggle_measure_visibility ();
304 void toggle_logo_visibility ();
306 /* SMPTE timecode & video sync */
308 void smpte_fps_chosen (ARDOUR::SmpteFormat format);
309 void video_pullup_chosen (ARDOUR::Session::PullupFormat pullup);
310 void subframes_per_frame_chosen (uint32_t);
312 void update_smpte_mode();
313 void update_video_pullup();
314 void update_subframes_per_frame ();
317 void toggle_auto_xfade ();
318 void toggle_xfades_active ();
319 void toggle_xfade_visibility ();
320 bool xfade_visibility() const { return _xfade_visibility; }
321 void update_xfade_visibility ();
322 void update_crossfade_model ();
323 void set_crossfade_model (ARDOUR::CrossfadeModel);
326 void set_layer_model (ARDOUR::LayerModel);
327 void update_layering_model ();
329 /* redirect shared ops menu. caller must free returned menu */
331 Gtk::Menu* redirect_menu ();
333 /* floating windows/transient */
335 void ensure_float (Gtk::Window&);
339 void scroll_tracks_down_line ();
340 void scroll_tracks_up_line ();
342 bool new_regionviews_display_gain () { return _new_regionviews_show_envelope; }
343 void prepare_for_cleanup ();
345 void maximise_editing_space();
346 void restore_editing_space();
348 void reset_x_origin (nframes_t);
349 void reset_zoom (double);
350 void reposition_and_zoom (nframes_t, double);
352 nframes64_t get_preferred_edit_position ();
354 bool update_mouse_speed ();
355 bool decelerate_mouse_speed ();
358 void map_transport_state ();
359 void map_position_change (nframes_t);
365 ARDOUR::Session *session;
368 // to keep track of the playhead position for control_scroll
369 boost::optional<nframes_t> _control_scroll_target;
371 PlaylistSelector* _playlist_selector;
373 void set_frames_per_unit (double);
375 Editing::MouseMode mouse_mode;
377 int post_maximal_editor_width;
378 int post_maximal_pane_position;
379 int pre_maximal_pane_position;
380 int pre_maximal_editor_width;
381 void pane_allocation_handler (Gtk::Allocation&, Gtk::Paned*);
383 Gtk::Notebook the_notebook;
384 Gtk::HPaned edit_pane;
386 Gtk::EventBox meter_base;
388 Gtk::EventBox marker_base;
389 Gtk::HBox marker_box;
390 Gtk::VBox scrollers_rulers_markers_box;
392 void location_changed (ARDOUR::Location *);
393 void location_flags_changed (ARDOUR::Location *, void *);
394 void refresh_location_display ();
395 void refresh_location_display_s (ARDOUR::Change);
396 void refresh_location_display_internal (ARDOUR::Locations::LocationList&);
397 void add_new_location (ARDOUR::Location *);
398 void location_gone (ARDOUR::Location *);
399 void remove_marker (ArdourCanvas::Item&, GdkEvent*);
400 gint really_remove_marker (ARDOUR::Location* loc);
401 void goto_nth_marker (int nth);
403 uint32_t location_marker_color;
404 uint32_t location_range_color;
405 uint32_t location_loop_color;
406 uint32_t location_punch_color;
407 uint32_t location_cd_marker_color;
409 struct LocationMarkers {
414 LocationMarkers () : start(0), end(0), valid (true) {}
420 void set_name (const string&);
421 void set_position (nframes_t start, nframes_t end = 0);
422 void set_color_rgba (uint32_t);
425 LocationMarkers *find_location_markers (ARDOUR::Location *) const;
426 ARDOUR::Location* find_location_from_marker (Marker *, bool& is_start) const;
427 Marker* entered_marker;
429 typedef std::map<ARDOUR::Location*,LocationMarkers *> LocationMarkerMap;
430 LocationMarkerMap location_markers;
432 void hide_marker (ArdourCanvas::Item*, GdkEvent*);
433 void clear_marker_display ();
434 void mouse_add_new_marker (nframes_t where, bool is_cd=false);
435 void update_cd_marker_display ();
436 void ensure_cd_marker_updated (LocationMarkers * lam, ARDOUR::Location * location);
438 TimeAxisView* clicked_trackview;
439 AudioTimeAxisView* clicked_audio_trackview;
440 RegionView* clicked_regionview;
441 RegionSelection latest_regionviews;
442 uint32_t clicked_selection;
443 CrossfadeView* clicked_crossfadeview;
444 ControlPoint* clicked_control_point;
446 void sort_track_selection ();
448 void get_relevant_audio_tracks (std::set<AudioTimeAxisView*>& relevant_tracks);
449 void get_equivalent_regions (RegionView* rv, std::vector<RegionView*>&);
450 void mapover_audio_tracks (sigc::slot<void,AudioTimeAxisView&,uint32_t> sl, TimeAxisView*);
452 /* functions to be passed to mapover_audio_tracks(), possibly with sigc::bind()-supplied arguments */
454 void mapped_get_equivalent_regions (RouteTimeAxisView&, uint32_t, RegionView*, vector<RegionView*>*);
455 void mapped_use_new_playlist (AudioTimeAxisView&, uint32_t);
456 void mapped_use_copy_playlist (AudioTimeAxisView&, uint32_t);
457 void mapped_clear_playlist (AudioTimeAxisView&, uint32_t);
461 void button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type);
462 bool button_release_can_deselect;
464 void catch_vanishing_regionview (RegionView *);
466 void set_selected_track (TimeAxisView&, Selection::Operation op = Selection::Set, bool no_remove=false);
467 void select_all_tracks ();
469 bool set_selected_control_point_from_click (Selection::Operation op = Selection::Set, bool no_remove=false);
470 void set_selected_track_from_click (bool press, Selection::Operation op = Selection::Set, bool no_remove=false);
471 void set_selected_track_as_side_effect (bool force = false);
472 bool set_selected_regionview_from_click (bool press, Selection::Operation op = Selection::Set, bool no_track_remove=false);
474 void set_selected_regionview_from_region_list (boost::shared_ptr<ARDOUR::Region> region, Selection::Operation op = Selection::Set);
475 bool set_selected_regionview_from_map_event (GdkEventAny*, StreamView*, boost::weak_ptr<ARDOUR::Region>);
476 void collect_new_region_view (RegionView *);
478 Gtk::Menu track_context_menu;
479 Gtk::Menu track_region_context_menu;
480 Gtk::Menu track_selection_context_menu;
481 Gtk::Menu track_crossfade_context_menu;
483 Gtk::MenuItem* region_edit_menu_split_item;
484 Gtk::MenuItem* region_edit_menu_split_multichannel_item;
485 Gtk::Menu * track_region_edit_playlist_menu;
486 Gtk::Menu * track_edit_playlist_submenu;
487 Gtk::Menu * track_selection_edit_playlist_submenu;
489 void popup_track_context_menu (int, int, ItemType, bool, nframes_t);
490 Gtk::Menu* build_track_context_menu (nframes_t);
491 Gtk::Menu* build_track_bus_context_menu (nframes_t);
492 Gtk::Menu* build_track_region_context_menu (nframes_t frame);
493 Gtk::Menu* build_track_crossfade_context_menu (nframes_t);
494 Gtk::Menu* build_track_selection_context_menu (nframes_t);
495 void add_dstream_context_items (Gtk::Menu_Helpers::MenuList&);
496 void add_bus_context_items (Gtk::Menu_Helpers::MenuList&);
497 void add_region_context_items (AudioStreamView*, boost::shared_ptr<ARDOUR::Region>, Gtk::Menu_Helpers::MenuList&);
498 void add_crossfade_context_items (AudioStreamView*, boost::shared_ptr<ARDOUR::Crossfade>, Gtk::Menu_Helpers::MenuList&, bool many);
499 void add_selection_context_items (Gtk::Menu_Helpers::MenuList&);
501 void handle_new_route (ARDOUR::Session::RouteList&);
502 void remove_route (TimeAxisView *);
505 Gtk::HBox global_hpacker;
506 Gtk::VBox global_vpacker;
509 Gdk::Cursor* current_canvas_cursor;
511 ArdourCanvas::CanvasAA track_canvas;
512 ArdourCanvas::CanvasAA time_canvas;
514 ArdourCanvas::Text* first_action_message;
515 ArdourCanvas::Text* verbose_canvas_cursor;
516 bool verbose_cursor_visible;
518 void parameter_changed (const char *);
520 bool track_canvas_motion (GdkEvent*);
522 void set_verbose_canvas_cursor (const string &, double x, double y);
523 void set_verbose_canvas_cursor_text (const string &);
524 void show_verbose_canvas_cursor();
525 void hide_verbose_canvas_cursor();
527 bool verbose_cursor_on; // so far unused
529 Gtk::EventBox time_canvas_event_box;
530 Gtk::EventBox track_canvas_event_box;
531 Gtk::EventBox time_button_event_box;
532 Gtk::Frame time_button_frame;
534 ArdourCanvas::Pixbuf* logo_item;
535 ArdourCanvas::Group* minsec_group;
536 ArdourCanvas::Group* bbt_group;
537 ArdourCanvas::Group* smpte_group;
538 ArdourCanvas::Group* frame_group;
539 ArdourCanvas::Group* tempo_group;
540 ArdourCanvas::Group* meter_group;
541 ArdourCanvas::Group* marker_group;
542 ArdourCanvas::Group* range_marker_group;
543 ArdourCanvas::Group* transport_marker_group;
544 ArdourCanvas::Group* cd_marker_group;
547 ruler_metric_smpte = 0,
548 ruler_metric_bbt = 1,
549 ruler_metric_frames = 2,
550 ruler_metric_minsec = 3,
552 ruler_time_tempo = 4,
553 ruler_time_meter = 5,
554 ruler_time_marker = 6,
555 ruler_time_range_marker = 7,
556 ruler_time_transport_marker = 8,
557 ruler_time_cd_marker = 9,
560 static GtkCustomMetric ruler_metrics[4];
561 bool ruler_shown[10];
562 bool no_ruler_shown_update;
564 gint ruler_button_press (GdkEventButton*);
565 gint ruler_button_release (GdkEventButton*);
566 gint ruler_mouse_motion (GdkEventMotion*);
568 gint ruler_pressed_button;
569 Gtk::Widget * ruler_grabbed_widget;
571 void initialize_rulers ();
572 void update_just_smpte ();
573 void update_fixed_rulers ();
574 void update_tempo_based_rulers ();
575 void popup_ruler_menu (nframes_t where = 0, ItemType type = RegionItem);
576 void update_ruler_visibility ();
577 void ruler_toggled (int);
578 gint ruler_label_button_release (GdkEventButton*);
579 void store_ruler_visibility ();
580 void restore_ruler_visibility ();
582 static gint _metric_get_smpte (GtkCustomRulerMark **, gdouble, gdouble, gint);
583 static gint _metric_get_bbt (GtkCustomRulerMark **, gdouble, gdouble, gint);
584 static gint _metric_get_frames (GtkCustomRulerMark **, gdouble, gdouble, gint);
585 static gint _metric_get_minsec (GtkCustomRulerMark **, gdouble, gdouble, gint);
587 gint metric_get_smpte (GtkCustomRulerMark **, gdouble, gdouble, gint);
588 gint metric_get_bbt (GtkCustomRulerMark **, gdouble, gdouble, gint);
589 gint metric_get_frames (GtkCustomRulerMark **, gdouble, gdouble, gint);
590 gint metric_get_minsec (GtkCustomRulerMark **, gdouble, gdouble, gint);
592 Gtk::Widget *_ruler_separator;
593 GtkWidget *_smpte_ruler;
594 GtkWidget *_bbt_ruler;
595 GtkWidget *_frames_ruler;
596 GtkWidget *_minsec_ruler;
597 Gtk::Widget *smpte_ruler;
598 Gtk::Widget *bbt_ruler;
599 Gtk::Widget *frames_ruler;
600 Gtk::Widget *minsec_ruler;
601 static Editor *ruler_editor;
603 static const double timebar_height;
604 guint32 visible_timebars;
605 Gtk::Menu *editor_ruler_menu;
607 ArdourCanvas::SimpleRect* tempo_bar;
608 ArdourCanvas::SimpleRect* meter_bar;
609 ArdourCanvas::SimpleRect* marker_bar;
610 ArdourCanvas::SimpleRect* range_marker_bar;
611 ArdourCanvas::SimpleRect* transport_marker_bar;
612 ArdourCanvas::SimpleRect* cd_marker_bar;
615 ArdourCanvas::SimpleLine* tempo_line;
616 ArdourCanvas::SimpleLine* meter_line;
617 ArdourCanvas::SimpleLine* marker_line;
618 ArdourCanvas::SimpleLine* range_marker_line;
619 ArdourCanvas::SimpleLine* transport_marker_line;
620 ArdourCanvas::SimpleLine* cd_marker_line;
622 Gtk::Label minsec_label;
623 Gtk::Label bbt_label;
624 Gtk::Label smpte_label;
625 Gtk::Label frame_label;
626 Gtk::Label tempo_label;
627 Gtk::Label meter_label;
628 Gtk::Label mark_label;
629 Gtk::Label range_mark_label;
630 Gtk::Label transport_mark_label;
631 Gtk::Label cd_mark_label;
634 Gtk::VBox time_button_vbox;
635 Gtk::HBox time_button_hbox;
639 ArdourCanvas::Points points;
640 ArdourCanvas::Line canvas_item;
641 nframes_t current_frame;
644 Cursor (Editor&, bool (Editor::*)(GdkEvent*,ArdourCanvas::Item*));
647 void set_position (nframes_t);
648 void set_length (double units);
649 void set_y_axis (double position);
652 friend struct Cursor; /* it needs access to several private
656 Cursor* playhead_cursor;
657 ArdourCanvas::Group* cursor_group;
659 void cursor_to_region_boundary (Cursor*, int32_t dir);
660 void cursor_to_next_region_boundary (Cursor*);
661 void cursor_to_previous_region_boundary (Cursor*);
662 void cursor_to_next_region_point (Cursor*, ARDOUR::RegionPoint);
663 void cursor_to_previous_region_point (Cursor*, ARDOUR::RegionPoint);
664 void cursor_to_region_point (Cursor*, ARDOUR::RegionPoint, int32_t dir);
665 void cursor_to_selection_start (Cursor *);
666 void cursor_to_selection_end (Cursor *);
668 void selected_marker_to_region_boundary (int32_t dir);
669 void selected_marker_to_next_region_boundary ();
670 void selected_marker_to_previous_region_boundary ();
671 void selected_marker_to_next_region_point (ARDOUR::RegionPoint);
672 void selected_marker_to_previous_region_point (ARDOUR::RegionPoint);
673 void selected_marker_to_region_point (ARDOUR::RegionPoint, int32_t dir);
674 void selected_marker_to_selection_start ();
675 void selected_marker_to_selection_end ();
677 void select_all_selectables_using_cursor (Cursor *, bool);
678 void select_all_selectables_using_edit (bool);
679 void select_all_selectables_between (bool within);
680 void select_range_between ();
682 boost::shared_ptr<ARDOUR::Region> find_next_region (nframes_t, ARDOUR::RegionPoint, int32_t dir, TrackViewList&, TimeAxisView ** = 0);
683 nframes64_t find_next_region_boundary (nframes64_t, int32_t dir, const TrackViewList&);
685 vector<nframes_t> region_boundary_cache;
686 void build_region_boundary_cache ();
688 Gtk::VBox trackview_vpacker;
691 Gtk::HBox bottom_hbox;
693 Gtk::Table edit_packer;
694 Gtk::VScrollbar edit_vscrollbar;
696 Gtk::Adjustment vertical_adjustment;
697 Gtk::Adjustment horizontal_adjustment;
699 Gtk::Layout controls_layout;
700 bool control_layout_scroll (GdkEventScroll* ev);
701 void controls_layout_size_request (Gtk::Requisition*);
703 Gtk::HScrollbar edit_hscrollbar;
704 bool _dragging_hscrollbar;
706 void reset_hscrollbar_stepping ();
708 bool hscrollbar_button_press (GdkEventButton*);
709 bool hscrollbar_button_release (GdkEventButton*);
710 void hscrollbar_allocate (Gtk::Allocation &alloc);
713 double canvas_height;
714 double full_canvas_height;
715 nframes_t last_canvas_frame;
717 bool track_canvas_map_handler (GdkEventAny*);
718 bool time_canvas_map_handler (GdkEventAny*);
720 gint edit_controls_button_release (GdkEventButton*);
721 Gtk::Menu *edit_controls_left_menu;
722 Gtk::Menu *edit_controls_right_menu;
724 Gtk::VBox track_canvas_vbox;
725 Gtk::VBox time_canvas_vbox;
726 Gtk::VBox edit_controls_vbox;
727 Gtk::HBox edit_controls_hbox;
729 void control_scroll (float);
730 bool deferred_control_scroll (nframes_t);
731 sigc::connection control_scroll_connection;
733 void tie_vertical_scrolling ();
734 void canvas_horizontally_scrolled ();
736 struct VisualChange {
743 nframes_t time_origin;
744 double frames_per_unit;
748 VisualChange() : pending ((VisualChange::Type) 0), time_origin (0), frames_per_unit (0), idle_handler_id (-1) {}
752 VisualChange pending_visual_change;
754 static int _idle_visual_changer (void *arg);
755 int idle_visual_changer ();
757 void queue_visual_change (nframes_t);
758 void queue_visual_change (double);
760 void end_location_changed (ARDOUR::Location*);
762 struct RegionListDisplayModelColumns : public Gtk::TreeModel::ColumnRecord {
763 RegionListDisplayModelColumns() {
768 Gtk::TreeModelColumn<Glib::ustring> name;
769 Gtk::TreeModelColumn<boost::shared_ptr<ARDOUR::Region> > region;
770 Gtk::TreeModelColumn<Gdk::Color> color_;
773 RegionListDisplayModelColumns region_list_columns;
774 Gtkmm2ext::DnDTreeView<boost::shared_ptr<ARDOUR::Region> > region_list_display;
776 Glib::RefPtr<Gtk::TreeStore> region_list_model;
777 Glib::RefPtr<Gtk::ToggleAction> toggle_full_region_list_action;
778 Glib::RefPtr<Gtk::ToggleAction> toggle_show_auto_regions_action;
780 void region_list_selection_changed ();
781 bool region_list_selection_filter (const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::Path& path, bool yn);
782 void region_name_edit (const Glib::ustring&, const Glib::ustring&);
783 void get_regions_corresponding_to (boost::shared_ptr<ARDOUR::Region> region, std::vector<RegionView*>& regions);
785 Gtk::Menu *region_list_menu;
786 Gtk::ScrolledWindow region_list_scroller;
787 Gtk::Frame region_list_frame;
789 bool region_list_display_key_press (GdkEventKey *);
790 bool region_list_display_key_release (GdkEventKey *);
791 bool region_list_display_button_press (GdkEventButton *);
792 bool region_list_display_button_release (GdkEventButton *);
793 void region_list_clear ();
794 void region_list_selection_mapover (sigc::slot<void,boost::shared_ptr<ARDOUR::Region> >);
795 void build_region_list_menu ();
796 void show_region_list_display_context_menu (int button, int time);
798 bool show_automatic_regions_in_region_list;
799 Editing::RegionListSortType region_list_sort_type;
801 void reset_region_list_sort_direction (bool);
802 void reset_region_list_sort_type (Editing::RegionListSortType);
804 void toggle_full_region_list ();
805 void toggle_show_auto_regions ();
807 int region_list_sorter (Gtk::TreeModel::iterator, Gtk::TreeModel::iterator);
811 Gtk::ScrolledWindow snapshot_display_scroller;
812 struct SnapshotDisplayModelColumns : public Gtk::TreeModel::ColumnRecord {
813 SnapshotDisplayModelColumns() {
817 Gtk::TreeModelColumn<Glib::ustring> visible_name;
818 Gtk::TreeModelColumn<Glib::ustring> real_name;
821 SnapshotDisplayModelColumns snapshot_display_columns;
822 Glib::RefPtr<Gtk::ListStore> snapshot_display_model;
823 Gtk::TreeView snapshot_display;
824 Gtk::Menu snapshot_context_menu;
826 bool snapshot_display_button_press (GdkEventButton*);
827 void snapshot_display_selection_changed ();
828 void redisplay_snapshots();
829 void popup_snapshot_context_menu (int, int32_t, Glib::ustring);
831 /* named selections */
833 struct NamedSelectionDisplayModelColumns : public Gtk::TreeModel::ColumnRecord {
834 NamedSelectionDisplayModelColumns() {
838 Gtk::TreeModelColumn<Glib::ustring> text;
839 Gtk::TreeModelColumn<ARDOUR::NamedSelection*> selection;
842 NamedSelectionDisplayModelColumns named_selection_columns;
843 Glib::RefPtr<Gtk::TreeStore> named_selection_model;
845 Gtkmm2ext::DnDTreeView<ARDOUR::NamedSelection*> named_selection_display;
846 Gtk::ScrolledWindow named_selection_scroller;
848 void create_named_selection ();
849 void paste_named_selection (float times);
850 void remove_selected_named_selections ();
851 void remove_snapshot (Glib::ustring);
852 void rename_snapshot (Glib::ustring);
854 void handle_new_named_selection ();
855 void add_named_selection_to_named_selection_display (ARDOUR::NamedSelection&);
856 void redisplay_named_selections ();
858 bool named_selection_display_button_release (GdkEventButton *ev);
859 bool named_selection_display_key_release (GdkEventKey *ev);
860 void named_selection_display_selection_changed ();
863 TrackViewList track_views;
864 TimeAxisView *trackview_by_y_position (double ypos);
866 static Gdk::Cursor* cross_hair_cursor;
867 static Gdk::Cursor* trimmer_cursor;
868 static Gdk::Cursor* selector_cursor;
869 static Gdk::Cursor* grabber_cursor;
870 static Gdk::Cursor* zoom_cursor;
871 static Gdk::Cursor* time_fx_cursor;
872 static Gdk::Cursor* fader_cursor;
873 static Gdk::Cursor* speaker_cursor;
874 static Gdk::Cursor* wait_cursor;
875 static Gdk::Cursor* timebar_cursor;
876 static Gdk::Cursor* transparent_cursor;
878 static void build_cursors ();
880 sigc::connection scroll_connection;
881 nframes_t last_update_frame;
882 void center_screen (nframes_t);
883 void center_screen_internal (nframes_t, float);
885 void update_current_screen ();
887 void session_going_away ();
889 nframes_t cut_buffer_start;
890 nframes_t cut_buffer_length;
892 bool typed_event (ArdourCanvas::Item*, GdkEvent*, ItemType);
893 bool button_press_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
894 bool button_release_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
895 bool motion_handler (ArdourCanvas::Item*, GdkEvent*, ItemType, bool from_autoscroll = false);
896 bool enter_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
897 bool leave_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
899 /* KEYMAP HANDLING */
901 void register_actions ();
903 int ensure_cursor (nframes_t* pos);
905 void handle_new_audio_region (boost::weak_ptr<ARDOUR::AudioRegion>);
906 void handle_audio_region_removed (boost::weak_ptr<ARDOUR::AudioRegion>);
907 void add_audio_region_to_region_display (boost::shared_ptr<ARDOUR::AudioRegion>);
908 void region_hidden (boost::shared_ptr<ARDOUR::Region>);
909 void redisplay_regions ();
910 void insert_into_tmp_audio_regionlist(boost::shared_ptr<ARDOUR::AudioRegion>);
912 list<boost::shared_ptr<ARDOUR::AudioRegion> > tmp_audio_region_list;
914 void cut_copy (Editing::CutCopyOp);
915 void cut_copy_points (Editing::CutCopyOp);
916 void cut_copy_regions (Editing::CutCopyOp);
917 void cut_copy_ranges (Editing::CutCopyOp);
920 void paste_internal (nframes_t position, float times);
922 /* EDITING OPERATIONS */
924 void reset_point_selection ();
925 void toggle_region_mute ();
926 void toggle_region_lock ();
927 void toggle_region_opaque ();
928 void raise_region ();
929 void raise_region_to_top ();
930 void lower_region ();
931 void lower_region_to_bottom ();
932 void split_region ();
933 void split_region_at (nframes_t);
934 void split_regions_at (nframes_t, RegionSelection&);
935 void crop_region_to_selection ();
936 void crop_region_to (nframes_t start, nframes_t end);
937 void set_sync_point (nframes64_t, const RegionSelection&);
938 void set_region_sync_from_edit_point ();
939 void remove_region_sync();
940 void align_selection (ARDOUR::RegionPoint, nframes_t position, const RegionSelection&);
941 void align_selection_relative (ARDOUR::RegionPoint point, nframes_t position, const RegionSelection&);
942 void align_region (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, nframes_t position);
943 void align_region_internal (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, nframes_t position);
944 void remove_clicked_region ();
945 void destroy_clicked_region ();
947 void duplicate_some_regions (RegionSelection&, float times);
948 void duplicate_selection (float times);
949 void region_fill_selection ();
951 void region_fill_track ();
952 void audition_playlist_region_standalone (boost::shared_ptr<ARDOUR::Region>);
953 void audition_playlist_region_via_route (boost::shared_ptr<ARDOUR::Region>, ARDOUR::Route&);
954 void split_multichannel_region();
955 void reverse_region ();
956 void normalize_region ();
957 void denormalize_region ();
959 void audition_region_from_region_list ();
960 void hide_region_from_region_list ();
961 void remove_region_from_region_list ();
963 void align (ARDOUR::RegionPoint);
964 void align_relative (ARDOUR::RegionPoint);
973 void paste (float times);
975 int get_prefix (float&, bool&);
977 void keyboard_paste ();
978 void keyboard_insert_region_list_selection ();
980 void region_from_selection ();
981 void create_region_from_selection (std::vector<boost::shared_ptr<ARDOUR::AudioRegion> >&);
984 void rename_region ();
985 void rename_region_finished (bool);
987 void play_from_start ();
988 void play_from_edit_point ();
989 void play_selected_region ();
990 void audition_selected_region ();
991 void loop_selected_region ();
992 void play_location (ARDOUR::Location&);
993 void loop_location (ARDOUR::Location&);
995 Editing::ZoomFocus zoom_focus;
997 void temporal_zoom_selection ();
998 void temporal_zoom_session ();
999 void temporal_zoom (gdouble scale);
1000 void temporal_zoom_by_frame (nframes_t start, nframes_t end, const string & op);
1001 void temporal_zoom_to_frame (bool coarser, nframes_t frame);
1003 void amplitude_zoom (gdouble scale);
1004 void amplitude_zoom_step (bool in);
1006 void insert_region_list_drag (boost::shared_ptr<ARDOUR::AudioRegion>, int x, int y);
1007 void insert_region_list_selection (float times);
1009 void add_external_audio_action (Editing::ImportMode);
1010 void external_audio_dialog ();
1011 bool check_multichannel_status (const std::vector<Glib::ustring>& paths);
1013 SoundFileOmega* sfbrowser;
1015 void bring_in_external_audio (Editing::ImportMode mode, nframes64_t& pos);
1016 void do_import (vector<Glib::ustring> paths, Editing::ImportDisposition, Editing::ImportMode mode, ARDOUR::SrcQuality, nframes64_t&);
1018 void _do_embed (vector<Glib::ustring> paths, Editing::ImportDisposition, Editing::ImportMode mode, nframes64_t&);
1019 void do_embed (vector<Glib::ustring> paths, Editing::ImportDisposition, Editing::ImportMode mode, nframes64_t&);
1020 bool idle_do_embed (vector<Glib::ustring> paths, Editing::ImportDisposition, Editing::ImportMode mode, nframes64_t&);
1022 int import_sndfiles (vector<Glib::ustring> paths, Editing::ImportMode mode, ARDOUR::SrcQuality, nframes64_t& pos,
1023 int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::AudioTrack>&);
1024 int embed_sndfiles (vector<Glib::ustring> paths, bool multiple_files, bool& check_sample_rate, Editing::ImportMode mode,
1025 nframes64_t& pos, int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::AudioTrack>&);
1027 int add_sources (vector<Glib::ustring> paths, ARDOUR::SourceList& sources, nframes64_t& pos, Editing::ImportMode,
1028 int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::AudioTrack>&, bool add_channel_suffix);
1029 int finish_bringing_in_audio (boost::shared_ptr<ARDOUR::AudioRegion> region, uint32_t, uint32_t, nframes64_t& pos, Editing::ImportMode mode,
1030 boost::shared_ptr<ARDOUR::AudioTrack>& existing_track);
1032 boost::shared_ptr<ARDOUR::AudioTrack> get_nth_selected_audio_track (int nth) const;
1034 /* generic interthread progress window */
1036 ArdourDialog* interthread_progress_window;
1037 Gtk::Label interthread_progress_label;
1038 Gtk::VBox interthread_progress_vbox;
1039 Gtk::ProgressBar interthread_progress_bar;
1040 Gtk::Button interthread_cancel_button;
1041 Gtk::Label interthread_cancel_label;
1042 sigc::connection interthread_progress_connection;
1043 void interthread_cancel_clicked ();
1044 void build_interthread_progress_window ();
1045 ARDOUR::InterThreadInfo* current_interthread_info;
1048 AnalysisWindow* analysis_window;
1051 /* import specific info */
1053 ARDOUR::Session::import_status import_status;
1054 gint import_progress_timeout (void *);
1055 static void *_import_thread (void *);
1056 void* import_thread ();
1058 /* to support this ... */
1060 void import_audio (bool as_tracks);
1061 void do_import (vector<Glib::ustring> paths, bool split, bool as_tracks);
1063 void move_to_start ();
1064 void move_to_end ();
1066 void center_playhead ();
1067 void center_edit_point ();
1068 void edit_cursor_backward ();
1069 void edit_cursor_forward ();
1070 void playhead_backward ();
1071 void playhead_forward ();
1072 void scroll_playhead (bool forward);
1073 void scroll_backward (float pages=0.8f);
1074 void scroll_forward (float pages=0.8f);
1075 void scroll_tracks_down ();
1076 void scroll_tracks_up ();
1077 void delete_sample_forward ();
1078 void delete_sample_backward ();
1079 void delete_screen ();
1080 void search_backwards ();
1081 void search_forwards ();
1083 void clear_markers ();
1084 void clear_ranges ();
1085 void clear_locations ();
1086 void unhide_markers ();
1087 void unhide_ranges ();
1088 void jump_forward_to_mark ();
1089 void jump_backward_to_mark ();
1090 void cursor_align (bool playhead_to_edit);
1092 void remove_last_capture ();
1093 void select_all_selectables_using_time_selection ();
1094 void select_all_selectables_using_loop();
1095 void select_all_selectables_using_punch();
1096 void set_selection_from_range (ARDOUR::Location&);
1097 void set_selection_from_punch ();
1098 void set_selection_from_loop ();
1099 void set_selection_from_audio_region ();
1101 void add_location_mark (nframes64_t where);
1102 void add_location_from_audio_region ();
1103 void add_location_from_selection ();
1104 void set_loop_from_selection (bool play);
1105 void set_punch_from_selection ();
1107 void set_loop_from_edit_range (bool play);
1108 void set_punch_from_edit_range ();
1110 void set_loop_range (nframes_t start, nframes_t end, std::string cmd);
1111 void set_punch_range (nframes_t start, nframes_t end, std::string cmd);
1113 void add_location_from_playhead_cursor ();
1114 bool select_new_marker;
1116 void reverse_selection ();
1117 void edit_envelope ();
1119 void start_scrolling ();
1120 void stop_scrolling ();
1123 double last_scrub_x;
1124 int scrubbing_direction;
1125 int scrub_reversals;
1126 int scrub_reverse_distance;
1128 void keyboard_selection_begin ();
1129 void keyboard_selection_finish (bool add);
1130 bool have_pending_keyboard_selection;
1131 nframes_t pending_keyboard_selection_start;
1133 boost::shared_ptr<ARDOUR::Region> select_region_for_operation (int dir, TimeAxisView **tv);
1134 void extend_selection_to_end_of_region (bool next);
1135 void extend_selection_to_start_of_region (bool previous);
1137 Editing::SnapType snap_type;
1138 Editing::SnapMode snap_mode;
1139 double snap_threshold;
1141 void handle_gui_changes (const string &, void *);
1143 void hide_all_tracks (bool with_select);
1146 LineDragInfo current_line_drag_info;
1148 void start_grab (GdkEvent*, Gdk::Cursor* cursor = 0);
1149 bool end_grab (ArdourCanvas::Item*, GdkEvent*);
1150 void swap_grab (ArdourCanvas::Item*, Gdk::Cursor* cursor, uint32_t time);
1152 Gtk::Menu fade_context_menu;
1153 void popup_fade_context_menu (int, int, ArdourCanvas::Item*, ItemType);
1155 void start_fade_in_grab (ArdourCanvas::Item*, GdkEvent*);
1156 void start_fade_out_grab (ArdourCanvas::Item*, GdkEvent*);
1157 void fade_in_drag_motion_callback (ArdourCanvas::Item*, GdkEvent*);
1158 void fade_out_drag_motion_callback (ArdourCanvas::Item*, GdkEvent*);
1159 void fade_in_drag_finished_callback (ArdourCanvas::Item*, GdkEvent*);
1160 void fade_out_drag_finished_callback (ArdourCanvas::Item*, GdkEvent*);
1162 void set_fade_in_shape (ARDOUR::AudioRegion::FadeShape);
1163 void set_fade_out_shape (ARDOUR::AudioRegion::FadeShape);
1165 void set_fade_length (bool in);
1167 void set_fade_in_active (bool);
1168 void set_fade_out_active (bool);
1170 std::set<boost::shared_ptr<ARDOUR::Playlist> > motion_frozen_playlists;
1171 RegionSelection pre_drag_region_selection;
1172 void region_drag_motion_callback (ArdourCanvas::Item*, GdkEvent*);
1173 void region_drag_finished_callback (ArdourCanvas::Item*, GdkEvent*);
1175 bool _dragging_playhead;
1176 bool _dragging_edit_point;
1178 void cursor_drag_motion_callback (ArdourCanvas::Item*, GdkEvent*);
1179 void cursor_drag_finished_callback (ArdourCanvas::Item*, GdkEvent*);
1180 void marker_drag_motion_callback (ArdourCanvas::Item*, GdkEvent*);
1181 void marker_drag_finished_callback (ArdourCanvas::Item*, GdkEvent*);
1182 void control_point_drag_motion_callback (ArdourCanvas::Item*, GdkEvent*);
1183 void control_point_drag_finished_callback (ArdourCanvas::Item*, GdkEvent*);
1184 void line_drag_motion_callback (ArdourCanvas::Item*, GdkEvent*);
1185 void line_drag_finished_callback (ArdourCanvas::Item*, GdkEvent*);
1187 void tempo_marker_drag_motion_callback (ArdourCanvas::Item*, GdkEvent*);
1188 void tempo_marker_drag_finished_callback (ArdourCanvas::Item*, GdkEvent*);
1189 void meter_marker_drag_motion_callback (ArdourCanvas::Item*, GdkEvent*);
1190 void meter_marker_drag_finished_callback (ArdourCanvas::Item*, GdkEvent*);
1192 gint mouse_rename_region (ArdourCanvas::Item*, GdkEvent*);
1194 void start_region_grab (ArdourCanvas::Item*, GdkEvent*);
1195 void start_region_copy_grab (ArdourCanvas::Item*, GdkEvent*);
1196 void start_region_brush_grab (ArdourCanvas::Item*, GdkEvent*);
1197 void start_selection_grab (ArdourCanvas::Item*, GdkEvent*);
1198 void start_cursor_grab (ArdourCanvas::Item*, GdkEvent*);
1199 void start_marker_grab (ArdourCanvas::Item*, GdkEvent*);
1200 void start_control_point_grab (ArdourCanvas::Item*, GdkEvent*);
1201 void start_line_grab_from_regionview (ArdourCanvas::Item*, GdkEvent*);
1202 void start_line_grab_from_line (ArdourCanvas::Item*, GdkEvent*);
1203 void start_line_grab (AutomationLine *, GdkEvent*);
1204 void start_tempo_marker_grab (ArdourCanvas::Item*, GdkEvent*);
1205 void start_tempo_marker_copy_grab (ArdourCanvas::Item*, GdkEvent*);
1206 void start_meter_marker_grab (ArdourCanvas::Item*, GdkEvent*);
1207 void start_meter_marker_copy_grab (ArdourCanvas::Item*, GdkEvent*);
1209 void region_view_item_click (AudioRegionView&, GdkEventButton*);
1211 void remove_gain_control_point (ArdourCanvas::Item*, GdkEvent*);
1212 void remove_control_point (ArdourCanvas::Item*, GdkEvent*);
1214 void mouse_brush_insert_region (RegionView*, nframes_t pos);
1215 void brush (nframes_t);
1217 void show_verbose_time_cursor (nframes_t frame, double offset = 0, double xpos=-1, double ypos=-1);
1218 void show_verbose_duration_cursor (nframes_t start, nframes_t end, double offset = 0, double xpos=-1, double ypos=-1);
1220 /* Canvas event handlers */
1222 bool canvas_control_point_event (GdkEvent* event,ArdourCanvas::Item*, ControlPoint*);
1223 bool canvas_line_event (GdkEvent* event,ArdourCanvas::Item*, AutomationLine*);
1224 bool canvas_selection_rect_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1225 bool canvas_selection_start_trim_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1226 bool canvas_selection_end_trim_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1227 bool canvas_crossfade_view_event (GdkEvent* event,ArdourCanvas::Item*, CrossfadeView*);
1228 bool canvas_fade_in_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1229 bool canvas_fade_in_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1230 bool canvas_fade_out_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1231 bool canvas_fade_out_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1232 bool canvas_region_view_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1233 bool canvas_region_view_name_highlight_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1234 bool canvas_region_view_name_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1235 bool canvas_stream_view_event (GdkEvent* event,ArdourCanvas::Item*, RouteTimeAxisView*);
1236 bool canvas_marker_event (GdkEvent* event,ArdourCanvas::Item*, Marker*);
1237 bool canvas_zoom_rect_event (GdkEvent* event,ArdourCanvas::Item*);
1238 bool canvas_tempo_marker_event (GdkEvent* event,ArdourCanvas::Item*, TempoMarker*);
1239 bool canvas_meter_marker_event (GdkEvent* event,ArdourCanvas::Item*, MeterMarker*);
1240 bool canvas_automation_track_event(GdkEvent* event, ArdourCanvas::Item*, AutomationTimeAxisView*) ;
1242 bool canvas_tempo_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1243 bool canvas_meter_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1244 bool canvas_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1245 bool canvas_range_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1246 bool canvas_transport_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1247 bool canvas_cd_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1249 bool canvas_imageframe_item_view_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1250 bool canvas_imageframe_view_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameTimeAxis*);
1251 bool canvas_imageframe_start_handle_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1252 bool canvas_imageframe_end_handle_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1253 bool canvas_marker_time_axis_view_event(GdkEvent* event, ArdourCanvas::Item*,MarkerTimeAxis*);
1254 bool canvas_markerview_item_view_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1255 bool canvas_markerview_start_handle_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1256 bool canvas_markerview_end_handle_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1258 /* non-public event handlers */
1260 bool canvas_playhead_cursor_event (GdkEvent* event, ArdourCanvas::Item*);
1261 bool track_canvas_scroll (GdkEventScroll* event);
1263 bool track_canvas_scroll_event (GdkEventScroll* event);
1264 bool track_canvas_button_press_event (GdkEventButton* event);
1265 bool track_canvas_button_release_event (GdkEventButton* event);
1266 bool track_canvas_motion_notify_event (GdkEventMotion* event);
1268 Gtk::Allocation canvas_allocation;
1269 bool canvas_idle_queued;
1270 void track_canvas_allocate (Gtk::Allocation alloc);
1271 bool track_canvas_size_allocated ();
1273 void set_playhead_cursor ();
1275 void kbd_driver (sigc::slot<void,GdkEvent*>, bool use_track_canvas = true, bool use_time_canvas = true, bool can_select = true);
1276 void kbd_mute_unmute_region ();
1278 void kbd_audition ();
1280 void kbd_do_brush (GdkEvent*);
1281 void kbd_do_audition (GdkEvent*);
1283 void handle_new_duration ();
1284 void initialize_canvas ();
1285 void reset_scrolling_region (Gtk::Allocation* alloc = 0);
1287 /* display control */
1289 bool _show_measures;
1290 bool _show_waveforms;
1291 bool _follow_playhead;
1292 bool _show_waveforms_recording;
1294 ARDOUR::TempoMap::BBTPointList *current_bbt_points;
1296 typedef vector<ArdourCanvas::SimpleLine*> TimeLineList;
1297 TimeLineList free_measure_lines;
1298 TimeLineList used_measure_lines;
1300 ArdourCanvas::Group* time_line_group;
1301 ArdourCanvas::SimpleLine* get_time_line ();
1302 void hide_measures ();
1303 void draw_measures ();
1304 bool lazy_hide_and_draw_measures ();
1306 void new_tempo_section ();
1308 void mouse_add_new_tempo_event (nframes_t where);
1309 void mouse_add_new_meter_event (nframes_t where);
1311 void remove_tempo_marker (ArdourCanvas::Item*);
1312 void remove_meter_marker (ArdourCanvas::Item*);
1313 gint real_remove_tempo_marker (ARDOUR::TempoSection*);
1314 gint real_remove_meter_marker (ARDOUR::MeterSection*);
1316 void edit_tempo_section (ARDOUR::TempoSection*);
1317 void edit_meter_section (ARDOUR::MeterSection*);
1318 void edit_tempo_marker (ArdourCanvas::Item*);
1319 void edit_meter_marker (ArdourCanvas::Item*);
1321 void marker_menu_edit ();
1322 void marker_menu_remove ();
1323 void marker_menu_rename ();
1324 void marker_menu_lock (bool yn);
1325 void marker_menu_hide ();
1326 void marker_menu_loop_range ();
1327 void marker_menu_select_all_selectables_using_range ();
1328 void marker_menu_select_using_range ();
1329 void marker_menu_separate_regions_using_location ();
1330 void marker_menu_play_from ();
1331 void marker_menu_play_range ();
1332 void marker_menu_set_playhead ();
1333 void marker_menu_set_from_playhead ();
1334 void marker_menu_set_from_selection ();
1335 void new_transport_marker_menu_set_loop ();
1336 void new_transport_marker_menu_set_punch ();
1337 void update_loop_range_view (bool visibility=false);
1338 void update_punch_range_view (bool visibility=false);
1339 gint new_transport_marker_menu_popdown (GdkEventAny*);
1340 void marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1341 void tm_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1342 void transport_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1343 void new_transport_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1344 void build_range_marker_menu (bool loop_or_punch);
1345 void build_marker_menu (bool start_or_end);
1346 void build_tm_marker_menu ();
1347 void build_new_transport_marker_menu ();
1349 Gtk::Menu* tm_marker_menu;
1350 Gtk::Menu* marker_menu;
1351 Gtk::Menu* start_end_marker_menu;
1352 Gtk::Menu* range_marker_menu;
1353 Gtk::Menu* transport_marker_menu;
1354 Gtk::Menu* new_transport_marker_menu;
1355 Gtk::Menu* cd_marker_menu;
1356 ArdourCanvas::Item* marker_menu_item;
1358 typedef list<Marker*> Marks;
1361 void remove_metric_marks ();
1362 void draw_metric_marks (const ARDOUR::Metrics& metrics);
1364 void tempo_map_changed (ARDOUR::Change);
1365 void redisplay_tempo (bool immediate_redraw);
1367 void snap_to (nframes64_t& first, int32_t direction = 0, bool for_mark = false);
1368 void snap_to (nframes_t& first, int32_t direction = 0, bool for_mark = false) {
1369 /* XXX remove this function when everything moves to 64 bit frame counts */
1370 nframes64_t first64 = first;
1371 snap_to (first64, direction, for_mark);
1372 first = (nframes_t) first64;
1375 uint32_t bbt_beat_subdivision;
1379 Gtk::ToggleButton editor_mixer_button;
1381 void editor_mixer_button_toggled ();
1383 AudioClock edit_point_clock;
1384 AudioClock zoom_range_clock;
1385 Gtk::Button zoom_in_button;
1386 Gtk::Button zoom_out_button;
1387 Gtk::Button zoom_out_full_button;
1388 Gtk::Button zoom_onetoone_button;
1390 Gtk::VBox toolbar_clock_vbox;
1391 Gtk::VBox toolbar_selection_clock_vbox;
1392 Gtk::Table toolbar_selection_clock_table;
1393 Gtk::Label toolbar_selection_cursor_label;
1395 Gtk::HBox mouse_mode_button_box;
1396 Gtkmm2ext::TearOff* mouse_mode_tearoff;
1397 Gtk::ToggleButton mouse_select_button;
1398 Gtk::ToggleButton mouse_move_button;
1399 Gtk::ToggleButton mouse_gain_button;
1400 Gtk::ToggleButton mouse_zoom_button;
1401 Gtk::ToggleButton mouse_timefx_button;
1402 Gtk::ToggleButton mouse_audition_button;
1403 GroupedButtons *mouse_mode_button_set;
1404 void mouse_mode_toggled (Editing::MouseMode m);
1405 bool ignore_mouse_mode_toggle;
1407 gint mouse_select_button_release (GdkEventButton*);
1409 Gtk::VBox automation_box;
1410 Gtk::Button automation_mode_button;
1411 Gtk::ToggleButton global_automation_button;
1413 Gtk::ComboBoxText edit_mode_selector;
1414 Gtk::VBox edit_mode_box;
1416 void set_edit_mode (ARDOUR::EditMode);
1417 void cycle_edit_mode ();
1418 void edit_mode_selection_done ();
1420 Gtk::ComboBoxText snap_type_selector;
1421 Gtk::ComboBoxText snap_mode_selector;
1424 std::vector<std::string> snap_type_strings;
1425 std::vector<std::string> snap_mode_strings;
1427 void snap_type_selection_done ();
1428 void snap_mode_selection_done ();
1429 void snap_mode_chosen (Editing::SnapMode);
1430 void snap_type_chosen (Editing::SnapType);
1432 Glib::RefPtr<Gtk::RadioAction> snap_type_action (Editing::SnapType);
1433 Glib::RefPtr<Gtk::RadioAction> snap_mode_action (Editing::SnapMode);
1435 Gtk::ComboBoxText zoom_focus_selector;
1436 Gtk::VBox zoom_focus_box;
1438 std::vector<std::string> zoom_focus_strings;
1440 void zoom_focus_selection_done ();
1441 void zoom_focus_chosen (Editing::ZoomFocus);
1443 Glib::RefPtr<Gtk::RadioAction> zoom_focus_action (Editing::ZoomFocus);
1447 void zoom_adjustment_changed();
1449 void edit_point_clock_changed();
1451 void setup_toolbar ();
1453 Gtkmm2ext::TearOff* tools_tearoff;
1454 Gtk::HBox toolbar_hbox;
1455 Gtk::EventBox toolbar_base;
1456 Gtk::Frame toolbar_frame;
1458 /* selection process */
1460 Selection* selection;
1461 Selection* cut_buffer;
1463 void time_selection_changed ();
1464 void track_selection_changed ();
1465 void region_selection_changed ();
1466 void point_selection_changed ();
1467 void marker_selection_changed ();
1476 void start_selection_op (ArdourCanvas::Item* item, GdkEvent* event, SelectionOp);
1477 void drag_selection (ArdourCanvas::Item* item, GdkEvent* event);
1478 void end_selection_op (ArdourCanvas::Item* item, GdkEvent* event);
1479 void cancel_selection ();
1481 void region_selection_op (void (ARDOUR::Region::*pmf)(void));
1482 void region_selection_op (void (ARDOUR::Region::*pmf)(void*), void*);
1483 void region_selection_op (void (ARDOUR::Region::*pmf)(bool), bool);
1485 bool audio_region_selection_covers (nframes_t where);
1487 /* transport range select process */
1488 enum RangeMarkerOp {
1490 CreateTransportMarker,
1494 void start_range_markerbar_op (ArdourCanvas::Item* item, GdkEvent* event, RangeMarkerOp);
1495 void drag_range_markerbar_op (ArdourCanvas::Item* item, GdkEvent* event);
1496 void end_range_markerbar_op (ArdourCanvas::Item* item, GdkEvent* event);
1498 ArdourCanvas::SimpleRect* range_bar_drag_rect;
1499 ArdourCanvas::SimpleRect* transport_bar_drag_rect;
1500 ArdourCanvas::Line* marker_drag_line;
1501 ArdourCanvas::Points marker_drag_line_points;
1502 ArdourCanvas::SimpleRect* range_marker_drag_rect;
1504 void update_marker_drag_item (ARDOUR::Location *);
1506 ArdourCanvas::SimpleRect *transport_bar_range_rect;
1507 ArdourCanvas::SimpleRect *transport_bar_preroll_rect;
1508 ArdourCanvas::SimpleRect *transport_bar_postroll_rect;
1509 ArdourCanvas::SimpleRect *transport_loop_range_rect;
1510 ArdourCanvas::SimpleRect *transport_punch_range_rect;
1511 ArdourCanvas::SimpleLine *transport_punchin_line;
1512 ArdourCanvas::SimpleLine *transport_punchout_line;
1513 ArdourCanvas::SimpleRect *transport_preroll_rect;
1514 ArdourCanvas::SimpleRect *transport_postroll_rect;
1516 ARDOUR::Location* transport_loop_location();
1517 ARDOUR::Location* transport_punch_location();
1519 ARDOUR::Location *temp_location;
1521 /* object rubberband select process */
1523 void start_rubberband_select (ArdourCanvas::Item* item, GdkEvent* event);
1524 void drag_rubberband_select (ArdourCanvas::Item* item, GdkEvent* event);
1525 void end_rubberband_select (ArdourCanvas::Item* item, GdkEvent* event);
1527 bool select_all_within (nframes_t start, nframes_t end, gdouble topy, gdouble boty, const TrackViewList&, Selection::Operation op);
1529 ArdourCanvas::SimpleRect *rubberband_rect;
1531 /* mouse zoom process */
1533 void start_mouse_zoom (ArdourCanvas::Item* item, GdkEvent* event);
1534 void drag_mouse_zoom (ArdourCanvas::Item* item, GdkEvent* event);
1535 void end_mouse_zoom (ArdourCanvas::Item* item, GdkEvent* event);
1537 ArdourCanvas::SimpleRect *zoom_rect;
1538 void reposition_zoom_rect (nframes_t start, nframes_t end);
1540 /* diskstream/route display management */
1542 struct RouteDisplayModelColumns : public Gtk::TreeModel::ColumnRecord {
1543 RouteDisplayModelColumns() {
1549 Gtk::TreeModelColumn<Glib::ustring> text;
1550 Gtk::TreeModelColumn<bool> visible;
1551 Gtk::TreeModelColumn<TimeAxisView*> tv;
1552 Gtk::TreeModelColumn<boost::shared_ptr<ARDOUR::Route> > route;
1555 RouteDisplayModelColumns route_display_columns;
1556 Glib::RefPtr<Gtk::ListStore> route_display_model;
1557 Glib::RefPtr<Gtk::TreeSelection> route_display_selection;
1559 Gtkmm2ext::DnDTreeView<boost::shared_ptr<ARDOUR::Route> > route_list_display;
1560 Gtk::ScrolledWindow route_list_scroller;
1561 Gtk::Menu* route_list_menu;
1563 void sync_order_keys ();
1564 bool ignore_route_order_sync;
1566 bool route_list_display_button_press (GdkEventButton*);
1567 bool route_list_selection_filter (const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::Path& path, bool yn);
1569 void route_list_change (const Gtk::TreeModel::Path&,const Gtk::TreeModel::iterator&);
1570 void route_list_delete (const Gtk::TreeModel::Path&);
1571 void track_list_reorder (const Gtk::TreeModel::Path& path, const Gtk::TreeModel::iterator& iter, int* new_order);
1573 void initial_route_list_display ();
1574 void redisplay_route_list();
1575 bool ignore_route_list_reorder;
1576 bool no_route_list_redisplay;
1578 void build_route_list_menu ();
1579 void show_route_list_menu ();
1581 void show_all_routes ();
1582 void hide_all_routes ();
1583 void show_all_audiotracks ();
1584 void hide_all_audiotracks ();
1585 void show_all_audiobus ();
1586 void hide_all_audiobus ();
1588 void set_all_tracks_visibility (bool yn);
1589 void set_all_audio_visibility (int type, bool yn);
1591 /* edit group management */
1593 struct GroupListModelColumns : public Gtk::TreeModel::ColumnRecord {
1594 GroupListModelColumns () {
1600 Gtk::TreeModelColumn<bool> is_active;
1601 Gtk::TreeModelColumn<bool> is_visible;
1602 Gtk::TreeModelColumn<std::string> text;
1603 Gtk::TreeModelColumn<ARDOUR::RouteGroup*> routegroup;
1606 GroupListModelColumns group_columns;
1607 Glib::RefPtr<Gtk::ListStore> group_model;
1608 Glib::RefPtr<Gtk::TreeSelection> group_selection;
1610 Gtk::TreeView edit_group_display;
1611 Gtk::ScrolledWindow edit_group_display_scroller;
1612 Gtk::Menu* edit_group_list_menu;
1614 void build_edit_group_list_menu ();
1615 void activate_all_edit_groups ();
1616 void disable_all_edit_groups ();
1618 bool in_edit_group_row_change;
1619 void edit_group_row_change (const Gtk::TreeModel::Path&,const Gtk::TreeModel::iterator&);
1620 void edit_group_name_edit (const Glib::ustring&, const Glib::ustring&);
1621 void new_edit_group ();
1622 void edit_group_list_button_clicked ();
1623 gint edit_group_list_button_press_event (GdkEventButton* ev);
1624 void add_edit_group (ARDOUR::RouteGroup* group);
1625 void remove_selected_edit_group ();
1626 void edit_groups_changed ();
1627 void group_flags_changed (void*, ARDOUR::RouteGroup*);
1629 Gtk::VBox list_vpacker;
1633 bool autoscroll_active;
1634 int autoscroll_timeout_tag;
1635 int autoscroll_direction;
1636 uint32_t autoscroll_cnt;
1637 nframes_t autoscroll_distance;
1639 static gint _autoscroll_canvas (void *);
1640 bool autoscroll_canvas ();
1641 void start_canvas_autoscroll (int direction);
1642 void stop_canvas_autoscroll ();
1643 void maybe_autoscroll (GdkEvent*);
1652 void start_trim (ArdourCanvas::Item*, GdkEvent*);
1653 void point_trim (GdkEvent*);
1654 void trim_motion_callback (ArdourCanvas::Item*, GdkEvent*);
1655 void single_contents_trim (RegionView&, nframes_t, bool, bool, bool);
1656 void single_start_trim (RegionView&, nframes_t, bool, bool);
1657 void single_end_trim (RegionView&, nframes_t, bool, bool);
1659 void trim_finished_callback (ArdourCanvas::Item*, GdkEvent*);
1660 void thaw_region_after_trim (RegionView& rv);
1662 void trim_region_front();
1663 void trim_region_back();
1664 void trim_region (bool front);
1666 void trim_region_to_edit_point ();
1667 void trim_region_from_edit_point ();
1668 void trim_region_to_loop ();
1669 void trim_region_to_punch ();
1670 void trim_region_to_location (const ARDOUR::Location&, const char* cmd);
1672 bool show_gain_after_trim;
1676 int convert_drop_to_paths (std::vector<Glib::ustring>& paths,
1677 const Glib::RefPtr<Gdk::DragContext>& context,
1680 const Gtk::SelectionData& data,
1684 void track_canvas_drag_data_received (const Glib::RefPtr<Gdk::DragContext>& context,
1687 const Gtk::SelectionData& data,
1691 void region_list_display_drag_data_received (const Glib::RefPtr<Gdk::DragContext>& context,
1694 const Gtk::SelectionData& data,
1699 void drop_paths (const Glib::RefPtr<Gdk::DragContext>& context,
1702 const Gtk::SelectionData& data,
1706 void drop_regions (const Glib::RefPtr<Gdk::DragContext>& context,
1709 const Gtk::SelectionData& data,
1715 ExportDialog *export_dialog;
1716 ExportDialog *export_range_markers_dialog;
1718 void export_range (nframes_t start, nframes_t end);
1719 void export_range_markers ();
1721 int write_region_selection(RegionSelection&);
1722 bool write_region (string path, boost::shared_ptr<ARDOUR::AudioRegion>);
1723 void export_region ();
1724 void bounce_region_selection ();
1725 void bounce_range_selection ();
1726 void external_edit_region ();
1728 int write_audio_selection (TimeSelection&);
1729 bool write_audio_range (ARDOUR::AudioPlaylist&, uint32_t channels, list<ARDOUR::AudioRange>&);
1731 void write_selection ();
1735 UndoAction get_memento() const;
1737 XMLNode *before; /* used in *_reversible_command */
1738 void begin_reversible_command (string cmd_name);
1739 void commit_reversible_command ();
1741 /* visual history */
1743 UndoHistory visual_history;
1744 UndoTransaction current_visual_command;
1747 void update_title ();
1748 void update_title_s (const string & snapshot_name);
1751 Selection* selection;
1752 double frames_per_unit;
1758 void store_state (State&) const;
1759 void restore_state (State *);
1761 void instant_save ();
1763 boost::shared_ptr<ARDOUR::AudioRegion> last_audition_region;
1765 /* freeze operations */
1767 ARDOUR::InterThreadInfo freeze_status;
1768 gint freeze_progress_timeout (void *);
1769 static void* _freeze_thread (void*);
1770 void* freeze_thread ();
1772 void freeze_route ();
1773 void unfreeze_route ();
1775 /* edit-group solo + mute */
1777 void set_edit_group_solo (ARDOUR::Route&, bool);
1778 void set_edit_group_mute (ARDOUR::Route&, bool);
1782 void duplicate_dialog (bool with_dialog);
1784 nframes64_t event_frame (GdkEvent*, double* px = 0, double* py = 0) const;
1786 /* returns false if mouse pointer is not in track or marker canvas
1788 bool mouse_frame (nframes64_t&, bool& in_track_canvas) const;
1790 void time_fx_motion (ArdourCanvas::Item*, GdkEvent*);
1791 void start_time_fx (ArdourCanvas::Item*, GdkEvent*);
1792 void end_time_fx (ArdourCanvas::Item*, GdkEvent*);
1794 struct TimeStretchDialog : public ArdourDialog {
1795 ARDOUR::TimeStretchRequest request;
1797 RegionSelection regions;
1798 Gtk::ProgressBar progress_bar;
1799 Gtk::ToggleButton quick_button;
1800 Gtk::ToggleButton antialias_button;
1801 Gtk::Button* cancel_button;
1802 Gtk::Button* action_button;
1803 Gtk::HBox upper_button_box;
1807 TimeStretchDialog (Editor& e);
1809 gint update_progress ();
1810 sigc::connection first_cancel;
1811 sigc::connection first_delete;
1812 void cancel_timestretch_in_progress ();
1813 gint delete_timestretch_in_progress (GdkEventAny*);
1816 /* "whats mine is yours" */
1818 friend class TimeStretchDialog;
1820 TimeStretchDialog* current_timestretch;
1822 static void* timestretch_thread (void *arg);
1823 int run_timestretch (RegionSelection&, float fraction);
1824 void do_timestretch (TimeStretchDialog&);
1826 /* editor-mixer strip */
1828 MixerStrip *current_mixer_strip;
1829 bool show_editor_mixer_when_tracks_arrive;
1830 Gtk::VBox current_mixer_strip_vbox;
1831 void cms_deleted ();
1832 void current_mixer_strip_hidden ();
1833 void current_mixer_strip_removed ();
1835 void detach_tearoff (Gtk::Box* b, Gtk::Window* w);
1836 void reattach_tearoff (Gtk::Box* b, Gtk::Window* w, int32_t n);
1838 /* nudging tracks */
1840 void nudge_track (bool use_edit_point, bool forwards);
1844 bool _xfade_visibility;
1846 /* <CMT Additions> */
1847 void handle_new_imageframe_time_axis_view(const string & track_name, void* src) ;
1848 void handle_new_imageframe_marker_time_axis_view(const 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 ;
1885 /* </CMT Additions> */
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 nframes_t get_nudge_distance (nframes_t pos, nframes_t& next);
1908 void apply_filter (ARDOUR::AudioFilter&, string cmd);
1910 /* handling cleanup */
1912 int playlist_deletion_dialog (boost::shared_ptr<ARDOUR::Playlist>);
1914 vector<sigc::connection> session_connections;
1916 /* tracking step changes of track height */
1918 TimeAxisView* current_stepping_trackview;
1919 struct timeval last_track_height_step_timestamp;
1920 gint track_height_step_timeout();
1921 sigc::connection step_timeout;
1923 TimeAxisView* entered_track;
1924 RegionView* entered_regionview;
1925 void ensure_entered_region_selected (bool op_acts_on_objects = false);
1926 void ensure_entered_track_selected (bool op_acts_on_objects = false);
1927 bool clear_entered_track;
1928 gint left_track_canvas (GdkEventCrossing*);
1929 void set_entered_track (TimeAxisView*);
1930 void set_entered_regionview (RegionView*);
1931 gint left_automation_track ();
1933 bool _new_regionviews_show_envelope;
1935 void toggle_gain_envelope_visibility ();
1936 void toggle_gain_envelope_active ();
1937 void reset_region_gain_envelopes ();
1939 Gtk::CheckMenuItem* region_envelope_visible_item;
1940 Gtk::CheckMenuItem* region_envelope_active_item;
1941 Gtk::CheckMenuItem* region_mute_item;
1942 Gtk::CheckMenuItem* region_lock_item;
1943 Gtk::CheckMenuItem* region_opaque_item;
1945 bool on_key_press_event (GdkEventKey*);
1947 void session_state_saved (string);
1949 Glib::RefPtr<Gtk::Action> undo_action;
1950 Glib::RefPtr<Gtk::Action> redo_action;
1952 void history_changed ();
1953 void color_handler ();
1955 Gtk::HBox status_bar_hpacker;
1957 Editing::EditPoint _edit_point;
1959 Gtk::ComboBoxText edit_point_selector;
1961 void set_edit_point_preference (Editing::EditPoint ep);
1962 void cycle_edit_point ();
1963 void set_edit_point ();
1964 void edit_point_selection_done ();
1965 void edit_point_chosen (Editing::EditPoint);
1966 Glib::RefPtr<Gtk::RadioAction> edit_point_action (Editing::EditPoint);
1967 std::vector<std::string> edit_point_strings;
1969 void selected_marker_moved (ARDOUR::Location*);
1970 sigc::connection edit_point_clock_connection_a;
1971 sigc::connection edit_point_clock_connection_b;
1973 bool get_edit_op_range (nframes64_t& start, nframes64_t& end) const;
1975 RegionSelection get_regions_at (nframes64_t where, const TrackSelection& ts) const;
1976 RegionSelection get_regions_after (nframes64_t where, const TrackSelection& ts) const;
1978 RegionSelection tmp_regions;
1980 RegionSelection& get_regions_for_action ();
1982 sigc::connection fast_screen_update_connection;
1983 gint start_updating ();
1984 gint stop_updating ();
1985 void toggle_meter_updating();
1986 void fast_update_strips ();
1987 bool meters_running;
1989 void select_next_route ();
1990 void select_prev_route ();
1993 #endif /* __ardour_editor_h__ */