13
0

Change the return type of ARDOUR_UI::build_session to bool to indicate success/failure

git-svn-id: svn://localhost/ardour2/trunk@1877 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Tim Mayberry 2007-05-18 02:46:33 +00:00
parent 355a988c3f
commit e36ac4fd22
2 changed files with 8 additions and 7 deletions

View File

@ -1991,7 +1991,7 @@ ARDOUR_UI::new_session (std::string predetermined_path)
uint32_t nphysin = (uint32_t) new_session_dialog->input_limit_count();
uint32_t nphysout = (uint32_t) new_session_dialog->output_limit_count();
if (build_session (session_path,
if (!build_session (session_path,
session_name,
cchns,
mchns,
@ -2076,7 +2076,7 @@ ARDOUR_UI::load_session (const string & path, const string & snap_name, string*
return 0;
}
int
bool
ARDOUR_UI::build_session (const string & path, const string & snap_name,
uint32_t control_channels,
uint32_t master_channels,
@ -2089,12 +2089,12 @@ ARDOUR_UI::build_session (const string & path, const string & snap_name,
Session *new_session;
if (!check_audioengine()) {
return -1;
return false;
}
session_loaded = false;
if (!unload_session ()) return -1;
if (!unload_session ()) return false;
_session_is_new = true;
@ -2107,13 +2107,13 @@ ARDOUR_UI::build_session (const string & path, const string & snap_name,
MessageDialog msg (string_compose(_("Could not create session in \"%1\""), path));
msg.run ();
return -1;
return false;
}
connect_to_session (new_session);
session_loaded = true;
return 0;
return true;
}
void

View File

@ -107,7 +107,8 @@ class ARDOUR_UI : public Gtkmm2ext::UI
int load_session (const string & path, const string & snapshot, string* mix_template = 0);
bool session_loaded;
int build_session (const string & path, const string & snapshot,
/// @return true if building the session was successful
bool build_session (const string & path, const string & snapshot,
uint32_t ctl_chns,
uint32_t master_chns,
ARDOUR::AutoConnectOption input_connect,