+ if (((Config->get_slave_source() == None && Config->get_auto_return()) ||
+ synced_to_jack() ||
+ _requested_return_frame >= 0) &&
+ !(post_transport_work & PostTransportLocate)) {
+
+ /* no explicit locate queued */
+
+ bool do_locate = false;
+
+ if (_requested_return_frame >= 0) {
+
+ /* explicit return request pre-queued in event list. overrides everything else */
+
+ cerr << "explicit auto-return to " << _requested_return_frame << endl;
+
+ _transport_frame = _requested_return_frame;
+ do_locate = true;
+
+ } else {
+ if (Config->get_auto_return()) {
+
+ if (play_loop) {
+
+ /* don't try to handle loop play when synced to JACK */
+
+ if (!synced_to_jack()) {
+
+ Location *location = _locations.auto_loop_location();
+
+ if (location != 0) {
+ _transport_frame = location->start();
+ } else {
+ _transport_frame = _last_roll_location;
+ }
+ do_locate = true;
+ }
+
+ } else if (_play_range) {
+
+ /* return to start of range */
+
+ if (!current_audio_range.empty()) {
+ _transport_frame = current_audio_range.front().start;
+ do_locate = true;
+ }
+
+ } else {
+
+ /* regular auto-return */
+
+ _transport_frame = _last_roll_location;
+ do_locate = true;
+ }
+ }
+ }