diff options
author | David Robillard <d@drobilla.net> | 2014-08-31 01:24:57 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-08-31 01:24:57 +0000 |
commit | a2792bd09212eed55bba1aa30dc09043a6955486 (patch) | |
tree | d4262f760d4522bc6f1c99778987aada332b9e7e /src/server/OutputPort.cpp | |
parent | e3ecb2b439bd03d27b5e11efe430c24f0ebe6283 (diff) | |
download | ingen-a2792bd09212eed55bba1aa30dc09043a6955486.tar.gz ingen-a2792bd09212eed55bba1aa30dc09043a6955486.tar.bz2 ingen-a2792bd09212eed55bba1aa30dc09043a6955486.zip |
Use float sequences for sample-accurate control ports.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5462 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/OutputPort.cpp')
-rw-r--r-- | src/server/OutputPort.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/server/OutputPort.cpp b/src/server/OutputPort.cpp index 9f97930e..395885ee 100644 --- a/src/server/OutputPort.cpp +++ b/src/server/OutputPort.cpp @@ -52,7 +52,8 @@ OutputPort::get_buffers(BufferFactory& bufs, bool real_time) const { for (uint32_t v = 0; v < poly; ++v) - voices->at(v).buffer = bufs.get_buffer(buffer_type(), _buffer_size, real_time); + voices->at(v).buffer = bufs.get_buffer( + buffer_type(), _value.type(), _buffer_size, real_time); return true; } @@ -64,6 +65,26 @@ OutputPort::pre_process(Context& context) _voices->at(v).buffer->prepare_output_write(context); } +SampleCount +OutputPort::next_value_offset(SampleCount offset, SampleCount end) const +{ + SampleCount earliest = end; + for (uint32_t v = 0; v < _poly; ++v) { + const SampleCount o = _voices->at(v).buffer->next_value_offset(offset, end); + if (o < earliest) { + earliest = o; + } + } + return earliest; +} + +void +OutputPort::update_values(SampleCount offset) +{ + for (uint32_t v = 0; v < _poly; ++v) + _voices->at(v).buffer->update_value_buffer(offset); +} + void OutputPort::post_process(Context& context) { @@ -71,6 +92,7 @@ OutputPort::post_process(Context& context) update_set_state(context, v); } + update_values(0); monitor(context); } |