diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index ebfa51fdb7..184b6442d1 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -1719,7 +1719,9 @@ ARDOUR_UI::toggle_roll (bool with_abort, bool roll_out_of_bounded_mode) void ARDOUR_UI::toggle_session_auto_loop () { - if (!_session) { + Location * looploc = _session->locations()->auto_loop_location(); + + if (!_session || !looploc) { return; } @@ -1727,24 +1729,18 @@ ARDOUR_UI::toggle_session_auto_loop () if (_session->transport_rolling()) { - Location * looploc = _session->locations()->auto_loop_location(); - - if (looploc) { - _session->request_locate (looploc->start(), true); - _session->request_play_loop (false); - } + _session->request_locate (looploc->start(), true); + _session->request_play_loop (false); } else { _session->request_play_loop (false); } } else { - - Location * looploc = _session->locations()->auto_loop_location(); - - if (looploc) { - _session->request_play_loop (true); - } + _session->request_play_loop (true); } + + //show the loop markers + looploc->set_hidden (false, this); } void