diff options
author | David Robillard <d@drobilla.net> | 2020-11-28 15:58:38 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-11-28 17:39:10 +0100 |
commit | 0f8bd14d3487c35280c33bbfd133dd9e37c8f07e (patch) | |
tree | 701cac49a1e6e34025a8352e53845859566106b3 /src/AlsaDriver.cpp | |
parent | a872f8b07498c85f0f2eb8b55462ac9df9ce4677 (diff) | |
download | patchage-0f8bd14d3487c35280c33bbfd133dd9e37c8f07e.tar.gz patchage-0f8bd14d3487c35280c33bbfd133dd9e37c8f07e.tar.bz2 patchage-0f8bd14d3487c35280c33bbfd133dd9e37c8f07e.zip |
Index clients and ports by ID
Diffstat (limited to 'src/AlsaDriver.cpp')
-rw-r--r-- | src/AlsaDriver.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/AlsaDriver.cpp b/src/AlsaDriver.cpp index 3ef466d..702cc00 100644 --- a/src/AlsaDriver.cpp +++ b/src/AlsaDriver.cpp @@ -234,7 +234,7 @@ AlsaDriver::find_or_create_module(Patchage* patchage, m = new PatchageModule( patchage, client_name, type, ClientID::alsa(client_id)); m->load_location(); - _app->canvas()->add_module(client_name, m); + _app->canvas()->add_module(ClientID::alsa(client_id), m); _modules.insert(std::make_pair(client_id, m)); } return m; @@ -292,10 +292,12 @@ AlsaDriver::create_port_view_internal(snd_seq_addr_t addr, split = _app->conf()->get_module_split(client_name, !is_application); } + const auto port_id = PortID::alsa(addr.client, addr.port, is_input); + if (!split) { parent = find_or_create_module( _app, addr.client, client_name, ModuleType::input_output); - if (!parent->get_port(port_name)) { + if (!parent->get_port(port_id)) { port = create_port(*parent, port_name, is_input, addr); port->show(); } @@ -307,7 +309,7 @@ AlsaDriver::create_port_view_internal(snd_seq_addr_t addr, parent = find_or_create_module( _app, addr.client, client_name, module_type); - if (!parent->get_port(port_name)) { + if (!parent->get_port(port_id)) { port = create_port(*parent, port_name, is_input, addr); port->show(); } @@ -318,7 +320,7 @@ AlsaDriver::create_port_view_internal(snd_seq_addr_t addr, ((!is_input) ? ModuleType::input : ModuleType::output); parent = find_or_create_module( _app, addr.client, client_name, flipped_module_type); - if (!parent->get_port(port_name)) { + if (!parent->get_port(port_id)) { port = create_port(*parent, port_name, !is_input, addr); port->show(); } |