diff options
author | David Robillard <d@drobilla.net> | 2007-08-05 02:32:10 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-08-05 02:32:10 +0000 |
commit | 16b683538fc95eb14dee8af971b6aa020f4937e0 (patch) | |
tree | 546dd3d283caaad0d907ecb539221762643960d3 | |
parent | 31cef27138216b6566339bd7846a5baaf1a70c8f (diff) | |
download | patchage-16b683538fc95eb14dee8af971b6aa020f4937e0.tar.gz patchage-16b683538fc95eb14dee8af971b6aa020f4937e0.tar.bz2 patchage-16b683538fc95eb14dee8af971b6aa020f4937e0.zip |
Improve startup time threefold.
git-svn-id: http://svn.drobilla.net/lad/patchage@675 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r-- | src/JackDriver.cpp | 2 | ||||
-rw-r--r-- | src/Patchage.cpp | 26 | ||||
-rw-r--r-- | 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<PatchageModule> parent, jack_port_t* p return boost::shared_ptr<PatchagePort>(); } + //cerr << "Port " << jack_port_name(port) << " type: " << type_str << " = " << (int)port_type << endl; + boost::shared_ptr<PatchagePort> 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; |