summaryrefslogtreecommitdiffstats
path: root/src/libs/client
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-09-23 19:32:07 +0000
committerDavid Robillard <d@drobilla.net>2007-09-23 19:32:07 +0000
commitfd53f46a38f6894164e3e91cbfa311af76e8c678 (patch)
treefde2aefdba83f2e6d996729887c1ad93654c4adb /src/libs/client
parent559cc1f3a510b84a5d4ef074fc616b481652b411 (diff)
downloadingen-fd53f46a38f6894164e3e91cbfa311af76e8c678.tar.gz
ingen-fd53f46a38f6894164e3e91cbfa311af76e8c678.tar.bz2
ingen-fd53f46a38f6894164e3e91cbfa311af76e8c678.zip
Update for SLV2 UI interface.
git-svn-id: http://svn.drobilla.net/lad/ingen@774 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/client')
-rw-r--r--src/libs/client/PluginModel.cpp39
1 files changed, 20 insertions, 19 deletions
diff --git a/src/libs/client/PluginModel.cpp b/src/libs/client/PluginModel.cpp
index cfe6d547..e532dd7a 100644
--- a/src/libs/client/PluginModel.cpp
+++ b/src/libs/client/PluginModel.cpp
@@ -20,6 +20,7 @@
#include "PluginModel.hpp"
#include "PatchModel.hpp"
+using namespace std;
using Ingen::Shared::EngineInterface;
namespace Ingen {
@@ -114,36 +115,36 @@ PluginModel::ui(EngineInterface* engine, NodeModel* node)
controller->node = node;
SLV2UIInstance ret = NULL;
+
+ const char* gtk_gui_uri = "http://ll-plugins.nongnu.org/lv2/ext/gui/dev/1#GtkGUI";
- SLV2Values ui = slv2_plugin_get_uis(_slv2_plugin);
- if (slv2_values_size(ui) > 0) {
- printf("\tUIs:\n");
- for (unsigned i=0; i < slv2_values_size(ui); ++i) {
- printf("\t\t%s\n", slv2_value_as_uri(slv2_values_get_at(ui, i)));
+ SLV2PluginUIs uis = slv2_plugin_get_uis(_slv2_plugin);
+ SLV2PluginUI ui = NULL;
- SLV2Value binary = slv2_plugin_get_ui_library_uri(_slv2_plugin, slv2_values_get_at(ui, i));
+ if (slv2_values_size(uis) > 0) {
+ for (unsigned i=0; i < slv2_plugin_uis_size(uis); ++i) {
+ ui = slv2_plugin_uis_get_at(uis, i);
- printf("\t\t\tType: %s\n", slv2_ui_type_get_uri(slv2_value_as_ui_type(
- slv2_values_get_at(ui, i))));
-
- if (binary)
- printf("\t\t\tBinary: %s\n", slv2_value_as_uri(binary));
-
- slv2_value_free(binary);
+ if (slv2_plugin_ui_is_type(ui, gtk_gui_uri)) {
+ break;
+ } else {
+ ui = NULL;
+ }
}
+ }
+
+ if (ui) {
+ cout << "Found GTK Plugin UI " << slv2_plugin_ui_get_uri(ui) << endl;
- if (slv2_values_size(ui) > 1)
- printf("WARNING: Multiple UIs found, using the first...");
-
ret = slv2_plugin_ui_instantiate(_slv2_plugin,
- slv2_values_get_at(ui, 0),
+ ui,
lv2_ui_write, lv2_ui_command,
lv2_ui_program_change, lv2_ui_program_save,
controller, NULL);
+
+ //slv2_plugin_ui_free(ui);
}
- slv2_values_free(ui);
-
return ret;
}