13
0

Fixed use case when session is being replaced with new session with the same name.

We should check session state file (*.ardour) presence to determine if the session is new for TracksLive as TracksLive has a use case which gives user a possibility to replace existing session by clicking on it's state file when new session is being created.
[To be Reviewed by] Paul Davis
This commit is contained in:
GZharun 2015-06-17 15:11:07 +03:00 committed by Paul Davis
parent c13d3ff790
commit dd0a73e2d4

View File

@ -142,8 +142,18 @@ Session::pre_engine_init (string fullpath)
_path = canonical_path(fullpath); _path = canonical_path(fullpath);
/* is it new ? */ /* is it new ? */
if (Profile->get_trx() ) {
_is_new = !Glib::file_test (_path, Glib::FileTest (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)); // Waves TracksLive has a usecase of session replacement with a new one.
// We should check session state file (<session_name>.ardour) existance
// to determine if the session is new or not
string full_session_name = Glib::build_filename( fullpath, _name );
full_session_name += statefile_suffix;
_is_new = !Glib::file_test (full_session_name, Glib::FileTest (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR));
} else {
_is_new = !Glib::file_test (_path, Glib::FileTest (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR));
}
/* finish initialization that can't be done in a normal C++ constructor /* finish initialization that can't be done in a normal C++ constructor
definition. definition.