diff options
author | David Robillard <d@drobilla.net> | 2011-02-22 20:14:58 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-02-22 20:14:58 +0000 |
commit | 21517678d85f34d3369f58c03cbb9fddca1b5d06 (patch) | |
tree | 8eda62e31210bf608f46e40fc302185bc899a398 | |
parent | 0963d40dec95931690ed05585443807cae3d630e (diff) | |
download | ingen-21517678d85f34d3369f58c03cbb9fddca1b5d06.tar.gz ingen-21517678d85f34d3369f58c03cbb9fddca1b5d06.tar.bz2 ingen-21517678d85f34d3369f58c03cbb9fddca1b5d06.zip |
Implement sane UI selection logic and separate it from instantiation.
Cleaner instantiation code.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3013 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r-- | src/client/PluginUI.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/client/PluginUI.cpp b/src/client/PluginUI.cpp index 29ecfa74..0411222b 100644 --- a/src/client/PluginUI.cpp +++ b/src/client/PluginUI.cpp @@ -130,17 +130,21 @@ PluginUI::create(Ingen::Shared::World* world, for (unsigned i = 0; i < slv2_uis_size(slv2_uis); ++i) { SLV2UI ui = slv2_uis_get_at(slv2_uis, i); SLV2Values classes = slv2_ui_get_classes(ui); - SLV2Value type = slv2_values_get_at(classes, 0); // FIXME? - if (!suil_ui_type_supported(slv2_value_as_uri(type))) { - warn << "Unsupported LV2 UI type " << slv2_value_as_uri(type) << endl; - continue; + for (unsigned j = 0; j < slv2_values_size(classes); ++j) { + SLV2Value type = slv2_values_get_at(classes, j); + if (suil_ui_type_supported("http://lv2plug.in/ns/extensions/ui#GtkUI", + slv2_value_as_uri(type))) { + suil_uis_add( + suil_uis, + slv2_value_as_uri(slv2_ui_get_uri(ui)), + slv2_value_as_uri(type), + slv2_uri_to_path(slv2_value_as_uri(slv2_ui_get_bundle_uri(ui))), + slv2_uri_to_path(slv2_value_as_uri(slv2_ui_get_binary_uri(ui)))); + break; + } else { + warn << "Unsupported LV2 UI type " << slv2_value_as_uri(type) << endl; + } } - - suil_uis_add(suil_uis, - slv2_value_as_uri(slv2_ui_get_uri(ui)), - slv2_value_as_uri(type), - slv2_uri_to_path(slv2_value_as_uri(slv2_ui_get_bundle_uri(ui))), - slv2_uri_to_path(slv2_value_as_uri(slv2_ui_get_binary_uri(ui)))); } // Attempt to instantiate a UI |