diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index b124d1c573..5e0cc0706d 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -2600,7 +2600,7 @@ void Editor::set_snapped_cursor_position (timepos_t const & pos) { if (_edit_point == EditAtMouse) { - snapped_cursor->set_position (pos.samples()); + _snapped_cursor->set_position (pos.samples()); } } @@ -4849,7 +4849,7 @@ Editor::get_preferred_edit_position (EditIgnoreOption ignore, bool from_context_ case EditAtPlayhead: if (_dragging_playhead) { /* NOTE: since the user is dragging with the mouse, this operation will implicitly be Snapped */ - where = timepos_t (playhead_cursor->current_sample()); + where = timepos_t (_playhead_cursor->current_sample()); } else { where = timepos_t (_session->audible_sample()); } @@ -5957,8 +5957,8 @@ Editor::super_rapid_screen_update () if (!selection->markers.empty()) { timepos_t ms (selection->markers.front()->position()); snap_to (ms); // should use snap_to_with_modifier? - snapped_cursor->set_position (ms.samples()); - snapped_cursor->show (); + _snapped_cursor->set_position (ms.samples()); + _snapped_cursor->show (); } } else if (_edit_point == EditAtMouse && mouse_sample (where.sample, ignored)) { /* cursor is in the editing canvas. show it. */ diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index ac9d584c95..c6f1ba1948 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -4183,7 +4183,7 @@ CursorDrag::start_grab (GdkEvent* event, Gdk::Cursor* c) { Drag::start_grab (event, c); - setup_snap_delta (timepos_t (_editor->playhead_cursor->current_sample())); + setup_snap_delta (timepos_t (_editor->playhead_cursor()->current_sample())); _grab_zoom = _editor->samples_per_pixel; @@ -4310,7 +4310,7 @@ CursorDrag::aborted (bool) _editor->_dragging_playhead = false; } - _editor->playhead_cursor->set_position (adjusted_time (grab_time (), 0, false).samples()); + _editor->playhead_cursor()->set_position (adjusted_time (grab_time (), 0, false).samples()); } FadeInDrag::FadeInDrag (Editor* e, ArdourCanvas::Item* i, RegionView* p, list const & v) diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 16157db69f..473b2b366c 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -482,8 +482,8 @@ Editor::nudge_forward (bool next, bool force_playhead) commit_reversible_command (); } } else { - distance = get_nudge_distance (timepos_t (playhead_cursor->current_sample ()), next_distance); - _session->request_locate ((timepos_t (playhead_cursor->current_sample ()) + distance).samples()); + distance = get_nudge_distance (timepos_t (playhead_cursor()->current_sample ()), next_distance); + _session->request_locate ((timepos_t (playhead_cursor()->current_sample ()) + distance).samples()); } } @@ -577,8 +577,8 @@ Editor::nudge_backward (bool next, bool force_playhead) } else { - if (playhead_cursor->current_sample () > distance.samples()) { - _session->request_locate ((timepos_t (playhead_cursor->current_sample ()).earlier (distance)).samples()); + if (_playhead_cursor->current_sample () > distance.samples()) { + _session->request_locate ((timepos_t (_playhead_cursor->current_sample ()).earlier (distance)).samples()); } else { _session->goto_start(); } @@ -970,7 +970,7 @@ Editor::get_region_boundary (timepos_t const & pos, int32_t dir, bool with_selec void Editor::cursor_to_region_boundary (bool with_selection, int32_t dir) { - timepos_t pos (playhead_cursor->current_sample ()); + timepos_t pos (_playhead_cursor->current_sample ()); timepos_t target; if (!_session) { @@ -1051,7 +1051,7 @@ Editor::cursor_to_region_point (EditorCursor* cursor, RegionPoint point, int32_t break; } - if (cursor == playhead_cursor) { + if (cursor == _playhead_cursor) { _session->request_locate (pos.samples()); } else { cursor->set_position (pos.samples()); @@ -1092,7 +1092,7 @@ Editor::cursor_to_selection_start (EditorCursor *cursor) return; } - if (cursor == playhead_cursor) { + if (cursor == _playhead_cursor) { _session->request_locate (pos.samples()); } else { cursor->set_position (pos.samples()); @@ -1121,7 +1121,7 @@ Editor::cursor_to_selection_end (EditorCursor *cursor) return; } - if (cursor == playhead_cursor) { + if (cursor == _playhead_cursor) { _session->request_locate (pos.samples()); } else { cursor->set_position (pos.samples()); @@ -1373,10 +1373,10 @@ Editor::cursor_align (bool playhead_to_edit) Location* loc = find_location_from_marker (*i, ignored); if (loc->is_mark()) { - loc->set_start (timepos_t (playhead_cursor->current_sample ()), false); + loc->set_start (timepos_t (_playhead_cursor->current_sample ()), false); } else { - loc->set (timepos_t (playhead_cursor->current_sample ()), - timepos_t (playhead_cursor->current_sample ()) + loc->length()); + loc->set (timepos_t (_playhead_cursor->current_sample ()), + timepos_t (_playhead_cursor->current_sample ()) + loc->length()); } } } @@ -2455,7 +2455,7 @@ Editor::jump_forward_to_mark () return; } - timepos_t pos = _session->locations()->first_mark_after (timepos_t (playhead_cursor->current_sample())); + timepos_t pos = _session->locations()->first_mark_after (timepos_t (_playhead_cursor->current_sample())); if (pos == timepos_t::max (Temporal::AudioTime)) { return; @@ -2471,11 +2471,11 @@ Editor::jump_backward_to_mark () return; } - timepos_t pos = _session->locations()->first_mark_before (timepos_t (playhead_cursor->current_sample())); + timepos_t pos = _session->locations()->first_mark_before (timepos_t (_playhead_cursor->current_sample())); //handle the case where we are rolling, and we're less than one-half second past the mark, we want to go to the prior mark... if (_session->transport_rolling()) { - if ((playhead_cursor->current_sample() - pos.samples()) < _session->sample_rate()/2) { + if ((_playhead_cursor->current_sample() - pos.samples()) < _session->sample_rate()/2) { timepos_t prior = _session->locations()->first_mark_before (pos); pos = prior; } @@ -6845,7 +6845,7 @@ Editor::set_auto_punch_range () } Location* tpl = transport_punch_location(); - timepos_t now (playhead_cursor->current_sample()); + timepos_t now (_playhead_cursor->current_sample()); timepos_t begin = now; timepos_t end (_session->current_end_sample()); @@ -6861,7 +6861,7 @@ Editor::set_auto_punch_range () set_punch_range (begin, end, _("Auto Punch In/Out")); } else { // normal case for 2nd press - set the punch out - end = timepos_t (playhead_cursor->current_sample ()); + end = timepos_t (_playhead_cursor->current_sample ()); set_punch_range (tpl->start(), now, _("Auto Punch In/Out")); _session->config.set_punch_out(true); } @@ -7649,7 +7649,7 @@ Editor::playhead_forward_to_grid () return; } - timepos_t pos (playhead_cursor->current_sample ()); + timepos_t pos (_playhead_cursor->current_sample ()); if ( _grid_type == GridTypeNone) { if (pos < timepos_t::max (pos.time_domain()).earlier (timepos_t (samplepos_t (floor (current_page_samples()*0.1))))) { @@ -7682,7 +7682,7 @@ Editor::playhead_backward_to_grid () return; } - timepos_t pos (playhead_cursor->current_sample ()); + timepos_t pos (_playhead_cursor->current_sample ()); if ( _grid_type == GridTypeNone) { if (pos.samples() > current_page_samples()*0.1 ) { @@ -7701,7 +7701,7 @@ Editor::playhead_backward_to_grid () //handle the case where we are rolling, and we're less than one-half second past the mark, we want to go to the prior mark... //also see: jump_backward_to_mark if (_session->transport_rolling()) { - if ((playhead_cursor->current_sample() - pos.samples()) < _session->sample_rate()/2) { + if ((_playhead_cursor->current_sample() - pos.samples()) < _session->sample_rate()/2) { pos = snap_to_grid (pos, Temporal::RoundDownAlways, SnapToGrid_Scaled); } } diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h index 4b69f358dd..e0fb808144 100644 --- a/gtk2_ardour/public_editor.h +++ b/gtk2_ardour/public_editor.h @@ -495,7 +495,7 @@ public: virtual void get_pointer_position (double &, double &) const = 0; - virtual std::pair session_gui_extents (bool use_extra = true) const = 0; + virtual std::pair session_gui_extents (bool use_extra = true) const = 0; virtual ARDOUR::Location* find_location_from_marker (ArdourMarker*, bool&) const = 0; virtual ArdourMarker* find_marker_from_location_id (PBD::ID const&, bool) const = 0;