From a5d4b64ee0d9e450baf1e8f9edf9146826d1b489 Mon Sep 17 00:00:00 2001 From: Nikolay Polyanovskii Date: Wed, 28 May 2014 08:35:44 -0500 Subject: [PATCH] [Summary] Igor's letter, point 4. Replace/Create new session with same name - when user tries to create new session with same name as existing session. [Reviewed] GZharun [git-p4: depot-paths = "//Abdaw/dev_main/tracks/": change = 464235] --- gtk2_ardour/ardour_ui.cc | 106 +++++++++++++++++++++++++++++++++-- libs/ardour/session_state.cc | 38 +++++++++---- 2 files changed, 127 insertions(+), 17 deletions(-) diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 529028e294..30018c53da 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -82,6 +82,7 @@ #include "ardour/session_utils.h" #include "ardour/slave.h" #include "ardour/system_exec.h" +#include "ardour/directory_names.h" #include "dbg_msg.h" #ifdef WINDOWS_VST_SUPPORT @@ -2830,14 +2831,107 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri if (likely_new && !nsm) { std::string existing = Glib::build_filename (session_path, session_name); + + bool do_not_create_session = false; - if (!ask_about_loading_existing_session (existing)) { - ARDOUR_COMMAND_LINE::session_name = ""; // cancel that - continue; - } - } + GDir *dir; + GError *error; + const gchar *file_name; + + dir = g_dir_open(session_path.c_str(), 0, &error); + + while ((file_name = g_dir_read_name(dir))) + { + string ff = string(file_name); + + string full_file_name = g_build_filename(session_path.c_str(), file_name); + + string str_file_name = string(file_name); + string interchange_debug = string(ARDOUR::interchange_dir_name); + + if( (g_file_test (full_file_name.c_str(), GFileTest (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) && + (str_file_name == interchange_debug) ) + { + cout<=0 ) + cout<=0 ) + cout<=0) + cout<