improve operation of ARDOUR_UI::toggle_roll() for loop mode (particularly when loop-is-mode)

This commit is contained in:
Paul Davis 2019-11-02 16:12:28 -06:00
parent 5025b939c6
commit 3e443bc237

View file

@ -1798,49 +1798,49 @@ ARDOUR_UI::toggle_roll (bool with_abort, bool roll_out_of_bounded_mode)
} }
bool rolling = _session->transport_rolling(); bool rolling = _session->transport_rolling();
bool affect_transport = true;
if (rolling && roll_out_of_bounded_mode) { if (rolling) {
/* drop out of loop/range playback but leave transport rolling */
if (_session->get_play_loop()) {
if (_session->actively_recording()) {
/* just stop using the loop, then actually stop if (roll_out_of_bounded_mode) {
* below /* drop out of loop/range playback but leave transport rolling */
*/
_session->request_play_loop (false, affect_transport);
} else { if (_session->get_play_loop()) {
/* the disk buffers contain copies of the loop - we can't
just keep playing, so stop the transport. the user if (_session->actively_recording()) {
can restart as they wish. /* actually stop transport because
*/ otherwise the captured data will make
affect_transport = true; no sense.
_session->request_play_loop (false, affect_transport); */
_session->request_play_loop (false, true);
} else {
_session->request_play_loop (false, false);
}
} else if (_session->get_play_range ()) {
_session->request_cancel_play_range ();
} }
} else if (_session->get_play_range ()) {
affect_transport = false;
_session->request_play_range (0, true);
}
}
if (affect_transport) { } else {
if (rolling) {
_session->request_stop (with_abort, true); _session->request_stop (with_abort, true);
}
} else if (!with_abort) { /* with_abort == true means the } else { /* not rolling */
* command was intended to stop
* transport, not start.
*/
/* the only external sync condition we can be in here if (with_abort) { /* with_abort == true means the command was intended to stop transport, not start. */
* would be Engine (JACK) sync, in which case we still return;
* want to do this. }
*/
if (UIConfiguration::instance().get_follow_edits() && ( editor->get_selection().time.front().start == _session->transport_sample() ) ) { //if playhead is exactly at the start of a range, we can assume it was placed there by follow_edits if (_session->get_play_loop() && Config->get_loop_is_mode()) {
_session->request_play_range (&editor->get_selection().time, true); _session->request_locate (_session->locations()->auto_loop_location()->start(), true);
_session->set_requested_return_sample( editor->get_selection().time.front().start ); //force an auto-return here } else {
if (UIConfiguration::instance().get_follow_edits()) {
list<AudioRange>& range = editor->get_selection().time;
if (range.front().start == _session->transport_sample()) { // if playhead is exactly at the start of a range, we assume it was placed there by follow_edits
_session->request_play_range (&range, true);
_session->set_requested_return_sample (range.front().start); //force an auto-return here
}
} }
_session->request_transport_speed (1.0f); _session->request_transport_speed (1.0f);
} }