diff options
author | David Robillard <d@drobilla.net> | 2020-11-27 20:18:41 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-11-27 21:52:29 +0100 |
commit | 10a9f00294c3a33477dee21980f91d1417b6ef21 (patch) | |
tree | 5fa81e66ffa8f5f22753ced48315db83a5237e9f /src/AlsaDriver.cpp | |
parent | 2146f229086ffe26888d74fffd4bd441bfdaecbe (diff) | |
download | patchage-10a9f00294c3a33477dee21980f91d1417b6ef21.tar.gz patchage-10a9f00294c3a33477dee21980f91d1417b6ef21.tar.bz2 patchage-10a9f00294c3a33477dee21980f91d1417b6ef21.zip |
Ensure that ports always have an 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 fdda5e7..dc07d48 100644 --- a/src/AlsaDriver.cpp +++ b/src/AlsaDriver.cpp @@ -322,20 +322,22 @@ AlsaDriver::create_port(PatchageModule& parent, bool is_input, snd_seq_addr_t addr) { + const PortID id{addr, is_input}; + auto* ret = new PatchagePort(parent, PortType::alsa_midi, + id, name, "", is_input, _app->conf()->get_port_color(PortType::alsa_midi), _app->show_human_names()); - dynamic_cast<PatchageCanvas*>(parent.canvas()) - ->index_port(PortID(addr, is_input), ret); + dynamic_cast<PatchageCanvas*>(parent.canvas())->index_port(id, ret); - _app->canvas()->index_port(PortID(addr, is_input), ret); - _port_addrs.insert(std::make_pair(ret, PortID(addr, is_input))); + _app->canvas()->index_port(id, ret); + _port_addrs.insert(std::make_pair(ret, id)); return ret; } |