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/ArcImpl.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/ArcImpl.cpp')
-rw-r--r-- | src/server/ArcImpl.cpp | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/server/ArcImpl.cpp b/src/server/ArcImpl.cpp index 8b8a23b4..e53f1880 100644 --- a/src/server/ArcImpl.cpp +++ b/src/server/ArcImpl.cpp @@ -55,21 +55,31 @@ ArcImpl::head_path() const } BufferRef -ArcImpl::buffer(uint32_t voice) const +ArcImpl::buffer(uint32_t voice, SampleCount offset) const { - assert(!must_mix()); assert(_tail->poly() == 1 || _tail->poly() > voice); if (_tail->poly() == 1) { - return _tail->buffer(0); - } else { - return _tail->buffer(voice); + voice = 0; } + + if (_tail->buffer(0)->is_sequence()) { + if (_head->type() == PortType::CONTROL) { + _tail->update_values(offset); // Update value buffer + return _tail->value_buffer(voice); // Return value buffer + } else if (_head->type() == PortType::CV) { + _tail->update_values(offset); // Update initial value + // Return full tail buffer below + } + } + + return _tail->buffer(voice); } bool ArcImpl::must_mix() const { - return _tail->poly() > _head->poly(); + return (_tail->poly() > _head->poly() || + (_tail->buffer(0)->is_sequence() != _head->buffer(0)->is_sequence())); } bool @@ -98,6 +108,9 @@ ArcImpl::can_connect(const OutputPort* src, const InputPort* dst) // atom:Float Value => Control || (src->supports(uris.atom_Float) && dst->is_a(PortType::ID::CONTROL)) + // atom:Float Value => CV + || (src->supports(uris.atom_Float) && dst->is_a(PortType::ID::CV)) + // atom:Sound Value => Audio || (src->supports(uris.atom_Sound) && dst->is_a(PortType::ID::AUDIO))); } |