Use a sensible min length for default session-duration

If the user tries to set the Start or End marker on an empty session,
apply some sensible defaults for the resulting session range.
This commit is contained in:
Ben Loftis 2020-01-25 11:34:46 -06:00 committed by Robin Gareus
parent 2d07e72d40
commit cf4d7387d2
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
1 changed files with 3 additions and 3 deletions

View File

@ -2267,8 +2267,8 @@ Editor::set_session_start_from_playhead ()
return;
Location* loc;
if ((loc = _session->locations()->session_range_location()) == 0) { //should never happen
_session->set_session_extents (_session->audible_sample(), _session->audible_sample());
if ((loc = _session->locations()->session_range_location()) == 0) {
_session->set_session_extents (_session->audible_sample(), _session->audible_sample() + 3 * 60 * _session->sample_rate());
} else {
XMLNode &before = loc->get_state();
@ -2294,7 +2294,7 @@ Editor::set_session_end_from_playhead ()
Location* loc;
if ((loc = _session->locations()->session_range_location()) == 0) { //should never happen
_session->set_session_extents (_session->audible_sample(), _session->audible_sample());
_session->set_session_extents (0, _session->audible_sample());
} else {
XMLNode &before = loc->get_state();