diff options
author | David Robillard <d@drobilla.net> | 2008-02-20 18:40:16 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-02-20 18:40:16 +0000 |
commit | 75b652d59639cf0171fe51a0c1442d03081f3b2f (patch) | |
tree | 91234a404baba903e3a3a3327de2a49fe9d51ba7 /src/PatchageEvent.cpp | |
parent | bbb3abbe4b86a23ef884d38ca299aff13b8f9242 (diff) | |
download | patchage-75b652d59639cf0171fe51a0c1442d03081f3b2f.tar.gz patchage-75b652d59639cf0171fe51a0c1442d03081f3b2f.tar.bz2 patchage-75b652d59639cf0171fe51a0c1442d03081f3b2f.zip |
Support jack client de-registration event.
git-svn-id: http://svn.drobilla.net/lad/patchage@1152 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/PatchageEvent.cpp')
-rw-r--r-- | src/PatchageEvent.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/PatchageEvent.cpp b/src/PatchageEvent.cpp index da64899..5b63486 100644 --- a/src/PatchageEvent.cpp +++ b/src/PatchageEvent.cpp @@ -31,6 +31,22 @@ PatchageEvent::execute(Patchage* patchage) { if (_type == REFRESH) { patchage->refresh(); + } else if (_type == CLIENT_CREATION) { + // No empty modules (for now) + free(_str); + _str = NULL; + } else if (_type == CLIENT_DESTRUCTION) { + SharedPtr<PatchageModule> module = PtrCast<PatchageModule>( + patchage->canvas()->find_module(_str, InputOutput)); + + if (module) { + patchage->canvas()->remove_item(module); + module.reset(); + } + + free(_str); + _str = NULL; + } else if (_type == PORT_CREATION) { if ( ! _driver->create_port_view(patchage, _port_1)) { @@ -48,6 +64,7 @@ PatchageEvent::execute(Patchage* patchage) module->remove_port(port); port->hide(); + // No empty modules (for now) if (module->num_ports() == 0) { patchage->canvas()->remove_item(module); module.reset(); |