summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/NodeModule.cpp24
-rw-r--r--src/gui/NodeModule.hpp1
2 files changed, 25 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*
diff --git a/src/gui/NodeModule.hpp b/src/gui/NodeModule.hpp
index 0cfa4ec8..3ec72f6d 100644
--- a/src/gui/NodeModule.hpp
+++ b/src/gui/NodeModule.hpp
@@ -83,6 +83,7 @@ protected:
void new_port_view(SharedPtr<const Client::PortModel> port);
void value_changed(uint32_t index, const Raul::Atom& value);
+ void port_activity(uint32_t index, const Raul::Atom& value);
void plugin_changed();
void set_control_values();