#include <pbd/error.h>
#include <pbd/basename.h>
#include <pbd/compose.h>
-#include <pbd/misc.h>
#include <pbd/pathscanner.h>
#include <pbd/failed_constructor.h>
#include <pbd/enumwriter.h>
flush_pending ();
}
+void
+ARDOUR_UI::idle_load (const Glib::ustring& path)
+{
+ if (session) {
+ if (Glib::file_test (path, Glib::FILE_TEST_IS_DIR)) {
+ /* /path/to/foo => /path/to/foo, foo */
+ load_session (path, basename_nosuffix (path));
+ } else {
+ /* /path/to/foo/foo.ardour => /path/to/foo, foo */
+ load_session (Glib::path_get_dirname (path), basename_nosuffix (path));
+ }
+ } else {
+ ARDOUR_COMMAND_LINE::session_name = path;
+ if (new_session_dialog) {
+ /* make it break out of Dialog::run() and
+ start again.
+ */
+ new_session_dialog->response (1);
+ }
+ }
+}
+
bool
ARDOUR_UI::get_session_parameters (bool backend_audio_is_running, bool should_be_new)
{
Glib::ustring session_name;
Glib::ustring session_path;
Glib::ustring template_name;
+ int response;
- int response = Gtk::RESPONSE_NONE;
+ begin:
+ response = Gtk::RESPONSE_NONE;
if (!ARDOUR_COMMAND_LINE::session_name.empty()) {
/* handle possible negative responses */
switch (response) {
+ case 1:
+ /* sent by idle_load, meaning restart the whole process again */
+ new_session_dialog->hide();
+ new_session_dialog->reset();
+ goto begin;
+ break;
+
case Gtk::RESPONSE_CANCEL:
case Gtk::RESPONSE_DELETE_EVENT:
if (!session) {
}
loading_message (_("Please wait while Ardour loads your session"));
- disable_screen_updates ();
try {
new_session = new Session (*engine, path, snap_name, mix_template);
session->set_clean ();
}
- enable_screen_updates ();
flush_pending ();
retval = 0;