diff options
author | David Robillard <d@drobilla.net> | 2012-08-10 23:27:30 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-08-10 23:27:30 +0000 |
commit | 46eff0830c8894997fb624733fadcea9c6d74812 (patch) | |
tree | a804a37965ee6531cd9934d5957ff8c51420ebb0 /src/server/PortImpl.cpp | |
parent | 2f03ac2d3e83563eacbacd4e17b4059605dc58b4 (diff) | |
download | ingen-46eff0830c8894997fb624733fadcea9c6d74812.tar.gz ingen-46eff0830c8894997fb624733fadcea9c6d74812.tar.bz2 ingen-46eff0830c8894997fb624733fadcea9c6d74812.zip |
Use the usual semantics for 'end' for Buffer::set_block, which in addition to actually making sense, allows GCC to optimize the loop.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4650 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/PortImpl.cpp')
-rw-r--r-- | src/server/PortImpl.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/server/PortImpl.cpp b/src/server/PortImpl.cpp index a336439f..21c77b42 100644 --- a/src/server/PortImpl.cpp +++ b/src/server/PortImpl.cpp @@ -153,9 +153,9 @@ PortImpl::set_voice_value(Context& context, uint32_t voice, FrameTime time, Samp } FrameTime offset = time - context.start(); - FrameTime last = (_type == PortType::CONTROL) ? 0 : context.nframes() - 1; + FrameTime end = (_type == PortType::CONTROL) ? 1 : context.nframes(); if (offset < context.nframes()) { - buffer(voice)->set_block(value, offset, last); + buffer(voice)->set_block(value, offset, end); } // else trigger at very end of block, and set to 0 at start of next block SetState& state = _set_states->at(voice); @@ -175,7 +175,7 @@ PortImpl::update_set_state(Context& context, uint32_t voice) } break; case SetState::HALF_SET_CYCLE_2: { - buffer(voice)->set_block(state.value, 0, context.nframes() - 1); + buffer(voice)->set_block(state.value, 0, context.nframes()); state.state = SetState::SET; break; } @@ -296,7 +296,7 @@ PortImpl::clear_buffers() case PortType::CV: for (uint32_t v = 0; v < _poly; ++v) { Buffer* buf = buffer(v).get(); - buf->set_block(_value.get_float(), 0, buf->nframes() - 1); + buf->set_block(_value.get_float(), 0, buf->nframes()); SetState& state = _set_states->at(v); state.state = SetState::SET; state.value = _value.get_float(); |