From e36ac4fd2225a0309f38b57d8efbffdee44fdf5b Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Fri, 18 May 2007 02:46:33 +0000 Subject: [PATCH] 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 --- gtk2_ardour/ardour_ui.cc | 12 ++++++------ gtk2_ardour/ardour_ui.h | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 0f72884c9b..4de3b12fb2 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -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 diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index 7f16ff7eec..d59fe20216 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -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,