summaryrefslogtreecommitdiffstats
path: root/src/server/events
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-07-31 04:34:18 +0000
committerDavid Robillard <d@drobilla.net>2012-07-31 04:34:18 +0000
commitd184de93fce861f4b632f410bde8d527ce1bf34f (patch)
tree9efa412f62028113381f66f8fe256d09fdeb6749 /src/server/events
parent66ac730782803a47ae4977d2db2407126005f4bd (diff)
downloadingen-d184de93fce861f4b632f410bde8d527ce1bf34f.tar.gz
ingen-d184de93fce861f4b632f410bde8d527ce1bf34f.tar.bz2
ingen-d184de93fce861f4b632f410bde8d527ce1bf34f.zip
Move continuous value setting stuff from AudioBuffer to PortImpl.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4582 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/events')
-rw-r--r--src/server/events/Delta.cpp2
-rw-r--r--src/server/events/Disconnect.cpp3
-rw-r--r--src/server/events/SetPortValue.cpp8
3 files changed, 5 insertions, 8 deletions
diff --git a/src/server/events/Delta.cpp b/src/server/events/Delta.cpp
index 6892ccbc..b1408d7a 100644
--- a/src/server/events/Delta.cpp
+++ b/src/server/events/Delta.cpp
@@ -38,7 +38,7 @@
#define LOG(s) s << "[Delta] "
// #define DUMP 1
-// #include "ingen/URIMap.hpp"
+#include "ingen/URIMap.hpp"
namespace Ingen {
namespace Server {
diff --git a/src/server/events/Disconnect.cpp b/src/server/events/Disconnect.cpp
index e797c6a7..413ded5f 100644
--- a/src/server/events/Disconnect.cpp
+++ b/src/server/events/Disconnect.cpp
@@ -101,7 +101,8 @@ Disconnect::Impl::Impl(Engine& e,
const float value = is_control ? _dst_input_port->value().get_float() : 0;
for (uint32_t i = 0; i < _buffers->size(); ++i) {
if (is_control) {
- PtrCast<AudioBuffer>(_buffers->at(i))->set_value(value, 0, 0);
+ AudioBuffer* abuf = dynamic_cast<AudioBuffer*>(_buffers->at(i).get());
+ abuf->set_block(value, 0, abuf->nframes() - 1);
} else {
_buffers->at(i)->clear();
}
diff --git a/src/server/events/SetPortValue.cpp b/src/server/events/SetPortValue.cpp
index 52d17c32..f2fa48f3 100644
--- a/src/server/events/SetPortValue.cpp
+++ b/src/server/events/SetPortValue.cpp
@@ -99,17 +99,13 @@ SetPortValue::apply(Context& context)
Ingen::URIs& uris = _engine.world()->uris();
Buffer* const buf = _port->buffer(0).get();
- AudioBuffer* const abuf = dynamic_cast<AudioBuffer*>(buf);
- if (abuf) {
+ if (buf->type() == uris.atom_Sound || buf->type() == uris.atom_Float) {
if (_value.type() != uris.forge.Float) {
_status = TYPE_MISMATCH;
return;
}
- for (uint32_t v = 0; v < _port->poly(); ++v) {
- ((AudioBuffer*)_port->buffer(v).get())->set_value(
- _value.get_float(), context.start(), _time);
- }
+ _port->set_control_value(context, _time, _value.get_float());
} else if (buf->type() == uris.atom_Sequence) {
buf->prepare_write(context); // FIXME: incorrect
if (buf->append_event(_time - context.start(),