diff options
author | David Robillard <d@drobilla.net> | 2017-03-20 03:27:33 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2017-03-20 03:27:33 +0100 |
commit | 9f1f6485c99e90831bbcebaa35831ff76b2204ed (patch) | |
tree | 608d084815b27ee59af77683d13020d24aa9c36f /src/server/Buffer.cpp | |
parent | 59f579df71e52207bcdda15d4abb3562fdc1d6f2 (diff) | |
download | ingen-9f1f6485c99e90831bbcebaa35831ff76b2204ed.tar.gz ingen-9f1f6485c99e90831bbcebaa35831ff76b2204ed.tar.bz2 ingen-9f1f6485c99e90831bbcebaa35831ff76b2204ed.zip |
Always use sample accurate controls
This changes control port buffers to always be sequences of float, splitting
cycles internally so nodes with control ports act as if they support sample
accurate control input and output. This allows things like having networks of
control ports manipulated by the user which are run into CV ports and having
sample accurate changes end up in the CV ports even though the values were
calculated by plugins with single float ports.
Further work is probably necessary to thin and smooth changes that come from a
user drag (perhaps there should be a mode for this?) to keep the amount of
cycle splitting reasonable, and support for plugins with fixed block length.
Diffstat (limited to 'src/server/Buffer.cpp')
-rw-r--r-- | src/server/Buffer.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/server/Buffer.cpp b/src/server/Buffer.cpp index fb7efa85..2353ab5d 100644 --- a/src/server/Buffer.cpp +++ b/src/server/Buffer.cpp @@ -166,12 +166,6 @@ Buffer::copy(const RunContext& context, const Buffer* src) } else { clear(); } - - if (_value_buffer && src->_value_buffer) { - memcpy(_value_buffer->get<LV2_Atom>(), - src->value(), - lv2_atom_total_size(src->value())); - } } else if (src->is_audio() && is_control()) { samples()[0] = src->samples()[0]; } else if (src->is_control() && is_audio()) { @@ -201,6 +195,7 @@ Buffer::port_data(PortType port_type, SampleCount offset) { switch (port_type.id()) { case PortType::ID::CONTROL: + return &_value_buffer->get<LV2_Atom_Float>()->body; case PortType::ID::CV: case PortType::ID::AUDIO: if (_type == _factory.uris().atom_Float) { |