diff options
author | David Robillard <d@drobilla.net> | 2014-02-01 01:02:16 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-02-01 01:02:16 +0000 |
commit | a80964a77a5622c00aa89dfdbdeebee3d202abe3 (patch) | |
tree | 00d68951f2ffd52ef282eb946c6e0b5161f658ab /src/client | |
parent | cc3359a6bea22c3d4584a5d57403e7d568e16fe7 (diff) | |
download | ingen-a80964a77a5622c00aa89dfdbdeebee3d202abe3.tar.gz ingen-a80964a77a5622c00aa89dfdbdeebee3d202abe3.tar.bz2 ingen-a80964a77a5622c00aa89dfdbdeebee3d202abe3.zip |
Check to make sure plugin matches for ui:notifications to avoid redundant messages.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5327 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/PluginUI.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/client/PluginUI.cpp b/src/client/PluginUI.cpp index 0e308abd..4b8651db 100644 --- a/src/client/PluginUI.cpp +++ b/src/client/PluginUI.cpp @@ -209,12 +209,22 @@ PluginUI::create(Ingen::World* world, UI's init() will be sent back to this client. */ LilvWorld* lworld = world->lilv_world(); LilvNode* ui_portNotification = lilv_new_uri(lworld, LV2_UI__portNotification); + LilvNode* ui_plugin = lilv_new_uri(lworld, LV2_UI__plugin); LilvNode* lv2_symbol = lilv_new_uri(lworld, LV2_CORE__symbol); LilvNodes* notes = lilv_world_find_nodes( lworld, lilv_ui_get_uri(ui), ui_portNotification, NULL); LILV_FOREACH(nodes, n, notes) { const LilvNode* note = lilv_nodes_get(notes, n); const LilvNode* sym = lilv_world_get(lworld, note, lv2_symbol, NULL); + const LilvNode* plug = lilv_world_get(lworld, note, ui_plugin, NULL); + if (plug && !lilv_node_is_uri(plug)) { + world->log().error(fmt("%1% UI has non-URI ui:plugin\n") + % block->plugin()->uri().c_str()); + continue; + } + if (plug && strcmp(lilv_node_as_uri(plug), block->plugin()->uri().c_str())) { + continue; // Notification is for another plugin + } if (sym) { uint32_t index = lv2_ui_port_index(ret.get(), lilv_node_as_string(sym)); if (index != LV2UI_INVALID_PORT_INDEX) { @@ -225,6 +235,7 @@ PluginUI::create(Ingen::World* world, } lilv_nodes_free(notes); lilv_node_free(lv2_symbol); + lilv_node_free(ui_plugin); lilv_node_free(ui_portNotification); // Instantiate the actual plugin UI via Suil |