diff options
author | Ben Loftis <ben@harrisonconsoles.com> | 2020-01-25 11:27:31 -0600 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-01-26 19:33:41 +0100 |
commit | 2d07e72d40ca51149578a539560060b6ea3406fc (patch) | |
tree | 5d885788a5ca21ff17020177a212152126005770 /libs/ardour/session.cc | |
parent | db465b5b439b69800c771dc8898e36d50f6cce7a (diff) |
Fix the ability to set Session Start&End Range on a new, empty session
set_session_extents had a bug; it wasn't calling locations->add()
on the newly created location.
The correct implementation was in set_session_range_location,
but this was only called from one place.
This function was removed, and set_session_extents will be used in its place.
set_session_extents will create a session location if one no longer exists,
so there is no need for set_session_range_location.
Diffstat (limited to 'libs/ardour/session.cc')
-rw-r--r-- | libs/ardour/session.cc | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 6b988be098..03891d4c47 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -1512,18 +1512,18 @@ Session::set_auto_punch_location (Location* location) void Session::set_session_extents (samplepos_t start, samplepos_t end) { - Location* existing; - if ((existing = _locations->session_range_location()) == 0) { - //if there is no existing session, we need to make a new session location (should never happen) - existing = new Location (*this, 0, 0, _("session"), Location::IsSessionRange, 0); - } - if (end <= start) { error << _("Session: you can't use that location for session start/end)") << endmsg; return; } - existing->set( start, end ); + Location* existing; + if ((existing = _locations->session_range_location()) == 0) { + _session_range_location = new Location (*this, start, end, _("session"), Location::IsSessionRange, 0); + _locations->add (_session_range_location); + } else { + existing->set( start, end ); + } set_dirty(); } @@ -4176,7 +4176,7 @@ Session::maybe_update_session_range (samplepos_t a, samplepos_t b) if (_session_range_location == 0) { - set_session_range_location (a, b + session_end_marker_shift_samples); + set_session_extents (a, b + session_end_marker_shift_samples); } else { @@ -6112,13 +6112,6 @@ Session::current_end_sample () const } void -Session::set_session_range_location (samplepos_t start, samplepos_t end) -{ - _session_range_location = new Location (*this, start, end, _("session"), Location::IsSessionRange, 0); - _locations->add (_session_range_location); -} - -void Session::step_edit_status_change (bool yn) { bool send = false; |