From 5f7f6e092a2c77c37973a1b49deead6d32ed1849 Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Fri, 18 May 2007 02:45:29 +0000 Subject: [PATCH] Add Session::create_session_file method git-svn-id: svn://localhost/ardour2/trunk@1869 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/ardour/session.h | 1 + libs/ardour/session_state.cc | 20 ++++++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 3e2d250160..a381802796 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -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 (); diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index f1c51f7ed2..c8623980df 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -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; }