summaryrefslogtreecommitdiffstats
path: root/src/server/PortImpl.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2015-10-23 16:42:17 +0000
committerDavid Robillard <d@drobilla.net>2015-10-23 16:42:17 +0000
commit626ec62aab67c136c405cc88213d7b92325c01d7 (patch)
tree01a94497d665daa90ba754f44cf2bc8b25ad92d0 /src/server/PortImpl.cpp
parent425786b0c41be41c50675815df51ed8927160865 (diff)
downloadingen-626ec62aab67c136c405cc88213d7b92325c01d7.tar.gz
ingen-626ec62aab67c136c405cc88213d7b92325c01d7.tar.bz2
ingen-626ec62aab67c136c405cc88213d7b92325c01d7.zip
Reduce overhead
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5770 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/PortImpl.cpp')
-rw-r--r--src/server/PortImpl.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/server/PortImpl.cpp b/src/server/PortImpl.cpp
index ea71568c..7119f94c 100644
--- a/src/server/PortImpl.cpp
+++ b/src/server/PortImpl.cpp
@@ -75,6 +75,7 @@ PortImpl::PortImpl(BufferFactory& bufs,
, _is_logarithmic(false)
, _is_sample_rate(false)
, _is_toggled(false)
+ , _is_driver_port(false)
{
assert(block != NULL);
assert(_poly > 0);
@@ -262,32 +263,37 @@ PortImpl::set_voice_value(const Context& context,
}
void
-PortImpl::update_set_state(Context& context, uint32_t voice)
+PortImpl::update_set_state(Context& context, uint32_t v)
{
- SetState& state = _voices->at(voice).set_state;
+ Voice& voice = _voices->at(v);
+ SetState& state = voice.set_state;
+ BufferRef buf = voice.buffer;
switch (state.state) {
case SetState::State::SET:
+ break;
+ case SetState::State::SET_CYCLE_1:
if (state.time < context.start() &&
- buffer(voice)->is_sequence() &&
- buffer(voice)->value_type() == _bufs.uris().atom_Float &&
+ buf->is_sequence() &&
+ buf->value_type() == _bufs.uris().atom_Float &&
!_parent->path().is_root()) {
- buffer(voice)->clear();
+ buf->clear();
state.time = context.start();
}
+ state.state = SetState::State::SET;
break;
case SetState::State::HALF_SET_CYCLE_1:
state.state = SetState::State::HALF_SET_CYCLE_2;
break;
case SetState::State::HALF_SET_CYCLE_2:
- if (buffer(voice)->is_sequence()) {
- buffer(voice)->clear();
- buffer(voice)->append_event(
+ if (buf->is_sequence()) {
+ buf->clear();
+ buf->append_event(
0, sizeof(float), _bufs.uris().atom_Float,
(const uint8_t*)&state.value);
} else {
- buffer(voice)->set_block(state.value, 0, context.nframes());
+ buf->set_block(state.value, 0, context.nframes());
}
- state.state = SetState::State::SET;
+ state.state = SetState::State::SET_CYCLE_1;
break;
}
}