diff options
author | David Robillard <d@drobilla.net> | 2008-06-10 19:41:31 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-06-10 19:41:31 +0000 |
commit | e94e373c429ba770bdc8c2bd2b02dc56939e52d0 (patch) | |
tree | b574322937839c3c128877d62e9bcdd68f03553d /src/AlsaDriver.cpp | |
parent | 89921216843e5a47d8eaf5cb8357b758b252d26d (diff) | |
download | patchage-e94e373c429ba770bdc8c2bd2b02dc56939e52d0.tar.gz patchage-e94e373c429ba770bdc8c2bd2b02dc56939e52d0.tar.bz2 patchage-e94e373c429ba770bdc8c2bd2b02dc56939e52d0.zip |
Fix handling of clients with duplex alsa ports and jack ports (force split).
Fixes ticket #140.
git-svn-id: http://svn.drobilla.net/lad/patchage@1267 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/AlsaDriver.cpp')
-rw-r--r-- | src/AlsaDriver.cpp | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/src/AlsaDriver.cpp b/src/AlsaDriver.cpp index b0981f0..8794386 100644 --- a/src/AlsaDriver.cpp +++ b/src/AlsaDriver.cpp @@ -142,6 +142,7 @@ AlsaDriver::refresh_ports() bool is_input = false; bool is_duplex = false; bool is_application = true; + bool need_refresh = false; set< boost::shared_ptr<PatchageModule> > to_resize; @@ -183,13 +184,24 @@ AlsaDriver::refresh_ports() port_name = snd_seq_port_info_get_name(pinfo); boost::shared_ptr<PatchageModule> m; - bool split = _app->state_manager()->get_module_split(client_name, !is_application) - || is_duplex; + bool split = false; + + // Because there would be name conflicts, we must force a split if (stupid) + // alsa duplex ports are present on the client + if (is_duplex) { + split = true; + if (!_app->state_manager()->get_module_split(client_name, !is_application)) { + need_refresh = true; + _app->state_manager()->set_module_split(client_name, true); + } + } else { + split = _app->state_manager()->get_module_split(client_name, !is_application); + } - //cout << "SHOW: " << client_name << " : " << port_name - //<< " is_application = " << is_application - //<< " is_duplex = " << is_duplex - //<< ", split = " << split << endl; + /*cout << "SHOW: " << client_name << " : " << port_name + << " is_application = " << is_application + << " is_duplex = " << is_duplex + << ", split = " << split << endl;*/ // Application input/output ports go on the same module if (!split) { @@ -274,9 +286,13 @@ AlsaDriver::refresh_ports() } } - for (set< boost::shared_ptr<PatchageModule> >::iterator i = to_resize.begin(); - i != to_resize.end(); ++i) { - (*i)->resize(); + if (need_refresh) { + _app->refresh(); + } else { + for (set< boost::shared_ptr<PatchageModule> >::iterator i = to_resize.begin(); + i != to_resize.end(); ++i) { + (*i)->resize(); + } } } |