From 16b683538fc95eb14dee8af971b6aa020f4937e0 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 5 Aug 2007 02:32:10 +0000 Subject: Improve startup time threefold. git-svn-id: http://svn.drobilla.net/lad/patchage@675 a436a847-0d15-0410-975c-d299462d15a1 --- src/JackDriver.cpp | 2 ++ src/Patchage.cpp | 26 +++++++++++++++++--------- src/Patchage.hpp | 1 + 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src/JackDriver.cpp b/src/JackDriver.cpp index d7f1c20..03284d9 100644 --- a/src/JackDriver.cpp +++ b/src/JackDriver.cpp @@ -158,6 +158,8 @@ JackDriver::create_port(boost::shared_ptr parent, jack_port_t* p return boost::shared_ptr(); } + //cerr << "Port " << jack_port_name(port) << " type: " << type_str << " = " << (int)port_type << endl; + boost::shared_ptr ret( new PatchagePort(parent, port_type, jack_port_short_name(port), (jack_port_flags(port) & JackPortIsInput), diff --git a/src/Patchage.cpp b/src/Patchage.cpp index 7fc4508..4c7959b 100644 --- a/src/Patchage.cpp +++ b/src/Patchage.cpp @@ -85,7 +85,8 @@ Patchage::Patchage(int argc, char** argv) #endif _jack_driver(NULL), _state_manager(NULL), - _refresh(false) + _refresh(false), + _enable_refresh(true) { _settings_filename = getenv("HOME"); _settings_filename += "/.patchagerc"; @@ -273,6 +274,8 @@ Patchage::~Patchage() void Patchage::attach() { + _enable_refresh = false; + _jack_driver->attach(true); #ifdef HAVE_LASH @@ -282,6 +285,8 @@ Patchage::attach() _alsa_driver->attach(); #endif + _enable_refresh = true; + refresh(); update_toolbar(); @@ -345,7 +350,7 @@ Patchage::update_toolbar() //_jack_connect_toggle->set_active(_jack_driver->is_attached()); //_jack_realtime_check->set_active(_jack_driver->is_realtime()); - if (_jack_driver->is_attached()) { + if (_enable_refresh && _jack_driver->is_attached()) { _buffer_size_combo->set_active((int)log2f(_jack_driver->buffer_size()) - 5); /*switch ((int)m_jack_driver->sample_rate()) { @@ -691,16 +696,19 @@ void Patchage::refresh() { assert(_canvas); - - _canvas->destroy(); - - if (_jack_driver) - _jack_driver->refresh(); + + if (_enable_refresh) { + + _canvas->destroy(); + + if (_jack_driver) + _jack_driver->refresh(); #ifdef HAVE_ALSA - if (_alsa_driver) - _alsa_driver->refresh(); + if (_alsa_driver) + _alsa_driver->refresh(); #endif + } } diff --git a/src/Patchage.hpp b/src/Patchage.hpp index b1eb444..2117753 100644 --- a/src/Patchage.hpp +++ b/src/Patchage.hpp @@ -130,6 +130,7 @@ protected: string _settings_filename; bool _refresh; + bool _enable_refresh; Gtk::Window* _main_window; JackSettingsDialog* _jack_settings_dialog; -- cgit v1.2.1