From 2e81d99cd33baed9e4342197e7b9e40ab70cb628 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 13 Aug 2012 03:02:41 +0000 Subject: 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 --- src/server/events/SetPortValue.cpp | 12 +++++------- 1 file 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; } } -- cgit v1.2.1