From db492ea9443c4813b4124f980793746405ae39ef Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 14 Aug 2008 05:20:40 +0000 Subject: Don't wait for plugins from ingen, show root patch window as soon as possible (huge reduction in startup time-to-patch-window). git-svn-id: http://svn.drobilla.net/lad/ingen@1373 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/gui/ConnectWindow.cpp | 56 ++++++++++++------------------------------ 1 file changed, 16 insertions(+), 40 deletions(-) diff --git a/src/libs/gui/ConnectWindow.cpp b/src/libs/gui/ConnectWindow.cpp index 288b30cc..546cbb60 100644 --- a/src/libs/gui/ConnectWindow.cpp +++ b/src/libs/gui/ConnectWindow.cpp @@ -359,57 +359,33 @@ ConnectWindow::gtk_callback() } } } else if (_connect_stage == 2) { - _progress_label->set_text(string("Loading plugins...")); - App::instance().engine()->load_plugins(); - ++_connect_stage; - } else if (_connect_stage == 3) { - //_progress_label->set_text(string("Requesting plugins...")); - App::instance().engine()->request_plugins(); - ++_connect_stage; - } else if (_connect_stage == 4) { - // Wait for first plugin message - if (App::instance().store()->plugins().size() > 0) { - _progress_label->set_text(string("Receiving plugins...")); - ++_connect_stage; - } - } else if (_connect_stage == 5) { - // FIXME - /*if (App::instance().store().plugins().size() < _client->num_plugins()) { - static char buf[32]; - snprintf(buf, 32, "%zu/%zu", App::instance().store().plugins().size(), - ThreadedSigClientInterface::instance()->num_plugins()); - _progress_bar->set_text(Glib::ustring(buf)); - _progress_bar->set_fraction( - App::instance().store().plugins().size() / (double)_client->num_plugins()); - } else {*/ - _progress_bar->set_text(""); - ++_connect_stage; - //} - } else if (_connect_stage == 6) { - _progress_label->set_text(string("Waiting for root patch...")); + _progress_label->set_text(string("Requesting root patch...")); App::instance().engine()->request_all_objects(); ++_connect_stage; - } else if (_connect_stage == 7) { + } else if (_connect_stage == 3) { if (App::instance().store()->objects().size() > 0) { SharedPtr root = PtrCast(App::instance().store()->object("/")); - assert(root); - App::instance().window_factory()->present_patch(root); - ++_connect_stage; + if (root) { + set_connected_to(App::instance().engine()); + App::instance().window_factory()->present_patch(root); + ++_connect_stage; + } } - } else if (_connect_stage == 8) { - _progress_label->set_text("Connected to engine"); + } else if (_connect_stage == 4) { + _progress_label->set_text(string("Loading plugins...")); + App::instance().engine()->load_plugins(); ++_connect_stage; - } else if (_connect_stage == 9) { + } else if (_connect_stage == 5) { + App::instance().engine()->request_plugins(); ++_connect_stage; - hide(); - } else if (_connect_stage == 10) { - set_connected_to(App::instance().engine()); + } else if (_connect_stage == 6) { + _progress_label->set_text("Connected to engine"); _connect_stage = 0; // set ourselves up for next time (if there is one) + hide(); return false; // deregister this callback } - if (_connect_stage != 5) // yeah, ew - _progress_bar->pulse(); + _progress_bar->pulse(); if (_connect_stage == -1) { // we were cancelled _icon->set(Gtk::Stock::DISCONNECT, Gtk::ICON_SIZE_LARGE_TOOLBAR); -- cgit v1.2.1