summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-07-18 02:45:35 +0000
committerDavid Robillard <d@drobilla.net>2012-07-18 02:45:35 +0000
commit6bd13dfa606f758212a20634f0f073596f42101f (patch)
tree84b4397e7961ffe46375feb17c847bb43e76e30e /src/gui
parent5afdd1098140b9aba15ff470356bf73b9144501a (diff)
downloadingen-6bd13dfa606f758212a20634f0f073596f42101f.tar.gz
ingen-6bd13dfa606f758212a20634f0f073596f42101f.tar.bz2
ingen-6bd13dfa606f758212a20634f0f073596f42101f.zip
Working bi-directional UI <=> plugin messaging.
Rewrite notification system to support variably sized notifications. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4548 a436a847-0d15-0410-975c-d299462d15a1
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();