summaryrefslogtreecommitdiffstats
path: root/src/Patchage.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-08-05 02:32:10 +0000
committerDavid Robillard <d@drobilla.net>2007-08-05 02:32:10 +0000
commit16b683538fc95eb14dee8af971b6aa020f4937e0 (patch)
tree546dd3d283caaad0d907ecb539221762643960d3 /src/Patchage.cpp
parent31cef27138216b6566339bd7846a5baaf1a70c8f (diff)
downloadpatchage-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
Diffstat (limited to 'src/Patchage.cpp')
-rw-r--r--src/Patchage.cpp26
1 files changed, 17 insertions, 9 deletions
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
+ }
}