summaryrefslogtreecommitdiffstats
path: root/src/engine/events
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-11-16 00:30:35 +0000
committerDavid Robillard <d@drobilla.net>2009-11-16 00:30:35 +0000
commit3d89115a67a9c947a28539ffdd2399808a53279b (patch)
tree826b900de3979eed9c31aae0d3ac560d39b53460 /src/engine/events
parent597fa9212f27d2448c0cdd20fbf616928c662cc1 (diff)
downloadingen-3d89115a67a9c947a28539ffdd2399808a53279b.tar.gz
ingen-3d89115a67a9c947a28539ffdd2399808a53279b.tar.bz2
ingen-3d89115a67a9c947a28539ffdd2399808a53279b.zip
Rework objects extension to have "value ports" and "message ports".
Make audio and control buffers in ingen actually object buffers (towards interop). Overhaul the hell out of ingen buffer and mixing stuff. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2266 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/events')
-rw-r--r--src/engine/events/Connect.cpp2
-rw-r--r--src/engine/events/CreateNode.cpp2
-rw-r--r--src/engine/events/CreatePort.cpp2
-rw-r--r--src/engine/events/RequestMetadata.cpp4
-rw-r--r--src/engine/events/SetMetadata.cpp2
-rw-r--r--src/engine/events/SetPortValue.cpp16
6 files changed, 14 insertions, 14 deletions
diff --git a/src/engine/events/Connect.cpp b/src/engine/events/Connect.cpp
index 6c7bf2fe..62e32916 100644
--- a/src/engine/events/Connect.cpp
+++ b/src/engine/events/Connect.cpp
@@ -133,7 +133,7 @@ Connect::pre_process()
return;
}
- _connection = SharedPtr<ConnectionImpl>(new ConnectionImpl(_src_port, _dst_port));
+ _connection = SharedPtr<ConnectionImpl>(new ConnectionImpl(*_engine.buffer_factory(), _src_port, _dst_port));
_patch_listnode = new PatchImpl::Connections::Node(_connection);
_port_listnode = new InputPort::Connections::Node(_connection);
diff --git a/src/engine/events/CreateNode.cpp b/src/engine/events/CreateNode.cpp
index 6c70d481..9a9e0826 100644
--- a/src/engine/events/CreateNode.cpp
+++ b/src/engine/events/CreateNode.cpp
@@ -90,7 +90,7 @@ CreateNode::pre_process()
if (_patch && _plugin) {
- _node = _plugin->instantiate(_path.name(), _polyphonic, _patch, _engine);
+ _node = _plugin->instantiate(*_engine.buffer_factory(), _path.name(), _polyphonic, _patch, _engine);
if (_node != NULL) {
_node->properties().insert(_properties.begin(), _properties.end());
diff --git a/src/engine/events/CreatePort.cpp b/src/engine/events/CreatePort.cpp
index 5ea78fb0..848092b1 100644
--- a/src/engine/events/CreatePort.cpp
+++ b/src/engine/events/CreatePort.cpp
@@ -98,7 +98,7 @@ CreatePort::pre_process()
const uint32_t old_num_ports = _patch->num_ports();
- _patch_port = _patch->create_port(_path.name(), _data_type, buffer_size, _is_output);
+ _patch_port = _patch->create_port(*_engine.buffer_factory(), _path.name(), _data_type, buffer_size, _is_output);
if (_patch->parent())
_patch_port->set_property("rdf:instanceOf",
Atom(Atom::URI, _patch_port->meta_uri().str()));
diff --git a/src/engine/events/RequestMetadata.cpp b/src/engine/events/RequestMetadata.cpp
index e6ba7f5d..2ef3edda 100644
--- a/src/engine/events/RequestMetadata.cpp
+++ b/src/engine/events/RequestMetadata.cpp
@@ -95,10 +95,10 @@ RequestMetadata::execute(ProcessContext& context)
PortImpl* port = dynamic_cast<PortImpl*>(_resource);
if (port) {
if (port->type() == DataType::CONTROL || port->type() == DataType::AUDIO)
- _value = ((AudioBuffer*)port->buffer(0))->value_at(0); // TODO: offset
+ _value = ((AudioBuffer*)port->buffer(0).get())->value_at(0); // TODO: offset
else if (port->type() == DataType::VALUE)
LV2Object::to_atom(context.engine().world(),
- ((ObjectBuffer*)port->buffer(0))->data(), _value);
+ ((ObjectBuffer*)port->buffer(0).get())->object(), _value);
} else {
_resource = 0;
}
diff --git a/src/engine/events/SetMetadata.cpp b/src/engine/events/SetMetadata.cpp
index 3d62781d..caed4909 100644
--- a/src/engine/events/SetMetadata.cpp
+++ b/src/engine/events/SetMetadata.cpp
@@ -162,7 +162,7 @@ SetMetadata::pre_process()
} else if (key.str() == "ingen:polyphony") {
if (value.type() == Atom::INT) {
op = POLYPHONY;
- _patch->prepare_internal_poly(value.get_int32());
+ _patch->prepare_internal_poly(*_engine.buffer_factory(), value.get_int32());
} else {
_error = BAD_TYPE;
}
diff --git a/src/engine/events/SetPortValue.cpp b/src/engine/events/SetPortValue.cpp
index 6b9d8d9e..2a33b798 100644
--- a/src/engine/events/SetPortValue.cpp
+++ b/src/engine/events/SetPortValue.cpp
@@ -151,7 +151,7 @@ SetPortValue::apply(Context& context)
/*} else if (_port->buffer(0)->capacity() < _data_size) {
_error = NO_SPACE;*/
} else {
- Buffer* const buf = _port->buffer(0);
+ Buffer* const buf = _port->buffer(0).get();
AudioBuffer* const abuf = dynamic_cast<AudioBuffer*>(buf);
if (abuf) {
if (_value.type() != Atom::FLOAT) {
@@ -160,12 +160,12 @@ SetPortValue::apply(Context& context)
}
if (_omni) {
- for (uint32_t i=0; i < _port->poly(); ++i)
- ((AudioBuffer*)_port->buffer(i))->set_value(
+ for (uint32_t v = 0; v < _port->poly(); ++v)
+ ((AudioBuffer*)_port->buffer(v).get())->set_value(
_value.get_float(), start, _time);
} else {
if (_voice_num < _port->poly())
- ((AudioBuffer*)_port->buffer(_voice_num))->set_value(
+ ((AudioBuffer*)_port->buffer(_voice_num).get())->set_value(
_value.get_float(), start, _time);
else
_error = ILLEGAL_VOICE;
@@ -198,10 +198,10 @@ SetPortValue::apply(Context& context)
ObjectBuffer* const obuf = dynamic_cast<ObjectBuffer*>(buf);
if (obuf) {
- obuf->data()->size = obuf->size() - sizeof(LV2_Object);
- if (LV2Object::from_atom(_engine.world(), _value, obuf->data())) {
- cout << "Converted atom " << _value << " :: " << obuf->data()->type
- << " * " << obuf->data()->size << " @ " << obuf->data() << endl;
+ obuf->object()->size = obuf->size() - sizeof(LV2_Object);
+ if (LV2Object::from_atom(_engine.world(), _value, obuf->object())) {
+ cout << "Converted atom " << _value << " :: " << obuf->object()->type
+ << " * " << obuf->object()->size << " @ " << obuf->object() << endl;
return;
} else {
cerr << "WARNING: Failed to convert atom to LV2 object" << endl;