summaryrefslogtreecommitdiffstats
path: root/src/gui/NodeModule.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/NodeModule.cpp')
-rw-r--r--src/gui/NodeModule.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp
index 5ee75584..1d3f6801 100644
--- a/src/gui/NodeModule.cpp
+++ b/src/gui/NodeModule.cpp
@@ -19,6 +19,8 @@
#include <gtkmm/eventbox.h>
+#include "lv2/lv2plug.in/ns/ext/atom/util.h"
+
#include "ingen/Interface.hpp"
#include "ingen/client/NodeModel.hpp"
#include "ingen/client/PatchModel.hpp"
@@ -182,6 +184,24 @@ NodeModule::value_changed(uint32_t index, const Atom& value)
}
void
+NodeModule::port_activity(uint32_t index, const Atom& value)
+{
+ if (!_plugin_ui)
+ return;
+
+ const URIs& uris = app().uris();
+
+ // FIXME: Well, this sucks...
+ LV2_Atom* atom = (LV2_Atom*)malloc(sizeof(LV2_Atom) + value.size());
+ atom->type = value.type();
+ atom->size = value.type();
+ memcpy(LV2_ATOM_BODY(atom), value.get_body(), value.size());
+ _plugin_ui->port_event(
+ index, lv2_atom_total_size(atom), uris.atom_eventTransfer, atom);
+ free(atom);
+}
+
+void
NodeModule::plugin_changed()
{
for (iterator p = begin(); p !=end(); ++p)
@@ -252,6 +272,10 @@ NodeModule::new_port_view(SharedPtr<const PortModel> port)
port->signal_value_changed().connect(
sigc::bind<0>(sigc::mem_fun(this, &NodeModule::value_changed),
port->index()));
+
+ port->signal_activity().connect(
+ sigc::bind<0>(sigc::mem_fun(this, &NodeModule::port_activity),
+ port->index()));
}
Port*