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; }