summaryrefslogtreecommitdiffstats
path: root/src/libs/client/PluginUI.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-05-20 00:30:50 +0000
committerDavid Robillard <d@drobilla.net>2008-05-20 00:30:50 +0000
commit1c746982c4d1b18308ce549852d8ecd83d612db5 (patch)
treeaca8ac8b6a6e3937277efc1c0961c29a1c84bbc2 /src/libs/client/PluginUI.cpp
parent239825b92b1d4c79ebd67cb3766355bf8e699bc7 (diff)
downloadingen-1c746982c4d1b18308ce549852d8ecd83d612db5.tar.gz
ingen-1c746982c4d1b18308ce549852d8ecd83d612db5.tar.bz2
ingen-1c746982c4d1b18308ce549852d8ecd83d612db5.zip
Fix various problems with control port values.
Fix control port feedback issues with LV2 plugin UIs. git-svn-id: http://svn.drobilla.net/lad/ingen@1218 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/client/PluginUI.cpp')
-rw-r--r--src/libs/client/PluginUI.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/libs/client/PluginUI.cpp b/src/libs/client/PluginUI.cpp
index 5215de25..9dcbfcba 100644
--- a/src/libs/client/PluginUI.cpp
+++ b/src/libs/client/PluginUI.cpp
@@ -16,12 +16,14 @@
*/
#include <iostream>
+#include "shared/LV2URIMap.hpp"
#include "PluginUI.hpp"
#include "NodeModel.hpp"
#include "PortModel.hpp"
using namespace std;
using Ingen::Shared::EngineInterface;
+using Ingen::Shared::LV2URIMap;
namespace Ingen {
namespace Client {
@@ -33,6 +35,7 @@ lv2_ui_write(LV2UI_Controller controller,
uint32_t format,
const void* buffer)
{
+#if 0
cerr << "********* LV2 UI WRITE (FORMAT " << format << "):" << endl;
/*lv2_osc_message_print((const LV2Message*)buffer);*/
@@ -45,16 +48,24 @@ lv2_ui_write(LV2UI_Controller controller,
fprintf(stderr, "%2X ", ((unsigned char*)buffer)[i]);
}
fprintf(stderr, "\n");
+#endif
PluginUI* ui = (PluginUI*)controller;
SharedPtr<PortModel> port = ui->node()->ports()[port_index];
- if (format == 0) {
- ui->world()->engine->set_port_value_immediate(port->path(),
- port->type().uri(),
- buffer_size, buffer);
+ LV2URIMap* map = (LV2URIMap*)ui->world()->lv2_features->feature(LV2_URI_MAP_URI);
+ assert(map);
+
+ if (format == 0) { // float (special case)
+ assert(buffer_size == 4);
+ if (*(float*)buffer == port->value().get_float())
+ return; // do nothing (handle stupid plugin UIs that feed back)
}
+
+ ui->world()->engine->set_port_value_immediate(port->path(),
+ port->type().uri(),
+ buffer_size, buffer);
}