diff options
Diffstat (limited to 'src/libs/engine/events')
-rw-r--r-- | src/libs/engine/events/AddPortEvent.cpp | 5 | ||||
-rw-r--r-- | src/libs/engine/events/DestroyEvent.cpp | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/libs/engine/events/AddPortEvent.cpp b/src/libs/engine/events/AddPortEvent.cpp index 4173ced2..317e68b7 100644 --- a/src/libs/engine/events/AddPortEvent.cpp +++ b/src/libs/engine/events/AddPortEvent.cpp @@ -140,7 +140,10 @@ AddPortEvent::execute(SampleCount nframes, FrameTime start, FrameTime end) } if (_driver_port) - _engine.audio_driver()->add_port(_driver_port); + if (_type == "ingen:audio") + _engine.audio_driver()->add_port(_driver_port); + else if (_type == "ingen:midi") + _engine.midi_driver()->add_port(_driver_port); } diff --git a/src/libs/engine/events/DestroyEvent.cpp b/src/libs/engine/events/DestroyEvent.cpp index 9866fe95..97a4f215 100644 --- a/src/libs/engine/events/DestroyEvent.cpp +++ b/src/libs/engine/events/DestroyEvent.cpp @@ -22,6 +22,7 @@ #include "Node.h" #include "Plugin.h" #include "AudioDriver.h" +#include "MidiDriver.h" #include "InternalNode.h" #include "DisconnectNodeEvent.h" #include "DisconnectPortEvent.h" @@ -178,9 +179,11 @@ DestroyEvent::execute(SampleCount nframes, FrameTime start, FrameTime end) _port->parent_patch()->external_ports(_ports_array); - if (!_port->parent_patch()->parent()) + if (!_port->parent_patch()->parent()) { _driver_port = _engine.audio_driver()->remove_port(_port->path()); - + if (!_driver_port) + _driver_port = _engine.midi_driver()->remove_port(_port->path()); + } } } |