summaryrefslogtreecommitdiff
path: root/libs/ardour/session_state.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-05-09 20:48:21 +0000
committerCarl Hetherington <carl@carlh.net>2010-05-09 20:48:21 +0000
commit792e3de1d4cb291a02c5c31dad54028049bafed9 (patch)
treee65183deeb01752110a59a5b834e06deef811dab /libs/ardour/session_state.cc
parentacfc44f3889704587ff281c6348523b2811e7c2e (diff)
Create the session range location as and when the session first gets some content. Allows both the beginning and end of the range to expand to contain the actual session contents.
git-svn-id: svn://localhost/ardour2/branches/3.0@7087 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/session_state.cc')
-rw-r--r--libs/ardour/session_state.cc19
1 files changed, 7 insertions, 12 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index a0e61d547a..ee7e88caaa 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -179,7 +179,7 @@ Session::first_stage_init (string fullpath, string snapshot_name)
transport_sub_state = 0;
_transport_frame = 0;
_requested_return_frame = -1;
- _session_range_location = new Location (0, 0, _("session"), Location::IsSessionRange);
+ _session_range_location = 0;
g_atomic_int_set (&_record_status, Disabled);
loop_changing = false;
play_loop = false;
@@ -365,8 +365,6 @@ Session::second_stage_init ()
ControlProtocolManager::instance().set_session (this);
- config.set_end_marker_is_free (_is_new);
-
_state_of_the_state = Clean;
DirtyChanged (); /* EMIT SIGNAL */
@@ -491,7 +489,7 @@ Session::ensure_subdirs ()
}
int
-Session::create (const string& mix_template, nframes_t initial_length, BusProfile* bus_profile)
+Session::create (const string& mix_template, BusProfile* bus_profile)
{
if (g_mkdir_with_parents (_path.c_str(), 0755) < 0) {
@@ -540,9 +538,6 @@ Session::create (const string& mix_template, nframes_t initial_length, BusProfil
/* set initial start + end point */
- _session_range_location->set (0, initial_length);
- _locations.add (_session_range_location);
-
_state_of_the_state = Clean;
/* set up Master Out and Control Out if necessary */
@@ -1051,7 +1046,7 @@ Session::state(bool full_state)
// with the default start and end, and get the state for that.
Locations loc;
Location* range = new Location (0, 0, _("session"), Location::IsSessionRange);
- range->set (0, compute_initial_length ());
+ range->set (max_frames, 0);
loc.add (range);
node->add_child_nocopy (loc.get_state());
}
@@ -1242,14 +1237,14 @@ Session::set_state (const XMLNode& node, int version)
set_auto_punch_location (location);
}
- if ((location = _locations.session_range_location()) == 0) {
- _locations.add (_session_range_location);
- } else {
+ if ((location = _locations.session_range_location()) != 0) {
delete _session_range_location;
_session_range_location = location;
}
- AudioFileSource::set_header_position_offset (_session_range_location->start());
+ if (_session_range_location) {
+ AudioFileSource::set_header_position_offset (_session_range_location->start());
+ }
if ((child = find_named_node (node, "Sources")) == 0) {
error << _("Session: XML state has no sources section") << endmsg;