summaryrefslogtreecommitdiffstats
path: root/src/handle_event.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-11-28 21:11:58 +0100
committerDavid Robillard <d@drobilla.net>2020-11-28 22:49:10 +0100
commitce4f43343f7554d550e71ca16d9b5ce1ce5fcc13 (patch)
treeba20eadccbb1358519506a57b12038c011481485 /src/handle_event.cpp
parentf53a94419853b63a0f97deab1cf4ccedd4088f3b (diff)
downloadpatchage-ce4f43343f7554d550e71ca16d9b5ce1ce5fcc13.tar.gz
patchage-ce4f43343f7554d550e71ca16d9b5ce1ce5fcc13.tar.bz2
patchage-ce4f43343f7554d550e71ca16d9b5ce1ce5fcc13.zip
Add separate store for client and port metadata
Diffstat (limited to 'src/handle_event.cpp')
-rw-r--r--src/handle_event.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/handle_event.cpp b/src/handle_event.cpp
index 47b2557..2bd3609 100644
--- a/src/handle_event.cpp
+++ b/src/handle_event.cpp
@@ -51,14 +51,16 @@ public:
: _patchage{patchage}
{}
- void operator()(const ClientCreationEvent&)
+ void operator()(const ClientCreationEvent& event)
{
// Don't create empty modules, they will be created when ports are added
+ _patchage.metadata().set_client(event.id, event.info);
}
void operator()(const ClientDestructionEvent& event)
{
_patchage.canvas()->remove_module(event.id);
+ _patchage.metadata().erase_client(event.id);
}
void operator()(const PortCreationEvent& event)
@@ -73,6 +75,7 @@ public:
driver = _patchage.alsa_driver();
#endif
}
+ _patchage.metadata().set_port(event.id, event.info);
if (driver) {
PatchagePort* port = driver->create_port_view(&_patchage, event.id);
@@ -89,6 +92,7 @@ public:
void operator()(const PortDestructionEvent& event)
{
_patchage.canvas()->remove_port(event.id);
+ _patchage.metadata().erase_port(event.id);
}
void operator()(const ConnectionEvent& event)