diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2008-03-17 20:54:03 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2008-03-17 20:54:03 +0000 |
commit | 997e4b1f9cd7ccfc704b7c035051da7f60d831e7 (patch) | |
tree | 1236e40183b677abf4a2882e4cfe8e0a345eb24d /gtk2_ardour/ardour_ui.cc | |
parent | 19a4b990325577fc949ccd5d5fbad4520eb1df56 (diff) |
merge with 2.0-ongoing @ rev 3147
git-svn-id: svn://localhost/ardour2/branches/3.0@3152 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/ardour_ui.cc')
-rw-r--r-- | gtk2_ardour/ardour_ui.cc | 47 |
1 files changed, 40 insertions, 7 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index f7a6c43b0f..421906fbfc 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -36,7 +36,6 @@ #include <gtkmm/accelmap.h> #include <pbd/error.h> -#include <pbd/misc.h> #include <pbd/basename.h> #include <pbd/compose.h> #include <pbd/failed_constructor.h> @@ -208,8 +207,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[]) have_disk_speed_dialog_displayed = false; session_loaded = false; last_speed_displayed = -1.0f; - - sys::path key_bindings_file; + ignore_dual_punch = false; last_configure_time.tv_sec = 0; last_configure_time.tv_usec = 0; @@ -256,6 +254,8 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[]) keyboard = new Keyboard; + reset_dpi(); + starting.connect (mem_fun(*this, &ARDOUR_UI::startup)); stopping.connect (mem_fun(*this, &ARDOUR_UI::shutdown)); @@ -641,7 +641,6 @@ ARDOUR_UI::startup () } BootMessage (_("Ardour is ready for use")); - show (); } @@ -2245,6 +2244,28 @@ ARDOUR_UI::loading_message (const std::string& msg) 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) { @@ -2252,8 +2273,10 @@ ARDOUR_UI::get_session_parameters (bool backend_audio_is_running, bool should_be 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()) { @@ -2297,6 +2320,13 @@ ARDOUR_UI::get_session_parameters (bool backend_audio_is_running, bool should_be /* 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) { @@ -2475,7 +2505,6 @@ ARDOUR_UI::load_session (const Glib::ustring& path, const Glib::ustring& snap_na } loading_message (_("Please wait while Ardour loads your session")); - disable_screen_updates (); try { new_session = new Session (*engine, path, snap_name, mix_template); @@ -2547,7 +2576,6 @@ ARDOUR_UI::load_session (const Glib::ustring& path, const Glib::ustring& snap_na session->set_clean (); } - enable_screen_updates (); flush_pending (); retval = 0; @@ -3249,6 +3277,11 @@ ARDOUR_UI::first_idle () if (session) { session->allow_auto_play (true); } + + if (editor) { + editor->first_idle(); + } + Keyboard::set_can_save_keybindings (true); return false; } |