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;
110 class AnalysisWindow;
113 /* <CMT Additions> */
114 class ImageFrameView;
115 class ImageFrameTimeAxisView;
116 class ImageFrameTimeAxis;
117 class MarkerTimeAxis ;
119 class ImageFrameSocketHandler ;
120 class TimeAxisViewItem ;
121 /* </CMT Additions> */
124 class Editor : public PublicEditor
130 void connect_to_session (ARDOUR::Session *);
131 ARDOUR::Session* current_session() const { return session; }
133 nframes_t leftmost_position() const { return leftmost_frame; }
134 nframes_t current_page_frames() const {
135 return (nframes_t) floor (canvas_width * frames_per_unit);
138 void cycle_snap_mode ();
139 void cycle_snap_choice ();
140 void set_snap_to (Editing::SnapType);
141 void set_snap_mode (Editing::SnapMode);
142 void set_snap_threshold (double pixel_distance) {snap_threshold = pixel_distance;}
144 void undo (uint32_t n = 1);
145 void redo (uint32_t n = 1);
147 XMLNode& get_state ();
148 int set_state (const XMLNode& );
150 void set_mouse_mode (Editing::MouseMode, bool force=true);
151 void step_mouse_mode (bool next);
152 Editing::MouseMode current_mouse_mode () { return mouse_mode; }
154 void add_imageframe_time_axis(const std::string & track_name, void*) ;
155 void add_imageframe_marker_time_axis(const std::string & track_name, TimeAxisView* marked_track, void*) ;
156 void connect_to_image_compositor() ;
157 void scroll_timeaxis_to_imageframe_item(const TimeAxisViewItem* item) ;
158 TimeAxisView* get_named_time_axis(const std::string & name) ;
160 void consider_auditioning (boost::shared_ptr<ARDOUR::Region>);
161 void hide_a_region (boost::shared_ptr<ARDOUR::Region>);
162 void remove_a_region (boost::shared_ptr<ARDOUR::Region>);
164 #ifdef USE_RUBBERBAND
165 std::vector<std::string> rb_opt_strings;
168 /* option editor-access */
170 void set_show_waveforms (bool yn);
171 bool show_waveforms() const { return _show_waveforms; }
173 void set_show_waveforms_recording (bool yn);
174 bool show_waveforms_recording() const { return _show_waveforms_recording; }
176 /* things that need to be public to be used in the main menubar */
178 void new_region_from_selection ();
179 void separate_regions_between (const TimeSelection&);
180 void separate_region_from_selection ();
181 void separate_regions_using_location (ARDOUR::Location&);
182 void toggle_playback (bool with_abort);
183 void transition_to_rolling (bool forward);
187 nframes_t unit_to_frame (double unit) const {
188 return (nframes_t) rint (unit * frames_per_unit);
191 double frame_to_unit (nframes_t frame) const {
192 return rint ((double) frame / (double) frames_per_unit);
195 double frame_to_unit (double frame) const {
196 return rint (frame / frames_per_unit);
199 /* NOTE: these functions assume that the "pixel" coordinate is
200 the result of using the world->canvas affine transform on a
201 world coordinate. These coordinates already take into
202 account any scrolling carried out by adjusting the
206 nframes64_t pixel_to_frame (double pixel) const {
208 /* pixel can be less than zero when motion events
209 are processed. since we've already run the world->canvas
210 affine, that means that the location *really* is "off
211 to the right" and thus really is "before the start".
215 return (nframes_t) rint (pixel * frames_per_unit * GNOME_CANVAS(track_canvas.gobj())->pixels_per_unit);
221 gulong frame_to_pixel (nframes64_t frame) const {
222 return (gulong) rint ((frame / (frames_per_unit * GNOME_CANVAS(track_canvas.gobj())->pixels_per_unit)));
225 void flush_canvas ();
229 Selection& get_selection() const { return *selection; }
230 Selection& get_cut_buffer() const { return *cut_buffer; }
232 bool extend_selection_to_track (TimeAxisView&);
234 void play_selection ();
235 void select_all_in_track (Selection::Operation op);
236 void select_all (Selection::Operation op);
237 void invert_selection_in_track ();
238 void invert_selection ();
239 void deselect_all ();
243 void set_show_measures (bool yn);
244 bool show_measures () const { return _show_measures; }
245 bool initial_ruler_update_required;
248 /* analysis window */
249 void analyze_region_selection();
250 void analyze_range_selection();
255 /* these initiate export ... */
257 void export_session();
258 void export_selection();
260 void add_toplevel_controls (Gtk::Container&);
261 Gtk::HBox& get_status_bar_packer() { return status_bar_hpacker; }
263 void set_zoom_focus (Editing::ZoomFocus);
264 Editing::ZoomFocus get_zoom_focus () const { return zoom_focus; }
265 double get_current_zoom () const { return frames_per_unit; }
267 void temporal_zoom_step (bool coarser);
269 /* stuff that AudioTimeAxisView and related classes use */
271 PlaylistSelector& playlist_selector() const;
272 void route_name_changed (TimeAxisView *);
273 void clear_playlist (boost::shared_ptr<ARDOUR::Playlist>);
275 void new_playlists (TimeAxisView*);
276 void copy_playlists (TimeAxisView*);
277 void clear_playlists (TimeAxisView*);
279 TrackViewList* get_valid_views (TimeAxisView*, ARDOUR::RouteGroup* grp = 0);
281 Width editor_mixer_strip_width;
282 void maybe_add_mixer_strip_width (XMLNode&);
283 void show_editor_mixer (bool yn);
284 void set_selected_mixer_strip (TimeAxisView&);
285 void hide_track_in_display (TimeAxisView& tv);
286 void show_track_in_display (TimeAxisView& tv);
288 /* nudge is initiated by transport controls owned by ARDOUR_UI */
290 void nudge_forward (bool next, bool force_playhead);
291 void nudge_backward (bool next, bool force_playhead);
293 /* nudge initiated from context menu */
295 void nudge_forward_capture_offset ();
296 void nudge_backward_capture_offset ();
298 /* playhead/screen stuff */
300 void set_follow_playhead (bool yn);
301 void toggle_follow_playhead ();
302 bool follow_playhead() const { return _follow_playhead; }
303 bool dragging_playhead () const { return _dragging_playhead; }
305 void toggle_waveform_visibility ();
306 void toggle_waveforms_while_recording ();
307 void toggle_measure_visibility ();
308 void toggle_logo_visibility ();
310 /* SMPTE timecode & video sync */
312 void smpte_fps_chosen (ARDOUR::SmpteFormat format);
313 void video_pullup_chosen (ARDOUR::Session::PullupFormat pullup);
314 void subframes_per_frame_chosen (uint32_t);
316 void update_smpte_mode();
317 void update_video_pullup();
318 void update_subframes_per_frame ();
321 void toggle_auto_xfade ();
322 void toggle_xfades_active ();
323 void toggle_xfade_visibility ();
324 bool xfade_visibility() const { return _xfade_visibility; }
325 void update_xfade_visibility ();
326 void update_crossfade_model ();
327 void set_crossfade_model (ARDOUR::CrossfadeModel);
330 void set_layer_model (ARDOUR::LayerModel);
331 void update_layering_model ();
333 void toggle_link_region_and_track_selection ();
335 /* redirect shared ops menu. caller must free returned menu */
337 Gtk::Menu* redirect_menu ();
339 /* floating windows/transient */
341 void ensure_float (Gtk::Window&);
345 void scroll_tracks_down_line ();
346 void scroll_tracks_up_line ();
348 bool new_regionviews_display_gain () { return _new_regionviews_show_envelope; }
349 void prepare_for_cleanup ();
351 void maximise_editing_space();
352 void restore_editing_space();
354 void reset_x_origin (nframes_t);
355 void reset_zoom (double);
356 void reposition_and_zoom (nframes_t, double);
358 nframes64_t get_preferred_edit_position (bool ignore_playhead = false);
360 bool update_mouse_speed ();
361 bool decelerate_mouse_speed ();
363 void toggle_meter_updating();
365 void show_rhythm_ferret();
368 void map_transport_state ();
369 void map_position_change (nframes_t);
375 ARDOUR::Session *session;
378 // to keep track of the playhead position for control_scroll
379 boost::optional<nframes_t> _control_scroll_target;
381 PlaylistSelector* _playlist_selector;
384 double frames_per_unit;
385 nframes_t leftmost_frame;
386 Editing::ZoomFocus zoom_focus;
389 VisualState last_visual_state;
391 nframes_t leftmost_frame;
392 double frames_per_unit;
393 Editing::ZoomFocus zoom_focus;
395 void use_visual_state (const VisualState&);
396 void set_frames_per_unit (double);
397 void swap_visual_state ();
400 Editing::MouseMode mouse_mode;
402 int post_maximal_editor_width;
403 int post_maximal_pane_position;
404 int pre_maximal_pane_position;
405 int pre_maximal_editor_width;
406 void pane_allocation_handler (Gtk::Allocation&, Gtk::Paned*);
408 Gtk::Notebook the_notebook;
409 Gtk::HPaned edit_pane;
411 Gtk::EventBox meter_base;
413 Gtk::EventBox marker_base;
414 Gtk::HBox marker_box;
415 Gtk::VBox scrollers_rulers_markers_box;
417 void location_changed (ARDOUR::Location *);
418 void location_flags_changed (ARDOUR::Location *, void *);
419 void refresh_location_display ();
420 void refresh_location_display_s (ARDOUR::Change);
421 void refresh_location_display_internal (ARDOUR::Locations::LocationList&);
422 void add_new_location (ARDOUR::Location *);
423 void location_gone (ARDOUR::Location *);
424 void remove_marker (ArdourCanvas::Item&, GdkEvent*);
425 gint really_remove_marker (ARDOUR::Location* loc);
426 void goto_nth_marker (int nth);
428 uint32_t location_marker_color;
429 uint32_t location_range_color;
430 uint32_t location_loop_color;
431 uint32_t location_punch_color;
432 uint32_t location_cd_marker_color;
434 struct LocationMarkers {
439 LocationMarkers () : start(0), end(0), valid (true) {}
445 void set_name (const string&);
446 void set_position (nframes_t start, nframes_t end = 0);
447 void set_color_rgba (uint32_t);
450 LocationMarkers *find_location_markers (ARDOUR::Location *) const;
451 ARDOUR::Location* find_location_from_marker (Marker *, bool& is_start) const;
452 Marker* entered_marker;
454 typedef std::map<ARDOUR::Location*,LocationMarkers *> LocationMarkerMap;
455 LocationMarkerMap location_markers;
457 void hide_marker (ArdourCanvas::Item*, GdkEvent*);
458 void clear_marker_display ();
459 void mouse_add_new_marker (nframes_t where, bool is_cd=false);
460 void update_cd_marker_display ();
461 void ensure_cd_marker_updated (LocationMarkers * lam, ARDOUR::Location * location);
463 TimeAxisView* clicked_trackview;
464 AudioTimeAxisView* clicked_audio_trackview;
465 RegionView* clicked_regionview;
466 RegionSelection latest_regionviews;
467 uint32_t clicked_selection;
468 CrossfadeView* clicked_crossfadeview;
469 ControlPoint* clicked_control_point;
471 void sort_track_selection (TrackSelection* sel = 0);
473 void get_relevant_audio_tracks (std::set<AudioTimeAxisView*>& relevant_tracks);
474 void get_equivalent_regions (RegionView* rv, std::vector<RegionView*>&);
475 void mapover_audio_tracks (sigc::slot<void,AudioTimeAxisView&,uint32_t> sl, TimeAxisView*);
477 /* functions to be passed to mapover_audio_tracks(), possibly with sigc::bind()-supplied arguments */
479 void mapped_get_equivalent_regions (RouteTimeAxisView&, uint32_t, RegionView*, vector<RegionView*>*);
480 void mapped_use_new_playlist (AudioTimeAxisView&, uint32_t);
481 void mapped_use_copy_playlist (AudioTimeAxisView&, uint32_t);
482 void mapped_clear_playlist (AudioTimeAxisView&, uint32_t);
486 void button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type);
487 bool button_release_can_deselect;
489 void catch_vanishing_regionview (RegionView *);
491 void set_selected_track (TimeAxisView&, Selection::Operation op = Selection::Set, bool no_remove=false);
492 void select_all_tracks ();
494 bool set_selected_control_point_from_click (Selection::Operation op = Selection::Set, bool no_remove=false);
495 void set_selected_track_from_click (bool press, Selection::Operation op = Selection::Set, bool no_remove=false);
496 void set_selected_track_as_side_effect (bool force = false);
497 bool set_selected_regionview_from_click (bool press, Selection::Operation op = Selection::Set, bool no_track_remove=false);
499 void set_selected_regionview_from_region_list (boost::shared_ptr<ARDOUR::Region> region, Selection::Operation op = Selection::Set);
500 bool set_selected_regionview_from_map_event (GdkEventAny*, StreamView*, boost::weak_ptr<ARDOUR::Region>);
501 void collect_new_region_view (RegionView *);
503 Gtk::Menu track_context_menu;
504 Gtk::Menu track_region_context_menu;
505 Gtk::Menu track_selection_context_menu;
506 Gtk::Menu track_crossfade_context_menu;
508 Gtk::MenuItem* region_edit_menu_split_item;
509 Gtk::MenuItem* region_edit_menu_split_multichannel_item;
510 Gtk::Menu * track_region_edit_playlist_menu;
511 Gtk::Menu * track_edit_playlist_submenu;
512 Gtk::Menu * track_selection_edit_playlist_submenu;
514 void popup_track_context_menu (int, int, ItemType, bool, nframes_t);
515 Gtk::Menu* build_track_context_menu (nframes_t);
516 Gtk::Menu* build_track_bus_context_menu (nframes_t);
517 Gtk::Menu* build_track_region_context_menu (nframes_t frame);
518 Gtk::Menu* build_track_crossfade_context_menu (nframes_t);
519 Gtk::Menu* build_track_selection_context_menu (nframes_t);
520 void add_dstream_context_items (Gtk::Menu_Helpers::MenuList&);
521 void add_bus_context_items (Gtk::Menu_Helpers::MenuList&);
522 void add_region_context_items (AudioStreamView*, boost::shared_ptr<ARDOUR::Region>, Gtk::Menu_Helpers::MenuList&);
523 void add_crossfade_context_items (AudioStreamView*, boost::shared_ptr<ARDOUR::Crossfade>, Gtk::Menu_Helpers::MenuList&, bool many);
524 void add_selection_context_items (Gtk::Menu_Helpers::MenuList&);
526 void handle_new_route (ARDOUR::Session::RouteList&);
527 void remove_route (TimeAxisView *);
530 Gtk::HBox global_hpacker;
531 Gtk::VBox global_vpacker;
534 Gdk::Cursor* current_canvas_cursor;
536 ArdourCanvas::CanvasAA track_canvas;
537 ArdourCanvas::CanvasAA time_canvas;
539 ArdourCanvas::Text* first_action_message;
540 ArdourCanvas::Text* verbose_canvas_cursor;
541 bool verbose_cursor_visible;
543 void parameter_changed (const char *);
545 bool track_canvas_motion (GdkEvent*);
547 void set_verbose_canvas_cursor (const string &, double x, double y);
548 void set_verbose_canvas_cursor_text (const string &);
549 void show_verbose_canvas_cursor();
550 void hide_verbose_canvas_cursor();
552 bool verbose_cursor_on; // so far unused
554 Gtk::EventBox time_canvas_event_box;
555 Gtk::EventBox track_canvas_event_box;
556 Gtk::EventBox time_button_event_box;
557 Gtk::Frame time_button_frame;
559 ArdourCanvas::Pixbuf* logo_item;
560 ArdourCanvas::Group* minsec_group;
561 ArdourCanvas::Group* bbt_group;
562 ArdourCanvas::Group* smpte_group;
563 ArdourCanvas::Group* frame_group;
564 ArdourCanvas::Group* tempo_group;
565 ArdourCanvas::Group* meter_group;
566 ArdourCanvas::Group* marker_group;
567 ArdourCanvas::Group* range_marker_group;
568 ArdourCanvas::Group* transport_marker_group;
569 ArdourCanvas::Group* cd_marker_group;
572 ruler_metric_smpte = 0,
573 ruler_metric_bbt = 1,
574 ruler_metric_frames = 2,
575 ruler_metric_minsec = 3,
577 ruler_time_tempo = 4,
578 ruler_time_meter = 5,
579 ruler_time_marker = 6,
580 ruler_time_range_marker = 7,
581 ruler_time_transport_marker = 8,
582 ruler_time_cd_marker = 9,
585 static GtkCustomMetric ruler_metrics[4];
586 bool ruler_shown[10];
587 bool no_ruler_shown_update;
589 gint ruler_button_press (GdkEventButton*);
590 gint ruler_button_release (GdkEventButton*);
591 gint ruler_mouse_motion (GdkEventMotion*);
592 bool ruler_scroll (GdkEventScroll* event);
594 gint ruler_pressed_button;
595 Gtk::Widget * ruler_grabbed_widget;
597 void initialize_rulers ();
598 void update_just_smpte ();
599 void update_fixed_rulers ();
600 void update_tempo_based_rulers ();
601 void popup_ruler_menu (nframes_t where = 0, ItemType type = RegionItem);
602 void update_ruler_visibility ();
603 void ruler_toggled (int);
604 gint ruler_label_button_release (GdkEventButton*);
605 void store_ruler_visibility ();
606 void restore_ruler_visibility ();
608 static gint _metric_get_smpte (GtkCustomRulerMark **, gdouble, gdouble, gint);
609 static gint _metric_get_bbt (GtkCustomRulerMark **, gdouble, gdouble, gint);
610 static gint _metric_get_frames (GtkCustomRulerMark **, gdouble, gdouble, gint);
611 static gint _metric_get_minsec (GtkCustomRulerMark **, gdouble, gdouble, gint);
613 gint metric_get_smpte (GtkCustomRulerMark **, gdouble, gdouble, gint);
614 gint metric_get_bbt (GtkCustomRulerMark **, gdouble, gdouble, gint);
615 gint metric_get_frames (GtkCustomRulerMark **, gdouble, gdouble, gint);
616 gint metric_get_minsec (GtkCustomRulerMark **, gdouble, gdouble, gint);
618 Gtk::Widget *_ruler_separator;
619 GtkWidget *_smpte_ruler;
620 GtkWidget *_bbt_ruler;
621 GtkWidget *_frames_ruler;
622 GtkWidget *_minsec_ruler;
623 Gtk::Widget *smpte_ruler;
624 Gtk::Widget *bbt_ruler;
625 Gtk::Widget *frames_ruler;
626 Gtk::Widget *minsec_ruler;
627 static Editor *ruler_editor;
629 static const double timebar_height;
630 guint32 visible_timebars;
631 Gtk::Menu *editor_ruler_menu;
633 ArdourCanvas::SimpleRect* tempo_bar;
634 ArdourCanvas::SimpleRect* meter_bar;
635 ArdourCanvas::SimpleRect* marker_bar;
636 ArdourCanvas::SimpleRect* range_marker_bar;
637 ArdourCanvas::SimpleRect* transport_marker_bar;
638 ArdourCanvas::SimpleRect* cd_marker_bar;
641 ArdourCanvas::SimpleLine* tempo_line;
642 ArdourCanvas::SimpleLine* meter_line;
643 ArdourCanvas::SimpleLine* marker_line;
644 ArdourCanvas::SimpleLine* range_marker_line;
645 ArdourCanvas::SimpleLine* transport_marker_line;
646 ArdourCanvas::SimpleLine* cd_marker_line;
648 Gtk::Label minsec_label;
649 Gtk::Label bbt_label;
650 Gtk::Label smpte_label;
651 Gtk::Label frame_label;
652 Gtk::Label tempo_label;
653 Gtk::Label meter_label;
654 Gtk::Label mark_label;
655 Gtk::Label range_mark_label;
656 Gtk::Label transport_mark_label;
657 Gtk::Label cd_mark_label;
660 Gtk::VBox time_button_vbox;
661 Gtk::HBox time_button_hbox;
665 ArdourCanvas::Points points;
666 ArdourCanvas::Line canvas_item;
667 nframes_t current_frame;
670 Cursor (Editor&, bool (Editor::*)(GdkEvent*,ArdourCanvas::Item*));
673 void set_position (nframes_t);
674 void set_length (double units);
675 void set_y_axis (double position);
678 friend struct Cursor; /* it needs access to several private
682 Cursor* playhead_cursor;
683 ArdourCanvas::Group* cursor_group;
685 void cursor_to_region_boundary (Cursor*, int32_t dir);
686 void cursor_to_next_region_boundary (Cursor*);
687 void cursor_to_previous_region_boundary (Cursor*);
688 void cursor_to_next_region_point (Cursor*, ARDOUR::RegionPoint);
689 void cursor_to_previous_region_point (Cursor*, ARDOUR::RegionPoint);
690 void cursor_to_region_point (Cursor*, ARDOUR::RegionPoint, int32_t dir);
691 void cursor_to_selection_start (Cursor *);
692 void cursor_to_selection_end (Cursor *);
694 void selected_marker_to_region_boundary (int32_t dir);
695 void selected_marker_to_next_region_boundary ();
696 void selected_marker_to_previous_region_boundary ();
697 void selected_marker_to_next_region_point (ARDOUR::RegionPoint);
698 void selected_marker_to_previous_region_point (ARDOUR::RegionPoint);
699 void selected_marker_to_region_point (ARDOUR::RegionPoint, int32_t dir);
700 void selected_marker_to_selection_start ();
701 void selected_marker_to_selection_end ();
703 void select_all_selectables_using_cursor (Cursor *, bool);
704 void select_all_selectables_using_edit (bool);
705 void select_all_selectables_between (bool within);
706 void select_range_between ();
708 boost::shared_ptr<ARDOUR::Region> find_next_region (nframes_t, ARDOUR::RegionPoint, int32_t dir, TrackViewList&, TimeAxisView ** = 0);
709 nframes64_t find_next_region_boundary (nframes64_t, int32_t dir, const TrackViewList&);
711 vector<nframes_t> region_boundary_cache;
712 void build_region_boundary_cache ();
714 Gtk::VBox trackview_vpacker;
717 Gtk::HBox bottom_hbox;
719 Gtk::Table edit_packer;
720 Gtk::VScrollbar edit_vscrollbar;
722 Gtk::Adjustment vertical_adjustment;
723 Gtk::Adjustment horizontal_adjustment;
725 Gtk::Layout controls_layout;
726 bool control_layout_scroll (GdkEventScroll* ev);
727 void controls_layout_size_request (Gtk::Requisition*);
729 Gtk::HScrollbar edit_hscrollbar;
730 bool _dragging_hscrollbar;
732 void reset_hscrollbar_stepping ();
734 bool hscrollbar_button_press (GdkEventButton*);
735 bool hscrollbar_button_release (GdkEventButton*);
736 void hscrollbar_allocate (Gtk::Allocation &alloc);
739 double canvas_height;
740 double full_canvas_height;
741 nframes_t last_canvas_frame;
743 bool track_canvas_map_handler (GdkEventAny*);
744 bool time_canvas_map_handler (GdkEventAny*);
746 gint edit_controls_button_release (GdkEventButton*);
747 Gtk::Menu *edit_controls_left_menu;
748 Gtk::Menu *edit_controls_right_menu;
750 Gtk::VBox track_canvas_vbox;
751 Gtk::VBox time_canvas_vbox;
752 Gtk::VBox edit_controls_vbox;
753 Gtk::HBox edit_controls_hbox;
755 void control_scroll (float);
756 bool deferred_control_scroll (nframes_t);
757 sigc::connection control_scroll_connection;
759 void tie_vertical_scrolling ();
760 void canvas_horizontally_scrolled ();
761 void canvas_scroll_to (nframes64_t);
763 struct VisualChange {
770 nframes_t time_origin;
771 double frames_per_unit;
775 VisualChange() : pending ((VisualChange::Type) 0), time_origin (0), frames_per_unit (0), idle_handler_id (-1) {}
779 VisualChange pending_visual_change;
781 static int _idle_visual_changer (void *arg);
782 int idle_visual_changer ();
784 void queue_visual_change (nframes_t);
785 void queue_visual_change (double);
787 void end_location_changed (ARDOUR::Location*);
789 struct RegionListDisplayModelColumns : public Gtk::TreeModel::ColumnRecord {
790 RegionListDisplayModelColumns() {
795 Gtk::TreeModelColumn<Glib::ustring> name;
796 Gtk::TreeModelColumn<boost::shared_ptr<ARDOUR::Region> > region;
797 Gtk::TreeModelColumn<Gdk::Color> color_;
800 RegionListDisplayModelColumns region_list_columns;
801 Gtkmm2ext::DnDTreeView<boost::shared_ptr<ARDOUR::Region> > region_list_display;
803 Glib::RefPtr<Gtk::TreeStore> region_list_model;
804 Glib::RefPtr<Gtk::ToggleAction> toggle_full_region_list_action;
805 Glib::RefPtr<Gtk::ToggleAction> toggle_show_auto_regions_action;
807 void region_list_selection_changed ();
808 bool region_list_selection_filter (const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::Path& path, bool yn);
809 void region_name_edit (const Glib::ustring&, const Glib::ustring&);
810 void get_regions_corresponding_to (boost::shared_ptr<ARDOUR::Region> region, std::vector<RegionView*>& regions);
812 Gtk::Menu *region_list_menu;
813 Gtk::ScrolledWindow region_list_scroller;
814 Gtk::Frame region_list_frame;
816 bool region_list_display_key_press (GdkEventKey *);
817 bool region_list_display_key_release (GdkEventKey *);
818 bool region_list_display_button_press (GdkEventButton *);
819 bool region_list_display_button_release (GdkEventButton *);
820 void region_list_clear ();
821 void region_list_selection_mapover (sigc::slot<void,boost::shared_ptr<ARDOUR::Region> >);
822 void build_region_list_menu ();
823 void show_region_list_display_context_menu (int button, int time);
825 bool show_automatic_regions_in_region_list;
826 Editing::RegionListSortType region_list_sort_type;
828 void reset_region_list_sort_direction (bool);
829 void reset_region_list_sort_type (Editing::RegionListSortType);
831 void toggle_full_region_list ();
832 void toggle_show_auto_regions ();
834 int region_list_sorter (Gtk::TreeModel::iterator, Gtk::TreeModel::iterator);
838 Gtk::ScrolledWindow snapshot_display_scroller;
839 struct SnapshotDisplayModelColumns : public Gtk::TreeModel::ColumnRecord {
840 SnapshotDisplayModelColumns() {
844 Gtk::TreeModelColumn<Glib::ustring> visible_name;
845 Gtk::TreeModelColumn<Glib::ustring> real_name;
848 SnapshotDisplayModelColumns snapshot_display_columns;
849 Glib::RefPtr<Gtk::ListStore> snapshot_display_model;
850 Gtk::TreeView snapshot_display;
851 Gtk::Menu snapshot_context_menu;
853 bool snapshot_display_button_press (GdkEventButton*);
854 void snapshot_display_selection_changed ();
855 void redisplay_snapshots();
856 void popup_snapshot_context_menu (int, int32_t, Glib::ustring);
858 /* named selections */
860 struct NamedSelectionDisplayModelColumns : public Gtk::TreeModel::ColumnRecord {
861 NamedSelectionDisplayModelColumns() {
865 Gtk::TreeModelColumn<Glib::ustring> text;
866 Gtk::TreeModelColumn<ARDOUR::NamedSelection*> selection;
869 NamedSelectionDisplayModelColumns named_selection_columns;
870 Glib::RefPtr<Gtk::TreeStore> named_selection_model;
872 Gtkmm2ext::DnDTreeView<ARDOUR::NamedSelection*> named_selection_display;
873 Gtk::ScrolledWindow named_selection_scroller;
875 void create_named_selection ();
876 void paste_named_selection (float times);
877 void remove_selected_named_selections ();
878 void remove_snapshot (Glib::ustring);
879 void rename_snapshot (Glib::ustring);
881 void handle_new_named_selection ();
882 void add_named_selection_to_named_selection_display (ARDOUR::NamedSelection&);
883 void redisplay_named_selections ();
885 bool named_selection_display_button_release (GdkEventButton *ev);
886 bool named_selection_display_key_release (GdkEventKey *ev);
887 void named_selection_display_selection_changed ();
890 TrackViewList track_views;
891 TimeAxisView *trackview_by_y_position (double ypos);
893 static Gdk::Cursor* cross_hair_cursor;
894 static Gdk::Cursor* trimmer_cursor;
895 static Gdk::Cursor* selector_cursor;
896 static Gdk::Cursor* grabber_cursor;
897 static Gdk::Cursor* zoom_cursor;
898 static Gdk::Cursor* time_fx_cursor;
899 static Gdk::Cursor* fader_cursor;
900 static Gdk::Cursor* speaker_cursor;
901 static Gdk::Cursor* wait_cursor;
902 static Gdk::Cursor* timebar_cursor;
903 static Gdk::Cursor* transparent_cursor;
905 static void build_cursors ();
907 sigc::connection scroll_connection;
908 nframes_t last_update_frame;
909 void center_screen (nframes_t);
910 void center_screen_internal (nframes_t, float);
912 void update_current_screen ();
914 void session_going_away ();
916 nframes_t cut_buffer_start;
917 nframes_t cut_buffer_length;
919 bool typed_event (ArdourCanvas::Item*, GdkEvent*, ItemType);
920 bool button_press_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
921 bool button_release_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
922 bool motion_handler (ArdourCanvas::Item*, GdkEvent*, ItemType, bool from_autoscroll = false);
923 bool enter_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
924 bool leave_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
926 /* KEYMAP HANDLING */
928 void register_actions ();
930 int ensure_cursor (nframes_t* pos);
932 void handle_new_audio_region (boost::weak_ptr<ARDOUR::AudioRegion>);
933 void handle_audio_region_removed (boost::weak_ptr<ARDOUR::AudioRegion>);
934 void add_audio_region_to_region_display (boost::shared_ptr<ARDOUR::AudioRegion>);
935 void region_hidden (boost::shared_ptr<ARDOUR::Region>);
936 void redisplay_regions ();
937 void insert_into_tmp_audio_regionlist(boost::shared_ptr<ARDOUR::AudioRegion>);
939 list<boost::shared_ptr<ARDOUR::AudioRegion> > tmp_audio_region_list;
941 void cut_copy (Editing::CutCopyOp);
942 void cut_copy_points (Editing::CutCopyOp);
943 void cut_copy_regions (Editing::CutCopyOp);
944 void cut_copy_ranges (Editing::CutCopyOp);
947 void paste_internal (nframes_t position, float times);
949 /* EDITING OPERATIONS */
951 void reset_point_selection ();
952 void toggle_region_mute ();
953 void toggle_region_lock ();
954 void toggle_region_opaque ();
955 void set_region_lock_style (ARDOUR::Region::PositionLockStyle);
956 void raise_region ();
957 void raise_region_to_top ();
958 void lower_region ();
959 void lower_region_to_bottom ();
960 void split_region ();
961 void split_region_at (nframes_t);
962 void split_regions_at (nframes_t, RegionSelection&);
963 void split_region_at_transients ();
964 void split_region_at_points (boost::shared_ptr<ARDOUR::Region>, ARDOUR::AnalysisFeatureList&);
965 void crop_region_to_selection ();
966 void crop_region_to (nframes_t start, nframes_t end);
967 void set_sync_point (nframes64_t, const RegionSelection&);
968 void set_region_sync_from_edit_point ();
969 void remove_region_sync();
970 void align_selection (ARDOUR::RegionPoint, nframes_t position, const RegionSelection&);
971 void align_selection_relative (ARDOUR::RegionPoint point, nframes_t position, const RegionSelection&);
972 void align_region (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, nframes_t position);
973 void align_region_internal (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, nframes_t position);
974 void remove_clicked_region ();
975 void destroy_clicked_region ();
977 void rename_region ();
978 void duplicate_some_regions (RegionSelection&, float times);
979 void duplicate_selection (float times);
980 void region_fill_selection ();
982 void region_fill_track ();
983 void audition_playlist_region_standalone (boost::shared_ptr<ARDOUR::Region>);
984 void audition_playlist_region_via_route (boost::shared_ptr<ARDOUR::Region>, ARDOUR::Route&);
985 void split_multichannel_region();
986 void reverse_region ();
987 void normalize_region ();
988 void denormalize_region ();
989 void adjust_region_scale_amplitude (bool up);
991 void tab_to_transient (bool forward);
993 void use_region_as_bar ();
994 void use_range_as_bar ();
996 void define_one_bar (nframes64_t start, nframes64_t end);
998 void audition_region_from_region_list ();
999 void hide_region_from_region_list ();
1000 void remove_region_from_region_list ();
1002 void align (ARDOUR::RegionPoint);
1003 void align_relative (ARDOUR::RegionPoint);
1006 void reset_focus ();
1012 void paste (float times);
1014 int get_prefix (float&, bool&);
1016 void keyboard_paste ();
1017 void keyboard_insert_region_list_selection ();
1019 void region_from_selection ();
1020 void create_region_from_selection (std::vector<boost::shared_ptr<ARDOUR::AudioRegion> >&);
1022 void play_from_start ();
1023 void play_from_edit_point ();
1024 void play_from_edit_point_and_return ();
1025 void play_selected_region ();
1026 void play_edit_range ();
1027 void loop_selected_region ();
1028 void play_location (ARDOUR::Location&);
1029 void loop_location (ARDOUR::Location&);
1031 void temporal_zoom_selection ();
1032 void temporal_zoom_region ();
1033 void toggle_zoom_region ();
1034 bool zoomed_to_region;
1035 void temporal_zoom_session ();
1036 void temporal_zoom (gdouble scale);
1037 void temporal_zoom_by_frame (nframes_t start, nframes_t end, const string & op);
1038 void temporal_zoom_to_frame (bool coarser, nframes_t frame);
1040 void amplitude_zoom (gdouble scale);
1041 void amplitude_zoom_step (bool in);
1043 void insert_region_list_drag (boost::shared_ptr<ARDOUR::AudioRegion>, int x, int y);
1044 void insert_region_list_selection (float times);
1046 void add_external_audio_action (Editing::ImportMode);
1047 void external_audio_dialog ();
1048 bool check_multichannel_status (const std::vector<Glib::ustring>& paths);
1050 SoundFileOmega* sfbrowser;
1052 void bring_in_external_audio (Editing::ImportMode mode, nframes64_t& pos);
1053 void do_import (vector<Glib::ustring> paths, Editing::ImportDisposition, Editing::ImportMode mode, ARDOUR::SrcQuality, nframes64_t&);
1055 void _do_embed (vector<Glib::ustring> paths, Editing::ImportDisposition, Editing::ImportMode mode, nframes64_t&);
1056 void do_embed (vector<Glib::ustring> paths, Editing::ImportDisposition, Editing::ImportMode mode, nframes64_t&);
1057 bool idle_do_embed (vector<Glib::ustring> paths, Editing::ImportDisposition, Editing::ImportMode mode, nframes64_t&);
1059 int import_sndfiles (vector<Glib::ustring> paths, Editing::ImportMode mode, ARDOUR::SrcQuality, nframes64_t& pos,
1060 int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::AudioTrack>&);
1061 int embed_sndfiles (vector<Glib::ustring> paths, bool multiple_files, bool& check_sample_rate, Editing::ImportMode mode,
1062 nframes64_t& pos, int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::AudioTrack>&);
1064 int add_sources (vector<Glib::ustring> paths, ARDOUR::SourceList& sources, nframes64_t& pos, Editing::ImportMode,
1065 int target_regions, int target_tracks, boost::shared_ptr<ARDOUR::AudioTrack>&, bool add_channel_suffix);
1066 int finish_bringing_in_audio (boost::shared_ptr<ARDOUR::AudioRegion> region, uint32_t, uint32_t, nframes64_t& pos, Editing::ImportMode mode,
1067 boost::shared_ptr<ARDOUR::AudioTrack>& existing_track);
1069 boost::shared_ptr<ARDOUR::AudioTrack> get_nth_selected_audio_track (int nth) const;
1071 /* generic interthread progress window */
1073 ArdourDialog* interthread_progress_window;
1074 Gtk::Label interthread_progress_label;
1075 Gtk::VBox interthread_progress_vbox;
1076 Gtk::ProgressBar interthread_progress_bar;
1077 Gtk::Button interthread_cancel_button;
1078 Gtk::Label interthread_cancel_label;
1079 sigc::connection interthread_progress_connection;
1080 void interthread_cancel_clicked ();
1081 void build_interthread_progress_window ();
1082 ARDOUR::InterThreadInfo* current_interthread_info;
1085 AnalysisWindow* analysis_window;
1088 /* import specific info */
1090 ARDOUR::Session::import_status import_status;
1091 gint import_progress_timeout (void *);
1092 static void *_import_thread (void *);
1093 void* import_thread ();
1095 /* to support this ... */
1097 void import_audio (bool as_tracks);
1098 void do_import (vector<Glib::ustring> paths, bool split, bool as_tracks);
1100 void move_to_start ();
1101 void move_to_end ();
1103 void center_playhead ();
1104 void center_edit_point ();
1105 void edit_cursor_backward ();
1106 void edit_cursor_forward ();
1107 void playhead_backward ();
1108 void playhead_forward ();
1109 void scroll_playhead (bool forward);
1110 void scroll_backward (float pages=0.8f);
1111 void scroll_forward (float pages=0.8f);
1112 void scroll_tracks_down ();
1113 void scroll_tracks_up ();
1114 void delete_sample_forward ();
1115 void delete_sample_backward ();
1116 void delete_screen ();
1117 void search_backwards ();
1118 void search_forwards ();
1120 void clear_markers ();
1121 void clear_ranges ();
1122 void clear_locations ();
1123 void unhide_markers ();
1124 void unhide_ranges ();
1125 void jump_forward_to_mark ();
1126 void jump_backward_to_mark ();
1127 void cursor_align (bool playhead_to_edit);
1129 void remove_last_capture ();
1130 void select_all_selectables_using_time_selection ();
1131 void select_all_selectables_using_loop();
1132 void select_all_selectables_using_punch();
1133 void set_selection_from_range (ARDOUR::Location&);
1134 void set_selection_from_punch ();
1135 void set_selection_from_loop ();
1136 void set_selection_from_audio_region ();
1138 void add_location_mark (nframes64_t where);
1139 void add_location_from_audio_region ();
1140 void add_location_from_selection ();
1141 void set_loop_from_selection (bool play);
1142 void set_punch_from_selection ();
1143 void set_punch_from_region ();
1145 void set_loop_from_edit_range (bool play);
1146 void set_loop_from_region (bool play);
1147 void set_punch_from_edit_range ();
1149 void set_loop_range (nframes_t start, nframes_t end, std::string cmd);
1150 void set_punch_range (nframes_t start, nframes_t end, std::string cmd);
1152 void add_location_from_playhead_cursor ();
1153 bool select_new_marker;
1155 void reverse_selection ();
1156 void edit_envelope ();
1158 void start_scrolling ();
1159 void stop_scrolling ();
1162 double last_scrub_x;
1163 int scrubbing_direction;
1164 int scrub_reversals;
1165 int scrub_reverse_distance;
1167 void keyboard_selection_begin ();
1168 void keyboard_selection_finish (bool add);
1169 bool have_pending_keyboard_selection;
1170 nframes_t pending_keyboard_selection_start;
1172 boost::shared_ptr<ARDOUR::Region> select_region_for_operation (int dir, TimeAxisView **tv);
1173 void extend_selection_to_end_of_region (bool next);
1174 void extend_selection_to_start_of_region (bool previous);
1176 Editing::SnapType snap_type;
1177 Editing::SnapMode snap_mode;
1178 double snap_threshold;
1180 void handle_gui_changes (const string &, void *);
1182 void hide_all_tracks (bool with_select);
1185 LineDragInfo current_line_drag_info;
1187 void start_grab (GdkEvent*, Gdk::Cursor* cursor = 0);
1188 bool end_grab (ArdourCanvas::Item*, GdkEvent*);
1189 void swap_grab (ArdourCanvas::Item*, Gdk::Cursor* cursor, uint32_t time);
1191 Gtk::Menu fade_context_menu;
1192 void popup_fade_context_menu (int, int, ArdourCanvas::Item*, ItemType);
1194 void start_fade_in_grab (ArdourCanvas::Item*, GdkEvent*);
1195 void start_fade_out_grab (ArdourCanvas::Item*, GdkEvent*);
1196 void fade_in_drag_motion_callback (ArdourCanvas::Item*, GdkEvent*);
1197 void fade_out_drag_motion_callback (ArdourCanvas::Item*, GdkEvent*);
1198 void fade_in_drag_finished_callback (ArdourCanvas::Item*, GdkEvent*);
1199 void fade_out_drag_finished_callback (ArdourCanvas::Item*, GdkEvent*);
1201 void set_fade_in_shape (ARDOUR::AudioRegion::FadeShape);
1202 void set_fade_out_shape (ARDOUR::AudioRegion::FadeShape);
1204 void set_fade_length (bool in);
1205 void toggle_fade_active (bool in);
1206 void set_fade_in_active (bool);
1207 void set_fade_out_active (bool);
1209 std::set<boost::shared_ptr<ARDOUR::Playlist> > motion_frozen_playlists;
1210 RegionSelection pre_drag_region_selection;
1211 void region_drag_motion_callback (ArdourCanvas::Item*, GdkEvent*);
1212 void region_drag_finished_callback (ArdourCanvas::Item*, GdkEvent*);
1213 bool check_region_drag_possible (AudioTimeAxisView**);
1214 void possibly_copy_regions_during_grab (GdkEvent*);
1215 void region_drag_splice_motion_callback (ArdourCanvas::Item*, GdkEvent*);
1216 void region_drag_splice_finished_callback (ArdourCanvas::Item*, GdkEvent*);
1218 bool _dragging_playhead;
1219 bool _dragging_edit_point;
1221 void cursor_drag_motion_callback (ArdourCanvas::Item*, GdkEvent*);
1222 void cursor_drag_finished_callback (ArdourCanvas::Item*, GdkEvent*);
1223 void marker_drag_motion_callback (ArdourCanvas::Item*, GdkEvent*);
1224 void marker_drag_finished_callback (ArdourCanvas::Item*, GdkEvent*);
1225 void control_point_drag_motion_callback (ArdourCanvas::Item*, GdkEvent*);
1226 void control_point_drag_finished_callback (ArdourCanvas::Item*, GdkEvent*);
1227 void line_drag_motion_callback (ArdourCanvas::Item*, GdkEvent*);
1228 void line_drag_finished_callback (ArdourCanvas::Item*, GdkEvent*);
1230 void tempo_marker_drag_motion_callback (ArdourCanvas::Item*, GdkEvent*);
1231 void tempo_marker_drag_finished_callback (ArdourCanvas::Item*, GdkEvent*);
1232 void meter_marker_drag_motion_callback (ArdourCanvas::Item*, GdkEvent*);
1233 void meter_marker_drag_finished_callback (ArdourCanvas::Item*, GdkEvent*);
1235 gint mouse_rename_region (ArdourCanvas::Item*, GdkEvent*);
1237 void start_region_grab (ArdourCanvas::Item*, GdkEvent*);
1238 void start_region_copy_grab (ArdourCanvas::Item*, GdkEvent*);
1239 void start_region_brush_grab (ArdourCanvas::Item*, GdkEvent*);
1240 void start_selection_grab (ArdourCanvas::Item*, GdkEvent*);
1241 void start_cursor_grab (ArdourCanvas::Item*, GdkEvent*);
1242 void start_marker_grab (ArdourCanvas::Item*, GdkEvent*);
1243 void start_control_point_grab (ArdourCanvas::Item*, GdkEvent*);
1244 void start_line_grab_from_regionview (ArdourCanvas::Item*, GdkEvent*);
1245 void start_line_grab_from_line (ArdourCanvas::Item*, GdkEvent*);
1246 void start_line_grab (AutomationLine *, GdkEvent*);
1247 void start_tempo_marker_grab (ArdourCanvas::Item*, GdkEvent*);
1248 void start_tempo_marker_copy_grab (ArdourCanvas::Item*, GdkEvent*);
1249 void start_meter_marker_grab (ArdourCanvas::Item*, GdkEvent*);
1250 void start_meter_marker_copy_grab (ArdourCanvas::Item*, GdkEvent*);
1252 void region_view_item_click (AudioRegionView&, GdkEventButton*);
1254 void remove_gain_control_point (ArdourCanvas::Item*, GdkEvent*);
1255 void remove_control_point (ArdourCanvas::Item*, GdkEvent*);
1257 void mouse_brush_insert_region (RegionView*, nframes_t pos);
1258 void brush (nframes_t);
1260 void show_verbose_time_cursor (nframes_t frame, double offset = 0, double xpos=-1, double ypos=-1);
1261 void show_verbose_duration_cursor (nframes_t start, nframes_t end, double offset = 0, double xpos=-1, double ypos=-1);
1262 double clamp_verbose_cursor_x (double);
1263 double clamp_verbose_cursor_y (double);
1265 /* Canvas event handlers */
1267 bool canvas_control_point_event (GdkEvent* event,ArdourCanvas::Item*, ControlPoint*);
1268 bool canvas_line_event (GdkEvent* event,ArdourCanvas::Item*, AutomationLine*);
1269 bool canvas_selection_rect_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1270 bool canvas_selection_start_trim_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1271 bool canvas_selection_end_trim_event (GdkEvent* event,ArdourCanvas::Item*, SelectionRect*);
1272 bool canvas_crossfade_view_event (GdkEvent* event,ArdourCanvas::Item*, CrossfadeView*);
1273 bool canvas_fade_in_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1274 bool canvas_fade_in_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1275 bool canvas_fade_out_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1276 bool canvas_fade_out_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
1279 // These variables are used to detect a feedback loop and break it to avoid a gui hang
1281 ArdourCanvas::Item *last_item_entered;
1282 int last_item_entered_n;
1285 bool canvas_region_view_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1286 bool canvas_region_view_name_highlight_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1287 bool canvas_region_view_name_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
1288 bool canvas_stream_view_event (GdkEvent* event,ArdourCanvas::Item*, RouteTimeAxisView*);
1289 bool canvas_marker_event (GdkEvent* event,ArdourCanvas::Item*, Marker*);
1290 bool canvas_zoom_rect_event (GdkEvent* event,ArdourCanvas::Item*);
1291 bool canvas_tempo_marker_event (GdkEvent* event,ArdourCanvas::Item*, TempoMarker*);
1292 bool canvas_meter_marker_event (GdkEvent* event,ArdourCanvas::Item*, MeterMarker*);
1293 bool canvas_automation_track_event(GdkEvent* event, ArdourCanvas::Item*, AutomationTimeAxisView*) ;
1295 bool canvas_tempo_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1296 bool canvas_meter_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1297 bool canvas_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1298 bool canvas_range_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1299 bool canvas_transport_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1300 bool canvas_cd_marker_bar_event (GdkEvent* event, ArdourCanvas::Item*);
1302 bool canvas_imageframe_item_view_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1303 bool canvas_imageframe_view_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameTimeAxis*);
1304 bool canvas_imageframe_start_handle_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1305 bool canvas_imageframe_end_handle_event(GdkEvent* event, ArdourCanvas::Item*,ImageFrameView*);
1306 bool canvas_marker_time_axis_view_event(GdkEvent* event, ArdourCanvas::Item*,MarkerTimeAxis*);
1307 bool canvas_markerview_item_view_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1308 bool canvas_markerview_start_handle_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1309 bool canvas_markerview_end_handle_event(GdkEvent* event, ArdourCanvas::Item*,MarkerView*);
1311 /* non-public event handlers */
1313 bool canvas_playhead_cursor_event (GdkEvent* event, ArdourCanvas::Item*);
1314 bool track_canvas_scroll (GdkEventScroll* event);
1315 bool time_canvas_scroll (GdkEventScroll* event);
1317 bool track_canvas_scroll_event (GdkEventScroll* event);
1318 bool track_canvas_button_press_event (GdkEventButton* event);
1319 bool track_canvas_button_release_event (GdkEventButton* event);
1320 bool track_canvas_motion_notify_event (GdkEventMotion* event);
1322 bool time_canvas_scroll_event (GdkEventScroll* event);
1324 Gtk::Allocation canvas_allocation;
1325 bool canvas_idle_queued;
1326 void track_canvas_allocate (Gtk::Allocation alloc);
1327 bool track_canvas_size_allocated ();
1329 void set_playhead_cursor ();
1331 void kbd_driver (sigc::slot<void,GdkEvent*>, bool use_track_canvas = true, bool use_time_canvas = true, bool can_select = true);
1332 void kbd_mute_unmute_region ();
1335 void kbd_do_brush (GdkEvent*);
1336 void kbd_do_audition (GdkEvent*);
1338 void handle_new_duration ();
1339 void initialize_canvas ();
1340 void reset_scrolling_region (Gtk::Allocation* alloc = 0);
1342 /* display control */
1344 bool _show_measures;
1345 bool _show_waveforms;
1346 bool _follow_playhead;
1347 bool _show_waveforms_recording;
1349 ARDOUR::TempoMap::BBTPointList *current_bbt_points;
1351 typedef vector<ArdourCanvas::SimpleLine*> TimeLineList;
1352 TimeLineList free_measure_lines;
1353 TimeLineList used_measure_lines;
1355 ArdourCanvas::Group* time_line_group;
1356 ArdourCanvas::SimpleLine* get_time_line ();
1357 void hide_measures ();
1358 void draw_measures ();
1359 bool lazy_hide_and_draw_measures ();
1361 void new_tempo_section ();
1363 void mouse_add_new_tempo_event (nframes_t where);
1364 void mouse_add_new_meter_event (nframes_t where);
1366 void remove_tempo_marker (ArdourCanvas::Item*);
1367 void remove_meter_marker (ArdourCanvas::Item*);
1368 gint real_remove_tempo_marker (ARDOUR::TempoSection*);
1369 gint real_remove_meter_marker (ARDOUR::MeterSection*);
1371 void edit_tempo_section (ARDOUR::TempoSection*);
1372 void edit_meter_section (ARDOUR::MeterSection*);
1373 void edit_tempo_marker (ArdourCanvas::Item*);
1374 void edit_meter_marker (ArdourCanvas::Item*);
1376 void marker_menu_edit ();
1377 void marker_menu_remove ();
1378 void marker_menu_rename ();
1379 void marker_menu_lock (bool yn);
1380 void marker_menu_hide ();
1381 void marker_menu_loop_range ();
1382 void marker_menu_select_all_selectables_using_range ();
1383 void marker_menu_select_using_range ();
1384 void marker_menu_separate_regions_using_location ();
1385 void marker_menu_play_from ();
1386 void marker_menu_play_range ();
1387 void marker_menu_set_playhead ();
1388 void marker_menu_set_from_playhead ();
1389 void marker_menu_set_from_selection ();
1390 void new_transport_marker_menu_set_loop ();
1391 void new_transport_marker_menu_set_punch ();
1392 void update_loop_range_view (bool visibility=false);
1393 void update_punch_range_view (bool visibility=false);
1394 gint new_transport_marker_menu_popdown (GdkEventAny*);
1395 void marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1396 void tm_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1397 void transport_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1398 void new_transport_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
1399 void build_range_marker_menu (bool loop_or_punch);
1400 void build_marker_menu (bool start_or_end);
1401 void build_tm_marker_menu ();
1402 void build_new_transport_marker_menu ();
1404 Gtk::Menu* tm_marker_menu;
1405 Gtk::Menu* marker_menu;
1406 Gtk::Menu* start_end_marker_menu;
1407 Gtk::Menu* range_marker_menu;
1408 Gtk::Menu* transport_marker_menu;
1409 Gtk::Menu* new_transport_marker_menu;
1410 Gtk::Menu* cd_marker_menu;
1411 ArdourCanvas::Item* marker_menu_item;
1413 typedef list<Marker*> Marks;
1416 void remove_metric_marks ();
1417 void draw_metric_marks (const ARDOUR::Metrics& metrics);
1419 void tempo_map_changed (ARDOUR::Change);
1420 void redisplay_tempo (bool immediate_redraw);
1422 void snap_to (nframes64_t& first, int32_t direction = 0, bool for_mark = false);
1423 void snap_to (nframes_t& first, int32_t direction = 0, bool for_mark = false) {
1424 /* XXX remove this function when everything moves to 64 bit frame counts */
1425 nframes64_t first64 = first;
1426 snap_to (first64, direction, for_mark);
1427 first = (nframes_t) first64;
1430 uint32_t bbt_beat_subdivision;
1434 Gtk::ToggleButton editor_mixer_button;
1436 void editor_mixer_button_toggled ();
1438 AudioClock edit_point_clock;
1439 AudioClock zoom_range_clock;
1440 Gtk::Button zoom_in_button;
1441 Gtk::Button zoom_out_button;
1442 Gtk::Button zoom_out_full_button;
1443 Gtk::Button zoom_onetoone_button;
1445 Gtk::VBox toolbar_clock_vbox;
1446 Gtk::VBox toolbar_selection_clock_vbox;
1447 Gtk::Table toolbar_selection_clock_table;
1448 Gtk::Label toolbar_selection_cursor_label;
1450 Gtk::HBox mouse_mode_button_box;
1451 Gtkmm2ext::TearOff* mouse_mode_tearoff;
1452 Gtk::ToggleButton mouse_select_button;
1453 Gtk::ToggleButton mouse_move_button;
1454 Gtk::ToggleButton mouse_gain_button;
1455 Gtk::ToggleButton mouse_zoom_button;
1456 Gtk::ToggleButton mouse_timefx_button;
1457 Gtk::ToggleButton mouse_audition_button;
1458 GroupedButtons *mouse_mode_button_set;
1459 void mouse_mode_toggled (Editing::MouseMode m);
1460 bool ignore_mouse_mode_toggle;
1462 gint mouse_select_button_release (GdkEventButton*);
1464 Gtk::VBox automation_box;
1465 Gtk::Button automation_mode_button;
1466 Gtk::ToggleButton global_automation_button;
1468 Gtk::ComboBoxText edit_mode_selector;
1469 Gtk::VBox edit_mode_box;
1471 void set_edit_mode (ARDOUR::EditMode);
1472 void cycle_edit_mode ();
1473 void edit_mode_selection_done ();
1475 Gtk::ComboBoxText snap_type_selector;
1476 Gtk::ComboBoxText snap_mode_selector;
1479 std::vector<std::string> snap_type_strings;
1480 std::vector<std::string> snap_mode_strings;
1482 void snap_type_selection_done ();
1483 void snap_mode_selection_done ();
1484 void snap_mode_chosen (Editing::SnapMode);
1485 void snap_type_chosen (Editing::SnapType);
1487 Glib::RefPtr<Gtk::RadioAction> snap_type_action (Editing::SnapType);
1488 Glib::RefPtr<Gtk::RadioAction> snap_mode_action (Editing::SnapMode);
1490 Gtk::ComboBoxText zoom_focus_selector;
1491 Gtk::VBox zoom_focus_box;
1493 std::vector<std::string> zoom_focus_strings;
1495 void zoom_focus_selection_done ();
1496 void zoom_focus_chosen (Editing::ZoomFocus);
1498 Glib::RefPtr<Gtk::RadioAction> zoom_focus_action (Editing::ZoomFocus);
1502 void zoom_adjustment_changed();
1504 void edit_point_clock_changed();
1506 void setup_toolbar ();
1508 Gtkmm2ext::TearOff* tools_tearoff;
1509 Gtk::HBox toolbar_hbox;
1510 Gtk::EventBox toolbar_base;
1511 Gtk::Frame toolbar_frame;
1513 /* selection process */
1515 Selection* selection;
1516 Selection* cut_buffer;
1518 void time_selection_changed ();
1519 void track_selection_changed ();
1520 void region_selection_changed ();
1521 void point_selection_changed ();
1522 void marker_selection_changed ();
1531 void start_selection_op (ArdourCanvas::Item* item, GdkEvent* event, SelectionOp);
1532 void drag_selection (ArdourCanvas::Item* item, GdkEvent* event);
1533 void end_selection_op (ArdourCanvas::Item* item, GdkEvent* event);
1534 void cancel_selection ();
1536 void region_selection_op (void (ARDOUR::Region::*pmf)(void));
1537 void region_selection_op (void (ARDOUR::Region::*pmf)(void*), void*);
1538 void region_selection_op (void (ARDOUR::Region::*pmf)(bool), bool);
1540 bool audio_region_selection_covers (nframes_t where);
1542 /* transport range select process */
1543 enum RangeMarkerOp {
1545 CreateTransportMarker,
1549 void start_range_markerbar_op (ArdourCanvas::Item* item, GdkEvent* event, RangeMarkerOp);
1550 void drag_range_markerbar_op (ArdourCanvas::Item* item, GdkEvent* event);
1551 void end_range_markerbar_op (ArdourCanvas::Item* item, GdkEvent* event);
1553 ArdourCanvas::SimpleRect* range_bar_drag_rect;
1554 ArdourCanvas::SimpleRect* transport_bar_drag_rect;
1555 ArdourCanvas::Line* marker_drag_line;
1556 ArdourCanvas::Points marker_drag_line_points;
1557 ArdourCanvas::SimpleRect* range_marker_drag_rect;
1559 void update_marker_drag_item (ARDOUR::Location *);
1561 ArdourCanvas::SimpleRect *transport_bar_range_rect;
1562 ArdourCanvas::SimpleRect *transport_bar_preroll_rect;
1563 ArdourCanvas::SimpleRect *transport_bar_postroll_rect;
1564 ArdourCanvas::SimpleRect *transport_loop_range_rect;
1565 ArdourCanvas::SimpleRect *transport_punch_range_rect;
1566 ArdourCanvas::SimpleLine *transport_punchin_line;
1567 ArdourCanvas::SimpleLine *transport_punchout_line;
1568 ArdourCanvas::SimpleRect *transport_preroll_rect;
1569 ArdourCanvas::SimpleRect *transport_postroll_rect;
1571 ARDOUR::Location* transport_loop_location();
1572 ARDOUR::Location* transport_punch_location();
1574 ARDOUR::Location *temp_location;
1576 /* object rubberband select process */
1578 void start_rubberband_select (ArdourCanvas::Item* item, GdkEvent* event);
1579 void drag_rubberband_select (ArdourCanvas::Item* item, GdkEvent* event);
1580 void end_rubberband_select (ArdourCanvas::Item* item, GdkEvent* event);
1582 bool select_all_within (nframes_t start, nframes_t end, gdouble topy, gdouble boty, const TrackViewList&, Selection::Operation op);
1584 ArdourCanvas::SimpleRect *rubberband_rect;
1586 /* mouse zoom process */
1588 void start_mouse_zoom (ArdourCanvas::Item* item, GdkEvent* event);
1589 void drag_mouse_zoom (ArdourCanvas::Item* item, GdkEvent* event);
1590 void end_mouse_zoom (ArdourCanvas::Item* item, GdkEvent* event);
1592 ArdourCanvas::SimpleRect *zoom_rect;
1593 void reposition_zoom_rect (nframes_t start, nframes_t end);
1595 /* diskstream/route display management */
1597 struct RouteDisplayModelColumns : public Gtk::TreeModel::ColumnRecord {
1598 RouteDisplayModelColumns() {
1604 Gtk::TreeModelColumn<Glib::ustring> text;
1605 Gtk::TreeModelColumn<bool> visible;
1606 Gtk::TreeModelColumn<TimeAxisView*> tv;
1607 Gtk::TreeModelColumn<boost::shared_ptr<ARDOUR::Route> > route;
1610 RouteDisplayModelColumns route_display_columns;
1611 Glib::RefPtr<Gtk::ListStore> route_display_model;
1612 Glib::RefPtr<Gtk::TreeSelection> route_display_selection;
1614 Gtkmm2ext::DnDTreeView<boost::shared_ptr<ARDOUR::Route> > route_list_display;
1615 Gtk::ScrolledWindow route_list_scroller;
1616 Gtk::Menu* route_list_menu;
1618 void sync_order_keys ();
1619 bool ignore_route_order_sync;
1621 bool route_list_display_button_press (GdkEventButton*);
1622 void route_list_display_drag_data_received (const Glib::RefPtr<Gdk::DragContext>& context,
1625 const Gtk::SelectionData& data,
1629 bool route_list_selection_filter (const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::Path& path, bool yn);
1631 void route_list_change (const Gtk::TreeModel::Path&,const Gtk::TreeModel::iterator&);
1632 void route_list_delete (const Gtk::TreeModel::Path&);
1633 void track_list_reorder (const Gtk::TreeModel::Path& path, const Gtk::TreeModel::iterator& iter, int* new_order);
1635 void initial_route_list_display ();
1636 void redisplay_route_list();
1637 bool ignore_route_list_reorder;
1638 bool no_route_list_redisplay;
1640 void build_route_list_menu ();
1641 void show_route_list_menu ();
1643 void show_all_routes ();
1644 void hide_all_routes ();
1645 void show_all_audiotracks ();
1646 void hide_all_audiotracks ();
1647 void show_all_audiobus ();
1648 void hide_all_audiobus ();
1650 void set_all_tracks_visibility (bool yn);
1651 void set_all_audio_visibility (int type, bool yn);
1653 /* edit group management */
1655 struct GroupListModelColumns : public Gtk::TreeModel::ColumnRecord {
1656 GroupListModelColumns () {
1662 Gtk::TreeModelColumn<bool> is_active;
1663 Gtk::TreeModelColumn<bool> is_visible;
1664 Gtk::TreeModelColumn<std::string> text;
1665 Gtk::TreeModelColumn<ARDOUR::RouteGroup*> routegroup;
1668 GroupListModelColumns group_columns;
1669 Glib::RefPtr<Gtk::ListStore> group_model;
1670 Glib::RefPtr<Gtk::TreeSelection> group_selection;
1672 Gtk::TreeView edit_group_display;
1673 Gtk::ScrolledWindow edit_group_display_scroller;
1674 Gtk::Menu* edit_group_list_menu;
1676 void build_edit_group_list_menu ();
1677 void activate_all_edit_groups ();
1678 void disable_all_edit_groups ();
1680 bool in_edit_group_row_change;
1681 void edit_group_row_change (const Gtk::TreeModel::Path&,const Gtk::TreeModel::iterator&);
1682 void edit_group_name_edit (const Glib::ustring&, const Glib::ustring&);
1683 void new_edit_group ();
1684 void edit_group_list_button_clicked ();
1685 gint edit_group_list_button_press_event (GdkEventButton* ev);
1686 void add_edit_group (ARDOUR::RouteGroup* group);
1687 void remove_selected_edit_group ();
1688 void edit_groups_changed ();
1689 void group_flags_changed (void*, ARDOUR::RouteGroup*);
1691 Gtk::VBox list_vpacker;
1695 bool autoscroll_active;
1696 int autoscroll_timeout_tag;
1697 int autoscroll_direction;
1698 uint32_t autoscroll_cnt;
1699 nframes_t autoscroll_distance;
1701 static gint _autoscroll_canvas (void *);
1702 bool autoscroll_canvas ();
1703 void start_canvas_autoscroll (int direction);
1704 void stop_canvas_autoscroll ();
1705 void maybe_autoscroll (GdkEvent*);
1714 void start_trim (ArdourCanvas::Item*, GdkEvent*);
1715 void point_trim (GdkEvent*);
1716 void trim_motion_callback (ArdourCanvas::Item*, GdkEvent*);
1717 void single_contents_trim (RegionView&, nframes_t, bool, bool, bool);
1718 void single_start_trim (RegionView&, nframes_t, bool, bool);
1719 void single_end_trim (RegionView&, nframes_t, bool, bool);
1721 void trim_finished_callback (ArdourCanvas::Item*, GdkEvent*);
1722 void thaw_region_after_trim (RegionView& rv);
1724 void trim_region_front();
1725 void trim_region_back();
1726 void trim_region (bool front);
1728 void trim_region_to_edit_point ();
1729 void trim_region_from_edit_point ();
1730 void trim_region_to_loop ();
1731 void trim_region_to_punch ();
1732 void trim_region_to_location (const ARDOUR::Location&, const char* cmd);
1734 bool show_gain_after_trim;
1738 int convert_drop_to_paths (std::vector<Glib::ustring>& paths,
1739 const Glib::RefPtr<Gdk::DragContext>& context,
1742 const Gtk::SelectionData& data,
1746 void track_canvas_drag_data_received (const Glib::RefPtr<Gdk::DragContext>& context,
1749 const Gtk::SelectionData& data,
1753 void region_list_display_drag_data_received (const Glib::RefPtr<Gdk::DragContext>& context,
1756 const Gtk::SelectionData& data,
1761 void drop_paths (const Glib::RefPtr<Gdk::DragContext>& context,
1764 const Gtk::SelectionData& data,
1768 void drop_regions (const Glib::RefPtr<Gdk::DragContext>& context,
1771 const Gtk::SelectionData& data,
1777 ExportDialog *export_dialog;
1778 ExportDialog *export_range_markers_dialog;
1780 void export_range (nframes_t start, nframes_t end);
1781 void export_range_markers ();
1783 int write_region_selection(RegionSelection&);
1784 bool write_region (string path, boost::shared_ptr<ARDOUR::AudioRegion>);
1785 void export_region ();
1786 void bounce_region_selection ();
1787 void bounce_range_selection ();
1788 void external_edit_region ();
1790 int write_audio_selection (TimeSelection&);
1791 bool write_audio_range (ARDOUR::AudioPlaylist&, uint32_t channels, list<ARDOUR::AudioRange>&);
1793 void write_selection ();
1797 UndoAction get_memento() const;
1799 XMLNode *before; /* used in *_reversible_command */
1800 void begin_reversible_command (string cmd_name);
1801 void commit_reversible_command ();
1803 /* visual history */
1805 UndoHistory visual_history;
1806 UndoTransaction current_visual_command;
1809 void update_title ();
1810 void update_title_s (const string & snapshot_name);
1813 Selection* selection;
1814 double frames_per_unit;
1820 void store_state (State&) const;
1821 void restore_state (State *);
1823 void instant_save ();
1825 boost::shared_ptr<ARDOUR::AudioRegion> last_audition_region;
1827 /* freeze operations */
1829 ARDOUR::InterThreadInfo freeze_status;
1830 gint freeze_progress_timeout (void *);
1831 static void* _freeze_thread (void*);
1832 void* freeze_thread ();
1834 void freeze_route ();
1835 void unfreeze_route ();
1837 /* edit-group solo + mute */
1839 void set_edit_group_solo (ARDOUR::Route&, bool);
1840 void set_edit_group_mute (ARDOUR::Route&, bool);
1844 void duplicate_dialog (bool with_dialog);
1846 nframes64_t event_frame (GdkEvent*, double* px = 0, double* py = 0) const;
1848 /* returns false if mouse pointer is not in track or marker canvas
1850 bool mouse_frame (nframes64_t&, bool& in_track_canvas) const;
1852 void time_fx_motion (ArdourCanvas::Item*, GdkEvent*);
1853 void start_time_fx (ArdourCanvas::Item*, GdkEvent*);
1854 void end_time_fx (ArdourCanvas::Item*, GdkEvent*);
1856 struct TimeFXDialog : public ArdourDialog {
1857 ARDOUR::TimeFXRequest request;
1860 Gtk::Adjustment pitch_octave_adjustment;
1861 Gtk::Adjustment pitch_semitone_adjustment;
1862 Gtk::Adjustment pitch_cent_adjustment;
1863 Gtk::SpinButton pitch_octave_spinner;
1864 Gtk::SpinButton pitch_semitone_spinner;
1865 Gtk::SpinButton pitch_cent_spinner;
1866 RegionSelection regions;
1867 Gtk::ProgressBar progress_bar;
1870 Gtk::ToggleButton quick_button;
1871 Gtk::ToggleButton antialias_button;
1872 Gtk::HBox upper_button_box;
1875 Gtk::ComboBoxText stretch_opts_selector;
1876 Gtk::Label stretch_opts_label;
1877 Gtk::ToggleButton precise_button;
1880 Gtk::Button* cancel_button;
1881 Gtk::Button* action_button;
1885 TimeFXDialog (Editor& e, bool for_pitch);
1887 gint update_progress ();
1888 sigc::connection first_cancel;
1889 sigc::connection first_delete;
1890 void cancel_in_progress ();
1891 gint delete_in_progress (GdkEventAny*);
1894 /* "whats mine is yours" */
1896 friend class TimeFXDialog;
1898 TimeFXDialog* current_timefx;
1900 static void* timefx_thread (void *arg);
1901 void do_timefx (TimeFXDialog&);
1903 int time_stretch (RegionSelection&, float fraction);
1904 int pitch_shift (RegionSelection&, float cents);
1905 void pitch_shift_regions ();
1906 int time_fx (RegionSelection&, float val, bool pitching);
1908 /* editor-mixer strip */
1910 MixerStrip *current_mixer_strip;
1911 bool show_editor_mixer_when_tracks_arrive;
1912 Gtk::VBox current_mixer_strip_vbox;
1913 void cms_deleted ();
1914 void current_mixer_strip_hidden ();
1915 void current_mixer_strip_removed ();
1917 void detach_tearoff (Gtk::Box* b, Gtk::Window* w);
1918 void reattach_tearoff (Gtk::Box* b, Gtk::Window* w, int32_t n);
1920 /* nudging tracks */
1922 void nudge_track (bool use_edit_point, bool forwards);
1926 bool _xfade_visibility;
1928 /* <CMT Additions> */
1929 void handle_new_imageframe_time_axis_view(const string & track_name, void* src) ;
1930 void handle_new_imageframe_marker_time_axis_view(const string & track_name, TimeAxisView* marked_track) ;
1932 void start_imageframe_grab(ArdourCanvas::Item*, GdkEvent*) ;
1933 void start_markerview_grab(ArdourCanvas::Item*, GdkEvent*) ;
1935 void imageframe_drag_motion_callback(ArdourCanvas::Item*, GdkEvent*) ;
1936 void markerview_drag_motion_callback(ArdourCanvas::Item*, GdkEvent*) ;
1937 void timeaxis_item_drag_finished_callback(ArdourCanvas::Item*, GdkEvent*) ;
1939 gint canvas_imageframe_item_view_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameView* ifv);
1940 gint canvas_imageframe_view_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameTimeAxis* ifta);
1941 gint canvas_imageframe_start_handle_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameView* ifv);
1942 gint canvas_imageframe_end_handle_event(ArdourCanvas::Item* item, GdkEvent* event, ImageFrameView* ifv);
1944 gint canvas_marker_time_axis_view_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerTimeAxis* mta);
1945 gint canvas_markerview_item_view_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerView* mv);
1946 gint canvas_markerview_start_handle_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerView* mv);
1947 gint canvas_markerview_end_handle_event(ArdourCanvas::Item* item, GdkEvent* event, MarkerView* mv);
1949 void imageframe_start_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1950 void imageframe_end_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1951 void imageframe_start_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1952 void imageframe_start_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1953 void imageframe_end_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1954 void imageframe_end_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1956 void markerview_item_start_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1957 void markerview_item_end_handle_op(ArdourCanvas::Item* item, GdkEvent* event) ;
1958 void markerview_start_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1959 void markerview_start_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1960 void markerview_end_handle_trim_motion(ArdourCanvas::Item* item, GdkEvent* event) ;
1961 void markerview_end_handle_end_trim(ArdourCanvas::Item* item, GdkEvent* event) ;
1963 void popup_imageframe_edit_menu(int button, int32_t time, ArdourCanvas::Item* ifv, bool with_frame) ;
1964 void popup_marker_time_axis_edit_menu(int button, int32_t time, ArdourCanvas::Item* ifv, bool with_frame) ;
1966 ImageFrameSocketHandler* image_socket_listener ;
1967 /* </CMT Additions> */
1969 void toggle_xfade_active (boost::weak_ptr<ARDOUR::Crossfade>);
1970 void toggle_xfade_length (boost::weak_ptr<ARDOUR::Crossfade>);
1971 void edit_xfade (boost::weak_ptr<ARDOUR::Crossfade>);
1972 void xfade_edit_left_region ();
1973 void xfade_edit_right_region ();
1975 static const int32_t default_width = 995;
1976 static const int32_t default_height = 765;
1980 Gtk::Button nudge_forward_button;
1981 Gtk::Button nudge_backward_button;
1982 Gtk::HBox nudge_hbox;
1983 Gtk::VBox nudge_vbox;
1984 AudioClock nudge_clock;
1986 nframes_t get_nudge_distance (nframes_t pos, nframes_t& next);
1988 bool nudge_forward_release (GdkEventButton*);
1989 bool nudge_backward_release (GdkEventButton*);
1993 void apply_filter (ARDOUR::AudioFilter&, string cmd);
1995 /* handling cleanup */
1997 int playlist_deletion_dialog (boost::shared_ptr<ARDOUR::Playlist>);
1999 vector<sigc::connection> session_connections;
2001 /* tracking step changes of track height */
2003 TimeAxisView* current_stepping_trackview;
2004 struct timeval last_track_height_step_timestamp;
2005 gint track_height_step_timeout();
2006 sigc::connection step_timeout;
2008 TimeAxisView* entered_track;
2009 RegionView* entered_regionview;
2011 class ExclusiveRegionSelection {
2013 ExclusiveRegionSelection (Editor&, RegionView*);
2014 ~ExclusiveRegionSelection ();
2018 RegionView* regionview;
2022 void ensure_entered_region_selected (bool op_acts_on_objects = false);
2023 void ensure_entered_track_selected (bool op_acts_on_objects = false);
2024 bool clear_entered_track;
2025 gint left_track_canvas (GdkEventCrossing*);
2026 void set_entered_track (TimeAxisView*);
2027 void set_entered_regionview (RegionView*);
2028 gint left_automation_track ();
2030 bool _new_regionviews_show_envelope;
2032 void toggle_gain_envelope_visibility ();
2033 void toggle_gain_envelope_active ();
2034 void reset_region_gain_envelopes ();
2036 bool on_key_press_event (GdkEventKey*);
2037 bool on_key_release_event (GdkEventKey*);
2039 void session_state_saved (string);
2041 Glib::RefPtr<Gtk::Action> undo_action;
2042 Glib::RefPtr<Gtk::Action> redo_action;
2044 void history_changed ();
2045 void color_handler ();
2047 Gtk::HBox status_bar_hpacker;
2049 Editing::EditPoint _edit_point;
2051 Gtk::ComboBoxText edit_point_selector;
2053 void set_edit_point_preference (Editing::EditPoint ep);
2054 void cycle_edit_point (bool with_marker);
2055 void set_edit_point ();
2056 void edit_point_selection_done ();
2057 void edit_point_chosen (Editing::EditPoint);
2058 Glib::RefPtr<Gtk::RadioAction> edit_point_action (Editing::EditPoint);
2059 std::vector<std::string> edit_point_strings;
2061 void selected_marker_moved (ARDOUR::Location*);
2062 sigc::connection edit_point_clock_connection_a;
2063 sigc::connection edit_point_clock_connection_b;
2065 bool get_edit_op_range (nframes64_t& start, nframes64_t& end) const;
2067 RegionSelection get_regions_at (nframes64_t where, const TrackSelection& ts) const;
2068 RegionSelection get_regions_after (nframes64_t where, const TrackSelection& ts) const;
2070 RegionSelection tmp_regions;
2072 RegionSelection& get_regions_for_action ();
2074 sigc::connection fast_screen_update_connection;
2075 gint start_updating ();
2076 gint stop_updating ();
2077 void fast_update_strips ();
2078 bool meters_running;
2080 void select_next_route ();
2081 void select_prev_route ();
2083 RhythmFerret* rhythm_ferret;
2086 #endif /* __ardour_editor_h__ */