summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/events
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
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')
-rw-r--r--src/libs/engine/events/AddPortEvent.cpp3
-rw-r--r--src/libs/engine/events/DestroyEvent.cpp11
-rw-r--r--src/libs/engine/events/DestroyEvent.h2
3 files changed, 14 insertions, 2 deletions
diff --git a/src/libs/engine/events/AddPortEvent.cpp b/src/libs/engine/events/AddPortEvent.cpp
index bdce9267..4173ced2 100644
--- a/src/libs/engine/events/AddPortEvent.cpp
+++ b/src/libs/engine/events/AddPortEvent.cpp
@@ -120,7 +120,6 @@ AddPortEvent::pre_process()
assert(_ports_array->size() == _patch->num_ports());
-
}
}
QueuedEvent::pre_process();
@@ -141,7 +140,7 @@ AddPortEvent::execute(SampleCount nframes, FrameTime start, FrameTime end)
}
if (_driver_port)
- _driver_port->add_to_driver();
+ _engine.audio_driver()->add_port(_driver_port);
}
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);
}
diff --git a/src/libs/engine/events/DestroyEvent.h b/src/libs/engine/events/DestroyEvent.h
index 6dfebbf7..1249eceb 100644
--- a/src/libs/engine/events/DestroyEvent.h
+++ b/src/libs/engine/events/DestroyEvent.h
@@ -33,6 +33,7 @@ class GraphObject;
class Patch;
class Node;
class Port;
+class DriverPort;
class Plugin;
class DisconnectNodeEvent;
class DisconnectPortEvent;
@@ -58,6 +59,7 @@ private:
GraphObject* _object;
Node* _node; ///< Same as _object if it is a Node, otherwise NULL
Port* _port; ///< Same as _object if it is a Port, otherwise NULL
+ DriverPort* _driver_port;
ListNode<Node*>* _patch_node_listnode;
ListNode<Port*>* _patch_port_listnode;
TreeNode<GraphObject*>* _store_treenode;