aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--VERSION2
-rw-r--r--bin/synthpod_bin.c24
-rw-r--r--bin/synthpod_bin.h1
-rw-r--r--plugins/synthpod_common_nk.c10
-rw-r--r--plugins/synthpod_lv2.c14
-rw-r--r--plugins/synthpod_lv2.h2
-rw-r--r--plugins/synthpod_stereo.c24
-rw-r--r--sandbox_ui.lv2/meson.build2
-rw-r--r--sandbox_ui.lv2/sandbox_slave.c24
9 files changed, 70 insertions, 33 deletions
diff --git a/VERSION b/VERSION
index a2d380db..24b7b95b 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.5707
+0.1.5717
diff --git a/bin/synthpod_bin.c b/bin/synthpod_bin.c
index d6317880..45af4aa8 100644
--- a/bin/synthpod_bin.c
+++ b/bin/synthpod_bin.c
@@ -39,8 +39,6 @@
static atomic_bool done = ATOMIC_VAR_INIT(false);
-static atomic_long voice_uuid = ATOMIC_VAR_INIT(1);
-
static uint8_t ui_buf [CHUNK_SIZE]; //FIXME
enum {
@@ -74,14 +72,6 @@ static const char *prefix [2][6] = {
}
};
-__realtime static xpress_uuid_t
-_voice_map_new_uuid(void *handle, uint32_t flag __attribute__((unused)))
-{
- atomic_long *uuid = handle;
-
- return atomic_fetch_add_explicit(uuid, 1, memory_order_relaxed);
-}
-
__realtime static void
_close_request(void *data)
{
@@ -335,6 +325,14 @@ _mapper_free_rt(void *data, char *uri)
// nothing
}
+__realtime static uint32_t
+_voice_map_new_uuid(void *data, uint32_t flags __attribute__((unused)))
+{
+ xpress_t *xpress = data;
+
+ return xpress_map(xpress);
+}
+
__non_realtime void
bin_init(bin_t *bin, uint32_t sample_rate)
{
@@ -356,8 +354,10 @@ bin_init(bin_t *bin, uint32_t sample_rate)
bin->map = mapper_get_map(bin->mapper);
bin->unmap = mapper_get_unmap(bin->mapper);
+ xpress_init(&bin->xpress, 0, bin->map, NULL,
+ XPRESS_EVENT_NONE, NULL, NULL, NULL);
bin->xmap.new_uuid = _voice_map_new_uuid;
- bin->xmap.handle = &voice_uuid;
+ bin->xmap.handle = &bin->xpress;
bin->log_error = bin->map->map(bin->map->handle, LV2_LOG__Error);
bin->log_note = bin->map->map(bin->map->handle, LV2_LOG__Note);
@@ -582,6 +582,8 @@ bin_deinit(bin_t *bin)
cross_clock_deinit(&bin->clk_mono);
cross_clock_deinit(&bin->clk_real);
+
+ xpress_deinit(&bin->xpress);
}
__realtime void
diff --git a/bin/synthpod_bin.h b/bin/synthpod_bin.h
index b5e1babf..b01590fc 100644
--- a/bin/synthpod_bin.h
+++ b/bin/synthpod_bin.h
@@ -66,6 +66,7 @@ struct _bin_t {
mapper_t *mapper;
LV2_URID_Map *map;
LV2_URID_Unmap *unmap;
+ xpress_t xpress;
xpress_map_t xmap;
sp_app_t *app;
diff --git a/plugins/synthpod_common_nk.c b/plugins/synthpod_common_nk.c
index ca570f38..a7e0472e 100644
--- a/plugins/synthpod_common_nk.c
+++ b/plugins/synthpod_common_nk.c
@@ -527,6 +527,8 @@ struct _plughandle_t {
#if defined(USE_CAIRO_CANVAS)
LV2_Canvas canvas;
#endif
+
+ xpress_t xpress;
};
static const char *bundle_search_labels [BUNDLE_SELECTOR_SEARCH_MAX] = {
@@ -7955,6 +7957,8 @@ instantiate(const LV2UI_Descriptor *descriptor, const char *plugin_uri,
void *parent = NULL;
LV2UI_Resize *host_resize = NULL;
LV2_Options_Option *opts = NULL;
+ xpress_map_t *voice_map = NULL;
+
for(int i=0; features[i]; i++)
{
if(!strcmp(features[i]->URI, LV2_UI__parent))
@@ -7965,6 +7969,8 @@ instantiate(const LV2UI_Descriptor *descriptor, const char *plugin_uri,
handle->map = features[i]->data;
else if(!strcmp(features[i]->URI, LV2_URID__unmap))
handle->unmap = features[i]->data;
+ else if(!strcmp(features[i]->URI, XPRESS__voiceMap))
+ voice_map = features[i]->data;
else if(!strcmp(features[i]->URI, LV2_OPTIONS__options))
opts = features[i]->data;
else if(!strcmp(features[i]->URI, LV2_LOG__log))
@@ -7993,6 +7999,9 @@ instantiate(const LV2UI_Descriptor *descriptor, const char *plugin_uri,
return NULL;
}
+ xpress_init(&handle->xpress, 0, handle->map, voice_map,
+ XPRESS_EVENT_NONE, NULL, NULL, NULL); //FIXME use xpress_map()
+
if(handle->log)
lv2_log_logger_init(&handle->logger, handle->map, handle->log);
@@ -8169,6 +8178,7 @@ cleanup(LV2UI_Handle instance)
_hash_free(&handle->param_matches);
_hash_free(&handle->dynam_matches);
+ xpress_deinit(&handle->xpress);
_deinit(handle);
free(handle);
diff --git a/plugins/synthpod_lv2.c b/plugins/synthpod_lv2.c
index 8d00263c..a1a8e7be 100644
--- a/plugins/synthpod_lv2.c
+++ b/plugins/synthpod_lv2.c
@@ -20,20 +20,6 @@
#include <synthpod_lv2.h>
-static atomic_long voice_uuid = ATOMIC_VAR_INIT(INT64_MAX / UINT16_MAX * 3LL);
-
-static xpress_uuid_t
-_voice_map_new_uuid(void *handle, uint32_t flag __attribute__((unused)))
-{
- atomic_long *uuid = handle;
- return atomic_fetch_add_explicit(uuid, 1, memory_order_relaxed);
-}
-
-xpress_map_t voice_map_fallback = {
- .handle = &voice_uuid,
- .new_uuid = _voice_map_new_uuid
-};
-
#ifdef _WIN32
__declspec(dllexport)
#else
diff --git a/plugins/synthpod_lv2.h b/plugins/synthpod_lv2.h
index 4f0b1e96..10529236 100644
--- a/plugins/synthpod_lv2.h
+++ b/plugins/synthpod_lv2.h
@@ -41,8 +41,6 @@
// bundle uri
#define SYNTHPOD_EVENT_URI SYNTHPOD_PREFIX"event"
-extern xpress_map_t voice_map_fallback;
-
// plugin uris
#define SYNTHPOD_KEYBOARD_URI SYNTHPOD_PREFIX"keyboard"
#define SYNTHPOD_CV2CONTROL_URI SYNTHPOD_PREFIX"cv2control"
diff --git a/plugins/synthpod_stereo.c b/plugins/synthpod_stereo.c
index b272b3ad..94d3300d 100644
--- a/plugins/synthpod_stereo.c
+++ b/plugins/synthpod_stereo.c
@@ -130,6 +130,9 @@ struct _plughandle_t {
varchunk_t *app_from_worker;
varchunk_t *app_from_ui;
varchunk_t *app_from_app;
+
+ xpress_t xpress;
+ xpress_map_t xmap;
};
static LV2_State_Status
@@ -342,6 +345,14 @@ _to_app_advance(size_t written, void *data)
varchunk_write_advance(handle->app_from_worker, written);
}
+__realtime static uint32_t
+_voice_map_new_uuid(void *data, uint32_t flags __attribute__((unused)))
+{
+ xpress_t *xpress = data;
+
+ return xpress_map(xpress);
+}
+
static LV2_Handle
instantiate(const LV2_Descriptor* descriptor, double rate,
const char *bundle_path, const LV2_Feature *const *features)
@@ -361,6 +372,7 @@ instantiate(const LV2_Descriptor* descriptor, double rate,
handle->driver.bad_plugins = false; //FIXME
const LilvWorld *world = NULL;
+ xpress_map_t *voice_map = NULL;
for(int i=0; features[i]; i++)
{
@@ -369,7 +381,7 @@ instantiate(const LV2_Descriptor* descriptor, double rate,
else if(!strcmp(features[i]->URI, LV2_URID__unmap))
handle->driver.unmap = (LV2_URID_Unmap *)features[i]->data;
else if(!strcmp(features[i]->URI, XPRESS__voiceMap))
- handle->driver.xmap = features[i]->data;
+ voice_map = features[i]->data;
else if(!strcmp(features[i]->URI, LV2_LOG__log))
handle->driver.log = (LV2_Log_Log *)features[i]->data;
else if(!strcmp(features[i]->URI, LV2_WORKER__schedule))
@@ -386,9 +398,6 @@ instantiate(const LV2_Descriptor* descriptor, double rate,
handle->driver.features |= SP_APP_FEATURE_POWER_OF_2_BLOCK_LENGTH;
}
- if(!handle->driver.xmap)
- handle->driver.xmap = &voice_map_fallback;
-
if(!handle->driver.map)
{
fprintf(stderr,
@@ -415,6 +424,12 @@ instantiate(const LV2_Descriptor* descriptor, double rate,
return NULL;
}
+ xpress_init(&handle->xpress, 0, handle->driver.map, voice_map,
+ XPRESS_EVENT_NONE, NULL, NULL, NULL);
+ handle->xmap.new_uuid = _voice_map_new_uuid;
+ handle->xmap.handle = &handle->xpress;
+ handle->driver.xmap = &handle->xmap;
+
// map URIs
handle->uri.bufsz.max_block_length = handle->driver.map->map(handle->driver.map->handle,
LV2_BUF_SIZE__maxBlockLength);
@@ -928,6 +943,7 @@ cleanup(LV2_Handle instance)
varchunk_free(handle->app_from_worker);
varchunk_free(handle->app_from_ui);
varchunk_free(handle->app_from_app);
+ xpress_deinit(&handle->xpress);
munlock(handle, sizeof(plughandle_t));
free(handle);
diff --git a/sandbox_ui.lv2/meson.build b/sandbox_ui.lv2/meson.build
index b84ac854..40d4ef45 100644
--- a/sandbox_ui.lv2/meson.build
+++ b/sandbox_ui.lv2/meson.build
@@ -4,6 +4,6 @@ sbox_master = static_library('sbox_master', 'sandbox_master.c',
dependencies : [lv2_dep, lilv_dep])
sbox_slave = static_library('sbox_slave', 'sandbox_slave.c',
- include_directories : [varchunk_incs, mapper_incs, netatom_incs],
+ include_directories : [varchunk_incs, mapper_incs, netatom_incs, xpress_incs],
c_args : c_args,
dependencies : [lv2_dep, lilv_dep])
diff --git a/sandbox_ui.lv2/sandbox_slave.c b/sandbox_ui.lv2/sandbox_slave.c
index b8ca5ee8..7d04682c 100644
--- a/sandbox_ui.lv2/sandbox_slave.c
+++ b/sandbox_ui.lv2/sandbox_slave.c
@@ -26,6 +26,8 @@
#include <sandbox_slave.h>
#include <sandbox_io.h>
+#include <xpress.lv2/xpress.h>
+
#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>
@@ -52,6 +54,8 @@ struct _sandbox_slave_t {
LV2UI_Port_Map port_map;
LV2UI_Port_Subscribe port_subscribe;
+ xpress_map_t xmap;
+ xpress_t xpress;
LV2UI_Resize host_resize;
@@ -269,6 +273,14 @@ _sb_uri_to_id(LV2_URI_Map_Callback_Data handle, const char *map, const char *uri
return sb->map->map(sb->map->handle, uri);
}
+static uint32_t
+_voice_map_new_uuid(void *data, uint32_t flags __attribute__((unused)))
+{
+ xpress_t *xpress = data;
+
+ return xpress_map(xpress);
+}
+
sandbox_slave_t *
sandbox_slave_new(int argc, char **argv, const sandbox_slave_driver_t *driver, void *data)
{
@@ -413,6 +425,11 @@ sandbox_slave_new(int argc, char **argv, const sandbox_slave_driver_t *driver, v
sb->log_warning = sb->map->map(sb->map->handle, LV2_LOG__Warning);
sb->log_note = sb->map->map(sb->map->handle, LV2_LOG__Note);
+ xpress_init(&sb->xpress, 0, sb->map, NULL,
+ XPRESS_EVENT_NONE, NULL, NULL, NULL);
+ sb->xmap.new_uuid = _voice_map_new_uuid;
+ sb->xmap.handle = &sb->xpress;
+
if(!(sb->world = lilv_world_new()))
{
fprintf(stderr, "lilv_world_new failed\n");
@@ -550,6 +567,8 @@ sandbox_slave_free(sandbox_slave_t *sb)
if(!sb)
return;
+ xpress_deinit(&sb->xpress);
+
if(sb->desc && sb->desc->cleanup && sb->handle)
sb->desc->cleanup(sb->handle);
@@ -665,6 +684,10 @@ sandbox_slave_instantiate(sandbox_slave_t *sb, const LV2_Feature *parent_feature
.URI = LV2_OPTIONS__options,
.data = options
};
+ const LV2_Feature voice_map_feature = {
+ .URI = XPRESS__voiceMap,
+ .data = &sb->xmap
+ };
const LV2_Feature resize_feature = {
.URI = LV2_UI__resize,
.data = &sb->host_resize
@@ -678,6 +701,7 @@ sandbox_slave_instantiate(sandbox_slave_t *sb, const LV2_Feature *parent_feature
&port_map_feature,
&port_subscribe_feature,
&options_feature,
+ &voice_map_feature,
sb->host_resize.ui_resize ? &resize_feature : parent_feature,
sb->host_resize.ui_resize && parent_feature ? parent_feature : NULL,
NULL