summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/events
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-09-29 18:19:17 +0000
committerDavid Robillard <d@drobilla.net>2008-09-29 18:19:17 +0000
commit3168e388d0a951cf665696b970eb5bb354fbb740 (patch)
treeaa2eb0c1887d2d315085944607b66ec8470a4a65 /src/libs/engine/events
parent95b1e3fe89477fbb6710d30ac183fab7d8238c14 (diff)
downloadingen-3168e388d0a951cf665696b970eb5bb354fbb740.tar.gz
ingen-3168e388d0a951cf665696b970eb5bb354fbb740.tar.bz2
ingen-3168e388d0a951cf665696b970eb5bb354fbb740.zip
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
Diffstat (limited to 'src/libs/engine/events')
-rw-r--r--src/libs/engine/events/SetPortValueEvent.cpp12
1 files changed, 11 insertions, 1 deletions
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))