13
0

rename DoTheRightThing to RollIfAppropriate

This commit is contained in:
Paul Davis 2020-01-17 16:35:28 -07:00
parent 3c00048b0c
commit 47767738b9
17 changed files with 32 additions and 32 deletions

View File

@ -1611,7 +1611,7 @@ ARDOUR_UI::transport_goto_wallclock ()
samples += tmnow.tm_min * (60 * sample_rate); samples += tmnow.tm_min * (60 * sample_rate);
samples += tmnow.tm_sec * 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 /* force displayed area in editor to start no matter
what "follow playhead" setting is. what "follow playhead" setting is.

View File

@ -2184,7 +2184,7 @@ AudioClock::locate ()
return; return;
} }
_session->request_locate (current_time(), DoTheRightThing); _session->request_locate (current_time(), RollIfAppropriate);
} }
void void

View File

@ -1131,7 +1131,7 @@ Editor::control_scroll (float fraction)
bool bool
Editor::deferred_control_scroll (samplepos_t /*target*/) 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 */ /* reset for next stream */
_control_scroll_target = boost::none; _control_scroll_target = boost::none;
_dragging_playhead = false; _dragging_playhead = false;

View File

@ -6002,7 +6002,7 @@ RangeMarkerBarDrag::finished (GdkEvent* event, bool movement_occurred)
/* didn't drag, so just locate */ /* didn't drag, so just locate */
_editor->session()->request_locate (grab_sample(), DoTheRightThing); _editor->session()->request_locate (grab_sample(), RollIfAppropriate);
} else if (_operation == CreateCDMarker) { } else if (_operation == CreateCDMarker) {

View File

@ -1768,7 +1768,7 @@ Editor::goto_nth_marker (int n)
for (Locations::LocationList::iterator i = ordered.begin(); n >= 0 && i != ordered.end(); ++i) { 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 ((*i)->is_mark() && !(*i)->is_hidden() && !(*i)->is_session_range()) {
if (n == 0) { if (n == 0) {
_session->request_locate ((*i)->start(), DoTheRightThing); _session->request_locate ((*i)->start(), RollIfAppropriate);
break; break;
} }
--n; --n;

View File

@ -1351,7 +1351,7 @@ Editor::cursor_align (bool playhead_to_edit)
return; return;
} }
_session->request_locate (selection->markers.front()->position(), DoTheRightThing); _session->request_locate (selection->markers.front()->position(), RollIfAppropriate);
} else { } else {
const int32_t divisions = get_grid_music_divisions (0); const int32_t divisions = get_grid_music_divisions (0);
@ -2445,7 +2445,7 @@ Editor::jump_forward_to_mark ()
return; return;
} }
_session->request_locate (pos, DoTheRightThing); _session->request_locate (pos, RollIfAppropriate);
} }
void void
@ -2469,7 +2469,7 @@ Editor::jump_backward_to_mark ()
return; return;
} }
_session->request_locate (pos, DoTheRightThing); _session->request_locate (pos, RollIfAppropriate);
} }
void void
@ -6520,7 +6520,7 @@ void
Editor::set_playhead_cursor () Editor::set_playhead_cursor ()
{ {
if (entered_marker) { if (entered_marker) {
_session->request_locate (entered_marker->position(), DoTheRightThing); _session->request_locate (entered_marker->position(), RollIfAppropriate);
} else { } else {
MusicSample where (0, 0); MusicSample where (0, 0);
bool ignored; bool ignored;
@ -6532,7 +6532,7 @@ Editor::set_playhead_cursor ()
snap_to (where); snap_to (where);
if (_session) { 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 */ /* keep PH visible in window */

View File

@ -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 (key->keyval == set_playhead_accel.accel_key && (int) key->state == set_playhead_accel.accel_mods) {
if (_session) { if (_session) {
get_pointer (x, y); 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; return true;
} }
} }

View File

@ -728,7 +728,7 @@ MiniTimeline::on_button_release_event (GdkEventButton *ev)
if (ev->y <= PADDING + _marker_height) { if (ev->y <= PADDING + _marker_height) {
for (JumpList::const_iterator i = _jumplist.begin (); i != _jumplist.end(); ++i) { for (JumpList::const_iterator i = _jumplist.begin (); i != _jumplist.end(); ++i) {
if (i->left <= ev->x && ev->x <= i->right) { if (i->left <= ev->x && ev->x <= i->right) {
_session->request_locate (i->to, DoTheRightThing); _session->request_locate (i->to, RollIfAppropriate);
return true; return true;
} }
} }
@ -736,7 +736,7 @@ MiniTimeline::on_button_release_event (GdkEventButton *ev)
if (ev->button == 1) { if (ev->button == 1) {
samplepos_t when = _last_update_sample + (ev->x - get_width() * .5) / _px_per_sample; 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; return true;
@ -818,6 +818,6 @@ MiniTimeline::on_scroll_event (GdkEventScroll *ev)
return true; return true;
break; break;
} }
_session->request_locate (std::max ((samplepos_t)0, when), DoTheRightThing); _session->request_locate (std::max ((samplepos_t)0, when), RollIfAppropriate);
return true; return true;
} }

View File

@ -444,7 +444,7 @@ public:
void request_roll_at_and_return (samplepos_t start, samplepos_t return_to); 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_bounded_roll (samplepos_t start, samplepos_t end);
void request_stop (bool abort = false, bool clear_state = false, TransportRequestSource origin = TRS_UI); 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); void request_play_loop (bool yn, bool leave_rolling = false);
bool get_play_loop () const { return play_loop; } bool get_play_loop () const { return play_loop; }

View File

@ -802,7 +802,7 @@ enum OverwriteReason {
enum LocateTransportDisposition { enum LocateTransportDisposition {
MustRoll, MustRoll,
MustStop, MustStop,
DoTheRightThing RollIfAppropriate
}; };
typedef std::vector<CaptureInfo*> CaptureInfos; typedef std::vector<CaptureInfo*> CaptureInfos;

View File

@ -837,7 +837,7 @@ setup_enum_writer ()
REGISTER_ENUM (MustStop); REGISTER_ENUM (MustStop);
REGISTER_ENUM (MustRoll); REGISTER_ENUM (MustRoll);
REGISTER_ENUM (DoTheRightThing); REGISTER_ENUM (RollIfAppropriate);
REGISTER (_LocateTransportDisposition); REGISTER (_LocateTransportDisposition);
} }

View File

@ -6093,9 +6093,9 @@ void
Session::goto_start (bool and_roll) Session::goto_start (bool and_roll)
{ {
if (_session_range_location) { 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 { } else {
request_locate (0, and_roll ? MustRoll : DoTheRightThing); request_locate (0, and_roll ? MustRoll : RollIfAppropriate);
} }
} }

View File

@ -930,7 +930,7 @@ Session::request_locate (samplepos_t target_sample, LocateTransportDisposition l
case MustStop: case MustStop:
type = SessionEvent::Locate; type = SessionEvent::Locate;
break; break;
case DoTheRightThing: case RollIfAppropriate:
if (config.get_auto_play()) { if (config.get_auto_play()) {
type = SessionEvent::LocateRoll; type = SessionEvent::LocateRoll;
} else { } else {

View File

@ -418,7 +418,7 @@ TransportFSM::compute_should_roll (LocateTransportDisposition ltd) const
return true; return true;
case MustStop: case MustStop:
return false; return false;
case DoTheRightThing: case RollIfAppropriate:
if (rolling()) { if (rolling()) {
return true; return true;
} else { } else {

View File

@ -557,7 +557,7 @@ ContourDesignControlProtocol::prev_marker_keep_rolling ()
samplepos_t pos = session->locations()->first_mark_before (session->transport_sample()); samplepos_t pos = session->locations()->first_mark_before (session->transport_sample());
if (pos >= 0) { if (pos >= 0) {
session->request_locate (pos, DoTheRightThing); session->request_locate (pos, RollIfAppropriate);
} else { } else {
session->goto_start (); session->goto_start ();
} }
@ -569,7 +569,7 @@ ContourDesignControlProtocol::next_marker_keep_rolling ()
samplepos_t pos = session->locations()->first_mark_after (session->transport_sample()); samplepos_t pos = session->locations()->first_mark_after (session->transport_sample());
if (pos >= 0) { if (pos >= 0) {
session->request_locate (pos, DoTheRightThing); session->request_locate (pos, RollIfAppropriate);
} else { } else {
session->goto_end(); session->goto_end();
} }
@ -592,7 +592,7 @@ ContourDesignControlProtocol::jog_event_forward ()
void void
ContourDesignControlProtocol::jump_forward (JumpDistance dist) ContourDesignControlProtocol::jump_forward (JumpDistance dist)
{ {
LocateTransportDisposition kr = _keep_rolling ? DoTheRightThing : MustStop; LocateTransportDisposition kr = _keep_rolling ? RollIfAppropriate : MustStop;
switch (dist.unit) { switch (dist.unit) {
case SECONDS: jump_by_seconds (dist.value, kr); break; case SECONDS: jump_by_seconds (dist.value, kr); break;
case BEATS: jump_by_beats (dist.value, kr); break; case BEATS: jump_by_beats (dist.value, kr); break;

View File

@ -330,7 +330,7 @@ BasicUI::prev_marker ()
samplepos_t pos = session->locations()->first_mark_before (session->transport_sample()); samplepos_t pos = session->locations()->first_mark_before (session->transport_sample());
if (pos >= 0) { if (pos >= 0) {
session->request_locate (pos, DoTheRightThing); session->request_locate (pos, RollIfAppropriate);
} else { } else {
session->goto_start (); session->goto_start ();
} }
@ -342,7 +342,7 @@ BasicUI::next_marker ()
samplepos_t pos = session->locations()->first_mark_after (session->transport_sample()); samplepos_t pos = session->locations()->first_mark_after (session->transport_sample());
if (pos >= 0) { if (pos >= 0) {
session->request_locate (pos, DoTheRightThing); session->request_locate (pos, RollIfAppropriate);
} else { } else {
session->goto_end(); session->goto_end();
} }
@ -425,7 +425,7 @@ BasicUI::locate (samplepos_t where, LocateTransportDisposition ltd)
void void
BasicUI::locate (samplepos_t where, bool roll) BasicUI::locate (samplepos_t where, bool roll)
{ {
session->request_locate (where, roll ? MustRoll : DoTheRightThing); session->request_locate (where, roll ? MustRoll : RollIfAppropriate);
} }
void void
@ -695,7 +695,7 @@ BasicUI::goto_nth_marker (int n)
for (Locations::LocationList::iterator i = ordered.begin(); n >= 0 && i != ordered.end(); ++i) { 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 ((*i)->is_mark() && !(*i)->is_hidden() && !(*i)->is_session_range()) {
if (n == 0) { if (n == 0) {
session->request_locate ((*i)->start(), DoTheRightThing); session->request_locate ((*i)->start(), RollIfAppropriate);
break; break;
} }
--n; --n;

View File

@ -70,9 +70,9 @@ class LIBCONTROLCP_API BasicUI {
void set_transport_speed (double speed); void set_transport_speed (double speed);
double get_transport_speed (); double get_transport_speed ();
void jump_by_seconds (double sec, 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::DoTheRightThing); void jump_by_bars (double bars, ARDOUR::LocateTransportDisposition ltd = ARDOUR::RollIfAppropriate);
void jump_by_beats (double beats, ARDOUR::LocateTransportDisposition ltd = ARDOUR::DoTheRightThing); void jump_by_beats (double beats, ARDOUR::LocateTransportDisposition ltd = ARDOUR::RollIfAppropriate);
ARDOUR::samplepos_t transport_sample (); ARDOUR::samplepos_t transport_sample ();
void locate (ARDOUR::samplepos_t sample, ARDOUR::LocateTransportDisposition ltd); void locate (ARDOUR::samplepos_t sample, ARDOUR::LocateTransportDisposition ltd);