From e479da3c26d41e977cf55b8e2355db45991be09f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 22 Nov 2009 03:06:25 +0000 Subject: Partial support for message/value ports and the message context. This use case now works: - Add an event input and the "print" plugin from imum.lv2 to ingen - Connect the event input to the input of "print" - Hook Ingen up to JACK and play some MIDI events (or get events to the print plugin from anywhere else) - The "print" plugin will print the received events to the console in the message context (i.e. the audio thread is realtime safe) git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2281 a436a847-0d15-0410-975c-d299462d15a1 --- src/engine/ConnectionImpl.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/engine/ConnectionImpl.hpp') diff --git a/src/engine/ConnectionImpl.hpp b/src/engine/ConnectionImpl.hpp index 76224269..9daea1f1 100644 --- a/src/engine/ConnectionImpl.hpp +++ b/src/engine/ConnectionImpl.hpp @@ -24,6 +24,7 @@ #include "raul/Deletable.hpp" #include "interface/PortType.hpp" #include "interface/Connection.hpp" +#include "object.lv2/object.h" #include "PortImpl.hpp" #include "PortImpl.hpp" @@ -62,6 +63,7 @@ public: void pending_disconnection(bool b) { _pending_disconnection = b; } void process(Context& context); + void queue(Context& context); /** Get the buffer for a particular voice. * A Connection is smart - it knows the destination port requesting the @@ -69,7 +71,7 @@ public: * voice in a mono->poly connection). */ inline SharedPtr buffer(uint32_t voice) const { - if (must_mix()) { + if (must_mix() || must_queue()) { return _local_buffer; } else if ( ! _src_port->polyphonic()) { return _src_port->buffer(0); @@ -85,9 +87,14 @@ public: /** Returns true if this connection must mix down voices into a local buffer */ inline bool must_mix() const { return _src_port->poly() > _dst_port->poly(); } + /** Returns true if this connection crosses contexts and must buffer */ + inline bool must_queue() const { return _src_port->context() != _dst_port->context(); } + protected: void dump() const; + Raul::RingBuffer* _queue; + BufferFactory& _bufs; PortImpl* const _src_port; PortImpl* const _dst_port; -- cgit v1.2.1