From 47767738b9aee165a03f09f8ba222179bb73aeb6 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 17 Jan 2020 16:35:28 -0700 Subject: [PATCH] rename DoTheRightThing to RollIfAppropriate --- gtk2_ardour/ardour_ui.cc | 2 +- gtk2_ardour/audio_clock.cc | 2 +- gtk2_ardour/editor.cc | 2 +- gtk2_ardour/editor_drag.cc | 2 +- gtk2_ardour/editor_markers.cc | 2 +- gtk2_ardour/editor_ops.cc | 12 ++++++------ gtk2_ardour/editor_summary.cc | 2 +- gtk2_ardour/mini_timeline.cc | 6 +++--- libs/ardour/ardour/session.h | 2 +- libs/ardour/ardour/types.h | 2 +- libs/ardour/enums.cc | 2 +- libs/ardour/session.cc | 4 ++-- libs/ardour/session_transport.cc | 2 +- libs/ardour/transport_fsm.cc | 2 +- libs/surfaces/contourdesign/contourdesign.cc | 6 +++--- libs/surfaces/control_protocol/basic_ui.cc | 8 ++++---- .../control_protocol/control_protocol/basic_ui.h | 6 +++--- 17 files changed, 32 insertions(+), 32 deletions(-) diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index c604d0c508..515982d0ab 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -1611,7 +1611,7 @@ ARDOUR_UI::transport_goto_wallclock () samples += tmnow.tm_min * (60 * sample_rate); samples += tmnow.tm_sec * sample_rate; - _session->request_locate (samples, DoTheRightThing); + _session->request_locate (samples, RollIfAppropriate); /* force displayed area in editor to start no matter what "follow playhead" setting is. diff --git a/gtk2_ardour/audio_clock.cc b/gtk2_ardour/audio_clock.cc index 690b2ffd56..0af9f234d7 100644 --- a/gtk2_ardour/audio_clock.cc +++ b/gtk2_ardour/audio_clock.cc @@ -2184,7 +2184,7 @@ AudioClock::locate () return; } - _session->request_locate (current_time(), DoTheRightThing); + _session->request_locate (current_time(), RollIfAppropriate); } void diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index ca2b73d0a8..23a21da819 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -1131,7 +1131,7 @@ Editor::control_scroll (float fraction) bool Editor::deferred_control_scroll (samplepos_t /*target*/) { - _session->request_locate (*_control_scroll_target, DoTheRightThing); + _session->request_locate (*_control_scroll_target, RollIfAppropriate); /* reset for next stream */ _control_scroll_target = boost::none; _dragging_playhead = false; diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index a2c43abeda..bd5e9f73c9 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -6002,7 +6002,7 @@ RangeMarkerBarDrag::finished (GdkEvent* event, bool movement_occurred) /* didn't drag, so just locate */ - _editor->session()->request_locate (grab_sample(), DoTheRightThing); + _editor->session()->request_locate (grab_sample(), RollIfAppropriate); } else if (_operation == CreateCDMarker) { diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc index d125536ac1..34a807b419 100644 --- a/gtk2_ardour/editor_markers.cc +++ b/gtk2_ardour/editor_markers.cc @@ -1768,7 +1768,7 @@ Editor::goto_nth_marker (int n) for (Locations::LocationList::iterator i = ordered.begin(); n >= 0 && i != ordered.end(); ++i) { if ((*i)->is_mark() && !(*i)->is_hidden() && !(*i)->is_session_range()) { if (n == 0) { - _session->request_locate ((*i)->start(), DoTheRightThing); + _session->request_locate ((*i)->start(), RollIfAppropriate); break; } --n; diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 050809dfe3..05bd71ad6b 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -1351,7 +1351,7 @@ Editor::cursor_align (bool playhead_to_edit) return; } - _session->request_locate (selection->markers.front()->position(), DoTheRightThing); + _session->request_locate (selection->markers.front()->position(), RollIfAppropriate); } else { const int32_t divisions = get_grid_music_divisions (0); @@ -2445,7 +2445,7 @@ Editor::jump_forward_to_mark () return; } - _session->request_locate (pos, DoTheRightThing); + _session->request_locate (pos, RollIfAppropriate); } void @@ -2469,7 +2469,7 @@ Editor::jump_backward_to_mark () return; } - _session->request_locate (pos, DoTheRightThing); + _session->request_locate (pos, RollIfAppropriate); } void @@ -6520,7 +6520,7 @@ void Editor::set_playhead_cursor () { if (entered_marker) { - _session->request_locate (entered_marker->position(), DoTheRightThing); + _session->request_locate (entered_marker->position(), RollIfAppropriate); } else { MusicSample where (0, 0); bool ignored; @@ -6532,7 +6532,7 @@ Editor::set_playhead_cursor () snap_to (where); if (_session) { - _session->request_locate (where.sample, DoTheRightThing); + _session->request_locate (where.sample, RollIfAppropriate); } } @@ -7525,7 +7525,7 @@ Editor::playhead_backward_to_grid () } } - _session->request_locate (pos.sample, DoTheRightThing); + _session->request_locate (pos.sample, RollIfAppropriate); } /* keep PH visible in window */ diff --git a/gtk2_ardour/editor_summary.cc b/gtk2_ardour/editor_summary.cc index 4a8598d59c..8beef90509 100644 --- a/gtk2_ardour/editor_summary.cc +++ b/gtk2_ardour/editor_summary.cc @@ -437,7 +437,7 @@ EditorSummary::on_key_press_event (GdkEventKey* key) if (key->keyval == set_playhead_accel.accel_key && (int) key->state == set_playhead_accel.accel_mods) { if (_session) { get_pointer (x, y); - _session->request_locate (_start + (samplepos_t) x / _x_scale, DoTheRightThing); + _session->request_locate (_start + (samplepos_t) x / _x_scale, RollIfAppropriate); return true; } } diff --git a/gtk2_ardour/mini_timeline.cc b/gtk2_ardour/mini_timeline.cc index bd8274affd..ae9224495c 100644 --- a/gtk2_ardour/mini_timeline.cc +++ b/gtk2_ardour/mini_timeline.cc @@ -728,7 +728,7 @@ MiniTimeline::on_button_release_event (GdkEventButton *ev) if (ev->y <= PADDING + _marker_height) { for (JumpList::const_iterator i = _jumplist.begin (); i != _jumplist.end(); ++i) { if (i->left <= ev->x && ev->x <= i->right) { - _session->request_locate (i->to, DoTheRightThing); + _session->request_locate (i->to, RollIfAppropriate); return true; } } @@ -736,7 +736,7 @@ MiniTimeline::on_button_release_event (GdkEventButton *ev) if (ev->button == 1) { samplepos_t when = _last_update_sample + (ev->x - get_width() * .5) / _px_per_sample; - _session->request_locate (std::max ((samplepos_t)0, when), DoTheRightThing); + _session->request_locate (std::max ((samplepos_t)0, when), RollIfAppropriate); } return true; @@ -818,6 +818,6 @@ MiniTimeline::on_scroll_event (GdkEventScroll *ev) return true; break; } - _session->request_locate (std::max ((samplepos_t)0, when), DoTheRightThing); + _session->request_locate (std::max ((samplepos_t)0, when), RollIfAppropriate); return true; } diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 402c55bf59..5ce59bc174 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -444,7 +444,7 @@ public: void request_roll_at_and_return (samplepos_t start, samplepos_t return_to); void request_bounded_roll (samplepos_t start, samplepos_t end); void request_stop (bool abort = false, bool clear_state = false, TransportRequestSource origin = TRS_UI); - void request_locate (samplepos_t sample, LocateTransportDisposition ltd = DoTheRightThing, TransportRequestSource origin = TRS_UI); + void request_locate (samplepos_t sample, LocateTransportDisposition ltd = RollIfAppropriate, TransportRequestSource origin = TRS_UI); void request_play_loop (bool yn, bool leave_rolling = false); bool get_play_loop () const { return play_loop; } diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h index 1504698896..3db1a34dc9 100644 --- a/libs/ardour/ardour/types.h +++ b/libs/ardour/ardour/types.h @@ -802,7 +802,7 @@ enum OverwriteReason { enum LocateTransportDisposition { MustRoll, MustStop, - DoTheRightThing + RollIfAppropriate }; typedef std::vector CaptureInfos; diff --git a/libs/ardour/enums.cc b/libs/ardour/enums.cc index d8a442150c..69bbb0bb61 100644 --- a/libs/ardour/enums.cc +++ b/libs/ardour/enums.cc @@ -837,7 +837,7 @@ setup_enum_writer () REGISTER_ENUM (MustStop); REGISTER_ENUM (MustRoll); - REGISTER_ENUM (DoTheRightThing); + REGISTER_ENUM (RollIfAppropriate); REGISTER (_LocateTransportDisposition); } diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 454a9065ed..6b988be098 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -6093,9 +6093,9 @@ void Session::goto_start (bool and_roll) { if (_session_range_location) { - request_locate (_session_range_location->start(), and_roll ? MustRoll : DoTheRightThing); + request_locate (_session_range_location->start(), and_roll ? MustRoll : RollIfAppropriate); } else { - request_locate (0, and_roll ? MustRoll : DoTheRightThing); + request_locate (0, and_roll ? MustRoll : RollIfAppropriate); } } diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc index 9e5117f9d1..2b630aa939 100644 --- a/libs/ardour/session_transport.cc +++ b/libs/ardour/session_transport.cc @@ -930,7 +930,7 @@ Session::request_locate (samplepos_t target_sample, LocateTransportDisposition l case MustStop: type = SessionEvent::Locate; break; - case DoTheRightThing: + case RollIfAppropriate: if (config.get_auto_play()) { type = SessionEvent::LocateRoll; } else { diff --git a/libs/ardour/transport_fsm.cc b/libs/ardour/transport_fsm.cc index a06e2159c9..05d4757e95 100644 --- a/libs/ardour/transport_fsm.cc +++ b/libs/ardour/transport_fsm.cc @@ -418,7 +418,7 @@ TransportFSM::compute_should_roll (LocateTransportDisposition ltd) const return true; case MustStop: return false; - case DoTheRightThing: + case RollIfAppropriate: if (rolling()) { return true; } else { diff --git a/libs/surfaces/contourdesign/contourdesign.cc b/libs/surfaces/contourdesign/contourdesign.cc index 0ddf9c5945..cceb605104 100644 --- a/libs/surfaces/contourdesign/contourdesign.cc +++ b/libs/surfaces/contourdesign/contourdesign.cc @@ -557,7 +557,7 @@ ContourDesignControlProtocol::prev_marker_keep_rolling () samplepos_t pos = session->locations()->first_mark_before (session->transport_sample()); if (pos >= 0) { - session->request_locate (pos, DoTheRightThing); + session->request_locate (pos, RollIfAppropriate); } else { session->goto_start (); } @@ -569,7 +569,7 @@ ContourDesignControlProtocol::next_marker_keep_rolling () samplepos_t pos = session->locations()->first_mark_after (session->transport_sample()); if (pos >= 0) { - session->request_locate (pos, DoTheRightThing); + session->request_locate (pos, RollIfAppropriate); } else { session->goto_end(); } @@ -592,7 +592,7 @@ ContourDesignControlProtocol::jog_event_forward () void ContourDesignControlProtocol::jump_forward (JumpDistance dist) { - LocateTransportDisposition kr = _keep_rolling ? DoTheRightThing : MustStop; + LocateTransportDisposition kr = _keep_rolling ? RollIfAppropriate : MustStop; switch (dist.unit) { case SECONDS: jump_by_seconds (dist.value, kr); break; case BEATS: jump_by_beats (dist.value, kr); break; diff --git a/libs/surfaces/control_protocol/basic_ui.cc b/libs/surfaces/control_protocol/basic_ui.cc index 5c2879cdf0..73f0792826 100644 --- a/libs/surfaces/control_protocol/basic_ui.cc +++ b/libs/surfaces/control_protocol/basic_ui.cc @@ -330,7 +330,7 @@ BasicUI::prev_marker () samplepos_t pos = session->locations()->first_mark_before (session->transport_sample()); if (pos >= 0) { - session->request_locate (pos, DoTheRightThing); + session->request_locate (pos, RollIfAppropriate); } else { session->goto_start (); } @@ -342,7 +342,7 @@ BasicUI::next_marker () samplepos_t pos = session->locations()->first_mark_after (session->transport_sample()); if (pos >= 0) { - session->request_locate (pos, DoTheRightThing); + session->request_locate (pos, RollIfAppropriate); } else { session->goto_end(); } @@ -425,7 +425,7 @@ BasicUI::locate (samplepos_t where, LocateTransportDisposition ltd) void BasicUI::locate (samplepos_t where, bool roll) { - session->request_locate (where, roll ? MustRoll : DoTheRightThing); + session->request_locate (where, roll ? MustRoll : RollIfAppropriate); } void @@ -695,7 +695,7 @@ BasicUI::goto_nth_marker (int n) for (Locations::LocationList::iterator i = ordered.begin(); n >= 0 && i != ordered.end(); ++i) { if ((*i)->is_mark() && !(*i)->is_hidden() && !(*i)->is_session_range()) { if (n == 0) { - session->request_locate ((*i)->start(), DoTheRightThing); + session->request_locate ((*i)->start(), RollIfAppropriate); break; } --n; diff --git a/libs/surfaces/control_protocol/control_protocol/basic_ui.h b/libs/surfaces/control_protocol/control_protocol/basic_ui.h index 70f40f97b8..7d5904544f 100644 --- a/libs/surfaces/control_protocol/control_protocol/basic_ui.h +++ b/libs/surfaces/control_protocol/control_protocol/basic_ui.h @@ -70,9 +70,9 @@ class LIBCONTROLCP_API BasicUI { void set_transport_speed (double speed); double get_transport_speed (); - void jump_by_seconds (double sec, ARDOUR::LocateTransportDisposition ltd = ARDOUR::DoTheRightThing); - void jump_by_bars (double bars, ARDOUR::LocateTransportDisposition ltd = ARDOUR::DoTheRightThing); - void jump_by_beats (double beats, ARDOUR::LocateTransportDisposition ltd = ARDOUR::DoTheRightThing); + void jump_by_seconds (double sec, ARDOUR::LocateTransportDisposition ltd = ARDOUR::RollIfAppropriate); + void jump_by_bars (double bars, ARDOUR::LocateTransportDisposition ltd = ARDOUR::RollIfAppropriate); + void jump_by_beats (double beats, ARDOUR::LocateTransportDisposition ltd = ARDOUR::RollIfAppropriate); ARDOUR::samplepos_t transport_sample (); void locate (ARDOUR::samplepos_t sample, ARDOUR::LocateTransportDisposition ltd);