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 ();
234 void deselect_all ();
238 void set_show_measures (bool yn);
239 bool show_measures () const { return _show_measures; }
240 bool initial_ruler_update_required;
243 /* analysis window */
244 void analyze_region_selection();
245 void analyze_range_selection();
250 /* these initiate export ... */
252 void export_session();
253 void export_selection();
255 void add_toplevel_controls (Gtk::Container&);
256 Gtk::HBox& get_status_bar_packer() { return status_bar_hpacker; }
258 void set_zoom_focus (Editing::ZoomFocus);
259 Editing::ZoomFocus get_zoom_focus () const { return zoom_focus; }
260 double get_current_zoom () const { return frames_per_unit; }
262 void temporal_zoom_step (bool coarser);
264 /* stuff that AudioTimeAxisView and related classes use */
266 PlaylistSelector& playlist_selector() const;
267 void route_name_changed (TimeAxisView *);
268 void clear_playlist (boost::shared_ptr<ARDOUR::Playlist>);
270 void new_playlists (TimeAxisView*);
271 void copy_playlists (TimeAxisView*);
272 void clear_playlists (TimeAxisView*);
274 TrackViewList* get_valid_views (TimeAxisView*, ARDOUR::RouteGroup* grp = 0);
276 Width editor_mixer_strip_width;
277 void maybe_add_mixer_strip_width (XMLNode&);
278 void show_editor_mixer (bool yn);
279 void set_selected_mixer_strip (TimeAxisView&);
280 void hide_track_in_display (TimeAxisView& tv);
281 void show_track_in_display (TimeAxisView& tv);
283 /* nudge is initiated by transport controls owned by ARDOUR_UI */
285 void nudge_forward (bool next);
286 void nudge_backward (bool next);
288 /* nudge initiated from context menu */
290 void nudge_forward_capture_offset ();
291 void nudge_backward_capture_offset ();
293 /* playhead/screen stuff */
295 void set_follow_playhead (bool yn);
296 void toggle_follow_playhead ();
297 bool follow_playhead() const { return _follow_playhead; }
298 bool dragging_playhead () const { return _dragging_playhead; }
300 void toggle_waveform_visibility ();
301 void toggle_waveforms_while_recording ();
302 void toggle_measure_visibility ();
303 void toggle_logo_visibility ();
305 /* SMPTE timecode & video sync */
307 void smpte_fps_chosen (ARDOUR::SmpteFormat format);
308 void video_pullup_chosen (ARDOUR::Session::PullupFormat pullup);
309 void subframes_per_frame_chosen (uint32_t);
311 void update_smpte_mode();
312 void update_video_pullup();
313 void update_subframes_per_frame ();
316 void toggle_auto_xfade ();
317 void toggle_xfades_active ();
318 void toggle_xfade_visibility ();
319 bool xfade_visibility() const { return _xfade_visibility; }
320 void update_xfade_visibility ();
321 void update_crossfade_model ();
322 void set_crossfade_model (ARDOUR::CrossfadeModel);
325 void set_layer_model (ARDOUR::LayerModel);
326 void update_layering_model ();
328 void toggle_link_region_and_track_selection ();
330 /* redirect shared ops menu. caller must free returned menu */
332 Gtk::Menu* redirect_menu ();
334 /* floating windows/transient */
336 void ensure_float (Gtk::Window&);
340 void scroll_tracks_down_line ();
341 void scroll_tracks_up_line ();
343 bool new_regionviews_display_gain () { return _new_regionviews_show_envelope; }
344 void prepare_for_cleanup ();
346 void maximise_editing_space();
347 void restore_editing_space();
349 void reset_x_origin (nframes_t);
350 void reset_zoom (double);
351 void reposition_and_zoom (nframes_t, double);
353 nframes64_t get_preferred_edit_position (bool ignore_playhead = false);
355 bool update_mouse_speed ();
356 bool decelerate_mouse_speed ();
359 void map_transport_state ();
360 void map_position_change (nframes_t);
366 ARDOUR::Session *session;
369 // to keep track of the playhead position for control_scroll
370 boost::optional<nframes_t> _control_scroll_target;
372 PlaylistSelector* _playlist_selector;
375 double frames_per_unit;
376 nframes_t leftmost_frame;
377 Editing::ZoomFocus zoom_focus;
380 VisualState last_visual_state;
382 nframes_t leftmost_frame;
383 double frames_per_unit;
384 Editing::ZoomFocus zoom_focus;
386 void use_visual_state (const VisualState&);
387 void set_frames_per_unit (double);
388 void swap_visual_state ();
391 Editing::MouseMode mouse_mode;
393 int post_maximal_editor_width;
394 int post_maximal_pane_position;
395 int pre_maximal_pane_position;
396 int pre_maximal_editor_width;
397 void pane_allocation_handler (Gtk::Allocation&, Gtk::Paned*);
399 Gtk::Notebook the_notebook;
400 Gtk::HPaned edit_pane;
402 Gtk::EventBox meter_base;
404 Gtk::EventBox marker_base;
405 Gtk::HBox marker_box;
406 Gtk::VBox scrollers_rulers_markers_box;
408 void location_changed (ARDOUR::Location *);
409 void location_flags_changed (ARDOUR::Location *, void *);
410 void refresh_location_display ();
411 void refresh_location_display_s (ARDOUR::Change);
412 void refresh_location_display_internal (ARDOUR::Locations::LocationList&);
413 void add_new_location (ARDOUR::Location *);
414 void location_gone (ARDOUR::Location *);
415 void remove_marker (ArdourCanvas::Item&, GdkEvent*);
416 gint really_remove_marker (ARDOUR::Location* loc);
417 void goto_nth_marker (int nth);
419 uint32_t location_marker_color;
420 uint32_t location_range_color;
421 uint32_t location_loop_color;
422 uint32_t location_punch_color;
423 uint32_t location_cd_marker_color;
425 struct LocationMarkers {
430 LocationMarkers () : start(0), end(0), valid (true) {}
436 void set_name (const string&);
437 void set_position (nframes_t start, nframes_t end = 0);
438 void set_color_rgba (uint32_t);
441 LocationMarkers *find_location_markers (ARDOUR::Location *) const;
442 ARDOUR::Location* find_location_from_marker (Marker *, bool& is_start) const;
443 Marker* entered_marker;
445 typedef std::map<ARDOUR::Location*,LocationMarkers *> LocationMarkerMap;
446 LocationMarkerMap location_markers;
448 void hide_marker (ArdourCanvas::Item*, GdkEvent*);
449 void clear_marker_display ();
450 void mouse_add_new_marker (nframes_t where, bool is_cd=false);
451 void update_cd_marker_display ();
452 void ensure_cd_marker_updated (LocationMarkers * lam, ARDOUR::Location * location);
454 TimeAxisView* clicked_trackview;
455 AudioTimeAxisView* clicked_audio_trackview;
456 RegionView* clicked_regionview;
457 RegionSelection latest_regionviews;
458 uint32_t clicked_selection;
459 CrossfadeView* clicked_crossfadeview;
460 ControlPoint* clicked_control_point;
462 void sort_track_selection ();
464 void get_relevant_audio_tracks (std::set<AudioTimeAxisView*>& relevant_tracks);
465 void get_equivalent_regions (RegionView* rv, std::vector<RegionView*>&);
466 void mapover_audio_tracks (sigc::slot<void,AudioTimeAxisView&,uint32_t> sl, TimeAxisView*);
468 /* functions to be passed to mapover_audio_tracks(), possibly with sigc::bind()-supplied arguments */
470 void mapped_get_equivalent_regions (RouteTimeAxisView&, uint32_t, RegionView*, vector<RegionView*>*);
471 void mapped_use_new_playlist (AudioTimeAxisView&, uint32_t);
472 void mapped_use_copy_playlist (AudioTimeAxisView&, uint32_t);
473 void mapped_clear_playlist (AudioTimeAxisView&, uint32_t);
477 void button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type);
478 bool button_release_can_deselect;
480 void catch_vanishing_regionview (RegionView *);
482 void set_selected_track (TimeAxisView&, Selection::Operation op = Selection::Set, bool no_remove=false);
483 void select_all_tracks ();
485 bool set_selected_control_point_from_click (Selection::Operation op = Selection::Set, bool no_remove=false);
486 void set_selected_track_from_click (bool press, Selection::Operation op = Selection::Set, bool no_remove=false);
487 void set_selected_track_as_side_effect (bool force = false);
488 bool set_selected_regionview_from_click (bool press, Selection::Operation op = Selection::Set, bool no_track_remove=false);
490 void set_selected_regionview_from_region_list (boost::shared_ptr<ARDOUR::Region> region, Selection::Operation op = Selection::Set);
491 bool set_selected_regionview_from_map_event (GdkEventAny*, StreamView*, boost::weak_ptr<ARDOUR::Region>);
492 void collect_new_region_view (RegionView *);
494 Gtk::Menu track_context_menu;
495 Gtk::Menu track_region_context_menu;
496 Gtk::Menu track_selection_context_menu;
497 Gtk::Menu track_crossfade_context_menu;
499 Gtk::MenuItem* region_edit_menu_split_item;
500 Gtk::MenuItem* region_edit_menu_split_multichannel_item;
501 Gtk::Menu * track_region_edit_playlist_menu;
502 Gtk::Menu * track_edit_playlist_submenu;
503 Gtk::Menu * track_selection_edit_playlist_submenu;
505 void popup_track_context_menu (int, int, ItemType, bool, nframes_t);
506 Gtk::Menu* build_track_context_menu (nframes_t);
507 Gtk::Menu* build_track_bus_context_menu (nframes_t);
508 Gtk::Menu* build_track_region_context_menu (nframes_t frame);
509 Gtk::Menu* build_track_crossfade_context_menu (nframes_t);
510 Gtk::Menu* build_track_selection_context_menu (nframes_t);
511 void add_dstream_context_items (Gtk::Menu_Helpers::MenuList&);
512 void add_bus_context_items (Gtk::Menu_Helpers::MenuList&);
513 void add_region_context_items (AudioStreamView*, boost::shared_ptr<ARDOUR::Region>, Gtk::Menu_Helpers::MenuList&);
514 void add_crossfade_context_items (AudioStreamView*, boost::shared_ptr<ARDOUR::Crossfade>, Gtk::Menu_Helpers::MenuList&, bool many);
515 void add_selection_context_items (Gtk::Menu_Helpers::MenuList&);
517 void handle_new_route (ARDOUR::Session::RouteList&);
518 void remove_route (TimeAxisView *);
521 Gtk::HBox global_hpacker;
522 Gtk::VBox global_vpacker;
525 Gdk::Cursor* current_canvas_cursor;
527 ArdourCanvas::CanvasAA track_canvas;
528 ArdourCanvas::CanvasAA time_canvas;
530 ArdourCanvas::Text* first_action_message;
531 ArdourCanvas::Text* verbose_canvas_cursor;
532 bool verbose_cursor_visible;
534 void parameter_changed (const char *);
536 bool track_canvas_motion (GdkEvent*);
538 void set_verbose_canvas_cursor (const string &, double x, double y);
539 void set_verbose_canvas_cursor_text (const string &);
540 void show_verbose_canvas_cursor();
541 void hide_verbose_canvas_cursor();
543 bool verbose_cursor_on; // so far unused
545 Gtk::EventBox time_canvas_event_box;
546 Gtk::EventBox track_canvas_event_box;
547 Gtk::EventBox time_button_event_box;
548 Gtk::Frame time_button_frame;
550 ArdourCanvas::Pixbuf* logo_item;
551 ArdourCanvas::Group* minsec_group;
552 ArdourCanvas::Group* bbt_group;
553 ArdourCanvas::Group* smpte_group;
554 ArdourCanvas::Group* frame_group;
555 ArdourCanvas::Group* tempo_group;
556 ArdourCanvas::Group* meter_group;
557 ArdourCanvas::Group* marker_group;
558 ArdourCanvas::Group* range_marker_group;
559 ArdourCanvas::Group* transport_marker_group;
560 ArdourCanvas::Group* cd_marker_group;
563 ruler_metric_smpte = 0,
564 ruler_metric_bbt = 1,
565 ruler_metric_frames = 2,
566 ruler_metric_minsec = 3,
568 ruler_time_tempo = 4,
569 ruler_time_meter = 5,
570 ruler_time_marker = 6,
571 ruler_time_range_marker = 7,
572 ruler_time_transport_marker = 8,
573 ruler_time_cd_marker = 9,
576 static GtkCustomMetric ruler_metrics[4];
577 bool ruler_shown[10];
578 bool no_ruler_shown_update;
580 gint ruler_button_press (GdkEventButton*);
581 gint ruler_button_release (GdkEventButton*);
582 gint ruler_mouse_motion (GdkEventMotion*);
584 gint ruler_pressed_button;
585 Gtk::Widget * ruler_grabbed_widget;
587 void initialize_rulers ();
588 void update_just_smpte ();
589 void update_fixed_rulers ();
590 void update_tempo_based_rulers ();
591 void popup_ruler_menu (nframes_t where = 0, ItemType type = RegionItem);
592 void update_ruler_visibility ();
593 void ruler_toggled (int);
594 gint ruler_label_button_release (GdkEventButton*);
595 void store_ruler_visibility ();
596 void restore_ruler_visibility ();
598 static gint _metric_get_smpte (GtkCustomRulerMark **, gdouble, gdouble, gint);
599 static gint _metric_get_bbt (GtkCustomRulerMark **, gdouble, gdouble, gint);
600 static gint _metric_get_frames (GtkCustomRulerMark **, gdouble, gdouble, gint);
601 static gint _metric_get_minsec (GtkCustomRulerMark **, gdouble, gdouble, gint);
603 gint metric_get_smpte (GtkCustomRulerMark **, gdouble, gdouble, gint);
604 gint metric_get_bbt (GtkCustomRulerMark **, gdouble, gdouble, gint);
605 gint metric_get_frames (GtkCustomRulerMark **, gdouble, gdouble, gint);
606 gint metric_get_minsec (GtkCustomRulerMark **, gdouble, gdouble, gint);
608 Gtk::Widget *_ruler_separator;
609 GtkWidget *_smpte_ruler;
610 GtkWidget *_bbt_ruler;
611 GtkWidget *_frames_ruler;
612 GtkWidget *_minsec_ruler;
613 Gtk::Widget *smpte_ruler;
614 Gtk::Widget *bbt_ruler;
615 Gtk::Widget *frames_ruler;
616 Gtk::Widget *minsec_ruler;
617 static Editor *ruler_editor;
619 static const double timebar_height;
620 guint32 visible_timebars;
621 Gtk::Menu *editor_ruler_menu;
623 ArdourCanvas::SimpleRect* tempo_bar;
624 ArdourCanvas::SimpleRect* meter_bar;
625 ArdourCanvas::SimpleRect* marker_bar;
626 ArdourCanvas::SimpleRect* range_marker_bar;
627 ArdourCanvas::SimpleRect* transport_marker_bar;
628 ArdourCanvas::SimpleRect* cd_marker_bar;
631 ArdourCanvas::SimpleLine* tempo_line;
632 ArdourCanvas::SimpleLine* meter_line;
633 ArdourCanvas::SimpleLine* marker_line;
634 ArdourCanvas::SimpleLine* range_marker_line;
635 ArdourCanvas::SimpleLine* transport_marker_line;
636 ArdourCanvas::SimpleLine* cd_marker_line;
638 Gtk::Label minsec_label;
639 Gtk::Label bbt_label;
640 Gtk::Label smpte_label;
641 Gtk::Label frame_label;
642 Gtk::Label tempo_label;
643 Gtk::Label meter_label;
644 Gtk::Label mark_label;
645 Gtk::Label range_mark_label;
646 Gtk::Label transport_mark_label;
647 Gtk::Label cd_mark_label;
650 Gtk::VBox time_button_vbox;
651 Gtk::HBox time_button_hbox;
655 ArdourCanvas::Points points;
656 ArdourCanvas::Line canvas_item;
657 nframes_t current_frame;
660 Cursor (Editor&, bool (Editor::*)(GdkEvent*,ArdourCanvas::Item*));
663 void set_position (nframes_t);
664 void set_length (double units);
665 void set_y_axis (double position);
668 friend struct Cursor; /* it needs access to several private
672 Cursor* playhead_cursor;
673 ArdourCanvas::Group* cursor_group;
675 void cursor_to_region_boundary (Cursor*, int32_t dir);
676 void cursor_to_next_region_boundary (Cursor*);
677 void cursor_to_previous_region_boundary (Cursor*);
678 void cursor_to_next_region_point (Cursor*, ARDOUR::RegionPoint);
679 void cursor_to_previous_region_point (Cursor*, ARDOUR::RegionPoint);
680 void cursor_to_region_point (Cursor*, ARDOUR::RegionPoint, int32_t dir);
681 void cursor_to_selection_start (Cursor *);
682 void cursor_to_selection_end (Cursor *);
684 void selected_marker_to_region_boundary (int32_t dir);
685 void selected_marker_to_next_region_boundary ();
686 void selected_marker_to_previous_region_boundary ();
687 void selected_marker_to_next_region_point (ARDOUR::RegionPoint);
688 void selected_marker_to_previous_region_point (ARDOUR::RegionPoint);
689 void selected_marker_to_region_point (ARDOUR::RegionPoint, int32_t dir);
690 void selected_marker_to_selection_start ();
691 void selected_marker_to_selection_end ();
693 void select_all_selectables_using_cursor (Cursor *, bool);
694 void select_all_selectables_using_edit (bool);
695 void select_all_selectables_between (bool within);
696 void select_range_between ();
698 boost::shared_ptr<ARDOUR::Region> find_next_region (nframes_t, ARDOUR::RegionPoint, int32_t dir, TrackViewList&, TimeAxisView ** = 0);
699 nframes64_t find_next_region_boundary (nframes64_t, int32_t dir, const TrackViewList&);
701 vector<nframes_t> region_boundary_cache;
702 void build_region_boundary_cache ();
704 Gtk::VBox trackview_vpacker;
707 Gtk::HBox bottom_hbox;
709 Gtk::Table edit_packer;
710 Gtk::VScrollbar edit_vscrollbar;
712 Gtk::Adjustment vertical_adjustment;
713 Gtk::Adjustment horizontal_adjustment;
715 Gtk::Layout controls_layout;
716 bool control_layout_scroll (GdkEventScroll* ev);
717 void controls_layout_size_request (Gtk::Requisition*);
719 Gtk::HScrollbar edit_hscrollbar;
720 bool _dragging_hscrollbar;
722 void reset_hscrollbar_stepping ();
724 bool hscrollbar_button_press (GdkEventButton*);
725 bool hscrollbar_button_release (GdkEventButton*);
726 void hscrollbar_allocate (Gtk::Allocation &alloc);
729 double canvas_height;
730 double full_canvas_height;
731 nframes_t last_canvas_frame;
733 bool track_canvas_map_handler (GdkEventAny*);
734 bool time_canvas_map_handler (GdkEventAny*);
736 gint edit_controls_button_release (GdkEventButton*);
737 Gtk::Menu *edit_controls_left_menu;
738 Gtk::Menu *edit_controls_right_menu;
740 Gtk::VBox track_canvas_vbox;
741 Gtk::VBox time_canvas_vbox;
742 Gtk::VBox edit_controls_vbox;
743 Gtk::HBox edit_controls_hbox;
745 void control_scroll (float);
746 bool deferred_control_scroll (nframes_t);
747 sigc::connection control_scroll_connection;
749 void tie_vertical_scrolling ();
750 void canvas_horizontally_scrolled ();
752 struct VisualChange {
759 nframes_t time_origin;
760 double frames_per_unit;
764 VisualChange() : pending ((VisualChange::Type) 0), time_origin (0), frames_per_unit (0), idle_handler_id (-1) {}
768 VisualChange pending_visual_change;
770 static int _idle_visual_changer (void *arg);
771 int idle_visual_changer ();
773 void queue_visual_change (nframes_t);
774 void queue_visual_change (double);
776 void end_location_changed (ARDOUR::Location*);
778 struct RegionListDisplayModelColumns : public Gtk::TreeModel::ColumnRecord {
779 RegionListDisplayModelColumns() {
784 Gtk::TreeModelColumn<Glib::ustring> name;
785 Gtk::TreeModelColumn<boost::shared_ptr<ARDOUR::Region> > region;
786 Gtk::TreeModelColumn<Gdk::Color> color_;
789 RegionListDisplayModelColumns region_list_columns;
790 Gtkmm2ext::DnDTreeView<boost::shared_ptr<ARDOUR::Region> > region_list_display;
792 Glib::RefPtr<Gtk::TreeStore> region_list_model;
793 Glib::RefPtr<Gtk::ToggleAction> toggle_full_region_list_action;
794 Glib::RefPtr<Gtk::ToggleAction> toggle_show_auto_regions_action;
796 void region_list_selection_changed ();
797 bool region_list_selection_filter (const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::Path& path, bool yn);
798 void region_name_edit (const Glib::ustring&, const Glib::ustring&);
799 void get_regions_corresponding_to (boost::shared_ptr<ARDOUR::Region> region, std::vector<RegionView*>& regions);
801 Gtk::Menu *region_list_menu;
802 Gtk::ScrolledWindow region_list_scroller;
803 Gtk::Frame region_list_frame;
805 bool region_list_display_key_press (GdkEventKey *);
806 bool region_list_display_key_release (GdkEventKey *);
807 bool region_list_display_button_press (GdkEventButton *);
808 bool region_list_display_button_release (GdkEventButton *);
809 void region_list_clear ();
810 void region_list_selection_mapover (sigc::slot<void,boost::shared_ptr<ARDOUR::Region> >);
811 void build_region_list_menu ();
812 void show_region_list_display_context_menu (int button, int time);
814 bool show_automatic_regions_in_region_list;
815 Editing::RegionListSortType region_list_sort_type;
817 void reset_region_list_sort_direction (bool);
818 void reset_region_list_sort_type (Editing::RegionListSortType);
820 void toggle_full_region_list ();
821 void toggle_show_auto_regions ();
823 int region_list_sorter (Gtk::TreeModel::iterator, Gtk::TreeModel::iterator);
827 Gtk::ScrolledWindow snapshot_display_scroller;
828 struct SnapshotDisplayModelColumns : public Gtk::TreeModel::ColumnRecord {
829 SnapshotDisplayModelColumns() {
833 Gtk::TreeModelColumn<Glib::ustring> visible_name;
834 Gtk::TreeModelColumn<Glib::ustring> real_name;
837 SnapshotDisplayModelColumns snapshot_display_columns;
838 Glib::RefPtr<Gtk::ListStore> snapshot_display_model;
839 Gtk::TreeView snapshot_display;
840 Gtk::Menu snapshot_context_menu;
842 bool snapshot_display_button_press (GdkEventButton*);
843 void snapshot_display_selection_changed ();
844 void redisplay_snapshots();
845 void popup_snapshot_context_menu (int, int32_t, Glib::ustring);
847 /* named selections */
849 struct NamedSelectionDisplayModelColumns : public Gtk::TreeModel::ColumnRecord {
850 NamedSelectionDisplayModelColumns() {
854 Gtk::TreeModelColumn<Glib::ustring> text;
855 Gtk::TreeModelColumn<ARDOUR::NamedSelection*> selection;
858 NamedSelectionDisplayModelColumns named_selection_columns;
859 Glib::RefPtr<Gtk::TreeStore> named_selection_model;
861 Gtkmm2ext::DnDTreeView<ARDOUR::NamedSelection*> named_selection_display;
862 Gtk::ScrolledWindow named_selection_scroller;
864 void create_named_selection ();
865 void paste_named_selection (float times);
866 void remove_selected_named_selections ();
867 void remove_snapshot (Glib::ustring);
868 void rename_snapshot (Glib::ustring);
870 void handle_new_named_selection ();
871 void add_named_selection_to_named_selection_display (ARDOUR::NamedSelection&);
872 void redisplay_named_selections ();
874 bool named_selection_display_button_release (GdkEventButton *ev);
875 bool named_selection_display_key_release (GdkEventKey *ev);
876 void named_selection_display_selection_changed ();
879 TrackViewList track_views;
880 TimeAxisView *trackview_by_y_position (double ypos);
882 static Gdk::Cursor* cross_hair_cursor;
883 static Gdk::Cursor* trimmer_cursor;
884 static Gdk::Cursor* selector_cursor;
885 static Gdk::Cursor* grabber_cursor;
886 static Gdk::Cursor* zoom_cursor;
887 static Gdk::Cursor* time_fx_cursor;
888 static Gdk::Cursor* fader_cursor;
889 static Gdk::Cursor* speaker_cursor;
890 static Gdk::Cursor* wait_cursor;
891 static Gdk::Cursor* timebar_cursor;
892 static Gdk::Cursor* transparent_cursor;
894 static void build_cursors ();
896 sigc::connection scroll_connection;
897 nframes_t last_update_frame;
898 void center_screen (nframes_t);
899 void center_screen_internal (nframes_t, float);
901 void update_current_screen ();
903 void session_going_away ();
905 nframes_t cut_buffer_start;
906 nframes_t cut_buffer_length;
908 bool typed_event (ArdourCanvas::Item*, GdkEvent*, ItemType);
909 bool button_press_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
910 bool button_release_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
911 bool motion_handler (ArdourCanvas::Item*, GdkEvent*, ItemType, bool from_autoscroll = false);
912 bool enter_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
913 bool leave_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
915 /* KEYMAP HANDLING */
917 void register_actions ();
919 int ensure_cursor (nframes_t* pos);
921 void handle_new_audio_region (boost::weak_ptr<ARDOUR::AudioRegion>);
922 void handle_audio_region_removed (boost::weak_ptr<ARDOUR::AudioRegion>);
923 void add_audio_region_to_region_display (boost::shared_ptr<ARDOUR::AudioRegion>);
924 void region_hidden (boost::shared_ptr<ARDOUR::Region>);
925 void redisplay_regions ();
926 void insert_into_tmp_audio_regionlist(boost::shared_ptr<ARDOUR::AudioRegion>);
928 list<boost::shared_ptr<ARDOUR::AudioRegion> > tmp_audio_region_list;
930 void cut_copy (Editing::CutCopyOp);
931 void cut_copy_points (Editing::CutCopyOp);
932 void cut_copy_regions (Editing::CutCopyOp);
933 void cut_copy_ranges (Editing::CutCopyOp);
936 void paste_internal (nframes_t position, float times);
938 /* EDITING OPERATIONS */
940 void reset_point_selection ();
941 void toggle_region_mute ();
942 void toggle_region_lock ();
943 void toggle_region_opaque ();
944 void raise_region ();
945 void raise_region_to_top ();
946 void lower_region ();
947 void lower_region_to_bottom ();
948 void split_region ();
949 void split_region_at (nframes_t);
950 void split_regions_at (nframes_t, RegionSelection&);
951 void crop_region_to_selection ();
952 void crop_region_to (nframes_t start, nframes_t end);
953 void set_sync_point (nframes64_t, const RegionSelection&);
954 void set_region_sync_from_edit_point ();
955 void remove_region_sync();
956 void align_selection (ARDOUR::RegionPoint, nframes_t position, const RegionSelection&);
957 void align_selection_relative (ARDOUR::RegionPoint point, nframes_t position, const RegionSelection&);
958 void align_region (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, nframes_t position);
959 void align_region_internal (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, nframes_t position);
960 void remove_clicked_region ();
961 void destroy_clicked_region ();
963 void rename_region ();
964 void duplicate_some_regions (RegionSelection&, float times);
965 void duplicate_selection (float times);
966 void region_fill_selection ();
968 void region_fill_track ();
969 void audition_playlist_region_standalone (boost::shared_ptr<ARDOUR::Region>);
970 void audition_playlist_region_via_route (boost::shared_ptr<ARDOUR::Region>, ARDOUR::Route&);
971 void split_multichannel_region();
972 void reverse_region ();
973 void normalize_region ();
974 void denormalize_region ();
976 void audition_region_from_region_list ();
977 void hide_region_from_region_list ();
978 void remove_region_from_region_list ();
980 void align (ARDOUR::RegionPoint);
981 void align_relative (ARDOUR::RegionPoint);
990 void paste (float times);
992 int get_prefix (float&, bool&);
994 void keyboard_paste ();
995 void keyboard_insert_region_list_selection ();
997 void region_from_selection ();
998 void create_region_from_selection (std::vector<boost::shared_ptr<ARDOUR::AudioRegion> >&);
1000 void play_from_start ();
1001 void play_from_edit_point ();
1002 void play_from_edit_point_and_return ();
1003 void play_selected_region ();
1004 void play_edit_range ();
1005 void loop_selected_region ();
1006 void play_location (ARDOUR::Location&);
1007 void loop_location (ARDOUR::Location&);
1009 void temporal_zoom_selection ();
1010 void temporal_zoom_region ();
1011 void toggle_zoom_region ();
1012 bool zoomed_to_region;
1013 void temporal_zoom_session ();
1014 void temporal_zoom (gdouble scale);
1015 void temporal_zoom_by_frame (nframes_t start, nframes_t end, const string & op);
1016 void temporal_zoom_to_frame (bool coarser, nframes_t frame);
1018 void amplitude_zoom (gdouble scale);
1019 void amplitude_zoom_step (bool in);
1021 void insert_region_list_drag (boost::shared_ptr<ARDOUR::AudioRegion>, int x, int y);
1022 void insert_region_list_selection (float times);
1024 void add_external_audio_action (Editing::ImportMode);
1025 void external_audio_dialog ();
1026 bool check_multichannel_status (const std::vector<Glib::ustring>& paths);
1028 SoundFileOmega* sfbrowser;
1030 void bring_in_external_audio (Editing::ImportMode mode, nframes64_t& pos);
1031 void do_import (vector<Glib::ustring> paths, Editing::ImportDisposition, Editing::ImportMode mode, ARDOUR::SrcQuality, nframes64_t&);
1033 void _do_embed (vector<Glib::ustring> paths, Editing::ImportDisposition, Editing::ImportMode mode, nframes64_t&);
1034 void do_embed (vector<Glib::ustring> paths, Editing::ImportDisposition, Editing::ImportMode mode, nframes64_t&);
1035 bool idle_do_embed (vector<Glib::ustring> paths, Editing::ImportDisposition, Editing::ImportMode mode, nframes64_t&);
1037 int import_sndfiles (vector<Glib::ustring> paths, Editing::ImportMode mode, ARDOUR::SrcQuality, nframes64_t& pos,
1038 int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::AudioTrack>&);
1039 int embed_sndfiles (vector<Glib::ustring> paths, bool multiple_files, bool& check_sample_rate, Editing::ImportMode mode,
1040 nframes64_t& pos, int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::AudioTrack>&);
1042 int add_sources (vector<Glib::ustring> paths, ARDOUR::SourceList& sources, nframes64_t& pos, Editing::ImportMode,
1043 int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::AudioTrack>&, bool add_channel_suffix);
1044 int finish_bringing_in_audio (boost::shared_ptr<ARDOUR::AudioRegion> region, uint32_t, uint32_t, nframes64_t& pos, Editing::ImportMode mode,
1045 boost::shared_ptr<ARDOUR::AudioTrack>& existing_track);
1047 boost::shared_ptr<ARDOUR::AudioTrack> get_nth_selected_audio_track (int nth) const;
1049 /* generic interthread progress window */
1051 ArdourDialog* interthread_progress_window;
1052 Gtk::Label interthread_progress_label;
1053 Gtk::VBox interthread_progress_vbox;
1054 Gtk::ProgressBar interthread_progress_bar;
1055 Gtk::Button interthread_cancel_button;
1056 Gtk::Label interthread_cancel_label;
1057 sigc::connection interthread_progress_connection;
1058 void interthread_cancel_clicked ();
1059 void build_interthread_progress_window ();
1060 ARDOUR::InterThreadInfo* current_interthread_info;
1063 AnalysisWindow* analysis_window;
1066 /* import specific info */
1068 ARDOUR::Session::import_status import_status;
1069 gint import_progress_timeout (void *);
1070 static void *_import_thread (void *);
1071 void* import_thread ();
1073 /* to support this ... */
1075 void import_audio (bool as_tracks);
1076 void do_import (vector<Glib::ustring> paths, bool split, bool as_tracks);
1078 void move_to_start ();
1079 void move_to_end ();
1081 void center_playhead ();
1082 void center_edit_point ();
1083 void edit_cursor_backward ();
1084 void edit_cursor_forward ();
1085 void playhead_backward ();
1086 void playhead_forward ();
1087 void scroll_playhead (bool forward);
1088 void scroll_backward (float pages=0.8f);
1089 void scroll_forward (float pages=0.8f);
1090 void scroll_tracks_down ();
1091 void scroll_tracks_up ();
1092 void delete_sample_forward ();
1093 void delete_sample_backward ();
1094 void delete_screen ();
1095 void search_backwards ();
1096 void search_forwards ();
1098 void clear_markers ();
1099 void clear_ranges ();
1100 void clear_locations ();
1101 void unhide_markers ();
1102 void unhide_ranges ();
1103 void jump_forward_to_mark ();
1104 void jump_backward_to_mark ();
1105 void cursor_align (bool playhead_to_edit);
1107 void remove_last_capture ();
1108 void select_all_selectables_using_time_selection ();
1109 void select_all_selectables_using_loop();
1110 void select_all_selectables_using_punch();
1111 void set_selection_from_range (ARDOUR::Location&);
1112 void set_selection_from_punch ();
1113 void set_selection_from_loop ();
1114 void set_selection_from_audio_region ();
1116 void add_location_mark (nframes64_t where);
1117 void add_location_from_audio_region ();
1118 void add_location_from_selection ();
1119 void set_loop_from_selection (bool play);
1120 void set_punch_from_selection ();
1122 void set_loop_from_edit_range (bool play);
1123 void set_loop_from_region (bool play);
1124 void set_punch_from_edit_range ();
1126 void set_loop_range (nframes_t start, nframes_t end, std::string cmd);
1127 void set_punch_range (nframes_t start, nframes_t end, std::string cmd);
1129 void add_location_from_playhead_cursor ();
1130 bool select_new_marker;
1132 void reverse_selection ();
1133 void edit_envelope ();
1135 void start_scrolling ();
1136 void stop_scrolling ();
1139 double last_scrub_x;
1140 int scrubbing_direction;
1141 int scrub_reversals;
1142 int scrub_reverse_distance;
1144 void keyboard_selection_begin ();
1145 void keyboard_selection_finish (bool add);
1146 bool have_pending_keyboard_selection;
1147 nframes_t pending_keyboard_selection_start;
1149 boost::shared_ptr<ARDOUR::Region> select_region_for_operation (int dir, TimeAxisView **tv);
1150 void extend_selection_to_end_of_region (bool next);
1151 void extend_selection_to_start_of_region (bool previous);
1153 Editing::SnapType snap_type;
1154 Editing::SnapMode snap_mode;
1155 double snap_threshold;
1157 void handle_gui_changes (const string &, void *);
1159 void hide_all_tracks (bool with_select);
1162 LineDragInfo current_line_drag_info;
1164 void start_grab (GdkEvent*, Gdk::Cursor* cursor = 0);
1165 bool end_grab (ArdourCanvas::Item*, GdkEvent*);
1166 void swap_grab (ArdourCanvas::Item*, Gdk::Cursor* cursor, uint32_t time);
1168 Gtk::Menu fade_context_menu;
1169 void popup_fade_context_menu (int, int, ArdourCanvas::Item*, ItemType);
1171 void start_fade_in_grab (ArdourCanvas::Item*, GdkEvent*);
1172 void start_fade_out_grab (ArdourCanvas::Item*, GdkEvent*);
1173 void fade_in_drag_motion_callback (ArdourCanvas::Item*, GdkEvent*);
1174 void fade_out_drag_motion_callback (ArdourCanvas::Item*, GdkEvent*);
1175 void fade_in_drag_finished_callback (ArdourCanvas::Item*, GdkEvent*);
1176 void fade_out_drag_finished_callback (ArdourCanvas::Item*, GdkEvent*);
1178 void set_fade_in_shape (ARDOUR::AudioRegion::FadeShape);
1179 void set_fade_out_shape (ARDOUR::AudioRegion::FadeShape);
1181 void set_fade_length (bool in);
1182 void toggle_fade_active (bool in);
1183 void set_fade_in_active (bool);
1184 void set_fade_out_active (bool);
1186 std::set<boost::shared_ptr<ARDOUR::Playlist> > motion_frozen_playlists;
1187 RegionSelection pre_drag_region_selection;
1188 void region_drag_motion_callback (ArdourCanvas::Item*, GdkEvent*);
1189 void region_drag_finished_callback (ArdourCanvas::Item*, GdkEvent*);
1190 bool check_region_drag_possible (AudioTimeAxisView**);
1191 void possibly_copy_regions_during_grab (GdkEvent*);
1192 void region_drag_splice_motion_callback (ArdourCanvas::Item*, GdkEvent*);
1193 void region_drag_splice_finished_callback (ArdourCanvas::Item*, GdkEvent*);
1195 bool _dragging_playhead;
1196 bool _dragging_edit_point;
1198 void cursor_drag_motion_callback (ArdourCanvas::Item*, GdkEvent*);
1199 void cursor_drag_finished_callback (ArdourCanvas::Item*, GdkEvent*);
1200 void marker_drag_motion_callback (ArdourCanvas::Item*, GdkEvent*);
1201 void marker_drag_finished_callback (ArdourCanvas::Item*, GdkEvent*);
1202 void control_point_drag_motion_callback (ArdourCanvas::Item*, GdkEvent*);
1203 void control_point_drag_finished_callback (ArdourCanvas::Item*, GdkEvent*);
1204 void line_drag_motion_callback (ArdourCanvas::Item*, GdkEvent*);
1205 void line_drag_finished_callback (ArdourCanvas::Item*, GdkEvent*);
1207 void tempo_marker_drag_motion_callback (ArdourCanvas::Item*, GdkEvent*);
1208 void tempo_marker_drag_finished_callback (ArdourCanvas::Item*, GdkEvent*);
1209 void meter_marker_drag_motion_callback (ArdourCanvas::Item*, GdkEvent*);
1210 void meter_marker_drag_finished_callback (ArdourCanvas::Item*, GdkEvent*);
1212 gint mouse_rename_region (ArdourCanvas::Item*, GdkEvent*);
1214 void start_region_grab (ArdourCanvas::Item*, GdkEvent*);
1215 void start_region_copy_grab (ArdourCanvas::Item*, GdkEvent*);
1216 void start_region_brush_grab (ArdourCanvas::Item*, GdkEvent*);
1217 void start_selection_grab (ArdourCanvas::Item*, GdkEvent*);
1218 void start_cursor_grab (ArdourCanvas::Item*, GdkEvent*);
1219 void start_marker_grab (ArdourCanvas::Item*, GdkEvent*);
1220 void start_control_point_grab (ArdourCanvas::Item*, GdkEvent*);
1221 void start_line_grab_from_regionview (ArdourCanvas::Item*, GdkEvent*);
1222 void start_line_grab_from_line (ArdourCanvas::Item*, GdkEvent*);
1223 void start_line_grab (AutomationLine *, GdkEvent*);
1224 void start_tempo_marker_grab (ArdourCanvas::Item*, GdkEvent*);
1225 void start_tempo_marker_copy_grab (ArdourCanvas::Item*, GdkEvent*);
1226 void start_meter_marker_grab (ArdourCanvas::Item*, GdkEvent*);
1227 void start_meter_marker_copy_grab (ArdourCanvas::Item*, GdkEvent*);
1229 void region_view_item_click (AudioRegionView&, GdkEventButton*);
1231 void remove_gain_control_point (ArdourCanvas::Item*, GdkEvent*);
1232 void remove_control_point (ArdourCanvas::Item*, GdkEvent*);
1234 void mouse_brush_insert_region (RegionView*, nframes_t pos);
1235 void brush (nframes_t);
1237 void show_verbose_time_cursor (nframes_t frame, double offset = 0, double xpos=-1, double ypos=-1);
1238 void show_verbose_duration_cursor (nframes_t start, nframes_t end, double offset = 0, double xpos=-1, double ypos=-1);
1240 /* Canvas event handlers */
1242 bool canvas_control_point_event (GdkEvent* event,ArdourCanvas::Item*, ControlPoint*);
1243 bool canvas_line_event (GdkEvent* event,ArdourCanvas::Item*, AutomationLine*);
1244 bool canvas_selection_rect_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1245 bool canvas_selection_start_trim_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1246 bool canvas_selection_end_trim_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1247 bool canvas_crossfade_view_event (GdkEvent* event,ArdourCanvas::Item*, CrossfadeView*);
1248 bool canvas_fade_in_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1249 bool canvas_fade_in_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1250 bool canvas_fade_out_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1251 bool canvas_fade_out_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1252 bool canvas_region_view_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1253 bool canvas_region_view_name_highlight_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1254 bool canvas_region_view_name_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1255 bool canvas_stream_view_event (GdkEvent* event,ArdourCanvas::Item*, RouteTimeAxisView*);
1256 bool canvas_marker_event (GdkEvent* event,ArdourCanvas::Item*, Marker*);
1257 bool canvas_zoom_rect_event (GdkEvent* event,ArdourCanvas::Item*);
1258 bool canvas_tempo_marker_event (GdkEvent* event,ArdourCanvas::Item*, TempoMarker*);
1259 bool canvas_meter_marker_event (GdkEvent* event,ArdourCanvas::Item*, MeterMarker*);
1260 bool canvas_automation_track_event(GdkEvent* event, ArdourCanvas::Item*, AutomationTimeAxisView*) ;
1262 bool canvas_tempo_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1263 bool canvas_meter_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1264 bool canvas_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1265 bool canvas_range_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1266 bool canvas_transport_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1267 bool canvas_cd_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1269 bool canvas_imageframe_item_view_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1270 bool canvas_imageframe_view_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameTimeAxis*);
1271 bool canvas_imageframe_start_handle_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1272 bool canvas_imageframe_end_handle_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1273 bool canvas_marker_time_axis_view_event(GdkEvent* event, ArdourCanvas::Item*,MarkerTimeAxis*);
1274 bool canvas_markerview_item_view_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1275 bool canvas_markerview_start_handle_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1276 bool canvas_markerview_end_handle_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1278 /* non-public event handlers */
1280 bool canvas_playhead_cursor_event (GdkEvent* event, ArdourCanvas::Item*);
1281 bool track_canvas_scroll (GdkEventScroll* event);
1283 bool track_canvas_scroll_event (GdkEventScroll* event);
1284 bool track_canvas_button_press_event (GdkEventButton* event);
1285 bool track_canvas_button_release_event (GdkEventButton* event);
1286 bool track_canvas_motion_notify_event (GdkEventMotion* event);
1288 Gtk::Allocation canvas_allocation;
1289 bool canvas_idle_queued;
1290 void track_canvas_allocate (Gtk::Allocation alloc);
1291 bool track_canvas_size_allocated ();
1293 void set_playhead_cursor ();
1295 void kbd_driver (sigc::slot<void,GdkEvent*>, bool use_track_canvas = true, bool use_time_canvas = true, bool can_select = true);
1296 void kbd_mute_unmute_region ();
1299 void kbd_do_brush (GdkEvent*);
1300 void kbd_do_audition (GdkEvent*);
1302 void handle_new_duration ();
1303 void initialize_canvas ();
1304 void reset_scrolling_region (Gtk::Allocation* alloc = 0);
1306 /* display control */
1308 bool _show_measures;
1309 bool _show_waveforms;
1310 bool _follow_playhead;
1311 bool _show_waveforms_recording;
1313 ARDOUR::TempoMap::BBTPointList *current_bbt_points;
1315 typedef vector<ArdourCanvas::SimpleLine*> TimeLineList;
1316 TimeLineList free_measure_lines;
1317 TimeLineList used_measure_lines;
1319 ArdourCanvas::Group* time_line_group;
1320 ArdourCanvas::SimpleLine* get_time_line ();
1321 void hide_measures ();
1322 void draw_measures ();
1323 bool lazy_hide_and_draw_measures ();
1325 void new_tempo_section ();
1327 void mouse_add_new_tempo_event (nframes_t where);
1328 void mouse_add_new_meter_event (nframes_t where);
1330 void remove_tempo_marker (ArdourCanvas::Item*);
1331 void remove_meter_marker (ArdourCanvas::Item*);
1332 gint real_remove_tempo_marker (ARDOUR::TempoSection*);
1333 gint real_remove_meter_marker (ARDOUR::MeterSection*);
1335 void edit_tempo_section (ARDOUR::TempoSection*);
1336 void edit_meter_section (ARDOUR::MeterSection*);
1337 void edit_tempo_marker (ArdourCanvas::Item*);
1338 void edit_meter_marker (ArdourCanvas::Item*);
1340 void marker_menu_edit ();
1341 void marker_menu_remove ();
1342 void marker_menu_rename ();
1343 void marker_menu_lock (bool yn);
1344 void marker_menu_hide ();
1345 void marker_menu_loop_range ();
1346 void marker_menu_select_all_selectables_using_range ();
1347 void marker_menu_select_using_range ();
1348 void marker_menu_separate_regions_using_location ();
1349 void marker_menu_play_from ();
1350 void marker_menu_play_range ();
1351 void marker_menu_set_playhead ();
1352 void marker_menu_set_from_playhead ();
1353 void marker_menu_set_from_selection ();
1354 void new_transport_marker_menu_set_loop ();
1355 void new_transport_marker_menu_set_punch ();
1356 void update_loop_range_view (bool visibility=false);
1357 void update_punch_range_view (bool visibility=false);
1358 gint new_transport_marker_menu_popdown (GdkEventAny*);
1359 void marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1360 void tm_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1361 void transport_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1362 void new_transport_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1363 void build_range_marker_menu (bool loop_or_punch);
1364 void build_marker_menu (bool start_or_end);
1365 void build_tm_marker_menu ();
1366 void build_new_transport_marker_menu ();
1368 Gtk::Menu* tm_marker_menu;
1369 Gtk::Menu* marker_menu;
1370 Gtk::Menu* start_end_marker_menu;
1371 Gtk::Menu* range_marker_menu;
1372 Gtk::Menu* transport_marker_menu;
1373 Gtk::Menu* new_transport_marker_menu;
1374 Gtk::Menu* cd_marker_menu;
1375 ArdourCanvas::Item* marker_menu_item;
1377 typedef list<Marker*> Marks;
1380 void remove_metric_marks ();
1381 void draw_metric_marks (const ARDOUR::Metrics& metrics);
1383 void tempo_map_changed (ARDOUR::Change);
1384 void redisplay_tempo (bool immediate_redraw);
1386 void snap_to (nframes64_t& first, int32_t direction = 0, bool for_mark = false);
1387 void snap_to (nframes_t& first, int32_t direction = 0, bool for_mark = false) {
1388 /* XXX remove this function when everything moves to 64 bit frame counts */
1389 nframes64_t first64 = first;
1390 snap_to (first64, direction, for_mark);
1391 first = (nframes_t) first64;
1394 uint32_t bbt_beat_subdivision;
1398 Gtk::ToggleButton editor_mixer_button;
1400 void editor_mixer_button_toggled ();
1402 AudioClock edit_point_clock;
1403 AudioClock zoom_range_clock;
1404 Gtk::Button zoom_in_button;
1405 Gtk::Button zoom_out_button;
1406 Gtk::Button zoom_out_full_button;
1407 Gtk::Button zoom_onetoone_button;
1409 Gtk::VBox toolbar_clock_vbox;
1410 Gtk::VBox toolbar_selection_clock_vbox;
1411 Gtk::Table toolbar_selection_clock_table;
1412 Gtk::Label toolbar_selection_cursor_label;
1414 Gtk::HBox mouse_mode_button_box;
1415 Gtkmm2ext::TearOff* mouse_mode_tearoff;
1416 Gtk::ToggleButton mouse_select_button;
1417 Gtk::ToggleButton mouse_move_button;
1418 Gtk::ToggleButton mouse_gain_button;
1419 Gtk::ToggleButton mouse_zoom_button;
1420 Gtk::ToggleButton mouse_timefx_button;
1421 Gtk::ToggleButton mouse_audition_button;
1422 GroupedButtons *mouse_mode_button_set;
1423 void mouse_mode_toggled (Editing::MouseMode m);
1424 bool ignore_mouse_mode_toggle;
1426 gint mouse_select_button_release (GdkEventButton*);
1428 Gtk::VBox automation_box;
1429 Gtk::Button automation_mode_button;
1430 Gtk::ToggleButton global_automation_button;
1432 Gtk::ComboBoxText edit_mode_selector;
1433 Gtk::VBox edit_mode_box;
1435 void set_edit_mode (ARDOUR::EditMode);
1436 void cycle_edit_mode ();
1437 void edit_mode_selection_done ();
1439 Gtk::ComboBoxText snap_type_selector;
1440 Gtk::ComboBoxText snap_mode_selector;
1443 std::vector<std::string> snap_type_strings;
1444 std::vector<std::string> snap_mode_strings;
1446 void snap_type_selection_done ();
1447 void snap_mode_selection_done ();
1448 void snap_mode_chosen (Editing::SnapMode);
1449 void snap_type_chosen (Editing::SnapType);
1451 Glib::RefPtr<Gtk::RadioAction> snap_type_action (Editing::SnapType);
1452 Glib::RefPtr<Gtk::RadioAction> snap_mode_action (Editing::SnapMode);
1454 Gtk::ComboBoxText zoom_focus_selector;
1455 Gtk::VBox zoom_focus_box;
1457 std::vector<std::string> zoom_focus_strings;
1459 void zoom_focus_selection_done ();
1460 void zoom_focus_chosen (Editing::ZoomFocus);
1462 Glib::RefPtr<Gtk::RadioAction> zoom_focus_action (Editing::ZoomFocus);
1466 void zoom_adjustment_changed();
1468 void edit_point_clock_changed();
1470 void setup_toolbar ();
1472 Gtkmm2ext::TearOff* tools_tearoff;
1473 Gtk::HBox toolbar_hbox;
1474 Gtk::EventBox toolbar_base;
1475 Gtk::Frame toolbar_frame;
1477 /* selection process */
1479 Selection* selection;
1480 Selection* cut_buffer;
1482 void time_selection_changed ();
1483 void track_selection_changed ();
1484 void region_selection_changed ();
1485 void point_selection_changed ();
1486 void marker_selection_changed ();
1495 void start_selection_op (ArdourCanvas::Item* item, GdkEvent* event, SelectionOp);
1496 void drag_selection (ArdourCanvas::Item* item, GdkEvent* event);
1497 void end_selection_op (ArdourCanvas::Item* item, GdkEvent* event);
1498 void cancel_selection ();
1500 void region_selection_op (void (ARDOUR::Region::*pmf)(void));
1501 void region_selection_op (void (ARDOUR::Region::*pmf)(void*), void*);
1502 void region_selection_op (void (ARDOUR::Region::*pmf)(bool), bool);
1504 bool audio_region_selection_covers (nframes_t where);
1506 /* transport range select process */
1507 enum RangeMarkerOp {
1509 CreateTransportMarker,
1513 void start_range_markerbar_op (ArdourCanvas::Item* item, GdkEvent* event, RangeMarkerOp);
1514 void drag_range_markerbar_op (ArdourCanvas::Item* item, GdkEvent* event);
1515 void end_range_markerbar_op (ArdourCanvas::Item* item, GdkEvent* event);
1517 ArdourCanvas::SimpleRect* range_bar_drag_rect;
1518 ArdourCanvas::SimpleRect* transport_bar_drag_rect;
1519 ArdourCanvas::Line* marker_drag_line;
1520 ArdourCanvas::Points marker_drag_line_points;
1521 ArdourCanvas::SimpleRect* range_marker_drag_rect;
1523 void update_marker_drag_item (ARDOUR::Location *);
1525 ArdourCanvas::SimpleRect *transport_bar_range_rect;
1526 ArdourCanvas::SimpleRect *transport_bar_preroll_rect;
1527 ArdourCanvas::SimpleRect *transport_bar_postroll_rect;
1528 ArdourCanvas::SimpleRect *transport_loop_range_rect;
1529 ArdourCanvas::SimpleRect *transport_punch_range_rect;
1530 ArdourCanvas::SimpleLine *transport_punchin_line;
1531 ArdourCanvas::SimpleLine *transport_punchout_line;
1532 ArdourCanvas::SimpleRect *transport_preroll_rect;
1533 ArdourCanvas::SimpleRect *transport_postroll_rect;
1535 ARDOUR::Location* transport_loop_location();
1536 ARDOUR::Location* transport_punch_location();
1538 ARDOUR::Location *temp_location;
1540 /* object rubberband select process */
1542 void start_rubberband_select (ArdourCanvas::Item* item, GdkEvent* event);
1543 void drag_rubberband_select (ArdourCanvas::Item* item, GdkEvent* event);
1544 void end_rubberband_select (ArdourCanvas::Item* item, GdkEvent* event);
1546 bool select_all_within (nframes_t start, nframes_t end, gdouble topy, gdouble boty, const TrackViewList&, Selection::Operation op);
1548 ArdourCanvas::SimpleRect *rubberband_rect;
1550 /* mouse zoom process */
1552 void start_mouse_zoom (ArdourCanvas::Item* item, GdkEvent* event);
1553 void drag_mouse_zoom (ArdourCanvas::Item* item, GdkEvent* event);
1554 void end_mouse_zoom (ArdourCanvas::Item* item, GdkEvent* event);
1556 ArdourCanvas::SimpleRect *zoom_rect;
1557 void reposition_zoom_rect (nframes_t start, nframes_t end);
1559 /* diskstream/route display management */
1561 struct RouteDisplayModelColumns : public Gtk::TreeModel::ColumnRecord {
1562 RouteDisplayModelColumns() {
1568 Gtk::TreeModelColumn<Glib::ustring> text;
1569 Gtk::TreeModelColumn<bool> visible;
1570 Gtk::TreeModelColumn<TimeAxisView*> tv;
1571 Gtk::TreeModelColumn<boost::shared_ptr<ARDOUR::Route> > route;
1574 RouteDisplayModelColumns route_display_columns;
1575 Glib::RefPtr<Gtk::ListStore> route_display_model;
1576 Glib::RefPtr<Gtk::TreeSelection> route_display_selection;
1578 Gtkmm2ext::DnDTreeView<boost::shared_ptr<ARDOUR::Route> > route_list_display;
1579 Gtk::ScrolledWindow route_list_scroller;
1580 Gtk::Menu* route_list_menu;
1582 void sync_order_keys ();
1583 bool ignore_route_order_sync;
1585 bool route_list_display_button_press (GdkEventButton*);
1586 void route_list_display_drag_data_received (const Glib::RefPtr<Gdk::DragContext>& context,
1589 const Gtk::SelectionData& data,
1593 bool route_list_selection_filter (const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::Path& path, bool yn);
1595 void route_list_change (const Gtk::TreeModel::Path&,const Gtk::TreeModel::iterator&);
1596 void route_list_delete (const Gtk::TreeModel::Path&);
1597 void track_list_reorder (const Gtk::TreeModel::Path& path, const Gtk::TreeModel::iterator& iter, int* new_order);
1599 void initial_route_list_display ();
1600 void redisplay_route_list();
1601 bool ignore_route_list_reorder;
1602 bool no_route_list_redisplay;
1604 void build_route_list_menu ();
1605 void show_route_list_menu ();
1607 void show_all_routes ();
1608 void hide_all_routes ();
1609 void show_all_audiotracks ();
1610 void hide_all_audiotracks ();
1611 void show_all_audiobus ();
1612 void hide_all_audiobus ();
1614 void set_all_tracks_visibility (bool yn);
1615 void set_all_audio_visibility (int type, bool yn);
1617 /* edit group management */
1619 struct GroupListModelColumns : public Gtk::TreeModel::ColumnRecord {
1620 GroupListModelColumns () {
1626 Gtk::TreeModelColumn<bool> is_active;
1627 Gtk::TreeModelColumn<bool> is_visible;
1628 Gtk::TreeModelColumn<std::string> text;
1629 Gtk::TreeModelColumn<ARDOUR::RouteGroup*> routegroup;
1632 GroupListModelColumns group_columns;
1633 Glib::RefPtr<Gtk::ListStore> group_model;
1634 Glib::RefPtr<Gtk::TreeSelection> group_selection;
1636 Gtk::TreeView edit_group_display;
1637 Gtk::ScrolledWindow edit_group_display_scroller;
1638 Gtk::Menu* edit_group_list_menu;
1640 void build_edit_group_list_menu ();
1641 void activate_all_edit_groups ();
1642 void disable_all_edit_groups ();
1644 bool in_edit_group_row_change;
1645 void edit_group_row_change (const Gtk::TreeModel::Path&,const Gtk::TreeModel::iterator&);
1646 void edit_group_name_edit (const Glib::ustring&, const Glib::ustring&);
1647 void new_edit_group ();
1648 void edit_group_list_button_clicked ();
1649 gint edit_group_list_button_press_event (GdkEventButton* ev);
1650 void add_edit_group (ARDOUR::RouteGroup* group);
1651 void remove_selected_edit_group ();
1652 void edit_groups_changed ();
1653 void group_flags_changed (void*, ARDOUR::RouteGroup*);
1655 Gtk::VBox list_vpacker;
1659 bool autoscroll_active;
1660 int autoscroll_timeout_tag;
1661 int autoscroll_direction;
1662 uint32_t autoscroll_cnt;
1663 nframes_t autoscroll_distance;
1665 static gint _autoscroll_canvas (void *);
1666 bool autoscroll_canvas ();
1667 void start_canvas_autoscroll (int direction);
1668 void stop_canvas_autoscroll ();
1669 void maybe_autoscroll (GdkEvent*);
1678 void start_trim (ArdourCanvas::Item*, GdkEvent*);
1679 void point_trim (GdkEvent*);
1680 void trim_motion_callback (ArdourCanvas::Item*, GdkEvent*);
1681 void single_contents_trim (RegionView&, nframes_t, bool, bool, bool);
1682 void single_start_trim (RegionView&, nframes_t, bool, bool);
1683 void single_end_trim (RegionView&, nframes_t, bool, bool);
1685 void trim_finished_callback (ArdourCanvas::Item*, GdkEvent*);
1686 void thaw_region_after_trim (RegionView& rv);
1688 void trim_region_front();
1689 void trim_region_back();
1690 void trim_region (bool front);
1692 void trim_region_to_edit_point ();
1693 void trim_region_from_edit_point ();
1694 void trim_region_to_loop ();
1695 void trim_region_to_punch ();
1696 void trim_region_to_location (const ARDOUR::Location&, const char* cmd);
1698 bool show_gain_after_trim;
1702 int convert_drop_to_paths (std::vector<Glib::ustring>& paths,
1703 const Glib::RefPtr<Gdk::DragContext>& context,
1706 const Gtk::SelectionData& data,
1710 void track_canvas_drag_data_received (const Glib::RefPtr<Gdk::DragContext>& context,
1713 const Gtk::SelectionData& data,
1717 void region_list_display_drag_data_received (const Glib::RefPtr<Gdk::DragContext>& context,
1720 const Gtk::SelectionData& data,
1725 void drop_paths (const Glib::RefPtr<Gdk::DragContext>& context,
1728 const Gtk::SelectionData& data,
1732 void drop_regions (const Glib::RefPtr<Gdk::DragContext>& context,
1735 const Gtk::SelectionData& data,
1741 ExportDialog *export_dialog;
1742 ExportDialog *export_range_markers_dialog;
1744 void export_range (nframes_t start, nframes_t end);
1745 void export_range_markers ();
1747 int write_region_selection(RegionSelection&);
1748 bool write_region (string path, boost::shared_ptr<ARDOUR::AudioRegion>);
1749 void export_region ();
1750 void bounce_region_selection ();
1751 void bounce_range_selection ();
1752 void external_edit_region ();
1754 int write_audio_selection (TimeSelection&);
1755 bool write_audio_range (ARDOUR::AudioPlaylist&, uint32_t channels, list<ARDOUR::AudioRange>&);
1757 void write_selection ();
1761 UndoAction get_memento() const;
1763 XMLNode *before; /* used in *_reversible_command */
1764 void begin_reversible_command (string cmd_name);
1765 void commit_reversible_command ();
1767 /* visual history */
1769 UndoHistory visual_history;
1770 UndoTransaction current_visual_command;
1773 void update_title ();
1774 void update_title_s (const string & snapshot_name);
1777 Selection* selection;
1778 double frames_per_unit;
1784 void store_state (State&) const;
1785 void restore_state (State *);
1787 void instant_save ();
1789 boost::shared_ptr<ARDOUR::AudioRegion> last_audition_region;
1791 /* freeze operations */
1793 ARDOUR::InterThreadInfo freeze_status;
1794 gint freeze_progress_timeout (void *);
1795 static void* _freeze_thread (void*);
1796 void* freeze_thread ();
1798 void freeze_route ();
1799 void unfreeze_route ();
1801 /* edit-group solo + mute */
1803 void set_edit_group_solo (ARDOUR::Route&, bool);
1804 void set_edit_group_mute (ARDOUR::Route&, bool);
1808 void duplicate_dialog (bool with_dialog);
1810 nframes64_t event_frame (GdkEvent*, double* px = 0, double* py = 0) const;
1812 /* returns false if mouse pointer is not in track or marker canvas
1814 bool mouse_frame (nframes64_t&, bool& in_track_canvas) const;
1816 void time_fx_motion (ArdourCanvas::Item*, GdkEvent*);
1817 void start_time_fx (ArdourCanvas::Item*, GdkEvent*);
1818 void end_time_fx (ArdourCanvas::Item*, GdkEvent*);
1820 struct TimeFXDialog : public ArdourDialog {
1821 ARDOUR::TimeFXRequest request;
1824 Gtk::Adjustment pitch_octave_adjustment;
1825 Gtk::Adjustment pitch_semitone_adjustment;
1826 Gtk::Adjustment pitch_cent_adjustment;
1827 Gtk::SpinButton pitch_octave_spinner;
1828 Gtk::SpinButton pitch_semitone_spinner;
1829 Gtk::SpinButton pitch_cent_spinner;
1830 RegionSelection regions;
1831 Gtk::ProgressBar progress_bar;
1832 Gtk::ToggleButton quick_button;
1833 Gtk::ToggleButton antialias_button;
1834 Gtk::Button* cancel_button;
1835 Gtk::Button* action_button;
1836 Gtk::HBox upper_button_box;
1840 TimeFXDialog (Editor& e, bool for_pitch);
1842 gint update_progress ();
1843 sigc::connection first_cancel;
1844 sigc::connection first_delete;
1845 void cancel_in_progress ();
1846 gint delete_in_progress (GdkEventAny*);
1849 /* "whats mine is yours" */
1851 friend class TimeFXDialog;
1853 TimeFXDialog* current_timefx;
1855 static void* timefx_thread (void *arg);
1856 void do_timefx (TimeFXDialog&);
1858 int time_stretch (RegionSelection&, float fraction);
1859 int pitch_shift (RegionSelection&, float cents);
1860 void pitch_shift_regions ();
1861 int time_fx (RegionSelection&, float val, bool pitching);
1863 /* editor-mixer strip */
1865 MixerStrip *current_mixer_strip;
1866 bool show_editor_mixer_when_tracks_arrive;
1867 Gtk::VBox current_mixer_strip_vbox;
1868 void cms_deleted ();
1869 void current_mixer_strip_hidden ();
1870 void current_mixer_strip_removed ();
1872 void detach_tearoff (Gtk::Box* b, Gtk::Window* w);
1873 void reattach_tearoff (Gtk::Box* b, Gtk::Window* w, int32_t n);
1875 /* nudging tracks */
1877 void nudge_track (bool use_edit_point, bool forwards);
1881 bool _xfade_visibility;
1883 /* <CMT Additions> */
1884 void handle_new_imageframe_time_axis_view(const string & track_name, void* src) ;
1885 void handle_new_imageframe_marker_time_axis_view(const string & track_name, TimeAxisView* marked_track) ;
1887 void start_imageframe_grab(ArdourCanvas::Item*, GdkEvent*) ;
1888 void start_markerview_grab(ArdourCanvas::Item*, GdkEvent*) ;
1890 void imageframe_drag_motion_callback(ArdourCanvas::Item*, GdkEvent*) ;
1891 void markerview_drag_motion_callback(ArdourCanvas::Item*, GdkEvent*) ;
1892 void timeaxis_item_drag_finished_callback(ArdourCanvas::Item*, GdkEvent*) ;
1894 gint canvas_imageframe_item_view_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameView* ifv);
1895 gint canvas_imageframe_view_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameTimeAxis* ifta);
1896 gint canvas_imageframe_start_handle_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameView* ifv);
1897 gint canvas_imageframe_end_handle_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameView* ifv);
1899 gint canvas_marker_time_axis_view_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerTimeAxis* mta);
1900 gint canvas_markerview_item_view_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerView* mv);
1901 gint canvas_markerview_start_handle_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerView* mv);
1902 gint canvas_markerview_end_handle_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerView* mv);
1904 void imageframe_start_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1905 void imageframe_end_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1906 void imageframe_start_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1907 void imageframe_start_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1908 void imageframe_end_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1909 void imageframe_end_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1911 void markerview_item_start_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1912 void markerview_item_end_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1913 void markerview_start_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1914 void markerview_start_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1915 void markerview_end_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1916 void markerview_end_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1918 void popup_imageframe_edit_menu(int button, int32_t time, ArdourCanvas::Item* ifv, bool with_frame) ;
1919 void popup_marker_time_axis_edit_menu(int button, int32_t time, ArdourCanvas::Item* ifv, bool with_frame) ;
1921 ImageFrameSocketHandler* image_socket_listener ;
1922 /* </CMT Additions> */
1924 void toggle_xfade_active (boost::weak_ptr<ARDOUR::Crossfade>);
1925 void toggle_xfade_length (boost::weak_ptr<ARDOUR::Crossfade>);
1926 void edit_xfade (boost::weak_ptr<ARDOUR::Crossfade>);
1927 void xfade_edit_left_region ();
1928 void xfade_edit_right_region ();
1930 static const int32_t default_width = 995;
1931 static const int32_t default_height = 765;
1935 Gtk::Button nudge_forward_button;
1936 Gtk::Button nudge_backward_button;
1937 Gtk::HBox nudge_hbox;
1938 Gtk::VBox nudge_vbox;
1939 AudioClock nudge_clock;
1941 nframes_t get_nudge_distance (nframes_t pos, nframes_t& next);
1945 void apply_filter (ARDOUR::AudioFilter&, string cmd);
1947 /* handling cleanup */
1949 int playlist_deletion_dialog (boost::shared_ptr<ARDOUR::Playlist>);
1951 vector<sigc::connection> session_connections;
1953 /* tracking step changes of track height */
1955 TimeAxisView* current_stepping_trackview;
1956 struct timeval last_track_height_step_timestamp;
1957 gint track_height_step_timeout();
1958 sigc::connection step_timeout;
1960 TimeAxisView* entered_track;
1961 RegionView* entered_regionview;
1962 void ensure_entered_region_selected (bool op_acts_on_objects = false);
1963 void ensure_entered_track_selected (bool op_acts_on_objects = false);
1964 bool clear_entered_track;
1965 gint left_track_canvas (GdkEventCrossing*);
1966 void set_entered_track (TimeAxisView*);
1967 void set_entered_regionview (RegionView*);
1968 gint left_automation_track ();
1970 bool _new_regionviews_show_envelope;
1972 void toggle_gain_envelope_visibility ();
1973 void toggle_gain_envelope_active ();
1974 void reset_region_gain_envelopes ();
1976 Gtk::CheckMenuItem* region_envelope_visible_item;
1977 Gtk::CheckMenuItem* region_envelope_active_item;
1978 Gtk::CheckMenuItem* region_mute_item;
1979 Gtk::CheckMenuItem* region_lock_item;
1980 Gtk::CheckMenuItem* region_opaque_item;
1982 bool on_key_press_event (GdkEventKey*);
1983 bool on_key_release_event (GdkEventKey*);
1985 void session_state_saved (string);
1987 Glib::RefPtr<Gtk::Action> undo_action;
1988 Glib::RefPtr<Gtk::Action> redo_action;
1990 void history_changed ();
1991 void color_handler ();
1993 Gtk::HBox status_bar_hpacker;
1995 Editing::EditPoint _edit_point;
1997 Gtk::ComboBoxText edit_point_selector;
1999 void set_edit_point_preference (Editing::EditPoint ep);
2000 void cycle_edit_point (bool with_marker);
2001 void set_edit_point ();
2002 void edit_point_selection_done ();
2003 void edit_point_chosen (Editing::EditPoint);
2004 Glib::RefPtr<Gtk::RadioAction> edit_point_action (Editing::EditPoint);
2005 std::vector<std::string> edit_point_strings;
2007 void selected_marker_moved (ARDOUR::Location*);
2008 sigc::connection edit_point_clock_connection_a;
2009 sigc::connection edit_point_clock_connection_b;
2011 bool get_edit_op_range (nframes64_t& start, nframes64_t& end) const;
2013 RegionSelection get_regions_at (nframes64_t where, const TrackSelection& ts) const;
2014 RegionSelection get_regions_after (nframes64_t where, const TrackSelection& ts) const;
2016 RegionSelection tmp_regions;
2018 RegionSelection& get_regions_for_action ();
2020 sigc::connection fast_screen_update_connection;
2021 gint start_updating ();
2022 gint stop_updating ();
2023 void toggle_meter_updating();
2024 void fast_update_strips ();
2025 bool meters_running;
2027 void select_next_route ();
2028 void select_prev_route ();
2031 #endif /* __ardour_editor_h__ */