summaryrefslogtreecommitdiffstats
path: root/src/plugin.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugin.c')
-rw-r--r--src/plugin.c56
1 files changed, 44 insertions, 12 deletions
diff --git a/src/plugin.c b/src/plugin.c
index 6e09161..80f59a5 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -33,12 +33,13 @@
/* private */
SLV2Plugin
-slv2_plugin_new(SLV2World world, librdf_uri* uri, const char* binary_uri)
+slv2_plugin_new(SLV2World world, librdf_uri* uri, librdf_uri* bundle_uri, librdf_uri* binary_uri)
{
struct _SLV2Plugin* plugin = malloc(sizeof(struct _SLV2Plugin));
plugin->world = world;
plugin->plugin_uri = librdf_new_uri_from_uri(uri);
- plugin->binary_uri = strdup(binary_uri);
+ plugin->bundle_uri = librdf_new_uri_from_uri(bundle_uri);
+ plugin->binary_uri = librdf_new_uri_from_uri(binary_uri);
plugin->plugin_class = NULL;
plugin->data_uris = slv2_values_new();
plugin->ports = raptor_new_sequence((void (*)(void*))&slv2_port_free, NULL);
@@ -56,8 +57,11 @@ slv2_plugin_free(SLV2Plugin p)
librdf_free_uri(p->plugin_uri);
p->plugin_uri = NULL;
- //free(p->bundle_url);
- free(p->binary_uri);
+ librdf_free_uri(p->bundle_uri);
+ p->bundle_uri = NULL;
+
+ librdf_free_uri(p->binary_uri);
+ p->binary_uri = NULL;
raptor_free_sequence(p->ports);
p->ports = NULL;
@@ -73,6 +77,7 @@ slv2_plugin_free(SLV2Plugin p)
}
slv2_values_free(p->data_uris);
+ p->data_uris = NULL;
free(p);
}
@@ -238,17 +243,24 @@ slv2_plugin_get_uri(SLV2Plugin p)
}
-SLV2Values
-slv2_plugin_get_data_uris(SLV2Plugin p)
+const char*
+slv2_plugin_get_bundle_uri(SLV2Plugin p)
{
- return p->data_uris;
+ return (const char*)librdf_uri_as_string(p->bundle_uri);
}
const char*
slv2_plugin_get_library_uri(SLV2Plugin p)
{
- return p->binary_uri;
+ return (const char*)librdf_uri_as_string(p->binary_uri);
+}
+
+
+SLV2Values
+slv2_plugin_get_data_uris(SLV2Plugin p)
+{
+ return p->data_uris;
}
@@ -387,22 +399,25 @@ slv2_plugin_get_value_for_subject(SLV2Plugin p,
/* Hack around broken RASQAL, full URI predicates don't work :/ */
+ char* subject_token = slv2_value_get_turtle_token(subject);
+
if (predicate_type == SLV2_URI) {
query = slv2_strjoin(
"PREFIX slv2predicate: <", predicate, ">",
"SELECT DISTINCT ?value WHERE { \n",
- slv2_value_get_turtle_token(subject), " slv2predicate: ?value \n"
+ subject_token, " slv2predicate: ?value \n"
"}\n", NULL);
} else {
query = slv2_strjoin(
"SELECT DISTINCT ?value WHERE { \n",
- slv2_value_get_turtle_token(subject), " ", predicate, " ?value \n"
+ subject_token, " ", predicate, " ?value \n"
"}\n", NULL);
}
SLV2Values result = slv2_plugin_simple_query(p, query, 0);
free(query);
+ free(subject_token);
return result;
}
@@ -442,9 +457,11 @@ slv2_plugin_has_latency(SLV2Plugin p)
" lv2:index ?index .\n"
"}\n";
- SLV2Values result = slv2_plugin_simple_query(p, query, 0);
+ SLV2Values results = slv2_plugin_simple_query(p, query, 0);
+ const bool latent = (slv2_values_size(results) > 0);
+ slv2_values_free(results);
- return (slv2_values_size(result) > 0);
+ return latent;
}
@@ -599,3 +616,18 @@ slv2_gui_type_get_uri(SLV2GUIType type)
return "http://ll-plugins.nongnu.org/lv2/ext/gtk2gui";
}
+
+void*
+slv2_plugin_load_gui(SLV2Plugin plugin,
+ SLV2Value gui)
+{
+ SLV2Value lib_uri = slv2_plugin_get_gui_library_uri(plugin, gui);
+
+ if (!lib_uri)
+ return NULL;
+
+ //LV2UI_Handle handle =
+ //
+ return NULL;
+}
+