summaryrefslogtreecommitdiffstats
path: root/src/client
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/client
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/client')
-rw-r--r--src/client/PluginUI.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/client/PluginUI.cpp b/src/client/PluginUI.cpp
index 01e1cb77..9bd3a195 100644
--- a/src/client/PluginUI.cpp
+++ b/src/client/PluginUI.cpp
@@ -53,14 +53,21 @@ lv2_ui_write(SuilController controller,
// float (special case, always 0)
if (format == 0) {
- assert(buffer_size == 4);
- if (*(const float*)buffer == port->value().get<float>())
- return; // do nothing (handle stupid plugin UIs that feed back)
+ if (buffer_size != 4) {
+ ui->world()->log().error(
+ Raul::fmt("%1% UI wrote corrupt float with bad size\n")
+ % ui->block()->plugin()->uri().c_str());
+ return;
+ }
+ const float value = *(const float*)buffer;
+ if (value == port->value().get<float>()) {
+ return; // Ignore feedback
+ }
ui->world()->interface()->set_property(
port->uri(),
uris.ingen_value,
- ui->world()->forge().make(*(const float*)buffer));
+ ui->world()->forge().make(value));
} else if (format == uris.atom_eventTransfer.id) {
const LV2_Atom* atom = (const LV2_Atom*)buffer;