summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-08-13 03:02:41 +0000
committerDavid Robillard <d@drobilla.net>2012-08-13 03:02:41 +0000
commit2e81d99cd33baed9e4342197e7b9e40ab70cb628 (patch)
treee46e0ea9908d6d3947f5c6277059933f8ff9abe7
parent16422ab7e8d52187aa7af07cd9ee585600453319 (diff)
downloadingen-2e81d99cd33baed9e4342197e7b9e40ab70cb628.tar.gz
ingen-2e81d99cd33baed9e4342197e7b9e40ab70cb628.tar.bz2
ingen-2e81d99cd33baed9e4342197e7b9e40ab70cb628.zip
Real-time safe error handling for bad SetPortValue events.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4680 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--src/server/events/SetPortValue.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/server/events/SetPortValue.cpp b/src/server/events/SetPortValue.cpp
index 0f63ed53..49e2e483 100644
--- a/src/server/events/SetPortValue.cpp
+++ b/src/server/events/SetPortValue.cpp
@@ -90,12 +90,11 @@ SetPortValue::apply(Context& context)
Buffer* const buf = _port->buffer(0).get();
if (buf->type() == uris.atom_Sound || buf->type() == uris.atom_Float) {
- if (_value.type() != uris.forge.Float) {
+ if (_value.type() == uris.forge.Float) {
+ _port->set_control_value(context, _time, _value.get_float());
+ } else {
_status = TYPE_MISMATCH;
- return;
}
-
- _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(),
@@ -104,11 +103,10 @@ SetPortValue::apply(Context& context)
(const uint8_t*)_value.get_body())) {
_port->raise_set_by_user_flag();
} else {
- Raul::warn(Raul::fmt("Error writing to port %1%\n")
- % _port->path().c_str());
+ _status = NO_SPACE;
}
} else {
- Raul::warn(Raul::fmt("Unknown value type %1%\n") % _value.type());
+ _status = BAD_VALUE_TYPE;
}
}