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 | |
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')
-rw-r--r-- | libs/ardour/ardour/session.h | 2 | ||||
-rw-r--r-- | libs/ardour/session.cc | 23 |
2 files changed, 8 insertions, 17 deletions
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 3c01725740..807c2686eb 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -2033,8 +2033,6 @@ private: void rt_set_controls (boost::shared_ptr<ControlList>, double val, PBD::Controllable::GroupControlDisposition group_override); void rt_clear_all_solo_state (boost::shared_ptr<RouteList>, bool yn, PBD::Controllable::GroupControlDisposition group_override); - void set_session_range_location (samplepos_t, samplepos_t); - void setup_midi_machine_control (); void step_edit_status_change (bool); 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; |