summaryrefslogtreecommitdiffstats
path: root/src/gui/NodeModule.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2013-02-09 20:28:40 +0000
committerDavid Robillard <d@drobilla.net>2013-02-09 20:28:40 +0000
commit5a6aafff8dda9dddce479a2ad86edb933c9688c3 (patch)
tree8d8d3b6cba1959ac2a51bd1c4ca6c5844c5454e5 /src/gui/NodeModule.cpp
parentfac474a727f8bf14aa01fcbaa0260287926ecff8 (diff)
downloadingen-5a6aafff8dda9dddce479a2ad86edb933c9688c3.tar.gz
ingen-5a6aafff8dda9dddce479a2ad86edb933c9688c3.tar.bz2
ingen-5a6aafff8dda9dddce479a2ad86edb933c9688c3.zip
Use default float protocol for UI float controls (fix #885).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5051 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui/NodeModule.cpp')
-rw-r--r--src/gui/NodeModule.cpp26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp
index 75e4b7c7..068642b1 100644
--- a/src/gui/NodeModule.cpp
+++ b/src/gui/NodeModule.cpp
@@ -165,19 +165,23 @@ NodeModule::show_human_names(bool b)
void
NodeModule::port_activity(uint32_t index, const Raul::Atom& value)
{
- if (!_plugin_ui)
- return;
-
const URIs& uris = app().uris();
+ if (!_plugin_ui) {
+ return;
+ }
- // FIXME: Well, this sucks...
- LV2_Atom* atom = (LV2_Atom*)malloc(sizeof(LV2_Atom) + value.size());
- atom->type = value.type();
- atom->size = value.size();
- 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);
+ if (value.type() == uris.atom_Float) {
+ _plugin_ui->port_event(index, sizeof(float), 0, value.ptr<float>());
+ } else {
+ // FIXME: Well, this sucks...
+ LV2_Atom* atom = (LV2_Atom*)malloc(sizeof(LV2_Atom) + value.size());
+ atom->type = value.type();
+ atom->size = value.size();
+ 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