diff options
author | David Robillard <d@drobilla.net> | 2007-06-08 02:17:40 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-06-08 02:17:40 +0000 |
commit | c335e2b88b051a1a14b0806ffabb257c2a0d0e74 (patch) | |
tree | b0a024b901f20254b3354cb7bb03f581b435c245 /src/Patchage.cpp | |
parent | 5a2358e39602607757fedd08a7355bede3cb8739 (diff) | |
download | patchage-c335e2b88b051a1a14b0806ffabb257c2a0d0e74.tar.gz patchage-c335e2b88b051a1a14b0806ffabb257c2a0d0e74.tar.bz2 patchage-c335e2b88b051a1a14b0806ffabb257c2a0d0e74.zip |
Monitor/change ALSA connections without refreshing entire canvas (much faster).
Waiting on JACK to provide the notification to do the same....
git-svn-id: http://svn.drobilla.net/lad/patchage@531 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/Patchage.cpp')
-rw-r--r-- | src/Patchage.cpp | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/src/Patchage.cpp b/src/Patchage.cpp index 603f306..c8a32a5 100644 --- a/src/Patchage.cpp +++ b/src/Patchage.cpp @@ -293,6 +293,7 @@ Patchage::attach() bool Patchage::idle_callback() { + // Process any JACK events if (_jack_driver) { while (!_jack_driver->events().empty()) { PatchageEvent& ev = _jack_driver->events().front(); @@ -300,34 +301,43 @@ Patchage::idle_callback() ev.execute(); } } - - bool refresh = _refresh; - - refresh = refresh || (_jack_driver && _jack_driver->is_dirty()); + // Process any ALSA events #ifdef HAVE_ALSA - refresh = refresh || (_alsa_driver && _alsa_driver->is_dirty()); + if (_alsa_driver) { + while (!_alsa_driver->events().empty()) { + PatchageEvent& ev = _alsa_driver->events().front(); + _alsa_driver->events().pop(); + ev.execute(); + } + } #endif - if (refresh) { - + // Do a full refresh (ie user clicked refresh) + if (_refresh) { _canvas->flag_all_connections(); - _jack_driver->refresh(); #ifdef HAVE_ALSA - _alsa_driver->refresh(); + if (_alsa_driver) + _alsa_driver->refresh(); #endif } + // Jack driver needs refreshing + if (_refresh || _jack_driver->is_dirty()) { + _canvas->flag_all_connections(); + _jack_driver->refresh(); + _canvas->destroy_all_flagged_connections(); + _refresh = false; + } + #ifdef HAVE_LASH if (_lash_driver->is_attached()) _lash_driver->process_events(); #endif - if (refresh) { - _canvas->destroy_all_flagged_connections(); + if (_refresh) _refresh = false; - } update_load(); |