summaryrefslogtreecommitdiffstats
path: root/src/server/events/SetPortValue.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2013-01-11 04:47:21 +0000
committerDavid Robillard <d@drobilla.net>2013-01-11 04:47:21 +0000
commit10e9a3a800a35916872abf9e354be4c554338e4e (patch)
treed6be3ce7993f5d8efd525629fd321b32a6341633 /src/server/events/SetPortValue.cpp
parent684eaf6b58e41f6758b160b882a6313faf0cff18 (diff)
downloadingen-10e9a3a800a35916872abf9e354be4c554338e4e.tar.gz
ingen-10e9a3a800a35916872abf9e354be4c554338e4e.tar.bz2
ingen-10e9a3a800a35916872abf9e354be4c554338e4e.zip
Use type safe enumerations.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4918 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/events/SetPortValue.cpp')
-rw-r--r--src/server/events/SetPortValue.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/server/events/SetPortValue.cpp b/src/server/events/SetPortValue.cpp
index b3481861..f2399d8e 100644
--- a/src/server/events/SetPortValue.cpp
+++ b/src/server/events/SetPortValue.cpp
@@ -54,7 +54,7 @@ bool
SetPortValue::pre_process()
{
if (_port->is_output()) {
- return Event::pre_process_done(DIRECTION_MISMATCH, _port->path());
+ return Event::pre_process_done(Status::DIRECTION_MISMATCH, _port->path());
}
// Set value metadata (does not affect buffers)
@@ -63,7 +63,7 @@ SetPortValue::pre_process()
_binding = _engine.control_bindings()->port_binding(_port);
- return Event::pre_process_done(SUCCESS);
+ return Event::pre_process_done(Status::SUCCESS);
}
void
@@ -71,7 +71,7 @@ SetPortValue::execute(ProcessContext& context)
{
assert(_time >= context.start() && _time <= context.end());
- if (_port->parent_block()->context() == Context::MESSAGE)
+ if (_port->parent_block()->context() == Context::ID::MESSAGE)
return;
apply(context);
@@ -81,7 +81,7 @@ SetPortValue::execute(ProcessContext& context)
void
SetPortValue::apply(Context& context)
{
- if (_status) {
+ if (_status != Status::SUCCESS) {
return;
}
@@ -92,7 +92,7 @@ SetPortValue::apply(Context& context)
if (_value.type() == uris.forge.Float) {
_port->set_control_value(context, _time, _value.get_float());
} else {
- _status = TYPE_MISMATCH;
+ _status = Status::TYPE_MISMATCH;
}
} else if (buf->type() == uris.atom_Sequence) {
buf->prepare_write(context); // FIXME: incorrect
@@ -102,12 +102,12 @@ SetPortValue::apply(Context& context)
(const uint8_t*)_value.get_body())) {
_port->raise_set_by_user_flag();
} else {
- _status = NO_SPACE;
+ _status = Status::NO_SPACE;
}
} else if (buf->type() == uris.atom_URID) {
((LV2_Atom_URID*)buf->atom())->body = _value.get_int32();
} else {
- _status = BAD_VALUE_TYPE;
+ _status = Status::BAD_VALUE_TYPE;
}
}
@@ -115,7 +115,7 @@ void
SetPortValue::post_process()
{
Broadcaster::Transfer t(*_engine.broadcaster());
- if (!respond()) {
+ if (respond() == Status::SUCCESS) {
_engine.broadcaster()->set_property(
_port->uri(),
_engine.world()->uris().ingen_value,