diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 0714077302..487437023c 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -1758,7 +1758,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop /** temporary list of Diskstreams used only during load of 2.X sessions */ std::list > _diskstreams_2X; - void add_session_range_location (framepos_t, framepos_t); + void set_session_range_location (framepos_t, framepos_t); void setup_midi_machine_control (); diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index a75f90dbc7..e1eed879a5 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -3946,7 +3946,7 @@ Session::maybe_update_session_range (framepos_t a, framepos_t b) if (_session_range_location == 0) { - add_session_range_location (a, b); + set_session_range_location (a, b); } else { @@ -5589,7 +5589,7 @@ Session::current_end_frame () const } void -Session::add_session_range_location (framepos_t start, framepos_t end) +Session::set_session_range_location (framepos_t start, framepos_t end) { _session_range_location = new Location (*this, start, end, _("session"), Location::IsSessionRange); _locations->add (_session_range_location); diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index b51d7a7d69..003dac8f94 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -572,7 +572,21 @@ Session::create (const string& session_template, BusProfile* bus_profile) } - /* set initial start + end point */ + if (Profile->get_trx()) { + + /* set initial start + end point : ARDOUR::Session::session_end_shift long. + Remember that this is a brand new session. Sessions + loaded from saved state will get this range from the saved state. + */ + + set_session_range_location (0, 0); + + /* Initial loop location, from absolute zero, length 10 seconds */ + + Location* loc = new Location (*this, 0, 10.0 * _engine.sample_rate(), _("Loop"), Location::IsAutoLoop); + _locations->add (loc, true); + set_auto_loop_location (loc); + } _state_of_the_state = Clean;