summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/events/DestroyEvent.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-01-07 06:11:57 +0000
committerDavid Robillard <d@drobilla.net>2007-01-07 06:11:57 +0000
commit99ab1c257b7456c16f82119e1faea62c61eea660 (patch)
tree8c31966bbf0e8919380cb4ece65351105b2bb597 /src/libs/engine/events/DestroyEvent.cpp
parent81e148286602439b71950d5c69de5ce06f513592 (diff)
downloadingen-99ab1c257b7456c16f82119e1faea62c61eea660.tar.gz
ingen-99ab1c257b7456c16f82119e1faea62c61eea660.tar.bz2
ingen-99ab1c257b7456c16f82119e1faea62c61eea660.zip
Top level port destruction (Jack port removal).
git-svn-id: http://svn.drobilla.net/lad/ingen@238 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/events/DestroyEvent.cpp')
-rw-r--r--src/libs/engine/events/DestroyEvent.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libs/engine/events/DestroyEvent.cpp b/src/libs/engine/events/DestroyEvent.cpp
index 26902697..9866fe95 100644
--- a/src/libs/engine/events/DestroyEvent.cpp
+++ b/src/libs/engine/events/DestroyEvent.cpp
@@ -21,6 +21,7 @@
#include "Tree.h"
#include "Node.h"
#include "Plugin.h"
+#include "AudioDriver.h"
#include "InternalNode.h"
#include "DisconnectNodeEvent.h"
#include "DisconnectPortEvent.h"
@@ -40,6 +41,7 @@ DestroyEvent::DestroyEvent(Engine& engine, SharedPtr<Responder> responder, Frame
_object(NULL),
_node(NULL),
_port(NULL),
+ _driver_port(NULL),
_patch_node_listnode(NULL),
_patch_port_listnode(NULL),
_store_treenode(NULL),
@@ -58,6 +60,7 @@ DestroyEvent::DestroyEvent(Engine& engine, SharedPtr<Responder> responder, Frame
_object(node),
_node(node),
_port(NULL),
+ _driver_port(NULL),
_patch_node_listnode(NULL),
_patch_port_listnode(NULL),
_store_treenode(NULL),
@@ -174,6 +177,10 @@ DestroyEvent::execute(SampleCount nframes, FrameTime start, FrameTime end)
_engine.maid()->push(_port->parent_patch()->external_ports());
_port->parent_patch()->external_ports(_ports_array);
+
+ if (!_port->parent_patch()->parent())
+ _driver_port = _engine.audio_driver()->remove_port(_port->path());
+
}
}
@@ -209,6 +216,10 @@ DestroyEvent::post_process()
} else {
_responder->respond_error("Unable to destroy object");
}
+
+ if (_driver_port)
+ delete _driver_port;
+ //_engine.maid()->push(_driver_port);
}