summaryrefslogtreecommitdiffstats
path: root/src/libs/gui/NodeModule.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-08-17 18:58:24 +0000
committerDavid Robillard <d@drobilla.net>2008-08-17 18:58:24 +0000
commit602e31074b30167baace71ccfff1f58a6b3f0626 (patch)
treeeb7b85c99532af48adfe6322e2b620ac31c62f76 /src/libs/gui/NodeModule.cpp
parent0e47cf5e7153a96875a64754291fad1cdbf26da7 (diff)
downloadingen-602e31074b30167baace71ccfff1f58a6b3f0626.tar.gz
ingen-602e31074b30167baace71ccfff1f58a6b3f0626.tar.bz2
ingen-602e31074b30167baace71ccfff1f58a6b3f0626.zip
More serialization work.
Preliminary copy/paste (nodes only) git-svn-id: http://svn.drobilla.net/lad/ingen@1418 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/gui/NodeModule.cpp')
-rw-r--r--src/libs/gui/NodeModule.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/libs/gui/NodeModule.cpp b/src/libs/gui/NodeModule.cpp
index fe71dd2f..7ac86e40 100644
--- a/src/libs/gui/NodeModule.cpp
+++ b/src/libs/gui/NodeModule.cpp
@@ -104,13 +104,17 @@ NodeModule::create(boost::shared_ptr<PatchCanvas> canvas, SharedPtr<NodeModel> n
void
NodeModule::value_changed(uint32_t index, const Atom& value)
{
- 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);
+ if (value.type() == Atom::FLOAT) {
+ 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);
+ }
+ } else {
+ cerr << "WARNING: Unknown value type " << (int)value.type() << endl;
}
}