summaryrefslogtreecommitdiffstats
path: root/src/engine/events
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/events')
-rw-r--r--src/engine/events/CreatePort.cpp8
-rw-r--r--src/engine/events/LoadPlugins.cpp2
-rw-r--r--src/engine/events/SetMetadata.cpp14
3 files changed, 15 insertions, 9 deletions
diff --git a/src/engine/events/CreatePort.cpp b/src/engine/events/CreatePort.cpp
index f1656019..63ebede2 100644
--- a/src/engine/events/CreatePort.cpp
+++ b/src/engine/events/CreatePort.cpp
@@ -51,7 +51,7 @@ CreatePort::CreatePort(
const Raul::URI& type,
bool is_output,
const Resource::Properties& properties)
- : QueuedEvent(engine, request, timestamp, true)
+ : QueuedEvent(engine, request, timestamp, bool(request))
, _error(NO_ERROR)
, _path(path)
, _type(type)
@@ -92,7 +92,9 @@ CreatePort::pre_process()
size_t buffer_size = _engine.driver()->buffer_size();
- const uint32_t old_num_ports = _patch->num_ports();
+ const uint32_t old_num_ports = (_patch->external_ports())
+ ? _patch->external_ports()->size()
+ : 0;
_patch_port = _patch->create_port(*_engine.buffer_factory(), _path.symbol(), _data_type, buffer_size, _is_output);
if (_patch->parent())
@@ -113,7 +115,7 @@ CreatePort::pre_process()
else
_ports_array = new Raul::Array<PortImpl*>(old_num_ports + 1, NULL);
- _ports_array->at(_patch->num_ports()-1) = _patch_port;
+ _ports_array->at(old_num_ports) = _patch_port;
_engine.engine_store()->add(_patch_port);
if (!_patch->parent())
diff --git a/src/engine/events/LoadPlugins.cpp b/src/engine/events/LoadPlugins.cpp
index d8a1175d..6fdc67db 100644
--- a/src/engine/events/LoadPlugins.cpp
+++ b/src/engine/events/LoadPlugins.cpp
@@ -26,7 +26,7 @@ namespace Events {
LoadPlugins::LoadPlugins(Engine& engine, SharedPtr<Request> request, SampleCount timestamp)
- : QueuedEvent(engine, request, timestamp, true)
+ : QueuedEvent(engine, request, timestamp, bool(request))
{
}
diff --git a/src/engine/events/SetMetadata.cpp b/src/engine/events/SetMetadata.cpp
index db68b1fb..77b67543 100644
--- a/src/engine/events/SetMetadata.cpp
+++ b/src/engine/events/SetMetadata.cpp
@@ -101,20 +101,24 @@ SetMetadata::pre_process()
bool is_patch = false, is_node = false, is_port = false, is_output = false;
PortType data_type(PortType::UNKNOWN);
ResourceImpl::type(_properties, is_patch, is_node, is_port, is_output, data_type);
+
+ // Create a separate request without a source so EventSource isn't unblocked twice
+ SharedPtr<Request> sub_request(new Request(NULL, _request->client(), _request->id()));
+
if (is_patch) {
uint32_t poly = 1;
iterator p = _properties.find(uris.ingen_polyphony);
if (p != _properties.end() && p->second.is_valid() && p->second.type() == Atom::INT)
poly = p->second.get_int32();
- _create_event = new CreatePatch(_engine, _request, _time,
+ _create_event = new CreatePatch(_engine, sub_request, _time,
path, poly, _properties);
} else if (is_node) {
const iterator p = _properties.find(uris.rdf_instanceOf);
- _create_event = new CreateNode(_engine, _request, _time,
+ _create_event = new CreateNode(_engine, sub_request, _time,
path, p->second.get_uri(), true, _properties);
} else if (is_port) {
- _blocking = true;
- _create_event = new CreatePort(_engine, _request, _time,
+ _blocking = bool(_request);
+ _create_event = new CreatePort(_engine, sub_request, _time,
path, data_type.uri(), is_output, _properties);
}
if (_create_event)
@@ -221,7 +225,7 @@ SetMetadata::execute(ProcessContext& context)
if (_create_event) {
QueuedEvent::execute(context);
_create_event->execute(context);
- if (_blocking && _request)
+ if (_blocking)
_request->unblock();
return;
}