133
133
void first_idle ();
134
134
virtual bool have_idled() const { return _have_idled; }
136
nframes_t leftmost_position() const { return leftmost_frame; }
137
nframes_t current_page_frames() const {
138
return (nframes_t) floor (canvas_width * frames_per_unit);
136
nframes64_t leftmost_position() const { return leftmost_frame; }
137
nframes64_t current_page_frames() const {
138
return (nframes64_t) floor (canvas_width * frames_per_unit);
141
141
void cycle_snap_mode ();
160
160
void scroll_timeaxis_to_imageframe_item(const TimeAxisViewItem* item) ;
161
161
TimeAxisView* get_named_time_axis(const std::string & name) ;
162
162
void foreach_time_axis_view (sigc::slot<void,TimeAxisView&>);
163
void add_to_idle_resize (TimeAxisView*, uint32_t);
164
165
void consider_auditioning (boost::shared_ptr<ARDOUR::Region>);
165
166
void hide_a_region (boost::shared_ptr<ARDOUR::Region>);
193
194
/* undo related */
195
nframes_t unit_to_frame (double unit) const {
196
return (nframes_t) rint (unit * frames_per_unit);
196
nframes64_t unit_to_frame (double unit) const {
197
return (nframes64_t) rint (unit * frames_per_unit);
199
double frame_to_unit (nframes_t frame) const {
200
double frame_to_unit (nframes64_t frame) const {
200
201
return rint ((double) frame / (double) frames_per_unit);
290
291
void maybe_add_mixer_strip_width (XMLNode&);
291
292
void show_editor_mixer (bool yn);
292
293
void set_selected_mixer_strip (TimeAxisView&);
293
void hide_track_in_display (TimeAxisView& tv);
294
void hide_track_in_display (TimeAxisView& tv, bool temporary = false);
294
295
void show_track_in_display (TimeAxisView& tv);
296
297
/* nudge is initiated by transport controls owned by ARDOUR_UI */
356
357
bool new_regionviews_display_gain () { return _new_regionviews_show_envelope; }
357
358
void prepare_for_cleanup ();
359
void finish_cleanup ();
359
361
void maximise_editing_space();
360
362
void restore_editing_space();
362
void reset_x_origin (nframes_t);
364
void reset_x_origin (nframes64_t);
363
365
void reset_zoom (double);
364
void reposition_and_zoom (nframes_t, double);
366
void reposition_and_zoom (nframes64_t, double);
366
368
nframes64_t get_preferred_edit_position (bool ignore_playhead = false);
373
375
void show_rhythm_ferret();
377
void goto_visual_state (uint32_t);
378
void save_visual_state (uint32_t);
380
void queue_draw_resize_line (int at);
381
void start_resize_line_ops ();
382
void end_resize_line_ops ();
376
385
void map_transport_state ();
377
void map_position_change (nframes_t);
386
void map_position_change (nframes64_t);
379
388
void on_realize();
389
bool on_expose_event (GdkEventExpose*);
384
394
bool constructed;
386
396
// to keep track of the playhead position for control_scroll
387
boost::optional<nframes_t> _control_scroll_target;
397
boost::optional<nframes64_t> _control_scroll_target;
389
399
PlaylistSelector* _playlist_selector;
401
typedef std::pair<TimeAxisView*,XMLNode*> TAVState;
391
403
struct VisualState {
392
double frames_per_unit;
393
nframes_t leftmost_frame;
394
Editing::ZoomFocus zoom_focus;
405
double frames_per_unit;
406
nframes64_t leftmost_frame;
407
Editing::ZoomFocus zoom_focus;
408
bool zoomed_to_region;
409
std::list<TAVState> track_states;
397
VisualState last_visual_state;
412
std::list<VisualState*> undo_visual_stack;
413
std::list<VisualState*> redo_visual_stack;
414
VisualState* current_visual_state (bool with_tracks = true);
415
void undo_visual_state ();
416
void redo_visual_state ();
417
void use_visual_state (VisualState&);
419
void swap_visual_state ();
421
std::vector<VisualState*> visual_states;
422
sigc::connection visual_state_op_connection;
423
void start_visual_state_op (uint32_t n);
424
void cancel_visual_state_op (uint32_t n);
425
bool end_visual_state_op (uint32_t n);
399
nframes_t leftmost_frame;
427
nframes64_t leftmost_frame;
400
428
double frames_per_unit;
401
429
Editing::ZoomFocus zoom_focus;
403
void use_visual_state (const VisualState&);
404
431
void set_frames_per_unit (double);
405
void swap_visual_state ();
406
432
void post_zoom ();
408
434
Editing::MouseMode mouse_mode;
453
479
void set_name (const string&);
454
void set_position (nframes_t start, nframes_t end = 0);
480
void set_position (nframes64_t start, nframes64_t end = 0);
455
481
void set_color_rgba (uint32_t);
465
491
void hide_marker (ArdourCanvas::Item*, GdkEvent*);
466
492
void clear_marker_display ();
467
void mouse_add_new_marker (nframes_t where, bool is_cd=false, bool is_xrun=false);
493
void mouse_add_new_marker (nframes64_t where, bool is_cd=false, bool is_xrun=false);
494
bool choose_new_marker_name(string &name);
468
495
void update_cd_marker_display ();
469
496
void ensure_cd_marker_updated (LocationMarkers * lam, ARDOUR::Location * location);
519
546
Gtk::Menu * track_edit_playlist_submenu;
520
547
Gtk::Menu * track_selection_edit_playlist_submenu;
522
void popup_track_context_menu (int, int, ItemType, bool, nframes_t);
523
Gtk::Menu* build_track_context_menu (nframes_t);
524
Gtk::Menu* build_track_bus_context_menu (nframes_t);
525
Gtk::Menu* build_track_region_context_menu (nframes_t frame);
526
Gtk::Menu* build_track_crossfade_context_menu (nframes_t);
527
Gtk::Menu* build_track_selection_context_menu (nframes_t);
549
void popup_track_context_menu (int, int, ItemType, bool, nframes64_t);
550
Gtk::Menu* build_track_context_menu (nframes64_t);
551
Gtk::Menu* build_track_bus_context_menu (nframes64_t);
552
Gtk::Menu* build_track_region_context_menu (nframes64_t frame);
553
Gtk::Menu* build_track_crossfade_context_menu (nframes64_t);
554
Gtk::Menu* build_track_selection_context_menu (nframes64_t);
528
555
void add_dstream_context_items (Gtk::Menu_Helpers::MenuList&);
529
556
void add_bus_context_items (Gtk::Menu_Helpers::MenuList&);
530
557
void add_region_context_items (AudioStreamView*, boost::shared_ptr<ARDOUR::Region>, Gtk::Menu_Helpers::MenuList&);
617
648
void update_just_smpte ();
618
649
void update_fixed_rulers ();
619
650
void update_tempo_based_rulers ();
620
void popup_ruler_menu (nframes_t where = 0, ItemType type = RegionItem);
651
void popup_ruler_menu (nframes64_t where = 0, ItemType type = RegionItem);
621
652
void update_ruler_visibility ();
622
653
void set_ruler_visible (RulerType, bool);
623
654
void toggle_ruler_visibility (RulerType rt);
686
717
ArdourCanvas::Points points;
687
718
ArdourCanvas::Line canvas_item;
688
nframes_t current_frame;
719
nframes64_t current_frame;
691
722
Cursor (Editor&, bool (Editor::*)(GdkEvent*,ArdourCanvas::Item*));
694
void set_position (nframes_t);
725
void set_position (nframes64_t);
695
726
void set_length (double units);
696
727
void set_y_axis (double position);
726
757
void select_all_selectables_between (bool within);
727
758
void select_range_between ();
729
boost::shared_ptr<ARDOUR::Region> find_next_region (nframes_t, ARDOUR::RegionPoint, int32_t dir, TrackViewList&, TimeAxisView ** = 0);
760
boost::shared_ptr<ARDOUR::Region> find_next_region (nframes64_t, ARDOUR::RegionPoint, int32_t dir, TrackViewList&, TimeAxisView ** = 0);
730
761
nframes64_t find_next_region_boundary (nframes64_t, int32_t dir, const TrackViewList&);
732
vector<nframes_t> region_boundary_cache;
763
vector<nframes64_t> region_boundary_cache;
733
764
void build_region_boundary_cache ();
735
Gtk::VBox trackview_vpacker;
737
766
Gtk::HBox top_hbox;
738
767
Gtk::HBox bottom_hbox;
759
788
double canvas_width;
760
789
double canvas_height;
761
790
double full_canvas_height;
762
nframes_t last_canvas_frame;
791
nframes64_t last_canvas_frame;
764
793
bool track_canvas_map_handler (GdkEventAny*);
765
794
bool time_canvas_map_handler (GdkEventAny*);
774
803
Gtk::HBox edit_controls_hbox;
776
805
void control_scroll (float);
777
bool deferred_control_scroll (nframes_t);
806
void access_action (std::string,std::string);
807
bool deferred_control_scroll (nframes64_t);
778
808
sigc::connection control_scroll_connection;
780
810
void tie_vertical_scrolling ();
802
832
static int _idle_visual_changer (void *arg);
803
833
int idle_visual_changer ();
805
void queue_visual_change (nframes_t);
835
void queue_visual_change (nframes64_t);
806
836
void queue_visual_change (double);
808
838
void end_location_changed (ARDOUR::Location*);
927
957
static void build_cursors ();
929
959
sigc::connection scroll_connection;
930
nframes_t last_update_frame;
931
void center_screen (nframes_t);
932
void center_screen_internal (nframes_t, float);
960
nframes64_t last_update_frame;
961
void center_screen (nframes64_t);
962
void center_screen_internal (nframes64_t, float);
934
964
void update_current_screen ();
936
966
void session_going_away ();
938
nframes_t cut_buffer_start;
939
nframes_t cut_buffer_length;
968
nframes64_t cut_buffer_start;
969
nframes64_t cut_buffer_length;
941
971
bool typed_event (ArdourCanvas::Item*, GdkEvent*, ItemType);
942
972
bool button_press_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
950
980
void register_actions ();
952
int ensure_cursor (nframes_t* pos);
982
int ensure_cursor (nframes64_t* pos);
954
984
void handle_new_audio_region (boost::weak_ptr<ARDOUR::AudioRegion>);
955
985
void handle_new_audio_regions (vector<boost::weak_ptr<ARDOUR::AudioRegion> >& );
958
988
void add_audio_regions_to_region_display (std::vector<boost::weak_ptr<ARDOUR::AudioRegion> > & );
959
989
void region_hidden (boost::shared_ptr<ARDOUR::Region>);
960
990
void redisplay_regions ();
991
bool no_region_list_redisplay;
961
992
void insert_into_tmp_audio_regionlist(boost::shared_ptr<ARDOUR::AudioRegion>);
963
994
list<boost::shared_ptr<ARDOUR::AudioRegion> > tmp_audio_region_list;
982
1013
void lower_region ();
983
1014
void lower_region_to_bottom ();
984
1015
void split_region ();
985
void split_region_at (nframes_t);
986
void split_regions_at (nframes_t, RegionSelection&);
1016
void split_region_at (nframes64_t);
1017
void split_regions_at (nframes64_t, RegionSelection&);
987
1018
void split_region_at_transients ();
988
1019
void split_region_at_points (boost::shared_ptr<ARDOUR::Region>, ARDOUR::AnalysisFeatureList&, bool can_ferret);
989
1020
void crop_region_to_selection ();
990
void crop_region_to (nframes_t start, nframes_t end);
1021
void crop_region_to (nframes64_t start, nframes64_t end);
991
1022
void set_sync_point (nframes64_t, const RegionSelection&);
992
1023
void set_region_sync_from_edit_point ();
993
1024
void remove_region_sync();
994
void align_selection (ARDOUR::RegionPoint, nframes_t position, const RegionSelection&);
995
void align_selection_relative (ARDOUR::RegionPoint point, nframes_t position, const RegionSelection&);
996
void align_region (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, nframes_t position);
997
void align_region_internal (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, nframes_t position);
1025
void align_selection (ARDOUR::RegionPoint, nframes64_t position, const RegionSelection&);
1026
void align_selection_relative (ARDOUR::RegionPoint point, nframes64_t position, const RegionSelection&);
1027
void align_region (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, nframes64_t position);
1028
void align_region_internal (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, nframes64_t position);
1029
void remove_region ();
998
1030
void remove_clicked_region ();
999
void destroy_clicked_region ();
1000
1031
void edit_region ();
1001
1032
void rename_region ();
1002
1033
void duplicate_some_regions (RegionSelection&, float times);
1013
1044
void adjust_region_scale_amplitude (bool up);
1015
1046
void do_insert_time ();
1016
void insert_time (nframes64_t pos, nframes64_t distance, Editing::InsertTimeOption opt, bool ignore_music_glue);
1047
void insert_time (nframes64_t pos, nframes64_t distance, Editing::InsertTimeOption opt, bool ignore_music_glue, bool markers_too);
1018
1049
void tab_to_transient (bool forward);
1056
1087
void loop_location (ARDOUR::Location&);
1058
1089
void temporal_zoom_selection ();
1059
void temporal_zoom_region ();
1060
void toggle_zoom_region ();
1090
void temporal_zoom_region (bool both_axes);
1091
void toggle_zoom_region (bool both_axes);
1061
1092
bool zoomed_to_region;
1062
1093
void temporal_zoom_session ();
1063
1094
void temporal_zoom (gdouble scale);
1064
void temporal_zoom_by_frame (nframes_t start, nframes_t end, const string & op);
1065
void temporal_zoom_to_frame (bool coarser, nframes_t frame);
1095
void temporal_zoom_by_frame (nframes64_t start, nframes64_t end, const string & op);
1096
void temporal_zoom_to_frame (bool coarser, nframes64_t frame);
1067
1098
void amplitude_zoom (gdouble scale);
1068
1099
void amplitude_zoom_step (bool in);
1180
1211
void set_loop_from_region (bool play);
1181
1212
void set_punch_from_edit_range ();
1183
void set_loop_range (nframes_t start, nframes_t end, std::string cmd);
1184
void set_punch_range (nframes_t start, nframes_t end, std::string cmd);
1214
void set_loop_range (nframes64_t start, nframes64_t end, std::string cmd);
1215
void set_punch_range (nframes64_t start, nframes64_t end, std::string cmd);
1186
1217
void add_location_from_playhead_cursor ();
1187
1218
bool select_new_marker;
1202
1233
void keyboard_selection_begin ();
1203
1234
void keyboard_selection_finish (bool add);
1204
1235
bool have_pending_keyboard_selection;
1205
nframes_t pending_keyboard_selection_start;
1236
nframes64_t pending_keyboard_selection_start;
1207
1238
boost::shared_ptr<ARDOUR::Region> select_region_for_operation (int dir, TimeAxisView **tv);
1208
1239
void extend_selection_to_end_of_region (bool next);
1291
1322
void remove_gain_control_point (ArdourCanvas::Item*, GdkEvent*);
1292
1323
void remove_control_point (ArdourCanvas::Item*, GdkEvent*);
1294
void mouse_brush_insert_region (RegionView*, nframes_t pos);
1295
void brush (nframes_t);
1325
void mouse_brush_insert_region (RegionView*, nframes64_t pos);
1326
void brush (nframes64_t);
1297
void show_verbose_time_cursor (nframes_t frame, double offset = 0, double xpos=-1, double ypos=-1);
1298
void show_verbose_duration_cursor (nframes_t start, nframes_t end, double offset = 0, double xpos=-1, double ypos=-1);
1328
void show_verbose_time_cursor (nframes64_t frame, double offset = 0, double xpos=-1, double ypos=-1);
1329
void show_verbose_duration_cursor (nframes64_t start, nframes64_t end, double offset = 0, double xpos=-1, double ypos=-1);
1299
1330
double clamp_verbose_cursor_x (double);
1300
1331
double clamp_verbose_cursor_y (double);
1398
1429
void new_tempo_section ();
1400
void mouse_add_new_tempo_event (nframes_t where);
1401
void mouse_add_new_meter_event (nframes_t where);
1431
void mouse_add_new_tempo_event (nframes64_t where);
1432
void mouse_add_new_meter_event (nframes64_t where);
1403
1434
void remove_tempo_marker (ArdourCanvas::Item*);
1404
1435
void remove_meter_marker (ArdourCanvas::Item*);
1424
1455
void marker_menu_set_playhead ();
1425
1456
void marker_menu_set_from_playhead ();
1426
1457
void marker_menu_set_from_selection ();
1458
void marker_menu_range_to_next ();
1459
void marker_menu_export_range ();
1427
1460
void new_transport_marker_menu_set_loop ();
1428
1461
void new_transport_marker_menu_set_punch ();
1429
1462
void update_loop_range_view (bool visibility=false);
1457
1490
void redisplay_tempo (bool immediate_redraw);
1459
1492
void snap_to (nframes64_t& first, int32_t direction = 0, bool for_mark = false);
1460
void snap_to (nframes_t& first, int32_t direction = 0, bool for_mark = false) {
1461
/* XXX remove this function when everything moves to 64 bit frame counts */
1462
nframes64_t first64 = first;
1463
snap_to (first64, direction, for_mark);
1464
first = (nframes_t) first64;
1467
1494
uint32_t bbt_beat_subdivision;
1575
1602
void region_selection_op (void (ARDOUR::Region::*pmf)(void*), void*);
1576
1603
void region_selection_op (void (ARDOUR::Region::*pmf)(bool), bool);
1578
bool audio_region_selection_covers (nframes_t where);
1605
bool audio_region_selection_covers (nframes64_t where);
1580
1607
/* transport range select process */
1581
1608
enum RangeMarkerOp {
1618
1645
void drag_rubberband_select (ArdourCanvas::Item* item, GdkEvent* event);
1619
1646
void end_rubberband_select (ArdourCanvas::Item* item, GdkEvent* event);
1621
bool select_all_within (nframes_t start, nframes_t end, gdouble topy, gdouble boty, const TrackViewList&, Selection::Operation op);
1648
bool select_all_within (nframes64_t start, nframes64_t end, gdouble topy, gdouble boty, const TrackViewList&, Selection::Operation op);
1623
1650
ArdourCanvas::SimpleRect *rubberband_rect;
1629
1656
void end_mouse_zoom (ArdourCanvas::Item* item, GdkEvent* event);
1631
1658
ArdourCanvas::SimpleRect *zoom_rect;
1632
void reposition_zoom_rect (nframes_t start, nframes_t end);
1659
void reposition_zoom_rect (nframes64_t start, nframes64_t end);
1634
1661
/* diskstream/route display management */
1637
1664
RouteDisplayModelColumns() {
1667
add (temporary_visible);
1643
1671
Gtk::TreeModelColumn<Glib::ustring> text;
1644
1672
Gtk::TreeModelColumn<bool> visible;
1673
Gtk::TreeModelColumn<bool> temporary_visible;
1645
1674
Gtk::TreeModelColumn<TimeAxisView*> tv;
1646
1675
Gtk::TreeModelColumn<boost::shared_ptr<ARDOUR::Route> > route;
1746
1777
void start_canvas_autoscroll (int x, int y);
1747
1778
void stop_canvas_autoscroll ();
1748
1779
void maybe_autoscroll (GdkEventMotion*);
1780
bool allow_vertical_scroll;
1757
1789
void start_trim (ArdourCanvas::Item*, GdkEvent*);
1758
1790
void point_trim (GdkEvent*);
1759
1791
void trim_motion_callback (ArdourCanvas::Item*, GdkEvent*);
1760
void single_contents_trim (RegionView&, nframes_t, bool, bool, bool);
1761
void single_start_trim (RegionView&, nframes_t, bool, bool);
1762
void single_end_trim (RegionView&, nframes_t, bool, bool);
1792
void single_contents_trim (RegionView&, nframes64_t, bool, bool, bool);
1793
void single_start_trim (RegionView&, nframes64_t, bool, bool);
1794
void single_end_trim (RegionView&, nframes64_t, bool, bool);
1764
1796
void trim_finished_callback (ArdourCanvas::Item*, GdkEvent*);
1765
1797
void thaw_region_after_trim (RegionView& rv);
1820
1852
ExportDialog *export_dialog;
1821
1853
ExportDialog *export_range_markers_dialog;
1823
void export_range (nframes_t start, nframes_t end);
1855
void export_range (nframes64_t start, nframes64_t end);
1824
1856
void export_range_markers ();
1826
1858
int write_region_selection(RegionSelection&);
1827
1859
bool write_region (string path, boost::shared_ptr<ARDOUR::AudioRegion>);
1828
1860
void export_region ();
1829
1861
void bounce_region_selection ();
1830
void bounce_range_selection ();
1862
void bounce_range_selection (bool replace);
1831
1863
void external_edit_region ();
1833
1865
int write_audio_selection (TimeSelection&);
1843
1875
void begin_reversible_command (string cmd_name);
1844
1876
void commit_reversible_command ();
1846
/* visual history */
1848
UndoHistory visual_history;
1849
UndoTransaction current_visual_command;
1852
1878
void update_title ();
1853
1879
void update_title_s (const string & snapshot_name);
2026
2052
Gtk::VBox nudge_vbox;
2027
2053
AudioClock nudge_clock;
2029
nframes_t get_nudge_distance (nframes_t pos, nframes_t& next);
2055
nframes64_t get_nudge_distance (nframes64_t pos, nframes64_t& next);
2031
2057
bool nudge_forward_release (GdkEventButton*);
2032
2058
bool nudge_backward_release (GdkEventButton*);
2044
2070
/* tracking step changes of track height */
2046
2072
TimeAxisView* current_stepping_trackview;
2047
struct timeval last_track_height_step_timestamp;
2073
ARDOUR::microseconds_t last_track_height_step_timestamp;
2048
2074
gint track_height_step_timeout();
2049
2075
sigc::connection step_timeout;
2117
2143
RhythmFerret* rhythm_ferret;
2119
void set_track_height (TimeAxisView::TrackHeight h);
2146
void set_track_height (uint32_t h);
2120
2147
void set_track_height_largest ();
2121
2148
void set_track_height_large ();
2122
2149
void set_track_height_larger ();
2129
2156
void waveform_scale_chosen (Editing::WaveformScale);
2131
2158
bool _have_idled;
2160
int32_t resize_idle_target;
2162
friend gboolean _idle_resize (gpointer);
2163
std::vector<TimeAxisView*> pending_resizes;
2134
2166
#endif /* __ardour_editor_h__ */