aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--VERSION2
-rw-r--r--bin/synthpod_bin.c3
-rw-r--r--bin/synthpod_ui.in3
-rw-r--r--plugins/synthpod_common_nk.c26
-rw-r--r--sandbox_ui.lv2/sandbox_slave.c64
5 files changed, 69 insertions, 29 deletions
diff --git a/VERSION b/VERSION
index 725939a..bf5f80e 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.5659
+0.1.5661
diff --git a/bin/synthpod_bin.c b/bin/synthpod_bin.c
index 7db0ecc..4a9f063 100644
--- a/bin/synthpod_bin.c
+++ b/bin/synthpod_bin.c
@@ -751,8 +751,9 @@ bin_show(bin_t *bin)
char *const args [] = {
SYNTHPOD_BIN_DIR"synthpod_sandbox_x11",
"-p", SYNTHPOD_STEREO_URI,
- "-b", SYNTHPOD_PLUGIN_DIR,
+ "-P", SYNTHPOD_PLUGIN_DIR,
"-u", SYNTHPOD_ROOT_NK_URI,
+ "-U", SYNTHPOD_PLUGIN_DIR,
"-s", (char *)bin->socket_path,
"-w", wname,
"-r", srate,
diff --git a/bin/synthpod_ui.in b/bin/synthpod_ui.in
index b158c30..e1e57a2 100644
--- a/bin/synthpod_ui.in
+++ b/bin/synthpod_ui.in
@@ -15,8 +15,9 @@ fi
exec ${GDB} synthpod_sandbox_x11 \
-p http://open-music-kontrollers.ch/lv2/synthpod#stereo \
- -b @CMAKE_INSTALL_PREFIX@/lib/lv2/synthpod.lv2/ \
+ -P @prefix@/lib/lv2/synthpod.lv2/ \
-u http://open-music-kontrollers.ch/lv2/synthpod#root_4_nk \
+ -U @prefix@/lib/lv2/synthpod.lv2/ \
-s ${socket} \
-w "Synthpod - ${socket}" \
-r 48000 \
diff --git a/plugins/synthpod_common_nk.c b/plugins/synthpod_common_nk.c
index d18bb46..81b5b78 100644
--- a/plugins/synthpod_common_nk.c
+++ b/plugins/synthpod_common_nk.c
@@ -341,7 +341,8 @@ struct _mod_ui_t {
sandbox_master_driver_t driver;
sandbox_master_t *sb;
char *socket_uri;
- char *bundle_path;
+ char *plugin_bundle_path;
+ char *ui_bundle_path;
char *window_name;
char *sample_rate;
char *update_rate;
@@ -2769,7 +2770,8 @@ _mod_ui_add(plughandle_t *handle, mod_t *mod, const LilvUI *ui)
{
DBG;
const LilvNode *ui_node = lilv_ui_get_uri(ui);
- const LilvNode *bundle_node = lilv_ui_get_bundle_uri(ui);
+ const LilvNode *plugin_bundle_node = lilv_plugin_get_bundle_uri(mod->plug);
+ const LilvNode *ui_bundle_node = lilv_ui_get_bundle_uri(ui);
//lilv_world_load_bundle(handle->world, (LilvNode *)bundle_node);
lilv_world_load_resource(handle->world, ui_node);
@@ -2822,8 +2824,15 @@ _mod_ui_add(plughandle_t *handle, mod_t *mod, const LilvUI *ui)
mod_ui->uri = lilv_node_as_uri(ui_node);
mod_ui->urn = handle->map->map(handle->map->handle, mod_ui->uri);
- const char *bundle_uri = bundle_node ? lilv_node_as_uri(bundle_node) : NULL;
- mod_ui->sbox.bundle_path = lilv_file_uri_parse(bundle_uri, NULL);
+ const char *plugin_bundle_uri = plugin_bundle_node
+ ? lilv_node_as_uri(plugin_bundle_node)
+ : NULL;
+ mod_ui->sbox.plugin_bundle_path = lilv_file_uri_parse(plugin_bundle_uri, NULL);
+
+ const char *ui_bundle_uri = ui_bundle_node
+ ? lilv_node_as_uri(ui_bundle_node)
+ : NULL;
+ mod_ui->sbox.ui_bundle_path = lilv_file_uri_parse(ui_bundle_uri, NULL);
if(asprintf(&mod_ui->sbox.socket_uri, "shm:///synthpod-sandbox-%016"PRIx64, (uint64_t)mod_ui) == -1)
mod_ui->sbox.socket_uri = NULL;
@@ -2898,7 +2907,8 @@ _mod_ui_run(mod_ui_t *mod_ui, bool sync)
//printf("exec_uri: %s\n", exec_uri);
- if(exec_uri && plugin_uri && plugin_urn && mod_ui->sbox.bundle_path && mod_ui->uri
+ if(exec_uri && plugin_uri && plugin_urn && mod_ui->sbox.plugin_bundle_path
+ && mod_ui->sbox.ui_bundle_path && mod_ui->uri
&& mod_ui->sbox.socket_uri && mod_ui->sbox.window_name
&& mod_ui->sbox.sample_rate && mod_ui->sbox.update_rate && mod_ui->sbox.sb)
{
@@ -2914,8 +2924,9 @@ _mod_ui_run(mod_ui_t *mod_ui, bool sync)
(char *)exec_uri,
"-n", (char *)plugin_urn,
"-p", (char *)plugin_uri,
- "-b", mod_ui->sbox.bundle_path,
+ "-P", mod_ui->sbox.plugin_bundle_path,
"-u", (char *)mod_ui->uri,
+ "-U", mod_ui->sbox.ui_bundle_path,
"-s", mod_ui->sbox.socket_uri,
"-w", mod_ui->sbox.window_name,
"-r", mod_ui->sbox.sample_rate,
@@ -2994,7 +3005,8 @@ _mod_ui_free(mod_ui_t *mod_ui)
lilv_world_unload_resource(handle->world, ui_node);
//lilv_world_unload_bundle(handle->world, (LilvNode *)bundle_node);
- lilv_free(mod_ui->sbox.bundle_path);
+ lilv_free(mod_ui->sbox.plugin_bundle_path);
+ lilv_free(mod_ui->sbox.ui_bundle_path);
free(mod_ui->sbox.socket_uri);
free(mod_ui->sbox.window_name);
free(mod_ui->sbox.update_rate);
diff --git a/sandbox_ui.lv2/sandbox_slave.c b/sandbox_ui.lv2/sandbox_slave.c
index 74144a8..a7b2ec4 100644
--- a/sandbox_ui.lv2/sandbox_slave.c
+++ b/sandbox_ui.lv2/sandbox_slave.c
@@ -56,7 +56,8 @@ struct _sandbox_slave_t {
LV2UI_Resize host_resize;
LilvWorld *world;
- LilvNode *bundle_node;
+ LilvNode *plugin_bundle_node;
+ LilvNode *ui_bundle_node;
LilvNode *plugin_node;
LilvNode *ui_node;
@@ -76,8 +77,9 @@ struct _sandbox_slave_t {
const char *plugin_urn;
const char *plugin_uri;
- const char *bundle_path;
+ const char *plugin_bundle_path;
const char *ui_uri;
+ const char *ui_bundle_path;
const char *socket_path;
const char *window_title;
float sample_rate;
@@ -281,7 +283,7 @@ sandbox_slave_new(int argc, char **argv, const sandbox_slave_driver_t *driver, v
sb->update_rate = 25.f; // fall-back
int c;
- while((c = getopt(argc, argv, "n:p:b:u:s:w:r:f:")) != -1)
+ while((c = getopt(argc, argv, "n:p:P:u:U:s:w:r:f:")) != -1)
{
switch(c)
{
@@ -291,12 +293,15 @@ sandbox_slave_new(int argc, char **argv, const sandbox_slave_driver_t *driver, v
case 'p':
sb->plugin_uri = optarg;
break;
- case 'b':
- sb->bundle_path = optarg;
+ case 'P':
+ sb->plugin_bundle_path = optarg;
break;
case 'u':
sb->ui_uri = optarg;
break;
+ case 'U':
+ sb->ui_bundle_path = optarg;
+ break;
case 's':
sb->socket_path = optarg;
break;
@@ -310,7 +315,7 @@ sandbox_slave_new(int argc, char **argv, const sandbox_slave_driver_t *driver, v
sb->update_rate = atof(optarg);
break;
case '?':
- if( (optopt == 'n') || (optopt == 'p') || (optopt == 'b') || (optopt == 'u') || (optopt == 's') || (optopt == 'w') || (optopt == 'r') || (optopt == 'f') )
+ if( (optopt == 'n') || (optopt == 'p') || (optopt == 'P') || (optopt == 'u') || (optopt == 'U') || (optopt == 's') || (optopt == 'w') || (optopt == 'r') || (optopt == 'f') )
fprintf(stderr, "Option `-%c' requires an argument.\n", optopt);
else if(isprint(optopt))
fprintf(stderr, "Unknown option `-%c'.\n", optopt);
@@ -323,8 +328,9 @@ sandbox_slave_new(int argc, char **argv, const sandbox_slave_driver_t *driver, v
}
if( !sb->plugin_uri
- || !sb->bundle_path
+ || !sb->plugin_bundle_path
|| !sb->ui_uri
+ || !sb->ui_bundle_path
|| !sb->socket_path)
{
fprintf(stderr, "not enough arguments\n");
@@ -370,17 +376,28 @@ sandbox_slave_new(int argc, char **argv, const sandbox_slave_driver_t *driver, v
goto fail;
}
- sb->bundle_node = lilv_new_file_uri(sb->world, NULL, sb->bundle_path);
+ sb->plugin_bundle_node = lilv_new_file_uri(sb->world, NULL, sb->plugin_bundle_path);
+ if(strcmp(sb->plugin_bundle_path, sb->ui_bundle_path))
+ {
+ sb->ui_bundle_node = lilv_new_file_uri(sb->world, NULL, sb->ui_bundle_path);
+ }
+
sb->plugin_node = lilv_new_uri(sb->world, sb->plugin_uri);
sb->ui_node = lilv_new_uri(sb->world, sb->ui_uri);
- if(!sb->bundle_node || !sb->plugin_node || !sb->ui_node)
+ if(!sb->plugin_bundle_node || !sb->plugin_node || !sb->ui_node)
{
fprintf(stderr, "lilv_new_uri failed\n");
goto fail;
}
- lilv_world_load_bundle(sb->world, sb->bundle_node);
+ lilv_world_load_bundle(sb->world, sb->plugin_bundle_node);
+ if(sb->ui_bundle_node)
+ {
+ lilv_world_load_bundle(sb->world, sb->ui_bundle_node);
+ }
+
+ lilv_world_load_resource(sb->world, sb->plugin_node);
lilv_world_load_resource(sb->world, sb->ui_node);
const LilvPlugins *plugins = lilv_world_get_all_plugins(sb->world);
@@ -513,14 +530,23 @@ sandbox_slave_free(sandbox_slave_t *sb)
lilv_node_free(sb->ui_node);
}
- if(sb->bundle_node)
+ if(sb->plugin_node)
+ {
+ lilv_world_unload_resource(sb->world, sb->plugin_node);
+ lilv_node_free(sb->plugin_node);
+ }
+
+ if(sb->ui_bundle_node)
{
- lilv_world_unload_bundle(sb->world, sb->bundle_node);
- lilv_node_free(sb->bundle_node);
+ lilv_world_unload_bundle(sb->world, sb->ui_bundle_node);
+ lilv_node_free(sb->ui_bundle_node);
}
- if(sb->plugin_node)
- lilv_node_free(sb->plugin_node);
+ if(sb->plugin_bundle_node)
+ {
+ lilv_world_unload_bundle(sb->world, sb->plugin_bundle_node);
+ lilv_node_free(sb->plugin_bundle_node);
+ }
lilv_world_free(sb->world);
}
@@ -617,19 +643,19 @@ sandbox_slave_instantiate(sandbox_slave_t *sb, const LV2_Feature *parent_feature
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);
+ char *ui_plugin_bundle_path = lilv_file_uri_parse(lilv_node_as_string(ui_bundle_uri), NULL);
#else
- const char *ui_bundle_path = lilv_uri_to_path(lilv_node_as_string(ui_bundle_uri));
+ const char *ui_plugin_bundle_path = lilv_uri_to_path(lilv_node_as_string(ui_bundle_uri));
#endif
if(sb->desc && sb->desc->instantiate)
{
sb->handle = sb->desc->instantiate(sb->desc, sb->plugin_uri,
- ui_bundle_path, _write_function, sb, widget, features);
+ ui_plugin_bundle_path, _write_function, sb, widget, features);
}
#if defined(LILV_0_22)
- lilv_free(ui_bundle_path);
+ lilv_free(ui_plugin_bundle_path);
#endif
if(sb->handle)