diff options
author | David Robillard <d@drobilla.net> | 2012-03-11 05:22:08 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-03-11 05:22:08 +0000 |
commit | 4c299323440923891b9c583a354116000eb143cc (patch) | |
tree | f2873fdd9849561608b7eebbfad89c04d56ba58e /src/server/PortImpl.cpp | |
parent | c2ea4e3c59ce8c06066780d67237fdb07255c89e (diff) | |
download | ingen-4c299323440923891b9c583a354116000eb143cc.tar.gz ingen-4c299323440923891b9c583a354116000eb143cc.tar.bz2 ingen-4c299323440923891b9c583a354116000eb143cc.zip |
Implement cv:CVPort (fix #790). Not well-tested, but at least works somewhat.
Use new style LV2 URI defines (and fix invalid atom URIs).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4050 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/PortImpl.cpp')
-rw-r--r-- | src/server/PortImpl.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/server/PortImpl.cpp b/src/server/PortImpl.cpp index 2aef6f5e..ac4eb21f 100644 --- a/src/server/PortImpl.cpp +++ b/src/server/PortImpl.cpp @@ -107,11 +107,15 @@ bool PortImpl::prepare_poly(BufferFactory& bufs, uint32_t poly) { ThreadManager::assert_thread(THREAD_PRE_PROCESS); - if (buffer_type() != PortType::CONTROL && buffer_type() != PortType::AUDIO) + if (buffer_type() != PortType::CONTROL && + buffer_type() != PortType::CV && + buffer_type() != PortType::AUDIO) { return false; + } - if (_poly == poly) + if (_poly == poly) { return true; + } if (_prepared_buffers && _prepared_buffers->size() != poly) { delete _prepared_buffers; @@ -135,11 +139,15 @@ bool PortImpl::apply_poly(Maid& maid, uint32_t poly) { ThreadManager::assert_thread(THREAD_PROCESS); - if (buffer_type() != PortType::CONTROL && buffer_type() != PortType::AUDIO) + if (buffer_type() != PortType::CONTROL && + buffer_type() != PortType::CV && + buffer_type() != PortType::AUDIO) { return false; + } - if (!_prepared_buffers) + if (!_prepared_buffers) { return true; + } assert(poly == _prepared_buffers->size()); @@ -150,7 +158,7 @@ PortImpl::apply_poly(Maid& maid, uint32_t poly) assert(_buffers == _prepared_buffers); _prepared_buffers = NULL; - if (is_a(PortType::CONTROL)) + if (is_a(PortType::CONTROL) || is_a(PortType::CV)) for (uint32_t v = 0; v < _poly; ++v) if (_buffers->at(v)) boost::static_pointer_cast<AudioBuffer>(_buffers->at(v))->set_value( @@ -211,6 +219,7 @@ PortImpl::broadcast_value(Context& context, bool force) } return; case PortType::CONTROL: + case PortType::CV: val = ((AudioBuffer*)buffer(0).get())->value_at(0); break; case PortType::EVENTS: |