13
0

Add Session::create_session_file method

git-svn-id: svn://localhost/ardour2/trunk@1869 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Tim Mayberry 2007-05-18 02:45:29 +00:00
parent 62c4c4cfbd
commit 5f7f6e092a
2 changed files with 15 additions and 6 deletions

View File

@ -955,6 +955,7 @@ class Session : public PBD::StatefulDestructible
void destroy ();
void initialize_start_and_end_locations(nframes_t start, nframes_t end);
bool create_session_file();
nframes_t compute_initial_length ();

View File

@ -464,7 +464,7 @@ Session::setup_raid_path (string path)
}
void
Session::initialize_start_and_end_locations(nframes_t start, nframes_t end)
Session::initialize_start_and_end_locations (nframes_t start, nframes_t end)
{
start_location->set_end (start);
_locations.add (start_location);
@ -473,6 +473,18 @@ Session::initialize_start_and_end_locations(nframes_t start, nframes_t end)
_locations.add (end_location);
}
bool
Session::create_session_file ()
{
_state_of_the_state = Clean;
if (save_state (_current_snapshot_name)) {
error << "Could not create new session file" << endmsg;
return false;
}
return true;
}
int
Session::create (bool& new_session, string* mix_template, nframes_t initial_length)
{
@ -535,11 +547,7 @@ Session::create (bool& new_session, string* mix_template, nframes_t initial_leng
initialize_start_and_end_locations(0, initial_length);
_state_of_the_state = Clean;
if (save_state (_current_snapshot_name)) {
return -1;
}
if (!create_session_file()) return -1;
return 0;
}