summaryrefslogtreecommitdiffstats
path: root/src/gui/NodeModule.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-11-12 06:56:26 +0000
committerDavid Robillard <d@drobilla.net>2009-11-12 06:56:26 +0000
commit64bd557e75113743f179086b365ea7d97b72ee3e (patch)
tree6a6f5b72a8ce97616cd5ccff188f2e44e92d1ba8 /src/gui/NodeModule.cpp
parent023dcf4cb297928879eb0e53cf0216edb562f6fa (diff)
downloadingen-64bd557e75113743f179086b365ea7d97b72ee3e.tar.gz
ingen-64bd557e75113743f179086b365ea7d97b72ee3e.tar.bz2
ingen-64bd557e75113743f179086b365ea7d97b72ee3e.zip
String port support.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2255 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui/NodeModule.cpp')
-rw-r--r--src/gui/NodeModule.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp
index fbc89fc3..4df32263 100644
--- a/src/gui/NodeModule.cpp
+++ b/src/gui/NodeModule.cpp
@@ -144,20 +144,23 @@ NodeModule::show_human_names(bool b)
void
NodeModule::value_changed(uint32_t index, const Atom& value)
{
- float control = 0.0f;
+ if (!_plugin_ui)
+ return;
+
+ float float_val = 0.0f;
+ SLV2UIInstance inst = _plugin_ui->instance();
+ const LV2UI_Descriptor* ui_desc = slv2_ui_instance_get_descriptor(inst);
+ LV2UI_Handle ui = slv2_ui_instance_get_handle(inst);
+
switch (value.type()) {
case Atom::FLOAT:
- control = value.get_float();
- if (_plugin_ui) {
- SLV2UIInstance inst = _plugin_ui->instance();
- const LV2UI_Descriptor* ui_descriptor = slv2_ui_instance_get_descriptor(inst);
- LV2UI_Handle ui_handle = slv2_ui_instance_get_handle(inst);
- if (ui_descriptor->port_event)
- ui_descriptor->port_event(ui_handle, index, 4, 0, &control);
- }
+ float_val = value.get_float();
+ if (ui_desc->port_event)
+ ui_desc->port_event(ui, index, 4, 0, &float_val);
break;
case Atom::STRING:
- cout << "Port value type is a string? (\"" << value.get_string() << "\")" << endl;
+ if (ui_desc->port_event)
+ ui_desc->port_event(ui, index, strlen(value.get_string()), 0, value.get_string());
break;
default:
break;