From 3168e388d0a951cf665696b970eb5bb354fbb740 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 29 Sep 2008 18:19:17 +0000 Subject: More context extension work. Clicking the input port on bang in ingen while in edit mode will now send a message to the bang plugin in the message context. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1537 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/engine/events/SetPortValueEvent.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/libs/engine/events') diff --git a/src/libs/engine/events/SetPortValueEvent.cpp b/src/libs/engine/events/SetPortValueEvent.cpp index 90e66c1c..6d65082b 100644 --- a/src/libs/engine/events/SetPortValueEvent.cpp +++ b/src/libs/engine/events/SetPortValueEvent.cpp @@ -27,6 +27,7 @@ #include "AudioBuffer.hpp" #include "EventBuffer.hpp" #include "ProcessContext.hpp" +#include "MessageContext.hpp" using namespace std; @@ -76,7 +77,7 @@ SetPortValueEvent::~SetPortValueEvent() { } - + void SetPortValueEvent::pre_process() { @@ -91,6 +92,12 @@ SetPortValueEvent::pre_process() if (_port == NULL && _error == NO_ERROR) _error = PORT_NOT_FOUND; } + + // Port is a message context port, set its value and + // call the plugin's message run function once + if (_port && _port->context() == Context::MESSAGE) { + _engine.message_context()->run(_port->parent_node()); + } QueuedEvent::pre_process(); } @@ -101,6 +108,9 @@ SetPortValueEvent::execute(ProcessContext& context) { Event::execute(context); assert(_time >= context.start() && _time <= context.end()); + + if (_port && _port->context() == Context::MESSAGE) + return; if (_error == NO_ERROR && _port == NULL) { if (Path::is_valid(_port_path)) -- cgit v1.2.1