aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--VERSION2
-rw-r--r--include/synthpod_private.h8
-rw-r--r--plugins/synthpod_common_nk.c21
-rw-r--r--sandbox_ui.lv2/sandbox_slave.c20
4 files changed, 50 insertions, 1 deletions
diff --git a/VERSION b/VERSION
index e507ee6b..a735cdfe 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.5003
+0.1.5005
diff --git a/include/synthpod_private.h b/include/synthpod_private.h
index df03dea4..8e78c89c 100644
--- a/include/synthpod_private.h
+++ b/include/synthpod_private.h
@@ -43,6 +43,8 @@
#include <lv2/lv2plug.in/ns/ext/state/state.h>
#include <lv2/lv2plug.in/ns/ext/time/time.h>
#include <lv2/lv2plug.in/ns/ext/parameters/parameters.h>
+#include <lv2/lv2plug.in/ns/ext/instance-access/instance-access.h>
+#include <lv2/lv2plug.in/ns/ext/data-access/data-access.h>
#include <lv2/lv2plug.in/ns/extensions/ui/ui.h>
#include <lv2/lv2plug.in/ns/extensions/units/units.h>
#include <zero_worker.h>
@@ -181,6 +183,8 @@ struct _reg_t {
reg_item_t port_subscribe;
reg_item_t port_index;
reg_item_t update_rate;
+ reg_item_t instance_access;
+ reg_item_t data_access;
} ui;
struct {
@@ -467,6 +471,8 @@ sp_regs_init(reg_t *regs, LilvWorld *world, LV2_URID_Map *map)
_register(&regs->ui.port_subscribe, world, map, LV2_UI__portSubscribe);
_register(&regs->ui.port_index, world, map, LV2_UI__portIndex);
_register(&regs->ui.update_rate, world, map, LV2_UI__updateRate);
+ _register(&regs->ui.instance_access, world, map, LV2_INSTANCE_ACCESS_URI);
+ _register(&regs->ui.data_access, world, map, LV2_DATA_ACCESS_URI);
#ifndef LV2_PRESETS__bank
# define LV2_PRESETS__bank LV2_PRESETS_PREFIX "bank"
@@ -708,6 +714,8 @@ sp_regs_deinit(reg_t *regs)
_unregister(&regs->ui.port_subscribe);
_unregister(&regs->ui.port_index);
_unregister(&regs->ui.update_rate);
+ _unregister(&regs->ui.instance_access);
+ _unregister(&regs->ui.data_access);
_unregister(&regs->pset.preset);
_unregister(&regs->pset.preset_bank);
diff --git a/plugins/synthpod_common_nk.c b/plugins/synthpod_common_nk.c
index 88bdeb77..e02d4f2f 100644
--- a/plugins/synthpod_common_nk.c
+++ b/plugins/synthpod_common_nk.c
@@ -2042,6 +2042,8 @@ _mod_ui_run(mod_ui_t *mod_ui)
mod_ui->sbox.sb = sandbox_master_new(&mod_ui->sbox.driver, mod_ui);
+ printf("exec_uri: %s\n", exec_uri);
+
if(exec_uri && plugin_uri && mod_ui->sbox.bundle_path && mod_ui->uri
&& mod_ui->sbox.socket_uri && mod_ui->sbox.window_name
&& mod_ui->sbox.update_rate && mod_ui->sbox.sb)
@@ -2703,6 +2705,25 @@ _mod_init(plughandle_t *handle, mod_t *mod, const LilvPlugin *plug)
LILV_FOREACH(uis, itr, mod->ui_nodes)
{
const LilvUI *ui = lilv_uis_get(mod->ui_nodes, itr);
+ const LilvNode *ui_uri = lilv_ui_get_uri(ui);
+
+ const bool needs_instance_access = lilv_world_ask(handle->world, ui_uri,
+ handle->regs.core.required_feature.node, handle->regs.ui.instance_access.node);
+ if(needs_instance_access)
+ {
+ fprintf(stderr, "<%s> instance-access extension not supported\n", lilv_node_as_string(ui_uri));
+ continue;
+ }
+
+ const bool needs_data_access = lilv_world_ask(handle->world, ui_uri,
+ handle->regs.core.required_feature.node, handle->regs.ui.data_access.node);
+ if(needs_data_access)
+ {
+ fprintf(stderr, "<%s> data-access extension not supported\n", lilv_node_as_string(ui_uri));
+ continue;
+ }
+
+ //FIXME check for more unsupported features
_mod_ui_add(handle, mod, ui);
}
diff --git a/sandbox_ui.lv2/sandbox_slave.c b/sandbox_ui.lv2/sandbox_slave.c
index 334e05cc..d9de7965 100644
--- a/sandbox_ui.lv2/sandbox_slave.c
+++ b/sandbox_ui.lv2/sandbox_slave.c
@@ -28,6 +28,7 @@
#include <lv2/lv2plug.in/ns/ext/log/log.h>
#include <lv2/lv2plug.in/ns/ext/options/options.h>
+#include <lv2/lv2plug.in/ns/ext/uri-map/uri-map.h>
#include <lv2/lv2plug.in/ns/extensions/ui/ui.h>
#include <lilv/lilv.h>
@@ -41,6 +42,7 @@ struct _sandbox_slave_t {
LV2_URID_Map *map;
LV2_URID_Unmap *unmap;
+ LV2_URI_Map_Feature uri_id;
LV2_Log_Log log;
@@ -169,6 +171,15 @@ _sandbox_recv_cb(LV2UI_Handle handle, uint32_t index, uint32_t size,
sb->desc->port_event(sb->handle, index, size, protocol, buf);
}
+static uint32_t
+_sb_uri_to_id(LV2_URI_Map_Callback_Data handle, const char *map, const char *uri)
+{
+ sandbox_slave_t *sb = handle;
+ (void)map;
+
+ return sb->map->map(sb->map->handle, uri);
+}
+
sandbox_slave_t *
sandbox_slave_new(int argc, char **argv, const sandbox_slave_driver_t *driver, void *data)
{
@@ -257,6 +268,8 @@ sandbox_slave_new(int argc, char **argv, const sandbox_slave_driver_t *driver, v
sb->map = mapper_pool_get_map(&sb->mapper_pool);
sb->unmap = mapper_pool_get_unmap(&sb->mapper_pool);
+ sb->uri_id.callback_data = sb;
+ sb->uri_id.uri_to_id = _sb_uri_to_id;
if(!(sb->world = lilv_world_new()))
{
@@ -470,6 +483,10 @@ sandbox_slave_instantiate(sandbox_slave_t *sb, const LV2_Feature *parent_feature
.URI = LV2_URID__unmap,
.data = sb->unmap
};
+ const LV2_Feature uri_id_feature= {
+ .URI = LV2_URI_MAP_URI,
+ .data = &sb->uri_id
+ };
const LV2_Feature log_feature = {
.URI = LV2_LOG__log,
.data = &sb->log
@@ -494,6 +511,7 @@ sandbox_slave_instantiate(sandbox_slave_t *sb, const LV2_Feature *parent_feature
const LV2_Feature *const features [] = {
&map_feature,
&unmap_feature,
+ &uri_id_feature,
&log_feature,
&port_map_feature,
&port_subscribe_feature,
@@ -503,6 +521,8 @@ sandbox_slave_instantiate(sandbox_slave_t *sb, const LV2_Feature *parent_feature
NULL
};
+ //FIXME check features
+
const LilvNode *ui_bundle_uri = lilv_ui_get_bundle_uri(sb->ui);
#if defined(LILV_0_22)
char *ui_bundle_path = lilv_file_uri_parse(lilv_node_as_string(ui_bundle_uri), NULL);