summaryrefslogtreecommitdiffstats
path: root/src/engine/ConnectionImpl.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-02-26 02:23:52 +0000
committerDavid Robillard <d@drobilla.net>2010-02-26 02:23:52 +0000
commitf982e4b62ebba89ead634169ebe4e281cc7df46a (patch)
treee26ac29eebbdc1fa4cf034913a1cb944fa74b4d9 /src/engine/ConnectionImpl.cpp
parent52e49500bb78974d43bdfd30b2ec9b2a4522dd25 (diff)
downloadingen-f982e4b62ebba89ead634169ebe4e281cc7df46a.tar.gz
ingen-f982e4b62ebba89ead634169ebe4e281cc7df46a.tar.bz2
ingen-f982e4b62ebba89ead634169ebe4e281cc7df46a.zip
Fix queued connections (e.g. event input => print).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2495 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/ConnectionImpl.cpp')
-rw-r--r--src/engine/ConnectionImpl.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/engine/ConnectionImpl.cpp b/src/engine/ConnectionImpl.cpp
index c6ccf3ba..8fa770f7 100644
--- a/src/engine/ConnectionImpl.cpp
+++ b/src/engine/ConnectionImpl.cpp
@@ -72,12 +72,17 @@ ConnectionImpl::dump() const
void
ConnectionImpl::get_sources(Context& context, uint32_t voice,
- Buffer** srcs, uint32_t max_num_srcs, uint32_t& num_srcs)
+ IntrusivePtr<Buffer>* srcs, uint32_t max_num_srcs, uint32_t& num_srcs)
{
- if (must_queue())
- return;
-
- if (must_mix()) {
+ if (must_queue() && _queue->read_space() > 0) {
+ LV2_Object obj;
+ _queue->peek(sizeof(LV2_Object), &obj);
+ IntrusivePtr<Buffer> buf = context.engine().buffer_factory()->get(
+ dst_port()->buffer_type(), sizeof(LV2_Object) + obj.size);
+ void* data = buf->port_data(PortType::MESSAGE, context.offset());
+ _queue->full_read(sizeof(LV2_Object) + obj.size, (LV2_Object*)data);
+ srcs[num_srcs++] = buf;
+ } else if (must_mix()) {
// Mixing down voices: every src voice mixed into every dst voice
for (uint32_t v = 0; v < _src_port->poly(); ++v) {
assert(num_srcs < max_num_srcs);