aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--VERSION2
-rw-r--r--app/meson.build7
-rw-r--r--app/synthpod_app.c110
-rw-r--r--app/synthpod_app_mod.c99
-rw-r--r--app/synthpod_app_port.c83
-rw-r--r--app/synthpod_app_private.h7
-rw-r--r--app/synthpod_app_state.c307
-rw-r--r--app/synthpod_app_ui.c401
-rw-r--r--app/synthpod_app_worker.c27
-rw-r--r--bin/synthpod_bin.c4
-rw-r--r--bin/synthpod_sandbox_gtk.c1
-rw-r--r--bin/synthpod_sandbox_kx.c1
-rw-r--r--bin/synthpod_sandbox_qt.cpp1
-rw-r--r--bin/synthpod_sandbox_show.c1
-rw-r--r--bin/synthpod_sandbox_x11_driver.c30
-rw-r--r--bin/synthpod_stat.c560
-rw-r--r--include/synthpod_patcher.h183
-rw-r--r--include/synthpod_private.h1906
-rw-r--r--include/synthpod_stat.h525
-rw-r--r--meson.build1
-rw-r--r--plugins/meson.build2
-rw-r--r--plugins/synthpod_common_d2tk.c208
-rw-r--r--plugins/synthpod_common_nk.c1123
-rw-r--r--plugins/synthpod_keyboard_nk.c21
-rw-r--r--plugins/synthpod_stereo.c9
-rw-r--r--plugins/synthpod_ui.ttl20
-rw-r--r--sandbox_ui.lv2/meson.build8
-rw-r--r--sandbox_ui.lv2/sandbox_slave.c73
-rw-r--r--sandbox_ui.lv2/sandbox_slave.h2
29 files changed, 2416 insertions, 3306 deletions
diff --git a/VERSION b/VERSION
index 33c4e31f..ee7435c4 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.6485
+0.1.6505
diff --git a/app/meson.build b/app/meson.build
index da6b8fea..87ef319c 100644
--- a/app/meson.build
+++ b/app/meson.build
@@ -3,11 +3,12 @@ srcs = ['synthpod_app.c',
'synthpod_app_port.c',
'synthpod_app_state.c',
'synthpod_app_ui.c',
- 'synthpod_app_worker.c'
+ 'synthpod_app_worker.c',
+ join_paths('..', 'bin', 'synthpod_stat.c')
]
-incs = [inc_incs, app_incs, canvas_incs, xpress_incs, osc_incs, extui_incs, ardour_incs, varchunk_incs, crossclock_incs]
-deps = [m_dep, rt_dep, lv2_dep, thread_dep, lilv_dep, sratom_dep]
+incs = [inc_incs, app_incs, canvas_incs, xpress_incs, osc_incs, canvas_incs, extui_incs, ardour_incs, varchunk_incs, crossclock_incs]
+deps = [m_dep, rt_dep, lv2_dep, thread_dep, lilv_dep, sratom_dep, serd_dep]
app = static_library('synthpod_app', srcs,
include_directories : incs,
diff --git a/app/synthpod_app.c b/app/synthpod_app.c
index 221460fb..f17ed2a4 100644
--- a/app/synthpod_app.c
+++ b/app/synthpod_app.c
@@ -17,6 +17,7 @@
#include <synthpod_app_private.h>
#include <synthpod_patcher.h>
+#include <synthpod_stat.h>
#include <osc.lv2/util.h>
#include <osc.lv2/forge.h>
@@ -121,19 +122,6 @@ sp_app_get_system_sinks(sp_app_t *app)
return app->system_sinks;
}
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-__non_realtime static uint32_t
-_uri_to_id(LV2_URI_Map_Callback_Data handle, const char *_, const char *uri)
-{
- sp_app_t *app = handle;
-
- LV2_URID_Map *map = app->driver->map;
-
- return map->map(map->handle, uri);
-}
-#pragma GCC diagnostic pop
-
__realtime static inline bool
_sp_app_has_source_automations(mod_t *mod)
{
@@ -204,7 +192,7 @@ _sp_app_automation_out(sp_app_t *app, LV2_Atom_Forge *forge, auto_t *automation,
ref = lv2_atom_forge_frame_time(forge, frames);
if(ref)
- ref = lv2_atom_forge_atom(forge, 3, app->regs.port.midi.urid);
+ ref = lv2_atom_forge_atom(forge, 3, MIDI__MidiEvent);
if(ref)
ref = lv2_atom_forge_write(forge, msg, 3);
}
@@ -244,7 +232,7 @@ _sp_app_process_single_run(mod_t *mod, uint32_t nsamples)
{
LV2_Atom_Sequence *seq = PORT_BASE_ALIGNED(port);
seq->atom.size = port->size;
- seq->atom.type = app->forge.Sequence;
+ seq->atom.type = ATOM__Sequence;
seq->body.unit = 0;
seq->body.pad = 0;
}
@@ -344,17 +332,17 @@ _sp_app_process_single_run(mod_t *mod, uint32_t nsamples)
continue;
}
- if(obj->body.otype == app->regs.patch.set.urid)
+ if(obj->body.otype == PATCH__Set)
{
const LV2_Atom_URID *patch_property = NULL;
const LV2_Atom *patch_value = NULL;
lv2_atom_object_get(obj,
- app->regs.patch.property.urid, &patch_property,
- app->regs.patch.value.urid, &patch_value,
+ PATCH__property, &patch_property,
+ PATCH__value, &patch_value,
0);
- if(!patch_property || (patch_property->atom.type != forge.URID) || !patch_value)
+ if(!patch_property || (patch_property->atom.type != ATOM__URID) || !patch_value)
{
continue;
}
@@ -364,15 +352,15 @@ _sp_app_process_single_run(mod_t *mod, uint32_t nsamples)
{
double val = 0.0;
- if(patch_value->type == forge.Bool)
+ if(patch_value->type == ATOM__Bool)
val = ((const LV2_Atom_Bool *)patch_value)->body;
- else if(patch_value->type == forge.Int)
+ else if(patch_value->type == ATOM__Int)
val = ((const LV2_Atom_Int *)patch_value)->body;
- else if(patch_value->type == forge.Long)
+ else if(patch_value->type == ATOM__Long)
val = ((const LV2_Atom_Long *)patch_value)->body;
- else if(patch_value->type == forge.Float)
+ else if(patch_value->type == ATOM__Float)
val = ((const LV2_Atom_Float *)patch_value)->body;
- else if(patch_value->type == forge.Double)
+ else if(patch_value->type == ATOM__Double)
val = ((const LV2_Atom_Double *)patch_value)->body;
//FIXME support more types
@@ -384,12 +372,12 @@ _sp_app_process_single_run(mod_t *mod, uint32_t nsamples)
t0 = ev->time.frames;
}
}
- else if(obj->body.otype == app->regs.patch.put.urid)
+ else if(obj->body.otype == PATCH__Put)
{
const LV2_Atom_Object *patch_body = NULL;
lv2_atom_object_get(obj,
- app->regs.patch.body.urid, &patch_body,
+ PATCH__body, &patch_body,
0);
if(!patch_body || !lv2_atom_forge_is_object_type(&forge, patch_body->atom.type))
@@ -407,15 +395,15 @@ _sp_app_process_single_run(mod_t *mod, uint32_t nsamples)
{
double val = 0.0;
- if(patch_value->type == forge.Bool)
+ if(patch_value->type == ATOM__Bool)
val = ((const LV2_Atom_Bool *)patch_value)->body;
- else if(patch_value->type == forge.Int)
+ else if(patch_value->type == ATOM__Int)
val = ((const LV2_Atom_Int *)patch_value)->body;
- else if(patch_value->type == forge.Long)
+ else if(patch_value->type == ATOM__Long)
val = ((const LV2_Atom_Long *)patch_value)->body;
- else if(patch_value->type == forge.Float)
+ else if(patch_value->type == ATOM__Float)
val = ((const LV2_Atom_Float *)patch_value)->body;
- else if(patch_value->type == forge.Double)
+ else if(patch_value->type == ATOM__Double)
val = ((const LV2_Atom_Double *)patch_value)->body;
//FIXME support more types
@@ -467,12 +455,12 @@ _sync_midi_automation_to_ui(sp_app_t *app, mod_t *mod, auto_t *automation)
{
const LV2_URID subj = 0; //FIXME
const int32_t sn = 0; //FIXME
- const LV2_URID prop = app->regs.synthpod.automation_list.urid;
+ const LV2_URID prop = SYNTHPOD__automationList;
port_t *port = &mod->ports[automation->index]; //FIXME handle prop
LV2_Atom_Forge_Frame frame [3];
LV2_Atom_Forge_Ref ref = synthpod_patcher_add_object(
- &app->regs, &app->forge, &frame[0], subj, sn, prop);
+ &app->forge, &frame[0], subj, sn, prop);
if(ref)
ref = _sp_app_forge_midi_automation(app, &frame[2], mod, port, automation);
@@ -501,12 +489,12 @@ _sync_osc_automation_to_ui(sp_app_t *app, mod_t *mod, auto_t *automation)
{
const LV2_URID subj = 0; //FIXME
const int32_t sn = 0; //FIXME
- const LV2_URID prop = app->regs.synthpod.automation_list.urid;
+ const LV2_URID prop = SYNTHPOD__automationList;
port_t *port = &mod->ports[automation->index]; //FIXME handle prop
LV2_Atom_Forge_Frame frame [3];
LV2_Atom_Forge_Ref ref = synthpod_patcher_add_object(
- &app->regs, &app->forge, &frame[0], subj, sn, prop);
+ &app->forge, &frame[0], subj, sn, prop);
if(ref)
ref = _sp_app_forge_osc_automation(app, &frame[2], mod, port, automation);
@@ -591,8 +579,8 @@ _sp_app_process_single_post(mod_t *mod, uint32_t nsamples, bool sparse_update_ti
{
LV2_Atom_Forge_Frame frame [3];
- LV2_Atom_Forge_Ref ref = synthpod_patcher_set_object(&app->regs, &app->forge, &frame[0],
- mod->urn, 0, app->regs.idisp.surface.urid); //TODO seqn
+ LV2_Atom_Forge_Ref ref = synthpod_patcher_set_object(&app->forge, &frame[0],
+ mod->urn, 0, INLINEDISPLAY__surface); //TODO seqn
if(ref)
ref = lv2_atom_forge_tuple(&app->forge, &frame[1]);
if(ref)
@@ -600,7 +588,7 @@ _sp_app_process_single_post(mod_t *mod, uint32_t nsamples, bool sparse_update_ti
if(ref)
ref = lv2_atom_forge_int(&app->forge, surf->height);
if(ref)
- ref = lv2_atom_forge_vector_head(&app->forge, &frame[2], sizeof(int32_t), app->forge.Int);
+ ref = lv2_atom_forge_vector_head(&app->forge, &frame[2], sizeof(int32_t), ATOM__Int);
if(surf->stride == surf->width * sizeof(uint32_t))
{
if(ref)
@@ -957,7 +945,7 @@ sp_app_new(const LilvWorld *world, sp_app_driver_t *driver, void *data)
app->plugs = lilv_world_get_all_plugins(app->world);
lv2_atom_forge_init(&app->forge, app->driver->map);
- sp_regs_init(&app->regs, app->world, app->driver->map);
+ sp_regs_init(app->regs, app->world);
_sp_app_populate(app);
@@ -966,10 +954,6 @@ sp_app_new(const LilvWorld *world, sp_app_driver_t *driver, void *data)
app->ramp_samples = driver->sample_rate / 10; // ramp over 0.1s FIXME make this configurable
- // populate uri_to_id
- app->uri_to_id.callback_data = app;
- app->uri_to_id.uri_to_id = _uri_to_id;
-
app->sratom = sratom_new(app->driver->map);
if(app->sratom)
sratom_set_pretty_numbers(app->sratom, false);
@@ -1052,7 +1036,7 @@ sp_app_run_pre(sp_app_t *app, uint32_t nsamples)
{
LV2_Atom_Sequence *seq = PORT_BASE_ALIGNED(port);
seq->atom.size = sizeof(LV2_Atom_Sequence_Body); // empty sequence
- seq->atom.type = app->regs.port.sequence.urid;
+ seq->atom.type = ATOM__Sequence;
seq->body.unit = 0;
seq->body.pad = 0;
}
@@ -1238,8 +1222,8 @@ sp_app_run_post(sp_app_t *app, uint32_t nsamples)
: app->dsp_master.concurrent;
LV2_Atom_Forge_Ref ref = synthpod_patcher_set(
- &app->regs, &app->forge, 0, 0, app->regs.synthpod.cpus_used.urid,
- sizeof(int32_t), app->forge.Int, &cpus_used); //TODO subj, seqn
+ &app->forge, 0, 0, SYNTHPOD__CPUsUsed,
+ sizeof(int32_t), ATOM__Int, &cpus_used); //TODO subj, seqn
if(ref)
{
_sp_app_to_ui_advance_atom(app, answer);
@@ -1274,9 +1258,9 @@ sp_app_run_post(sp_app_t *app, uint32_t nsamples)
LV2_Atom_Forge_Frame frame [1];
LV2_Atom_Forge_Ref ref = synthpod_patcher_set_object(
- &app->regs, &app->forge, &frame[0], mod->urn, 0, app->regs.synthpod.module_profiling.urid); //TODO seqn
+ &app->forge, &frame[0], mod->urn, 0, SYNTHPOD__moduleProfiling); //TODO seqn
if(ref)
- ref = lv2_atom_forge_vector(&app->forge, sizeof(float), app->forge.Float, 3, vec);
+ ref = lv2_atom_forge_vector(&app->forge, sizeof(float), ATOM__Float, 3, vec);
if(ref)
{
synthpod_patcher_pop(&app->forge, frame, 1);
@@ -1312,9 +1296,9 @@ sp_app_run_post(sp_app_t *app, uint32_t nsamples)
LV2_Atom_Forge_Frame frame [1];
LV2_Atom_Forge_Ref ref = synthpod_patcher_set_object(
- &app->regs, &app->forge, &frame[0], 0, 0, app->regs.synthpod.dsp_profiling.urid); //TODO subj, seqn
+ &app->forge, &frame[0], 0, 0, SYNTHPOD__DSPProfiling); //TODO subj, seqn
if(ref)
- ref = lv2_atom_forge_vector(&app->forge, sizeof(float), app->forge.Float, 3, vec);
+ ref = lv2_atom_forge_vector(&app->forge, sizeof(float), ATOM__Float, 3, vec);
if(ref)
{
synthpod_patcher_pop(&app->forge, frame, 1);
@@ -1386,7 +1370,7 @@ sp_app_free(sp_app_t *app)
for(unsigned m=0; m<app->num_mods; m++)
_sp_app_mod_del(app, app->mods[m]);
- sp_regs_deinit(&app->regs);
+ sp_regs_deinit(app->regs);
if(!app->embedded)
lilv_world_free(app->world);
@@ -1476,9 +1460,9 @@ sp_app_nominal_block_length(sp_app_t *app, uint32_t nsamples)
const LV2_Options_Option options [2] = {{
.context = LV2_OPTIONS_INSTANCE,
.subject = 0, // is ignored
- .key = app->regs.bufsz.min_block_length.urid,
+ .key = BUF_SIZE__minBlockLength,
.size = sizeof(int32_t),
- .type = app->forge.Int,
+ .type = ATOM__Int,
.value = &app->driver->min_block_size
}, {
.key = 0, // sentinel
@@ -1495,9 +1479,9 @@ sp_app_nominal_block_length(sp_app_t *app, uint32_t nsamples)
const LV2_Options_Option options [2] = {{
.context = LV2_OPTIONS_INSTANCE,
.subject = 0, // is ignored
- .key = app->regs.bufsz.nominal_block_length.urid,
+ .key = BUF_SIZE__nominalBlockLength,
.size = sizeof(int32_t),
- .type = app->forge.Int,
+ .type = ATOM__Int,
.value = &nominal_block_length
}, {
.key = 0, // sentinel
@@ -1525,10 +1509,10 @@ int
sp_app_com_event(sp_app_t *app, LV2_URID otype)
{
// it is a com event, if it is not an official port protocol
- if( (otype == app->regs.port.float_protocol.urid)
- || (otype == app->regs.port.peak_protocol.urid)
- || (otype == app->regs.port.atom_transfer.urid)
- || (otype == app->regs.port.event_transfer.urid) )
+ if( (otype == UI__floatProtocol)
+ || (otype == UI__peakProtocol)
+ || (otype == ATOM__atomTransfer)
+ || (otype == ATOM__eventTransfer) )
return 0;
return 1;
@@ -1599,7 +1583,7 @@ sp_app_log_error(sp_app_t *app, const char *fmt, ...)
int ret;
va_start (args, fmt);
- ret = app->driver->log->vprintf(app->driver->log->handle, app->regs.log.error.urid, fmt, args);
+ ret = app->driver->log->vprintf(app->driver->log->handle, LOG__Error, fmt, args);
va_end(args);
return ret;
@@ -1612,7 +1596,7 @@ sp_app_log_note(sp_app_t *app, const char *fmt, ...)
int ret;
va_start (args, fmt);
- ret = app->driver->log->vprintf(app->driver->log->handle, app->regs.log.note.urid, fmt, args);
+ ret = app->driver->log->vprintf(app->driver->log->handle, LOG__Note, fmt, args);
va_end(args);
return ret;
@@ -1625,7 +1609,7 @@ sp_app_log_warning(sp_app_t *app, const char *fmt, ...)
int ret;
va_start (args, fmt);
- ret = app->driver->log->vprintf(app->driver->log->handle, app->regs.log.warning.urid, fmt, args);
+ ret = app->driver->log->vprintf(app->driver->log->handle, LOG__Warning, fmt, args);
va_end(args);
return ret;
@@ -1638,7 +1622,7 @@ sp_app_log_trace(sp_app_t *app, const char *fmt, ...)
int ret;
va_start (args, fmt);
- ret = app->driver->log->vprintf(app->driver->log->handle, app->regs.log.trace.urid, fmt, args);
+ ret = app->driver->log->vprintf(app->driver->log->handle, LOG__Trace, fmt, args);
va_end(args);
return ret;
diff --git a/app/synthpod_app_mod.c b/app/synthpod_app_mod.c
index 32c994e9..d10348de 100644
--- a/app/synthpod_app_mod.c
+++ b/app/synthpod_app_mod.c
@@ -19,9 +19,11 @@
#include <unistd.h>
#include <synthpod_app_private.h>
+#include <synthpod_stat.h>
#define ANSI_COLOR_BOLD "\x1b[1m"
#define ANSI_COLOR_RESET "\x1b[0m"
+#define NODE(KEY) app->regs[KEY]
//tools.ietf.org/html/rfc4122 version 4
static void
@@ -322,9 +324,6 @@ _sp_app_mod_features_populate(sp_app_t *app, mod_t *mod)
mod->feature_list[nfeatures++].data = NULL;
}
- mod->feature_list[nfeatures].URI = LV2_URI_MAP_URI;
- mod->feature_list[nfeatures++].data = &app->uri_to_id;
-
mod->feature_list[nfeatures].URI = LV2_CORE__inPlaceBroken;
mod->feature_list[nfeatures++].data = NULL;
@@ -643,44 +642,44 @@ _sp_app_mod_add(sp_app_t *app, const char *uri, LV2_URID urn, uint32_t created,
// populate options
mod->opts.options[0].context = LV2_OPTIONS_INSTANCE;
mod->opts.options[0].subject = 0;
- mod->opts.options[0].key = app->regs.bufsz.max_block_length.urid;
+ mod->opts.options[0].key = BUF_SIZE__maxBlockLength;
mod->opts.options[0].size = sizeof(int32_t);
- mod->opts.options[0].type = app->forge.Int;
+ mod->opts.options[0].type = ATOM__Int;
mod->opts.options[0].value = &app->driver->max_block_size;
mod->opts.options[1].context = LV2_OPTIONS_INSTANCE;
mod->opts.options[1].subject = 0;
- mod->opts.options[1].key = app->regs.bufsz.min_block_length.urid;
+ mod->opts.options[1].key = BUF_SIZE__minBlockLength;
mod->opts.options[1].size = sizeof(int32_t);
- mod->opts.options[1].type = app->forge.Int;
+ mod->opts.options[1].type = ATOM__Int;
mod->opts.options[1].value = &app->driver->min_block_size;
mod->opts.options[2].context = LV2_OPTIONS_INSTANCE;
mod->opts.options[2].subject = 0;
- mod->opts.options[2].key = app->regs.bufsz.sequence_size.urid;
+ mod->opts.options[2].key = BUF_SIZE__sequenceSize;
mod->opts.options[2].size = sizeof(int32_t);
- mod->opts.options[2].type = app->forge.Int;
+ mod->opts.options[2].type = ATOM__Int;
mod->opts.options[2].value = &app->driver->seq_size;
mod->opts.options[3].context = LV2_OPTIONS_INSTANCE;
mod->opts.options[3].subject = 0;
- mod->opts.options[3].key = app->regs.bufsz.nominal_block_length.urid;
+ mod->opts.options[3].key = BUF_SIZE__nominalBlockLength;
mod->opts.options[3].size = sizeof(int32_t);
- mod->opts.options[3].type = app->forge.Int;
+ mod->opts.options[3].type = ATOM__Int;
mod->opts.options[3].value = &app->driver->max_block_size; // set to max by default
mod->opts.options[4].context = LV2_OPTIONS_INSTANCE;
mod->opts.options[4].subject = 0;
- mod->opts.options[4].key = app->regs.param.sample_rate.urid;
+ mod->opts.options[4].key = PARAMETERS__sampleRate;
mod->opts.options[4].size = sizeof(float);
- mod->opts.options[4].type = app->forge.Float;
+ mod->opts.options[4].type = ATOM__Float;
mod->opts.options[4].value = &app->driver->sample_rate;
mod->opts.options[5].context = LV2_OPTIONS_INSTANCE;
mod->opts.options[5].subject = 0;
- mod->opts.options[5].key = app->regs.ui.update_rate.urid;
+ mod->opts.options[5].key = UI__updateRate;
mod->opts.options[5].size = sizeof(float);
- mod->opts.options[5].type = app->forge.Float;
+ mod->opts.options[5].type = ATOM__Float;
mod->opts.options[5].value = &app->driver->update_rate;
mod->opts.options[6].key = 0; // sentinel
@@ -718,11 +717,9 @@ _sp_app_mod_add(sp_app_t *app, const char *uri, LV2_URID urn, uint32_t created,
mod->opts.iface = lilv_instance_get_extension_data(mod->inst,
LV2_OPTIONS__interface);
const bool has_ro_canvas_graph = lilv_world_ask(app->world,
- lilv_plugin_get_uri(mod->plug), app->regs.patch.readable.node,
- app->regs.canvas.graph.node);
+ lilv_plugin_get_uri(mod->plug), NODE(PATCH__readable), NODE(CVAS__graph));
const bool has_rw_canvas_graph = lilv_world_ask(app->world,
- lilv_plugin_get_uri(mod->plug), app->regs.patch.writable.node,
- app->regs.canvas.graph.node);
+ lilv_plugin_get_uri(mod->plug), NODE(PATCH__writable), NODE(CVAS__graph));
if(has_ro_canvas_graph || has_rw_canvas_graph)
{
//sp_app_log_note(app, "%s: detected canvas:graph parameter\n", __func__);
@@ -734,9 +731,9 @@ _sp_app_mod_add(sp_app_t *app, const char *uri, LV2_URID urn, uint32_t created,
}
mod->state.iface = lilv_instance_get_extension_data(mod->inst,
LV2_STATE__interface);
- mod->system_ports = lilv_plugin_has_feature(plug, app->regs.synthpod.system_ports.node);
- const bool load_default_state = lilv_plugin_has_feature(plug, app->regs.state.load_default_state.node);
- const bool thread_safe_restore = lilv_plugin_has_feature(plug, app->regs.state.thread_safe_restore.node);
+ mod->system_ports = lilv_plugin_has_feature(plug, NODE(SYNTHPOD__systemPorts));
+ const bool load_default_state = lilv_plugin_has_feature(plug, NODE(STATE__loadDefaultState));
+ const bool thread_safe_restore = lilv_plugin_has_feature(plug, NODE(STATE__threadSafeRestore));
if(mod->state.iface) // plugins with state:interface need bypassing upon preset load
mod->needs_bypassing = true;
@@ -765,24 +762,24 @@ _sp_app_mod_add(sp_app_t *app, const char *uri, LV2_URID urn, uint32_t created,
tar->mod = mod;
tar->index = i;
tar->symbol = lilv_node_as_string(lilv_port_get_symbol(plug, port));
- tar->direction = lilv_port_is_a(plug, port, app->regs.port.input.node)
+ tar->direction = lilv_port_is_a(plug, port, NODE(CORE__InputPort))
? PORT_DIRECTION_INPUT
: PORT_DIRECTION_OUTPUT;
// register system ports
if(mod->system_ports)
{
- if(lilv_port_is_a(plug, port, app->regs.synthpod.control_port.node))
+ if(lilv_port_is_a(plug, port, NODE(SYNTHPOD__ControlPort)))
tar->sys.type = SYSTEM_PORT_CONTROL;
- else if(lilv_port_is_a(plug, port, app->regs.synthpod.audio_port.node))
+ else if(lilv_port_is_a(plug, port, NODE(SYNTHPOD__AudioPort)))
tar->sys.type = SYSTEM_PORT_AUDIO;
- else if(lilv_port_is_a(plug, port, app->regs.synthpod.cv_port.node))
+ else if(lilv_port_is_a(plug, port, NODE(SYNTHPOD__CVPort)))
tar->sys.type = SYSTEM_PORT_CV;
- else if(lilv_port_is_a(plug, port, app->regs.synthpod.midi_port.node))
+ else if(lilv_port_is_a(plug, port, NODE(SYNTHPOD__MIDIPort)))
tar->sys.type = SYSTEM_PORT_MIDI;
- else if(lilv_port_is_a(plug, port, app->regs.synthpod.osc_port.node))
+ else if(lilv_port_is_a(plug, port, NODE(SYNTHPOD__OSCPort)))
tar->sys.type = SYSTEM_PORT_OSC;
- else if(lilv_port_is_a(plug, port, app->regs.synthpod.com_port.node))
+ else if(lilv_port_is_a(plug, port, NODE(SYNTHPOD__ComPort)))
tar->sys.type = SYSTEM_PORT_COM;
else
tar->sys.type = SYSTEM_PORT_NONE;
@@ -795,7 +792,7 @@ _sp_app_mod_add(sp_app_t *app, const char *uri, LV2_URID urn, uint32_t created,
const char *designation = NULL;
const LilvNode *port_symbol_node = lilv_port_get_symbol(plug, port);
LilvNode *port_name_node = lilv_port_get_name(plug, port);
- LilvNode *port_designation= lilv_port_get(plug, port, app->regs.core.designation.node);
+ LilvNode *port_designation= lilv_port_get(plug, port, NODE(CORE__designation));
asprintf(&short_name, "#%"PRIu32"_%s",
mod->urn, lilv_node_as_string(port_symbol_node));
@@ -826,30 +823,30 @@ _sp_app_mod_add(sp_app_t *app, const char *uri, LV2_URID urn, uint32_t created,
tar->sys.data = NULL;
}
- if(lilv_port_is_a(plug, port, app->regs.port.audio.node))
+ if(lilv_port_is_a(plug, port, NODE(CORE__AudioPort)))
{
tar->size = app->driver->max_block_size * sizeof(float);
tar->type = PORT_TYPE_AUDIO;
- tar->protocol = app->regs.port.peak_protocol.urid;
+ tar->protocol = UI__peakProtocol;
tar->driver = &audio_port_driver;
}
- else if(lilv_port_is_a(plug, port, app->regs.port.cv.node))
+ else if(lilv_port_is_a(plug, port, NODE(CORE__CVPort)))
{
tar->size = app->driver->max_block_size * sizeof(float);
tar->type = PORT_TYPE_CV;
- tar->protocol = app->regs.port.peak_protocol.urid;
+ tar->protocol = UI__peakProtocol;
tar->driver = &cv_port_driver;
}
- else if(lilv_port_is_a(plug, port, app->regs.port.control.node))
+ else if(lilv_port_is_a(plug, port, NODE(CORE__ControlPort)))
{
tar->size = sizeof(float);
tar->type = PORT_TYPE_CONTROL;
- tar->protocol = app->regs.port.float_protocol.urid;
+ tar->protocol = UI__floatProtocol;
tar->driver = &control_port_driver;
control_port_t *control = &tar->control;
- control->is_integer = lilv_port_has_property(plug, port, app->regs.port.integer.node);
- control->is_toggled = lilv_port_has_property(plug, port, app->regs.port.toggled.node);
+ control->is_integer = lilv_port_has_property(plug, port, NODE(CORE__integer));
+ control->is_toggled = lilv_port_has_property(plug, port, NODE(CORE__toggled));
control->lock = (atomic_flag)ATOMIC_FLAG_INIT;
LilvNode *dflt_node;
@@ -865,24 +862,24 @@ _sp_app_mod_add(sp_app_t *app, const char *uri, LV2_URID urn, uint32_t created,
lilv_node_free(min_node);
lilv_node_free(max_node);
}
- else if(lilv_port_is_a(plug, port, app->regs.port.atom.node))
+ else if(lilv_port_is_a(plug, port, NODE(ATOM__AtomPort)))
{
tar->size = app->driver->seq_size;
tar->type = PORT_TYPE_ATOM;
- tar->protocol = app->regs.port.event_transfer.urid; //FIXME handle atom_transfer
+ tar->protocol = ATOM__eventTransfer; //FIXME handle atom_transfer
tar->driver = &seq_port_driver; // FIXME handle atom_port_driver
tar->atom.buffer_type = PORT_BUFFER_TYPE_SEQUENCE; //FIXME properly discover this
// does this port support patch:Message?
- tar->atom.patchable = lilv_port_supports_event(plug, port, app->regs.patch.message.node);
+ tar->atom.patchable = lilv_port_supports_event(plug, port, NODE(PATCH__Message));
// check whether this is a control port
const LilvPort *control_port = lilv_plugin_get_port_by_designation(plug,
tar->direction == PORT_DIRECTION_INPUT
- ? app->regs.port.input.node
- : app->regs.port.output.node
- , app->regs.core.control.node);
+ ? NODE(CORE__InputPort)
+ : NODE(CORE__OutputPort)
+ , NODE(CORE__ControlPort));
(void)control_port; //TODO use this?
}
else
@@ -897,7 +894,7 @@ _sp_app_mod_add(sp_app_t *app, const char *uri, LV2_URID urn, uint32_t created,
}
// get minimum port size if specified
- LilvNode *minsize = lilv_port_get(plug, port, app->regs.port.minimum_size.node);
+ LilvNode *minsize = lilv_port_get(plug, port, NODE(RESIZE_PORT__minimumSize));
if(minsize)
{
tar->size = lilv_node_as_int(minsize);
@@ -925,7 +922,7 @@ _sp_app_mod_add(sp_app_t *app, const char *uri, LV2_URID urn, uint32_t created,
tar->size = dbg_sz;
tar->type = PORT_TYPE_ATOM;
- tar->protocol = app->regs.port.event_transfer.urid;
+ tar->protocol = ATOM__eventTransfer;
tar->driver = &seq_port_driver;
tar->atom.buffer_type = PORT_BUFFER_TYPE_SEQUENCE;
@@ -949,7 +946,7 @@ _sp_app_mod_add(sp_app_t *app, const char *uri, LV2_URID urn, uint32_t created,
tar->size = dbg_sz;
tar->type = PORT_TYPE_ATOM;
- tar->protocol = app->regs.port.event_transfer.urid;
+ tar->protocol = ATOM__eventTransfer;
tar->driver = &seq_port_driver;
tar->atom.buffer_type = PORT_BUFFER_TYPE_SEQUENCE;
@@ -973,7 +970,7 @@ _sp_app_mod_add(sp_app_t *app, const char *uri, LV2_URID urn, uint32_t created,
tar->size = app->driver->seq_size;
tar->type = PORT_TYPE_ATOM;
- tar->protocol = app->regs.port.event_transfer.urid;
+ tar->protocol = ATOM__eventTransfer;
tar->driver = &seq_port_driver;
tar->atom.buffer_type = PORT_BUFFER_TYPE_SEQUENCE;
@@ -997,7 +994,7 @@ _sp_app_mod_add(sp_app_t *app, const char *uri, LV2_URID urn, uint32_t created,
tar->size = app->driver->seq_size;
tar->type = PORT_TYPE_ATOM;
- tar->protocol = app->regs.port.event_transfer.urid;
+ tar->protocol = ATOM__eventTransfer;
tar->driver = &seq_port_driver;
tar->atom.buffer_type = PORT_BUFFER_TYPE_SEQUENCE;
@@ -1048,7 +1045,7 @@ _sp_app_mod_add(sp_app_t *app, const char *uri, LV2_URID urn, uint32_t created,
}
// load presets
- mod->presets = lilv_plugin_get_related(plug, app->regs.pset.preset.node);
+ mod->presets = lilv_plugin_get_related(plug, NODE(PRESETS__Preset));
// spawn worker thread
if(mod->worker.iface || mod->idisp.iface)
@@ -1201,7 +1198,7 @@ _sp_app_mod_eject(sp_app_t *app, mod_t *mod)
transmit_module_del_t *trans = _sp_app_to_ui_request(app, size);
if(trans)
{
- _sp_transmit_module_del_fill(&app->regs, &app->forge, trans, size, mod->uid);
+ _sp_transmit_module_del_fill(&app->forge, trans, size, mod->uid);
_sp_app_to_ui_advance(app, size);
}
#endif
diff --git a/app/synthpod_app_port.c b/app/synthpod_app_port.c
index f9a60631..aa57a10f 100644
--- a/app/synthpod_app_port.c
+++ b/app/synthpod_app_port.c
@@ -19,6 +19,7 @@
#include <synthpod_app_private.h>
#include <synthpod_patcher.h>
+#include <synthpod_stat.h>
#include <osc.lv2/util.h>
@@ -178,8 +179,8 @@ _dsp_master_reorder(sp_app_t *app)
: app->dsp_master.concurrent;
LV2_Atom_Forge_Ref ref = synthpod_patcher_set(
- &app->regs, &app->forge, 0, 0, app->regs.synthpod.cpus_used.urid,
- sizeof(int32_t), app->forge.Int, &cpus_used); //TODO subj, seqn
+ &app->forge, 0, 0, SYNTHPOD__CPUsUsed,
+ sizeof(int32_t), ATOM__Int, &cpus_used); //TODO subj, seqn
if(ref)
{
_sp_app_to_ui_advance_atom(app, answer);
@@ -604,29 +605,29 @@ _sp_app_automate(sp_app_t *app, mod_t *mod, auto_t *automation, double value,
LV2_Atom_Forge_Ref ref;
ref = lv2_atom_forge_frame_time(&app->forge, frames)
- && lv2_atom_forge_object(&app->forge, &obj_frame, 0, app->regs.patch.set.urid)
- && lv2_atom_forge_key(&app->forge, app->regs.patch.property.urid)
+ && lv2_atom_forge_object(&app->forge, &obj_frame, 0, PATCH__Set)
+ && lv2_atom_forge_key(&app->forge, PATCH__property)
&& lv2_atom_forge_urid(&app->forge, automation->property)
- && lv2_atom_forge_key(&app->forge, app->regs.patch.value.urid);
+ && lv2_atom_forge_key(&app->forge, PATCH__value);
if(ref)
{
- if(automation->range == app->forge.Bool)
+ if(automation->range == ATOM__Bool)
{
ref = lv2_atom_forge_bool(&app->forge, f64 != 0.0);
}
- else if(automation->range == app->forge.Int)
+ else if(automation->range == ATOM__Int)
{
ref = lv2_atom_forge_int(&app->forge, floor(f64));
}
- else if(automation->range == app->forge.Long)
+ else if(automation->range == ATOM__Long)
{
ref = lv2_atom_forge_long(&app->forge, floor(f64));
}
- else if(automation->range == app->forge.Float)
+ else if(automation->range == ATOM__Float)
{
ref = lv2_atom_forge_float(&app->forge, f64);
}
- else if(automation->range == app->forge.Double)
+ else if(automation->range == ATOM__Double)
{
ref = lv2_atom_forge_double(&app->forge, f64);
}
@@ -660,7 +661,7 @@ _sp_app_automate_event(sp_app_t *app, mod_t *mod, const LV2_Atom_Event *ev,
int do_route = 0;
//printf("got automation\n");
- if( (atom->type == app->regs.port.midi.urid)
+ if( (atom->type == MIDI__MidiEvent)
&& (atom->size == 3) ) // we're only interested in controller events
{
const uint8_t *msg = LV2_ATOM_BODY_CONST(atom);
@@ -945,17 +946,17 @@ __realtime static LV2_Atom_Forge_Ref
_patch_notification_internal(sp_app_t *app, port_t *source_port,
uint32_t size, LV2_URID type, const void *body)
{
- LV2_Atom_Forge_Ref ref = lv2_atom_forge_key(&app->forge, app->regs.synthpod.sink_module.urid);
+ LV2_Atom_Forge_Ref ref = lv2_atom_forge_key(&app->forge, SYNTHPOD__sinkModule);
if(ref)
ref = lv2_atom_forge_urid(&app->forge, source_port->mod->urn);
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.synthpod.sink_symbol.urid);
+ ref = lv2_atom_forge_key(&app->forge, SYNTHPOD__sinkSymbol);
if(ref)
ref = lv2_atom_forge_string(&app->forge, source_port->symbol, strlen(source_port->symbol));
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.rdf.value.urid);
+ ref = lv2_atom_forge_key(&app->forge, RDF__value);
if(ref)
ref = lv2_atom_forge_atom(&app->forge, size, type);
if(ref)
@@ -973,8 +974,8 @@ _patch_notification_add(sp_app_t *app, port_t *source_port,
LV2_Atom *answer = _sp_app_to_ui_request_atom(app);
if(answer)
{
- if(synthpod_patcher_add_object(&app->regs, &app->forge, &frame[0],
- 0, 0, app->regs.synthpod.notification_list.urid) //TODO subject
+ if(synthpod_patcher_add_object(&app->forge, &frame[0],
+ 0, 0, SYNTHPOD__notificationList) //TODO subject
&& lv2_atom_forge_object(&app->forge, &frame[2], 0, proto)
&& _patch_notification_internal(app, source_port, size, type, body) )
{
@@ -985,13 +986,13 @@ _patch_notification_add(sp_app_t *app, port_t *source_port,
// dsp debug out
lv2_atom_object_get((const LV2_Atom_Object *)answer,
- app->regs.patch.add.urid, &patch_add,
+ PATCH__add, &patch_add,
0);
if(patch_add)
{
lv2_atom_object_get(patch_add,
- app->regs.synthpod.notification_list.urid, &obj,
+ SYNTHPOD__notificationList, &obj,
0);
}
@@ -1045,8 +1046,8 @@ _port_float_protocol_update(sp_app_t *app, port_t *port, uint32_t nsamples)
if(needs_update)
{
// for nk
- _patch_notification_add(app, port, app->regs.port.float_protocol.urid,
- sizeof(float), app->forge.Float, &new_val);
+ _patch_notification_add(app, port, UI__floatProtocol,
+ sizeof(float), ATOM__Float, &new_val);
}
}
@@ -1088,32 +1089,32 @@ _port_peak_protocol_update(sp_app_t *app, port_t *port, uint32_t nsamples)
.header = {
.atom = {
.size = 3*sizeof(LV2_Atom_Long),
- .type = app->forge.Tuple
+ .type = ATOM__Tuple
}
},
.period_start = {
.atom = {
.size = sizeof(int32_t),
- .type = app->forge.Int
+ .type = ATOM__Int
},
.body = data.period_start
},
.period_size = {
.atom = {
.size = sizeof(int32_t),
- .type = app->forge.Int
+ .type = ATOM__Int
},
.body = data.period_size
},
.peak = {
.atom = {
.size = sizeof(float),
- .type = app->forge.Float
+ .type = ATOM__Float
},
.body = data.peak
}
};
- _patch_notification_add(app, port, app->regs.port.peak_protocol.urid,
+ _patch_notification_add(app, port, UI__peakProtocol,
tup.header.atom.size, tup.header.atom.type, &tup.period_start);
}
}
@@ -1130,7 +1131,7 @@ _port_atom_transfer_update(sp_app_t *app, port_t *port, uint32_t nsamples)
return;
// for nk
- _patch_notification_add(app, port, app->regs.port.atom_transfer.urid,
+ _patch_notification_add(app, port, ATOM__atomTransfer,
atom->size, atom->type, LV2_ATOM_BODY_CONST(atom));
}
@@ -1151,7 +1152,7 @@ _port_event_transfer_update(sp_app_t *app, port_t *port, uint32_t nsamples)
const LV2_Atom *atom = &ev->body;
// for nk
- _patch_notification_add(app, port, app->regs.port.event_transfer.urid,
+ _patch_notification_add(app, port, ATOM__eventTransfer,
atom->size, atom->type, LV2_ATOM_BODY_CONST(atom));
}
}
@@ -1165,25 +1166,25 @@ _port_event_transfer_update(sp_app_t *app, port_t *port, uint32_t nsamples)
{
/*FIXME
const LV2_Atom_URID *destination = NULL;
- lv2_atom_object_get(obj, app->regs.patch.destination.urid, &destination, NULL);
- if(destination && (destination->atom.type == app->forge.URID)
- && (destination->body == app->regs.core.plugin.urid) )
+ lv2_atom_object_get(obj, PATCH__destination, &destination, NULL);
+ if(destination && (destination->atom.type == ATOM__URID)
+ && (destination->body == CORE__Plugin) )
continue; // ignore feedback messages
*/
- if( (obj->body.otype == app->regs.patch.set.urid)
- || (obj->body.otype == app->regs.patch.get.urid)
- || (obj->body.otype == app->regs.patch.put.urid)
- || (obj->body.otype == app->regs.patch.patch.urid)
- || (obj->body.otype == app->regs.patch.insert.urid)
- || (obj->body.otype == app->regs.patch.move.urid)
- || (obj->body.otype == app->regs.patch.copy.urid)
- || (obj->body.otype == app->regs.patch.delete.urid)
- || (obj->body.otype == app->regs.patch.error.urid)
- || (obj->body.otype == app->regs.patch.ack.urid) ) //TODO support more patch messages
+ if( (obj->body.otype == PATCH__Set)
+ || (obj->body.otype == PATCH__Get)
+ || (obj->body.otype == PATCH__Put)
+ || (obj->body.otype == PATCH__Patch)
+ || (obj->body.otype == PATCH__Insert)
+ || (obj->body.otype == PATCH__Move)
+ || (obj->body.otype == PATCH__Copy)
+ || (obj->body.otype == PATCH__Delete)
+ || (obj->body.otype == PATCH__Error)
+ || (obj->body.otype == PATCH__Ack) ) //TODO support more patch messages
{
// for nk
- _patch_notification_add(app, port, app->regs.port.event_transfer.urid,
+ _patch_notification_add(app, port, ATOM__eventTransfer,
obj->atom.size, obj->atom.type, &obj->body);
}
}
diff --git a/app/synthpod_app_private.h b/app/synthpod_app_private.h
index 3177ad7a..eba736a5 100644
--- a/app/synthpod_app_private.h
+++ b/app/synthpod_app_private.h
@@ -464,7 +464,8 @@ struct _sp_app_t {
LilvWorld *world;
const LilvPlugins *plugs;
- reg_t regs;
+ LilvNode *regs [STAT_URID_MAX];
+
LV2_Atom_Forge forge;
unsigned num_mods;
@@ -477,10 +478,6 @@ struct _sp_app_t {
LV2_State_Map_Path map_path;
LV2_Feature state_feature_list [2];
LV2_Feature *state_features [3];
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
- LV2_URI_Map_Feature uri_to_id;
-#pragma GCC diagnostic pop
char *bundle_path;
char *bundle_filename;
diff --git a/app/synthpod_app_state.c b/app/synthpod_app_state.c
index f4e27eda..fa1bbf50 100644
--- a/app/synthpod_app_state.c
+++ b/app/synthpod_app_state.c
@@ -18,6 +18,7 @@
#include <inttypes.h>
#include <synthpod_app_private.h>
+#include <synthpod_stat.h>
typedef struct _atom_ser_t atom_ser_t;
@@ -172,15 +173,15 @@ _state_set_value(const char *symbol, void *data,
float val = 0.f;
- if( (type == app->forge.Int) && (size == sizeof(int32_t)) )
+ if( (type == ATOM__Int) && (size == sizeof(int32_t)) )
val = *(const int32_t *)value;
- else if( (type == app->forge.Long) && (size == sizeof(int64_t)) )
+ else if( (type == ATOM__Long) && (size == sizeof(int64_t)) )
val = *(const int64_t *)value;
- else if( (type == app->forge.Float) && (size == sizeof(float)) )
+ else if( (type == ATOM__Float) && (size == sizeof(float)) )
val = *(const float *)value;
- else if( (type == app->forge.Double) && (size == sizeof(double)) )
+ else if( (type == ATOM__Double) && (size == sizeof(double)) )
val = *(const double *)value;
- else if( (type == app->forge.Bool) && (size == sizeof(int32_t)) )
+ else if( (type == ATOM__Bool) && (size == sizeof(int32_t)) )
val = *(const int32_t *)value;
else
{
@@ -256,21 +257,21 @@ _state_get_value(const char *symbol, void *data, uint32_t *size, uint32_t *type)
if(control->is_toggled)
{
*size = sizeof(int32_t);
- *type = app->forge.Bool;
+ *type = ATOM__Bool;
control->i32 = floor(stash);
ptr = &control->i32;
}
else if(control->is_integer)
{
*size = sizeof(int32_t);
- *type = app->forge.Int;
+ *type = ATOM__Int;
control->i32 = floor(stash);
ptr = &control->i32;
}
else // float
{
*size = sizeof(float);
- *type = app->forge.Float;
+ *type = ATOM__Float;
control->f32 = stash;
ptr = &control->f32;
}
@@ -404,19 +405,19 @@ _sp_app_state_preset_save(sp_app_t *app, mod_t *mod, const char *uri)
/*FIXME for lilv 0.24
const char *comment = "this is a comment";
- lilv_state_set_metadata(state, app->regs.rdfs.comment.urid,
- comment, strlen(comment)+1, app->forge.String,
+ lilv_state_set_metadata(state, RDFS__comment,
+ comment, strlen(comment)+1, ATOM__String,
LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE);
const char *license = "http://opensource.org/licenses/Artistic-2.0";
- lilv_state_set_metadata(state, app->regs.doap.license.urid,
- license, strlen(license)+1, app->forge.URI,
+ lilv_state_set_metadata(state, DOAP__license,
+ license, strlen(license)+1, ATOM__URI,
LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE);
const LV2_URID bank = app->driver->map->map(app->driver->map->handle,
"http://open-music-kontrollers.ch/banks#Bank1");
- lilv_state_set_metadata(state, app->regs.pset.preset_bank.urid,
- &bank, sizeof(LV2_URID), app->forge.URID,
+ lilv_state_set_metadata(state, PRESETS__bank,
+ &bank, sizeof(LV2_URID), ATOM__URID,
LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE);
*/
@@ -426,7 +427,7 @@ _sp_app_state_preset_save(sp_app_t *app, mod_t *mod, const char *uri)
lilv_state_free(state);
// reload presets for this module
- mod->presets = _preset_reload(app->world, &app->regs, mod->plug,
+ mod->presets = _preset_reload(app->world, app->regs, mod->plug,
mod->presets, bndl);
}
else
@@ -736,13 +737,13 @@ _sp_app_state_bundle_save(sp_app_t *app, const char *bundle_path)
lv2_atom_forge_set_sink(forge, _sink, _deref, &ser);
if( ser.buf
- && lv2_atom_forge_object(forge, &pset_frame, app->regs.synthpod.state.urid, app->regs.pset.preset.urid)
- && lv2_atom_forge_key(forge, app->regs.core.applies_to.urid)
- && lv2_atom_forge_urid(forge, app->regs.synthpod.stereo.urid)
- && lv2_atom_forge_key(forge, app->regs.core.applies_to.urid)
- && lv2_atom_forge_urid(forge, app->regs.synthpod.monoatom.urid)
- && lv2_atom_forge_key(forge, app->regs.rdfs.see_also.urid)
- && lv2_atom_forge_urid(forge, app->regs.synthpod.state.urid) )
+ && lv2_atom_forge_object(forge, &pset_frame, SYNTHPOD__state, PRESETS__Preset)
+ && lv2_atom_forge_key(forge, CORE__appliesTo)
+ && lv2_atom_forge_urid(forge, SYNTHPOD__stereo)
+ && lv2_atom_forge_key(forge, CORE__appliesTo)
+ && lv2_atom_forge_urid(forge, SYNTHPOD__monoatom)
+ && lv2_atom_forge_key(forge, RDFS__seeAlso)
+ && lv2_atom_forge_urid(forge, SYNTHPOD__state) )
{
lv2_atom_forge_pop(forge, &pset_frame);
@@ -777,17 +778,17 @@ _sp_app_state_bundle_save(sp_app_t *app, const char *bundle_path)
}
if( ser.buf
- && lv2_atom_forge_object(forge, &pset_frame, app->regs.synthpod.null.urid, app->regs.pset.preset.urid)
- && lv2_atom_forge_key(forge, app->regs.core.applies_to.urid)
- && lv2_atom_forge_urid(forge, app->regs.synthpod.stereo.urid)
- && lv2_atom_forge_key(forge, app->regs.core.applies_to.urid)
- && lv2_atom_forge_urid(forge, app->regs.synthpod.monoatom.urid)
+ && lv2_atom_forge_object(forge, &pset_frame, SYNTHPOD__null, PRESETS__Preset)
+ && lv2_atom_forge_key(forge, CORE__appliesTo)
+ && lv2_atom_forge_urid(forge, SYNTHPOD__stereo)
+ && lv2_atom_forge_key(forge, CORE__appliesTo)
+ && lv2_atom_forge_urid(forge, SYNTHPOD__monoatom)
- && lv2_atom_forge_key(forge, app->regs.rdfs.label.urid)
+ && lv2_atom_forge_key(forge, RDFS__label)
&& lv2_atom_forge_string(forge, rdfs_label ? rdfs_label : app->bundle_path,
rdfs_label ? strlen(rdfs_label) : strlen(app->bundle_path) )
- && lv2_atom_forge_key(forge, app->regs.state.state.urid)
+ && lv2_atom_forge_key(forge, STATE__state)
&& lv2_atom_forge_object(forge, &state_frame, 0, 0) )
{
// store state
@@ -908,20 +909,20 @@ sp_app_save(sp_app_t *app, LV2_State_Store_Function store,
// store visibility
const int32_t visibility = sp_app_visibility_get(app);
- store(hndl, app->regs.synthpod.visibility.urid,
- &visibility, sizeof(int32_t), app->forge.Bool,
+ store(hndl, SYNTHPOD__visibility,
+ &visibility, sizeof(int32_t), ATOM__Bool,
LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE);
// store minor version
const int32_t minor_version = SYNTHPOD_MINOR_VERSION;
- store(hndl, app->regs.core.minor_version.urid,
- &minor_version, sizeof(int32_t), app->forge.Int,
+ store(hndl, CORE__minorVersion,
+ &minor_version, sizeof(int32_t), ATOM__Int,
LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE);
// store micro version
const int32_t micro_version = SYNTHPOD_MICRO_VERSION;
- store(hndl, app->regs.core.micro_version.urid,
- &micro_version, sizeof(int32_t), app->forge.Int,
+ store(hndl, CORE__microVersion,
+ &micro_version, sizeof(int32_t), ATOM__Int,
LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE);
// create temporary forge
@@ -978,42 +979,42 @@ sp_app_save(sp_app_t *app, LV2_State_Store_Function store,
&& lv2_atom_forge_key(forge, mod->urn)
&& lv2_atom_forge_object(forge, &mod_frame, 0, uri_urid) )
{
- ref = lv2_atom_forge_key(forge, app->regs.synthpod.module_position_x.urid)
+ ref = lv2_atom_forge_key(forge, SYNTHPOD__modulePositionX)
&& lv2_atom_forge_float(forge, mod->pos.x);
if(ref)
{
- ref = lv2_atom_forge_key(forge, app->regs.synthpod.module_position_y.urid)
+ ref = lv2_atom_forge_key(forge, SYNTHPOD__modulePositionY)
&& lv2_atom_forge_float(forge, mod->pos.y);
}
if(ref && strlen(mod->alias))
{
- ref = lv2_atom_forge_key(forge, app->regs.synthpod.module_alias.urid)
+ ref = lv2_atom_forge_key(forge, SYNTHPOD__moduleAlias)
&& lv2_atom_forge_string(forge, mod->alias, strlen(mod->alias));
}
if(ref && mod->ui)
{
- ref = lv2_atom_forge_key(forge, app->regs.ui.ui.urid)
+ ref = lv2_atom_forge_key(forge, UI__ui)
&& lv2_atom_forge_urid(forge, mod->ui);
}
if(ref && mod->visible)
{
- ref = lv2_atom_forge_key(forge, app->regs.synthpod.module_visible.urid)
+ ref = lv2_atom_forge_key(forge, SYNTHPOD__moduleVisible)
&& lv2_atom_forge_urid(forge, mod->visible);
}
if(ref && mod->disabled)
{
- ref = lv2_atom_forge_key(forge, app->regs.synthpod.module_disabled.urid)
+ ref = lv2_atom_forge_key(forge, SYNTHPOD__moduleDisabled)
&& lv2_atom_forge_bool(forge, mod->disabled);
}
if(ref)
{
- ref = lv2_atom_forge_key(forge, app->regs.synthpod.module_created.urid)
+ ref = lv2_atom_forge_key(forge, SYNTHPOD__moduleCreated)
&& lv2_atom_forge_int(forge, mod->created);
}
@@ -1033,7 +1034,7 @@ sp_app_save(sp_app_t *app, LV2_State_Store_Function store,
const LV2_Atom *atom = (const LV2_Atom *)ser.buf;
if(ref && atom)
{
- store(hndl, app->regs.synthpod.module_list.urid,
+ store(hndl, SYNTHPOD__moduleList,
LV2_ATOM_BODY_CONST(atom), atom->size, atom->type,
LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE);
}
@@ -1073,15 +1074,15 @@ sp_app_save(sp_app_t *app, LV2_State_Store_Function store,
if( ref
&& lv2_atom_forge_object(forge, &source_frame, 0, 0) )
{
- ref = lv2_atom_forge_key(forge, app->regs.synthpod.source_module.urid)
+ ref = lv2_atom_forge_key(forge, SYNTHPOD__sourceModule)
&& lv2_atom_forge_urid(forge, source_port->mod->urn)
- && lv2_atom_forge_key(forge, app->regs.synthpod.source_symbol.urid)
+ && lv2_atom_forge_key(forge, SYNTHPOD__sourceSymbol)
&& lv2_atom_forge_string(forge, source_port->symbol, strlen(source_port->symbol))
- && lv2_atom_forge_key(forge, app->regs.synthpod.sink_module.urid)
+ && lv2_atom_forge_key(forge, SYNTHPOD__sinkModule)
&& lv2_atom_forge_urid(forge, port->mod->urn)
- && lv2_atom_forge_key(forge, app->regs.synthpod.sink_symbol.urid)
+ && lv2_atom_forge_key(forge, SYNTHPOD__sinkSymbol)
&& lv2_atom_forge_string(forge, port->symbol, strlen(port->symbol))
- && lv2_atom_forge_key(forge, app->regs.param.gain.urid)
+ && lv2_atom_forge_key(forge, PARAMETERS__gain)
&& lv2_atom_forge_float(forge, source->gain);
if(ref)
@@ -1102,7 +1103,7 @@ sp_app_save(sp_app_t *app, LV2_State_Store_Function store,
const LV2_Atom *atom = (const LV2_Atom *)ser.buf;
if(ref && atom)
{
- store(hndl, app->regs.synthpod.connection_list.urid,
+ store(hndl, SYNTHPOD__connectionList,
LV2_ATOM_BODY_CONST(atom), atom->size, atom->type,
LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE);
}
@@ -1164,13 +1165,13 @@ sp_app_save(sp_app_t *app, LV2_State_Store_Function store,
if( ref
&& lv2_atom_forge_object(forge, &source_frame, 0, 0) )
{
- ref = lv2_atom_forge_key(forge, app->regs.synthpod.source_module.urid)
+ ref = lv2_atom_forge_key(forge, SYNTHPOD__sourceModule)
&& lv2_atom_forge_urid(forge, src_mod->urn)
- && lv2_atom_forge_key(forge, app->regs.synthpod.sink_module.urid)
+ && lv2_atom_forge_key(forge, SYNTHPOD__sinkModule)
&& lv2_atom_forge_urid(forge, snk_mod->urn)
- && lv2_atom_forge_key(forge, app->regs.synthpod.node_position_x.urid)
+ && lv2_atom_forge_key(forge, SYNTHPOD__nodePositionX)
&& lv2_atom_forge_float(forge, x)
- && lv2_atom_forge_key(forge, app->regs.synthpod.node_position_y.urid)
+ && lv2_atom_forge_key(forge, SYNTHPOD__nodePositionY)
&& lv2_atom_forge_float(forge, y);
if(ref)
@@ -1189,7 +1190,7 @@ sp_app_save(sp_app_t *app, LV2_State_Store_Function store,
const LV2_Atom *atom = (const LV2_Atom *)ser.buf;
if(ref && atom)
{
- store(hndl, app->regs.synthpod.node_list.urid,
+ store(hndl, SYNTHPOD__nodeList,
LV2_ATOM_BODY_CONST(atom), atom->size, atom->type,
LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE);
}
@@ -1223,47 +1224,47 @@ sp_app_save(sp_app_t *app, LV2_State_Store_Function store,
LV2_Atom_Forge_Frame auto_frame;
if( ref
- && lv2_atom_forge_object(forge, &auto_frame, 0, app->regs.midi.Controller.urid) )
+ && lv2_atom_forge_object(forge, &auto_frame, 0, MIDI__Controller) )
{
- ref = lv2_atom_forge_key(forge, app->regs.synthpod.sink_module.urid)
+ ref = lv2_atom_forge_key(forge, SYNTHPOD__sinkModule)
&& lv2_atom_forge_urid(forge, mod->urn)
- && lv2_atom_forge_key(forge, app->regs.midi.channel.urid)
+ && lv2_atom_forge_key(forge, MIDI__channel)
&& lv2_atom_forge_int(forge, mauto->channel)
- && lv2_atom_forge_key(forge, app->regs.midi.controller_number.urid)
+ && lv2_atom_forge_key(forge, MIDI__controllerNumber)
&& lv2_atom_forge_int(forge, mauto->controller)
- && lv2_atom_forge_key(forge, app->regs.synthpod.source_min.urid)
+ && lv2_atom_forge_key(forge, SYNTHPOD__sourceMinimum)
&& lv2_atom_forge_double(forge, automation->a)
- && lv2_atom_forge_key(forge, app->regs.synthpod.source_max.urid)
+ && lv2_atom_forge_key(forge, SYNTHPOD__sourceMaximum)
&& lv2_atom_forge_double(forge, automation->b)
- && lv2_atom_forge_key(forge, app->regs.synthpod.sink_min.urid)
+ && lv2_atom_forge_key(forge, SYNTHPOD__sinkMinimum)
&& lv2_atom_forge_double(forge, automation->c)
- && lv2_atom_forge_key(forge, app->regs.synthpod.sink_max.urid)
+ && lv2_atom_forge_key(forge, SYNTHPOD__sinkMaximum)
&& lv2_atom_forge_double(forge, automation->d)
- && lv2_atom_forge_key(forge, app->regs.synthpod.source_enabled.urid)
+ && lv2_atom_forge_key(forge, SYNTHPOD__sourceEnabled)
&& lv2_atom_forge_bool(forge, automation->src_enabled)
- && lv2_atom_forge_key(forge, app->regs.synthpod.sink_enabled.urid)
+ && lv2_atom_forge_key(forge, SYNTHPOD__sinkEnabled)
&& lv2_atom_forge_bool(forge, automation->snk_enabled);
if(ref)
{
if(automation->property)
{
- ref = lv2_atom_forge_key(forge, app->regs.patch.property.urid)
+ ref = lv2_atom_forge_key(forge, PATCH__property)
&& lv2_atom_forge_urid(forge, automation->property)
- && lv2_atom_forge_key(forge, app->regs.rdfs.range.urid)
+ && lv2_atom_forge_key(forge, RDFS__range)
&& lv2_atom_forge_urid(forge, automation->range);
}
else
{
- ref = lv2_atom_forge_key(forge, app->regs.synthpod.sink_symbol.urid)
+ ref = lv2_atom_forge_key(forge, SYNTHPOD__sinkSymbol)
&& lv2_atom_forge_string(forge, port->symbol, strlen(port->symbol));
}
}
@@ -1278,44 +1279,44 @@ sp_app_save(sp_app_t *app, LV2_State_Store_Function store,
LV2_Atom_Forge_Frame auto_frame;
if( ref
- && lv2_atom_forge_object(forge, &auto_frame, 0, app->regs.osc.message.urid) )
+ && lv2_atom_forge_object(forge, &auto_frame, 0, OSC__Message) )
{
- ref = lv2_atom_forge_key(forge, app->regs.synthpod.sink_module.urid)
+ ref = lv2_atom_forge_key(forge, SYNTHPOD__sinkModule)
&& lv2_atom_forge_urid(forge, mod->urn)
- && lv2_atom_forge_key(forge, app->regs.osc.path.urid)
+ && lv2_atom_forge_key(forge, OSC__messagePath)
&& lv2_atom_forge_string(forge, oauto->path, strlen(oauto->path))
- && lv2_atom_forge_key(forge, app->regs.synthpod.source_min.urid)
+ && lv2_atom_forge_key(forge, SYNTHPOD__sourceMinimum)
&& lv2_atom_forge_double(forge, automation->a)
- && lv2_atom_forge_key(forge, app->regs.synthpod.source_max.urid)
+ && lv2_atom_forge_key(forge, SYNTHPOD__sourceMaximum)
&& lv2_atom_forge_double(forge, automation->b)
- && lv2_atom_forge_key(forge, app->regs.synthpod.sink_min.urid)
+ && lv2_atom_forge_key(forge, SYNTHPOD__sinkMinimum)
&& lv2_atom_forge_double(forge, automation->c)
- && lv2_atom_forge_key(forge, app->regs.synthpod.sink_max.urid)
+ && lv2_atom_forge_key(forge, SYNTHPOD__sinkMaximum)
&& lv2_atom_forge_double(forge, automation->d)
- && lv2_atom_forge_key(forge, app->regs.synthpod.source_enabled.urid)
+ && lv2_atom_forge_key(forge, SYNTHPOD__sourceEnabled)
&& lv2_atom_forge_bool(forge, automation->src_enabled)
- && lv2_atom_forge_key(forge, app->regs.synthpod.sink_enabled.urid)
+ && lv2_atom_forge_key(forge, SYNTHPOD__sinkEnabled)
&& lv2_atom_forge_bool(forge, automation->snk_enabled);
if(ref)
{
if(automation->property)
{
- ref = lv2_atom_forge_key(forge, app->regs.patch.property.urid)
+ ref = lv2_atom_forge_key(forge, PATCH__property)
&& lv2_atom_forge_urid(forge, automation->property)
- && lv2_atom_forge_key(forge, app->regs.rdfs.range.urid)
+ && lv2_atom_forge_key(forge, RDFS__range)
&& lv2_atom_forge_urid(forge, automation->range);
}
else
{
- ref = lv2_atom_forge_key(forge, app->regs.synthpod.sink_symbol.urid)
+ ref = lv2_atom_forge_key(forge, SYNTHPOD__sinkSymbol)
&& lv2_atom_forge_string(forge, port->symbol, strlen(port->symbol));
}
}
@@ -1336,7 +1337,7 @@ sp_app_save(sp_app_t *app, LV2_State_Store_Function store,
const LV2_Atom *atom = (const LV2_Atom *)ser.buf;
if(ref && atom)
{
- store(hndl, app->regs.synthpod.automation_list.urid,
+ store(hndl, SYNTHPOD__automationList,
LV2_ATOM_BODY_CONST(atom), atom->size, atom->type,
LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE);
}
@@ -1347,23 +1348,23 @@ sp_app_save(sp_app_t *app, LV2_State_Store_Function store,
free(ser.buf);
// spod:graphPositionX
- store(hndl, app->regs.synthpod.graph_position_x.urid,
- &app->pos.x, sizeof(float), app->forge.Float,
+ store(hndl, SYNTHPOD__graphPositionX,
+ &app->pos.x, sizeof(float), ATOM__Float,
LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE);
// spod:graphPositionY
- store(hndl, app->regs.synthpod.graph_position_y.urid,
- &app->pos.y, sizeof(float), app->forge.Float,
+ store(hndl, SYNTHPOD__graphPositionY,
+ &app->pos.y, sizeof(float), ATOM__Float,
LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE);
// spod:columnEnabled
- store(hndl, app->regs.synthpod.column_enabled.urid,
- &app->column_enabled, sizeof(int32_t), app->forge.Bool,
+ store(hndl, SYNTHPOD__columnEnabled,
+ &app->column_enabled, sizeof(int32_t), ATOM__Bool,
LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE);
// spod:rowEnabled
- store(hndl, app->regs.synthpod.row_enabled.urid,
- &app->row_enabled, sizeof(int32_t), app->forge.Bool,
+ store(hndl, SYNTHPOD__rowEnabled,
+ &app->row_enabled, sizeof(int32_t), ATOM__Bool,
LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE);
return LV2_STATE_SUCCESS;
@@ -1392,18 +1393,18 @@ _mod_inject(sp_app_t *app, int32_t mod_uid, LV2_URID mod_urn, const LV2_Atom_Obj
const LV2_Atom_Bool *mod_disabled = NULL;
const LV2_Atom_Int *mod_created = NULL;
lv2_atom_object_get(mod_obj,
- app->regs.synthpod.module_position_x.urid, &mod_pos_x,
- app->regs.synthpod.module_position_y.urid, &mod_pos_y,
- app->regs.synthpod.module_alias.urid, &mod_alias,
- app->regs.ui.ui.urid, &mod_ui,
- app->regs.synthpod.module_visible.urid, &mod_visible,
- app->regs.synthpod.module_disabled.urid, &mod_disabled,
- app->regs.synthpod.module_created.urid, &mod_created,
+ SYNTHPOD__modulePositionX, &mod_pos_x,
+ SYNTHPOD__modulePositionY, &mod_pos_y,
+ SYNTHPOD__moduleAlias, &mod_alias,
+ UI__ui, &mod_ui,
+ SYNTHPOD__moduleVisible, &mod_visible,
+ SYNTHPOD__moduleDisabled, &mod_disabled,
+ SYNTHPOD__moduleCreated, &mod_created,
0);
- const uint32_t created = mod_created && (mod_created->atom.type == app->forge.Int)
+ const uint32_t created = mod_created && (mod_created->atom.type == ATOM__Int)
? mod_created->body : 0;
- const char *alias = mod_alias && (mod_alias->atom.type == app->forge.String)
+ const char *alias = mod_alias && (mod_alias->atom.type == ATOM__String)
? (const char *)LV2_ATOM_BODY_CONST(mod_alias) : NULL;
const char *mod_uri_str = app->driver->unmap->unmap(app->driver->unmap->handle, mod_obj->body.otype);
@@ -1418,15 +1419,15 @@ _mod_inject(sp_app_t *app, int32_t mod_uid, LV2_URID mod_urn, const LV2_Atom_Obj
app->mods[app->num_mods] = mod;
app->num_mods += 1;
- mod->pos.x = mod_pos_x && (mod_pos_x->atom.type == app->forge.Float)
+ mod->pos.x = mod_pos_x && (mod_pos_x->atom.type == ATOM__Float)
? mod_pos_x->body : 0.f;
- mod->pos.y = mod_pos_y && (mod_pos_y->atom.type == app->forge.Float)
+ mod->pos.y = mod_pos_y && (mod_pos_y->atom.type == ATOM__Float)
? mod_pos_y->body : 0.f;
- mod->visible = mod_visible && (mod_visible->atom.type == app->forge.URID)
+ mod->visible = mod_visible && (mod_visible->atom.type == ATOM__URID)
? mod_visible->body : 0;
- mod->disabled = mod_disabled && (mod_disabled->atom.type == app->forge.Bool)
+ mod->disabled = mod_disabled && (mod_disabled->atom.type == ATOM__Bool)
? mod_disabled->body : false;
- mod->ui = mod_ui && (mod_ui->atom.type == app->forge.URID)
+ mod->ui = mod_ui && (mod_ui->atom.type == ATOM__URID)
? mod_ui->body : 0;
mod->uid = mod_uid;
@@ -1471,17 +1472,17 @@ sp_app_stash(sp_app_t *app, LV2_State_Retrieve_Function retrieve,
LV2_State_Handle hndl, uint32_t flags, const LV2_Feature *const *features)
{
const LV2_URID keys [11] = {
- app->regs.core.minor_version.urid,
- app->regs.core.micro_version.urid,
- app->regs.synthpod.module_list.urid,
- app->regs.synthpod.connection_list.urid,
- app->regs.synthpod.node_list.urid,
- app->regs.synthpod.automation_list.urid,
- app->regs.synthpod.graph.urid,
- app->regs.synthpod.graph_position_x.urid,
- app->regs.synthpod.graph_position_y.urid,
- app->regs.synthpod.column_enabled.urid,
- app->regs.synthpod.row_enabled.urid
+ CORE__minorVersion,
+ CORE__microVersion,
+ SYNTHPOD__moduleList,
+ SYNTHPOD__connectionList,
+ SYNTHPOD__nodeList,
+ SYNTHPOD__automationList,
+ SYNTHPOD__graph,
+ SYNTHPOD__graphPositionX,
+ SYNTHPOD__graphPositionY,
+ SYNTHPOD__columnEnabled,
+ SYNTHPOD__rowEnabled
};
const unsigned num_keys = sizeof(keys) / sizeof(LV2_URID);
@@ -1545,34 +1546,34 @@ sp_app_restore(sp_app_t *app, LV2_State_Retrieve_Function retrieve,
uint32_t type;
// retrieve visibility
- const int32_t *visibility = retrieve(hndl, app->regs.synthpod.visibility.urid,
+ const int32_t *visibility = retrieve(hndl, SYNTHPOD__visibility,
&size, &type, &_flags);
- if(visibility && (type == app->forge.Bool) && (size == sizeof(int32_t)) )
+ if(visibility && (type == ATOM__Bool) && (size == sizeof(int32_t)) )
{
sp_app_visibility_set(app, *visibility);
}
// retrieve minor version
- const int32_t *minor_version = retrieve(hndl, app->regs.core.minor_version.urid,
+ const int32_t *minor_version = retrieve(hndl, CORE__minorVersion,
&size, &type, &_flags);
- if(minor_version && (type == app->forge.Int) && (size == sizeof(int32_t)) )
+ if(minor_version && (type == ATOM__Int) && (size == sizeof(int32_t)) )
{
//TODO check with running version
}
// retrieve micro version
- const int32_t *micro_version = retrieve(hndl, app->regs.core.micro_version.urid,
+ const int32_t *micro_version = retrieve(hndl, CORE__microVersion,
&size, &type, &_flags);
- if(micro_version && (type == app->forge.Int) && (size == sizeof(int32_t)) )
+ if(micro_version && (type == ATOM__Int) && (size == sizeof(int32_t)) )
{
//TODO check with running version
}
// retrieve spod:moduleList
- const LV2_Atom_Object_Body *mod_list_body = retrieve(hndl, app->regs.synthpod.module_list.urid,
+ const LV2_Atom_Object_Body *mod_list_body = retrieve(hndl, SYNTHPOD__moduleList,
&size, &type, &_flags);
if( mod_list_body
- && (type == app->forge.Object)
+ && (type == ATOM__Object)
&& (_flags & (LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE)) )
{
_sp_app_reset(app);
@@ -1586,7 +1587,7 @@ sp_app_restore(sp_app_t *app, LV2_State_Retrieve_Function retrieve,
mod_t *mod = _mod_inject(app, mod_index, mod_urn, mod_obj, map_path);
if(!mod)
{
- mod_obj->body.otype = app->regs.synthpod.placeholder.urid;
+ mod_obj->body.otype = SYNTHPOD__placeholder;
mod = _mod_inject(app, mod_index, mod_urn, mod_obj, map_path);
if(!mod)
{
@@ -1607,10 +1608,10 @@ sp_app_restore(sp_app_t *app, LV2_State_Retrieve_Function retrieve,
sp_app_log_error(app, "%s: invaild moduleList\n", __func__);
// retrieve spod:connectionList
- const LV2_Atom_Object_Body *conn_list_body = retrieve(hndl, app->regs.synthpod.connection_list.urid,
+ const LV2_Atom_Object_Body *conn_list_body = retrieve(hndl, SYNTHPOD__connectionList,
&size, &type, &_flags);
if( conn_list_body
- && (type == app->forge.Tuple)
+ && (type == ATOM__Tuple)
&& (_flags & (LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE)) )
{
LV2_ATOM_TUPLE_BODY_FOREACH(conn_list_body, size, item)
@@ -1627,10 +1628,10 @@ sp_app_restore(sp_app_t *app, LV2_State_Retrieve_Function retrieve,
sp_app_log_error(app, "%s: invaild connectionList\n", __func__);
// retrieve spod:nodeList
- const LV2_Atom_Object_Body *node_list_body = retrieve(hndl, app->regs.synthpod.node_list.urid,
+ const LV2_Atom_Object_Body *node_list_body = retrieve(hndl, SYNTHPOD__nodeList,
&size, &type, &_flags);
if( node_list_body
- && (type == app->forge.Tuple)
+ && (type == ATOM__Tuple)
&& (_flags & (LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE)) )
{
LV2_ATOM_TUPLE_BODY_FOREACH(node_list_body, size, item)
@@ -1647,10 +1648,10 @@ sp_app_restore(sp_app_t *app, LV2_State_Retrieve_Function retrieve,
sp_app_log_error(app, "%s: invaild nodeList \n", __func__);
// retrieve spod:automationList
- const LV2_Atom_Object_Body *auto_list_body = retrieve(hndl, app->regs.synthpod.automation_list.urid,
+ const LV2_Atom_Object_Body *auto_list_body = retrieve(hndl, SYNTHPOD__automationList,
&size, &type, &_flags);
if( auto_list_body
- && (type == app->forge.Tuple)
+ && (type == ATOM__Tuple)
&& (_flags & (LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE)) )
{
LV2_ATOM_TUPLE_BODY_FOREACH(auto_list_body, size, item)
@@ -1667,10 +1668,10 @@ sp_app_restore(sp_app_t *app, LV2_State_Retrieve_Function retrieve,
sp_app_log_error(app, "%s: invaild automationList\n", __func__);
// retrieve spod:graphPositionX
- const float *graph_position_x_body = retrieve(hndl, app->regs.synthpod.graph_position_x.urid,
+ const float *graph_position_x_body = retrieve(hndl, SYNTHPOD__graphPositionX,
&size, &type, &_flags);
if( graph_position_x_body
- && (type == app->forge.Float)
+ && (type == ATOM__Float)
&& (_flags & (LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE)) )
{
app->pos.x = *graph_position_x_body;
@@ -1679,10 +1680,10 @@ sp_app_restore(sp_app_t *app, LV2_State_Retrieve_Function retrieve,
sp_app_log_error(app, "%s: invalid graphPositionX\n", __func__);
// retrieve spod:graphPositionY
- const float *graph_position_y_body = retrieve(hndl, app->regs.synthpod.graph_position_y.urid,
+ const float *graph_position_y_body = retrieve(hndl, SYNTHPOD__graphPositionY,
&size, &type, &_flags);
if( graph_position_y_body
- && (type == app->forge.Float)
+ && (type == ATOM__Float)
&& (_flags & (LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE)) )
{
app->pos.y = *graph_position_y_body;
@@ -1691,10 +1692,10 @@ sp_app_restore(sp_app_t *app, LV2_State_Retrieve_Function retrieve,
sp_app_log_error(app, "%s: invalid graphPositionY\n", __func__);
// retrieve spod:columnEnabled
- const int32_t *column_enabled = retrieve(hndl, app->regs.synthpod.column_enabled.urid,
+ const int32_t *column_enabled = retrieve(hndl, SYNTHPOD__columnEnabled,
&size, &type, &_flags);
if( column_enabled
- && (type == app->forge.Bool)
+ && (type == ATOM__Bool)
&& (_flags & (LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE)) )
{
app->column_enabled = *column_enabled;
@@ -1703,10 +1704,10 @@ sp_app_restore(sp_app_t *app, LV2_State_Retrieve_Function retrieve,
sp_app_log_error(app, "%s: invalid columnEnabled\n", __func__);
// retrieve spod:rowEnabled
- const int32_t *row_enabled = retrieve(hndl, app->regs.synthpod.row_enabled.urid,
+ const int32_t *row_enabled = retrieve(hndl, SYNTHPOD__rowEnabled,
&size, &type, &_flags);
if( row_enabled
- && (type == app->forge.Bool)
+ && (type == ATOM__Bool)
&& (_flags & (LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE)) )
{
app->row_enabled = *row_enabled;
@@ -1715,10 +1716,10 @@ sp_app_restore(sp_app_t *app, LV2_State_Retrieve_Function retrieve,
sp_app_log_error(app, "%s: invalid rowEnabled\n", __func__);
// retrieve spod:graph // XXX old save format
- const LV2_Atom_Object_Body *graph_body = retrieve(hndl, app->regs.synthpod.graph.urid,
+ const LV2_Atom_Object_Body *graph_body = retrieve(hndl, SYNTHPOD__graph,
&size, &type, &_flags);
if( graph_body
- && (type == app->forge.Tuple)
+ && (type == ATOM__Tuple)
&& (_flags & (LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE)) )
{
_sp_app_reset(app);
@@ -1733,17 +1734,17 @@ sp_app_restore(sp_app_t *app, LV2_State_Retrieve_Function retrieve,
const LV2_Atom_Int *mod_index = NULL;
lv2_atom_object_get(mod_obj,
- app->regs.core.index.urid, &mod_index,
+ CORE__index, &mod_index,
0);
- if(!mod_index || (mod_index->atom.type != app->forge.Int) )
+ if(!mod_index || (mod_index->atom.type != ATOM__Int) )
continue;
const LV2_URID mod_urn = 0;
mod_t *mod = _mod_inject(app, mod_index->body, mod_urn, mod_obj, map_path);
if(!mod)
{
- mod_obj->body.otype = app->regs.synthpod.placeholder.urid;
+ mod_obj->body.otype = SYNTHPOD__placeholder;
mod = _mod_inject(app, mod_index->body, mod_urn, mod_obj, map_path);
if(mod)
{
@@ -1764,10 +1765,10 @@ sp_app_restore(sp_app_t *app, LV2_State_Retrieve_Function retrieve,
const LV2_Atom_Int *mod_index = NULL;
lv2_atom_object_get(mod_obj,
- app->regs.core.index.urid, &mod_index,
+ CORE__index, &mod_index,
0);
- if(!mod_index || (mod_index->atom.type != app->forge.Int) )
+ if(!mod_index || (mod_index->atom.type != ATOM__Int) )
continue;
mod_t *mod = _sp_app_mod_get_by_uid(app, mod_index->body);
@@ -1778,17 +1779,17 @@ sp_app_restore(sp_app_t *app, LV2_State_Retrieve_Function retrieve,
{
const LV2_Atom_Object *port_obj = (const LV2_Atom_Object *)&item->value;
- if( (item->key != app->regs.core.port.urid)
+ if( (item->key != CORE__port)
|| !lv2_atom_forge_is_object_type(&app->forge, port_obj->atom.type)
- || (port_obj->body.otype != app->regs.core.Port.urid) )
+ || (port_obj->body.otype != CORE__Port) )
continue;
const LV2_Atom_String *port_symbol = NULL;
lv2_atom_object_get(port_obj,
- app->regs.core.symbol.urid, &port_symbol,
+ CORE__symbol, &port_symbol,
0);
- if(!port_symbol || (port_symbol->atom.type != app->forge.String) )
+ if(!port_symbol || (port_symbol->atom.type != ATOM__String) )
continue;
const char *port_symbol_str = LV2_ATOM_BODY_CONST(port_symbol);
@@ -1805,20 +1806,20 @@ sp_app_restore(sp_app_t *app, LV2_State_Retrieve_Function retrieve,
{
const LV2_Atom_Object *source_obj = (const LV2_Atom_Object *)&sub->value;
- if( (sub->key != app->regs.core.port.urid)
+ if( (sub->key != CORE__port)
|| !lv2_atom_forge_is_object_type(&app->forge, source_obj->atom.type)
- || (source_obj->body.otype != app->regs.core.Port.urid) )
+ || (source_obj->body.otype != CORE__Port) )
continue;
const LV2_Atom_String *source_symbol = NULL;
const LV2_Atom_Int *source_index = NULL;
lv2_atom_object_get(source_obj,
- app->regs.core.symbol.urid, &source_symbol,
- app->regs.core.index.urid, &source_index,
+ CORE__symbol, &source_symbol,
+ CORE__index, &source_index,
0);
- if( !source_symbol || (source_symbol->atom.type != app->forge.String)
- || !source_index || (source_index->atom.type != app->forge.Int) )
+ if( !source_symbol || (source_symbol->atom.type != ATOM__String)
+ || !source_index || (source_index->atom.type != ATOM__Int) )
continue;
const char *source_symbol_str = LV2_ATOM_BODY_CONST(source_symbol);
diff --git a/app/synthpod_app_ui.c b/app/synthpod_app_ui.c
index 55adda27..91b9f9d4 100644
--- a/app/synthpod_app_ui.c
+++ b/app/synthpod_app_ui.c
@@ -17,6 +17,7 @@
#include <synthpod_app_private.h>
#include <synthpod_patcher.h>
+#include <synthpod_stat.h>
static inline bool
_mod_needs_ramping(mod_t *mod, ramp_state_t state, bool silencing)
@@ -102,7 +103,7 @@ _sp_app_ui_set_modlist(sp_app_t *app, LV2_URID subj, int32_t seqn)
{
LV2_Atom_Forge_Frame frame [2];
LV2_Atom_Forge_Ref ref = synthpod_patcher_set_object(
- &app->regs, &app->forge, &frame[0], subj, seqn, app->regs.synthpod.module_list.urid);
+ &app->forge, &frame[0], subj, seqn, SYNTHPOD__moduleList);
if(ref)
ref = lv2_atom_forge_tuple(&app->forge, &frame[1]);
for(unsigned m = 0; m < app->num_mods; m++)
@@ -135,70 +136,70 @@ _sp_app_forge_midi_automation(sp_app_t *app, LV2_Atom_Forge_Frame *frame,
const midi_auto_t *mauto = &automation->midi;
LV2_Atom_Forge_Ref ref;
- ref = lv2_atom_forge_object(&app->forge, frame, 0, app->regs.midi.Controller.urid);
+ ref = lv2_atom_forge_object(&app->forge, frame, 0, MIDI__Controller);
if(ref)
{
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.synthpod.sink_module.urid);
+ ref = lv2_atom_forge_key(&app->forge, SYNTHPOD__sinkModule);
if(ref)
ref = lv2_atom_forge_urid(&app->forge, mod->urn);
if(automation->property)
{
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.patch.property.urid);
+ ref = lv2_atom_forge_key(&app->forge, PATCH__property);
if(ref)
ref = lv2_atom_forge_urid(&app->forge, automation->property);
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.rdfs.range.urid);
+ ref = lv2_atom_forge_key(&app->forge, RDFS__range);
if(ref)
ref = lv2_atom_forge_urid(&app->forge, automation->range);
}
else
{
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.synthpod.sink_symbol.urid);
+ ref = lv2_atom_forge_key(&app->forge, SYNTHPOD__sinkSymbol);
if(ref)
ref = lv2_atom_forge_string(&app->forge, port->symbol, strlen(port->symbol));
}
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.midi.channel.urid);
+ ref = lv2_atom_forge_key(&app->forge, MIDI__channel);
if(ref)
ref = lv2_atom_forge_int(&app->forge, mauto->channel);
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.midi.controller_number.urid);
+ ref = lv2_atom_forge_key(&app->forge, MIDI__controllerNumber);
if(ref)
ref = lv2_atom_forge_int(&app->forge, mauto->controller);
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.synthpod.source_min.urid);
+ ref = lv2_atom_forge_key(&app->forge, SYNTHPOD__sourceMinimum);
if(ref)
ref = lv2_atom_forge_double(&app->forge, automation->a);
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.synthpod.source_max.urid);
+ ref = lv2_atom_forge_key(&app->forge, SYNTHPOD__sourceMaximum);
if(ref)
ref = lv2_atom_forge_double(&app->forge, automation->b);
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.synthpod.sink_min.urid);
+ ref = lv2_atom_forge_key(&app->forge, SYNTHPOD__sinkMinimum);
if(ref)
ref = lv2_atom_forge_double(&app->forge, automation->c);
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.synthpod.sink_max.urid);
+ ref = lv2_atom_forge_key(&app->forge, SYNTHPOD__sinkMaximum);
if(ref)
ref = lv2_atom_forge_double(&app->forge, automation->d);
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.synthpod.source_enabled.urid);
+ ref = lv2_atom_forge_key(&app->forge, SYNTHPOD__sourceEnabled);
if(ref)
ref = lv2_atom_forge_bool(&app->forge, automation->src_enabled);
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.synthpod.sink_enabled.urid);
+ ref = lv2_atom_forge_key(&app->forge, SYNTHPOD__sinkEnabled);
if(ref)
ref = lv2_atom_forge_bool(&app->forge, automation->snk_enabled);
}
@@ -215,65 +216,65 @@ _sp_app_forge_osc_automation(sp_app_t *app, LV2_Atom_Forge_Frame *frame,
const osc_auto_t *oauto = &automation->osc;
LV2_Atom_Forge_Ref ref;
- ref = lv2_atom_forge_object(&app->forge, frame, 0, app->regs.osc.message.urid);
+ ref = lv2_atom_forge_object(&app->forge, frame, 0, OSC__Message);
if(ref)
{
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.synthpod.sink_module.urid);
+ ref = lv2_atom_forge_key(&app->forge, SYNTHPOD__sinkModule);
if(ref)
ref = lv2_atom_forge_urid(&app->forge, mod->urn);
if(automation->property)
{
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.patch.property.urid);
+ ref = lv2_atom_forge_key(&app->forge, PATCH__property);
if(ref)
ref = lv2_atom_forge_urid(&app->forge, automation->property);
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.rdfs.range.urid);
+ ref = lv2_atom_forge_key(&app->forge, RDFS__range);
if(ref)
ref = lv2_atom_forge_urid(&app->forge, automation->range);
}
else
{
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.synthpod.sink_symbol.urid);
+ ref = lv2_atom_forge_key(&app->forge, SYNTHPOD__sinkSymbol);
if(ref)
ref = lv2_atom_forge_string(&app->forge, port->symbol, strlen(port->symbol));
}
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.osc.path.urid);
+ ref = lv2_atom_forge_key(&app->forge, OSC__messagePath);
if(ref)
ref = lv2_atom_forge_string(&app->forge, oauto->path, strlen(oauto->path));
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.synthpod.source_min.urid);
+ ref = lv2_atom_forge_key(&app->forge, SYNTHPOD__sourceMinimum);
if(ref)
ref = lv2_atom_forge_double(&app->forge, automation->a);
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.synthpod.source_max.urid);
+ ref = lv2_atom_forge_key(&app->forge, SYNTHPOD__sourceMaximum);
if(ref)
ref = lv2_atom_forge_double(&app->forge, automation->b);
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.synthpod.sink_min.urid);
+ ref = lv2_atom_forge_key(&app->forge, SYNTHPOD__sinkMinimum);
if(ref)
ref = lv2_atom_forge_double(&app->forge, automation->c);
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.synthpod.sink_max.urid);
+ ref = lv2_atom_forge_key(&app->forge, SYNTHPOD__sinkMaximum);
if(ref)
ref = lv2_atom_forge_double(&app->forge, automation->d);
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.synthpod.source_enabled.urid);
+ ref = lv2_atom_forge_key(&app->forge, SYNTHPOD__sourceEnabled);
if(ref)
ref = lv2_atom_forge_bool(&app->forge, automation->src_enabled);
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.synthpod.sink_enabled.urid);
+ ref = lv2_atom_forge_key(&app->forge, SYNTHPOD__sinkEnabled);
if(ref)
ref = lv2_atom_forge_bool(&app->forge, automation->snk_enabled);
}
@@ -293,16 +294,16 @@ _sp_app_from_ui_patch_get(sp_app_t *app, const LV2_Atom *atom)
const LV2_Atom_URID *property = NULL;
lv2_atom_object_get(obj,
- app->regs.patch.subject.urid, &subject,
- app->regs.patch.sequence_number.urid, &seqn,
- app->regs.patch.property.urid, &property,
+ PATCH__subject, &subject,
+ PATCH__sequenceNumber, &seqn,
+ PATCH__property, &property,
0);
- const LV2_URID subj = subject && (subject->atom.type == app->forge.URID)
+ const LV2_URID subj = subject && (subject->atom.type == ATOM__URID)
? subject->body : 0;
- const int32_t sn = seqn && (seqn->atom.type == app->forge.Int)
+ const int32_t sn = seqn && (seqn->atom.type == ATOM__Int)
? seqn->body : 0;
- const LV2_URID prop = property && (property->atom.type == app->forge.URID)
+ const LV2_URID prop = property && (property->atom.type == ATOM__URID)
? property->body : 0;
//printf("got patch:Get for <%s>\n", app->driver->unmap->unmap(app->driver->unmap->handle, subj));
@@ -311,18 +312,18 @@ _sp_app_from_ui_patch_get(sp_app_t *app, const LV2_Atom *atom)
{
//printf("\tpatch:property <%s>\n", app->driver->unmap->unmap(app->driver->unmap->handle, prop));
- if(prop == app->regs.synthpod.module_list.urid)
+ if(prop == SYNTHPOD__moduleList)
{
_sp_app_ui_set_modlist(app, subj, sn);
}
- else if(prop == app->regs.synthpod.connection_list.urid)
+ else if(prop == SYNTHPOD__connectionList)
{
LV2_Atom *answer = _sp_app_to_ui_request_atom(app);
if(answer)
{
LV2_Atom_Forge_Frame frame [3];
LV2_Atom_Forge_Ref ref = synthpod_patcher_set_object(
- &app->regs, &app->forge, &frame[0], subj, sn, prop);
+ &app->forge, &frame[0], subj, sn, prop);
if(ref)
ref = lv2_atom_forge_tuple(&app->forge, &frame[1]);
for(unsigned m = 0; m < app->num_mods; m++)
@@ -344,27 +345,27 @@ _sp_app_from_ui_patch_get(sp_app_t *app, const LV2_Atom *atom)
ref = lv2_atom_forge_object(&app->forge, &frame[2], 0, 0);
{
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.synthpod.source_module.urid);
+ ref = lv2_atom_forge_key(&app->forge, SYNTHPOD__sourceModule);
if(ref)
ref = lv2_atom_forge_urid(&app->forge, source->port->mod->urn);
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.synthpod.source_symbol.urid);
+ ref = lv2_atom_forge_key(&app->forge, SYNTHPOD__sourceSymbol);
if(ref)
ref = lv2_atom_forge_string(&app->forge, source->port->symbol, strlen(source->port->symbol));
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.synthpod.sink_module.urid);
+ ref = lv2_atom_forge_key(&app->forge, SYNTHPOD__sinkModule);
if(ref)
ref = lv2_atom_forge_urid(&app->forge, port->mod->urn);
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.synthpod.sink_symbol.urid);
+ ref = lv2_atom_forge_key(&app->forge, SYNTHPOD__sinkSymbol);
if(ref)
ref = lv2_atom_forge_string(&app->forge, port->symbol, strlen(port->symbol));
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.param.gain.urid);
+ ref = lv2_atom_forge_key(&app->forge, PARAMETERS__gain);
if(ref)
ref = lv2_atom_forge_float(&app->forge, source->gain);
}
@@ -389,14 +390,14 @@ _sp_app_from_ui_patch_get(sp_app_t *app, const LV2_Atom *atom)
_sp_app_to_ui_overflow(app);
}
}
- else if(prop == app->regs.synthpod.node_list.urid)
+ else if(prop == SYNTHPOD__nodeList)
{
LV2_Atom *answer = _sp_app_to_ui_request_atom(app);
if(answer)
{
LV2_Atom_Forge_Frame frame [3];
LV2_Atom_Forge_Ref ref = synthpod_patcher_set_object(
- &app->regs, &app->forge, &frame[0], subj, sn, prop);
+ &app->forge, &frame[0], subj, sn, prop);
if(ref)
ref = lv2_atom_forge_tuple(&app->forge, &frame[1]);
for(unsigned m1 = 0; m1 < app->num_mods; m1++)
@@ -442,22 +443,22 @@ _sp_app_from_ui_patch_get(sp_app_t *app, const LV2_Atom *atom)
ref = lv2_atom_forge_object(&app->forge, &frame[2], 0, 0);
{
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.synthpod.source_module.urid);
+ ref = lv2_atom_forge_key(&app->forge, SYNTHPOD__sourceModule);
if(ref)
ref = lv2_atom_forge_urid(&app->forge, src_mod->urn);
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.synthpod.sink_module.urid);
+ ref = lv2_atom_forge_key(&app->forge, SYNTHPOD__sinkModule);
if(ref)
ref = lv2_atom_forge_urid(&app->forge, snk_mod->urn);
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.synthpod.node_position_x.urid);
+ ref = lv2_atom_forge_key(&app->forge, SYNTHPOD__nodePositionX);
if(ref)
ref = lv2_atom_forge_float(&app->forge, x);
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.synthpod.node_position_y.urid);
+ ref = lv2_atom_forge_key(&app->forge, SYNTHPOD__nodePositionY);
if(ref)
ref = lv2_atom_forge_float(&app->forge, y);
}
@@ -481,7 +482,7 @@ _sp_app_from_ui_patch_get(sp_app_t *app, const LV2_Atom *atom)
_sp_app_to_ui_overflow(app);
}
}
- else if(prop == app->regs.pset.preset.urid)
+ else if(prop == PRESETS__Preset)
{
LV2_Atom *answer = _sp_app_to_ui_request_atom(app);
if(answer)
@@ -489,8 +490,8 @@ _sp_app_from_ui_patch_get(sp_app_t *app, const LV2_Atom *atom)
const LV2_URID bundle_urid = app->driver->map->map(app->driver->map->handle, app->bundle_path); //FIXME store bundle path as URID
LV2_Atom_Forge_Ref ref = synthpod_patcher_set(
- &app->regs, &app->forge, subj, sn, prop,
- sizeof(uint32_t), app->forge.URID, &bundle_urid);
+ &app->forge, subj, sn, prop,
+ sizeof(uint32_t), ATOM__URID, &bundle_urid);
if(ref)
{
_sp_app_to_ui_advance_atom(app, answer);
@@ -505,7 +506,7 @@ _sp_app_from_ui_patch_get(sp_app_t *app, const LV2_Atom *atom)
_sp_app_to_ui_overflow(app);
}
}
- else if(prop == app->regs.synthpod.automation_list.urid)
+ else if(prop == SYNTHPOD__automationList)
{
//printf("patch:Get for spod:automationList\n");
@@ -514,7 +515,7 @@ _sp_app_from_ui_patch_get(sp_app_t *app, const LV2_Atom *atom)
{
LV2_Atom_Forge_Frame frame [3];
LV2_Atom_Forge_Ref ref = synthpod_patcher_set_object(
- &app->regs, &app->forge, &frame[0], subj, sn, prop);
+ &app->forge, &frame[0], subj, sn, prop);
if(ref)
ref = lv2_atom_forge_tuple(&app->forge, &frame[1]);
@@ -555,15 +556,15 @@ _sp_app_from_ui_patch_get(sp_app_t *app, const LV2_Atom *atom)
_sp_app_to_ui_overflow(app);
}
}
- else if(prop == app->regs.synthpod.graph_position_x.urid)
+ else if(prop == SYNTHPOD__graphPositionX)
{
//printf("patch:Get for spod:graphPositionX\n");
LV2_Atom *answer = _sp_app_to_ui_request_atom(app);
if(answer)
{
LV2_Atom_Forge_Ref ref = synthpod_patcher_set(
- &app->regs, &app->forge, subj, sn, prop,
- sizeof(float), app->forge.Float, &app->pos.x);
+ &app->forge, subj, sn, prop,
+ sizeof(float), ATOM__Float, &app->pos.x);
if(ref)
{
_sp_app_to_ui_advance_atom(app, answer);
@@ -578,15 +579,15 @@ _sp_app_from_ui_patch_get(sp_app_t *app, const LV2_Atom *atom)
_sp_app_to_ui_overflow(app);
}
}
- else if(prop == app->regs.synthpod.graph_position_y.urid)
+ else if(prop == SYNTHPOD__graphPositionY)
{
//printf("patch:Get for spod:graphPositionY\n");
LV2_Atom *answer = _sp_app_to_ui_request_atom(app);
if(answer)
{
LV2_Atom_Forge_Ref ref = synthpod_patcher_set(
- &app->regs, &app->forge, subj, sn, prop,
- sizeof(float), app->forge.Float, &app->pos.y);
+ &app->forge, subj, sn, prop,
+ sizeof(float), ATOM__Float, &app->pos.y);
if(ref)
{
_sp_app_to_ui_advance_atom(app, answer);
@@ -601,15 +602,15 @@ _sp_app_from_ui_patch_get(sp_app_t *app, const LV2_Atom *atom)
_sp_app_to_ui_overflow(app);
}
}
- else if(prop == app->regs.synthpod.column_enabled.urid)
+ else if(prop == SYNTHPOD__columnEnabled)
{
//printf("patch:Get for spod:columnEnabled\n");
LV2_Atom *answer = _sp_app_to_ui_request_atom(app);
if(answer)
{
LV2_Atom_Forge_Ref ref = synthpod_patcher_set(
- &app->regs, &app->forge, subj, sn, prop,
- sizeof(int32_t), app->forge.Bool, &app->column_enabled);
+ &app->forge, subj, sn, prop,
+ sizeof(int32_t), ATOM__Bool, &app->column_enabled);
if(ref)
{
_sp_app_to_ui_advance_atom(app, answer);
@@ -624,15 +625,15 @@ _sp_app_from_ui_patch_get(sp_app_t *app, const LV2_Atom *atom)
_sp_app_to_ui_overflow(app);
}
}
- else if(prop == app->regs.synthpod.row_enabled.urid)
+ else if(prop == SYNTHPOD__rowEnabled)
{
//printf("patch:Get for spod:rowEnabled\n");
LV2_Atom *answer = _sp_app_to_ui_request_atom(app);
if(answer)
{
LV2_Atom_Forge_Ref ref = synthpod_patcher_set(
- &app->regs, &app->forge, subj, sn, prop,
- sizeof(int32_t), app->forge.Bool, &app->row_enabled);
+ &app->forge, subj, sn, prop,
+ sizeof(int32_t), ATOM__Bool, &app->row_enabled);
if(ref)
{
_sp_app_to_ui_advance_atom(app, answer);
@@ -647,7 +648,7 @@ _sp_app_from_ui_patch_get(sp_app_t *app, const LV2_Atom *atom)
_sp_app_to_ui_overflow(app);
}
}
- else if(prop == app->regs.synthpod.cpus_available.urid)
+ else if(prop == SYNTHPOD__CPUsAvailable)
{
LV2_Atom *answer = _sp_app_to_ui_request_atom(app);
if(answer)
@@ -655,8 +656,8 @@ _sp_app_from_ui_patch_get(sp_app_t *app, const LV2_Atom *atom)
const int32_t cpus_available = app->dsp_master.num_slaves + 1;
LV2_Atom_Forge_Ref ref = synthpod_patcher_set(
- &app->regs, &app->forge, subj, sn, prop,
- sizeof(int32_t), app->forge.Int, &cpus_available);
+ &app->forge, subj, sn, prop,
+ sizeof(int32_t), ATOM__Int, &cpus_available);
if(ref)
{
_sp_app_to_ui_advance_atom(app, answer);
@@ -671,7 +672,7 @@ _sp_app_from_ui_patch_get(sp_app_t *app, const LV2_Atom *atom)
_sp_app_to_ui_overflow(app);
}
}
- else if(prop == app->regs.synthpod.cpus_used.urid)
+ else if(prop == SYNTHPOD__CPUsUsed)
{
LV2_Atom *answer = _sp_app_to_ui_request_atom(app);
if(answer)
@@ -681,8 +682,8 @@ _sp_app_from_ui_patch_get(sp_app_t *app, const LV2_Atom *atom)
: app->dsp_master.concurrent;
LV2_Atom_Forge_Ref ref = synthpod_patcher_set(
- &app->regs, &app->forge, subj, sn, prop,
- sizeof(int32_t), app->forge.Int, &cpus_used);
+ &app->forge, subj, sn, prop,
+ sizeof(int32_t), ATOM__Int, &cpus_used);
if(ref)
{
_sp_app_to_ui_advance_atom(app, answer);
@@ -697,7 +698,7 @@ _sp_app_from_ui_patch_get(sp_app_t *app, const LV2_Atom *atom)
_sp_app_to_ui_overflow(app);
}
}
- else if(prop == app->regs.synthpod.period_size.urid)
+ else if(prop == SYNTHPOD__periodSize)
{
LV2_Atom *answer = _sp_app_to_ui_request_atom(app);
if(answer)
@@ -705,8 +706,8 @@ _sp_app_from_ui_patch_get(sp_app_t *app, const LV2_Atom *atom)
const int32_t period_size = app->driver->max_block_size;
LV2_Atom_Forge_Ref ref = synthpod_patcher_set(
- &app->regs, &app->forge, subj, sn, prop,
- sizeof(int32_t), app->forge.Int, &period_size);
+ &app->forge, subj, sn, prop,
+ sizeof(int32_t), ATOM__Int, &period_size);
if(ref)
{
_sp_app_to_ui_advance_atom(app, answer);
@@ -721,7 +722,7 @@ _sp_app_from_ui_patch_get(sp_app_t *app, const LV2_Atom *atom)
_sp_app_to_ui_overflow(app);
}
}
- else if(prop == app->regs.synthpod.num_periods.urid)
+ else if(prop == SYNTHPOD__numPeriods)
{
LV2_Atom *answer = _sp_app_to_ui_request_atom(app);
if(answer)
@@ -729,8 +730,8 @@ _sp_app_from_ui_patch_get(sp_app_t *app, const LV2_Atom *atom)
const int32_t num_periods = app->driver->num_periods;
LV2_Atom_Forge_Ref ref = synthpod_patcher_set(
- &app->regs, &app->forge, subj, sn, prop,
- sizeof(int32_t), app->forge.Int, &num_periods);
+ &app->forge, subj, sn, prop,
+ sizeof(int32_t), ATOM__Int, &num_periods);
if(ref)
{
_sp_app_to_ui_advance_atom(app, answer);
@@ -760,29 +761,29 @@ _sp_app_from_ui_patch_get(sp_app_t *app, const LV2_Atom *atom)
{
LV2_Atom_Forge_Frame frame [2];
LV2_Atom_Forge_Ref ref = synthpod_patcher_put_object(
- &app->regs, &app->forge, &frame[0], subj, sn);
+ &app->forge, &frame[0], subj, sn);
if(ref)
ref = lv2_atom_forge_object(&app->forge, &frame[1], 0, 0);
{
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.core.plugin.urid);
+ ref = lv2_atom_forge_key(&app->forge, CORE__Plugin);
if(ref)
ref = lv2_atom_forge_urid(&app->forge, mod->plug_urid);
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.synthpod.module_position_x.urid);
+ ref = lv2_atom_forge_key(&app->forge, SYNTHPOD__modulePositionX);
if(ref)
ref = lv2_atom_forge_float(&app->forge, mod->pos.x);
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.synthpod.module_position_y.urid);
+ ref = lv2_atom_forge_key(&app->forge, SYNTHPOD__modulePositionY);
if(ref)
ref = lv2_atom_forge_float(&app->forge, mod->pos.y);
if(strlen(mod->alias))
{
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.synthpod.module_alias.urid);
+ ref = lv2_atom_forge_key(&app->forge, SYNTHPOD__moduleAlias);
if(ref)
ref = lv2_atom_forge_string(&app->forge, mod->alias, strlen(mod->alias));
}
@@ -790,13 +791,13 @@ _sp_app_from_ui_patch_get(sp_app_t *app, const LV2_Atom *atom)
if(mod->ui)
{
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.ui.ui.urid);
+ ref = lv2_atom_forge_key(&app->forge, UI__ui);
if(ref)
ref = lv2_atom_forge_urid(&app->forge, mod->ui);
}
if(ref)
- ref = lv2_atom_forge_key(&app->forge, app->regs.ui.instance_access.urid);
+ ref = lv2_atom_forge_key(&app->forge, INSTANCE_ACCESS);
if(ref)
ref = lv2_atom_forge_long(&app->forge, (intptr_t)mod->inst);
}
@@ -834,17 +835,17 @@ _sp_app_from_ui_patch_set(sp_app_t *app, const LV2_Atom *atom)
const LV2_Atom *value = NULL;
lv2_atom_object_get(obj,
- app->regs.patch.subject.urid, &subject,
- app->regs.patch.sequence_number.urid, &seqn,
- app->regs.patch.property.urid, &property,
- app->regs.patch.value.urid, &value,
+ PATCH__subject, &subject,
+ PATCH__sequenceNumber, &seqn,
+ PATCH__property, &property,
+ PATCH__value, &value,
0);
- const LV2_URID subj = subject && (subject->atom.type == app->forge.URID)
+ const LV2_URID subj = subject && (subject->atom.type == ATOM__URID)
? subject->body : 0;
- const int32_t sn = seqn && (seqn->atom.type == app->forge.Int)
+ const int32_t sn = seqn && (seqn->atom.type == ATOM__Int)
? seqn->body : 0;
- const LV2_URID prop = property && (property->atom.type == app->forge.URID)
+ const LV2_URID prop = property && (property->atom.type == ATOM__URID)
? property->body : 0;
if(subj && prop && value) // is for a module
@@ -854,20 +855,20 @@ _sp_app_from_ui_patch_set(sp_app_t *app, const LV2_Atom *atom)
mod_t *mod = _mod_find_by_urn(app, subj);
if(mod)
{
- if( (prop == app->regs.synthpod.module_position_x.urid)
- && (value->type == app->forge.Float) )
+ if( (prop == SYNTHPOD__modulePositionX)
+ && (value->type == ATOM__Float) )
{
mod->pos.x = ((const LV2_Atom_Float *)value)->body;
_sp_app_order(app);
}
- else if( (prop == app->regs.synthpod.module_position_y.urid)
- && (value->type == app->forge.Float) )
+ else if( (prop == SYNTHPOD__modulePositionY)
+ && (value->type == ATOM__Float) )
{
mod->pos.y = ((const LV2_Atom_Float *)value)->body;
_sp_app_order(app);
}
- else if( (prop == app->regs.synthpod.module_alias.urid)
- && (value->type == app->forge.String) )
+ else if( (prop == SYNTHPOD__moduleAlias)
+ && (value->type == ATOM__String) )
{
strncpy(mod->alias, LV2_ATOM_BODY_CONST(value), ALIAS_MAX - 1);
@@ -888,13 +889,13 @@ _sp_app_from_ui_patch_set(sp_app_t *app, const LV2_Atom *atom)
}
}
}
- else if( (prop == app->regs.ui.ui.urid)
- && (value->type == app->forge.URID) )
+ else if( (prop == UI__ui)
+ && (value->type == ATOM__URID) )
{
mod->ui = ((const LV2_Atom_URID *)value)->body;
}
- else if( (prop == app->regs.pset.preset.urid)
- && (value->type == app->forge.URID) )
+ else if( (prop == PRESETS__Preset)
+ && (value->type == ATOM__URID) )
{
if(app->block_state == BLOCKING_STATE_RUN)
{
@@ -946,15 +947,15 @@ _sp_app_from_ui_patch_set(sp_app_t *app, const LV2_Atom *atom)
}
}
}
- else if( (prop == app->regs.idisp.surface.urid)
- && (value->type == app->forge.Bool) )
+ else if( (prop == INLINEDISPLAY__surface)
+ && (value->type == ATOM__Bool) )
{
mod->idisp.subscribed = ((const LV2_Atom_Bool *)value)->body;
_sp_app_mod_queue_draw(mod); // trigger update
}
- else if( (prop == app->regs.synthpod.module_reinstantiate.urid)
- && (value->type == app->forge.Bool) )
+ else if( (prop == SYNTHPOD__moduleReinstantiate)
+ && (value->type == ATOM__Bool) )
{
if(app->block_state == BLOCKING_STATE_RUN)
{
@@ -1011,23 +1012,23 @@ _sp_app_from_ui_patch_set(sp_app_t *app, const LV2_Atom *atom)
}
else if(prop && value)// is for host
{
- if( (prop == app->regs.synthpod.graph_position_x.urid)
- && (value->type == app->forge.Float) )
+ if( (prop == SYNTHPOD__graphPositionX)
+ && (value->type == ATOM__Float) )
{
app->pos.x = ((const LV2_Atom_Float *)value)->body;
}
- else if( (prop == app->regs.synthpod.graph_position_y.urid)
- && (value->type == app->forge.Float) )
+ else if( (prop == SYNTHPOD__graphPositionY)
+ && (value->type == ATOM__Float) )
{
app->pos.y = ((const LV2_Atom_Float *)value)->body;
}
- else if( (prop == app->regs.synthpod.column_enabled.urid)
- && (value->type == app->forge.Bool) )
+ else if( (prop == SYNTHPOD__columnEnabled)
+ && (value->type == ATOM__Bool) )
{
app->column_enabled = ((const LV2_Atom_Bool *)value)->body;
}
- else if( (prop == app->regs.synthpod.row_enabled.urid)
- && (value->type == app->forge.Bool) )
+ else if( (prop == SYNTHPOD__rowEnabled)
+ && (value->type == ATOM__Bool) )
{
app->row_enabled = ((const LV2_Atom_Bool *)value)->body;
}
@@ -1046,16 +1047,16 @@ _sp_app_from_ui_patch_copy(sp_app_t *app, const LV2_Atom *atom)
const LV2_Atom_URID *destination = NULL;
lv2_atom_object_get(obj,
- app->regs.patch.subject.urid, &subject,
- app->regs.patch.sequence_number.urid, &seqn,
- app->regs.patch.destination.urid, &destination,
+ PATCH__subject, &subject,
+ PATCH__sequenceNumber, &seqn,
+ PATCH__destination, &destination,
0);
- const LV2_URID subj = subject && (subject->atom.type == app->forge.URID)
+ const LV2_URID subj = subject && (subject->atom.type == ATOM__URID)
? subject->body : 0;
- const int32_t sn = seqn && (seqn->atom.type == app->forge.Int)
+ const int32_t sn = seqn && (seqn->atom.type == ATOM__Int)
? seqn->body : 0;
- const LV2_URID dest = destination && (destination->atom.type == app->forge.URID)
+ const LV2_URID dest = destination && (destination->atom.type == ATOM__URID)
? destination->body : 0;
if(!subj && dest) // save bundle to dest
@@ -1204,11 +1205,11 @@ _connection_list_add(sp_app_t *app, const LV2_Atom_Object *obj)
const LV2_Atom_Float *link_gain = NULL;
lv2_atom_object_get(obj,
- app->regs.synthpod.source_module.urid, &src_module,
- app->regs.synthpod.source_symbol.urid, &src_symbol,
- app->regs.synthpod.sink_module.urid, &snk_module,
- app->regs.synthpod.sink_symbol.urid, &snk_symbol,
- app->regs.param.gain.urid, &link_gain,
+ SYNTHPOD__sourceModule, &src_module,
+ SYNTHPOD__sourceSymbol, &src_symbol,
+ SYNTHPOD__sinkModule, &snk_module,
+ SYNTHPOD__sinkSymbol, &snk_symbol,
+ PARAMETERS__gain, &link_gain,
0);
const LV2_URID src_urn = src_module
@@ -1236,8 +1237,8 @@ _connection_list_add(sp_app_t *app, const LV2_Atom_Object *obj)
LV2_Atom *answer = _sp_app_to_ui_request_atom(app);
if(answer)
{
- LV2_Atom_Forge_Ref ref = synthpod_patcher_add_atom(&app->regs, &app->forge,
- 0, 0, app->regs.synthpod.connection_list.urid, &obj->atom); //TODO subject
+ LV2_Atom_Forge_Ref ref = synthpod_patcher_add_atom(&app->forge,
+ 0, 0, SYNTHPOD__connectionList, &obj->atom); //TODO subject
if(ref)
{
_sp_app_to_ui_advance_atom(app, answer);
@@ -1266,10 +1267,10 @@ _connection_list_rem(sp_app_t *app, const LV2_Atom_Object *obj)
const LV2_Atom *snk_symbol = NULL;
lv2_atom_object_get(obj,
- app->regs.synthpod.source_module.urid, &src_module,
- app->regs.synthpod.source_symbol.urid, &src_symbol,
- app->regs.synthpod.sink_module.urid, &snk_module,
- app->regs.synthpod.sink_symbol.urid, &snk_symbol,
+ SYNTHPOD__sourceModule, &src_module,
+ SYNTHPOD__sourceSymbol, &src_symbol,
+ SYNTHPOD__sinkModule, &snk_module,
+ SYNTHPOD__sinkSymbol, &snk_symbol,
0);
const LV2_URID src_urn = src_module
@@ -1295,8 +1296,8 @@ _connection_list_rem(sp_app_t *app, const LV2_Atom_Object *obj)
LV2_Atom *answer = _sp_app_to_ui_request_atom(app);
if(answer)
{
- LV2_Atom_Forge_Ref ref = synthpod_patcher_remove_atom(&app->regs, &app->forge,
- 0, 0, app->regs.synthpod.connection_list.urid, &obj->atom); //TODO subject
+ LV2_Atom_Forge_Ref ref = synthpod_patcher_remove_atom(&app->forge,
+ 0, 0, SYNTHPOD__connectionList, &obj->atom); //TODO subject
if(ref)
{
_sp_app_to_ui_advance_atom(app, answer);
@@ -1325,10 +1326,10 @@ _node_list_add(sp_app_t *app, const LV2_Atom_Object *obj)
const LV2_Atom_Float *pos_y = NULL;
lv2_atom_object_get(obj,
- app->regs.synthpod.source_module.urid, &src_module,
- app->regs.synthpod.sink_module.urid, &snk_module,
- app->regs.synthpod.node_position_x.urid, &pos_x,
- app->regs.synthpod.node_position_y.urid, &pos_y,
+ SYNTHPOD__sourceModule, &src_module,
+ SYNTHPOD__sinkModule, &snk_module,
+ SYNTHPOD__nodePositionX, &pos_x,
+ SYNTHPOD__nodePositionY, &pos_y,
0);
const LV2_URID src_urn = src_module
@@ -1382,8 +1383,8 @@ _subscription_list_add(sp_app_t *app, const LV2_Atom_Object *obj)
const LV2_Atom *src_symbol = NULL;
lv2_atom_object_get(obj,
- app->regs.synthpod.sink_module.urid, &src_module,
- app->regs.synthpod.sink_symbol.urid, &src_symbol,
+ SYNTHPOD__sinkModule, &src_module,
+ SYNTHPOD__sinkSymbol, &src_symbol,
0);
const LV2_URID src_urn = src_module
@@ -1417,8 +1418,8 @@ _subscription_list_rem(sp_app_t *app, const LV2_Atom_Object *obj)
const LV2_Atom *src_symbol = NULL;
lv2_atom_object_get(obj,
- app->regs.synthpod.sink_module.urid, &src_module,
- app->regs.synthpod.sink_symbol.urid, &src_symbol,
+ SYNTHPOD__sinkModule, &src_module,
+ SYNTHPOD__sinkSymbol, &src_symbol,
0);
const LV2_URID src_urn = src_module
@@ -1449,9 +1450,9 @@ _notification_list_add(sp_app_t *app, const LV2_Atom_Object *obj)
const LV2_Atom *snk_value = NULL;
lv2_atom_object_get(obj,
- app->regs.synthpod.sink_module.urid, &snk_module,
- app->regs.synthpod.sink_symbol.urid, &snk_symbol,
- app->regs.rdf.value.urid, &snk_value,
+ SYNTHPOD__sinkModule, &snk_module,
+ SYNTHPOD__sinkSymbol, &snk_symbol,
+ RDF__value, &snk_value,
0);
const LV2_URID snk_urn = snk_module
@@ -1465,8 +1466,8 @@ _notification_list_add(sp_app_t *app, const LV2_Atom_Object *obj)
if(snk_port)
{
- if( (snk_proto == app->regs.port.float_protocol.urid)
- && (snk_value->type == app->forge.Float) )
+ if( (snk_proto == UI__floatProtocol)
+ && (snk_value->type == ATOM__Float) )
{
const float val = ((const LV2_Atom_Float *)snk_value)->body;
float *buf_ptr = PORT_BASE_ALIGNED(snk_port);
@@ -1487,7 +1488,7 @@ _notification_list_add(sp_app_t *app, const LV2_Atom_Object *obj)
}
}
}
- else if( (snk_proto == app->regs.port.event_transfer.urid)
+ else if( (snk_proto == ATOM__eventTransfer)
&& (snk_port->type == PORT_TYPE_ATOM) )
{
//printf("got atom:eventTransfer\n");
@@ -1509,7 +1510,7 @@ _notification_list_add(sp_app_t *app, const LV2_Atom_Object *obj)
__func__, snk_port->symbol);
}
}
- else if( (snk_proto == app->regs.port.atom_transfer.urid)
+ else if( (snk_proto == ATOM__atomTransfer)
&& (snk_port->type == PORT_TYPE_ATOM) )
{
//printf("got atom:atomTransfer\n");
@@ -1590,9 +1591,9 @@ _automation_list_rem(sp_app_t *app, const LV2_Atom_Object *obj)
const LV2_Atom_URID *src_property = NULL;
lv2_atom_object_get(obj,
- app->regs.synthpod.sink_module.urid, &src_module,
- app->regs.synthpod.sink_symbol.urid, &src_symbol,
- app->regs.patch.property.urid, &src_property,
+ SYNTHPOD__sinkModule, &src_module,
+ SYNTHPOD__sinkSymbol, &src_symbol,
+ PATCH__property, &src_property,
0);
const LV2_URID src_urn = src_module
@@ -1646,20 +1647,20 @@ _automation_list_add(sp_app_t *app, const LV2_Atom_Object *obj)
const LV2_Atom_Bool *is_learning = NULL;
lv2_atom_object_get(obj,
- app->regs.synthpod.sink_module.urid, &src_module,
- app->regs.synthpod.sink_symbol.urid, &src_symbol,
- app->regs.patch.property.urid, &src_property,
- app->regs.rdfs.range.urid, &src_range,
- app->regs.midi.channel.urid, &src_channel,
- app->regs.midi.controller_number.urid, &src_controller,
- app->regs.osc.path.urid, &src_path,
- app->regs.synthpod.source_min.urid, &src_min,
- app->regs.synthpod.source_max.urid, &src_max,
- app->regs.synthpod.sink_min.urid, &snk_min,
- app->regs.synthpod.sink_max.urid, &snk_max,
- app->regs.synthpod.source_enabled.urid, &src_enabled,
- app->regs.synthpod.sink_enabled.urid, &snk_enabled,
- app->regs.synthpod.learning.urid, &is_learning,
+ SYNTHPOD__sinkModule, &src_module,
+ SYNTHPOD__sinkSymbol, &src_symbol,
+ PATCH__property, &src_property,
+ RDFS__range, &src_range,
+ MIDI__channel, &src_channel,
+ MIDI__controllerNumber, &src_controller,
+ OSC__messagePath, &src_path,
+ SYNTHPOD__sourceMinimum, &src_min,
+ SYNTHPOD__sourceMaximum, &src_max,
+ SYNTHPOD__sinkMinimum, &snk_min,
+ SYNTHPOD__sinkMaximum, &snk_max,
+ SYNTHPOD__sourceEnabled, &src_enabled,
+ SYNTHPOD__sinkEnabled, &snk_enabled,
+ SYNTHPOD__learning, &is_learning,
0);
const LV2_URID src_urn = src_module
@@ -1701,13 +1702,13 @@ _automation_list_add(sp_app_t *app, const LV2_Atom_Object *obj)
_automation_refresh_mul_add(automation);
- if(obj->body.otype == app->regs.midi.Controller.urid)
+ if(obj->body.otype == MIDI__Controller)
{
automation->type = AUTO_TYPE_MIDI;
automation->midi.channel = src_channel ? src_channel->body : -1;
automation->midi.controller = src_controller ? src_controller->body : -1;
}
- else if(obj->body.otype == app->regs.osc.message.urid)
+ else if(obj->body.otype == OSC__Message)
{
automation->type = AUTO_TYPE_OSC;
if(src_path)
@@ -1795,53 +1796,53 @@ _sp_app_from_ui_patch_patch(sp_app_t *app, const LV2_Atom *atom)
const LV2_Atom_Object *rem = NULL;
lv2_atom_object_get(obj,
- app->regs.patch.subject.urid, &subject,
- app->regs.patch.sequence_number.urid, &seqn,
- app->regs.patch.add.urid, &add,
- app->regs.patch.remove.urid, &rem,
+ PATCH__subject, &subject,
+ PATCH__sequenceNumber, &seqn,
+ PATCH__add, &add,
+ PATCH__remove, &rem,
0);
- const LV2_URID subj = subject && (subject->atom.type == app->forge.URID)
+ const LV2_URID subj = subject && (subject->atom.type == ATOM__URID)
? subject->body : 0; //FIXME check for
- const int32_t sn = seqn && (seqn->atom.type == app->forge.Int)
+ const int32_t sn = seqn && (seqn->atom.type == ATOM__Int)
? seqn->body : 0;
//printf("got patch:Patch: %s\n", app->driver->unmap->unmap(app->driver->unmap->handle, subj));
- if( add && (add->atom.type == app->forge.Object)
- && rem && (rem->atom.type == app->forge.Object) )
+ if( add && (add->atom.type == ATOM__Object)
+ && rem && (rem->atom.type == ATOM__Object) )
{
LV2_ATOM_OBJECT_FOREACH(rem, prop)
{
//printf("got patch:remove: %s\n", app->driver->unmap->unmap(app->driver->unmap->handle, prop->key));
- if( (prop->key == app->regs.synthpod.connection_list.urid)
- && (prop->value.type == app->forge.Object) )
+ if( (prop->key == SYNTHPOD__connectionList)
+ && (prop->value.type == ATOM__Object) )
{
_connection_list_rem(app, (const LV2_Atom_Object *)&prop->value);
}
- else if( (prop->key == app->regs.synthpod.node_list.urid)
- && (prop->value.type == app->forge.Object) )
+ else if( (prop->key == SYNTHPOD__nodeList)
+ && (prop->value.type == ATOM__Object) )
{
//FIXME never reached
}
- else if( (prop->key == app->regs.synthpod.subscription_list.urid)
- && (prop->value.type == app->forge.Object) )
+ else if( (prop->key == SYNTHPOD__subscriptionList)
+ && (prop->value.type == ATOM__Object) )
{
_subscription_list_rem(app, (const LV2_Atom_Object *)&prop->value);
}
- else if( (prop->key == app->regs.synthpod.notification_list.urid)
- && (prop->value.type == app->forge.Object) )
+ else if( (prop->key == SYNTHPOD__notificationList)
+ && (prop->value.type == ATOM__Object) )
{
//FIXME never reached
}
- else if( (prop->key == app->regs.synthpod.module_list.urid)
- && (prop->value.type == app->forge.URID) )
+ else if( (prop->key == SYNTHPOD__moduleList)
+ && (prop->value.type == ATOM__URID) )
{
_mod_list_rem(app, (const LV2_Atom_URID *)&prop->value);
}
- else if( (prop->key == app->regs.synthpod.automation_list.urid)
- && (prop->value.type == app->forge.Object) )
+ else if( (prop->key == SYNTHPOD__automationList)
+ && (prop->value.type == ATOM__Object) )
{
_automation_list_rem(app, (const LV2_Atom_Object *)&prop->value);
}
@@ -1851,33 +1852,33 @@ _sp_app_from_ui_patch_patch(sp_app_t *app, const LV2_Atom *atom)
{
//printf("got patch:add: %s\n", app->driver->unmap->unmap(app->driver->unmap->handle, prop->key));
- if( (prop->key == app->regs.synthpod.connection_list.urid)
- && (prop->value.type == app->forge.Object) )
+ if( (prop->key == SYNTHPOD__connectionList)
+ && (prop->value.type == ATOM__Object) )
{
_connection_list_add(app, (const LV2_Atom_Object *)&prop->value);
}
- else if( (prop->key == app->regs.synthpod.node_list.urid)
- && (prop->value.type == app->forge.Object) )
+ else if( (prop->key == SYNTHPOD__nodeList)
+ && (prop->value.type == ATOM__Object) )
{
_node_list_add(app, (const LV2_Atom_Object *)&prop->value);
}
- else if( (prop->key == app->regs.synthpod.subscription_list.urid)
- && (prop->value.type == app->forge.Object) )
+ else if( (prop->key == SYNTHPOD__subscriptionList)
+ && (prop->value.type == ATOM__Object) )
{
_subscription_list_add(app, (const LV2_Atom_Object *)&prop->value);
}
- else if( (prop->key == app->regs.synthpod.notification_list.urid)
- && (prop->value.type == app->forge.Object) )
+ else if( (prop->key == SYNTHPOD__notificationList)
+ && (prop->value.type == ATOM__Object) )
{
_notification_list_add(app, (const LV2_Atom_Object *)&prop->value);
}
- else if( (prop->key == app->regs.synthpod.module_list.urid)
- && (prop->value.type == app->forge.URID) )
+ else if( (prop->key == SYNTHPOD__moduleList)
+ && (prop->value.type == ATOM__URID) )
{
_mod_list_add(app, (const LV2_Atom_URID *)&prop->value);
}
- else if( (prop->key == app->regs.synthpod.automation_list.urid)
- && (prop->value.type == app->forge.Object) )
+ else if( (prop->key == SYNTHPOD__automationList)
+ && (prop->value.type == ATOM__Object) )
{
_automation_list_add(app, (const LV2_Atom_Object *)&prop->value);
}
@@ -1898,13 +1899,13 @@ sp_app_from_ui(sp_app_t *app, const LV2_Atom *atom)
if(lv2_atom_forge_is_object_type(&app->forge, obj->atom.type))
{
- if(obj->body.otype == app->regs.patch.get.urid)
+ if(obj->body.otype == PATCH__Get)
return _sp_app_from_ui_patch_get(app, &obj->atom);
- else if(obj->body.otype == app->regs.patch.set.urid)
+ else if(obj->body.otype == PATCH__Set)
return _sp_app_from_ui_patch_set(app, &obj->atom);
- else if(obj->body.otype == app->regs.patch.copy.urid)
+ else if(obj->body.otype == PATCH__Copy)
return _sp_app_from_ui_patch_copy(app, &obj->atom);
- else if(obj->body.otype == app->regs.patch.patch.urid)
+ else if(obj->body.otype == PATCH__Patch)
return _sp_app_from_ui_patch_patch(app, &obj->atom);
else
sp_app_log_trace(app, "%s: unknown object type\n", __func__);
diff --git a/app/synthpod_app_worker.c b/app/synthpod_app_worker.c
index 8384e52e..b2c0cb7b 100644
--- a/app/synthpod_app_worker.c
+++ b/app/synthpod_app_worker.c
@@ -17,6 +17,7 @@
#include <synthpod_app_private.h>
#include <synthpod_patcher.h>
+#include <synthpod_stat.h>
static inline void *
__sp_worker_to_app_request(sp_app_t *app, size_t minimum, size_t *maximum)
@@ -60,7 +61,7 @@ sp_app_from_worker(sp_app_t *app, uint32_t len, const void *data)
transmit_module_supported_t *trans = _sp_app_to_ui_request(app, size);
if(trans)
{
- _sp_transmit_module_supported_fill(&app->regs, &app->forge, trans, size,
+ _sp_transmit_module_supported_fill(&app->forge, trans, size,
job->status, job->uri);
_sp_app_to_ui_advance(app, size);
}
@@ -86,9 +87,9 @@ sp_app_from_worker(sp_app_t *app, uint32_t len, const void *data)
LV2_Atom *answer = _sp_app_to_ui_request_atom(app);
if(answer)
{
- LV2_Atom_Forge_Ref ref = synthpod_patcher_add(&app->regs, &app->forge,
- 0, 0, app->regs.synthpod.module_list.urid, //TODO subject
- sizeof(uint32_t), app->forge.URID, &mod->urn);
+ LV2_Atom_Forge_Ref ref = synthpod_patcher_add(&app->forge,
+ 0, 0, SYNTHPOD__moduleList, //TODO subject
+ sizeof(uint32_t), ATOM__URID, &mod->urn);
if(ref)
{
_sp_app_to_ui_advance_atom(app, answer);
@@ -114,9 +115,9 @@ sp_app_from_worker(sp_app_t *app, uint32_t len, const void *data)
LV2_Atom *answer = _sp_app_to_ui_request_atom(app);
if(answer)
{
- LV2_Atom_Forge_Ref ref = synthpod_patcher_remove(&app->regs, &app->forge,
- 0, 0, app->regs.synthpod.module_list.urid, //TODO subject
- sizeof(uint32_t), app->forge.URID, &urn);
+ LV2_Atom_Forge_Ref ref = synthpod_patcher_remove(&app->forge,
+ 0, 0, SYNTHPOD__moduleList, //TODO subject
+ sizeof(uint32_t), ATOM__URID, &urn);
if(ref)
{
_sp_app_to_ui_advance_atom(app, answer);
@@ -167,8 +168,8 @@ sp_app_from_worker(sp_app_t *app, uint32_t len, const void *data)
{
const int64_t dsp_instance = (intptr_t )mod->inst;
LV2_Atom_Forge_Ref ref = synthpod_patcher_set(
- &app->regs, &app->forge, mod->urn, 0, app->regs.ui.instance_access.urid, //FIXME seqnum
- sizeof(int64_t), app->forge.Long, &dsp_instance);
+ &app->forge, mod->urn, 0, INSTANCE_ACCESS, //FIXME seqnum
+ sizeof(int64_t), ATOM__Long, &dsp_instance);
if(ref)
{
_sp_app_to_ui_advance_atom(app, answer);
@@ -220,7 +221,7 @@ sp_app_from_worker(sp_app_t *app, uint32_t len, const void *data)
transmit_module_preset_load_t *trans = _sp_app_to_ui_request(app, size);
if(trans)
{
- _sp_transmit_module_preset_load_fill(&app->regs, &app->forge, trans, size,
+ _sp_transmit_module_preset_load_fill(&app->forge, trans, size,
mod->uid, NULL);
_sp_app_to_ui_advance(app, size);
}
@@ -240,7 +241,7 @@ sp_app_from_worker(sp_app_t *app, uint32_t len, const void *data)
LV2_Atom *answer = _sp_app_to_ui_request_atom(app);
if(answer)
{
- LV2_Atom_Forge_Ref ref = synthpod_patcher_copy(&app->regs, &app->forge,
+ LV2_Atom_Forge_Ref ref = synthpod_patcher_copy(&app->forge,
job->mod->urn, 0, job->urn);
if(ref)
{
@@ -287,7 +288,7 @@ sp_app_from_worker(sp_app_t *app, uint32_t len, const void *data)
transmit_bundle_load_t *trans = _sp_app_to_ui_request(app, size);
if(trans)
{
- _sp_transmit_bundle_load_fill(&app->regs, &app->forge, trans, size,
+ _sp_transmit_bundle_load_fill(&app->forge, trans, size,
job->status, job->uri);
_sp_app_to_ui_advance(app, size);
}
@@ -323,7 +324,7 @@ sp_app_from_worker(sp_app_t *app, uint32_t len, const void *data)
transmit_bundle_save_t *trans = _sp_app_to_ui_request(app, size);
if(trans)
{
- _sp_transmit_bundle_save_fill(&app->regs, &app->forge, trans, size,
+ _sp_transmit_bundle_save_fill(&app->forge, trans, size,
job->status, job->uri);
_sp_app_to_ui_advance(app, size);
}
diff --git a/bin/synthpod_bin.c b/bin/synthpod_bin.c
index bf58f994..d341b1b0 100644
--- a/bin/synthpod_bin.c
+++ b/bin/synthpod_bin.c
@@ -23,6 +23,7 @@
#include <signal.h>
#include <synthpod_bin.h>
+#include <synthpod_stat.h>
#include <sandbox_slave.h>
#include <synthpod_sandbox_x11_driver.h>
@@ -369,7 +370,8 @@ bin_init(bin_t *bin, uint32_t sample_rate)
bin->app_from_app = varchunk_new(CHUNK_SIZE, false);
bin->lfrtm = lfrtm_new(512, 0x100000); // 1M
- bin->mapper = mapper_new(0x20000, 0, NULL, _mapper_alloc_rt, _mapper_free_rt, bin); // 128K
+ bin->mapper = mapper_new(0x20000, STAT_URID_MAX, stat_uris,
+ _mapper_alloc_rt, _mapper_free_rt, bin); // 128K
bin->map = mapper_get_map(bin->mapper);
bin->unmap = mapper_get_unmap(bin->mapper);
diff --git a/bin/synthpod_sandbox_gtk.c b/bin/synthpod_sandbox_gtk.c
index b61a7a4a..4585ebf2 100644
--- a/bin/synthpod_sandbox_gtk.c
+++ b/bin/synthpod_sandbox_gtk.c
@@ -182,7 +182,6 @@ static const sandbox_slave_driver_t driver = {
.init_cb = _init,
.run_cb = _run,
.deinit_cb = _deinit,
- .resize_cb = NULL,
.request_cb = _request
};
diff --git a/bin/synthpod_sandbox_kx.c b/bin/synthpod_sandbox_kx.c
index 2bbec535..567cdd2f 100644
--- a/bin/synthpod_sandbox_kx.c
+++ b/bin/synthpod_sandbox_kx.c
@@ -148,7 +148,6 @@ static const sandbox_slave_driver_t driver = {
.init_cb = _init,
.run_cb = _run,
.deinit_cb = _deinit,
- .resize_cb = NULL,
.request_cb = _request
};
diff --git a/bin/synthpod_sandbox_qt.cpp b/bin/synthpod_sandbox_qt.cpp
index 950c0a86..d0663f84 100644
--- a/bin/synthpod_sandbox_qt.cpp
+++ b/bin/synthpod_sandbox_qt.cpp
@@ -181,7 +181,6 @@ static const sandbox_slave_driver_t driver = {
.init_cb = _init,
.run_cb = _run,
.deinit_cb = _deinit,
- .resize_cb = NULL,
.request_cb = _request
};
diff --git a/bin/synthpod_sandbox_show.c b/bin/synthpod_sandbox_show.c
index ff42aea1..62f068f3 100644
--- a/bin/synthpod_sandbox_show.c
+++ b/bin/synthpod_sandbox_show.c
@@ -138,7 +138,6 @@ static const sandbox_slave_driver_t driver = {
.init_cb = _init,
.run_cb = _run,
.deinit_cb = _deinit,
- .resize_cb = NULL,
.request_cb = _request
};
diff --git a/bin/synthpod_sandbox_x11_driver.c b/bin/synthpod_sandbox_x11_driver.c
index 696cd760..2767c6fd 100644
--- a/bin/synthpod_sandbox_x11_driver.c
+++ b/bin/synthpod_sandbox_x11_driver.c
@@ -40,7 +40,6 @@ struct _app_t {
void *dsp_instance;
LV2UI_Handle *handle;
const LV2UI_Idle_Interface *idle_iface;
- const LV2UI_Resize *resize_iface;
xcb_connection_t *conn;
xcb_screen_t *screen;
@@ -64,22 +63,6 @@ _sig(int signum)
atomic_store_explicit(_done, true, memory_order_relaxed);
}
-static inline int
-_resize(void *data, int w, int h)
-{
- app_t *app= data;
-
- app->w = w;
- app->h = h;
-
- const uint32_t values [2] = {app->w, app->h};
- xcb_configure_window(app->conn, app->win,
- XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT, values);
- xcb_flush(app->conn);
-
- return 0;
-}
-
static inline void
_clone_size_hints(app_t *app)
{
@@ -197,13 +180,6 @@ _init(sandbox_slave_t *sb, void *data)
_clone_size_hints(app);
app->idle_iface = sandbox_slave_extension_data(sb, LV2_UI__idleInterface);
- app->resize_iface = sandbox_slave_extension_data(sb, LV2_UI__resize);
-
- // work-around for broken lsp-plugins
- if((uintptr_t)app->resize_iface == (uintptr_t)app->idle_iface)
- {
- app->resize_iface = NULL;
- }
cross_clock_init(&app->clk_real, CROSS_CLOCK_REALTIME);
@@ -238,11 +214,6 @@ _run(sandbox_slave_t *sb, float update_rate, void *data)
XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT,
&values);
xcb_flush(app->conn);
-
- if(app->resize_iface)
- {
- app->resize_iface->ui_resize(app->handle, app->w, app->h);
- }
}
break;
}
@@ -338,7 +309,6 @@ static const sandbox_slave_driver_t x11_driver = {
.init_cb = _init,
.run_cb = _run,
.deinit_cb = _deinit,
- .resize_cb = _resize,
.request_cb = _request
};
diff --git a/bin/synthpod_stat.c b/bin/synthpod_stat.c
new file mode 100644
index 00000000..bb2ca4a8
--- /dev/null
+++ b/bin/synthpod_stat.c
@@ -0,0 +1,560 @@
+#include <synthpod_common.h>
+#include <synthpod_stat.h>
+
+#include <lilv/lilv.h>
+
+#include <lv2/atom/atom.h>
+#include <lv2/buf-size/buf-size.h>
+#include <lv2/core/lv2.h>
+#include <lv2/data-access/data-access.h>
+#include <lv2/dynmanifest/dynmanifest.h>
+#include <lv2/event/event.h>
+#include <lv2/instance-access/instance-access.h>
+#include <lv2/log/log.h>
+#include <lv2/midi/midi.h>
+#include <lv2/morph/morph.h>
+#include <lv2/options/options.h>
+#include <lv2/parameters/parameters.h>
+#include <lv2/patch/patch.h>
+#include <lv2/port-groups/port-groups.h>
+#include <lv2/port-props/port-props.h>
+#include <lv2/presets/presets.h>
+#include <lv2/resize-port/resize-port.h>
+#include <lv2/state/state.h>
+#include <lv2/time/time.h>
+#include <lv2/ui/ui.h>
+#include <lv2/units/units.h>
+#include <lv2/urid/urid.h>
+#include <lv2/uri-map/uri-map.h>
+#include <lv2/worker/worker.h>
+
+#include <lv2_extensions.h>
+#include <lv2_external_ui.h>
+#include <osc.lv2/osc.h>
+#include <canvas.lv2/canvas.h>
+
+#define NS_ITM(EXT, ID) [EXT ## __ ## ID] = LILV_NS_ ## EXT # ID
+#define ITM(ID) [ID] = LV2_ ## ID
+#define SYN(ID) [SYNTHPOD__ ## ID] = SYNTHPOD_PREFIX # ID
+
+#define LV2_CORE__isBitmask LV2_CORE_PREFIX "isBitmask"
+#define LV2_CORE__parameterProperty LV2_CORE_PREFIX "parameterProperty"
+#define LV2_PATCH__Insert LV2_PATCH_PREFIX "Insert"
+#define LV2_INLINEDISPLAY__surface LV2_INLINEDISPLAY_PREFIX "surface"
+
+const char *stat_uris [STAT_URID_MAX] = {
+ [STAT_URID_INVALID] = NULL,
+
+ NS_ITM(RDFS, label),
+ NS_ITM(RDFS, comment),
+ NS_ITM(RDFS, range),
+ NS_ITM(RDFS, subClassOf),
+ NS_ITM(RDFS, seeAlso),
+
+ NS_ITM(RDF, type),
+ NS_ITM(RDF, value),
+
+ NS_ITM(DOAP, description),
+ NS_ITM(DOAP, license),
+ NS_ITM(DOAP, name),
+ NS_ITM(DOAP, shortdesc),
+
+ NS_ITM(XSD, int),
+ NS_ITM(XSD, nonNegativeInteger),
+ NS_ITM(XSD, long),
+ NS_ITM(XSD, float),
+ NS_ITM(XSD, double),
+
+ ITM(ATOM__Atom),
+ ITM(ATOM__AtomPort),
+ ITM(ATOM__Blank),
+ ITM(ATOM__Bool),
+ ITM(ATOM__Chunk),
+ ITM(ATOM__Double),
+ ITM(ATOM__Event),
+ ITM(ATOM__Float),
+ ITM(ATOM__Int),
+ ITM(ATOM__Literal),
+ ITM(ATOM__Long),
+ ITM(ATOM__Number),
+ ITM(ATOM__Object),
+ ITM(ATOM__Path),
+ ITM(ATOM__Property),
+ ITM(ATOM__Resource),
+ ITM(ATOM__Sequence),
+ ITM(ATOM__Sound),
+ ITM(ATOM__String),
+ ITM(ATOM__Tuple),
+ ITM(ATOM__URI),
+ ITM(ATOM__URID),
+ ITM(ATOM__Vector),
+ ITM(ATOM__atomTransfer),
+ ITM(ATOM__beatTime),
+ ITM(ATOM__bufferType),
+ ITM(ATOM__childType),
+ ITM(ATOM__eventTransfer),
+ ITM(ATOM__frameTime),
+ ITM(ATOM__supports),
+ ITM(ATOM__timeUnit),
+
+ ITM(BUF_SIZE__boundedBlockLength),
+ ITM(BUF_SIZE__coarseBlockLength),
+ ITM(BUF_SIZE__fixedBlockLength),
+ ITM(BUF_SIZE__maxBlockLength),
+ ITM(BUF_SIZE__minBlockLength),
+ ITM(BUF_SIZE__nominalBlockLength),
+ ITM(BUF_SIZE__powerOf2BlockLength),
+ ITM(BUF_SIZE__sequenceSize),
+
+ ITM(CORE__AllpassPlugin),
+ ITM(CORE__AmplifierPlugin),
+ ITM(CORE__AnalyserPlugin),
+ ITM(CORE__AudioPort),
+ ITM(CORE__BandpassPlugin),
+ ITM(CORE__CVPort),
+ ITM(CORE__ChorusPlugin),
+ ITM(CORE__CombPlugin),
+ ITM(CORE__CompressorPlugin),
+ ITM(CORE__ConstantPlugin),
+ ITM(CORE__ControlPort),
+ ITM(CORE__ConverterPlugin),
+ ITM(CORE__DelayPlugin),
+ ITM(CORE__DistortionPlugin),
+ ITM(CORE__DynamicsPlugin),
+ ITM(CORE__EQPlugin),
+ ITM(CORE__EnvelopePlugin),
+ ITM(CORE__ExpanderPlugin),
+ ITM(CORE__ExtensionData),
+ ITM(CORE__Feature),
+ ITM(CORE__FilterPlugin),
+ ITM(CORE__FlangerPlugin),
+ ITM(CORE__FunctionPlugin),
+ ITM(CORE__GatePlugin),
+ ITM(CORE__GeneratorPlugin),
+ ITM(CORE__HighpassPlugin),
+ ITM(CORE__InputPort),
+ ITM(CORE__InstrumentPlugin),
+ ITM(CORE__LimiterPlugin),
+ ITM(CORE__LowpassPlugin),
+ ITM(CORE__MixerPlugin),
+ ITM(CORE__ModulatorPlugin),
+ ITM(CORE__MultiEQPlugin),
+ ITM(CORE__OscillatorPlugin),
+ ITM(CORE__OutputPort),
+ ITM(CORE__ParaEQPlugin),
+ ITM(CORE__PhaserPlugin),
+ ITM(CORE__PitchPlugin),
+ ITM(CORE__Plugin),
+ ITM(CORE__PluginBase),
+ ITM(CORE__Point),
+ ITM(CORE__Port),
+ ITM(CORE__PortProperty),
+ ITM(CORE__Resource),
+ ITM(CORE__ReverbPlugin),
+ ITM(CORE__ScalePoint),
+ ITM(CORE__SimulatorPlugin),
+ ITM(CORE__SpatialPlugin),
+ ITM(CORE__Specification),
+ ITM(CORE__SpectralPlugin),
+ ITM(CORE__UtilityPlugin),
+ ITM(CORE__WaveshaperPlugin),
+ ITM(CORE__appliesTo),
+ ITM(CORE__binary),
+ ITM(CORE__connectionOptional),
+ ITM(CORE__control),
+ ITM(CORE__default),
+ ITM(CORE__designation),
+ ITM(CORE__documentation),
+ ITM(CORE__enumeration),
+ ITM(CORE__extensionData),
+ ITM(CORE__freeWheeling),
+ ITM(CORE__hardRTCapable),
+ ITM(CORE__inPlaceBroken),
+ ITM(CORE__index),
+ ITM(CORE__integer),
+ ITM(CORE__isLive),
+ ITM(CORE__latency),
+ ITM(CORE__maximum),
+ ITM(CORE__microVersion),
+ ITM(CORE__minimum),
+ ITM(CORE__minorVersion),
+ ITM(CORE__name),
+ ITM(CORE__optionalFeature),
+ ITM(CORE__port),
+ ITM(CORE__portProperty),
+ ITM(CORE__project),
+ ITM(CORE__prototype),
+ ITM(CORE__reportsLatency),
+ ITM(CORE__requiredFeature),
+ ITM(CORE__sampleRate),
+ ITM(CORE__scalePoint),
+ ITM(CORE__symbol),
+ ITM(CORE__toggled),
+ ITM(CORE__isBitmask),
+ ITM(CORE__parameterProperty),
+
+ [DATA_ACCESS] = LV2_DATA_ACCESS_URI,
+
+ [DYN_MANIFEST] = LV2_DYN_MANIFEST_URI,
+
+ ITM(EVENT__Event),
+ ITM(EVENT__EventPort),
+ ITM(EVENT__FrameStamp),
+ ITM(EVENT__TimeStamp),
+ ITM(EVENT__generatesTimeStamp),
+ ITM(EVENT__generic),
+ ITM(EVENT__inheritsEvent),
+ ITM(EVENT__inheritsTimeStamp),
+ ITM(EVENT__supportsEvent),
+ ITM(EVENT__supportsTimeStamp),
+
+ [INSTANCE_ACCESS] = LV2_INSTANCE_ACCESS_URI,
+
+ ITM(LOG__Entry),
+ ITM(LOG__Error),
+ ITM(LOG__Note),
+ ITM(LOG__Trace),
+ ITM(LOG__Warning),
+ ITM(LOG__log),
+
+ ITM(MIDI__ActiveSense),
+ ITM(MIDI__Aftertouch),
+ ITM(MIDI__Bender),
+ ITM(MIDI__ChannelPressure),
+ ITM(MIDI__Chunk),
+ ITM(MIDI__Clock),
+ ITM(MIDI__Continue),
+ ITM(MIDI__Controller),
+ ITM(MIDI__MidiEvent),
+ ITM(MIDI__NoteOff),
+ ITM(MIDI__NoteOn),
+ ITM(MIDI__ProgramChange),
+ ITM(MIDI__QuarterFrame),
+ ITM(MIDI__Reset),
+ ITM(MIDI__SongPosition),
+ ITM(MIDI__SongSelect),
+ ITM(MIDI__Start),
+ ITM(MIDI__Stop),
+ ITM(MIDI__SystemCommon),
+ ITM(MIDI__SystemExclusive),
+ ITM(MIDI__SystemMessage),
+ ITM(MIDI__SystemRealtime),
+ ITM(MIDI__Tick),
+ ITM(MIDI__TuneRequest),
+ ITM(MIDI__VoiceMessage),
+ ITM(MIDI__benderValue),
+ ITM(MIDI__binding),
+ ITM(MIDI__byteNumber),
+ ITM(MIDI__channel),
+ ITM(MIDI__chunk),
+ ITM(MIDI__controllerNumber),
+ ITM(MIDI__controllerValue),
+ ITM(MIDI__noteNumber),
+ ITM(MIDI__pressure),
+ ITM(MIDI__programNumber),
+ ITM(MIDI__property),
+ ITM(MIDI__songNumber),
+ ITM(MIDI__songPosition),
+ ITM(MIDI__status),
+ ITM(MIDI__statusMask),
+ ITM(MIDI__velocity),
+
+ ITM(MORPH__AutoMorphPort),
+ ITM(MORPH__MorphPort),
+ ITM(MORPH__interface),
+ ITM(MORPH__supportsType),
+ ITM(MORPH__currentType),
+
+ ITM(OPTIONS__Option),
+ ITM(OPTIONS__interface),
+ ITM(OPTIONS__options),
+ ITM(OPTIONS__requiredOption),
+ ITM(OPTIONS__supportedOption),
+
+ ITM(PARAMETERS__CompressorControls),
+ ITM(PARAMETERS__ControlGroup),
+ ITM(PARAMETERS__EnvelopeControls),
+ ITM(PARAMETERS__FilterControls),
+ ITM(PARAMETERS__OscillatorControls),
+ ITM(PARAMETERS__amplitude),
+ ITM(PARAMETERS__attack),
+ ITM(PARAMETERS__bypass),
+ ITM(PARAMETERS__cutoffFrequency),
+ ITM(PARAMETERS__decay),
+ ITM(PARAMETERS__delay),
+ ITM(PARAMETERS__dryLevel),
+ ITM(PARAMETERS__frequency),
+ ITM(PARAMETERS__gain),
+ ITM(PARAMETERS__hold),
+ ITM(PARAMETERS__pulseWidth),
+ ITM(PARAMETERS__ratio),
+ ITM(PARAMETERS__release),
+ ITM(PARAMETERS__resonance),
+ ITM(PARAMETERS__sampleRate),
+ ITM(PARAMETERS__sustain),
+ ITM(PARAMETERS__threshold),
+ ITM(PARAMETERS__waveform),
+ ITM(PARAMETERS__wetDryRatio),
+ ITM(PARAMETERS__wetLevel),
+
+ ITM(PATCH__Ack),
+ ITM(PATCH__Delete),
+ ITM(PATCH__Copy),
+ ITM(PATCH__Error),
+ ITM(PATCH__Get),
+ ITM(PATCH__Message),
+ ITM(PATCH__Move),
+ ITM(PATCH__Patch),
+ ITM(PATCH__Post),
+ ITM(PATCH__Put),
+ ITM(PATCH__Request),
+ ITM(PATCH__Response),
+ ITM(PATCH__Set),
+ ITM(PATCH__Insert),
+ ITM(PATCH__accept),
+ ITM(PATCH__add),
+ ITM(PATCH__body),
+ ITM(PATCH__context),
+ ITM(PATCH__destination),
+ ITM(PATCH__property),
+ ITM(PATCH__readable),
+ ITM(PATCH__remove),
+ ITM(PATCH__request),
+ ITM(PATCH__subject),
+ ITM(PATCH__sequenceNumber),
+ ITM(PATCH__value),
+ ITM(PATCH__wildcard),
+ ITM(PATCH__writable),
+
+ ITM(PORT_GROUPS__DiscreteGroup),
+ ITM(PORT_GROUPS__Element),
+ ITM(PORT_GROUPS__FivePointOneGroup),
+ ITM(PORT_GROUPS__FivePointZeroGroup),
+ ITM(PORT_GROUPS__FourPointZeroGroup),
+ ITM(PORT_GROUPS__Group),
+ ITM(PORT_GROUPS__InputGroup),
+ ITM(PORT_GROUPS__MidSideGroup),
+ ITM(PORT_GROUPS__MonoGroup),
+ ITM(PORT_GROUPS__OutputGroup),
+ ITM(PORT_GROUPS__SevenPointOneGroup),
+ ITM(PORT_GROUPS__SevenPointOneWideGroup),
+ ITM(PORT_GROUPS__SixPointOneGroup),
+ ITM(PORT_GROUPS__StereoGroup),
+ ITM(PORT_GROUPS__ThreePointZeroGroup),
+ ITM(PORT_GROUPS__center),
+ ITM(PORT_GROUPS__centerLeft),
+ ITM(PORT_GROUPS__centerRight),
+ ITM(PORT_GROUPS__element),
+ ITM(PORT_GROUPS__group),
+ ITM(PORT_GROUPS__left),
+ ITM(PORT_GROUPS__lowFrequencyEffects),
+ ITM(PORT_GROUPS__mainInput),
+ ITM(PORT_GROUPS__mainOutput),
+ ITM(PORT_GROUPS__rearCenter),
+ ITM(PORT_GROUPS__rearLeft),
+ ITM(PORT_GROUPS__rearRight),
+ ITM(PORT_GROUPS__right),
+ ITM(PORT_GROUPS__side),
+ ITM(PORT_GROUPS__sideChainOf),
+ ITM(PORT_GROUPS__sideLeft),
+ ITM(PORT_GROUPS__sideRight),
+ ITM(PORT_GROUPS__source),
+ ITM(PORT_GROUPS__subGroupOf),
+
+ ITM(PORT_PROPS__causesArtifacts),
+ ITM(PORT_PROPS__continuousCV),
+ ITM(PORT_PROPS__discreteCV),
+ ITM(PORT_PROPS__displayPriority),
+ ITM(PORT_PROPS__expensive),
+ ITM(PORT_PROPS__hasStrictBounds),
+ ITM(PORT_PROPS__logarithmic),
+ ITM(PORT_PROPS__notAutomatic),
+ ITM(PORT_PROPS__notOnGUI),
+ ITM(PORT_PROPS__rangeSteps),
+ ITM(PORT_PROPS__supportsStrictBounds),
+ ITM(PORT_PROPS__trigger),
+
+ //ITM(PRESETS__Bank),
+ ITM(PRESETS__Preset),
+ ITM(PRESETS__bank),
+ //ITM(PRESETS__preset),
+ ITM(PRESETS__value),
+
+ ITM(RESIZE_PORT__asLargeAs),
+ ITM(RESIZE_PORT__minimumSize),
+ ITM(RESIZE_PORT__resize),
+
+ //ITM(STATE__State),
+ ITM(STATE__interface),
+ ITM(STATE__loadDefaultState),
+ ITM(STATE__freePath),
+ ITM(STATE__makePath),
+ ITM(STATE__mapPath),
+ ITM(STATE__state),
+ ITM(STATE__threadSafeRestore),
+ ITM(STATE__StateChanged),
+
+ ITM(TIME__Time),
+ ITM(TIME__Position),
+ ITM(TIME__Rate),
+ ITM(TIME__position),
+ ITM(TIME__barBeat),
+ ITM(TIME__bar),
+ ITM(TIME__beat),
+ ITM(TIME__beatUnit),
+ ITM(TIME__beatsPerBar),
+ ITM(TIME__beatsPerMinute),
+ ITM(TIME__frame),
+ ITM(TIME__framesPerSecond),
+ ITM(TIME__speed),
+
+ ITM(UI__CocoaUI),
+ ITM(UI__Gtk3UI),
+ ITM(UI__GtkUI),
+ ITM(UI__PortNotification),
+ ITM(UI__PortProtocol),
+ ITM(UI__Qt4UI),
+ ITM(UI__Qt5UI),
+ //ITM(UI__UI),
+ ITM(UI__WindowsUI),
+ ITM(UI__X11UI),
+ ITM(UI__binary),
+ ITM(UI__fixedSize),
+ ITM(UI__idleInterface),
+ ITM(UI__noUserResize),
+ ITM(UI__notifyType),
+ ITM(UI__parent),
+ ITM(UI__plugin),
+ ITM(UI__portIndex),
+ ITM(UI__portMap),
+ ITM(UI__portNotification),
+ ITM(UI__portSubscribe),
+ ITM(UI__protocol),
+ ITM(UI__requestValue),
+ ITM(UI__floatProtocol),
+ ITM(UI__peakProtocol),
+ ITM(UI__resize),
+ ITM(UI__showInterface),
+ ITM(UI__touch),
+ ITM(UI__ui),
+ ITM(UI__updateRate),
+ ITM(UI__windowTitle),
+ ITM(UI__scaleFactor),
+ ITM(UI__foregroundColor),
+ ITM(UI__backgroundColor),
+
+ ITM(UNITS__Conversion),
+ ITM(UNITS__Unit),
+ ITM(UNITS__bar),
+ ITM(UNITS__beat),
+ ITM(UNITS__bpm),
+ ITM(UNITS__cent),
+ ITM(UNITS__cm),
+ ITM(UNITS__coef),
+ ITM(UNITS__conversion),
+ ITM(UNITS__db),
+ ITM(UNITS__degree),
+ ITM(UNITS__frame),
+ ITM(UNITS__hz),
+ ITM(UNITS__inch),
+ ITM(UNITS__khz),
+ ITM(UNITS__km),
+ ITM(UNITS__m),
+ ITM(UNITS__mhz),
+ ITM(UNITS__midiNote),
+ ITM(UNITS__mile),
+ ITM(UNITS__min),
+ ITM(UNITS__mm),
+ ITM(UNITS__ms),
+ ITM(UNITS__name),
+ ITM(UNITS__oct),
+ ITM(UNITS__pc),
+ ITM(UNITS__prefixConversion),
+ ITM(UNITS__render),
+ ITM(UNITS__s),
+ ITM(UNITS__semitone12TET),
+ ITM(UNITS__symbol),
+ ITM(UNITS__unit),
+
+ ITM(URID__map),
+ ITM(URID__unmap),
+
+ [URI_MAP] = LV2_URI_MAP_URI,
+
+ ITM(WORKER__interface),
+ ITM(WORKER__schedule),
+
+ ITM(EXTERNAL_UI__Widget),
+
+ ITM(INLINEDISPLAY__interface),
+ ITM(INLINEDISPLAY__queue_draw),
+ ITM(INLINEDISPLAY__surface),
+
+ ITM(OSC__Message),
+ ITM(OSC__messagePath),
+
+ [CVAS__graph] = CANVAS__graph,
+
+ [SYNTHPOD__state] = "state.ttl",
+ [SYNTHPOD__null] = "",
+ SYN(payload),
+ SYN(graph),
+ SYN(stereo),
+ SYN(monoatom),
+ SYN(moduleList),
+ SYN(moduleSupported),
+ SYN(moduleAdd),
+ SYN(moduleDel),
+ SYN(moduleMove),
+ SYN(modulePresetLoad),
+ SYN(modulePresetSave),
+ SYN(moduleVisible),
+ SYN(moduleDisabled),
+ SYN(moduleProfiling),
+ SYN(modulePositionX),
+ SYN(modulePositionY),
+ SYN(moduleAlias),
+ SYN(moduleReinstantiate),
+ SYN(moduleCreated),
+ SYN(nodePositionX),
+ SYN(nodePositionY),
+ SYN(graphPositionX),
+ SYN(graphPositionY),
+ SYN(columnEnabled),
+ SYN(rowEnabled),
+ SYN(portRefresh),
+ SYN(bundleLoad),
+ SYN(bundleSave),
+ SYN(pathGet),
+ SYN(DSPProfiling),
+ SYN(CPUsAvailable),
+ SYN(CPUsUsed),
+ SYN(periodSize),
+ SYN(numPeriods),
+ SYN(quit),
+ SYN(systemPorts),
+ SYN(ControlPort),
+ SYN(AudioPort),
+ SYN(CVPort),
+ SYN(MIDIPort),
+ SYN(OSCPort),
+ SYN(ComPort),
+ SYN(connectionList),
+ SYN(nodeList),
+ SYN(subscriptionList),
+ SYN(notificationList),
+ SYN(automationList),
+ SYN(sourceModule),
+ SYN(sourceSymbol),
+ SYN(sinkModule),
+ SYN(sinkSymbol),
+ SYN(sourceMinimum),
+ SYN(sourceMaximum),
+ SYN(sinkMinimum),
+ SYN(sinkMaximum),
+ SYN(sourceEnabled),
+ SYN(sinkEnabled),
+ SYN(learning),
+ SYN(placeholder),
+ SYN(visibility),
+};
diff --git a/include/synthpod_patcher.h b/include/synthpod_patcher.h
index 3bce8b2b..50ec25bf 100644
--- a/include/synthpod_patcher.h
+++ b/include/synthpod_patcher.h
@@ -19,9 +19,10 @@
#define _SYNTHPOD_PATCHER_H
#include <synthpod_private.h>
+#include <synthpod_stat.h>
static inline LV2_Atom_Forge_Ref
-_synthpod_patcher_internal_object(reg_t *regs, LV2_Atom_Forge *forge,
+_synthpod_patcher_internal_object(LV2_Atom_Forge *forge,
LV2_Atom_Forge_Frame *frame, LV2_URID otype, LV2_URID subject, int32_t seqn)
{
LV2_Atom_Forge_Ref ref = lv2_atom_forge_object(forge, frame, 0, otype);
@@ -29,7 +30,7 @@ _synthpod_patcher_internal_object(reg_t *regs, LV2_Atom_Forge *forge,
if(subject)
{
if(ref)
- ref = lv2_atom_forge_key(forge, regs->patch.subject.urid);
+ ref = lv2_atom_forge_key(forge, PATCH__subject);
if(ref)
ref = lv2_atom_forge_urid(forge, subject);
}
@@ -37,7 +38,7 @@ _synthpod_patcher_internal_object(reg_t *regs, LV2_Atom_Forge *forge,
if(seqn)
{
if(ref)
- ref = lv2_atom_forge_key(forge, regs->patch.sequence_number.urid);
+ ref = lv2_atom_forge_key(forge, PATCH__sequenceNumber);
if(ref)
ref = lv2_atom_forge_int(forge, seqn);
}
@@ -46,10 +47,10 @@ _synthpod_patcher_internal_object(reg_t *regs, LV2_Atom_Forge *forge,
}
static inline LV2_Atom_Forge_Ref
-_synthpod_patcher_internal_property(reg_t *regs, LV2_Atom_Forge *forge,
+_synthpod_patcher_internal_property(LV2_Atom_Forge *forge,
LV2_URID property)
{
- LV2_Atom_Forge_Ref ref = lv2_atom_forge_key(forge, regs->patch.property.urid);
+ LV2_Atom_Forge_Ref ref = lv2_atom_forge_key(forge, PATCH__property);
if(ref)
ref = lv2_atom_forge_urid(forge, property);
@@ -57,10 +58,10 @@ _synthpod_patcher_internal_property(reg_t *regs, LV2_Atom_Forge *forge,
}
static inline LV2_Atom_Forge_Ref
-_synthpod_patcher_internal_destination(reg_t *regs, LV2_Atom_Forge *forge,
+_synthpod_patcher_internal_destination(LV2_Atom_Forge *forge,
LV2_URID destination)
{
- LV2_Atom_Forge_Ref ref = lv2_atom_forge_key(forge, regs->patch.destination.urid);
+ LV2_Atom_Forge_Ref ref = lv2_atom_forge_key(forge, PATCH__destination);
if(ref)
ref = lv2_atom_forge_urid(forge, destination);
@@ -68,31 +69,31 @@ _synthpod_patcher_internal_destination(reg_t *regs, LV2_Atom_Forge *forge,
}
static inline LV2_Atom_Forge_Ref
-_synthpod_patcher_internal_body(reg_t *regs, LV2_Atom_Forge *forge)
+_synthpod_patcher_internal_body(LV2_Atom_Forge *forge)
{
- return lv2_atom_forge_key(forge, regs->patch.body.urid);
+ return lv2_atom_forge_key(forge, PATCH__body);
}
static inline LV2_Atom_Forge_Ref
-_synthpod_patcher_internal_add(reg_t *regs, LV2_Atom_Forge *forge)
+_synthpod_patcher_internal_add(LV2_Atom_Forge *forge)
{
- return lv2_atom_forge_key(forge, regs->patch.add.urid);
+ return lv2_atom_forge_key(forge, PATCH__add);
}
static inline LV2_Atom_Forge_Ref
-_synthpod_patcher_internal_remove(reg_t *regs, LV2_Atom_Forge *forge)
+_synthpod_patcher_internal_remove(LV2_Atom_Forge *forge)
{
- return lv2_atom_forge_key(forge, regs->patch.remove.urid);
+ return lv2_atom_forge_key(forge, PATCH__remove);
}
static inline LV2_Atom_Forge_Ref
-_synthpod_patcher_internal_value(reg_t *regs, LV2_Atom_Forge *forge)
+_synthpod_patcher_internal_value(LV2_Atom_Forge *forge)
{
- return lv2_atom_forge_key(forge, regs->patch.value.urid);
+ return lv2_atom_forge_key(forge, PATCH__value);
}
static inline LV2_Atom_Forge_Ref
-_synthpod_patcher_internal_raw(reg_t *regs, LV2_Atom_Forge *forge,
+_synthpod_patcher_internal_raw(LV2_Atom_Forge *forge,
uint32_t size, LV2_URID type, const void *body)
{
LV2_Atom_Forge_Ref ref = lv2_atom_forge_atom(forge, size, type);
@@ -103,7 +104,7 @@ _synthpod_patcher_internal_raw(reg_t *regs, LV2_Atom_Forge *forge,
}
static inline LV2_Atom_Forge_Ref
-_synthpod_patcher_internal_atom(reg_t *regs, LV2_Atom_Forge *forge,
+_synthpod_patcher_internal_atom(LV2_Atom_Forge *forge,
const LV2_Atom *atom)
{
return lv2_atom_forge_write(forge, atom, lv2_atom_total_size(atom));
@@ -121,15 +122,15 @@ synthpod_patcher_pop(LV2_Atom_Forge *forge,
// patch:Copy
static LV2_Atom_Forge_Ref
-synthpod_patcher_copy(reg_t *regs, LV2_Atom_Forge *forge,
+synthpod_patcher_copy(LV2_Atom_Forge *forge,
LV2_URID subject, int32_t seqn, LV2_URID destination)
{
LV2_Atom_Forge_Frame frame [1];
- LV2_Atom_Forge_Ref ref = _synthpod_patcher_internal_object(regs, forge, frame,
- regs->patch.copy.urid, subject, seqn);
+ LV2_Atom_Forge_Ref ref = _synthpod_patcher_internal_object(forge, frame,
+ PATCH__Copy, subject, seqn);
if(ref)
- ref = _synthpod_patcher_internal_destination(regs, forge, destination);
+ ref = _synthpod_patcher_internal_destination(forge, destination);
if(ref)
synthpod_patcher_pop(forge, frame, 1);
@@ -138,13 +139,13 @@ synthpod_patcher_copy(reg_t *regs, LV2_Atom_Forge *forge,
// patch:Delete
static LV2_Atom_Forge_Ref
-synthpod_patcher_delete(reg_t *regs, LV2_Atom_Forge *forge,
+synthpod_patcher_delete(LV2_Atom_Forge *forge,
LV2_URID subject, int32_t seqn)
{
LV2_Atom_Forge_Frame frame [1];
- LV2_Atom_Forge_Ref ref = _synthpod_patcher_internal_object(regs, forge, frame,
- regs->patch.delete.urid, subject, seqn);
+ LV2_Atom_Forge_Ref ref = _synthpod_patcher_internal_object(forge, frame,
+ PATCH__Delete, subject, seqn);
if(ref)
synthpod_patcher_pop(forge, frame, 1);
@@ -153,15 +154,15 @@ synthpod_patcher_delete(reg_t *regs, LV2_Atom_Forge *forge,
// patch:Get
static LV2_Atom_Forge_Ref
-synthpod_patcher_get(reg_t *regs, LV2_Atom_Forge *forge,
+synthpod_patcher_get(LV2_Atom_Forge *forge,
LV2_URID subject, int32_t seqn, LV2_URID property)
{
LV2_Atom_Forge_Frame frame [1];
- LV2_Atom_Forge_Ref ref = _synthpod_patcher_internal_object(regs, forge, frame,
- regs->patch.get.urid, subject, seqn);
+ LV2_Atom_Forge_Ref ref = _synthpod_patcher_internal_object(forge, frame,
+ PATCH__Get, subject, seqn);
if(property && ref)
- ref = _synthpod_patcher_internal_property(regs, forge, property);
+ ref = _synthpod_patcher_internal_property(forge, property);
if(ref)
synthpod_patcher_pop(forge, frame, 1);
@@ -170,28 +171,28 @@ synthpod_patcher_get(reg_t *regs, LV2_Atom_Forge *forge,
// patch:Insert
static LV2_Atom_Forge_Ref
-synthpod_patcher_insert_object(reg_t *regs, LV2_Atom_Forge *forge, LV2_Atom_Forge_Frame *frame,
+synthpod_patcher_insert_object(LV2_Atom_Forge *forge, LV2_Atom_Forge_Frame *frame,
LV2_URID subject, int32_t seqn)
{
- LV2_Atom_Forge_Ref ref = _synthpod_patcher_internal_object(regs, forge, frame,
- regs->patch.insert.urid, subject, seqn);
+ LV2_Atom_Forge_Ref ref = _synthpod_patcher_internal_object(forge, frame,
+ PATCH__Insert, subject, seqn);
if(ref)
- ref = _synthpod_patcher_internal_body(regs, forge);
+ ref = _synthpod_patcher_internal_body(forge);
return ref;
}
static LV2_Atom_Forge_Ref
-synthpod_patcher_insert(reg_t *regs, LV2_Atom_Forge *forge,
+synthpod_patcher_insert(LV2_Atom_Forge *forge,
LV2_URID subject, int32_t seqn,
uint32_t size, LV2_URID type, const void *body)
{
LV2_Atom_Forge_Frame frame [1];
- LV2_Atom_Forge_Ref ref = synthpod_patcher_insert_object(regs, forge, frame,
+ LV2_Atom_Forge_Ref ref = synthpod_patcher_insert_object(forge, frame,
subject, seqn);
if(ref)
- ref = _synthpod_patcher_internal_raw(regs, forge, size, type, body);
+ ref = _synthpod_patcher_internal_raw(forge, size, type, body);
if(ref)
synthpod_patcher_pop(forge, frame, 1);
@@ -199,16 +200,16 @@ synthpod_patcher_insert(reg_t *regs, LV2_Atom_Forge *forge,
}
static LV2_Atom_Forge_Ref
-synthpod_patcher_insert_atom(reg_t *regs, LV2_Atom_Forge *forge,
+synthpod_patcher_insert_atom(LV2_Atom_Forge *forge,
LV2_URID subject, int32_t seqn,
const LV2_Atom *atom)
{
LV2_Atom_Forge_Frame frame [1];
- LV2_Atom_Forge_Ref ref = synthpod_patcher_insert_object(regs, forge, frame,
+ LV2_Atom_Forge_Ref ref = synthpod_patcher_insert_object(forge, frame,
subject, seqn);
if(ref)
- ref = _synthpod_patcher_internal_atom(regs, forge, atom);
+ ref = _synthpod_patcher_internal_atom(forge, atom);
if(ref)
synthpod_patcher_pop(forge, frame, 1);
@@ -217,20 +218,20 @@ synthpod_patcher_insert_atom(reg_t *regs, LV2_Atom_Forge *forge,
// patch:remove aka patch:Patch
static LV2_Atom_Forge_Ref
-synthpod_patcher_remove_object(reg_t *regs, LV2_Atom_Forge *forge, LV2_Atom_Forge_Frame *frame,
+synthpod_patcher_remove_object(LV2_Atom_Forge *forge, LV2_Atom_Forge_Frame *frame,
LV2_URID subject, int32_t seqn, LV2_URID property)
{
- LV2_Atom_Forge_Ref ref = _synthpod_patcher_internal_object(regs, forge, frame,
- regs->patch.patch.urid, subject, seqn);
+ LV2_Atom_Forge_Ref ref = _synthpod_patcher_internal_object(forge, frame,
+ PATCH__Patch, subject, seqn);
if(ref)
- ref = _synthpod_patcher_internal_add(regs, forge);
+ ref = _synthpod_patcher_internal_add(forge);
if(ref)
ref = lv2_atom_forge_object(forge, &frame[1], 0, 0);
// add nothing
if(ref)
lv2_atom_forge_pop(forge, &frame[1]);
if(ref)
- ref = _synthpod_patcher_internal_remove(regs, forge);
+ ref = _synthpod_patcher_internal_remove(forge);
if(ref)
ref = lv2_atom_forge_object(forge, &frame[1], 0, 0);
if(ref)
@@ -240,16 +241,16 @@ synthpod_patcher_remove_object(reg_t *regs, LV2_Atom_Forge *forge, LV2_Atom_Forg
}
static LV2_Atom_Forge_Ref
-synthpod_patcher_remove(reg_t *regs, LV2_Atom_Forge *forge,
+synthpod_patcher_remove(LV2_Atom_Forge *forge,
LV2_URID subject, int32_t seqn, LV2_URID property,
uint32_t size, LV2_URID type, const void *body)
{
LV2_Atom_Forge_Frame frame [2];
- LV2_Atom_Forge_Ref ref = synthpod_patcher_remove_object(regs, forge, frame,
+ LV2_Atom_Forge_Ref ref = synthpod_patcher_remove_object(forge, frame,
subject, seqn, property);
if(ref)
- ref = _synthpod_patcher_internal_raw(regs, forge, size, type, body);
+ ref = _synthpod_patcher_internal_raw(forge, size, type, body);
if(ref)
synthpod_patcher_pop(forge, frame, 2);
@@ -257,16 +258,16 @@ synthpod_patcher_remove(reg_t *regs, LV2_Atom_Forge *forge,
}
static LV2_Atom_Forge_Ref
-synthpod_patcher_remove_atom(reg_t *regs, LV2_Atom_Forge *forge,
+synthpod_patcher_remove_atom(LV2_Atom_Forge *forge,
LV2_URID subject, int32_t seqn, LV2_URID property,
const LV2_Atom *atom)
{
LV2_Atom_Forge_Frame frame [2];
- LV2_Atom_Forge_Ref ref = synthpod_patcher_remove_object(regs, forge, frame,
+ LV2_Atom_Forge_Ref ref = synthpod_patcher_remove_object(forge, frame,
subject, seqn, property);
if(ref)
- ref = _synthpod_patcher_internal_atom(regs, forge, atom);
+ ref = _synthpod_patcher_internal_atom(forge, atom);
if(ref)
synthpod_patcher_pop(forge, frame, 2);
@@ -275,20 +276,20 @@ synthpod_patcher_remove_atom(reg_t *regs, LV2_Atom_Forge *forge,
// patch:add aka patch:Patch
static LV2_Atom_Forge_Ref
-synthpod_patcher_add_object(reg_t *regs, LV2_Atom_Forge *forge, LV2_Atom_Forge_Frame *frame,
+synthpod_patcher_add_object(LV2_Atom_Forge *forge, LV2_Atom_Forge_Frame *frame,
LV2_URID subject, int32_t seqn, LV2_URID property) //FIXME add removal flag
{
- LV2_Atom_Forge_Ref ref = _synthpod_patcher_internal_object(regs, forge, frame,
- regs->patch.patch.urid, subject, seqn);
+ LV2_Atom_Forge_Ref ref = _synthpod_patcher_internal_object(forge, frame,
+ PATCH__Patch, subject, seqn);
if(ref)
- ref = _synthpod_patcher_internal_remove(regs, forge);
+ ref = _synthpod_patcher_internal_remove(forge);
if(ref)
ref = lv2_atom_forge_object(forge, &frame[1], 0, 0);
// add nothing
if(ref)
lv2_atom_forge_pop(forge, &frame[1]);
if(ref)
- ref = _synthpod_patcher_internal_add(regs, forge);
+ ref = _synthpod_patcher_internal_add(forge);
if(ref)
ref = lv2_atom_forge_object(forge, &frame[1], 0, 0);
if(ref)
@@ -298,16 +299,16 @@ synthpod_patcher_add_object(reg_t *regs, LV2_Atom_Forge *forge, LV2_Atom_Forge_F
}
static LV2_Atom_Forge_Ref
-synthpod_patcher_add(reg_t *regs, LV2_Atom_Forge *forge,
+synthpod_patcher_add(LV2_Atom_Forge *forge,
LV2_URID subject, int32_t seqn, LV2_URID property,
uint32_t size, LV2_URID type, const void *body)
{
LV2_Atom_Forge_Frame frame [2];
- LV2_Atom_Forge_Ref ref = synthpod_patcher_add_object(regs, forge, frame,
+ LV2_Atom_Forge_Ref ref = synthpod_patcher_add_object(forge, frame,
subject, seqn, property);
if(ref)
- ref = _synthpod_patcher_internal_raw(regs, forge, size, type, body);
+ ref = _synthpod_patcher_internal_raw(forge, size, type, body);
if(ref)
synthpod_patcher_pop(forge, frame, 2);
@@ -315,16 +316,16 @@ synthpod_patcher_add(reg_t *regs, LV2_Atom_Forge *forge,
}
static LV2_Atom_Forge_Ref
-synthpod_patcher_add_atom(reg_t *regs, LV2_Atom_Forge *forge,
+synthpod_patcher_add_atom(LV2_Atom_Forge *forge,
LV2_URID subject, int32_t seqn, LV2_URID property,
const LV2_Atom *atom)
{
LV2_Atom_Forge_Frame frame [2];
- LV2_Atom_Forge_Ref ref = synthpod_patcher_add_object(regs, forge, frame,
+ LV2_Atom_Forge_Ref ref = synthpod_patcher_add_object(forge, frame,
subject, seqn, property);
if(ref)
- ref = _synthpod_patcher_internal_atom(regs, forge, atom);
+ ref = _synthpod_patcher_internal_atom(forge, atom);
if(ref)
synthpod_patcher_pop(forge, frame, 2);
@@ -333,16 +334,16 @@ synthpod_patcher_add_atom(reg_t *regs, LV2_Atom_Forge *forge,
// patch:Move
static LV2_Atom_Forge_Ref
-synthpod_patcher_move(reg_t *regs, LV2_Atom_Forge *forge,
+synthpod_patcher_move(LV2_Atom_Forge *forge,
LV2_URID subject, int32_t seqn,
LV2_URID destination)
{
LV2_Atom_Forge_Frame frame [1];
- LV2_Atom_Forge_Ref ref = _synthpod_patcher_internal_object(regs, forge, frame,
- regs->patch.move.urid, subject, seqn);
+ LV2_Atom_Forge_Ref ref = _synthpod_patcher_internal_object(forge, frame,
+ PATCH__Move, subject, seqn);
if(ref)
- ref = _synthpod_patcher_internal_destination(regs, forge, destination);
+ ref = _synthpod_patcher_internal_destination(forge, destination);
if(ref)
synthpod_patcher_pop(forge, frame, 1);
@@ -355,28 +356,28 @@ synthpod_patcher_move(reg_t *regs, LV2_Atom_Forge *forge,
// patch:Put
static LV2_Atom_Forge_Ref
-synthpod_patcher_put_object(reg_t *regs, LV2_Atom_Forge *forge, LV2_Atom_Forge_Frame *frame,
+synthpod_patcher_put_object(LV2_Atom_Forge *forge, LV2_Atom_Forge_Frame *frame,
LV2_URID subject, int32_t seqn)
{
- LV2_Atom_Forge_Ref ref = _synthpod_patcher_internal_object(regs, forge, frame,
- regs->patch.put.urid, subject, seqn);
+ LV2_Atom_Forge_Ref ref = _synthpod_patcher_internal_object(forge, frame,
+ PATCH__Put, subject, seqn);
if(ref)
- ref = _synthpod_patcher_internal_body(regs, forge);
+ ref = _synthpod_patcher_internal_body(forge);
return ref;
}
static LV2_Atom_Forge_Ref
-synthpod_patcher_put(reg_t *regs, LV2_Atom_Forge *forge,
+synthpod_patcher_put(LV2_Atom_Forge *forge,
LV2_URID subject, int32_t seqn,
uint32_t size, LV2_URID type, const void *body)
{
LV2_Atom_Forge_Frame frame [1];
- LV2_Atom_Forge_Ref ref = synthpod_patcher_put_object(regs, forge, frame,
+ LV2_Atom_Forge_Ref ref = synthpod_patcher_put_object(forge, frame,
subject, seqn);
if(ref)
- ref = _synthpod_patcher_internal_raw(regs, forge, size, type, body);
+ ref = _synthpod_patcher_internal_raw(forge, size, type, body);
if(ref)
synthpod_patcher_pop(forge, frame, 1);
@@ -384,16 +385,16 @@ synthpod_patcher_put(reg_t *regs, LV2_Atom_Forge *forge,
}
static LV2_Atom_Forge_Ref
-synthpod_patcher_put_atom(reg_t *regs, LV2_Atom_Forge *forge,
+synthpod_patcher_put_atom(LV2_Atom_Forge *forge,
LV2_URID subject, int32_t seqn,
const LV2_Atom *atom)
{
LV2_Atom_Forge_Frame frame [1];
- LV2_Atom_Forge_Ref ref = synthpod_patcher_put_object(regs, forge, frame,
+ LV2_Atom_Forge_Ref ref = synthpod_patcher_put_object(forge, frame,
subject, seqn);
if(ref)
- ref = _synthpod_patcher_internal_atom(regs, forge, atom);
+ ref = _synthpod_patcher_internal_atom(forge, atom);
if(ref)
synthpod_patcher_pop(forge, frame, 1);
@@ -402,29 +403,29 @@ synthpod_patcher_put_atom(reg_t *regs, LV2_Atom_Forge *forge,
// patch:Set
static LV2_Atom_Forge_Ref
-synthpod_patcher_set_object(reg_t *regs, LV2_Atom_Forge *forge, LV2_Atom_Forge_Frame *frame,
+synthpod_patcher_set_object(LV2_Atom_Forge *forge, LV2_Atom_Forge_Frame *frame,
LV2_URID subject, int32_t seqn, LV2_URID property)
{
- LV2_Atom_Forge_Ref ref = _synthpod_patcher_internal_object(regs, forge, frame,
- regs->patch.set.urid, subject, seqn);
+ LV2_Atom_Forge_Ref ref = _synthpod_patcher_internal_object(forge, frame,
+ PATCH__Set, subject, seqn);
if(ref)
- ref = _synthpod_patcher_internal_property(regs, forge, property);
+ ref = _synthpod_patcher_internal_property(forge, property);
if(ref)
- ref = _synthpod_patcher_internal_value(regs, forge);
+ ref = _synthpod_patcher_internal_value(forge);
return ref;
}
static LV2_Atom_Forge_Ref
-synthpod_patcher_set(reg_t *regs, LV2_Atom_Forge *forge,
+synthpod_patcher_set(LV2_Atom_Forge *forge,
LV2_URID subject, int32_t seqn, LV2_URID property,
uint32_t size, LV2_URID type, const void *body)
{
LV2_Atom_Forge_Frame frame [1];
- LV2_Atom_Forge_Ref ref = synthpod_patcher_set_object(regs, forge, frame,
+ LV2_Atom_Forge_Ref ref = synthpod_patcher_set_object(forge, frame,
subject, seqn, property);
if(ref)
- ref = _synthpod_patcher_internal_raw(regs, forge, size, type, body);
+ ref = _synthpod_patcher_internal_raw(forge, size, type, body);
if(ref)
synthpod_patcher_pop(forge, frame, 1);
@@ -432,16 +433,16 @@ synthpod_patcher_set(reg_t *regs, LV2_Atom_Forge *forge,
}
static LV2_Atom_Forge_Ref
-synthpod_patcher_set_atom(reg_t *regs, LV2_Atom_Forge *forge,
+synthpod_patcher_set_atom(LV2_Atom_Forge *forge,
LV2_URID subject, int32_t seqn, LV2_URID property,
const LV2_Atom *atom)
{
LV2_Atom_Forge_Frame frame [1];
- LV2_Atom_Forge_Ref ref = synthpod_patcher_set_object(regs, forge, frame,
+ LV2_Atom_Forge_Ref ref = synthpod_patcher_set_object(forge, frame,
subject, seqn, property);
if(ref)
- ref = _synthpod_patcher_internal_atom(regs, forge, atom);
+ ref = _synthpod_patcher_internal_atom(forge, atom);
if(ref)
synthpod_patcher_pop(forge, frame, 1);
@@ -450,13 +451,13 @@ synthpod_patcher_set_atom(reg_t *regs, LV2_Atom_Forge *forge,
// patch:Ack
static LV2_Atom_Forge_Ref
-synthpod_patcher_ack(reg_t *regs, LV2_Atom_Forge *forge,
+synthpod_patcher_ack(LV2_Atom_Forge *forge,
LV2_URID subject, int32_t seqn)
{
LV2_Atom_Forge_Frame frame [1];
- LV2_Atom_Forge_Ref ref = _synthpod_patcher_internal_object(regs, forge, frame,
- regs->patch.ack.urid, subject, seqn);
+ LV2_Atom_Forge_Ref ref = _synthpod_patcher_internal_object(forge, frame,
+ PATCH__Ack, subject, seqn);
if(ref)
synthpod_patcher_pop(forge, frame, 1);
@@ -465,13 +466,13 @@ synthpod_patcher_ack(reg_t *regs, LV2_Atom_Forge *forge,
// patch:Error
static LV2_Atom_Forge_Ref
-synthpod_patcher_error(reg_t *regs, LV2_Atom_Forge *forge,
+synthpod_patcher_error(LV2_Atom_Forge *forge,
LV2_URID subject, int32_t seqn)
{
LV2_Atom_Forge_Frame frame [1];
- LV2_Atom_Forge_Ref ref = _synthpod_patcher_internal_object(regs, forge, frame,
- regs->patch.error.urid, subject, seqn);
+ LV2_Atom_Forge_Ref ref = _synthpod_patcher_internal_object(forge, frame,
+ PATCH__Error, subject, seqn);
if(ref)
synthpod_patcher_pop(forge, frame, 1);
diff --git a/include/synthpod_private.h b/include/synthpod_private.h
index f7d4cc28..adcda07f 100644
--- a/include/synthpod_private.h
+++ b/include/synthpod_private.h
@@ -30,7 +30,6 @@
#include <lv2/lv2plug.in/ns/lv2core/lv2.h>
#include <lv2/lv2plug.in/ns/ext/urid/urid.h>
-#include <lv2/lv2plug.in/ns/ext/uri-map/uri-map.h>
#include <lv2/lv2plug.in/ns/ext/midi/midi.h>
#include <lv2/lv2plug.in/ns/ext/log/log.h>
#include <lv2/lv2plug.in/ns/ext/worker/worker.h>
@@ -53,6 +52,8 @@
#include <osc.lv2/osc.h>
#include <canvas.lv2/canvas.h>
+#include <synthpod_stat.h>
+
typedef enum _port_type_t port_type_t;
typedef enum _port_atom_type_t port_atom_type_t;
typedef enum _port_buffer_type_t port_buffer_type_t;
@@ -101,1901 +102,42 @@ enum _port_protocol_t {
PORT_PROTOCOL_NUM
}; //TODO use this
-typedef int32_t u_id_t;
-typedef struct _reg_item_t reg_item_t;
-typedef struct _reg_t reg_t;
-
-struct _reg_item_t {
- LilvNode *node;
- LV2_URID urid;
-};
-
-struct _reg_t {
- struct {
- reg_item_t input;
- reg_item_t output;
-
- reg_item_t control;
- reg_item_t audio;
- reg_item_t cv;
- reg_item_t atom;
-
- // atom buffer type
- reg_item_t sequence;
-
- // atom sequence event types
- reg_item_t midi;
- reg_item_t osc_event;
- reg_item_t time_position;
-
- // control port property
- reg_item_t integer;
- reg_item_t enumeration;
- reg_item_t toggled;
- reg_item_t is_bitmask;
-
- // port protocols
- reg_item_t float_protocol;
- reg_item_t peak_protocol;
- reg_item_t atom_transfer;
- reg_item_t event_transfer;
-
- reg_item_t notification;
- reg_item_t minimum_size;
-
- // properties
- reg_item_t logarithmic;
- } port;
-
- struct {
- reg_item_t message;
- reg_item_t path;
- } osc;
-
- struct {
- reg_item_t property;
- } parameter;
-
- struct {
- reg_item_t schedule;
- } work;
-
- struct {
- reg_item_t entry;
- reg_item_t error;
- reg_item_t note;
- reg_item_t trace;
- reg_item_t warning;
- } log;
-
- struct {
- reg_item_t window_title;
- reg_item_t show_interface;
- reg_item_t idle_interface;
- reg_item_t kx_widget;
- reg_item_t external;
- reg_item_t x11;
- reg_item_t gtk2;
- reg_item_t gtk3;
- reg_item_t qt4;
- reg_item_t qt5;
- reg_item_t plugin;
- reg_item_t protocol;
- reg_item_t period_start;
- reg_item_t period_size;
- reg_item_t peak;
- 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;
- reg_item_t ui;
- } ui;
-
- struct {
- reg_item_t preset;
- reg_item_t preset_bank;
- reg_item_t bank;
- } pset;
-
- struct {
- reg_item_t value;
- reg_item_t type;
- reg_item_t subject;
- } rdf;
-
- struct {
- reg_item_t label;
- reg_item_t range;
- reg_item_t comment;
- reg_item_t see_also;
- } rdfs;
-
- struct {
- reg_item_t license;
- reg_item_t name;
- } doap;
-
- struct {
- reg_item_t optional_feature;
- reg_item_t required_feature;
- reg_item_t name;
- reg_item_t minor_version;
- reg_item_t micro_version;
- reg_item_t extension_data;
- reg_item_t control;
- reg_item_t symbol;
- reg_item_t index;
- reg_item_t minimum;
- reg_item_t maximum;
- reg_item_t scale_point;
- reg_item_t port;
- reg_item_t Port;
- reg_item_t plugin;
- reg_item_t applies_to;
- reg_item_t designation;
- } core;
-
- struct {
- reg_item_t sample_rate;
- reg_item_t gain;
- } param;
-
- struct {
- reg_item_t nominal_block_length;
- reg_item_t max_block_length;
- reg_item_t min_block_length;
- reg_item_t sequence_size;
- } bufsz;
-
- struct {
- reg_item_t writable;
- reg_item_t readable;
- reg_item_t message;
- reg_item_t set;
- reg_item_t get;
- reg_item_t subject;
- reg_item_t body;
- reg_item_t property;
- reg_item_t value;
- reg_item_t wildcard;
- reg_item_t patch;
- reg_item_t add;
- reg_item_t remove;
- reg_item_t put;
- reg_item_t insert;
- reg_item_t delete;
- reg_item_t destination;
- reg_item_t copy;
- reg_item_t move;
- reg_item_t sequence_number;
- reg_item_t error;
- reg_item_t ack;
- } patch;
-
- struct {
- reg_item_t message;
- } xpress;
-
- struct {
- reg_item_t graph;
- } canvas;
-
- struct {
- reg_item_t group;
- reg_item_t left;
- reg_item_t right;
- reg_item_t center;
- reg_item_t side;
- reg_item_t center_left;
- reg_item_t center_right;
- reg_item_t side_left;
- reg_item_t side_right;
- reg_item_t rear_left;
- reg_item_t rear_right;
- reg_item_t rear_center;
- reg_item_t low_frequency_effects;
- } group;
-
- struct {
- // properties
- reg_item_t conversion;
- reg_item_t prefixConversion;
- reg_item_t render;
- reg_item_t symbol;
- reg_item_t unit;
- reg_item_t Unit;
-
- // instances;
- reg_item_t bar;
- reg_item_t beat;
- reg_item_t bpm;
- reg_item_t cent;
- reg_item_t cm;
- reg_item_t coef;
- reg_item_t db;
- reg_item_t degree;
- reg_item_t frame;
- reg_item_t hz;
- reg_item_t inch;
- reg_item_t khz;
- reg_item_t km;
- reg_item_t m;
- reg_item_t mhz;
- reg_item_t midiNote;
- reg_item_t midiController;
- reg_item_t mile;
- reg_item_t min;
- reg_item_t mm;
- reg_item_t ms;
- reg_item_t oct;
- reg_item_t pc;
- reg_item_t s;
- reg_item_t semitone12TET;
- } units;
-
- struct {
- reg_item_t state;
- reg_item_t load_default_state;
- reg_item_t thread_safe_restore;
- } state;
-
- struct {
- reg_item_t payload;
- reg_item_t state;
- reg_item_t graph;
- reg_item_t null;
- reg_item_t stereo;
- reg_item_t monoatom;
-
- reg_item_t module_list;
- reg_item_t module_supported;
- reg_item_t module_add;
- reg_item_t module_del;
- reg_item_t module_move;
- reg_item_t module_preset_load;
- reg_item_t module_preset_save;
- reg_item_t module_visible;
- reg_item_t module_disabled;
- reg_item_t module_profiling;
- reg_item_t module_position_x;
- reg_item_t module_position_y;
- reg_item_t module_alias;
- reg_item_t module_reinstantiate;
- reg_item_t module_created;
- reg_item_t node_position_x;
- reg_item_t node_position_y;
- reg_item_t graph_position_x;
- reg_item_t graph_position_y;
- reg_item_t column_enabled;
- reg_item_t row_enabled;
- reg_item_t port_refresh;
- reg_item_t bundle_load;
- reg_item_t bundle_save;
- reg_item_t path_get;
- reg_item_t dsp_profiling;
- reg_item_t cpus_available;
- reg_item_t cpus_used;
- reg_item_t period_size;
- reg_item_t num_periods;
- reg_item_t quit;
-
- reg_item_t system_ports;
- reg_item_t control_port;
- reg_item_t audio_port;
- reg_item_t cv_port;
- reg_item_t midi_port;
- reg_item_t osc_port;
- reg_item_t com_port;
-
- reg_item_t subscription_list;
- reg_item_t notification_list;
- reg_item_t automation_list;
- reg_item_t connection_list;
- reg_item_t node_list;
-
- reg_item_t source_module;
- reg_item_t source_symbol;
- reg_item_t sink_module;
- reg_item_t sink_symbol;
-
- reg_item_t source_min;
- reg_item_t source_max;
- reg_item_t sink_min;
- reg_item_t sink_max;
-
- reg_item_t source_enabled;
- reg_item_t sink_enabled;
- reg_item_t learning;
-
- reg_item_t placeholder;
- reg_item_t visibility;
- } synthpod;
-
- struct {
- reg_item_t Controller;
- reg_item_t channel;
- reg_item_t controller_number;
- } midi;
-
- struct {
- reg_item_t surface;
- } idisp;
-};
-
-static inline void
-_register(reg_item_t *itm, LilvWorld *world, LV2_URID_Map *map, const char *uri)
-{
- itm->node = lilv_new_uri(world, uri);
- itm->urid = map->map(map->handle, uri);
-}
-
-static inline void
-_register_string(reg_item_t *itm, LilvWorld *world, LV2_URID_Map *map, const char *uri)
-{
- itm->node = lilv_new_string(world, uri);
- itm->urid = map->map(map->handle, uri);
-}
-
-static inline void
-_unregister(reg_item_t *itm)
-{
- if(itm->node)
- lilv_node_free(itm->node);
-}
-
-static inline void
-sp_regs_init(reg_t *regs, LilvWorld *world, LV2_URID_Map *map)
-{
- _register(&regs->port.input, world, map, LV2_CORE__InputPort);
- _register(&regs->port.output, world, map, LV2_CORE__OutputPort);
-
- _register(&regs->port.control, world, map, LV2_CORE__ControlPort);
- _register(&regs->port.audio, world, map, LV2_CORE__AudioPort);
- _register(&regs->port.cv, world, map, LV2_CORE__CVPort);
- _register(&regs->port.atom, world, map, LV2_ATOM__AtomPort);
-
- _register(&regs->port.sequence, world, map, LV2_ATOM__Sequence);
- _register(&regs->port.midi, world, map, LV2_MIDI__MidiEvent);
- _register(&regs->port.osc_event, world, map, LV2_OSC__Event);
- _register(&regs->port.time_position, world, map, LV2_TIME__Position);
-
- _register(&regs->port.integer, world, map, LV2_CORE__integer);
- _register(&regs->port.enumeration, world, map, LV2_CORE__enumeration);
- _register(&regs->port.toggled, world, map, LV2_CORE__toggled);
- _register(&regs->port.is_bitmask, world, map, LV2_CORE_PREFIX"isBitmask");
-
- _register(&regs->port.float_protocol, world, map, LV2_UI_PREFIX"floatProtocol");
- _register(&regs->port.peak_protocol, world, map, LV2_UI_PREFIX"peakProtocol");
- _register(&regs->port.atom_transfer, world, map, LV2_ATOM__atomTransfer);
- _register(&regs->port.event_transfer, world, map, LV2_ATOM__eventTransfer);
- _register(&regs->port.notification, world, map, LV2_UI__portNotification);
-
- _register(&regs->port.minimum_size, world, map, LV2_RESIZE_PORT__minimumSize);
-
- _register(&regs->port.logarithmic, world, map, LV2_PORT_PROPS__logarithmic);
-
- _register(&regs->parameter.property, world, map, LV2_CORE_PREFIX"parameterProperty");
-
- _register(&regs->osc.message, world, map, LV2_OSC__Message);
- _register(&regs->osc.path, world, map, LV2_OSC__messagePath);
-
- _register(&regs->work.schedule, world, map, LV2_WORKER__schedule);
-
- _register(&regs->log.entry, world, map, LV2_LOG__Entry);
- _register(&regs->log.error, world, map, LV2_LOG__Error);
- _register(&regs->log.note, world, map, LV2_LOG__Note);
- _register(&regs->log.trace, world, map, LV2_LOG__Trace);
- _register(&regs->log.warning, world, map, LV2_LOG__Warning);
-
- _register(&regs->ui.window_title, world, map, LV2_UI__windowTitle);
- _register(&regs->ui.show_interface, world, map, LV2_UI__showInterface);
- _register(&regs->ui.idle_interface, world, map, LV2_UI__idleInterface);
- _register(&regs->ui.kx_widget, world, map, LV2_EXTERNAL_UI__Widget);
- _register(&regs->ui.external, world, map, LV2_EXTERNAL_UI_DEPRECATED_URI);
- _register(&regs->ui.x11, world, map, LV2_UI__X11UI);
- _register(&regs->ui.gtk2, world, map, LV2_UI__GtkUI);
- _register(&regs->ui.gtk3, world, map, LV2_UI__Gtk3UI);
- _register(&regs->ui.qt4, world, map, LV2_UI__Qt4UI);
- _register(&regs->ui.qt5, world, map, LV2_UI_PREFIX"Qt5UI");
- _register(&regs->ui.plugin, world, map, LV2_UI__plugin);
- _register(&regs->ui.protocol, world, map, LV2_UI_PREFIX"protocol");
- _register(&regs->ui.period_start, world, map, LV2_UI_PREFIX"periodStart");
- _register(&regs->ui.period_size, world, map, LV2_UI_PREFIX"periodSize");
- _register(&regs->ui.peak, world, map, LV2_UI_PREFIX"peak");
- _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);
- _register(&regs->ui.ui, world, map, LV2_UI__ui);
-
-#ifndef LV2_PRESETS__bank
-# define LV2_PRESETS__bank LV2_PRESETS_PREFIX "bank"
-#endif
-#ifndef LV2_PRESETS__Bank
-# define LV2_PRESETS__Bank LV2_PRESETS_PREFIX "Bank"
-#endif
- _register(&regs->pset.preset, world, map, LV2_PRESETS__Preset);
- _register(&regs->pset.preset_bank, world, map, LV2_PRESETS__bank);
- _register(&regs->pset.bank, world, map, LV2_PRESETS__Bank);
-
- _register(&regs->rdf.value, world, map, LILV_NS_RDF"value");
- _register(&regs->rdf.type, world, map, LILV_NS_RDF"type");
- _register(&regs->rdf.subject, world, map, LILV_NS_RDF"subject");
-
- _register(&regs->rdfs.label, world, map, LILV_NS_RDFS"label");
- _register(&regs->rdfs.range, world, map, LILV_NS_RDFS"range");
- _register(&regs->rdfs.comment, world, map, LILV_NS_RDFS"comment");
- _register(&regs->rdfs.see_also, world, map, LILV_NS_RDFS"seeAlso");
-
- _register(&regs->doap.license, world, map, LILV_NS_DOAP"license");
- _register(&regs->doap.name, world, map, LILV_NS_DOAP"name");
-
- _register(&regs->core.optional_feature, world, map, LV2_CORE__optionalFeature);
- _register(&regs->core.required_feature, world, map, LV2_CORE__requiredFeature);
- _register(&regs->core.name, world, map, LV2_CORE__name);
- _register(&regs->core.minor_version, world, map, LV2_CORE__minorVersion);
- _register(&regs->core.micro_version, world, map, LV2_CORE__microVersion);
- _register(&regs->core.extension_data, world, map, LV2_CORE__extensionData);
- _register(&regs->core.control, world, map, LV2_CORE__control);
- _register(&regs->core.symbol, world, map, LV2_CORE__symbol);
- _register(&regs->core.index, world, map, LV2_CORE__index);
- _register(&regs->core.minimum, world, map, LV2_CORE__minimum);
- _register(&regs->core.maximum, world, map, LV2_CORE__maximum);
- _register(&regs->core.scale_point, world, map, LV2_CORE__scalePoint);
- _register(&regs->core.port, world, map, LV2_CORE__port);
- _register(&regs->core.Port, world, map, LV2_CORE__Port);
- _register(&regs->core.plugin, world, map, LV2_CORE__Plugin);
- _register(&regs->core.applies_to, world, map, LV2_CORE__appliesTo);
- _register(&regs->core.designation, world, map, LV2_CORE__designation);
-
- _register(&regs->param.sample_rate, world, map, LV2_PARAMETERS__sampleRate);
- _register(&regs->param.gain, world, map, LV2_PARAMETERS__gain);
-
- _register(&regs->bufsz.nominal_block_length, world, map, LV2_BUF_SIZE_PREFIX "nominalBlockLength");
- _register(&regs->bufsz.max_block_length, world, map, LV2_BUF_SIZE__maxBlockLength);
- _register(&regs->bufsz.min_block_length, world, map, LV2_BUF_SIZE__minBlockLength);
- _register(&regs->bufsz.sequence_size, world, map, LV2_BUF_SIZE__sequenceSize);
-
- _register(&regs->patch.writable, world, map, LV2_PATCH__writable);
- _register(&regs->patch.readable, world, map, LV2_PATCH__readable);
- _register(&regs->patch.message, world, map, LV2_PATCH__Message);
- _register(&regs->patch.set, world, map, LV2_PATCH__Set);
- _register(&regs->patch.get, world, map, LV2_PATCH__Get);
- _register(&regs->patch.subject, world, map, LV2_PATCH__subject);
- _register(&regs->patch.body, world, map, LV2_PATCH__body);
- _register(&regs->patch.property, world, map, LV2_PATCH__property);
- _register(&regs->patch.value, world, map, LV2_PATCH__value);
- _register(&regs->patch.wildcard, world, map, LV2_PATCH__wildcard);
- _register(&regs->patch.patch, world, map, LV2_PATCH__Patch);
- _register(&regs->patch.add, world, map, LV2_PATCH__add);
- _register(&regs->patch.remove, world, map, LV2_PATCH__remove);
- _register(&regs->patch.put, world, map, LV2_PATCH__Put);
- _register(&regs->patch.insert, world, map, LV2_PATCH_PREFIX "Insert");
- _register(&regs->patch.delete, world, map, LV2_PATCH_PREFIX "Delete");
- _register(&regs->patch.destination, world, map, LV2_PATCH__destination);
- _register(&regs->patch.copy, world, map, LV2_PATCH__Copy);
- _register(&regs->patch.move, world, map, LV2_PATCH__Move);
- _register(&regs->patch.sequence_number, world, map, LV2_PATCH__sequenceNumber);
- _register(&regs->patch.error, world, map, LV2_PATCH__Error);
- _register(&regs->patch.ack, world, map, LV2_PATCH__Ack);
-
- _register(&regs->xpress.message, world, map, "http://open-music-kontrollers.ch/lv2/xpress#Message");
-
- _register(&regs->canvas.graph, world, map, CANVAS__graph);
-
- _register(&regs->group.group, world, map, LV2_PORT_GROUPS__group);
- _register(&regs->group.left, world, map, LV2_PORT_GROUPS__left);
- _register(&regs->group.right, world, map, LV2_PORT_GROUPS__right);
- _register(&regs->group.center, world, map, LV2_PORT_GROUPS__center);
- _register(&regs->group.side, world, map, LV2_PORT_GROUPS__side);
- _register(&regs->group.center_left, world, map, LV2_PORT_GROUPS__centerLeft);
- _register(&regs->group.center_right, world, map, LV2_PORT_GROUPS__centerRight);
- _register(&regs->group.side_left, world, map, LV2_PORT_GROUPS__sideLeft);
- _register(&regs->group.side_right, world, map, LV2_PORT_GROUPS__sideRight);
- _register(&regs->group.rear_left, world, map, LV2_PORT_GROUPS__rearLeft);
- _register(&regs->group.rear_right, world, map, LV2_PORT_GROUPS__rearRight);
- _register(&regs->group.rear_center, world, map, LV2_PORT_GROUPS__rearCenter);
- _register(&regs->group.low_frequency_effects, world, map, LV2_PORT_GROUPS__lowFrequencyEffects);
-
- _register(&regs->units.conversion, world, map, LV2_UNITS__conversion);
- _register(&regs->units.prefixConversion, world, map, LV2_UNITS__prefixConversion);
- _register(&regs->units.render, world, map, LV2_UNITS__render);
- _register(&regs->units.symbol, world, map, LV2_UNITS__symbol);
- _register(&regs->units.unit, world, map, LV2_UNITS__unit);
- _register(&regs->units.Unit, world, map, LV2_UNITS__Unit);
- _register(&regs->units.bar, world, map, LV2_UNITS__bar);
- _register(&regs->units.beat, world, map, LV2_UNITS__beat);
- _register(&regs->units.bpm, world, map, LV2_UNITS__bpm);
- _register(&regs->units.cent, world, map, LV2_UNITS__cent);
- _register(&regs->units.cm, world, map, LV2_UNITS__cm);
- _register(&regs->units.coef, world, map, LV2_UNITS__coef);
- _register(&regs->units.db, world, map, LV2_UNITS__db);
- _register(&regs->units.degree, world, map, LV2_UNITS__degree);
- _register(&regs->units.frame, world, map, LV2_UNITS__frame);
- _register(&regs->units.hz, world, map, LV2_UNITS__hz);
- _register(&regs->units.inch, world, map, LV2_UNITS__inch);
- _register(&regs->units.khz, world, map, LV2_UNITS__khz);
- _register(&regs->units.km, world, map, LV2_UNITS__km);
- _register(&regs->units.m, world, map, LV2_UNITS__m);
- _register(&regs->units.mhz, world, map, LV2_UNITS__mhz);
- _register(&regs->units.midiNote, world, map, LV2_UNITS__midiNote);
- _register(&regs->units.midiController, world, map, LV2_UNITS_PREFIX"midiController");
- _register(&regs->units.mile, world, map, LV2_UNITS__mile);
- _register(&regs->units.min, world, map, LV2_UNITS__min);
- _register(&regs->units.mm, world, map, LV2_UNITS__mm);
- _register(&regs->units.ms, world, map, LV2_UNITS__ms);
- _register(&regs->units.oct, world, map, LV2_UNITS__oct);
- _register(&regs->units.pc, world, map, LV2_UNITS__pc);
- _register(&regs->units.s, world, map, LV2_UNITS__s);
- _register(&regs->units.semitone12TET, world, map, LV2_UNITS__semitone12TET);
-
- _register(&regs->state.state, world, map, LV2_STATE__state);
- _register(&regs->state.load_default_state, world, map, LV2_STATE__loadDefaultState);
-#ifndef LV2_STATE__threadSafeRestore
-# define LV2_STATE__threadSafeRestore LV2_STATE_PREFIX "threadSafeRestore"
-#endif
- _register(&regs->state.thread_safe_restore, world, map, LV2_STATE__threadSafeRestore);
-
- _register(&regs->synthpod.payload, world, map, SYNTHPOD_PREFIX"payload");
- _register_string(&regs->synthpod.state, world, map, "state.ttl");
- _register(&regs->synthpod.graph, world, map, SYNTHPOD_PREFIX"graph");
- _register_string(&regs->synthpod.null, world, map, "");
- _register(&regs->synthpod.stereo, world, map, SYNTHPOD_PREFIX"stereo");
- _register(&regs->synthpod.monoatom, world, map, SYNTHPOD_PREFIX"monoatom");
- _register(&regs->synthpod.module_list, world, map, SYNTHPOD_PREFIX"moduleList");
- _register(&regs->synthpod.module_supported, world, map, SYNTHPOD_PREFIX"moduleSupported");
- _register(&regs->synthpod.module_add, world, map, SYNTHPOD_PREFIX"moduleAdd");
- _register(&regs->synthpod.module_del, world, map, SYNTHPOD_PREFIX"moduleDel");
- _register(&regs->synthpod.module_move, world, map, SYNTHPOD_PREFIX"moduleMove");
- _register(&regs->synthpod.module_preset_load, world, map, SYNTHPOD_PREFIX"modulePresetLoad");
- _register(&regs->synthpod.module_preset_save, world, map, SYNTHPOD_PREFIX"modulePresetSave");
- _register(&regs->synthpod.module_visible, world, map, SYNTHPOD_PREFIX"moduleVisible");
- _register(&regs->synthpod.module_disabled, world, map, SYNTHPOD_PREFIX"moduleDisabled");
- _register(&regs->synthpod.module_profiling, world, map, SYNTHPOD_PREFIX"moduleProfiling");
- _register(&regs->synthpod.module_position_x, world, map, SYNTHPOD_PREFIX"modulePositionX");
- _register(&regs->synthpod.module_position_y, world, map, SYNTHPOD_PREFIX"modulePositionY");
- _register(&regs->synthpod.module_alias, world, map, SYNTHPOD_PREFIX"moduleAlias");
- _register(&regs->synthpod.module_reinstantiate, world, map, SYNTHPOD_PREFIX"moduleReinstantiate");
- _register(&regs->synthpod.module_created, world, map, SYNTHPOD_PREFIX"moduleCreated");
- _register(&regs->synthpod.node_position_x, world, map, SYNTHPOD_PREFIX"nodePositionX");
- _register(&regs->synthpod.node_position_y, world, map, SYNTHPOD_PREFIX"nodePositionY");
- _register(&regs->synthpod.graph_position_x, world, map, SYNTHPOD_PREFIX"graphPositionX");
- _register(&regs->synthpod.graph_position_y, world, map, SYNTHPOD_PREFIX"graphPositionY");
- _register(&regs->synthpod.column_enabled, world, map, SYNTHPOD_PREFIX"columnEnabled");
- _register(&regs->synthpod.row_enabled, world, map, SYNTHPOD_PREFIX"rowEnabled");
- _register(&regs->synthpod.port_refresh, world, map, SYNTHPOD_PREFIX"portRefresh");
- _register(&regs->synthpod.bundle_load, world, map, SYNTHPOD_PREFIX"bundleLoad");
- _register(&regs->synthpod.bundle_save, world, map, SYNTHPOD_PREFIX"bundleSave");
- _register(&regs->synthpod.path_get, world, map, SYNTHPOD_PREFIX"pathGet");
- _register(&regs->synthpod.dsp_profiling, world, map, SYNTHPOD_PREFIX"DSPProfiling");
- _register(&regs->synthpod.cpus_available, world, map, SYNTHPOD_PREFIX"CPUsAvailable");
- _register(&regs->synthpod.cpus_used, world, map, SYNTHPOD_PREFIX"CPUsUsed");
- _register(&regs->synthpod.period_size, world, map, SYNTHPOD_PREFIX"periodSize");
- _register(&regs->synthpod.num_periods, world, map, SYNTHPOD_PREFIX"numPeriods");
- _register(&regs->synthpod.quit, world, map, SYNTHPOD_PREFIX"quit");
-
- _register(&regs->synthpod.system_ports, world, map, SYNTHPOD_PREFIX"systemPorts");
- _register(&regs->synthpod.control_port, world, map, SYNTHPOD_PREFIX"ControlPort");
- _register(&regs->synthpod.audio_port, world, map, SYNTHPOD_PREFIX"AudioPort");
- _register(&regs->synthpod.cv_port, world, map, SYNTHPOD_PREFIX"CVPort");
- _register(&regs->synthpod.midi_port, world, map, SYNTHPOD_PREFIX"MIDIPort");
- _register(&regs->synthpod.osc_port, world, map, SYNTHPOD_PREFIX"OSCPort");
- _register(&regs->synthpod.com_port, world, map, SYNTHPOD_PREFIX"ComPort");
-
- _register(&regs->synthpod.connection_list, world, map, SYNTHPOD_PREFIX"connectionList");
- _register(&regs->synthpod.node_list, world, map, SYNTHPOD_PREFIX"nodeList");
- _register(&regs->synthpod.subscription_list, world, map, SYNTHPOD_PREFIX"subscriptionList");
- _register(&regs->synthpod.notification_list, world, map, SYNTHPOD_PREFIX"notificationList");
- _register(&regs->synthpod.automation_list, world, map, SYNTHPOD_PREFIX"automationList");
-
- _register(&regs->synthpod.source_module, world, map, SYNTHPOD_PREFIX"sourceModule");
- _register(&regs->synthpod.source_symbol, world, map, SYNTHPOD_PREFIX"sourceSymbol");
- _register(&regs->synthpod.sink_module, world, map, SYNTHPOD_PREFIX"sinkModule");
- _register(&regs->synthpod.sink_symbol, world, map, SYNTHPOD_PREFIX"sinkSymbol");
-
- _register(&regs->synthpod.source_min, world, map, SYNTHPOD_PREFIX"sourceMinimum");
- _register(&regs->synthpod.source_max, world, map, SYNTHPOD_PREFIX"sourceMaximum");
- _register(&regs->synthpod.sink_min, world, map, SYNTHPOD_PREFIX"sinkMinimum");
- _register(&regs->synthpod.sink_max, world, map, SYNTHPOD_PREFIX"sinkMaximum");
-
- _register(&regs->synthpod.source_enabled, world, map, SYNTHPOD_PREFIX"sourceEnabled");
- _register(&regs->synthpod.sink_enabled, world, map, SYNTHPOD_PREFIX"sinkEnabled");
- _register(&regs->synthpod.learning, world, map, SYNTHPOD_PREFIX"learning");
-
- _register(&regs->synthpod.placeholder, world, map, SYNTHPOD_PREFIX"placeholder");
- _register(&regs->synthpod.visibility, world, map, SYNTHPOD_PREFIX"visibility");
-
- _register(&regs->midi.Controller, world, map, LV2_MIDI__Controller);
- _register(&regs->midi.channel, world, map, LV2_MIDI__channel);
- _register(&regs->midi.controller_number, world, map, LV2_MIDI__controllerNumber);
-
- _register(&regs->idisp.surface, world, map, LV2_INLINEDISPLAY_PREFIX"surface");
-}
+typedef int32_t u_id_t;
static inline void
-sp_regs_deinit(reg_t *regs)
+sp_regs_init(LilvNode **nodes, LilvWorld *world)
{
- _unregister(&regs->port.input);
- _unregister(&regs->port.output);
-
- _unregister(&regs->port.control);
- _unregister(&regs->port.audio);
- _unregister(&regs->port.cv);
- _unregister(&regs->port.atom);
-
- _unregister(&regs->port.sequence);
- _unregister(&regs->port.midi);
- _unregister(&regs->port.osc_event);
- _unregister(&regs->port.time_position);
-
- _unregister(&regs->port.integer);
- _unregister(&regs->port.enumeration);
- _unregister(&regs->port.toggled);
- _unregister(&regs->port.is_bitmask);
-
- _unregister(&regs->port.float_protocol);
- _unregister(&regs->port.peak_protocol);
- _unregister(&regs->port.atom_transfer);
- _unregister(&regs->port.event_transfer);
- _unregister(&regs->port.notification);
-
- _unregister(&regs->port.minimum_size);
-
- _unregister(&regs->port.logarithmic);
-
- _unregister(&regs->parameter.property);
-
- _unregister(&regs->osc.message);
- _unregister(&regs->osc.path);
-
- _unregister(&regs->work.schedule);
-
- _unregister(&regs->log.entry);
- _unregister(&regs->log.error);
- _unregister(&regs->log.note);
- _unregister(&regs->log.trace);
- _unregister(&regs->log.warning);
-
- _unregister(&regs->ui.window_title);
- _unregister(&regs->ui.show_interface);
- _unregister(&regs->ui.idle_interface);
- _unregister(&regs->ui.kx_widget);
- _unregister(&regs->ui.external);
- _unregister(&regs->ui.x11);
- _unregister(&regs->ui.gtk2);
- _unregister(&regs->ui.gtk3);
- _unregister(&regs->ui.qt4);
- _unregister(&regs->ui.qt5);
- _unregister(&regs->ui.plugin);
- _unregister(&regs->ui.protocol);
- _unregister(&regs->ui.period_start);
- _unregister(&regs->ui.period_size);
- _unregister(&regs->ui.peak);
- _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->ui.ui);
-
- _unregister(&regs->pset.preset);
- _unregister(&regs->pset.preset_bank);
- _unregister(&regs->pset.bank);
-
- _unregister(&regs->rdf.value);
- _unregister(&regs->rdf.type);
- _unregister(&regs->rdf.subject);
-
- _unregister(&regs->rdfs.label);
- _unregister(&regs->rdfs.range);
- _unregister(&regs->rdfs.comment);
- _unregister(&regs->rdfs.see_also);
-
- _unregister(&regs->doap.license);
- _unregister(&regs->doap.name);
-
- _unregister(&regs->core.optional_feature);
- _unregister(&regs->core.required_feature);
- _unregister(&regs->core.name);
- _unregister(&regs->core.minor_version);
- _unregister(&regs->core.micro_version);
- _unregister(&regs->core.extension_data);
- _unregister(&regs->core.control);
- _unregister(&regs->core.symbol);
- _unregister(&regs->core.index);
- _unregister(&regs->core.minimum);
- _unregister(&regs->core.maximum);
- _unregister(&regs->core.scale_point);
- _unregister(&regs->core.port);
- _unregister(&regs->core.Port);
- _unregister(&regs->core.plugin);
- _unregister(&regs->core.applies_to);
- _unregister(&regs->core.designation);
-
- _unregister(&regs->param.sample_rate);
- _unregister(&regs->param.gain);
-
- _unregister(&regs->bufsz.nominal_block_length);
- _unregister(&regs->bufsz.max_block_length);
- _unregister(&regs->bufsz.min_block_length);
- _unregister(&regs->bufsz.sequence_size);
-
- _unregister(&regs->patch.writable);
- _unregister(&regs->patch.readable);
- _unregister(&regs->patch.message);
- _unregister(&regs->patch.set);
- _unregister(&regs->patch.get);
- _unregister(&regs->patch.subject);
- _unregister(&regs->patch.body);
- _unregister(&regs->patch.property);
- _unregister(&regs->patch.value);
- _unregister(&regs->patch.wildcard);
- _unregister(&regs->patch.patch);
- _unregister(&regs->patch.add);
- _unregister(&regs->patch.remove);
- _unregister(&regs->patch.put);
- _unregister(&regs->patch.insert);
- _unregister(&regs->patch.delete);
- _unregister(&regs->patch.destination);
- _unregister(&regs->patch.copy);
- _unregister(&regs->patch.move);
- _unregister(&regs->patch.sequence_number);
- _unregister(&regs->patch.error);
- _unregister(&regs->patch.ack);
-
- _unregister(&regs->xpress.message);
-
- _unregister(&regs->canvas.graph);
-
- _unregister(&regs->group.group);
- _unregister(&regs->group.left);
- _unregister(&regs->group.right);
- _unregister(&regs->group.center);
- _unregister(&regs->group.side);
- _unregister(&regs->group.center_left);
- _unregister(&regs->group.center_right);
- _unregister(&regs->group.side_left);
- _unregister(&regs->group.side_right);
- _unregister(&regs->group.rear_left);
- _unregister(&regs->group.rear_right);
- _unregister(&regs->group.rear_center);
- _unregister(&regs->group.low_frequency_effects);
-
- _unregister(&regs->units.conversion);
- _unregister(&regs->units.prefixConversion);
- _unregister(&regs->units.render);
- _unregister(&regs->units.symbol);
- _unregister(&regs->units.unit);
- _unregister(&regs->units.Unit);
- _unregister(&regs->units.bar);
- _unregister(&regs->units.beat);
- _unregister(&regs->units.bpm);
- _unregister(&regs->units.cent);
- _unregister(&regs->units.cm);
- _unregister(&regs->units.coef);
- _unregister(&regs->units.db);
- _unregister(&regs->units.degree);
- _unregister(&regs->units.frame);
- _unregister(&regs->units.hz);
- _unregister(&regs->units.inch);
- _unregister(&regs->units.khz);
- _unregister(&regs->units.km);
- _unregister(&regs->units.m);
- _unregister(&regs->units.mhz);
- _unregister(&regs->units.midiNote);
- _unregister(&regs->units.midiController);
- _unregister(&regs->units.mile);
- _unregister(&regs->units.min);
- _unregister(&regs->units.mm);
- _unregister(&regs->units.ms);
- _unregister(&regs->units.oct);
- _unregister(&regs->units.pc);
- _unregister(&regs->units.s);
- _unregister(&regs->units.semitone12TET);
-
- _unregister(&regs->state.state);
- _unregister(&regs->state.load_default_state);
- _unregister(&regs->state.thread_safe_restore);
-
- _unregister(&regs->synthpod.payload);
- _unregister(&regs->synthpod.state);
- _unregister(&regs->synthpod.graph);
- _unregister(&regs->synthpod.null);
- _unregister(&regs->synthpod.stereo);
- _unregister(&regs->synthpod.monoatom);
- _unregister(&regs->synthpod.module_list);
- _unregister(&regs->synthpod.module_supported);
- _unregister(&regs->synthpod.module_add);
- _unregister(&regs->synthpod.module_del);
- _unregister(&regs->synthpod.module_move);
- _unregister(&regs->synthpod.module_preset_load);
- _unregister(&regs->synthpod.module_preset_save);
- _unregister(&regs->synthpod.module_visible);
- _unregister(&regs->synthpod.module_disabled);
- _unregister(&regs->synthpod.module_profiling);
- _unregister(&regs->synthpod.module_position_x);
- _unregister(&regs->synthpod.module_position_y);
- _unregister(&regs->synthpod.module_alias);
- _unregister(&regs->synthpod.module_reinstantiate);
- _unregister(&regs->synthpod.module_created);
- _unregister(&regs->synthpod.node_position_x);
- _unregister(&regs->synthpod.node_position_y);
- _unregister(&regs->synthpod.graph_position_x);
- _unregister(&regs->synthpod.graph_position_y);
- _unregister(&regs->synthpod.column_enabled);
- _unregister(&regs->synthpod.row_enabled);
- _unregister(&regs->synthpod.port_refresh);
- _unregister(&regs->synthpod.bundle_load);
- _unregister(&regs->synthpod.bundle_save);
- _unregister(&regs->synthpod.path_get);
- _unregister(&regs->synthpod.dsp_profiling);
- _unregister(&regs->synthpod.cpus_available);
- _unregister(&regs->synthpod.cpus_used);
- _unregister(&regs->synthpod.period_size);
- _unregister(&regs->synthpod.num_periods);
- _unregister(&regs->synthpod.quit);
-
- _unregister(&regs->synthpod.system_ports);
- _unregister(&regs->synthpod.control_port);
- _unregister(&regs->synthpod.audio_port);
- _unregister(&regs->synthpod.cv_port);
- _unregister(&regs->synthpod.midi_port);
- _unregister(&regs->synthpod.osc_port);
- _unregister(&regs->synthpod.com_port);
-
- _unregister(&regs->synthpod.connection_list);
- _unregister(&regs->synthpod.node_list);
- _unregister(&regs->synthpod.subscription_list);
- _unregister(&regs->synthpod.notification_list);
- _unregister(&regs->synthpod.automation_list);
-
- _unregister(&regs->synthpod.source_module);
- _unregister(&regs->synthpod.source_symbol);
- _unregister(&regs->synthpod.sink_module);
- _unregister(&regs->synthpod.sink_symbol);
-
- _unregister(&regs->synthpod.source_min);
- _unregister(&regs->synthpod.source_max);
- _unregister(&regs->synthpod.sink_min);
- _unregister(&regs->synthpod.sink_max);
-
- _unregister(&regs->synthpod.source_enabled);
- _unregister(&regs->synthpod.sink_enabled);
- _unregister(&regs->synthpod.learning);
-
- _unregister(&regs->synthpod.placeholder);
- _unregister(&regs->synthpod.visibility);
-
- _unregister(&regs->midi.Controller);
- _unregister(&regs->midi.channel);
- _unregister(&regs->midi.controller_number);
-
- _unregister(&regs->idisp.surface);
-}
-
-#if 0
-#define _ATOM_ALIGNED __attribute__((aligned(8)))
-
-// app <-> ui communication for module/port manipulations
-typedef struct _transmit_t transmit_t;
-typedef struct _transmit_module_list_t transmit_module_list_t;
-typedef struct _transmit_module_supported_t transmit_module_supported_t;
-typedef struct _transmit_module_add_t transmit_module_add_t;
-typedef struct _transmit_module_del_t transmit_module_del_t;
-typedef struct _transmit_module_move_t transmit_module_move_t;
-typedef struct _transmit_module_preset_load_t transmit_module_preset_load_t;
-typedef struct _transmit_module_preset_save_t transmit_module_preset_save_t;
-typedef struct _transmit_module_selected_t transmit_module_selected_t;
-typedef struct _transmit_module_embedded_t transmit_module_embedded_t;
-typedef struct _transmit_module_visible_t transmit_module_visible_t;
-typedef struct _transmit_module_disabled_t transmit_module_disabled_t;
-typedef struct _transmit_module_profiling_t transmit_module_profiling_t;
-typedef struct _transmit_port_connected_t transmit_port_connected_t;
-typedef struct _transmit_port_subscribed_t transmit_port_subscribed_t;
-typedef struct _transmit_port_monitored_t transmit_port_monitored_t;
-typedef struct _transmit_port_refresh_t transmit_port_refresh_t;
-typedef struct _transmit_port_selected_t transmit_port_selected_t;
-typedef struct _transmit_bundle_load_t transmit_bundle_load_t;
-typedef struct _transmit_bundle_save_t transmit_bundle_save_t;
-typedef struct _transmit_path_get_t transmit_path_get_t;
-typedef struct _transmit_dsp_profiling_t transmit_dsp_profiling_t;
-typedef struct _transmit_grid_cols_t transmit_grid_cols_t;
-typedef struct _transmit_grid_rows_t transmit_grid_rows_t;
-typedef struct _transmit_pane_left_t transmit_pane_left_t;
-typedef struct _transmit_quit_t transmit_quit_t;
-
-struct _transmit_t {
- LV2_Atom_Object obj _ATOM_ALIGNED;
- LV2_Atom_Property_Body prop _ATOM_ALIGNED;
-} _ATOM_ALIGNED;
-
-struct _transmit_module_list_t {
- transmit_t transmit _ATOM_ALIGNED;
-} _ATOM_ALIGNED;
-
-struct _transmit_module_supported_t {
- transmit_t transmit _ATOM_ALIGNED;
- LV2_Atom_Int state _ATOM_ALIGNED;
- LV2_Atom_String uri _ATOM_ALIGNED;
- char uri_str [0] _ATOM_ALIGNED;
-} _ATOM_ALIGNED;
-
-struct _transmit_module_add_t {
- transmit_t transmit _ATOM_ALIGNED;
- LV2_Atom_Int uid _ATOM_ALIGNED;
- LV2_Atom_String uri _ATOM_ALIGNED;
- char uri_str [0] _ATOM_ALIGNED;
-} _ATOM_ALIGNED;
-
-struct _transmit_module_del_t {
- transmit_t transmit _ATOM_ALIGNED;
- LV2_Atom_Int uid _ATOM_ALIGNED;
-} _ATOM_ALIGNED;
-
-struct _transmit_module_move_t {
- transmit_t transmit _ATOM_ALIGNED;
- LV2_Atom_Int uid _ATOM_ALIGNED;
- LV2_Atom_Int prev _ATOM_ALIGNED;
-} _ATOM_ALIGNED;
-
-struct _transmit_module_preset_load_t {
- transmit_t transmit _ATOM_ALIGNED;
- LV2_Atom_Int uid _ATOM_ALIGNED;
- LV2_Atom_String uri _ATOM_ALIGNED;
- char uri_str [0] _ATOM_ALIGNED;
-} _ATOM_ALIGNED;
-
-struct _transmit_module_preset_save_t {
- transmit_t transmit _ATOM_ALIGNED;
- LV2_Atom_Int uid _ATOM_ALIGNED;
- LV2_Atom_String label _ATOM_ALIGNED;
- char label_str [0] _ATOM_ALIGNED;
-} _ATOM_ALIGNED;
-
-struct _transmit_module_selected_t {
- transmit_t transmit _ATOM_ALIGNED;
- LV2_Atom_Int uid _ATOM_ALIGNED;
- LV2_Atom_Int state _ATOM_ALIGNED;
-} _ATOM_ALIGNED;
-
-struct _transmit_module_embedded_t {
- transmit_t transmit _ATOM_ALIGNED;
- LV2_Atom_Int uid _ATOM_ALIGNED;
- LV2_Atom_Int state _ATOM_ALIGNED;
-} _ATOM_ALIGNED;
-
-struct _transmit_module_visible_t {
- transmit_t transmit _ATOM_ALIGNED;
- LV2_Atom_Int uid _ATOM_ALIGNED;
- LV2_Atom_Int state _ATOM_ALIGNED;
- LV2_Atom_URID urid _ATOM_ALIGNED;
-} _ATOM_ALIGNED;
-
-struct _transmit_module_disabled_t {
- transmit_t transmit _ATOM_ALIGNED;
- LV2_Atom_Int uid _ATOM_ALIGNED;
- LV2_Atom_Int state _ATOM_ALIGNED;
-} _ATOM_ALIGNED;
-
-struct _transmit_module_profiling_t {
- transmit_t transmit _ATOM_ALIGNED;
- LV2_Atom_Int uid _ATOM_ALIGNED;
- LV2_Atom_Float min _ATOM_ALIGNED;
- LV2_Atom_Float avg _ATOM_ALIGNED;
- LV2_Atom_Float max _ATOM_ALIGNED;
-} _ATOM_ALIGNED;
-
-struct _transmit_port_connected_t {
- transmit_t transmit _ATOM_ALIGNED;
- LV2_Atom_Int src_uid _ATOM_ALIGNED;
- LV2_Atom_Int src_port _ATOM_ALIGNED;
- LV2_Atom_Int snk_uid _ATOM_ALIGNED;
- LV2_Atom_Int snk_port _ATOM_ALIGNED;
- LV2_Atom_Int state _ATOM_ALIGNED;
- LV2_Atom_Int indirect _ATOM_ALIGNED;
-} _ATOM_ALIGNED;
-
-struct _transmit_port_subscribed_t {
- transmit_t transmit _ATOM_ALIGNED;
- LV2_Atom_Int uid _ATOM_ALIGNED;
- LV2_Atom_Int port _ATOM_ALIGNED;
- LV2_Atom_URID prot _ATOM_ALIGNED;
- LV2_Atom_Int state _ATOM_ALIGNED;
-} _ATOM_ALIGNED;
-
-struct _transmit_port_monitored_t {
- transmit_t transmit _ATOM_ALIGNED;
- LV2_Atom_Int uid _ATOM_ALIGNED;
- LV2_Atom_Int port _ATOM_ALIGNED;
- LV2_Atom_Int state _ATOM_ALIGNED;
-} _ATOM_ALIGNED;
-
-struct _transmit_port_refresh_t {
- transmit_t transmit _ATOM_ALIGNED;
- LV2_Atom_Int uid _ATOM_ALIGNED;
- LV2_Atom_Int port _ATOM_ALIGNED;
-} _ATOM_ALIGNED;
-
-struct _transmit_port_selected_t {
- transmit_t transmit _ATOM_ALIGNED;
- LV2_Atom_Int uid _ATOM_ALIGNED;
- LV2_Atom_Int port _ATOM_ALIGNED;
- LV2_Atom_Int state _ATOM_ALIGNED;
-} _ATOM_ALIGNED;
-
-struct _transmit_bundle_load_t {
- transmit_t transmit _ATOM_ALIGNED;
- LV2_Atom_Int status _ATOM_ALIGNED;
- LV2_Atom_String path _ATOM_ALIGNED;
- char path_str [0] _ATOM_ALIGNED;
-} _ATOM_ALIGNED;
-
-struct _transmit_bundle_save_t {
- transmit_t transmit _ATOM_ALIGNED;
- LV2_Atom_Int status _ATOM_ALIGNED;
- LV2_Atom_String path _ATOM_ALIGNED;
- char path_str [0] _ATOM_ALIGNED;
-} _ATOM_ALIGNED;
-
-struct _transmit_path_get_t {
- transmit_t transmit _ATOM_ALIGNED;
- LV2_Atom_String path _ATOM_ALIGNED;
- char path_str [0] _ATOM_ALIGNED;
-} _ATOM_ALIGNED;
-
-struct _transmit_dsp_profiling_t {
- transmit_t transmit _ATOM_ALIGNED;
- LV2_Atom_Float min _ATOM_ALIGNED;
- LV2_Atom_Float avg _ATOM_ALIGNED;
- LV2_Atom_Float max _ATOM_ALIGNED;
-} _ATOM_ALIGNED;
-
-struct _transmit_grid_cols_t {
- transmit_t transmit _ATOM_ALIGNED;
- LV2_Atom_Int cols _ATOM_ALIGNED;
-} _ATOM_ALIGNED;
-
-struct _transmit_grid_rows_t {
- transmit_t transmit _ATOM_ALIGNED;
- LV2_Atom_Int rows _ATOM_ALIGNED;
-} _ATOM_ALIGNED;
-
-struct _transmit_pane_left_t {
- transmit_t transmit _ATOM_ALIGNED;
- LV2_Atom_Float left _ATOM_ALIGNED;
-} _ATOM_ALIGNED;
-
-struct _transmit_quit_t {
- transmit_t transmit _ATOM_ALIGNED;
-} _ATOM_ALIGNED;
-
-// app <-> ui communication for port notifications
-typedef struct _transfer_t transfer_t;
-typedef struct _transfer_float_t transfer_float_t;
-typedef struct _transfer_peak_t transfer_peak_t;
-typedef struct _transfer_atom_t transfer_atom_t;
-typedef struct _transfer_patch_set_obj_t transfer_patch_set_obj_t;
-typedef struct _transfer_patch_get_t transfer_patch_get_t;
-typedef struct _transfer_patch_get_all_t transfer_patch_get_all_t;
-
-struct _transfer_t {
- transmit_t transmit _ATOM_ALIGNED;
- LV2_Atom_Int uid _ATOM_ALIGNED;
- LV2_Atom_Int port _ATOM_ALIGNED;
-} _ATOM_ALIGNED;
-
-struct _transfer_float_t {
- transfer_t transfer _ATOM_ALIGNED;
- LV2_Atom_Float value _ATOM_ALIGNED;
-} _ATOM_ALIGNED;
-
-struct _transfer_peak_t {
- transfer_t transfer _ATOM_ALIGNED;
- LV2_Atom_Int period_start _ATOM_ALIGNED;
- LV2_Atom_Int period_size _ATOM_ALIGNED;
- LV2_Atom_Float peak _ATOM_ALIGNED;
-} _ATOM_ALIGNED;
-
-struct _transfer_atom_t {
- transfer_t transfer _ATOM_ALIGNED;
- LV2_Atom atom [0] _ATOM_ALIGNED;
-} _ATOM_ALIGNED;
-
-struct _transfer_patch_set_obj_t {
- LV2_Atom_Object obj _ATOM_ALIGNED;
- LV2_Atom_Property_Body subj _ATOM_ALIGNED;
- LV2_URID subj_val _ATOM_ALIGNED;
- LV2_Atom_Property_Body seq _ATOM_ALIGNED;
- int32_t seq_val _ATOM_ALIGNED;
- LV2_Atom_Property_Body prop _ATOM_ALIGNED;
- LV2_URID prop_val _ATOM_ALIGNED;
- LV2_Atom_Property_Body dest _ATOM_ALIGNED;
- LV2_URID dest_val _ATOM_ALIGNED;
- LV2_Atom_Property_Body val _ATOM_ALIGNED;
-} _ATOM_ALIGNED;
-
-struct _transfer_patch_get_t {
- transfer_t transfer _ATOM_ALIGNED;
- LV2_Atom_Object obj _ATOM_ALIGNED;
- LV2_Atom_Property_Body subj _ATOM_ALIGNED;
- LV2_URID subj_val _ATOM_ALIGNED;
- LV2_Atom_Property_Body seq _ATOM_ALIGNED;
- int32_t seq_val _ATOM_ALIGNED;
- LV2_Atom_Property_Body prop _ATOM_ALIGNED;
- LV2_URID prop_val _ATOM_ALIGNED;
- LV2_Atom_Property_Body dest _ATOM_ALIGNED;
- LV2_URID dest_val _ATOM_ALIGNED;
-} _ATOM_ALIGNED;
-
-struct _transfer_patch_get_all_t {
- transfer_t transfer _ATOM_ALIGNED;
- LV2_Atom_Object obj _ATOM_ALIGNED;
- LV2_Atom_Property_Body subj _ATOM_ALIGNED;
- LV2_URID subj_val _ATOM_ALIGNED;
- LV2_Atom_Property_Body seq _ATOM_ALIGNED;
- int32_t seq_val _ATOM_ALIGNED;
- LV2_Atom_Property_Body dest _ATOM_ALIGNED;
- LV2_URID dest_val _ATOM_ALIGNED;
-} _ATOM_ALIGNED;
-
-static inline void
-_sp_transmit_fill(reg_t *regs, LV2_Atom_Forge *forge, transmit_t *trans, uint32_t size,
- LV2_URID protocol)
-{
- trans = ASSUME_ALIGNED(trans);
-
- trans->obj.atom.size = size - sizeof(LV2_Atom);
- trans->obj.atom.type = forge->Object;
- trans->obj.body.id = 0;
- trans->obj.body.otype = protocol;
-
- trans->prop.key = regs->synthpod.payload.urid;
- trans->prop.context = 0;
- trans->prop.value.size = size - sizeof(transmit_t);
- trans->prop.value.type = forge->Tuple;
-}
-
-static inline void
-_sp_transmit_module_list_fill(reg_t *regs, LV2_Atom_Forge *forge,
- transmit_module_list_t *trans, uint32_t size)
-{
- trans = ASSUME_ALIGNED(trans);
-
- _sp_transmit_fill(regs, forge, &trans->transmit, size,
- regs->synthpod.module_list.urid);
-}
-
-static inline void
-_sp_transmit_module_supported_fill(reg_t *regs, LV2_Atom_Forge *forge,
- transmit_module_supported_t *trans, uint32_t size,
- int32_t state, const char *module_uri)
-{
- trans = ASSUME_ALIGNED(trans);
-
- _sp_transmit_fill(regs, forge, &trans->transmit, size,
- regs->synthpod.module_supported.urid);
-
- trans->state.atom.size = sizeof(int32_t);
- trans->state.atom.type = forge->Int;
- trans->state.body = state;
-
- if(module_uri)
+ for(unsigned i = 1; i < STAT_URID_MAX; i++)
{
- trans->uri.atom.size = strlen(module_uri) + 1;
- strcpy(trans->uri_str, module_uri);
+ switch(i)
+ {
+ case SYNTHPOD__state:
+ // fall-through
+ case SYNTHPOD__null:
+ {
+ nodes[i] = lilv_new_string(world, stat_uris[i]);
+ } break;
+
+ default:
+ {
+ nodes[i] = lilv_new_uri(world, stat_uris[i]);
+ } break;
+ }
}
- else
- trans->uri.atom.size = 0;
- trans->uri.atom.type = forge->String;
}
static inline void
-_sp_transmit_module_add_fill(reg_t *regs, LV2_Atom_Forge *forge,
- transmit_module_add_t *trans, uint32_t size,
- u_id_t module_uid, const char *module_uri)
+sp_regs_deinit(LilvNode **nodes)
{
- trans = ASSUME_ALIGNED(trans);
-
- _sp_transmit_fill(regs, forge, &trans->transmit, size,
- regs->synthpod.module_add.urid);
-
- trans->uid.atom.size = sizeof(int32_t);
- trans->uid.atom.type = forge->Int;
- trans->uid.body = module_uid;
-
- if(module_uri)
+ for(unsigned i = 1; i < STAT_URID_MAX; i++)
{
- trans->uri.atom.size = strlen(module_uri) + 1;
- strcpy(trans->uri_str, module_uri);
+ lilv_node_free(nodes[i]);
}
- else
- trans->uri.atom.size = 0;
- trans->uri.atom.type = forge->String;
-}
-
-static inline void
-_sp_transmit_module_del_fill(reg_t *regs, LV2_Atom_Forge *forge,
- transmit_module_del_t *trans, uint32_t size, u_id_t module_uid)
-{
- trans = ASSUME_ALIGNED(trans);
-
- _sp_transmit_fill(regs, forge, &trans->transmit, size,
- regs->synthpod.module_del.urid);
-
- trans->uid.atom.size = sizeof(int32_t);
- trans->uid.atom.type = forge->Int;
- trans->uid.body = module_uid;
-}
-
-static inline void
-_sp_transmit_module_move_fill(reg_t *regs, LV2_Atom_Forge *forge,
- transmit_module_move_t *trans, uint32_t size, u_id_t module_uid, u_id_t prev_uid)
-{
- trans = ASSUME_ALIGNED(trans);
-
- _sp_transmit_fill(regs, forge, &trans->transmit, size,
- regs->synthpod.module_move.urid);
-
- trans->uid.atom.size = sizeof(int32_t);
- trans->uid.atom.type = forge->Int;
- trans->uid.body = module_uid;
-
- trans->prev.atom.size = sizeof(int32_t);
- trans->prev.atom.type = forge->Int;
- trans->prev.body = prev_uid;
-}
-
-static inline void
-_sp_transmit_module_preset_load_fill(reg_t *regs, LV2_Atom_Forge *forge,
- transmit_module_preset_load_t *trans, uint32_t size, u_id_t module_uid, const char *uri)
-{
- trans = ASSUME_ALIGNED(trans);
-
- _sp_transmit_fill(regs, forge, &trans->transmit, size,
- regs->synthpod.module_preset_load.urid);
-
- trans->uid.atom.size = sizeof(int32_t);
- trans->uid.atom.type = forge->Int;
- trans->uid.body = module_uid;
-
- trans->uri.atom.size = uri
- ? strlen(uri) + 1
- : 0;
- trans->uri.atom.type = forge->String;
-
- if(uri)
- strcpy(trans->uri_str, uri);
}
-static inline void
-_sp_transmit_module_preset_save_fill(reg_t *regs, LV2_Atom_Forge *forge,
- transmit_module_preset_save_t *trans, uint32_t size, u_id_t module_uid, const char *label)
-{
- trans = ASSUME_ALIGNED(trans);
-
- _sp_transmit_fill(regs, forge, &trans->transmit, size,
- regs->synthpod.module_preset_save.urid);
-
- trans->uid.atom.size = sizeof(int32_t);
- trans->uid.atom.type = forge->Int;
- trans->uid.body = module_uid;
-
- trans->label.atom.size = label
- ? strlen(label) + 1
- : 0;
- trans->label.atom.type = forge->String;
-
- if(label)
- strcpy(trans->label_str, label);
-}
-
-static inline void
-_sp_transmit_module_selected_fill(reg_t *regs, LV2_Atom_Forge *forge,
- transmit_module_selected_t *trans, uint32_t size, u_id_t module_uid, int state)
-{
- trans = ASSUME_ALIGNED(trans);
-
- _sp_transmit_fill(regs, forge, &trans->transmit, size,
- regs->synthpod.module_selected.urid);
-
- trans->uid.atom.size = sizeof(int32_t);
- trans->uid.atom.type = forge->Int;
- trans->uid.body = module_uid;
-
- trans->state.atom.size = sizeof(int32_t);
- trans->state.atom.type = forge->Int;
- trans->state.body = state;
-}
-
-static inline void
-_sp_transmit_module_embedded_fill(reg_t *regs, LV2_Atom_Forge *forge,
- transmit_module_embedded_t *trans, uint32_t size, u_id_t module_uid, int state)
-{
- trans = ASSUME_ALIGNED(trans);
-
- _sp_transmit_fill(regs, forge, &trans->transmit, size,
- regs->synthpod.module_embedded.urid);
-
- trans->uid.atom.size = sizeof(int32_t);
- trans->uid.atom.type = forge->Int;
- trans->uid.body = module_uid;
-
- trans->state.atom.size = sizeof(int32_t);
- trans->state.atom.type = forge->Int;
- trans->state.body = state;
-}
-
-static inline void
-_sp_transmit_module_visible_fill(reg_t *regs, LV2_Atom_Forge *forge,
- transmit_module_visible_t *trans, uint32_t size, u_id_t module_uid,
- int state, LV2_URID urid)
-{
- trans = ASSUME_ALIGNED(trans);
-
- _sp_transmit_fill(regs, forge, &trans->transmit, size,
- regs->synthpod.module_visible.urid);
-
- trans->uid.atom.size = sizeof(int32_t);
- trans->uid.atom.type = forge->Int;
- trans->uid.body = module_uid;
-
- trans->state.atom.size = sizeof(int32_t);
- trans->state.atom.type = forge->Int;
- trans->state.body = state;
-
- trans->urid.atom.size = sizeof(uint32_t);
- trans->urid.atom.type = forge->URID;
- trans->urid.body = urid;
-}
-
-static inline void
-_sp_transmit_module_disabled_fill(reg_t *regs, LV2_Atom_Forge *forge,
- transmit_module_disabled_t *trans, uint32_t size, u_id_t module_uid, int state)
-{
- trans = ASSUME_ALIGNED(trans);
-
- _sp_transmit_fill(regs, forge, &trans->transmit, size,
- regs->synthpod.module_disabled.urid);
-
- trans->uid.atom.size = sizeof(int32_t);
- trans->uid.atom.type = forge->Int;
- trans->uid.body = module_uid;
-
- trans->state.atom.size = sizeof(int32_t);
- trans->state.atom.type = forge->Int;
- trans->state.body = state;
-}
-
-static inline void
-_sp_transmit_module_profiling_fill(reg_t *regs, LV2_Atom_Forge *forge,
- transmit_module_profiling_t *trans, uint32_t size, u_id_t module_uid,
- float min, float avg, float max)
-{
- trans = ASSUME_ALIGNED(trans);
-
- _sp_transmit_fill(regs, forge, &trans->transmit, size,
- regs->synthpod.module_profiling.urid);
-
- trans->uid.atom.size = sizeof(int32_t);
- trans->uid.atom.type = forge->Int;
- trans->uid.body = module_uid;
-
- trans->min.atom.size = sizeof(float);
- trans->min.atom.type = forge->Float;
- trans->min.body = min;
-
- trans->avg.atom.size = sizeof(float);
- trans->avg.atom.type = forge->Float;
- trans->avg.body = avg;
-
- trans->max.atom.size = sizeof(float);
- trans->max.atom.type = forge->Float;
- trans->max.body = max;
-}
-
-static inline void
-_sp_transmit_port_connected_fill(reg_t *regs, LV2_Atom_Forge *forge,
- transmit_port_connected_t *trans, uint32_t size, u_id_t src_uid,
- uint32_t src_port, u_id_t snk_uid, uint32_t snk_port, int32_t state, int32_t indirect)
-{
- trans = ASSUME_ALIGNED(trans);
-
- _sp_transmit_fill(regs, forge, &trans->transmit, size,
- regs->synthpod.port_connected.urid);
-
- trans->src_uid.atom.size = sizeof(int32_t);
- trans->src_uid.atom.type = forge->Int;
- trans->src_uid.body = src_uid;
-
- trans->src_port.atom.size = sizeof(int32_t);
- trans->src_port.atom.type = forge->Int;
- trans->src_port.body = src_port;
-
- trans->snk_uid.atom.size = sizeof(int32_t);
- trans->snk_uid.atom.type = forge->Int;
- trans->snk_uid.body = snk_uid;
-
- trans->snk_port.atom.size = sizeof(int32_t);
- trans->snk_port.atom.type = forge->Int;
- trans->snk_port.body = snk_port;
-
- trans->state.atom.size = sizeof(int32_t);
- trans->state.atom.type = forge->Int;
- trans->state.body = state; // -1 (query), 0 (disconnected), 1 (connected)
-
- trans->indirect.atom.size = sizeof(int32_t);
- trans->indirect.atom.type = forge->Int;
- trans->indirect.body = indirect; // -1 (feedback), 0 (direct), 1 (indirect)
-}
-
-static inline void
-_sp_transmit_port_subscribed_fill(reg_t *regs, LV2_Atom_Forge *forge,
- transmit_port_subscribed_t *trans, uint32_t size,
- u_id_t module_uid, uint32_t port_index, LV2_URID prot, int32_t state)
-{
- trans = ASSUME_ALIGNED(trans);
-
- _sp_transmit_fill(regs, forge, &trans->transmit, size,
- regs->synthpod.port_subscribed.urid);
-
- trans->uid.atom.size = sizeof(int32_t);
- trans->uid.atom.type = forge->Int;
- trans->uid.body = module_uid;
-
- trans->port.atom.size = sizeof(int32_t);
- trans->port.atom.type = forge->Int;
- trans->port.body = port_index;
-
- trans->prot.atom.size = sizeof(LV2_URID);
- trans->prot.atom.type = forge->URID;
- trans->prot.body = prot;
-
- trans->state.atom.size = sizeof(int32_t);
- trans->state.atom.type = forge->Int;
- trans->state.body = state; // -1 (query), 0 (disconnected), 1 (connected)
-}
-
-static inline void
-_sp_transmit_port_monitored_fill(reg_t *regs, LV2_Atom_Forge *forge,
- transmit_port_monitored_t *trans, uint32_t size,
- u_id_t module_uid, uint32_t port_index, int32_t state)
-{
- trans = ASSUME_ALIGNED(trans);
-
- _sp_transmit_fill(regs, forge, &trans->transmit, size,
- regs->synthpod.port_monitored.urid);
-
- trans->uid.atom.size = sizeof(int32_t);
- trans->uid.atom.type = forge->Int;
- trans->uid.body = module_uid;
-
- trans->port.atom.size = sizeof(int32_t);
- trans->port.atom.type = forge->Int;
- trans->port.body = port_index;
-
- trans->state.atom.size = sizeof(int32_t);
- trans->state.atom.type = forge->Int;
- trans->state.body = state; // -1 (query), 0 (not monitored), 1 (monitored)
-}
-
-static inline void
-_sp_transmit_port_refresh_fill(reg_t *regs, LV2_Atom_Forge *forge,
- transmit_port_refresh_t *trans, uint32_t size,
- u_id_t module_uid, uint32_t port_index)
-{
- trans = ASSUME_ALIGNED(trans);
-
- _sp_transmit_fill(regs, forge, &trans->transmit, size,
- regs->synthpod.port_refresh.urid);
-
- trans->uid.atom.size = sizeof(int32_t);
- trans->uid.atom.type = forge->Int;
- trans->uid.body = module_uid;
-
- trans->port.atom.size = sizeof(int32_t);
- trans->port.atom.type = forge->Int;
- trans->port.body = port_index;
-}
-
-static inline void
-_sp_transmit_port_selected_fill(reg_t *regs, LV2_Atom_Forge *forge,
- transmit_port_selected_t *trans, uint32_t size,
- u_id_t module_uid, uint32_t port_index, int32_t state)
-{
- trans = ASSUME_ALIGNED(trans);
-
- _sp_transmit_fill(regs, forge, &trans->transmit, size,
- regs->synthpod.port_selected.urid);
-
- trans->uid.atom.size = sizeof(int32_t);
- trans->uid.atom.type = forge->Int;
- trans->uid.body = module_uid;
-
- trans->port.atom.size = sizeof(int32_t);
- trans->port.atom.type = forge->Int;
- trans->port.body = port_index;
-
- trans->state.atom.size = sizeof(int32_t);
- trans->state.atom.type = forge->Int;
- trans->state.body = state;
-}
-
-static inline void
-_sp_transmit_bundle_load_fill(reg_t *regs, LV2_Atom_Forge *forge,
- transmit_bundle_load_t *trans, uint32_t size,
- int32_t status, const char *bundle_path)
-{
- trans = ASSUME_ALIGNED(trans);
-
- _sp_transmit_fill(regs, forge, &trans->transmit, size,
- regs->synthpod.bundle_load.urid);
-
- trans->status.atom.size = sizeof(int32_t);
- trans->status.atom.type = forge->Int;
- trans->status.body = status;
-
- trans->path.atom.size = bundle_path
- ? strlen(bundle_path) + 1
- : 0;
- trans->path.atom.type = forge->String;
-
- if(bundle_path)
- strcpy(trans->path_str, bundle_path);
-}
-
-static inline void
-_sp_transmit_bundle_save_fill(reg_t *regs, LV2_Atom_Forge *forge,
- transmit_bundle_save_t *trans, uint32_t size,
- int32_t status, const char *bundle_path)
-{
- trans = ASSUME_ALIGNED(trans);
-
- _sp_transmit_fill(regs, forge, &trans->transmit, size,
- regs->synthpod.bundle_save.urid);
-
- trans->status.atom.size = sizeof(int32_t);
- trans->status.atom.type = forge->Int;
- trans->status.body = status;
-
- trans->path.atom.size = bundle_path
- ? strlen(bundle_path) + 1
- : 0;
- trans->path.atom.type = forge->String;
-
- if(bundle_path)
- strcpy(trans->path_str, bundle_path);
-}
-
-static inline void
-_sp_transmit_path_get_fill(reg_t *regs, LV2_Atom_Forge *forge,
- transmit_path_get_t *trans, uint32_t size,
- const char *bundle_path)
-{
- trans = ASSUME_ALIGNED(trans);
-
- _sp_transmit_fill(regs, forge, &trans->transmit, size,
- regs->synthpod.path_get.urid);
-
- trans->path.atom.size = bundle_path
- ? strlen(bundle_path) + 1
- : 0;
- trans->path.atom.type = forge->String;
-
- if(bundle_path)
- strcpy(trans->path_str, bundle_path);
-}
-
-static inline void
-_sp_transmit_dsp_profiling_fill(reg_t *regs, LV2_Atom_Forge *forge,
- transmit_dsp_profiling_t *trans, uint32_t size,
- float min, float avg, float max)
-{
- trans = ASSUME_ALIGNED(trans);
-
- _sp_transmit_fill(regs, forge, &trans->transmit, size,
- regs->synthpod.dsp_profiling.urid);
-
- trans->min.atom.size = sizeof(float);
- trans->min.atom.type = forge->Float;
- trans->min.body = min;
-
- trans->avg.atom.size = sizeof(float);
- trans->avg.atom.type = forge->Float;
- trans->avg.body = avg;
-
- trans->max.atom.size = sizeof(float);
- trans->max.atom.type = forge->Float;
- trans->max.body = max;
-}
-
-static inline void
-_sp_transmit_grid_cols_fill(reg_t *regs, LV2_Atom_Forge *forge,
- transmit_grid_cols_t *trans, uint32_t size, int32_t cols)
-{
- trans = ASSUME_ALIGNED(trans);
-
- _sp_transmit_fill(regs, forge, &trans->transmit, size,
- regs->synthpod.grid_cols.urid);
-
- trans->cols.atom.size = sizeof(int32_t);
- trans->cols.atom.type = forge->Int;
- trans->cols.body = cols;
-}
-
-static inline void
-_sp_transmit_grid_rows_fill(reg_t *regs, LV2_Atom_Forge *forge,
- transmit_grid_rows_t *trans, uint32_t size, int32_t rows)
-{
- trans = ASSUME_ALIGNED(trans);
-
- _sp_transmit_fill(regs, forge, &trans->transmit, size,
- regs->synthpod.grid_rows.urid);
-
- trans->rows.atom.size = sizeof(int32_t);
- trans->rows.atom.type = forge->Int;
- trans->rows.body = rows;
-}
-
-static inline void
-_sp_transmit_pane_left_fill(reg_t *regs, LV2_Atom_Forge *forge,
- transmit_pane_left_t *trans, uint32_t size, float left)
-{
- trans = ASSUME_ALIGNED(trans);
-
- _sp_transmit_fill(regs, forge, &trans->transmit, size,
- regs->synthpod.pane_left.urid);
-
- trans->left.atom.size = sizeof(float);
- trans->left.atom.type = forge->Float;
- trans->left.body = left;
-}
-
-static inline void
-_sp_transmit_quit_fill(reg_t *regs, LV2_Atom_Forge *forge,
- transmit_quit_t *trans, uint32_t size)
-{
- trans = ASSUME_ALIGNED(trans);
-
- _sp_transmit_fill(regs, forge, &trans->transmit, size,
- regs->synthpod.quit.urid);
-}
-
-static inline void
-_sp_transfer_fill(reg_t *regs, LV2_Atom_Forge *forge, transfer_t *trans, uint32_t size,
- LV2_URID protocol, u_id_t module_uid, uint32_t port_index)
-{
- trans = ASSUME_ALIGNED(trans);
-
- _sp_transmit_fill(regs, forge, &trans->transmit, size,
- protocol);
-
- trans->uid.atom.size = sizeof(int32_t);
- trans->uid.atom.type = forge->Int;
- trans->uid.body = module_uid;
-
- trans->port.atom.size = sizeof(int32_t);
- trans->port.atom.type = forge->Int;
- trans->port.body = port_index;
-}
-
-static inline void
-_sp_transfer_float_fill(reg_t *regs, LV2_Atom_Forge *forge, transfer_float_t *trans,
- u_id_t module_uid, uint32_t port_index, const float *value)
-{
- trans = ASSUME_ALIGNED(trans);
-
- _sp_transfer_fill(regs, forge, &trans->transfer, sizeof(transfer_float_t),
- regs->port.float_protocol.urid, module_uid, port_index);
-
- trans->value.atom.size = sizeof(float);
- trans->value.atom.type = forge->Float;
- trans->value.body = *value;
-}
-
-static inline void
-_sp_transfer_peak_fill(reg_t *regs, LV2_Atom_Forge *forge, transfer_peak_t *trans,
- u_id_t module_uid, uint32_t port_index, const LV2UI_Peak_Data *data)
-{
- trans = ASSUME_ALIGNED(trans);
-
- _sp_transfer_fill(regs, forge, &trans->transfer, sizeof(transfer_peak_t),
- regs->port.peak_protocol.urid, module_uid, port_index);
-
- trans->period_start.atom.size = sizeof(uint32_t);
- trans->period_start.atom.type = forge->Int;
- trans->period_start.body = data->period_start;
-
- trans->period_size.atom.size = sizeof(uint32_t);
- trans->period_size.atom.type = forge->Int;
- trans->period_size.body = data->period_size;
-
- trans->peak.atom.size = sizeof(float);
- trans->peak.atom.type = forge->Float;
- trans->peak.body = data->peak;
-}
-
-static inline LV2_Atom *
-_sp_transfer_atom_fill(reg_t *regs, LV2_Atom_Forge *forge, transfer_atom_t *trans,
- u_id_t module_uid, uint32_t port_index, uint32_t atom_size, const LV2_Atom *atom)
-{
- trans = ASSUME_ALIGNED(trans);
- //TODO atom aligned, too?
-
- _sp_transfer_fill(regs, forge, &trans->transfer, sizeof(transfer_atom_t)
- + lv2_atom_pad_size(atom_size),
- regs->port.atom_transfer.urid, module_uid, port_index);
-
- if(atom)
- memcpy(trans->atom, atom, atom_size);
-
- return trans->atom;
-}
-
-static inline LV2_Atom *
-_sp_transfer_event_fill(reg_t *regs, LV2_Atom_Forge *forge, transfer_atom_t *trans,
- u_id_t module_uid, uint32_t port_index, uint32_t atom_size, const LV2_Atom *atom)
-{
- trans = ASSUME_ALIGNED(trans);
- //TODO atom aligned, too?
-
- _sp_transfer_fill(regs, forge, &trans->transfer, sizeof(transfer_atom_t)
- + lv2_atom_pad_size(atom_size),
- regs->port.event_transfer.urid, module_uid, port_index);
-
- if(atom)
- memcpy(trans->atom, atom, atom_size);
-
- return trans->atom;
-}
-
-static inline LV2_Atom *
-_sp_transfer_patch_set_obj_fill(reg_t *regs, LV2_Atom_Forge *forge,
- transfer_patch_set_obj_t *trans,
- uint32_t body_size, LV2_URID subject,
- LV2_URID property, LV2_URID type,
- int32_t sequence_number)
-{
- trans = ASSUME_ALIGNED(trans);
-
- uint32_t obj_size = sizeof(transfer_patch_set_obj_t) + body_size - sizeof(LV2_Atom);
-
- trans->obj.atom.size = obj_size;
- trans->obj.atom.type = forge->Object;
- trans->obj.body.id = 0;
- trans->obj.body.otype = regs->patch.set.urid;
-
- trans->subj.key = regs->patch.subject.urid;
- trans->subj.context = 0;
- trans->subj.value.size = sizeof(LV2_URID);
- trans->subj.value.type = forge->URID;
-
- trans->subj_val = subject;
-
- trans->seq.key = regs->patch.sequence_number.urid;
- trans->seq.context = 0;
- trans->seq.value.size = sizeof(int32_t);
- trans->seq.value.type = forge->Int;
-
- trans->seq_val = sequence_number;
-
- trans->prop.key = regs->patch.property.urid;
- trans->prop.context = 0;
- trans->prop.value.size = sizeof(LV2_URID);
- trans->prop.value.type = forge->URID;
-
- trans->prop_val = property;
-
- trans->dest.key = regs->patch.destination.urid;
- trans->dest.context = 0;
- trans->dest.value.size = sizeof(LV2_URID);
- trans->dest.value.type = forge->URID;
-
- trans->dest_val = regs->core.plugin.urid;
-
- trans->val.key = regs->patch.value.urid;
- trans->val.context = 0;
- trans->val.value.size = body_size;
- trans->val.value.type = type;
-
- //return LV2_ATOM_BODY(&trans->val.value);
- return &trans->val.value;
-}
-
-static inline void
-_sp_transfer_patch_get_fill(reg_t *regs, LV2_Atom_Forge *forge,
- transfer_patch_get_t *trans, u_id_t module_uid, uint32_t port_index,
- LV2_URID subject, LV2_URID property, int32_t sequence_number)
-{
- trans = ASSUME_ALIGNED(trans);
-
- uint32_t trans_size = sizeof(transfer_patch_get_t);
- uint32_t obj_size = trans_size
- - offsetof(transfer_patch_get_t, obj.body);
-
- _sp_transfer_fill(regs, forge, &trans->transfer, trans_size,
- regs->port.event_transfer.urid, module_uid, port_index);
-
- trans->obj.atom.size = obj_size;
- trans->obj.atom.type = forge->Object;
- trans->obj.body.id = 0;
- trans->obj.body.otype = regs->patch.get.urid;
-
- trans->subj.key = regs->patch.subject.urid;
- trans->subj.context = 0;
- trans->subj.value.size = sizeof(LV2_URID);
- trans->subj.value.type = forge->URID;
-
- trans->subj_val = subject;
-
- trans->seq.key = regs->patch.sequence_number.urid;
- trans->seq.context = 0;
- trans->seq.value.size = sizeof(int32_t);
- trans->seq.value.type = forge->Int;
-
- trans->seq_val = sequence_number;
-
- trans->prop.key = regs->patch.property.urid;
- trans->prop.context = 0;
- trans->prop.value.size = sizeof(LV2_URID);
- trans->prop.value.type = forge->URID;
-
- trans->prop_val = property;
-
- trans->dest.key = regs->patch.destination.urid;
- trans->dest.context = 0;
- trans->dest.value.size = sizeof(LV2_URID);
- trans->dest.value.type = forge->URID;
-
- trans->dest_val = regs->core.plugin.urid;
-}
-
-static inline void
-_sp_transfer_patch_get_all_fill(reg_t *regs, LV2_Atom_Forge *forge,
- transfer_patch_get_all_t *trans, u_id_t module_uid, uint32_t port_index,
- LV2_URID subject, int32_t sequence_number)
-{
- trans = ASSUME_ALIGNED(trans);
-
- uint32_t trans_size = sizeof(transfer_patch_get_all_t);
- uint32_t obj_size = trans_size
- - offsetof(transfer_patch_get_all_t, obj.body);
-
- _sp_transfer_fill(regs, forge, &trans->transfer, trans_size,
- regs->port.event_transfer.urid, module_uid, port_index);
-
- trans->obj.atom.size = obj_size;
- trans->obj.atom.type = forge->Object;
- trans->obj.body.id = 0;
- trans->obj.body.otype = regs->patch.get.urid;
-
- trans->subj.key = regs->patch.subject.urid;
- trans->subj.context = 0;
- trans->subj.value.size = sizeof(LV2_URID);
- trans->subj.value.type = forge->URID;
-
- trans->subj_val = subject;
-
- trans->seq.key = regs->patch.sequence_number.urid;
- trans->seq.context = 0;
- trans->seq.value.size = sizeof(int32_t);
- trans->seq.value.type = forge->Int;
-
- trans->seq_val = sequence_number;
-
- trans->dest.key = regs->patch.destination.urid;
- trans->dest.context = 0;
- trans->dest.value.size = sizeof(LV2_URID);
- trans->dest.value.type = forge->URID;
-
- trans->dest_val = regs->core.plugin.urid;
-}
-#endif
-
// non-rt
static LilvNodes *
-_preset_reload(LilvWorld *world, reg_t *regs, const LilvPlugin *plugin,
+_preset_reload(LilvWorld *world, LilvNode *nodes[], const LilvPlugin *plugin,
LilvNodes *presets, const char *bndl)
{
if(presets)
@@ -2024,7 +166,7 @@ _preset_reload(LilvWorld *world, reg_t *regs, const LilvPlugin *plugin,
}
// discover presets for this module
- presets = lilv_plugin_get_related(plugin, regs->pset.preset.node);
+ presets = lilv_plugin_get_related(plugin, nodes[PRESETS__Preset]);
// load resources for this module's presets
LILV_FOREACH(nodes, itr, presets)
diff --git a/include/synthpod_stat.h b/include/synthpod_stat.h
new file mode 100644
index 00000000..5d66d252
--- /dev/null
+++ b/include/synthpod_stat.h
@@ -0,0 +1,525 @@
+#ifndef _SYNTHPOD_STAT_H
+#define _SYNTHPOD_STAT_H
+
+typedef enum _stat_urid_t {
+ STAT_URID_INVALID = 0,
+
+ RDFS__label,
+ RDFS__comment,
+ RDFS__range,
+ RDFS__subClassOf,
+ RDFS__seeAlso,
+
+ RDF__type,
+ RDF__value,
+
+ DOAP__description,
+ DOAP__license,
+ DOAP__name,
+ DOAP__shortdesc,
+
+ XSD__int,
+ XSD__nonNegativeInteger,
+ XSD__long,
+ XSD__float,
+ XSD__double,
+
+ ATOM__Atom,
+ ATOM__AtomPort,
+ ATOM__Blank,
+ ATOM__Bool,
+ ATOM__Chunk,
+ ATOM__Double,
+ ATOM__Event,
+ ATOM__Float,
+ ATOM__Int,
+ ATOM__Literal,
+ ATOM__Long,
+ ATOM__Number,
+ ATOM__Object,
+ ATOM__Path,
+ ATOM__Property,
+ ATOM__Resource,
+ ATOM__Sequence,
+ ATOM__Sound,
+ ATOM__String,
+ ATOM__Tuple,
+ ATOM__URI,
+ ATOM__URID,
+ ATOM__Vector,
+ ATOM__atomTransfer,
+ ATOM__beatTime,
+ ATOM__bufferType,
+ ATOM__childType,
+ ATOM__eventTransfer,
+ ATOM__frameTime,
+ ATOM__supports,
+ ATOM__timeUnit,
+
+ BUF_SIZE__boundedBlockLength,
+ BUF_SIZE__coarseBlockLength,
+ BUF_SIZE__fixedBlockLength,
+ BUF_SIZE__maxBlockLength,
+ BUF_SIZE__minBlockLength,
+ BUF_SIZE__nominalBlockLength,
+ BUF_SIZE__powerOf2BlockLength,
+ BUF_SIZE__sequenceSize,
+
+ CORE__AllpassPlugin,
+ CORE__AmplifierPlugin,
+ CORE__AnalyserPlugin,
+ CORE__AudioPort,
+ CORE__BandpassPlugin,
+ CORE__CVPort,
+ CORE__ChorusPlugin,
+ CORE__CombPlugin,
+ CORE__CompressorPlugin,
+ CORE__ConstantPlugin,
+ CORE__ControlPort,
+ CORE__ConverterPlugin,
+ CORE__DelayPlugin,
+ CORE__DistortionPlugin,
+ CORE__DynamicsPlugin,
+ CORE__EQPlugin,
+ CORE__EnvelopePlugin,
+ CORE__ExpanderPlugin,
+ CORE__ExtensionData,
+ CORE__Feature,
+ CORE__FilterPlugin,
+ CORE__FlangerPlugin,
+ CORE__FunctionPlugin,
+ CORE__GatePlugin,
+ CORE__GeneratorPlugin,
+ CORE__HighpassPlugin,
+ CORE__InputPort,
+ CORE__InstrumentPlugin,
+ CORE__LimiterPlugin,
+ CORE__LowpassPlugin,
+ CORE__MixerPlugin,
+ CORE__ModulatorPlugin,
+ CORE__MultiEQPlugin,
+ CORE__OscillatorPlugin,
+ CORE__OutputPort,
+ CORE__ParaEQPlugin,
+ CORE__PhaserPlugin,
+ CORE__PitchPlugin,
+ CORE__Plugin,
+ CORE__PluginBase,
+ CORE__Point,
+ CORE__Port,
+ CORE__PortProperty,
+ CORE__Resource,
+ CORE__ReverbPlugin,
+ CORE__ScalePoint,
+ CORE__SimulatorPlugin,
+ CORE__SpatialPlugin,
+ CORE__Specification,
+ CORE__SpectralPlugin,
+ CORE__UtilityPlugin,
+ CORE__WaveshaperPlugin,
+ CORE__appliesTo,
+ CORE__binary,
+ CORE__connectionOptional,
+ CORE__control,
+ CORE__default,
+ CORE__designation,
+ CORE__documentation,
+ CORE__enumeration,
+ CORE__extensionData,
+ CORE__freeWheeling,
+ CORE__hardRTCapable,
+ CORE__inPlaceBroken,
+ CORE__index,
+ CORE__integer,
+ CORE__isLive,
+ CORE__latency,
+ CORE__maximum,
+ CORE__microVersion,
+ CORE__minimum,
+ CORE__minorVersion,
+ CORE__name,
+ CORE__optionalFeature,
+ CORE__port,
+ CORE__portProperty,
+ CORE__project,
+ CORE__prototype,
+ CORE__reportsLatency,
+ CORE__requiredFeature,
+ CORE__sampleRate,
+ CORE__scalePoint,
+ CORE__symbol,
+ CORE__toggled,
+ CORE__isBitmask,
+ CORE__parameterProperty,
+
+ DATA_ACCESS,
+
+ DYN_MANIFEST,
+
+ EVENT__Event,
+ EVENT__EventPort,
+ EVENT__FrameStamp,
+ EVENT__TimeStamp,
+ EVENT__generatesTimeStamp,
+ EVENT__generic,
+ EVENT__inheritsEvent,
+ EVENT__inheritsTimeStamp,
+ EVENT__supportsEvent,
+ EVENT__supportsTimeStamp,
+
+ INSTANCE_ACCESS,
+
+ LOG__Entry,
+ LOG__Error,
+ LOG__Note,
+ LOG__Trace,
+ LOG__Warning,
+ LOG__log,
+
+ MIDI__ActiveSense,
+ MIDI__Aftertouch,
+ MIDI__Bender,
+ MIDI__ChannelPressure,
+ MIDI__Chunk,
+ MIDI__Clock,
+ MIDI__Continue,
+ MIDI__Controller,
+ MIDI__MidiEvent,
+ MIDI__NoteOff,
+ MIDI__NoteOn,
+ MIDI__ProgramChange,
+ MIDI__QuarterFrame,
+ MIDI__Reset,
+ MIDI__SongPosition,
+ MIDI__SongSelect,
+ MIDI__Start,
+ MIDI__Stop,
+ MIDI__SystemCommon,
+ MIDI__SystemExclusive,
+ MIDI__SystemMessage,
+ MIDI__SystemRealtime,
+ MIDI__Tick,
+ MIDI__TuneRequest,
+ MIDI__VoiceMessage,
+ MIDI__benderValue,
+ MIDI__binding,
+ MIDI__byteNumber,
+ MIDI__channel,
+ MIDI__chunk,
+ MIDI__controllerNumber,
+ MIDI__controllerValue,
+ MIDI__noteNumber,
+ MIDI__pressure,
+ MIDI__programNumber,
+ MIDI__property,
+ MIDI__songNumber,
+ MIDI__songPosition,
+ MIDI__status,
+ MIDI__statusMask,
+ MIDI__velocity,
+
+ MORPH__AutoMorphPort,
+ MORPH__MorphPort,
+ MORPH__interface,
+ MORPH__supportsType,
+ MORPH__currentType,
+
+ OPTIONS__Option,
+ OPTIONS__interface,
+ OPTIONS__options,
+ OPTIONS__requiredOption,
+ OPTIONS__supportedOption,
+
+ PARAMETERS__CompressorControls,
+ PARAMETERS__ControlGroup,
+ PARAMETERS__EnvelopeControls,
+ PARAMETERS__FilterControls,
+ PARAMETERS__OscillatorControls,
+ PARAMETERS__amplitude,
+ PARAMETERS__attack,
+ PARAMETERS__bypass,
+ PARAMETERS__cutoffFrequency,
+ PARAMETERS__decay,
+ PARAMETERS__delay,
+ PARAMETERS__dryLevel,
+ PARAMETERS__frequency,
+ PARAMETERS__gain,
+ PARAMETERS__hold,
+ PARAMETERS__pulseWidth,
+ PARAMETERS__ratio,
+ PARAMETERS__release,
+ PARAMETERS__resonance,
+ PARAMETERS__sampleRate,
+ PARAMETERS__sustain,
+ PARAMETERS__threshold,
+ PARAMETERS__waveform,
+ PARAMETERS__wetDryRatio,
+ PARAMETERS__wetLevel,
+
+ PATCH__Ack,
+ PATCH__Delete,
+ PATCH__Copy,
+ PATCH__Error,
+ PATCH__Get,
+ PATCH__Message,
+ PATCH__Move,
+ PATCH__Patch,
+ PATCH__Post,
+ PATCH__Put,
+ PATCH__Request,
+ PATCH__Response,
+ PATCH__Set,
+ PATCH__Insert,
+ PATCH__accept,
+ PATCH__add,
+ PATCH__body,
+ PATCH__context,
+ PATCH__destination,
+ PATCH__property,
+ PATCH__readable,
+ PATCH__remove,
+ PATCH__request,
+ PATCH__subject,
+ PATCH__sequenceNumber,
+ PATCH__value,
+ PATCH__wildcard,
+ PATCH__writable,
+
+ PORT_GROUPS__DiscreteGroup,
+ PORT_GROUPS__Element,
+ PORT_GROUPS__FivePointOneGroup,
+ PORT_GROUPS__FivePointZeroGroup,
+ PORT_GROUPS__FourPointZeroGroup,
+ PORT_GROUPS__Group,
+ PORT_GROUPS__InputGroup,
+ PORT_GROUPS__MidSideGroup,
+ PORT_GROUPS__MonoGroup,
+ PORT_GROUPS__OutputGroup,
+ PORT_GROUPS__SevenPointOneGroup,
+ PORT_GROUPS__SevenPointOneWideGroup,
+ PORT_GROUPS__SixPointOneGroup,
+ PORT_GROUPS__StereoGroup,
+ PORT_GROUPS__ThreePointZeroGroup,
+ PORT_GROUPS__center,
+ PORT_GROUPS__centerLeft,
+ PORT_GROUPS__centerRight,
+ PORT_GROUPS__element,
+ PORT_GROUPS__group,
+ PORT_GROUPS__left,
+ PORT_GROUPS__lowFrequencyEffects,
+ PORT_GROUPS__mainInput,
+ PORT_GROUPS__mainOutput,
+ PORT_GROUPS__rearCenter,
+ PORT_GROUPS__rearLeft,
+ PORT_GROUPS__rearRight,
+ PORT_GROUPS__right,
+ PORT_GROUPS__side,
+ PORT_GROUPS__sideChainOf,
+ PORT_GROUPS__sideLeft,
+ PORT_GROUPS__sideRight,
+ PORT_GROUPS__source,
+ PORT_GROUPS__subGroupOf,
+
+ PORT_PROPS__causesArtifacts,
+ PORT_PROPS__continuousCV,
+ PORT_PROPS__discreteCV,
+ PORT_PROPS__displayPriority,
+ PORT_PROPS__expensive,
+ PORT_PROPS__hasStrictBounds,
+ PORT_PROPS__logarithmic,
+ PORT_PROPS__notAutomatic,
+ PORT_PROPS__notOnGUI,
+ PORT_PROPS__rangeSteps,
+ PORT_PROPS__supportsStrictBounds,
+ PORT_PROPS__trigger,
+
+ //PRESETS__Bank,
+ PRESETS__Preset,
+ PRESETS__bank,
+ //PRESETS__preset,
+ PRESETS__value,
+
+ RESIZE_PORT__asLargeAs,
+ RESIZE_PORT__minimumSize,
+ RESIZE_PORT__resize,
+
+ //STATE__State,
+ STATE__interface,
+ STATE__loadDefaultState,
+ STATE__freePath,
+ STATE__makePath,
+ STATE__mapPath,
+ STATE__state,
+ STATE__threadSafeRestore,
+ STATE__StateChanged,
+
+ TIME__Time,
+ TIME__Position,
+ TIME__Rate,
+ TIME__position,
+ TIME__barBeat,
+ TIME__bar,
+ TIME__beat,
+ TIME__beatUnit,
+ TIME__beatsPerBar,
+ TIME__beatsPerMinute,
+ TIME__frame,
+ TIME__framesPerSecond,
+ TIME__speed,
+
+ UI__CocoaUI,
+ UI__Gtk3UI,
+ UI__GtkUI,
+ UI__PortNotification,
+ UI__PortProtocol,
+ UI__Qt4UI,
+ UI__Qt5UI,
+ //UI__UI,
+ UI__WindowsUI,
+ UI__X11UI,
+ UI__binary,
+ UI__fixedSize,
+ UI__idleInterface,
+ UI__noUserResize,
+ UI__notifyType,
+ UI__parent,
+ UI__plugin,
+ UI__portIndex,
+ UI__portMap,
+ UI__portNotification,
+ UI__portSubscribe,
+ UI__protocol,
+ UI__requestValue,
+ UI__floatProtocol,
+ UI__peakProtocol,
+ UI__resize,
+ UI__showInterface,
+ UI__touch,
+ UI__ui,
+ UI__updateRate,
+ UI__windowTitle,
+ UI__scaleFactor,
+ UI__foregroundColor,
+ UI__backgroundColor,
+
+ UNITS__Conversion,
+ UNITS__Unit,
+ UNITS__bar,
+ UNITS__beat,
+ UNITS__bpm,
+ UNITS__cent,
+ UNITS__cm,
+ UNITS__coef,
+ UNITS__conversion,
+ UNITS__db,
+ UNITS__degree,
+ UNITS__frame,
+ UNITS__hz,
+ UNITS__inch,
+ UNITS__khz,
+ UNITS__km,
+ UNITS__m,
+ UNITS__mhz,
+ UNITS__midiNote,
+ UNITS__mile,
+ UNITS__min,
+ UNITS__mm,
+ UNITS__ms,
+ UNITS__name,
+ UNITS__oct,
+ UNITS__pc,
+ UNITS__prefixConversion,
+ UNITS__render,
+ UNITS__s,
+ UNITS__semitone12TET,
+ UNITS__symbol,
+ UNITS__unit,
+
+ URID__map,
+ URID__unmap,
+
+ URI_MAP,
+
+ WORKER__interface,
+ WORKER__schedule,
+
+ EXTERNAL_UI__Widget,
+
+ INLINEDISPLAY__interface,
+ INLINEDISPLAY__queue_draw,
+ INLINEDISPLAY__surface,
+
+ OSC__Message,
+ OSC__messagePath,
+
+ CVAS__graph,
+
+ SYNTHPOD__state,
+ SYNTHPOD__null,
+ SYNTHPOD__payload,
+ SYNTHPOD__graph,
+ SYNTHPOD__stereo,
+ SYNTHPOD__monoatom,
+ SYNTHPOD__moduleList,
+ SYNTHPOD__moduleSupported,
+ SYNTHPOD__moduleAdd,
+ SYNTHPOD__moduleDel,
+ SYNTHPOD__moduleMove,
+ SYNTHPOD__modulePresetLoad,
+ SYNTHPOD__modulePresetSave,
+ SYNTHPOD__moduleVisible,
+ SYNTHPOD__moduleDisabled,
+ SYNTHPOD__moduleProfiling,
+ SYNTHPOD__modulePositionX,
+ SYNTHPOD__modulePositionY,
+ SYNTHPOD__moduleAlias,
+ SYNTHPOD__moduleReinstantiate,
+ SYNTHPOD__moduleCreated,
+ SYNTHPOD__nodePositionX,
+ SYNTHPOD__nodePositionY,
+ SYNTHPOD__graphPositionX,
+ SYNTHPOD__graphPositionY,
+ SYNTHPOD__columnEnabled,
+ SYNTHPOD__rowEnabled,
+ SYNTHPOD__portRefresh,
+ SYNTHPOD__bundleLoad,
+ SYNTHPOD__bundleSave,
+ SYNTHPOD__pathGet,
+ SYNTHPOD__DSPProfiling,
+ SYNTHPOD__CPUsAvailable,
+ SYNTHPOD__CPUsUsed,
+ SYNTHPOD__periodSize,
+ SYNTHPOD__numPeriods,
+ SYNTHPOD__quit,
+ SYNTHPOD__systemPorts,
+ SYNTHPOD__ControlPort,
+ SYNTHPOD__AudioPort,
+ SYNTHPOD__CVPort,
+ SYNTHPOD__MIDIPort,
+ SYNTHPOD__OSCPort,
+ SYNTHPOD__ComPort,
+ SYNTHPOD__connectionList,
+ SYNTHPOD__nodeList,
+ SYNTHPOD__subscriptionList,
+ SYNTHPOD__notificationList,
+ SYNTHPOD__automationList,
+ SYNTHPOD__sourceModule,
+ SYNTHPOD__sourceSymbol,
+ SYNTHPOD__sinkModule,
+ SYNTHPOD__sinkSymbol,
+ SYNTHPOD__sourceMinimum,
+ SYNTHPOD__sourceMaximum,
+ SYNTHPOD__sinkMinimum,
+ SYNTHPOD__sinkMaximum,
+ SYNTHPOD__sourceEnabled,
+ SYNTHPOD__sinkEnabled,
+ SYNTHPOD__learning,
+ SYNTHPOD__placeholder,
+ SYNTHPOD__visibility,
+
+ STAT_URID_MAX
+} stat_urid_t;
+
+extern const char *stat_uris [STAT_URID_MAX];
+
+#endif
diff --git a/meson.build b/meson.build
index 39644879..b9145fc5 100644
--- a/meson.build
+++ b/meson.build
@@ -62,6 +62,7 @@ rt_dep = cc.find_library('rt')
lv2_dep = dependency('lv2', version : '>=1.18.0')
thread_dep = dependency('threads')
lilv_dep = dependency('lilv-0', version : '>=0.24.0', static : static_link)
+serd_dep = dependency('serd-0', version : '>=0.30.0', static : static_link)
sratom_dep = dependency('sratom-0', version : '>=0.6.0', static : static_link)
alsa_dep = dependency('alsa', version : '>=1.1.0', required : use_alsa)
zita_dep = cc.find_library('zita-alsa-pcmi', required : use_alsa)
diff --git a/plugins/meson.build b/plugins/meson.build
index 6db6a527..73c1036d 100644
--- a/plugins/meson.build
+++ b/plugins/meson.build
@@ -13,12 +13,14 @@ nk_srcs = ['synthpod_lv2_nk.c',
'synthpod_keyboard_nk.c',
'synthpod_common_nk.c',
join_paths('..', 'sandbox_ui.lv2', 'sandbox_slave.c'),
+ join_paths('..', 'bin', 'synthpod_stat.c'),
join_paths('..', 'bin', 'synthpod_sandbox_x11_driver.c')]
ui_deps = [m_dep, rt_dep, thread_dep, lv2_dep, lilv_dep, d2tk_dep, xcb_dep, xcbicccm_dep, xcbxrm_dep]
ui_srcs = ['synthpod_lv2_d2tk.c',
'synthpod_common_d2tk.c',
join_paths('..', 'sandbox_ui.lv2', 'sandbox_slave.c'),
+ join_paths('..', 'bin', 'synthpod_stat.c'),
join_paths('..', 'bin', 'synthpod_sandbox_x11_driver.c')]
dsp = shared_module('synthpod', dsp_srcs,
diff --git a/plugins/synthpod_common_d2tk.c b/plugins/synthpod_common_d2tk.c
index eb326e96..2d9d4f45 100644
--- a/plugins/synthpod_common_d2tk.c
+++ b/plugins/synthpod_common_d2tk.c
@@ -28,6 +28,7 @@
#include <synthpod_common.h>
#include <synthpod_private.h>
#include <synthpod_patcher.h>
+#include <synthpod_stat.h>
#include <d2tk/frontend_pugl.h>
@@ -116,7 +117,9 @@ struct _mod_t {
struct _plughandle_t {
LilvWorld *world;
- reg_t regs;
+
+ LilvNode *regs [STAT_URID_MAX];
+
union {
LV2_Atom atom;
uint8_t buf [ATOM_BUF_MAX];
@@ -202,7 +205,7 @@ _message_write(plughandle_t *handle)
{
DBG;
handle->writer(handle->controller, CONTROL, lv2_atom_total_size(&handle->atom),
- handle->regs.port.event_transfer.urid, &handle->atom);
+ ATOM__eventTransfer, &handle->atom);
}
static inline void
@@ -910,14 +913,11 @@ instantiate(const LV2UI_Descriptor *descriptor, const char *plugin_uri,
return NULL;
void *parent = NULL;
- LV2UI_Resize *host_resize = NULL;
LV2_Options_Option *opts = NULL;
for(int i=0; features[i]; i++)
{
if(!strcmp(features[i]->URI, LV2_UI__parent))
parent = features[i]->data;
- else if(!strcmp(features[i]->URI, LV2_UI__resize))
- host_resize = features[i]->data;
else if(!strcmp(features[i]->URI, LV2_URID__map))
handle->map = features[i]->data;
else if(!strcmp(features[i]->URI, LV2_URID__unmap))
@@ -994,11 +994,6 @@ instantiate(const LV2UI_Descriptor *descriptor, const char *plugin_uri,
return NULL;
}
- if(host_resize)
- {
- host_resize->ui_resize(host_resize->handle, w, h);
- }
-
strncpy(handle->pplugs, "*", sizeof(handle->pplugs));
_status_message_set(handle, "Scanning for plugins");
@@ -1022,7 +1017,7 @@ cleanup(LV2UI_Handle instance)
d2tk_frontend_free(handle->dpugl);
- sp_regs_deinit(&handle->regs);
+ sp_regs_deinit(handle->regs);
free(handle->lplugs);
@@ -1136,7 +1131,7 @@ _add_mod(plughandle_t *handle, const LV2_Atom_URID *urn)
// get information for each of those, FIXME only if not already available
if( _message_request(handle)
- && synthpod_patcher_get(&handle->regs, &handle->forge,
+ && synthpod_patcher_get(&handle->forge,
urn->body, 0, 0) )
{
_message_write(handle);
@@ -1177,32 +1172,32 @@ _port_event_set_module_list(plughandle_t *handle, const LV2_Atom_Tuple *tup)
// patch:Get [patch:property spod:connectionList]
if( _message_request(handle)
- && synthpod_patcher_get(&handle->regs, &handle->forge,
- 0, 0, handle->regs.synthpod.connection_list.urid) )
+ && synthpod_patcher_get(&handle->forge,
+ 0, 0, SYNTHPOD__connectionList) )
{
_message_write(handle);
}
// patch:Get [patch:property spod:nodeList]
if( _message_request(handle)
- && synthpod_patcher_get(&handle->regs, &handle->forge,
- 0, 0, handle->regs.synthpod.node_list.urid) )
+ && synthpod_patcher_get(&handle->forge,
+ 0, 0, SYNTHPOD__nodeList) )
{
_message_write(handle);
}
// patch:Get [patch:property pset:preset]
if( _message_request(handle)
- && synthpod_patcher_get(&handle->regs, &handle->forge,
- 0, 0, handle->regs.pset.preset.urid) )
+ && synthpod_patcher_get(&handle->forge,
+ 0, 0, PRESETS__Preset) )
{
_message_write(handle);
}
// patch:Get [patch:property spod:automationList]
if( _message_request(handle)
- && synthpod_patcher_get(&handle->regs, &handle->forge,
- 0, 0, handle->regs.synthpod.automation_list.urid) )
+ && synthpod_patcher_get(&handle->forge,
+ 0, 0, SYNTHPOD__automationList) )
{
_message_write(handle);
}
@@ -1238,15 +1233,15 @@ _port_event_set(plughandle_t *handle, const LV2_Atom_Object *obj)
const LV2_Atom *value = NULL;
lv2_atom_object_get(obj,
- handle->regs.patch.subject.urid, &subject,
- handle->regs.patch.property.urid, &property,
- handle->regs.patch.value.urid, &value,
+ PATCH__subject, &subject,
+ PATCH__property, &property,
+ PATCH__value, &value,
0);
- const LV2_URID subj = subject && (subject->atom.type == handle->forge.URID)
+ const LV2_URID subj = subject && (subject->atom.type == ATOM__URID)
? subject->body
: 0;
- const LV2_URID prop = property && (property->atom.type == handle->forge.URID)
+ const LV2_URID prop = property && (property->atom.type == ATOM__URID)
? property->body
: 0;
@@ -1255,33 +1250,33 @@ _port_event_set(plughandle_t *handle, const LV2_Atom_Object *obj)
return;
}
- if( (prop == handle->regs.synthpod.module_list.urid)
- && (value->type == handle->forge.Tuple) )
+ if( (prop == SYNTHPOD__moduleList)
+ && (value->type == ATOM__Tuple) )
{
_port_event_set_module_list(handle, (const LV2_Atom_Tuple *)value);
}
- else if( (prop == handle->regs.synthpod.connection_list.urid)
- && (value->type == handle->forge.Tuple) )
+ else if( (prop == SYNTHPOD__connectionList)
+ && (value->type == ATOM__Tuple) )
{
_port_event_set_connection_list(handle, (const LV2_Atom_Tuple *)value);
}
- else if( (prop == handle->regs.synthpod.node_list.urid)
- && (value->type == handle->forge.Tuple) )
+ else if( (prop == SYNTHPOD__nodeList)
+ && (value->type == ATOM__Tuple) )
{
_port_event_set_node_list(handle, (const LV2_Atom_Tuple *)value);
}
- else if( (prop == handle->regs.synthpod.automation_list.urid)
- && (value->type == handle->forge.Tuple) )
+ else if( (prop == SYNTHPOD__automationList)
+ && (value->type == ATOM__Tuple) )
{
_port_event_set_automation_list(handle, (const LV2_Atom_Tuple *)value);
}
- else if( (prop == handle->regs.pset.preset.urid)
- && (value->type == handle->forge.URID) )
+ else if( (prop == PRESETS__Preset)
+ && (value->type == ATOM__URID) )
{
//FIXME
}
- else if( (prop == handle->regs.synthpod.dsp_profiling.urid)
- && (value->type == handle->forge.Vector) )
+ else if( (prop == SYNTHPOD__DSPProfiling)
+ && (value->type == ATOM__Vector) )
{
const float *f32 = LV2_ATOM_CONTENTS_CONST(LV2_Atom_Vector, value);
@@ -1291,62 +1286,62 @@ _port_event_set(plughandle_t *handle, const LV2_Atom_Object *obj)
_status_labels_update(handle);
}
- else if( (prop == handle->regs.synthpod.module_profiling.urid)
- && (value->type == handle->forge.Vector)
+ else if( (prop == SYNTHPOD__moduleProfiling)
+ && (value->type == ATOM__Vector)
&& subj )
{
//FIXME
}
- else if( (prop == handle->regs.synthpod.graph_position_x.urid)
- && (value->type == handle->forge.Float) )
+ else if( (prop == SYNTHPOD__graphPositionX)
+ && (value->type == ATOM__Float) )
{
//FIXME
}
- else if( (prop == handle->regs.synthpod.graph_position_y.urid)
- && (value->type == handle->forge.Float) )
+ else if( (prop == SYNTHPOD__graphPositionY)
+ && (value->type == ATOM__Float) )
{
}
- else if( (prop == handle->regs.synthpod.column_enabled.urid)
- && (value->type == handle->forge.Bool) )
+ else if( (prop == SYNTHPOD__columnEnabled)
+ && (value->type == ATOM__Bool) )
{
//FIXME
}
- else if( (prop == handle->regs.synthpod.row_enabled.urid)
- && (value->type == handle->forge.Bool) )
+ else if( (prop == SYNTHPOD__rowEnabled)
+ && (value->type == ATOM__Bool) )
{
//FIXME
}
- else if( (prop == handle->regs.synthpod.cpus_used.urid)
- && (value->type == handle->forge.Int) )
+ else if( (prop == SYNTHPOD__CPUsUsed)
+ && (value->type == ATOM__Int) )
{
handle->status.cpus_used = ATOM_INT_VAL(value);
_status_labels_update(handle);
}
- else if( (prop == handle->regs.synthpod.cpus_available.urid)
- && (value->type == handle->forge.Int) )
+ else if( (prop == SYNTHPOD__CPUsAvailable)
+ && (value->type == ATOM__Int) )
{
handle->status.cpus_available = ATOM_INT_VAL(value);
_status_labels_update(handle);
}
- else if( (prop == handle->regs.synthpod.period_size.urid)
- && (value->type == handle->forge.Int) )
+ else if( (prop == SYNTHPOD__periodSize)
+ && (value->type == ATOM__Int) )
{
handle->status.period_size = ATOM_INT_VAL(value);
_status_labels_update(handle);
}
- else if( (prop == handle->regs.synthpod.num_periods.urid)
- && (value->type == handle->forge.Int) )
+ else if( (prop == SYNTHPOD__numPeriods)
+ && (value->type == ATOM__Int) )
{
handle->status.num_periods = ATOM_INT_VAL(value);
_status_labels_update(handle);
}
- else if( (prop == handle->regs.idisp.surface.urid)
- && (value->type == handle->forge.Tuple)
+ else if( (prop == INLINEDISPLAY__surface)
+ && (value->type == ATOM__Tuple)
&& subj )
{
//FIXME
@@ -1464,11 +1459,11 @@ DBG;
const LV2_Atom_Object *body = NULL;
lv2_atom_object_get(obj,
- handle->regs.patch.subject.urid, &subject,
- handle->regs.patch.body.urid, &body,
+ PATCH__subject, &subject,
+ PATCH__body, &body,
0);
- const LV2_URID subj = subject && (subject->atom.type == handle->forge.URID)
+ const LV2_URID subj = subject && (subject->atom.type == ATOM__URID)
? subject->body
: 0;
@@ -1486,11 +1481,11 @@ DBG;
const LV2_Atom_URID *ui_uri = NULL;
lv2_atom_object_get(body,
- handle->regs.core.plugin.urid, &plugin,
- handle->regs.synthpod.module_position_x.urid, &mod_pos_x,
- handle->regs.synthpod.module_position_y.urid, &mod_pos_y,
- handle->regs.synthpod.module_alias.urid, &mod_alias,
- handle->regs.ui.ui.urid, &ui_uri, //FIXME use this
+ CORE__Plugin, &plugin,
+ SYNTHPOD__modulePositionX, &mod_pos_x,
+ SYNTHPOD__modulePositionY, &mod_pos_y,
+ SYNTHPOD__moduleAlias, &mod_alias,
+ UI__ui, &ui_uri, //FIXME use this
0); //FIXME query more
const LV2_URID urid = plugin
@@ -1533,37 +1528,37 @@ DBG;
bool needs_filtering = false;
if( mod_pos_x
- && (mod_pos_x->atom.type == handle->forge.Float)
+ && (mod_pos_x->atom.type == ATOM__Float)
&& (mod_pos_x->body != 0.f) )
{
mod->pos.x = mod_pos_x->body;
needs_filtering = true;
}
else if( _message_request(handle)
- && synthpod_patcher_set(&handle->regs, &handle->forge,
- mod->urn, 0, handle->regs.synthpod.module_position_x.urid,
- sizeof(float), handle->forge.Float, &mod->pos.x) )
+ && synthpod_patcher_set(&handle->forge,
+ mod->urn, 0, SYNTHPOD__modulePositionX,
+ sizeof(float), ATOM__Float, &mod->pos.x) )
{
_message_write(handle);
}
if( mod_pos_y
- && (mod_pos_y->atom.type == handle->forge.Float)
+ && (mod_pos_y->atom.type == ATOM__Float)
&& (mod_pos_y->body != 0.f) )
{
mod->pos.y = mod_pos_y->body;
needs_filtering = true;
}
else if( _message_request(handle)
- && synthpod_patcher_set(&handle->regs, &handle->forge,
- mod->urn, 0, handle->regs.synthpod.module_position_y.urid,
- sizeof(float), handle->forge.Float, &mod->pos.y) )
+ && synthpod_patcher_set(&handle->forge,
+ mod->urn, 0, SYNTHPOD__modulePositionY,
+ sizeof(float), ATOM__Float, &mod->pos.y) )
{
_message_write(handle);
}
if( mod_alias
- && (mod_alias->atom.type == handle->forge.String) )
+ && (mod_alias->atom.type == ATOM__String) )
{
mod->alias.len = snprintf(mod->alias.buf, sizeof(mod->alias.buf), "%s",
ATOM_STRING_VAL(&mod_alias->atom));
@@ -1623,7 +1618,7 @@ port_event(LV2UI_Handle instance, uint32_t port_index, uint32_t size,
return;
}
- if(format != handle->regs.port.event_transfer.urid)
+ if(format != ATOM__eventTransfer)
{
return;
}
@@ -1634,19 +1629,19 @@ port_event(LV2UI_Handle instance, uint32_t port_index, uint32_t size,
return;
}
- if(obj->body.otype == handle->regs.patch.set.urid)
+ if(obj->body.otype == PATCH__Set)
{
_port_event_set(handle, obj);
}
- else if(obj->body.otype == handle->regs.patch.put.urid)
+ else if(obj->body.otype == PATCH__Put)
{
_port_event_put(handle, obj);
}
- else if(obj->body.otype == handle->regs.patch.patch.urid)
+ else if(obj->body.otype == PATCH__Patch)
{
_port_event_patch(handle, obj);
}
- else if(obj->body.otype == handle->regs.patch.copy.urid)
+ else if(obj->body.otype == PATCH__Copy)
{
_port_event_copy(handle, obj);
}
@@ -1684,76 +1679,76 @@ _init(plughandle_t *handle)
const unsigned nplugs = lilv_plugins_size(handle->plugs);
handle->lplugs = calloc(1, nplugs * sizeof(entry_t));
- sp_regs_init(&handle->regs, handle->world, handle->map);
+ sp_regs_init(handle->regs, handle->world);
// patch:Get [patch:property spod:moduleList]
if( _message_request(handle)
- && synthpod_patcher_get(&handle->regs, &handle->forge,
- 0, 0, handle->regs.synthpod.module_list.urid) )
+ && synthpod_patcher_get(&handle->forge,
+ 0, 0, SYNTHPOD__moduleList) )
{
_message_write(handle);
}
// patch:Get [patch:property spod:CPUsAvailable]
if( _message_request(handle)
- && synthpod_patcher_get(&handle->regs, &handle->forge,
- 0, 0, handle->regs.synthpod.cpus_available.urid) )
+ && synthpod_patcher_get(&handle->forge,
+ 0, 0, SYNTHPOD__CPUsAvailable) )
{
_message_write(handle);
}
// patch:Get [patch:property spod:CPUsUsed]
if( _message_request(handle)
- && synthpod_patcher_get(&handle->regs, &handle->forge,
- 0, 0, handle->regs.synthpod.cpus_used.urid) )
+ && synthpod_patcher_get(&handle->forge,
+ 0, 0, SYNTHPOD__CPUsUsed) )
{
_message_write(handle);
}
// patch:Get [patch:property spod:periodSize]
if( _message_request(handle)
- && synthpod_patcher_get(&handle->regs, &handle->forge,
- 0, 0, handle->regs.synthpod.period_size.urid) )
+ && synthpod_patcher_get(&handle->forge,
+ 0, 0, SYNTHPOD__periodSize) )
{
_message_write(handle);
}
// patch:Get [patch:property spod:numPeriods]
if( _message_request(handle)
- && synthpod_patcher_get(&handle->regs, &handle->forge,
- 0, 0, handle->regs.synthpod.num_periods.urid) )
+ && synthpod_patcher_get(&handle->forge,
+ 0, 0, SYNTHPOD__numPeriods) )
{
_message_write(handle);
}
// patch:Get [patch:property spod:graphPositionX]
if( _message_request(handle)
- && synthpod_patcher_get(&handle->regs, &handle->forge,
- 0, 0, handle->regs.synthpod.graph_position_x.urid) )
+ && synthpod_patcher_get(&handle->forge,
+ 0, 0, SYNTHPOD__graphPositionX) )
{
_message_write(handle);
}
// patch:Get [patch:property spod:graphPositionY]
if( _message_request(handle)
- && synthpod_patcher_get(&handle->regs, &handle->forge,
- 0, 0, handle->regs.synthpod.graph_position_y.urid) )
+ && synthpod_patcher_get(&handle->forge,
+ 0, 0, SYNTHPOD__graphPositionY) )
{
_message_write(handle);
}
// patch:Get [patch:property spod:columnEnabled]
if( _message_request(handle)
- && synthpod_patcher_get(&handle->regs, &handle->forge,
- 0, 0, handle->regs.synthpod.column_enabled.urid) )
+ && synthpod_patcher_get(&handle->forge,
+ 0, 0, SYNTHPOD__columnEnabled) )
{
_message_write(handle);
}
// patch:Get [patch:property spod:rowEnabled]
if( _message_request(handle)
- && synthpod_patcher_get(&handle->regs, &handle->forge,
- 0, 0, handle->regs.synthpod.row_enabled.urid) )
+ && synthpod_patcher_get(&handle->forge,
+ 0, 0, SYNTHPOD__rowEnabled) )
{
_message_write(handle);
}
@@ -1779,27 +1774,14 @@ static const LV2UI_Idle_Interface idle_ext = {
.idle = _idle
};
-static int
-_resize(LV2UI_Handle instance, int width, int height)
-{
- DBG;
- plughandle_t *handle = instance;
-
- return d2tk_frontend_set_size(handle->dpugl, width, height);
-}
-
-static const LV2UI_Resize resize_ext = {
- .ui_resize = _resize
-};
-
static const void *
extension_data(const char *uri)
{
DBG;
if(!strcmp(uri, LV2_UI__idleInterface))
+ {
return &idle_ext;
- else if(!strcmp(uri, LV2_UI__resize))
- return &resize_ext;
+ }
return NULL;
}
diff --git a/plugins/synthpod_common_nk.c b/plugins/synthpod_common_nk.c
index d05a44f2..a07080f5 100644
--- a/plugins/synthpod_common_nk.c
+++ b/plugins/synthpod_common_nk.c
@@ -35,6 +35,7 @@
#include <sandbox_master.h>
#include <synthpod_sandbox_x11_driver.h>
+#include <synthpod_stat.h>
#include <math.h>
#include <unistd.h> // vfork
@@ -63,6 +64,7 @@
#define SPLINE_BEND 25.f
#define ALIAS_MAX 32
#define DEFAULT_PSET_LABEL "DEFAULT"
+#define NODE(KEY) handle->regs[KEY]
#ifdef Bool
# undef Bool // interferes with atom forge
@@ -475,7 +477,8 @@ struct _plughandle_t {
struct nk_vec2 from;
} box;
- reg_t regs;
+ LilvNode *regs [STAT_URID_MAX];
+
union {
LV2_Atom atom;
uint8_t buf [ATOM_BUF_MAX];
@@ -769,7 +772,7 @@ _message_write(plughandle_t *handle)
{
DBG;
handle->writer(handle->controller, CONTROL, lv2_atom_total_size(&handle->atom),
- handle->regs.port.event_transfer.urid, &handle->atom);
+ ATOM__eventTransfer, &handle->atom);
}
static size_t
@@ -992,27 +995,27 @@ static LV2_Atom_Forge_Ref
_patch_connection_internal(plughandle_t *handle, port_t *source_port, port_t *sink_port, float gain)
{
DBG;
- LV2_Atom_Forge_Ref ref = lv2_atom_forge_key(&handle->forge, handle->regs.synthpod.source_module.urid);
+ LV2_Atom_Forge_Ref ref = lv2_atom_forge_key(&handle->forge, SYNTHPOD__sourceModule);
if(ref)
ref = lv2_atom_forge_urid(&handle->forge, source_port->mod->urn);
if(ref)
- ref = lv2_atom_forge_key(&handle->forge, handle->regs.synthpod.source_symbol.urid);
+ ref = lv2_atom_forge_key(&handle->forge, SYNTHPOD__sourceSymbol);
if(ref)
ref = lv2_atom_forge_string(&handle->forge, source_port->symbol, strlen(source_port->symbol));
if(ref)
- ref = lv2_atom_forge_key(&handle->forge, handle->regs.synthpod.sink_module.urid);
+ ref = lv2_atom_forge_key(&handle->forge, SYNTHPOD__sinkModule);
if(ref)
ref = lv2_atom_forge_urid(&handle->forge, sink_port->mod->urn);
if(ref)
- ref = lv2_atom_forge_key(&handle->forge, handle->regs.synthpod.sink_symbol.urid);
+ ref = lv2_atom_forge_key(&handle->forge, SYNTHPOD__sinkSymbol);
if(ref)
ref = lv2_atom_forge_string(&handle->forge, sink_port->symbol, strlen(sink_port->symbol));
if(ref)
- ref = lv2_atom_forge_key(&handle->forge, handle->regs.param.gain.urid);
+ ref = lv2_atom_forge_key(&handle->forge, PARAMETERS__gain);
if(ref)
ref = lv2_atom_forge_float(&handle->forge, gain);
@@ -1026,8 +1029,8 @@ _patch_connection_add(plughandle_t *handle, port_t *source_port, port_t *sink_po
LV2_Atom_Forge_Frame frame [3];
if( _message_request(handle)
- && synthpod_patcher_add_object(&handle->regs, &handle->forge, &frame[0],
- 0, 0, handle->regs.synthpod.connection_list.urid) //TODO subject
+ && synthpod_patcher_add_object(&handle->forge, &frame[0],
+ 0, 0, SYNTHPOD__connectionList) //TODO subject
&& lv2_atom_forge_object(&handle->forge, &frame[2], 0, 0)
&& _patch_connection_internal(handle, source_port, sink_port, gain) )
{
@@ -1045,8 +1048,8 @@ _patch_connection_remove(plughandle_t *handle, port_t *source_port, port_t *sink
LV2_Atom_Forge_Frame frame [3];
if( _message_request(handle)
- && synthpod_patcher_remove_object(&handle->regs, &handle->forge, &frame[0],
- 0, 0, handle->regs.synthpod.connection_list.urid) //TODO subject
+ && synthpod_patcher_remove_object(&handle->forge, &frame[0],
+ 0, 0, SYNTHPOD__connectionList) //TODO subject
&& lv2_atom_forge_object(&handle->forge, &frame[2], 0, 0)
&& _patch_connection_internal(handle, source_port, sink_port, 0.f) )
{
@@ -1062,19 +1065,19 @@ _patch_node_internal(plughandle_t *handle, mod_t *source_mod, mod_t *sink_mod,
float x, float y)
{
DBG;
- LV2_Atom_Forge_Ref ref = lv2_atom_forge_key(&handle->forge, handle->regs.synthpod.source_module.urid);
+ LV2_Atom_Forge_Ref ref = lv2_atom_forge_key(&handle->forge, SYNTHPOD__sourceModule);
if(ref)
ref = lv2_atom_forge_urid(&handle->forge, source_mod->urn);
if(ref)
- ref = lv2_atom_forge_key(&handle->forge, handle->regs.synthpod.sink_module.urid);
+ ref = lv2_atom_forge_key(&handle->forge, SYNTHPOD__sinkModule);
if(ref)
ref = lv2_atom_forge_urid(&handle->forge, sink_mod->urn);
if(x != 0.f)
{
if(ref)
- ref = lv2_atom_forge_key(&handle->forge, handle->regs.synthpod.node_position_x.urid);
+ ref = lv2_atom_forge_key(&handle->forge, SYNTHPOD__nodePositionX);
if(ref)
ref = lv2_atom_forge_float(&handle->forge, x);
}
@@ -1082,7 +1085,7 @@ _patch_node_internal(plughandle_t *handle, mod_t *source_mod, mod_t *sink_mod,
if(y != 0.f)
{
if(ref)
- ref = lv2_atom_forge_key(&handle->forge, handle->regs.synthpod.node_position_y.urid);
+ ref = lv2_atom_forge_key(&handle->forge, SYNTHPOD__nodePositionY);
if(ref)
ref = lv2_atom_forge_float(&handle->forge, y);
}
@@ -1098,8 +1101,8 @@ _patch_node_add(plughandle_t *handle, mod_t *source_mod, mod_t *sink_mod,
LV2_Atom_Forge_Frame frame [3];
if( _message_request(handle)
- && synthpod_patcher_add_object(&handle->regs, &handle->forge, &frame[0],
- 0, 0, handle->regs.synthpod.node_list.urid) //TODO subject
+ && synthpod_patcher_add_object(&handle->forge, &frame[0],
+ 0, 0, SYNTHPOD__nodeList) //TODO subject
&& lv2_atom_forge_object(&handle->forge, &frame[2], 0, 0)
&& _patch_node_internal(handle, source_mod, sink_mod, x, y) )
{
@@ -1115,8 +1118,8 @@ _patch_node_remove(plughandle_t *handle, mod_t *source_mod, mod_t *sink_mod)
LV2_Atom_Forge_Frame frame [3];
if( _message_request(handle)
- && synthpod_patcher_remove_object(&handle->regs, &handle->forge, &frame[0],
- 0, 0, handle->regs.synthpod.node_list.urid) //TODO subject
+ && synthpod_patcher_remove_object(&handle->forge, &frame[0],
+ 0, 0, SYNTHPOD__nodeList) //TODO subject
&& lv2_atom_forge_object(&handle->forge, &frame[2], 0, 0)
&& _patch_node_internal(handle, source_mod, sink_mod, 0.f, 0.f) )
{
@@ -1129,12 +1132,12 @@ static LV2_Atom_Forge_Ref
_patch_subscription_internal(plughandle_t *handle, port_t *source_port)
{
DBG;
- LV2_Atom_Forge_Ref ref = lv2_atom_forge_key(&handle->forge, handle->regs.synthpod.sink_module.urid);
+ LV2_Atom_Forge_Ref ref = lv2_atom_forge_key(&handle->forge, SYNTHPOD__sinkModule);
if(ref)
ref = lv2_atom_forge_urid(&handle->forge, source_port->mod->urn);
if(ref)
- ref = lv2_atom_forge_key(&handle->forge, handle->regs.synthpod.sink_symbol.urid);
+ ref = lv2_atom_forge_key(&handle->forge, SYNTHPOD__sinkSymbol);
if(ref)
ref = lv2_atom_forge_string(&handle->forge, source_port->symbol, strlen(source_port->symbol));
@@ -1148,8 +1151,8 @@ _patch_subscription_add(plughandle_t *handle, port_t *source_port)
LV2_Atom_Forge_Frame frame [3];
if( _message_request(handle)
- && synthpod_patcher_add_object(&handle->regs, &handle->forge, &frame[0],
- 0, 0, handle->regs.synthpod.subscription_list.urid) //TODO subject
+ && synthpod_patcher_add_object(&handle->forge, &frame[0],
+ 0, 0, SYNTHPOD__subscriptionList) //TODO subject
&& lv2_atom_forge_object(&handle->forge, &frame[2], 0, 0)
&& _patch_subscription_internal(handle, source_port) )
{
@@ -1165,8 +1168,8 @@ _patch_subscription_remove(plughandle_t *handle, port_t *source_port)
LV2_Atom_Forge_Frame frame [3];
if( _message_request(handle)
- && synthpod_patcher_remove_object(&handle->regs, &handle->forge, &frame[0],
- 0, 0, handle->regs.synthpod.subscription_list.urid) //TODO subject
+ && synthpod_patcher_remove_object(&handle->forge, &frame[0],
+ 0, 0, SYNTHPOD__subscriptionList) //TODO subject
&& lv2_atom_forge_object(&handle->forge, &frame[2], 0, 0)
&& _patch_subscription_internal(handle, source_port) )
{
@@ -1271,17 +1274,17 @@ _patch_notification_internal(plughandle_t *handle, port_t *source_port,
uint32_t size, LV2_URID type, const void *body)
{
DBG;
- LV2_Atom_Forge_Ref ref = lv2_atom_forge_key(&handle->forge, handle->regs.synthpod.sink_module.urid);
+ LV2_Atom_Forge_Ref ref = lv2_atom_forge_key(&handle->forge, SYNTHPOD__sinkModule);
if(ref)
ref = lv2_atom_forge_urid(&handle->forge, source_port->mod->urn);
if(ref)
- ref = lv2_atom_forge_key(&handle->forge, handle->regs.synthpod.sink_symbol.urid);
+ ref = lv2_atom_forge_key(&handle->forge, SYNTHPOD__sinkSymbol);
if(ref)
ref = lv2_atom_forge_string(&handle->forge, source_port->symbol, strlen(source_port->symbol));
if(ref)
- ref = lv2_atom_forge_key(&handle->forge, handle->regs.rdf.value.urid);
+ ref = lv2_atom_forge_key(&handle->forge, RDF__value);
if(ref)
ref = lv2_atom_forge_atom(&handle->forge, size, type);
if(ref)
@@ -1298,8 +1301,8 @@ _patch_notification_add(plughandle_t *handle, port_t *source_port,
LV2_Atom_Forge_Frame frame [3];
if( _message_request(handle)
- && synthpod_patcher_add_object(&handle->regs, &handle->forge, &frame[0],
- 0, 0, handle->regs.synthpod.notification_list.urid) //TODO subject
+ && synthpod_patcher_add_object(&handle->forge, &frame[0],
+ 0, 0, SYNTHPOD__notificationList) //TODO subject
&& lv2_atom_forge_object(&handle->forge, &frame[2], 0, proto)
&& _patch_notification_internal(handle, source_port, size, type, body) )
{
@@ -1314,19 +1317,19 @@ _patch_notification_patch_set_internal(plughandle_t *handle, port_t *source_port
uint32_t size, LV2_URID type, const void *body)
{
DBG;
- LV2_Atom_Forge_Ref ref = lv2_atom_forge_key(&handle->forge, handle->regs.synthpod.sink_module.urid);
+ LV2_Atom_Forge_Ref ref = lv2_atom_forge_key(&handle->forge, SYNTHPOD__sinkModule);
if(ref)
ref = lv2_atom_forge_urid(&handle->forge, source_port->mod->urn);
if(ref)
- ref = lv2_atom_forge_key(&handle->forge, handle->regs.synthpod.sink_symbol.urid);
+ ref = lv2_atom_forge_key(&handle->forge, SYNTHPOD__sinkSymbol);
if(ref)
ref = lv2_atom_forge_string(&handle->forge, source_port->symbol, strlen(source_port->symbol));
if(ref)
- ref = lv2_atom_forge_key(&handle->forge, handle->regs.rdf.value.urid);
+ ref = lv2_atom_forge_key(&handle->forge, RDF__value);
if(ref)
- ref = synthpod_patcher_set(&handle->regs, &handle->forge,
+ ref = synthpod_patcher_set(&handle->forge,
subject, seqn, property, size, type, body);
return ref;
@@ -1347,10 +1350,10 @@ _patch_notification_add_patch_set(plughandle_t *handle, mod_t *mod,
if(!(port->type & PROPERTY_TYPE_PATCH))
continue;
- //FIXME set patch:destination to handle->regs.core.plugin.urid to omit feedback
+ //FIXME set patch:destination to CORE__Plugin to omit feedback
if( _message_request(handle)
- && synthpod_patcher_add_object(&handle->regs, &handle->forge, &frame[0],
- 0, 0, handle->regs.synthpod.notification_list.urid) //TODO subject
+ && synthpod_patcher_add_object(&handle->forge, &frame[0],
+ 0, 0, SYNTHPOD__notificationList) //TODO subject
&& lv2_atom_forge_object(&handle->forge, &frame[2], 0, proto)
&& _patch_notification_patch_set_internal(handle, port,
subject, seqn, property, size, type, body) )
@@ -1366,19 +1369,19 @@ _patch_notification_patch_get_internal(plughandle_t *handle, port_t *source_port
LV2_URID subject, int32_t seqn, LV2_URID property)
{
DBG;
- LV2_Atom_Forge_Ref ref = lv2_atom_forge_key(&handle->forge, handle->regs.synthpod.sink_module.urid);
+ LV2_Atom_Forge_Ref ref = lv2_atom_forge_key(&handle->forge, SYNTHPOD__sinkModule);
if(ref)
ref = lv2_atom_forge_urid(&handle->forge, source_port->mod->urn);
if(ref)
- ref = lv2_atom_forge_key(&handle->forge, handle->regs.synthpod.sink_symbol.urid);
+ ref = lv2_atom_forge_key(&handle->forge, SYNTHPOD__sinkSymbol);
if(ref)
ref = lv2_atom_forge_string(&handle->forge, source_port->symbol, strlen(source_port->symbol));
if(ref)
- ref = lv2_atom_forge_key(&handle->forge, handle->regs.rdf.value.urid);
+ ref = lv2_atom_forge_key(&handle->forge, RDF__value);
if(ref)
- ref = synthpod_patcher_get(&handle->regs, &handle->forge,
+ ref = synthpod_patcher_get(&handle->forge,
subject, seqn, property);
return ref;
@@ -1398,10 +1401,10 @@ _patch_notification_add_patch_get(plughandle_t *handle, mod_t *mod,
if(!(port->type & PROPERTY_TYPE_PATCH))
continue;
- //FIXME set patch:destination to handle->regs.core.plugin.urid to omit feedback
+ //FIXME set patch:destination to CORE__Plugin to omit feedback
if( _message_request(handle)
- && synthpod_patcher_add_object(&handle->regs, &handle->forge, &frame[0],
- 0, 0, handle->regs.synthpod.notification_list.urid) //TODO subject
+ && synthpod_patcher_add_object(&handle->forge, &frame[0],
+ 0, 0, SYNTHPOD__notificationList) //TODO subject
&& lv2_atom_forge_object(&handle->forge, &frame[2], 0, proto)
&& _patch_notification_patch_get_internal(handle, port,
subject, seqn, property) ) // property == 0 -> get all
@@ -1416,12 +1419,12 @@ static LV2_Atom_Forge_Ref
_patch_port_automation_internal(plughandle_t *handle, port_t *source_port)
{
DBG;
- LV2_Atom_Forge_Ref ref = lv2_atom_forge_key(&handle->forge, handle->regs.synthpod.sink_module.urid);
+ LV2_Atom_Forge_Ref ref = lv2_atom_forge_key(&handle->forge, SYNTHPOD__sinkModule);
if(ref)
ref = lv2_atom_forge_urid(&handle->forge, source_port->mod->urn);
if(ref)
- ref = lv2_atom_forge_key(&handle->forge, handle->regs.synthpod.sink_symbol.urid);
+ ref = lv2_atom_forge_key(&handle->forge, SYNTHPOD__sinkSymbol);
if(ref)
ref = lv2_atom_forge_string(&handle->forge, source_port->symbol, strlen(source_port->symbol));
@@ -1432,17 +1435,17 @@ static LV2_Atom_Forge_Ref
_patch_param_automation_internal(plughandle_t *handle, param_t *source_param)
{
DBG;
- LV2_Atom_Forge_Ref ref = lv2_atom_forge_key(&handle->forge, handle->regs.synthpod.sink_module.urid);
+ LV2_Atom_Forge_Ref ref = lv2_atom_forge_key(&handle->forge, SYNTHPOD__sinkModule);
if(ref)
ref = lv2_atom_forge_urid(&handle->forge, source_param->mod->urn);
if(ref)
- ref = lv2_atom_forge_key(&handle->forge, handle->regs.patch.property.urid);
+ ref = lv2_atom_forge_key(&handle->forge, PATCH__property);
if(ref)
ref = lv2_atom_forge_urid(&handle->forge, source_param->property);
if(ref)
- ref = lv2_atom_forge_key(&handle->forge, handle->regs.rdfs.range.urid);
+ ref = lv2_atom_forge_key(&handle->forge, RDFS__range);
if(ref)
ref = lv2_atom_forge_urid(&handle->forge, source_param->range);
@@ -1453,47 +1456,47 @@ static LV2_Atom_Forge_Ref
_patch_midi_automation_internal(plughandle_t *handle, auto_t *automation)
{
DBG;
- LV2_Atom_Forge_Ref ref = lv2_atom_forge_key(&handle->forge, handle->regs.midi.channel.urid);
+ LV2_Atom_Forge_Ref ref = lv2_atom_forge_key(&handle->forge, MIDI__channel);
if(ref)
ref = lv2_atom_forge_int(&handle->forge, automation->midi.channel);
if(ref)
- ref = lv2_atom_forge_key(&handle->forge, handle->regs.midi.controller_number.urid);
+ ref = lv2_atom_forge_key(&handle->forge, MIDI__controllerNumber);
if(ref)
ref = lv2_atom_forge_int(&handle->forge, automation->midi.controller);
if(ref)
- ref = lv2_atom_forge_key(&handle->forge, handle->regs.synthpod.source_min.urid);
+ ref = lv2_atom_forge_key(&handle->forge, SYNTHPOD__sourceMinimum);
if(ref)
ref = lv2_atom_forge_double(&handle->forge, automation->midi.a);
if(ref)
- ref = lv2_atom_forge_key(&handle->forge, handle->regs.synthpod.source_max.urid);
+ ref = lv2_atom_forge_key(&handle->forge, SYNTHPOD__sourceMaximum);
if(ref)
ref = lv2_atom_forge_double(&handle->forge, automation->midi.b);
if(ref)
- ref = lv2_atom_forge_key(&handle->forge, handle->regs.synthpod.sink_min.urid);
+ ref = lv2_atom_forge_key(&handle->forge, SYNTHPOD__sinkMinimum);
if(ref)
ref = lv2_atom_forge_double(&handle->forge, automation->c);
if(ref)
- ref = lv2_atom_forge_key(&handle->forge, handle->regs.synthpod.sink_max.urid);
+ ref = lv2_atom_forge_key(&handle->forge, SYNTHPOD__sinkMaximum);
if(ref)
ref = lv2_atom_forge_double(&handle->forge, automation->d);
if(ref)
- ref = lv2_atom_forge_key(&handle->forge, handle->regs.synthpod.source_enabled.urid);
+ ref = lv2_atom_forge_key(&handle->forge, SYNTHPOD__sourceEnabled);
if(ref)
ref = lv2_atom_forge_bool(&handle->forge, automation->src_enabled);
if(ref)
- ref = lv2_atom_forge_key(&handle->forge, handle->regs.synthpod.sink_enabled.urid);
+ ref = lv2_atom_forge_key(&handle->forge, SYNTHPOD__sinkEnabled);
if(ref)
ref = lv2_atom_forge_bool(&handle->forge, automation->snk_enabled);
if(ref)
- ref = lv2_atom_forge_key(&handle->forge, handle->regs.synthpod.learning.urid);
+ ref = lv2_atom_forge_key(&handle->forge, SYNTHPOD__learning);
if(ref)
ref = lv2_atom_forge_bool(&handle->forge, automation->learning);
@@ -1504,42 +1507,42 @@ static LV2_Atom_Forge_Ref
_patch_osc_automation_internal(plughandle_t *handle, auto_t *automation)
{
DBG;
- LV2_Atom_Forge_Ref ref = lv2_atom_forge_key(&handle->forge, handle->regs.osc.path.urid);
+ LV2_Atom_Forge_Ref ref = lv2_atom_forge_key(&handle->forge, OSC__messagePath);
if(ref)
ref = lv2_atom_forge_string(&handle->forge, automation->osc.path, strlen(automation->osc.path));
if(ref)
- ref = lv2_atom_forge_key(&handle->forge, handle->regs.synthpod.source_min.urid);
+ ref = lv2_atom_forge_key(&handle->forge, SYNTHPOD__sourceMinimum);
if(ref)
ref = lv2_atom_forge_double(&handle->forge, automation->osc.a);
if(ref)
- ref = lv2_atom_forge_key(&handle->forge, handle->regs.synthpod.source_max.urid);
+ ref = lv2_atom_forge_key(&handle->forge, SYNTHPOD__sourceMaximum);
if(ref)
ref = lv2_atom_forge_double(&handle->forge, automation->osc.b);
if(ref)
- ref = lv2_atom_forge_key(&handle->forge, handle->regs.synthpod.sink_min.urid);
+ ref = lv2_atom_forge_key(&handle->forge, SYNTHPOD__sinkMinimum);
if(ref)
ref = lv2_atom_forge_double(&handle->forge, automation->c);
if(ref)
- ref = lv2_atom_forge_key(&handle->forge, handle->regs.synthpod.sink_max.urid);
+ ref = lv2_atom_forge_key(&handle->forge, SYNTHPOD__sinkMaximum);
if(ref)
ref = lv2_atom_forge_double(&handle->forge, automation->d);
if(ref)
- ref = lv2_atom_forge_key(&handle->forge, handle->regs.synthpod.source_enabled.urid);
+ ref = lv2_atom_forge_key(&handle->forge, SYNTHPOD__sourceEnabled);
if(ref)
ref = lv2_atom_forge_bool(&handle->forge, automation->src_enabled);
if(ref)
- ref = lv2_atom_forge_key(&handle->forge, handle->regs.synthpod.sink_enabled.urid);
+ ref = lv2_atom_forge_key(&handle->forge, SYNTHPOD__sinkEnabled);
if(ref)
ref = lv2_atom_forge_bool(&handle->forge, automation->snk_enabled);
if(ref)
- ref = lv2_atom_forge_key(&handle->forge, handle->regs.synthpod.learning.urid);
+ ref = lv2_atom_forge_key(&handle->forge, SYNTHPOD__learning);
if(ref)
ref = lv2_atom_forge_bool(&handle->forge, automation->learning);
@@ -1554,9 +1557,9 @@ _patch_port_midi_automation_add(plughandle_t *handle, port_t *source_port,
LV2_Atom_Forge_Frame frame [3];
if( _message_request(handle)
- && synthpod_patcher_add_object(&handle->regs, &handle->forge, &frame[0],
- 0, 0, handle->regs.synthpod.automation_list.urid) //TODO subject
- && lv2_atom_forge_object(&handle->forge, &frame[2], 0, handle->regs.midi.Controller.urid)
+ && synthpod_patcher_add_object(&handle->forge, &frame[0],
+ 0, 0, SYNTHPOD__automationList) //TODO subject
+ && lv2_atom_forge_object(&handle->forge, &frame[2], 0, MIDI__Controller)
&& _patch_port_automation_internal(handle, source_port)
&& _patch_midi_automation_internal(handle, automation) )
{
@@ -1572,8 +1575,8 @@ _patch_port_automation_remove(plughandle_t *handle, port_t *source_port)
LV2_Atom_Forge_Frame frame [3];
if( _message_request(handle)
- && synthpod_patcher_remove_object(&handle->regs, &handle->forge, &frame[0],
- 0, 0, handle->regs.synthpod.automation_list.urid) //TODO subject
+ && synthpod_patcher_remove_object(&handle->forge, &frame[0],
+ 0, 0, SYNTHPOD__automationList) //TODO subject
&& lv2_atom_forge_object(&handle->forge, &frame[2], 0, 0)
&& _patch_port_automation_internal(handle, source_port) )
{
@@ -1590,9 +1593,9 @@ _patch_port_osc_automation_add(plughandle_t *handle, port_t *source_port,
LV2_Atom_Forge_Frame frame [3];
if( _message_request(handle)
- && synthpod_patcher_add_object(&handle->regs, &handle->forge, &frame[0],
- 0, 0, handle->regs.synthpod.automation_list.urid) //TODO subject
- && lv2_atom_forge_object(&handle->forge, &frame[2], 0, handle->regs.osc.message.urid)
+ && synthpod_patcher_add_object(&handle->forge, &frame[0],
+ 0, 0, SYNTHPOD__automationList) //TODO subject
+ && lv2_atom_forge_object(&handle->forge, &frame[2], 0, OSC__Message)
&& _patch_port_automation_internal(handle, source_port)
&& _patch_osc_automation_internal(handle, automation) )
{
@@ -1605,17 +1608,17 @@ static inline double
_param_union_as_double(LV2_Atom_Forge *forge, LV2_URID range, param_union_t *pu)
{
DBG;
- if(range == forge->Bool)
+ if(range == ATOM__Bool)
return pu->b;
- else if(range == forge->Int)
+ else if(range == ATOM__Int)
return pu->i;
- else if(range == forge->Long)
+ else if(range == ATOM__Long)
return pu->h;
- else if(range == forge->Float)
+ else if(range == ATOM__Float)
return pu->f;
- else if(range == forge->Double)
+ else if(range == ATOM__Double)
return pu->d;
- else if(range == forge->URID)
+ else if(range == ATOM__URID)
return pu->u;
return 0.0;
@@ -1629,9 +1632,9 @@ _patch_param_midi_automation_add(plughandle_t *handle, param_t *source_param,
LV2_Atom_Forge_Frame frame [3];
if( _message_request(handle)
- && synthpod_patcher_add_object(&handle->regs, &handle->forge, &frame[0],
- 0, 0, handle->regs.synthpod.automation_list.urid) //TODO subject
- && lv2_atom_forge_object(&handle->forge, &frame[2], 0, handle->regs.midi.Controller.urid)
+ && synthpod_patcher_add_object(&handle->forge, &frame[0],
+ 0, 0, SYNTHPOD__automationList) //TODO subject
+ && lv2_atom_forge_object(&handle->forge, &frame[2], 0, MIDI__Controller)
&& _patch_param_automation_internal(handle, source_param)
&& _patch_midi_automation_internal(handle, automation) )
{
@@ -1648,9 +1651,9 @@ _patch_param_osc_automation_add(plughandle_t *handle, param_t *source_param,
LV2_Atom_Forge_Frame frame [3];
if( _message_request(handle)
- && synthpod_patcher_add_object(&handle->regs, &handle->forge, &frame[0],
- 0, 0, handle->regs.synthpod.automation_list.urid) //TODO subject
- && lv2_atom_forge_object(&handle->forge, &frame[2], 0, handle->regs.osc.message.urid)
+ && synthpod_patcher_add_object(&handle->forge, &frame[0],
+ 0, 0, SYNTHPOD__automationList) //TODO subject
+ && lv2_atom_forge_object(&handle->forge, &frame[2], 0, OSC__Message)
&& _patch_param_automation_internal(handle, source_param)
&& _patch_osc_automation_internal(handle, automation) )
{
@@ -1666,8 +1669,8 @@ _patch_param_automation_remove(plughandle_t *handle, param_t *source_param)
LV2_Atom_Forge_Frame frame [3];
if( _message_request(handle)
- && synthpod_patcher_remove_object(&handle->regs, &handle->forge, &frame[0],
- 0, 0, handle->regs.synthpod.automation_list.urid) //TODO subject
+ && synthpod_patcher_remove_object(&handle->forge, &frame[0],
+ 0, 0, SYNTHPOD__automationList) //TODO subject
&& lv2_atom_forge_object(&handle->forge, &frame[2], 0, 0)
&& _patch_param_automation_internal(handle, source_param) )
{
@@ -1902,17 +1905,17 @@ static void
_param_update_span(plughandle_t *handle, param_t *param)
{
DBG;
- if(param->range == handle->forge.Int)
+ if(param->range == ATOM__Int)
param->span.i = param->max.i - param->min.i;
- else if(param->range == handle->forge.Bool)
+ else if(param->range == ATOM__Bool)
param->span.i = param->max.i - param->min.i;
- else if(param->range == handle->forge.Long)
+ else if(param->range == ATOM__Long)
param->span.h = param->max.h - param->min.h;
- else if(param->range == handle->forge.Float)
+ else if(param->range == ATOM__Float)
param->span.f = param->max.f - param->min.f;
- else if(param->range == handle->forge.Double)
+ else if(param->range == ATOM__Double)
param->span.d = param->max.d - param->min.d;
- else if(param->range == handle->forge.URID)
+ else if(param->range == ATOM__URID)
param->span.u = UINT32_MAX;
//FIXME more types
}
@@ -1981,7 +1984,7 @@ _unit_symbol_obj(plughandle_t *handle, LilvNode *units_unit)
DBG;
char *symbol = NULL;
- LilvNode *units_symbol = lilv_world_get(handle->world, units_unit, handle->regs.units.symbol.node, NULL);
+ LilvNode *units_symbol = lilv_world_get(handle->world, units_unit, NODE(UNITS__symbol), NULL);
if(units_symbol)
{
if(lilv_node_is_string(units_symbol))
@@ -2020,10 +2023,10 @@ _param_fill(plughandle_t *handle, param_t *param, const LilvNode *param_node)
if(range)
{
param->range = handle->map->map(handle->map->handle, lilv_node_as_uri(range));
- if( (param->range == handle->forge.String)
- || (param->range == handle->forge.Path)
- || (param->range == handle->forge.URI)
- || (param->range == handle->forge.URID) )
+ if( (param->range == ATOM__String)
+ || (param->range == ATOM__Path)
+ || (param->range == ATOM__URI)
+ || (param->range == ATOM__URID) )
{
nk_textedit_init_default(&param->val.editor);
}
@@ -2032,7 +2035,7 @@ _param_fill(plughandle_t *handle, param_t *param, const LilvNode *param_node)
if(param->range)
{
- if(param->range == handle->forge.Bool)
+ if(param->range == ATOM__Bool)
{
param->min.b = 0;
param->max.b = 1;
@@ -2041,41 +2044,67 @@ _param_fill(plughandle_t *handle, param_t *param, const LilvNode *param_node)
LilvNode *min = lilv_world_get(handle->world, param_node, handle->node.lv2_minimum, NULL);
if(min)
{
- if(param->range == handle->forge.Int)
+ if(param->range == ATOM__Int)
param->min.i = _node_as_int(min, 0);
- else if(param->range == handle->forge.Bool)
+ else if(param->range == ATOM__Bool)
param->min.i = _node_as_bool(min, false);
- else if(param->range == handle->forge.Long)
+ else if(param->range == ATOM__Long)
param->min.h = _node_as_long(min, 0);
- else if(param->range == handle->forge.Float)
+ else if(param->range == ATOM__Float)
param->min.f = _node_as_float(min, 0.f);
- else if(param->range == handle->forge.Double)
+ else if(param->range == ATOM__Double)
param->min.d = _node_as_double(min, 0.0);
//FIXME
lilv_node_free(min);
}
+ else
+ {
+ if(param->range == ATOM__Int)
+ param->min.i = 0;
+ else if(param->range == ATOM__Bool)
+ param->min.i = false;
+ else if(param->range == ATOM__Long)
+ param->min.h = 0;
+ else if(param->range == ATOM__Float)
+ param->min.f = 0.f;
+ else if(param->range == ATOM__Double)
+ param->min.d = 0.0;
+ }
LilvNode *max = lilv_world_get(handle->world, param_node, handle->node.lv2_maximum, NULL);
if(max)
{
- if(param->range == handle->forge.Int)
+ if(param->range == ATOM__Int)
param->max.i = _node_as_int(max, 1);
- else if(param->range == handle->forge.Bool)
+ else if(param->range == ATOM__Bool)
param->max.i = _node_as_bool(max, true);
- else if(param->range == handle->forge.Long)
+ else if(param->range == ATOM__Long)
param->max.h = _node_as_long(max, 1);
- else if(param->range == handle->forge.Float)
+ else if(param->range == ATOM__Float)
param->max.f = _node_as_float(max, 1.f);
- else if(param->range == handle->forge.Double)
+ else if(param->range == ATOM__Double)
param->max.d = _node_as_double(max, 1.0);
//FIXME
lilv_node_free(max);
}
+ else
+ {
+ if(param->range == ATOM__Int)
+ param->max.i = 1;
+ else if(param->range == ATOM__Bool)
+ param->max.i = true;
+ else if(param->range == ATOM__Long)
+ param->max.h = 1;
+ else if(param->range == ATOM__Float)
+ param->max.f = 1.f;
+ else if(param->range == ATOM__Double)
+ param->max.d = 1.0;
+ }
_param_update_span(handle, param);
}
- LilvNode *label = lilv_world_get(handle->world, param_node, handle->regs.rdfs.label.node, NULL);
+ LilvNode *label = lilv_world_get(handle->world, param_node, NODE(RDFS__label), NULL);
if(label)
{
if(lilv_node_is_string(label))
@@ -2083,7 +2112,7 @@ _param_fill(plughandle_t *handle, param_t *param, const LilvNode *param_node)
lilv_node_free(label);
}
- LilvNode *comment = lilv_world_get(handle->world, param_node, handle->regs.rdfs.comment.node, NULL);
+ LilvNode *comment = lilv_world_get(handle->world, param_node, NODE(RDFS__comment), NULL);
if(comment)
{
if(lilv_node_is_string(comment))
@@ -2091,14 +2120,14 @@ _param_fill(plughandle_t *handle, param_t *param, const LilvNode *param_node)
lilv_node_free(comment);
}
- LilvNode *units_unit = lilv_world_get(handle->world, param_node, handle->regs.units.unit.node, NULL);
+ LilvNode *units_unit = lilv_world_get(handle->world, param_node, NODE(UNITS__unit), NULL);
if(units_unit)
{
if(lilv_node_is_uri(units_unit))
{
param->units_symbol = _unit_symbol(handle, lilv_node_as_uri(units_unit));
}
- else if(lilv_world_ask(handle->world, units_unit, handle->regs.rdf.type.node, handle->regs.units.Unit.node))
+ else if(lilv_world_ask(handle->world, units_unit, NODE(RDF__type), NODE(UNITS__Unit)))
{
param->units_symbol = _unit_symbol_obj(handle, units_unit);
}
@@ -2106,30 +2135,32 @@ _param_fill(plughandle_t *handle, param_t *param, const LilvNode *param_node)
lilv_node_free(units_unit);
}
- LilvNodes *param_properties = lilv_world_find_nodes(handle->world, param_node, handle->regs.parameter.property.node, NULL);
+ LilvNodes *param_properties = lilv_world_find_nodes(handle->world, param_node,
+ NODE(CORE__parameterProperty), NULL);
if(param_properties)
{
LILV_FOREACH(nodes, i, param_properties)
{
const LilvNode *param_property = lilv_nodes_get(param_properties, i);
- if(lilv_node_equals(param_property, handle->regs.port.is_bitmask.node))
+ if(lilv_node_equals(param_property, NODE(CORE__isBitmask)))
param->is_bitmask = true;
- else if(lilv_node_equals(param_property, handle->regs.port.logarithmic.node))
+ else if(lilv_node_equals(param_property, NODE(PORT_PROPS__logarithmic)))
param->is_logarithmic = true;
}
lilv_nodes_free(param_properties);
}
- LilvNodes *lv2_scale_points = lilv_world_find_nodes(handle->world, param_node, handle->regs.core.scale_point.node, NULL);
+ LilvNodes *lv2_scale_points = lilv_world_find_nodes(handle->world, param_node,
+ NODE(CORE__scalePoint), NULL);
if(lv2_scale_points)
{
LILV_FOREACH(nodes, i, lv2_scale_points)
{
const LilvNode *port_point = lilv_nodes_get(lv2_scale_points, i);
- LilvNode *label_node = lilv_world_get(handle->world, port_point, handle->regs.rdfs.label.node, NULL);
- LilvNode *value_node = lilv_world_get(handle->world, port_point, handle->regs.rdf.value.node, NULL);
+ LilvNode *label_node = lilv_world_get(handle->world, port_point, NODE(RDFS__label), NULL);
+ LilvNode *value_node = lilv_world_get(handle->world, port_point, NODE(RDF__value), NULL);
if(label_node && value_node)
{
@@ -2141,23 +2172,23 @@ _param_fill(plughandle_t *handle, param_t *param, const LilvNode *param_node)
point->label = strdup(lilv_node_as_string(label_node));
- if(param->range == handle->forge.Int)
+ if(param->range == ATOM__Int)
{
point->val.i = _node_as_int(value_node, 0);
}
- else if(param->range == handle->forge.Long)
+ else if(param->range == ATOM__Long)
{
point->val.h = _node_as_long(value_node, 0);
}
- else if(param->range == handle->forge.Bool)
+ else if(param->range == ATOM__Bool)
{
point->val.i = _node_as_bool(value_node, false);
}
- else if(param->range == handle->forge.Float)
+ else if(param->range == ATOM__Float)
{
point->val.f = _node_as_float(value_node, 0.f);
}
- else if(param->range == handle->forge.Double)
+ else if(param->range == ATOM__Double)
{
point->val.d = _node_as_double(value_node, 0.0);
}
@@ -2197,18 +2228,18 @@ static void
_param_free(plughandle_t *handle, param_t *param)
{
DBG;
- if( (param->range == handle->forge.String)
- || (param->range == handle->forge.Path)
- || (param->range == handle->forge.URI)
- || (param->range == handle->forge.URID) )
+ if( (param->range == ATOM__String)
+ || (param->range == ATOM__Path)
+ || (param->range == ATOM__URI)
+ || (param->range == ATOM__URID) )
{
nk_textedit_free(&param->val.editor);
}
- else if(param->range == handle->forge.Chunk)
+ else if(param->range == ATOM__Chunk)
{
free(param->val.chunk.body);
}
- else if(param->range == handle->forge.Tuple)
+ else if(param->range == ATOM__Tuple)
{
#if defined(USE_CAIRO_CANVAS)
if(param->property == handle->canvas.urid.Canvas_graph)
@@ -2371,7 +2402,7 @@ _param_matches_type(plughandle_t *handle, param_t *param, LV2_URID type)
if(!param)
return false;
- if( (param->range + type) == (handle->forge.Int + handle->forge.Bool) )
+ if( (param->range + type) == (ATOM__Int + ATOM__Bool) )
return true;
return (param->range == type);
@@ -2382,56 +2413,56 @@ _param_set_value(plughandle_t *handle, mod_t *mod, param_t *param,
const LV2_Atom *value)
{
DBG;
- if(param->range == handle->forge.Int)
+ if(param->range == ATOM__Int)
{
param->val.i = ((const LV2_Atom_Int *)value)->body;
}
- else if(param->range == handle->forge.Bool)
+ else if(param->range == ATOM__Bool)
{
param->val.i = ((const LV2_Atom_Bool *)value)->body;
}
- else if(param->range == handle->forge.Long)
+ else if(param->range == ATOM__Long)
{
param->val.h = ((const LV2_Atom_Long *)value)->body;
}
- else if(param->range == handle->forge.Float)
+ else if(param->range == ATOM__Float)
{
param->val.f = ((const LV2_Atom_Float *)value)->body;
}
- else if(param->range == handle->forge.Double)
+ else if(param->range == ATOM__Double)
{
param->val.d = ((const LV2_Atom_Double *)value)->body;
}
- else if(param->range == handle->forge.String)
+ else if(param->range == ATOM__String)
{
struct nk_str *str = &param->val.editor.string;
_set_string(str, value->size, LV2_ATOM_BODY_CONST(value));
}
- else if(param->range == handle->forge.Path)
+ else if(param->range == ATOM__Path)
{
struct nk_str *str = &param->val.editor.string;
_set_string(str, value->size, LV2_ATOM_BODY_CONST(value));
}
- else if(param->range == handle->forge.URI)
+ else if(param->range == ATOM__URI)
{
struct nk_str *str = &param->val.editor.string;
_set_string(str, value->size, LV2_ATOM_BODY_CONST(value));
}
- else if(param->range == handle->forge.URID)
+ else if(param->range == ATOM__URID)
{
struct nk_str *str = &param->val.editor.string;
const LV2_URID urid = ((const LV2_Atom_URID *)value)->body;
const char *uri = handle->unmap->unmap(handle->unmap->handle, urid);
_set_string(str, strlen(uri) + 1, uri);
}
- else if(param->range == handle->forge.Chunk)
+ else if(param->range == ATOM__Chunk)
{
param->val.chunk.size = value->size;
param->val.chunk.body = realloc(param->val.chunk.body, value->size);
if(param->val.chunk.body)
memcpy(param->val.chunk.body, LV2_ATOM_BODY_CONST(value), value->size);
}
- else if(param->range == handle->forge.Tuple)
+ else if(param->range == ATOM__Tuple)
{
#if defined(USE_CAIRO_CANVAS)
if(param->property == handle->canvas.urid.Canvas_graph)
@@ -2496,8 +2527,8 @@ _mod_nk_write_function(plughandle_t *handle, mod_t *src_mod, port_t *src_port,
uint32_t src_proto, const LV2_Atom *src_value, bool route_to_ui)
{
DBG;
- if( (src_proto == handle->regs.port.float_protocol.urid)
- && (src_value->type == handle->forge.Float)
+ if( (src_proto == UI__floatProtocol)
+ && (src_value->type == ATOM__Float)
&& (src_port->type & PROPERTY_TYPE_CONTROL) )
{
control_port_t *control = &src_port->control;
@@ -2513,8 +2544,8 @@ _mod_nk_write_function(plughandle_t *handle, mod_t *src_mod, port_t *src_port,
_mod_uis_send(src_mod, src_port->index, sizeof(float), 0, &f32);
}
}
- else if( (src_proto == handle->regs.port.peak_protocol.urid)
- && (src_value->type == handle->forge.Tuple)
+ else if( (src_proto == UI__peakProtocol)
+ && (src_value->type == ATOM__Tuple)
&& (src_port->type & PROPERTY_TYPE_AUDIO || src_port->type & PROPERTY_TYPE_CV) )
{
const LV2_Atom_Tuple *tup = (const LV2_Atom_Tuple *)src_value;
@@ -2535,17 +2566,17 @@ _mod_nk_write_function(plughandle_t *handle, mod_t *src_mod, port_t *src_port,
};
_mod_uis_send(src_mod, src_port->index, sizeof(LV2UI_Peak_Data),
- handle->regs.port.peak_protocol.urid, &pdata);
+ UI__peakProtocol, &pdata);
}
}
- else if( (src_proto == handle->regs.port.event_transfer.urid)
+ else if( (src_proto == ATOM__eventTransfer)
&& (src_port->type & PROPERTY_TYPE_ATOM) )
{
const LV2_Atom_Object *pobj = (const LV2_Atom_Object *)src_value;
- if(pobj->atom.type == handle->forge.Object)
+ if(pobj->atom.type == ATOM__Object)
{
- if(pobj->body.otype == handle->regs.patch.set.urid)
+ if(pobj->body.otype == PATCH__Set)
{
//printf("got patch:Set notification\n");
const LV2_Atom_URID *subject = NULL;
@@ -2553,15 +2584,15 @@ _mod_nk_write_function(plughandle_t *handle, mod_t *src_mod, port_t *src_port,
const LV2_Atom *value = NULL;
lv2_atom_object_get(pobj,
- handle->regs.patch.subject.urid, &subject,
- handle->regs.patch.property.urid, &property,
- handle->regs.patch.value.urid, &value,
+ PATCH__subject, &subject,
+ PATCH__property, &property,
+ PATCH__value, &value,
0);
- const LV2_URID subj = subject && (subject->atom.type == handle->forge.URID)
+ const LV2_URID subj = subject && (subject->atom.type == ATOM__URID)
? subject->body
: 0;
- const LV2_URID prop = property && (property->atom.type == handle->forge.URID)
+ const LV2_URID prop = property && (property->atom.type == ATOM__URID)
? property->body
: 0;
@@ -2574,18 +2605,18 @@ _mod_nk_write_function(plughandle_t *handle, mod_t *src_mod, port_t *src_port,
}
}
}
- else if(pobj->body.otype == handle->regs.patch.put.urid)
+ else if(pobj->body.otype == PATCH__Put)
{
//printf("got patch:Put notification\n");
const LV2_Atom_URID *subject = NULL;
const LV2_Atom_Object *body = NULL;
lv2_atom_object_get(pobj,
- handle->regs.patch.subject.urid, &subject,
- handle->regs.patch.body.urid, &body,
+ PATCH__subject, &subject,
+ PATCH__body, &body,
0);
- const LV2_URID subj = subject && (subject->atom.type == handle->forge.URID)
+ const LV2_URID subj = subject && (subject->atom.type == ATOM__URID)
? subject->body
: 0;
@@ -2598,7 +2629,7 @@ _mod_nk_write_function(plughandle_t *handle, mod_t *src_mod, port_t *src_port,
}
}
}
- else if(pobj->body.otype == handle->regs.patch.patch.urid)
+ else if(pobj->body.otype == PATCH__Patch)
{
//printf("got patch:Patch notification\n");
const LV2_Atom_URID *subject = NULL;
@@ -2606,26 +2637,26 @@ _mod_nk_write_function(plughandle_t *handle, mod_t *src_mod, port_t *src_port,
const LV2_Atom_Object *add = NULL;
lv2_atom_object_get(pobj,
- handle->regs.patch.subject.urid, &subject,
- handle->regs.patch.remove.urid, &rem,
- handle->regs.patch.add.urid, &add,
+ PATCH__subject, &subject,
+ PATCH__remove, &rem,
+ PATCH__add, &add,
0);
- const LV2_URID subj = subject && (subject->atom.type == handle->forge.URID)
+ const LV2_URID subj = subject && (subject->atom.type == ATOM__URID)
? subject->body
: 0;
- if( rem && (rem->atom.type == handle->forge.Object)
- && add && (add->atom.type == handle->forge.Object) )
+ if( rem && (rem->atom.type == ATOM__Object)
+ && add && (add->atom.type == ATOM__Object) )
{
LV2_ATOM_OBJECT_FOREACH(rem, prop)
{
- if( (prop->key == handle->regs.patch.writable.urid)
- && (prop->value.type == handle->forge.URID) )
+ if( (prop->key == PATCH__writable)
+ && (prop->value.type == ATOM__URID) )
{
const LV2_URID property = ((const LV2_Atom_URID *)&prop->value)->body;
- if(property == handle->regs.patch.wildcard.urid)
+ if(property == PATCH__wildcard)
{
HASH_FREE(&src_mod->dynams, param_ptr)
{
@@ -2643,12 +2674,12 @@ _mod_nk_write_function(plughandle_t *handle, mod_t *src_mod, port_t *src_port,
}
}
}
- else if( (prop->key == handle->regs.patch.readable.urid)
- && (prop->value.type == handle->forge.URID) )
+ else if( (prop->key == PATCH__readable)
+ && (prop->value.type == ATOM__URID) )
{
const LV2_URID property = ((const LV2_Atom_URID *)&prop->value)->body;
- if(property == handle->regs.patch.wildcard.urid)
+ if(property == PATCH__wildcard)
{
HASH_FREE(&src_mod->dynams, param_ptr)
{
@@ -2671,33 +2702,33 @@ _mod_nk_write_function(plughandle_t *handle, mod_t *src_mod, port_t *src_port,
param_t *param = _mod_dynam_find_by_property(src_mod, subj);
if(param)
{
- if(prop->key == handle->regs.rdfs.range.urid)
+ if(prop->key == RDFS__range)
{
param->range = 0;
}
- else if(prop->key == handle->regs.rdfs.label.urid)
+ else if(prop->key == RDFS__label)
{
free(param->label);
param->label = NULL;
}
- else if(prop->key == handle->regs.rdfs.comment.urid)
+ else if(prop->key == RDFS__comment)
{
free(param->comment);
param->comment= NULL;
}
- else if(prop->key == handle->regs.core.minimum.urid)
+ else if(prop->key == CORE__minimum)
{
param->min.i = 0;
}
- else if(prop->key == handle->regs.core.maximum.urid)
+ else if(prop->key == CORE__maximum)
{
param->max.i = 0;
}
- else if(prop->key == handle->regs.units.unit.urid)
+ else if(prop->key == UNITS__unit)
{
//FIXME
}
- else if(prop->key == handle->regs.units.symbol.urid)
+ else if(prop->key == UNITS__symbol)
{
free(param->units_symbol);
param->units_symbol = NULL;
@@ -2708,8 +2739,8 @@ _mod_nk_write_function(plughandle_t *handle, mod_t *src_mod, port_t *src_port,
LV2_ATOM_OBJECT_FOREACH(add, prop)
{
- if( (prop->key == handle->regs.patch.writable.urid)
- && (prop->value.type == handle->forge.URID) )
+ if( (prop->key == PATCH__writable)
+ && (prop->value.type == ATOM__URID) )
{
const LV2_URID property = ((const LV2_Atom_URID *)&prop->value)->body;
@@ -2722,11 +2753,11 @@ _mod_nk_write_function(plughandle_t *handle, mod_t *src_mod, port_t *src_port,
// patch:Get [patch:property property]
_patch_notification_add_patch_get(handle, src_mod,
- handle->regs.port.event_transfer.urid, src_mod->subj, 0, property);
+ ATOM__eventTransfer, src_mod->subj, 0, property);
}
}
- else if( (prop->key == handle->regs.patch.readable.urid)
- && (prop->value.type == handle->forge.URID) )
+ else if( (prop->key == PATCH__readable)
+ && (prop->value.type == ATOM__URID) )
{
const LV2_URID property = ((const LV2_Atom_URID *)&prop->value)->body;
@@ -2739,7 +2770,7 @@ _mod_nk_write_function(plughandle_t *handle, mod_t *src_mod, port_t *src_port,
// patch:Get [patch:property property]
_patch_notification_add_patch_get(handle, src_mod,
- handle->regs.port.event_transfer.urid, src_mod->subj, 0, property);
+ ATOM__eventTransfer, src_mod->subj, 0, property);
}
}
else if(subj)
@@ -2747,24 +2778,24 @@ _mod_nk_write_function(plughandle_t *handle, mod_t *src_mod, port_t *src_port,
param_t *param = _mod_dynam_find_by_property(src_mod, subj);
if(param)
{
- if( (prop->key == handle->regs.rdfs.range.urid)
- && (prop->value.type == handle->forge.URID) )
+ if( (prop->key == RDFS__range)
+ && (prop->value.type == ATOM__URID) )
{
param->range = ((const LV2_Atom_URID *)&prop->value)->body;
- if( (param->range == handle->forge.String)
- || (param->range == handle->forge.URI)
- || (param->range == handle->forge.URID) )
+ if( (param->range == ATOM__String)
+ || (param->range == ATOM__URI)
+ || (param->range == ATOM__URID) )
{
nk_textedit_init_default(&param->val.editor);
}
- else if(param->range == handle->forge.Bool)
+ else if(param->range == ATOM__Bool)
{
param->min.b = 0;
param->min.b = 1;
}
}
- else if( (prop->key == handle->regs.rdfs.label.urid)
- && (prop->value.type == handle->forge.String) )
+ else if( (prop->key == RDFS__label)
+ && (prop->value.type == ATOM__String) )
{
free(param->label);
param->label = strdup(LV2_ATOM_BODY_CONST(&prop->value));
@@ -2772,61 +2803,61 @@ _mod_nk_write_function(plughandle_t *handle, mod_t *src_mod, port_t *src_port,
_refresh_main_dynam_list(handle, src_mod);
_hash_sort(&src_mod->dynams, _sort_param_name);
}
- else if( (prop->key == handle->regs.rdfs.comment.urid)
- && (prop->value.type == handle->forge.String) )
+ else if( (prop->key == RDFS__comment)
+ && (prop->value.type == ATOM__String) )
{
free(param->comment);
param->comment = strdup(LV2_ATOM_BODY_CONST(&prop->value));
}
- else if( (prop->key == handle->regs.core.minimum.urid)
+ else if( (prop->key == CORE__minimum)
&& (prop->value.type == param->range) )
{
- if(param->range == handle->forge.Int)
+ if(param->range == ATOM__Int)
param->min.i = ((const LV2_Atom_Int *)&prop->value)->body;
- else if(param->range == handle->forge.Bool)
+ else if(param->range == ATOM__Bool)
param->min.i = ((const LV2_Atom_Bool *)&prop->value)->body;
- else if(param->range == handle->forge.Long)
+ else if(param->range == ATOM__Long)
param->min.h = ((const LV2_Atom_Long *)&prop->value)->body;
- else if(param->range == handle->forge.Float)
+ else if(param->range == ATOM__Float)
param->min.f = ((const LV2_Atom_Float *)&prop->value)->body;
- else if(param->range == handle->forge.Double)
+ else if(param->range == ATOM__Double)
param->min.d = ((const LV2_Atom_Double *)&prop->value)->body;
//FIXME support more types
_param_update_span(handle, param);
}
- else if( (prop->key == handle->regs.core.maximum.urid)
+ else if( (prop->key == CORE__maximum)
&& (prop->value.type == param->range) )
{
- if(param->range == handle->forge.Int)
+ if(param->range == ATOM__Int)
param->max.i = ((const LV2_Atom_Int *)&prop->value)->body;
- else if(param->range == handle->forge.Bool)
+ else if(param->range == ATOM__Bool)
param->max.i = ((const LV2_Atom_Bool *)&prop->value)->body;
- else if(param->range == handle->forge.Long)
+ else if(param->range == ATOM__Long)
param->max.h = ((const LV2_Atom_Long *)&prop->value)->body;
- else if(param->range == handle->forge.Float)
+ else if(param->range == ATOM__Float)
param->max.f = ((const LV2_Atom_Float *)&prop->value)->body;
- else if(param->range == handle->forge.Double)
+ else if(param->range == ATOM__Double)
param->max.d = ((const LV2_Atom_Double *)&prop->value)->body;
//FIXME support more types
_param_update_span(handle, param);
}
- else if( (prop->key == handle->regs.units.unit.urid)
- && (prop->value.type == handle->forge.URID) )
+ else if( (prop->key == UNITS__unit)
+ && (prop->value.type == ATOM__URID) )
{
const LV2_URID units_unit = ((const LV2_Atom_URID *)&prop->value)->body;
param->units_symbol = _unit_symbol(handle,
handle->unmap->unmap(handle->unmap->handle, units_unit));
}
- else if( (prop->key == handle->regs.units.symbol.urid)
- && (prop->value.type == handle->forge.String) )
+ else if( (prop->key == UNITS__symbol)
+ && (prop->value.type == ATOM__String) )
{
free(param->units_symbol);
param->units_symbol = strdup(LV2_ATOM_BODY_CONST(&prop->value));
}
- else if( (prop->key == handle->regs.core.scale_point.urid)
- && (prop->value.type == handle->forge.Tuple) )
+ else if( (prop->key == CORE__scalePoint)
+ && (prop->value.type == ATOM__Tuple) )
{
const LV2_Atom_Tuple *tup = (const LV2_Atom_Tuple *)&prop->value;
@@ -2840,11 +2871,11 @@ _mod_nk_write_function(plughandle_t *handle, mod_t *src_mod, port_t *src_port,
const LV2_Atom *value = NULL;
lv2_atom_object_get(obj,
- handle->regs.rdfs.label.urid, &label,
- handle->regs.rdf.value.urid, &value,
+ RDFS__label, &label,
+ RDF__value, &value,
NULL);
- if( !label || (label->type != handle->forge.String)
+ if( !label || (label->type != ATOM__String)
|| !value || (value->type != param->range) )
continue;
@@ -2856,13 +2887,13 @@ _mod_nk_write_function(plughandle_t *handle, mod_t *src_mod, port_t *src_port,
point->label = strdup(LV2_ATOM_BODY_CONST(label));
- if(param->range == handle->forge.Bool)
+ if(param->range == ATOM__Bool)
point->val.i = ((const LV2_Atom_Bool *)value)->body;
- else if(param->range == handle->forge.Int)
+ else if(param->range == ATOM__Int)
point->val.i = ((const LV2_Atom_Int *)value)->body;
- else if(param->range == handle->forge.Float)
+ else if(param->range == ATOM__Float)
point->val.f = ((const LV2_Atom_Float *)value)->body;
- else if(param->range == handle->forge.Double)
+ else if(param->range == ATOM__Double)
point->val.d = ((const LV2_Atom_Double *)value)->body;
//FIXME support more types
}
@@ -2879,10 +2910,10 @@ _mod_nk_write_function(plughandle_t *handle, mod_t *src_mod, port_t *src_port,
if(route_to_ui)
{
_mod_uis_send(src_mod, src_port->index, lv2_atom_total_size(src_value),
- handle->regs.port.event_transfer.urid, src_value);
+ ATOM__eventTransfer, src_value);
}
}
- else if( (src_proto == handle->regs.port.atom_transfer.urid)
+ else if( (src_proto == ATOM__atomTransfer)
&& (src_port->type & PROPERTY_TYPE_ATOM) )
{
//FIXME rarely (never) sent by any plugin
@@ -2890,7 +2921,7 @@ _mod_nk_write_function(plughandle_t *handle, mod_t *src_mod, port_t *src_port,
if(route_to_ui)
{
_mod_uis_send(src_mod, src_port->index, lv2_atom_total_size(src_value),
- handle->regs.port.atom_transfer.urid, src_value);
+ ATOM__atomTransfer, src_value);
}
}
@@ -2907,31 +2938,31 @@ _mod_ui_write_function(LV2UI_Controller controller, uint32_t index,
plughandle_t *handle = mod->handle;
if(protocol == 0)
- protocol = handle->regs.port.float_protocol.urid;
+ protocol = UI__floatProtocol;
//printf("_mod_ui_write_function: %u %u %u\n", index, size, protocol);
port_t *port = _mod_port_find_by_index(mod, index);
if(port)
{
- if(protocol == handle->regs.port.float_protocol.urid)
+ if(protocol == UI__floatProtocol)
{
// route to dsp
_patch_notification_add(handle, port, protocol,
- sizeof(float), handle->forge.Float, buffer);
+ sizeof(float), ATOM__Float, buffer);
// route to nk
const LV2_Atom_Float flt = {
.atom = {
.size = sizeof(float),
- .type = handle->forge.Float
+ .type = ATOM__Float
},
.body = *(const float *)buffer
};
_mod_nk_write_function(handle, mod, port, protocol, &flt.atom, false);
}
- else if( (protocol == handle->regs.port.event_transfer.urid)
- || (protocol == handle->regs.port.atom_transfer.urid) )
+ else if( (protocol == ATOM__eventTransfer)
+ || (protocol == ATOM__atomTransfer) )
{
const LV2_Atom *atom = buffer;
@@ -2975,19 +3006,20 @@ _mod_ui_add(plughandle_t *handle, mod_t *mod, const LilvUI *ui, bool threaded)
lilv_world_load_resource(handle->world, ui_node);
bool supported = false;
- if(handle->supports_x11 && lilv_ui_is_a(ui, handle->regs.ui.x11.node))
+ if(handle->supports_x11 && lilv_ui_is_a(ui, NODE(UI__X11UI)))
supported = true;
- else if(handle->supports_gtk2 && lilv_ui_is_a(ui, handle->regs.ui.gtk2.node))
+ else if(handle->supports_gtk2 && lilv_ui_is_a(ui, NODE(UI__GtkUI)))
supported = true;
- else if(handle->supports_gtk3 && lilv_ui_is_a(ui, handle->regs.ui.gtk3.node))
+ else if(handle->supports_gtk3 && lilv_ui_is_a(ui, NODE(UI__Gtk3UI)))
supported = true;
- else if(handle->supports_qt4 && lilv_ui_is_a(ui, handle->regs.ui.qt4.node))
+ else if(handle->supports_qt4 && lilv_ui_is_a(ui, NODE(UI__Qt4UI)))
supported = true;
- else if(handle->supports_qt5 && lilv_ui_is_a(ui, handle->regs.ui.qt5.node))
+ else if(handle->supports_qt5 && lilv_ui_is_a(ui, NODE(UI__Qt5UI)))
supported = true;
- else if(handle->supports_kx && lilv_ui_is_a(ui, handle->regs.ui.kx_widget.node))
+ else if(handle->supports_kx && lilv_ui_is_a(ui, NODE(EXTERNAL_UI__Widget)))
supported = true;
- else if(handle->supports_show && lilv_world_ask(handle->world, ui_node, handle->regs.core.extension_data.node, handle->regs.ui.show_interface.node))
+ else if(handle->supports_show && lilv_world_ask(handle->world, ui_node,
+ NODE(CORE__extensionData), NODE(UI__showInterface)))
supported = true;
if(!supported)
@@ -3112,31 +3144,32 @@ _mod_ui_run(mod_ui_t *mod_ui, bool sync)
const char *plugin_urn = handle->unmap->unmap(handle->unmap->handle, mod_ui->mod->urn);
const char *exec_uri = NULL;
- if(lilv_ui_is_a(ui, handle->regs.ui.x11.node))
+ if(lilv_ui_is_a(ui, NODE(UI__X11UI)))
{
exec_uri = "synthpod_sandbox_x11";
}
- else if(lilv_ui_is_a(ui, handle->regs.ui.gtk2.node))
+ else if(lilv_ui_is_a(ui, NODE(UI__GtkUI)))
{
exec_uri = "synthpod_sandbox_gtk2";
}
- else if(lilv_ui_is_a(ui, handle->regs.ui.gtk3.node))
+ else if(lilv_ui_is_a(ui, NODE(UI__Gtk3UI)))
{
exec_uri = "synthpod_sandbox_gtk3";
}
- else if(lilv_ui_is_a(ui, handle->regs.ui.qt4.node))
+ else if(lilv_ui_is_a(ui, NODE(UI__Qt4UI)))
{
exec_uri = "synthpod_sandbox_qt4";
}
- else if(lilv_ui_is_a(ui, handle->regs.ui.qt5.node))
+ else if(lilv_ui_is_a(ui, NODE(UI__Qt4UI)))
{
exec_uri = "synthpod_sandbox_qt5";
}
- else if(lilv_ui_is_a(ui, handle->regs.ui.kx_widget.node))
+ else if(lilv_ui_is_a(ui, NODE(EXTERNAL_UI__Widget)))
{
exec_uri = "synthpod_sandbox_kx";
}
- else if(lilv_world_ask(handle->world, ui_node, handle->regs.core.extension_data.node, handle->regs.ui.show_interface.node))
+ else if(lilv_world_ask(handle->world, ui_node,
+ NODE(CORE__extensionData), NODE(UI__showInterface)))
{
exec_uri = "synthpod_sandbox_show";
}
@@ -3226,14 +3259,14 @@ _mod_ui_run(mod_ui_t *mod_ui, bool sync)
_mod_subscribe_all(handle, mod);
_patch_notification_add_patch_get(handle, mod,
- handle->regs.port.event_transfer.urid, mod->subj, 0, 0); // patch:Get []
+ ATOM__eventTransfer, mod->subj, 0, 0); // patch:Get []
if(sync)
{
if( _message_request(handle)
- && synthpod_patcher_set(&handle->regs, &handle->forge,
- mod->urn, 0, handle->regs.ui.ui.urid,
- sizeof(uint32_t), handle->forge.URID, &mod_ui->urn) )
+ && synthpod_patcher_set(&handle->forge,
+ mod->urn, 0, UI__ui,
+ sizeof(uint32_t), ATOM__URID, &mod_ui->urn) )
{
_message_write(handle);
}
@@ -3288,9 +3321,9 @@ _mod_ui_stop(mod_ui_t *mod_ui, bool sync)
{
const uint32_t dummy = 0;
if( _message_request(handle)
- && synthpod_patcher_set(&handle->regs, &handle->forge, //FIXME or patcher_del ?
- mod->urn, 0, handle->regs.ui.ui.urid,
- sizeof(uint32_t), handle->forge.URID, &dummy) )
+ && synthpod_patcher_set(&handle->forge, //FIXME or patcher_del ?
+ mod->urn, 0, UI__ui,
+ sizeof(uint32_t), ATOM__URID, &dummy) )
{
_message_write(handle);
}
@@ -3471,9 +3504,9 @@ _patch_mod_add(plughandle_t *handle, const LilvPlugin *plug)
const LV2_URID urid = handle->map->map(handle->map->handle, uri);
if( _message_request(handle)
- && synthpod_patcher_add(&handle->regs, &handle->forge,
- 0, 0, handle->regs.synthpod.module_list.urid, //TODO subject
- sizeof(uint32_t), handle->forge.URID, &urid) )
+ && synthpod_patcher_add(&handle->forge,
+ 0, 0, SYNTHPOD__moduleList, //TODO subject
+ sizeof(uint32_t), ATOM__URID, &urid) )
{
_message_write(handle);
}
@@ -3484,9 +3517,9 @@ _patch_mod_remove(plughandle_t *handle, mod_t *mod)
{
DBG;
if( _message_request(handle)
- && synthpod_patcher_remove(&handle->regs, &handle->forge,
- 0, 0, handle->regs.synthpod.module_list.urid, //TODO subject
- sizeof(uint32_t), handle->forge.URID, &mod->urn) )
+ && synthpod_patcher_remove(&handle->forge,
+ 0, 0, SYNTHPOD__moduleList, //TODO subject
+ sizeof(uint32_t), ATOM__URID, &mod->urn) )
{
_message_write(handle);
}
@@ -3500,9 +3533,9 @@ _patch_mod_preset_set(plughandle_t *handle, mod_t *mod, const LilvNode *preset)
const LV2_URID preset_urid = handle->map->map(handle->map->handle, preset_uri);;
if( _message_request(handle)
- && synthpod_patcher_set(&handle->regs, &handle->forge,
- mod->urn, 0, handle->regs.pset.preset.urid,
- sizeof(uint32_t), handle->forge.URID, &preset_urid) )
+ && synthpod_patcher_set(&handle->forge,
+ mod->urn, 0, PRESETS__Preset,
+ sizeof(uint32_t), ATOM__URID, &preset_urid) )
{
_message_write(handle);
}
@@ -3526,9 +3559,9 @@ _patch_mod_reinstantiate_set(plughandle_t *handle, mod_t *mod, int32_t state)
mod->dsp_instance = NULL;
if( _message_request(handle)
- && synthpod_patcher_set(&handle->regs, &handle->forge,
- mod->urn, 0, handle->regs.synthpod.module_reinstantiate.urid,
- sizeof(int32_t), handle->forge.Bool, &state) )
+ && synthpod_patcher_set(&handle->forge,
+ mod->urn, 0, SYNTHPOD__moduleReinstantiate,
+ sizeof(int32_t), ATOM__Bool, &state) )
{
_message_write(handle);
}
@@ -3574,7 +3607,7 @@ _patch_mod_preset_save(plughandle_t *handle)
const LV2_URID preset_urid = handle->map->map(handle->map->handle, preset_path);
if( _message_request(handle)
- && synthpod_patcher_copy(&handle->regs, &handle->forge,
+ && synthpod_patcher_copy(&handle->forge,
mod->urn, 0, preset_urid) )
{
_message_write(handle);
@@ -3680,9 +3713,9 @@ _set_module_idisp_subscription(plughandle_t *handle, mod_t *mod, int32_t state)
{
DBG;
if( _message_request(handle)
- && synthpod_patcher_set(&handle->regs, &handle->forge,
- mod->urn, 0, handle->regs.idisp.surface.urid,
- sizeof(int32_t), handle->forge.Bool, &state) )
+ && synthpod_patcher_set(&handle->forge,
+ mod->urn, 0, INLINEDISPLAY__surface,
+ sizeof(int32_t), ATOM__Bool, &state) )
{
_message_write(handle);
}
@@ -3781,7 +3814,7 @@ _mod_init(plughandle_t *handle, mod_t *mod, const LilvPlugin *plug)
control->is_readonly = is_output;
control->is_int = lilv_port_has_property(plug, port->port, handle->node.lv2_integer);
control->is_bool = lilv_port_has_property(plug, port->port, handle->node.lv2_toggled);
- control->is_logarithmic = lilv_port_has_property(plug, port->port, handle->regs.port.logarithmic.node);
+ control->is_logarithmic = lilv_port_has_property(plug, port->port, NODE(PORT_PROPS__logarithmic));
LilvNode *val = NULL;
LilvNode *min = NULL;
@@ -3843,14 +3876,15 @@ _mod_init(plughandle_t *handle, mod_t *mod, const LilvPlugin *plug)
control->is_bool = true;
}
- LilvNode *units_unit = lilv_port_get(plug, port->port, handle->regs.units.unit.node);
+ LilvNode *units_unit = lilv_port_get(plug, port->port, NODE(UNITS__unit));
if(units_unit)
{
if(lilv_node_is_uri(units_unit))
{
control->units_symbol = _unit_symbol(handle, lilv_node_as_uri(units_unit));
}
- else if(lilv_world_ask(handle->world, units_unit, handle->regs.rdf.type.node, handle->regs.units.Unit.node))
+ else if(lilv_world_ask(handle->world, units_unit,
+ NODE(RDF__type), NODE(UNITS__Unit)))
{
control->units_symbol = _unit_symbol_obj(handle, units_unit);
}
@@ -3915,7 +3949,7 @@ _mod_init(plughandle_t *handle, mod_t *mod, const LilvPlugin *plug)
port->type |= PROPERTY_TYPE_XPRESS;
- LilvNode *min_size= lilv_port_get(plug, port->port, handle->regs.port.minimum_size.node);
+ LilvNode *min_size= lilv_port_get(plug, port->port, NODE(RESIZE_PORT__minimumSize));
if(min_size)
{
mod->minimum += sizeof(LV2_Atom_Property) + sizeof(LV2_Atom) + lilv_node_as_int(min_size);
@@ -4131,12 +4165,12 @@ _mod_init(plughandle_t *handle, mod_t *mod, const LilvPlugin *plug)
const LilvUI *ui = lilv_uis_get(mod->ui_nodes, itr);
const LilvNode *ui_uri = lilv_ui_get_uri(ui);
bool threaded = false;
- const bool x11ui = lilv_ui_is_a(ui, handle->regs.ui.x11.node);
+ const bool x11ui = lilv_ui_is_a(ui, NODE(UI__X11UI));
const bool wants_instance_access = lilv_world_ask(handle->world, ui_uri,
- handle->regs.core.required_feature.node, handle->regs.ui.instance_access.node)
+ NODE(CORE__requiredFeature), NODE(INSTANCE_ACCESS))
|| lilv_world_ask(handle->world, ui_uri,
- handle->regs.core.optional_feature.node, handle->regs.ui.instance_access.node);
+ NODE(CORE__optionalFeature), NODE(INSTANCE_ACCESS));
if(wants_instance_access)
{
if(x11ui && handle->dsp_instance)
@@ -4155,9 +4189,9 @@ _mod_init(plughandle_t *handle, mod_t *mod, const LilvPlugin *plug)
}
const bool wants_data_access = lilv_world_ask(handle->world, ui_uri,
- handle->regs.core.required_feature.node, handle->regs.ui.data_access.node)
+ NODE(CORE__requiredFeature), NODE(DATA_ACCESS))
|| lilv_world_ask(handle->world, ui_uri,
- handle->regs.core.optional_feature.node, handle->regs.ui.data_access.node);
+ NODE(CORE__optionalFeature), NODE(DATA_ACCESS));
if(wants_data_access)
{
if(x11ui && handle->dsp_instance)
@@ -4184,7 +4218,7 @@ _mod_init(plughandle_t *handle, mod_t *mod, const LilvPlugin *plug)
_mod_subscribe_persistent(handle, mod); // e.g. canvas:graph
_patch_notification_add_patch_get(handle, mod,
- handle->regs.port.event_transfer.urid, mod->subj, 0, 0); // patch:Get []
+ ATOM__eventTransfer, mod->subj, 0, 0); // patch:Get []
nk_pugl_post_redisplay(&handle->win); //FIXME
}
@@ -4444,7 +4478,7 @@ _expose_main_header(plughandle_t *handle, struct nk_context *ctx, float dy)
if(_toolbar_button(ctx, 'n', handle->icon.plus, "New"))
{
if( _message_request(handle)
- && synthpod_patcher_copy(&handle->regs, &handle->forge,
+ && synthpod_patcher_copy(&handle->forge,
handle->self_urn, 0, 0) )
{
_message_write(handle);
@@ -4454,7 +4488,7 @@ _expose_main_header(plughandle_t *handle, struct nk_context *ctx, float dy)
if(_toolbar_button(ctx, 's', handle->icon.download, "Save"))
{
if( _message_request(handle)
- && synthpod_patcher_copy(&handle->regs, &handle->forge,
+ && synthpod_patcher_copy(&handle->forge,
0, 0, handle->bundle_urn) )
{
_message_write(handle);
@@ -4506,9 +4540,9 @@ _expose_main_header(plughandle_t *handle, struct nk_context *ctx, float dy)
const LV2_URID subj = 0; // aka host
if( _message_request(handle)
- && synthpod_patcher_set(&handle->regs, &handle->forge,
- subj, 0, handle->regs.synthpod.row_enabled.urid,
- sizeof(int32_t), handle->forge.Bool, &handle->show_bottombar) )
+ && synthpod_patcher_set(&handle->forge,
+ subj, 0, SYNTHPOD__rowEnabled,
+ sizeof(int32_t), ATOM__Bool, &handle->show_bottombar) )
{
_message_write(handle);
}
@@ -4522,9 +4556,9 @@ _expose_main_header(plughandle_t *handle, struct nk_context *ctx, float dy)
const LV2_URID subj = 0; // aka host
if( _message_request(handle)
- && synthpod_patcher_set(&handle->regs, &handle->forge,
- subj, 0, handle->regs.synthpod.column_enabled.urid,
- sizeof(int32_t), handle->forge.Bool, &handle->show_sidebar) )
+ && synthpod_patcher_set(&handle->forge,
+ subj, 0, SYNTHPOD__columnEnabled,
+ sizeof(int32_t), ATOM__Bool, &handle->show_sidebar) )
{
_message_write(handle);
}
@@ -5636,8 +5670,8 @@ _expose_port(struct nk_context *ctx, mod_t *mod, port_t *port, float DY, float d
? port->control.val.i
: port->control.val.f;
- _patch_notification_add(handle, port, handle->regs.port.float_protocol.urid,
- sizeof(float), handle->forge.Float, &val);
+ _patch_notification_add(handle, port, UI__floatProtocol,
+ sizeof(float), ATOM__Float, &val);
// route to ui
_mod_uis_send(mod, port->index, sizeof(float), 0, &val);
@@ -5708,10 +5742,10 @@ _expose_param_inner(struct nk_context *ctx, param_t *param, plughandle_t *handle
DY -= 2*ctx->style.window.group_padding.y;
bool changed = false;
- if( (param->range == handle->forge.String)
- || (param->range == handle->forge.Path)
- || (param->range == handle->forge.URI)
- || (param->range == handle->forge.URID)
+ if( (param->range == ATOM__String)
+ || (param->range == ATOM__Path)
+ || (param->range == ATOM__URI)
+ || (param->range == ATOM__URID)
|| param->is_bitmask)
{
nk_layout_row_dynamic(ctx, DY, 1);
@@ -5796,7 +5830,7 @@ _expose_param_inner(struct nk_context *ctx, param_t *param, plughandle_t *handle
nk_style_pop_color(ctx);
}
}
- else if(param->range == handle->forge.Int)
+ else if(param->range == ATOM__Int)
{
if(param->is_readonly)
{
@@ -5812,7 +5846,7 @@ _expose_param_inner(struct nk_context *ctx, param_t *param, plughandle_t *handle
param->val.i = val;
}
}
- else if(param->range == handle->forge.Long)
+ else if(param->range == ATOM__Long)
{
if(param->is_readonly)
{
@@ -5828,11 +5862,11 @@ _expose_param_inner(struct nk_context *ctx, param_t *param, plughandle_t *handle
param->val.h = val;
}
}
- else if(param->range == handle->forge.Bool)
+ else if(param->range == ATOM__Bool)
{
nk_spacing(ctx, 1);
}
- else if(param->range == handle->forge.Float)
+ else if(param->range == ATOM__Float)
{
if(param->is_readonly)
{
@@ -5848,7 +5882,7 @@ _expose_param_inner(struct nk_context *ctx, param_t *param, plughandle_t *handle
changed = true;
}
}
- else if(param->range == handle->forge.Double)
+ else if(param->range == ATOM__Double)
{
if(param->is_readonly)
{
@@ -5864,31 +5898,31 @@ _expose_param_inner(struct nk_context *ctx, param_t *param, plughandle_t *handle
changed = true;
}
}
- else if(param->range == handle->forge.String)
+ else if(param->range == ATOM__String)
{
nk_layout_row_dynamic(ctx, dy*1.2, 1); // editor field needs to be heigher
if(_widget_string(handle, ctx, &param->val.editor, !param->is_readonly))
changed = true;
}
- else if(param->range == handle->forge.Path)
+ else if(param->range == ATOM__Path)
{
nk_layout_row_dynamic(ctx, dy*1.2, 1); // editor field needs to be heigher
if(_widget_string(handle, ctx, &param->val.editor, !param->is_readonly))
changed = true;
}
- else if(param->range == handle->forge.URI)
+ else if(param->range == ATOM__URI)
{
nk_layout_row_dynamic(ctx, dy*1.2, 1); // editor field needs to be heigher
if(_widget_string(handle, ctx, &param->val.editor, !param->is_readonly))
changed = true;
}
- else if(param->range == handle->forge.URID)
+ else if(param->range == ATOM__URID)
{
nk_layout_row_dynamic(ctx, dy*1.2, 1); // editor field needs to be heigher
if(_widget_string(handle, ctx, &param->val.editor, !param->is_readonly))
changed = true;
}
- else if(param->range == handle->forge.Chunk)
+ else if(param->range == ATOM__Chunk)
{
nk_labelf(ctx, NK_TEXT_RIGHT, "%"PRIu32" bytes", param->val.chunk.size);
//FIXME file dialog
@@ -5902,7 +5936,7 @@ _expose_param_inner(struct nk_context *ctx, param_t *param, plughandle_t *handle
nk_group_end(ctx);
}
- if( (param->range == handle->forge.Int) && !param->is_bitmask)
+ if( (param->range == ATOM__Int) && !param->is_bitmask)
{
if(_dial_int(ctx, param->min.i, &param->val.i, param->max.i, 1.f,
nk_rgb(0xff, 0xff, 0xff), !param->is_readonly, param->is_logarithmic))
@@ -5910,7 +5944,7 @@ _expose_param_inner(struct nk_context *ctx, param_t *param, plughandle_t *handle
changed = true;
}
}
- else if(param->range == handle->forge.Long)
+ else if(param->range == ATOM__Long)
{
if(_dial_long(ctx, param->min.h, &param->val.h, param->max.h, 1.f,
nk_rgb(0xff, 0xff, 0xff), !param->is_readonly, param->is_logarithmic))
@@ -5918,14 +5952,14 @@ _expose_param_inner(struct nk_context *ctx, param_t *param, plughandle_t *handle
changed = true;
}
}
- else if(param->range == handle->forge.Bool)
+ else if(param->range == ATOM__Bool)
{
if(_dial_bool(ctx, &param->val.i, nk_rgb(0xff, 0xff, 0xff), !param->is_readonly))
{
changed = true;
}
}
- else if(param->range == handle->forge.Float)
+ else if(param->range == ATOM__Float)
{
if(_dial_float(ctx, param->min.f, &param->val.f, param->max.f, 1.f,
nk_rgb(0xff, 0xff, 0xff), !param->is_readonly, param->is_logarithmic))
@@ -5933,7 +5967,7 @@ _expose_param_inner(struct nk_context *ctx, param_t *param, plughandle_t *handle
changed = true;
}
}
- else if(param->range == handle->forge.Double)
+ else if(param->range == ATOM__Double)
{
if(_dial_double(ctx, param->min.d, &param->val.d, param->max.d, 1.f,
nk_rgb(0xff, 0xff, 0xff), !param->is_readonly, param->is_logarithmic))
@@ -5955,64 +5989,64 @@ _param_notification_add(plughandle_t *handle, mod_t *mod, param_t *param)
{
DBG;
//FIXME sandbox_master_send is not necessary, as messages should be fed back via dsp to nk
- if(param->range == handle->forge.Int)
+ if(param->range == ATOM__Int)
{
_patch_notification_add_patch_set(handle, mod,
- handle->regs.port.event_transfer.urid, mod->subj, 0, param->property,
- sizeof(int32_t), handle->forge.Int, &param->val.i);
+ ATOM__eventTransfer, mod->subj, 0, param->property,
+ sizeof(int32_t), ATOM__Int, &param->val.i);
}
- else if(param->range == handle->forge.Bool)
+ else if(param->range == ATOM__Bool)
{
_patch_notification_add_patch_set(handle, mod,
- handle->regs.port.event_transfer.urid, mod->subj, 0, param->property,
- sizeof(int32_t), handle->forge.Bool, &param->val.i);
+ ATOM__eventTransfer, mod->subj, 0, param->property,
+ sizeof(int32_t), ATOM__Bool, &param->val.i);
}
- else if(param->range == handle->forge.Long)
+ else if(param->range == ATOM__Long)
{
_patch_notification_add_patch_set(handle, mod,
- handle->regs.port.event_transfer.urid, mod->subj, 0, param->property,
- sizeof(int64_t), handle->forge.Long, &param->val.h);
+ ATOM__eventTransfer, mod->subj, 0, param->property,
+ sizeof(int64_t), ATOM__Long, &param->val.h);
}
- else if(param->range == handle->forge.Float)
+ else if(param->range == ATOM__Float)
{
_patch_notification_add_patch_set(handle, mod,
- handle->regs.port.event_transfer.urid, mod->subj, 0, param->property,
- sizeof(float), handle->forge.Float, &param->val.f);
+ ATOM__eventTransfer, mod->subj, 0, param->property,
+ sizeof(float), ATOM__Float, &param->val.f);
}
- else if(param->range == handle->forge.Double)
+ else if(param->range == ATOM__Double)
{
_patch_notification_add_patch_set(handle, mod,
- handle->regs.port.event_transfer.urid, mod->subj, 0, param->property,
- sizeof(double), handle->forge.Double, &param->val.d);
+ ATOM__eventTransfer, mod->subj, 0, param->property,
+ sizeof(double), ATOM__Double, &param->val.d);
}
- else if(param->range == handle->forge.String)
+ else if(param->range == ATOM__String)
{
const char *str = nk_str_get_const(&param->val.editor.string);
const uint32_t sz= nk_str_len_char(&param->val.editor.string) + 1;
_patch_notification_add_patch_set(handle, mod,
- handle->regs.port.event_transfer.urid, mod->subj, 0, param->property,
- sz, handle->forge.String, str);
+ ATOM__eventTransfer, mod->subj, 0, param->property,
+ sz, ATOM__String, str);
}
- else if(param->range == handle->forge.Path)
+ else if(param->range == ATOM__Path)
{
const char *str = nk_str_get_const(&param->val.editor.string);
const uint32_t sz= nk_str_len_char(&param->val.editor.string) + 1;
_patch_notification_add_patch_set(handle, mod,
- handle->regs.port.event_transfer.urid, mod->subj, 0, param->property,
- sz, handle->forge.Path, str);
+ ATOM__eventTransfer, mod->subj, 0, param->property,
+ sz, ATOM__Path, str);
}
- else if(param->range == handle->forge.URI)
+ else if(param->range == ATOM__URI)
{
const char *str = nk_str_get_const(&param->val.editor.string);
const uint32_t sz= nk_str_len_char(&param->val.editor.string) + 1;
_patch_notification_add_patch_set(handle, mod,
- handle->regs.port.event_transfer.urid, mod->subj, 0, param->property,
- sz, handle->forge.URI, str);
+ ATOM__eventTransfer, mod->subj, 0, param->property,
+ sz, ATOM__URI, str);
}
- else if(param->range == handle->forge.URID)
+ else if(param->range == ATOM__URID)
{
const char *str = nk_str_get_const(&param->val.editor.string);
const uint32_t sz= nk_str_len_char(&param->val.editor.string);
@@ -6022,16 +6056,16 @@ _param_notification_add(plughandle_t *handle, mod_t *mod, param_t *param)
const uint32_t urid = handle->map->map(handle->map->handle, uri);
_patch_notification_add_patch_set(handle, mod,
- handle->regs.port.event_transfer.urid, mod->subj, 0, param->property,
- sizeof(uint32_t), handle->forge.URID, &urid);
+ ATOM__eventTransfer, mod->subj, 0, param->property,
+ sizeof(uint32_t), ATOM__URID, &urid);
}
- else if(param->range == handle->forge.Chunk)
+ else if(param->range == ATOM__Chunk)
{
chunk_t *chunk = &param->val.chunk;
_patch_notification_add_patch_set(handle, mod,
- handle->regs.port.event_transfer.urid, mod->subj, 0, param->property,
- chunk->size, handle->forge.Chunk, chunk->body);
+ ATOM__eventTransfer, mod->subj, 0, param->property,
+ chunk->size, ATOM__Chunk, chunk->body);
}
//FIXME handle remaining types
}
@@ -6291,7 +6325,7 @@ _set_module_selector(plughandle_t *handle, mod_t *mod)
_mod_subscribe_all(handle, mod);
_patch_notification_add_patch_get(handle, mod,
- handle->regs.port.event_transfer.urid, mod->subj, 0, 0); // patch:Get []
+ ATOM__eventTransfer, mod->subj, 0, 0); // patch:Get []
}
handle->module_selector = mod;
@@ -6707,17 +6741,17 @@ _mod_moveable(plughandle_t *handle, struct nk_context *ctx, mod_t *mod,
}
if( _message_request(handle)
- && synthpod_patcher_set(&handle->regs, &handle->forge,
- mod->urn, 0, handle->regs.synthpod.module_position_x.urid,
- sizeof(float), handle->forge.Float, &mod->pos.x) )
+ && synthpod_patcher_set(&handle->forge,
+ mod->urn, 0, SYNTHPOD__modulePositionX,
+ sizeof(float), ATOM__Float, &mod->pos.x) )
{
_message_write(handle);
}
if( _message_request(handle)
- && synthpod_patcher_set(&handle->regs, &handle->forge,
- mod->urn, 0, handle->regs.synthpod.module_position_y.urid,
- sizeof(float), handle->forge.Float, &mod->pos.y) )
+ && synthpod_patcher_set(&handle->forge,
+ mod->urn, 0, SYNTHPOD__modulePositionY,
+ sizeof(float), ATOM__Float, &mod->pos.y) )
{
_message_write(handle);
}
@@ -7478,15 +7512,15 @@ _param_randomize(plughandle_t *handle, mod_t *mod, param_t *param)
DBG;
const float rnd = (float)rand() / RAND_MAX;
- if(param->range == handle->forge.Bool)
+ if(param->range == ATOM__Bool)
param->val.i = rnd > 0.5f ? 1 : 0;
- else if(param->range == handle->forge.Int)
+ else if(param->range == ATOM__Int)
param->val.i = param->min.i + param->span.i*rnd;
- else if(param->range == handle->forge.Long)
+ else if(param->range == ATOM__Long)
param->val.h = param->min.h + param->span.h*rnd;
- else if(param->range == handle->forge.Float)
+ else if(param->range == ATOM__Float)
param->val.f = param->min.f + param->span.f*rnd;
- else if(param->range == handle->forge.Double)
+ else if(param->range == ATOM__Double)
param->val.d = param->min.d + param->span.d*rnd;
//FIXME handle other types
}
@@ -7506,8 +7540,8 @@ _mod_randomize(plughandle_t *handle, mod_t *mod)
const float val = port->control.is_bool || port->control.is_int
? port->control.val.i
: port->control.val.f;
- _patch_notification_add(handle, port, handle->regs.port.float_protocol.urid,
- sizeof(float), handle->forge.Float, &val);
+ _patch_notification_add(handle, port, UI__floatProtocol,
+ sizeof(float), ATOM__Float, &val);
}
}
@@ -7572,17 +7606,17 @@ _expose_main_body(plughandle_t *handle, struct nk_context *ctx, float dh, float
const LV2_URID subj = 0; // aka host
if( _message_request(handle)
- && synthpod_patcher_set(&handle->regs, &handle->forge,
- subj, 0, handle->regs.synthpod.graph_position_x.urid,
- sizeof(float), handle->forge.Float, &handle->scrolling.x) )
+ && synthpod_patcher_set(&handle->forge,
+ subj, 0, SYNTHPOD__graphPositionX,
+ sizeof(float), ATOM__Float, &handle->scrolling.x) )
{
_message_write(handle);
}
if( _message_request(handle)
- && synthpod_patcher_set(&handle->regs, &handle->forge,
- subj, 0, handle->regs.synthpod.graph_position_y.urid,
- sizeof(float), handle->forge.Float, &handle->scrolling.y) )
+ && synthpod_patcher_set(&handle->forge,
+ subj, 0, SYNTHPOD__graphPositionY,
+ sizeof(float), ATOM__Float, &handle->scrolling.y) )
{
_message_write(handle);
}
@@ -8050,9 +8084,9 @@ _expose_main_body(plughandle_t *handle, struct nk_context *ctx, float dh, float
if( (flags & NK_EDIT_COMMITED) || (old_len != strlen(mod->alias)) )
{
if( _message_request(handle)
- && synthpod_patcher_set(&handle->regs, &handle->forge,
- mod->urn, 0, handle->regs.synthpod.module_alias.urid,
- strlen(mod->alias) + 1, handle->forge.String, mod->alias) )
+ && synthpod_patcher_set(&handle->forge,
+ mod->urn, 0, SYNTHPOD__moduleAlias,
+ strlen(mod->alias) + 1, ATOM__String, mod->alias) )
{
_message_write(handle);
}
@@ -8078,19 +8112,20 @@ _expose_main_body(plughandle_t *handle, struct nk_context *ctx, float dh, float
if(!single_ui)
{
- if(lilv_ui_is_a(ui, handle->regs.ui.x11.node))
+ if(lilv_ui_is_a(ui, NODE(UI__X11UI)))
label = "X11";
- else if(lilv_ui_is_a(ui, handle->regs.ui.gtk2.node))
+ else if(lilv_ui_is_a(ui, NODE(UI__GtkUI)))
label = "Gtk2";
- else if(lilv_ui_is_a(ui, handle->regs.ui.gtk3.node))
+ else if(lilv_ui_is_a(ui, NODE(UI__Gtk3UI)))
label = "Gtk3";
- else if(lilv_ui_is_a(ui, handle->regs.ui.qt4.node))
+ else if(lilv_ui_is_a(ui, NODE(UI__Qt4UI)))
label = "Qt4";
- else if(lilv_ui_is_a(ui, handle->regs.ui.qt5.node))
+ else if(lilv_ui_is_a(ui, NODE(UI__Qt5UI)))
label = "Qt5";
- else if(lilv_ui_is_a(ui, handle->regs.ui.kx_widget.node))
+ else if(lilv_ui_is_a(ui, NODE(EXTERNAL_UI__Widget)))
label = "KX";
- else if(lilv_world_ask(handle->world, ui_node, handle->regs.core.extension_data.node, handle->regs.ui.show_interface.node))
+ else if(lilv_world_ask(handle->world, ui_node,
+ NODE(CORE__extensionData), NODE(UI__showInterface)))
label = "Show";
}
@@ -8227,76 +8262,76 @@ _init(plughandle_t *handle)
_discover_bundles(handle);
- sp_regs_init(&handle->regs, handle->world, handle->map);
+ sp_regs_init(handle->regs, handle->world);
// patch:Get [patch:property spod:moduleList]
if( _message_request(handle)
- && synthpod_patcher_get(&handle->regs, &handle->forge,
- 0, 0, handle->regs.synthpod.module_list.urid) )
+ && synthpod_patcher_get(&handle->forge,
+ 0, 0, SYNTHPOD__moduleList) )
{
_message_write(handle);
}
// patch:Get [patch:property spod:CPUsAvailable]
if( _message_request(handle)
- && synthpod_patcher_get(&handle->regs, &handle->forge,
- 0, 0, handle->regs.synthpod.cpus_available.urid) )
+ && synthpod_patcher_get(&handle->forge,
+ 0, 0, SYNTHPOD__CPUsAvailable) )
{
_message_write(handle);
}
// patch:Get [patch:property spod:CPUsUsed]
if( _message_request(handle)
- && synthpod_patcher_get(&handle->regs, &handle->forge,
- 0, 0, handle->regs.synthpod.cpus_used.urid) )
+ && synthpod_patcher_get(&handle->forge,
+ 0, 0, SYNTHPOD__CPUsUsed) )
{
_message_write(handle);
}
// patch:Get [patch:property spod:periodSize]
if( _message_request(handle)
- && synthpod_patcher_get(&handle->regs, &handle->forge,
- 0, 0, handle->regs.synthpod.period_size.urid) )
+ && synthpod_patcher_get(&handle->forge,
+ 0, 0, SYNTHPOD__periodSize) )
{
_message_write(handle);
}
// patch:Get [patch:property spod:numPeriods]
if( _message_request(handle)
- && synthpod_patcher_get(&handle->regs, &handle->forge,
- 0, 0, handle->regs.synthpod.num_periods.urid) )
+ && synthpod_patcher_get(&handle->forge,
+ 0, 0, SYNTHPOD__numPeriods) )
{
_message_write(handle);
}
// patch:Get [patch:property spod:graphPositionX]
if( _message_request(handle)
- && synthpod_patcher_get(&handle->regs, &handle->forge,
- 0, 0, handle->regs.synthpod.graph_position_x.urid) )
+ && synthpod_patcher_get(&handle->forge,
+ 0, 0, SYNTHPOD__graphPositionX) )
{
_message_write(handle);
}
// patch:Get [patch:property spod:graphPositionY]
if( _message_request(handle)
- && synthpod_patcher_get(&handle->regs, &handle->forge,
- 0, 0, handle->regs.synthpod.graph_position_y.urid) )
+ && synthpod_patcher_get(&handle->forge,
+ 0, 0, SYNTHPOD__graphPositionY) )
{
_message_write(handle);
}
// patch:Get [patch:property spod:columnEnabled]
if( _message_request(handle)
- && synthpod_patcher_get(&handle->regs, &handle->forge,
- 0, 0, handle->regs.synthpod.column_enabled.urid) )
+ && synthpod_patcher_get(&handle->forge,
+ 0, 0, SYNTHPOD__columnEnabled) )
{
_message_write(handle);
}
// patch:Get [patch:property spod:rowEnabled]
if( _message_request(handle)
- && synthpod_patcher_get(&handle->regs, &handle->forge,
- 0, 0, handle->regs.synthpod.row_enabled.urid) )
+ && synthpod_patcher_get(&handle->forge,
+ 0, 0, SYNTHPOD__rowEnabled) )
{
_message_write(handle);
}
@@ -8308,33 +8343,7 @@ _deinit(plughandle_t *handle)
DBG;
if(handle->world)
{
- sp_regs_deinit(&handle->regs);
-
- lilv_node_free(handle->node.pg_group);
- lilv_node_free(handle->node.lv2_integer);
- lilv_node_free(handle->node.lv2_toggled);
- lilv_node_free(handle->node.lv2_minimum);
- lilv_node_free(handle->node.lv2_maximum);
- lilv_node_free(handle->node.lv2_default);
- lilv_node_free(handle->node.pset_Preset);
- lilv_node_free(handle->node.pset_bank);
- lilv_node_free(handle->node.rdfs_comment);
- lilv_node_free(handle->node.rdfs_range);
- lilv_node_free(handle->node.doap_name);
- lilv_node_free(handle->node.lv2_minorVersion);
- lilv_node_free(handle->node.lv2_microVersion);
- lilv_node_free(handle->node.doap_license);
- lilv_node_free(handle->node.rdfs_label);
- lilv_node_free(handle->node.lv2_name);
- lilv_node_free(handle->node.lv2_OutputPort);
- lilv_node_free(handle->node.lv2_AudioPort);
- lilv_node_free(handle->node.lv2_CVPort);
- lilv_node_free(handle->node.lv2_ControlPort);
- lilv_node_free(handle->node.atom_AtomPort);
- lilv_node_free(handle->node.patch_readable);
- lilv_node_free(handle->node.patch_writable);
- lilv_node_free(handle->node.rdf_type);
- lilv_node_free(handle->node.lv2_Plugin);
+ sp_regs_deinit(handle->regs);
_undiscover_bundles(handle);
@@ -8430,7 +8439,6 @@ instantiate(const LV2UI_Descriptor *descriptor, const char *plugin_uri,
return NULL;
void *parent = NULL;
- LV2UI_Resize *host_resize = NULL;
LV2_Options_Option *opts = NULL;
xpress_map_t *voice_map = NULL;
@@ -8438,8 +8446,6 @@ instantiate(const LV2UI_Descriptor *descriptor, const char *plugin_uri,
{
if(!strcmp(features[i]->URI, LV2_UI__parent))
parent = features[i]->data;
- else if(!strcmp(features[i]->URI, LV2_UI__resize))
- host_resize = features[i]->data;
else if(!strcmp(features[i]->URI, LV2_URID__map))
handle->map = features[i]->data;
else if(!strcmp(features[i]->URI, LV2_URID__unmap))
@@ -8513,7 +8519,7 @@ instantiate(const LV2UI_Descriptor *descriptor, const char *plugin_uri,
{
handle->update_rate = *(float*)opt->value;
}
- if( (opt->key == ui_scaleFactor) && (opt->type == handle->forge.Float) )
+ if( (opt->key == ui_scaleFactor) && (opt->type == ATOM__Float) )
{
handle->scale = *(float*)opt->value;
}
@@ -8536,7 +8542,7 @@ instantiate(const LV2UI_Descriptor *descriptor, const char *plugin_uri,
cfg->class = "synthpod";
cfg->title = "Synthpod";
cfg->parent = (intptr_t)parent;
- cfg->host_resize = host_resize;
+ cfg->host_resize = NULL;
cfg->data = handle;
cfg->expose = _expose;
@@ -8696,11 +8702,11 @@ _add_connection(plughandle_t *handle, const LV2_Atom_Object *obj)
const LV2_Atom_Float *link_gain = NULL;
lv2_atom_object_get(obj,
- handle->regs.synthpod.source_module.urid, &src_module,
- handle->regs.synthpod.source_symbol.urid, &src_symbol,
- handle->regs.synthpod.sink_module.urid, &snk_module,
- handle->regs.synthpod.sink_symbol.urid, &snk_symbol,
- handle->regs.param.gain.urid, &link_gain,
+ SYNTHPOD__sourceModule, &src_module,
+ SYNTHPOD__sourceSymbol, &src_symbol,
+ SYNTHPOD__sinkModule, &snk_module,
+ SYNTHPOD__sinkSymbol, &snk_symbol,
+ PARAMETERS__gain, &link_gain,
0);
const LV2_URID src_urn = src_module
@@ -8752,10 +8758,10 @@ _rem_connection(plughandle_t *handle, const LV2_Atom_Object *obj)
const LV2_Atom *snk_symbol = NULL;
lv2_atom_object_get(obj,
- handle->regs.synthpod.source_module.urid, &src_module,
- handle->regs.synthpod.source_symbol.urid, &src_symbol,
- handle->regs.synthpod.sink_module.urid, &snk_module,
- handle->regs.synthpod.sink_symbol.urid, &snk_symbol,
+ SYNTHPOD__sourceModule, &src_module,
+ SYNTHPOD__sourceSymbol, &src_symbol,
+ SYNTHPOD__sinkModule, &snk_module,
+ SYNTHPOD__sinkSymbol, &snk_symbol,
0);
const LV2_URID src_urn = src_module
@@ -8801,10 +8807,10 @@ _add_node(plughandle_t *handle, const LV2_Atom_Object *obj)
const LV2_Atom_Float *pos_y = NULL;
lv2_atom_object_get(obj,
- handle->regs.synthpod.source_module.urid, &src_module,
- handle->regs.synthpod.sink_module.urid, &snk_module,
- handle->regs.synthpod.node_position_x.urid, &pos_x,
- handle->regs.synthpod.node_position_y.urid, &pos_y,
+ SYNTHPOD__sourceModule, &src_module,
+ SYNTHPOD__sinkModule, &snk_module,
+ SYNTHPOD__nodePositionX, &pos_x,
+ SYNTHPOD__nodePositionY, &pos_y,
0);
const LV2_URID src_urn = src_module
@@ -8855,18 +8861,18 @@ _add_automation(plughandle_t *handle, const LV2_Atom_Object *obj)
const LV2_Atom_Bool *snk_enabled = NULL;
lv2_atom_object_get(obj,
- handle->regs.synthpod.sink_module.urid, &src_module,
- handle->regs.synthpod.sink_symbol.urid, &src_symbol,
- handle->regs.patch.property.urid, &src_property,
- handle->regs.midi.channel.urid, &midi_channel,
- handle->regs.midi.controller_number.urid, &midi_controller,
- handle->regs.osc.path.urid, &osc_path,
- handle->regs.synthpod.source_min.urid, &src_min,
- handle->regs.synthpod.source_max.urid, &src_max,
- handle->regs.synthpod.sink_min.urid, &snk_min,
- handle->regs.synthpod.sink_max.urid, &snk_max,
- handle->regs.synthpod.source_enabled.urid, &src_enabled,
- handle->regs.synthpod.sink_enabled.urid, &snk_enabled,
+ SYNTHPOD__sinkModule, &src_module,
+ SYNTHPOD__sinkSymbol, &src_symbol,
+ PATCH__property, &src_property,
+ MIDI__channel, &midi_channel,
+ MIDI__controllerNumber, &midi_controller,
+ OSC__messagePath, &osc_path,
+ SYNTHPOD__sourceMinimum, &src_min,
+ SYNTHPOD__sourceMaximum, &src_max,
+ SYNTHPOD__sinkMinimum, &snk_min,
+ SYNTHPOD__sinkMaximum, &snk_max,
+ SYNTHPOD__sourceEnabled, &src_enabled,
+ SYNTHPOD__sinkEnabled, &snk_enabled,
0);
const LV2_URID src_urn = src_module
@@ -8917,7 +8923,7 @@ _add_automation(plughandle_t *handle, const LV2_Atom_Object *obj)
automation->c = snk_min ? snk_min->body : 0.0; //FIXME
automation->d = snk_max ? snk_max->body : 0.0; //FIXME
- if(obj->body.otype == handle->regs.midi.Controller.urid)
+ if(obj->body.otype == MIDI__Controller)
{
automation->type = AUTO_MIDI;
midi_auto_t *mauto = &automation->midi;
@@ -8928,7 +8934,7 @@ _add_automation(plughandle_t *handle, const LV2_Atom_Object *obj)
mauto->channel = midi_channel ? midi_channel->body : -1;
mauto->controller = midi_controller ? midi_controller->body : -1;
}
- else if(obj->body.otype == handle->regs.osc.message.urid)
+ else if(obj->body.otype == OSC__Message)
{
automation->type = AUTO_OSC;
osc_auto_t *oauto = &automation->osc;
@@ -8950,9 +8956,9 @@ _add_notification(plughandle_t *handle, const LV2_Atom_Object *obj)
const LV2_Atom *src_value = NULL;
lv2_atom_object_get(obj,
- handle->regs.synthpod.sink_module.urid, &src_module,
- handle->regs.synthpod.sink_symbol.urid, &src_symbol,
- handle->regs.rdf.value.urid, &src_value,
+ SYNTHPOD__sinkModule, &src_module,
+ SYNTHPOD__sinkSymbol, &src_symbol,
+ RDF__value, &src_value,
0);
const LV2_URID src_urn = src_module
@@ -8987,7 +8993,7 @@ _add_mod(plughandle_t *handle, const LV2_Atom_URID *urn)
// get information for each of those, FIXME only if not already available
if( _message_request(handle)
- && synthpod_patcher_get(&handle->regs, &handle->forge,
+ && synthpod_patcher_get(&handle->forge,
urn->body, 0, 0) )
{
_message_write(handle);
@@ -9018,28 +9024,28 @@ port_event(LV2UI_Handle instance, uint32_t port_index, uint32_t size,
if(port_index == 15) // notify
{
- if(format == handle->regs.port.event_transfer.urid)
+ if(format == ATOM__eventTransfer)
{
const LV2_Atom_Object *obj = buffer;
if(lv2_atom_forge_is_object_type(&handle->forge, obj->atom.type))
{
- if(obj->body.otype == handle->regs.patch.set.urid)
+ if(obj->body.otype == PATCH__Set)
{
const LV2_Atom_URID *subject = NULL;
const LV2_Atom_URID *property = NULL;
const LV2_Atom *value = NULL;
lv2_atom_object_get(obj,
- handle->regs.patch.subject.urid, &subject,
- handle->regs.patch.property.urid, &property,
- handle->regs.patch.value.urid, &value,
+ PATCH__subject, &subject,
+ PATCH__property, &property,
+ PATCH__value, &value,
0);
- const LV2_URID subj = subject && (subject->atom.type == handle->forge.URID)
+ const LV2_URID subj = subject && (subject->atom.type == ATOM__URID)
? subject->body
: 0;
- const LV2_URID prop = property && (property->atom.type == handle->forge.URID)
+ const LV2_URID prop = property && (property->atom.type == ATOM__URID)
? property->body
: 0;
@@ -9047,8 +9053,8 @@ port_event(LV2UI_Handle instance, uint32_t port_index, uint32_t size,
{
//printf("got patch:Set: %s\n", handle->unmap->unmap(handle->unmap->handle, prop));
- if( (prop == handle->regs.synthpod.module_list.urid)
- && (value->type == handle->forge.Tuple) )
+ if( (prop == SYNTHPOD__moduleList)
+ && (value->type == ATOM__Tuple) )
{
const LV2_Atom_Tuple *tup = (const LV2_Atom_Tuple *)value;
@@ -9066,38 +9072,38 @@ port_event(LV2UI_Handle instance, uint32_t port_index, uint32_t size,
// patch:Get [patch:property spod:connectionList]
if( _message_request(handle)
- && synthpod_patcher_get(&handle->regs, &handle->forge,
- 0, 0, handle->regs.synthpod.connection_list.urid) )
+ && synthpod_patcher_get(&handle->forge,
+ 0, 0, SYNTHPOD__connectionList) )
{
_message_write(handle);
}
// patch:Get [patch:property spod:nodeList]
if( _message_request(handle)
- && synthpod_patcher_get(&handle->regs, &handle->forge,
- 0, 0, handle->regs.synthpod.node_list.urid) )
+ && synthpod_patcher_get(&handle->forge,
+ 0, 0, SYNTHPOD__nodeList) )
{
_message_write(handle);
}
// patch:Get [patch:property pset:preset]
if( _message_request(handle)
- && synthpod_patcher_get(&handle->regs, &handle->forge,
- 0, 0, handle->regs.pset.preset.urid) )
+ && synthpod_patcher_get(&handle->forge,
+ 0, 0, PRESETS__Preset) )
{
_message_write(handle);
}
// patch:Get [patch:property spod:automationList]
if( _message_request(handle)
- && synthpod_patcher_get(&handle->regs, &handle->forge,
- 0, 0, handle->regs.synthpod.automation_list.urid) )
+ && synthpod_patcher_get(&handle->forge,
+ 0, 0, SYNTHPOD__automationList) )
{
_message_write(handle);
}
}
- else if( (prop == handle->regs.synthpod.connection_list.urid)
- && (value->type == handle->forge.Tuple) )
+ else if( (prop == SYNTHPOD__connectionList)
+ && (value->type == ATOM__Tuple) )
{
const LV2_Atom_Tuple *tup = (const LV2_Atom_Tuple *)value;
@@ -9112,8 +9118,8 @@ port_event(LV2UI_Handle instance, uint32_t port_index, uint32_t size,
_add_connection(handle, (const LV2_Atom_Object *)itm);
}
}
- else if( (prop == handle->regs.synthpod.node_list.urid)
- && (value->type == handle->forge.Tuple) )
+ else if( (prop == SYNTHPOD__nodeList)
+ && (value->type == ATOM__Tuple) )
{
const LV2_Atom_Tuple *tup = (const LV2_Atom_Tuple *)value;
@@ -9122,15 +9128,15 @@ port_event(LV2UI_Handle instance, uint32_t port_index, uint32_t size,
_add_node(handle, (const LV2_Atom_Object *)itm);
}
}
- else if( (prop == handle->regs.pset.preset.urid)
- && (value->type == handle->forge.URID) )
+ else if( (prop == PRESETS__Preset)
+ && (value->type == ATOM__URID) )
{
const LV2_Atom_URID *urid = (const LV2_Atom_URID *)value;
handle->bundle_urn = urid->body;
}
- else if( (prop == handle->regs.synthpod.automation_list.urid)
- && (value->type == handle->forge.Tuple) )
+ else if( (prop == SYNTHPOD__automationList)
+ && (value->type == ATOM__Tuple) )
{
const LV2_Atom_Tuple *tup = (const LV2_Atom_Tuple *)value;
@@ -9139,8 +9145,8 @@ port_event(LV2UI_Handle instance, uint32_t port_index, uint32_t size,
_add_automation(handle, (const LV2_Atom_Object *)itm);
}
}
- else if( (prop == handle->regs.synthpod.dsp_profiling.urid)
- && (value->type == handle->forge.Vector) )
+ else if( (prop == SYNTHPOD__DSPProfiling)
+ && (value->type == ATOM__Vector) )
{
const LV2_Atom_Vector *vec = (const LV2_Atom_Vector *)value;
const float *f32 = LV2_ATOM_CONTENTS_CONST(LV2_Atom_Vector, value);
@@ -9151,8 +9157,8 @@ port_event(LV2UI_Handle instance, uint32_t port_index, uint32_t size,
nk_pugl_post_redisplay(&handle->win);
}
- else if( (prop == handle->regs.synthpod.module_profiling.urid)
- && (value->type == handle->forge.Vector)
+ else if( (prop == SYNTHPOD__moduleProfiling)
+ && (value->type == ATOM__Vector)
&& subj )
{
const LV2_Atom_Vector *vec = (const LV2_Atom_Vector *)value;
@@ -9168,8 +9174,8 @@ port_event(LV2UI_Handle instance, uint32_t port_index, uint32_t size,
nk_pugl_post_redisplay(&handle->win);
}
}
- else if( (prop == handle->regs.ui.instance_access.urid)
- && (value->type == handle->forge.Long)
+ else if( (prop == INSTANCE_ACCESS)
+ && (value->type == ATOM__Long)
&& subj )
{
const LV2_Atom_Long *ptr = (const LV2_Atom_Long *)value;
@@ -9180,8 +9186,8 @@ port_event(LV2UI_Handle instance, uint32_t port_index, uint32_t size,
mod->dsp_instance = (LilvInstance *)ptr->body;
}
}
- else if( (prop == handle->regs.synthpod.graph_position_x.urid)
- && (value->type == handle->forge.Float) )
+ else if( (prop == SYNTHPOD__graphPositionX)
+ && (value->type == ATOM__Float) )
{
const LV2_Atom_Float *graph_position_x = (const LV2_Atom_Float *)value;
@@ -9189,8 +9195,8 @@ port_event(LV2UI_Handle instance, uint32_t port_index, uint32_t size,
nk_pugl_post_redisplay(&handle->win);
}
- else if( (prop == handle->regs.synthpod.graph_position_y.urid)
- && (value->type == handle->forge.Float) )
+ else if( (prop == SYNTHPOD__graphPositionY)
+ && (value->type == ATOM__Float) )
{
const LV2_Atom_Float *graph_position_y = (const LV2_Atom_Float *)value;
@@ -9198,8 +9204,8 @@ port_event(LV2UI_Handle instance, uint32_t port_index, uint32_t size,
nk_pugl_post_redisplay(&handle->win);
}
- else if( (prop == handle->regs.synthpod.column_enabled.urid)
- && (value->type == handle->forge.Bool) )
+ else if( (prop == SYNTHPOD__columnEnabled)
+ && (value->type == ATOM__Bool) )
{
const LV2_Atom_Bool *column_enabled = (const LV2_Atom_Bool *)value;
@@ -9207,8 +9213,8 @@ port_event(LV2UI_Handle instance, uint32_t port_index, uint32_t size,
nk_pugl_post_redisplay(&handle->win);
}
- else if( (prop == handle->regs.synthpod.row_enabled.urid)
- && (value->type == handle->forge.Bool) )
+ else if( (prop == SYNTHPOD__rowEnabled)
+ && (value->type == ATOM__Bool) )
{
const LV2_Atom_Bool *row_enabled = (const LV2_Atom_Bool *)value;
@@ -9216,8 +9222,8 @@ port_event(LV2UI_Handle instance, uint32_t port_index, uint32_t size,
nk_pugl_post_redisplay(&handle->win);
}
- else if( (prop == handle->regs.synthpod.cpus_used.urid)
- && (value->type == handle->forge.Int) )
+ else if( (prop == SYNTHPOD__CPUsUsed)
+ && (value->type == ATOM__Int) )
{
const LV2_Atom_Int *cpus_used = (const LV2_Atom_Int *)value;
@@ -9225,8 +9231,8 @@ port_event(LV2UI_Handle instance, uint32_t port_index, uint32_t size,
nk_pugl_post_redisplay(&handle->win);
}
- else if( (prop == handle->regs.synthpod.cpus_available.urid)
- && (value->type == handle->forge.Int) )
+ else if( (prop == SYNTHPOD__CPUsAvailable)
+ && (value->type == ATOM__Int) )
{
const LV2_Atom_Int *cpus_available = (const LV2_Atom_Int *)value;
@@ -9234,8 +9240,8 @@ port_event(LV2UI_Handle instance, uint32_t port_index, uint32_t size,
nk_pugl_post_redisplay(&handle->win);
}
- else if( (prop == handle->regs.synthpod.period_size.urid)
- && (value->type == handle->forge.Int) )
+ else if( (prop == SYNTHPOD__periodSize)
+ && (value->type == ATOM__Int) )
{
const LV2_Atom_Int *period_size = (const LV2_Atom_Int *)value;
@@ -9243,8 +9249,8 @@ port_event(LV2UI_Handle instance, uint32_t port_index, uint32_t size,
nk_pugl_post_redisplay(&handle->win);
}
- else if( (prop == handle->regs.synthpod.num_periods.urid)
- && (value->type == handle->forge.Int) )
+ else if( (prop == SYNTHPOD__numPeriods)
+ && (value->type == ATOM__Int) )
{
const LV2_Atom_Int *num_periods = (const LV2_Atom_Int *)value;
@@ -9252,8 +9258,8 @@ port_event(LV2UI_Handle instance, uint32_t port_index, uint32_t size,
nk_pugl_post_redisplay(&handle->win);
}
- else if( (prop == handle->regs.idisp.surface.urid)
- && (value->type == handle->forge.Tuple)
+ else if( (prop == INLINEDISPLAY__surface)
+ && (value->type == ATOM__Tuple)
&& subj )
{
const LV2_Atom_Tuple *tup = (const LV2_Atom_Tuple *)value;
@@ -9284,17 +9290,17 @@ port_event(LV2UI_Handle instance, uint32_t port_index, uint32_t size,
}
}
}
- else if(obj->body.otype == handle->regs.patch.put.urid)
+ else if(obj->body.otype == PATCH__Put)
{
const LV2_Atom_URID *subject = NULL;
const LV2_Atom_Object *body = NULL;
lv2_atom_object_get(obj,
- handle->regs.patch.subject.urid, &subject,
- handle->regs.patch.body.urid, &body,
+ PATCH__subject, &subject,
+ PATCH__body, &body,
0);
- const LV2_URID subj = subject && (subject->atom.type == handle->forge.URID)
+ const LV2_URID subj = subject && (subject->atom.type == ATOM__URID)
? subject->body
: 0;
@@ -9310,12 +9316,12 @@ port_event(LV2UI_Handle instance, uint32_t port_index, uint32_t size,
const LV2_Atom_Long *instance_access = NULL;
lv2_atom_object_get(body,
- handle->regs.core.plugin.urid, &plugin,
- handle->regs.synthpod.module_position_x.urid, &mod_pos_x,
- handle->regs.synthpod.module_position_y.urid, &mod_pos_y,
- handle->regs.synthpod.module_alias.urid, &mod_alias,
- handle->regs.ui.ui.urid, &ui_uri, //FIXME use this
- handle->regs.ui.instance_access.urid, &instance_access,
+ CORE__Plugin, &plugin,
+ SYNTHPOD__modulePositionX, &mod_pos_x,
+ SYNTHPOD__modulePositionY, &mod_pos_y,
+ SYNTHPOD__moduleAlias, &mod_alias,
+ UI__ui, &ui_uri, //FIXME use this
+ INSTANCE_ACCESS, &instance_access,
0); //FIXME query more
const LV2_URID urid = plugin
@@ -9349,36 +9355,36 @@ port_event(LV2UI_Handle instance, uint32_t port_index, uint32_t size,
_mod_init(handle, mod, plug);
}
- if(mod_pos_x && (mod_pos_x->atom.type == handle->forge.Float) && (mod_pos_x->body != 0.f) )
+ if(mod_pos_x && (mod_pos_x->atom.type == ATOM__Float) && (mod_pos_x->body != 0.f) )
{
mod->pos.x = mod_pos_x->body;
}
else if( _message_request(handle)
- && synthpod_patcher_set(&handle->regs, &handle->forge,
- mod->urn, 0, handle->regs.synthpod.module_position_x.urid,
- sizeof(float), handle->forge.Float, &mod->pos.x) )
+ && synthpod_patcher_set(&handle->forge,
+ mod->urn, 0, SYNTHPOD__modulePositionX,
+ sizeof(float), ATOM__Float, &mod->pos.x) )
{
_message_write(handle);
}
- if(mod_pos_y && (mod_pos_y->atom.type == handle->forge.Float) && (mod_pos_y->body != 0.f) )
+ if(mod_pos_y && (mod_pos_y->atom.type == ATOM__Float) && (mod_pos_y->body != 0.f) )
{
mod->pos.y = mod_pos_y->body;
}
else if( _message_request(handle)
- && synthpod_patcher_set(&handle->regs, &handle->forge,
- mod->urn, 0, handle->regs.synthpod.module_position_y.urid,
- sizeof(float), handle->forge.Float, &mod->pos.y) )
+ && synthpod_patcher_set(&handle->forge,
+ mod->urn, 0, SYNTHPOD__modulePositionY,
+ sizeof(float), ATOM__Float, &mod->pos.y) )
{
_message_write(handle);
}
- if(mod_alias && (mod_alias->atom.type == handle->forge.String) )
+ if(mod_alias && (mod_alias->atom.type == ATOM__String) )
{
strncpy(mod->alias, LV2_ATOM_BODY_CONST(&mod_alias->atom), ALIAS_MAX-1);
}
- if(instance_access && (instance_access->atom.type == handle->forge.Long) )
+ if(instance_access && (instance_access->atom.type == ATOM__Long) )
{
mod->dsp_instance = (LilvInstance *)instance_access->body;
}
@@ -9405,52 +9411,52 @@ port_event(LV2UI_Handle instance, uint32_t port_index, uint32_t size,
}
//TODO
}
- else if(obj->body.otype == handle->regs.patch.patch.urid)
+ else if(obj->body.otype == PATCH__Patch)
{
const LV2_Atom_URID *subject = NULL;
const LV2_Atom_Object *add = NULL;
const LV2_Atom_Object *rem = NULL;
lv2_atom_object_get(obj,
- handle->regs.patch.subject.urid, &subject,
- handle->regs.patch.add.urid, &add,
- handle->regs.patch.remove.urid, &rem,
+ PATCH__subject, &subject,
+ PATCH__add, &add,
+ PATCH__remove, &rem,
0);
- const LV2_URID subj = subject && (subject->atom.type == handle->forge.URID)
+ const LV2_URID subj = subject && (subject->atom.type == ATOM__URID)
? subject->body
: 0; //FIXME check
- if( add && (add->atom.type == handle->forge.Object)
- && rem && (rem->atom.type == handle->forge.Object) )
+ if( add && (add->atom.type == ATOM__Object)
+ && rem && (rem->atom.type == ATOM__Object) )
{
LV2_ATOM_OBJECT_FOREACH(rem, prop)
{
//_log_note(handle, "%s: got patch:remove for <%s>\n", __func__,
// handle->unmap->unmap(handle->unmap->handle, prop->key));
- if( (prop->key == handle->regs.synthpod.connection_list.urid)
- && (prop->value.type == handle->forge.Object) )
+ if( (prop->key == SYNTHPOD__connectionList)
+ && (prop->value.type == ATOM__Object) )
{
_rem_connection(handle, (const LV2_Atom_Object *)&prop->value);
}
- else if( (prop->key == handle->regs.synthpod.node_list.urid)
- && (prop->value.type == handle->forge.Object) )
+ else if( (prop->key == SYNTHPOD__nodeList)
+ && (prop->value.type == ATOM__Object) )
{
//FIXME never reached
}
- else if( (prop->key == handle->regs.synthpod.notification_list.urid)
- && (prop->value.type == handle->forge.Object) )
+ else if( (prop->key == SYNTHPOD__notificationList)
+ && (prop->value.type == ATOM__Object) )
{
//FIXME never reached
}
- else if( (prop->key == handle->regs.synthpod.module_list.urid)
- && (prop->value.type == handle->forge.URID) )
+ else if( (prop->key == SYNTHPOD__moduleList)
+ && (prop->value.type == ATOM__URID) )
{
_rem_mod(handle, (const LV2_Atom_URID *)&prop->value);
}
- else if( (prop->key == handle->regs.synthpod.automation_list.urid)
- && (prop->value.type == handle->forge.URID) )
+ else if( (prop->key == SYNTHPOD__automationList)
+ && (prop->value.type == ATOM__URID) )
{
//FIXME implement
}
@@ -9461,48 +9467,48 @@ port_event(LV2UI_Handle instance, uint32_t port_index, uint32_t size,
//_log_note(handle, "%s: got patch:add for <%s>\n", __func__,
// handle->unmap->unmap(handle->unmap->handle, prop->key));
- if( (prop->key == handle->regs.synthpod.connection_list.urid)
- && (prop->value.type == handle->forge.Object) )
+ if( (prop->key == SYNTHPOD__connectionList)
+ && (prop->value.type == ATOM__Object) )
{
_add_connection(handle, (const LV2_Atom_Object *)&prop->value);
}
- else if( (prop->key == handle->regs.synthpod.node_list.urid)
- && (prop->value.type == handle->forge.Object) )
+ else if( (prop->key == SYNTHPOD__nodeList)
+ && (prop->value.type == ATOM__Object) )
{
_add_node(handle, (const LV2_Atom_Object *)&prop->value);
}
- else if( (prop->key == handle->regs.synthpod.notification_list.urid)
- && (prop->value.type == handle->forge.Object) )
+ else if( (prop->key == SYNTHPOD__notificationList)
+ && (prop->value.type == ATOM__Object) )
{
_add_notification(handle, (const LV2_Atom_Object *)&prop->value);
}
- else if( (prop->key == handle->regs.synthpod.module_list.urid)
- && (prop->value.type == handle->forge.URID) )
+ else if( (prop->key == SYNTHPOD__moduleList)
+ && (prop->value.type == ATOM__URID) )
{
_add_mod(handle, (const LV2_Atom_URID *)&prop->value);
}
- else if( (prop->key == handle->regs.synthpod.automation_list.urid)
- && (prop->value.type == handle->forge.Object) )
+ else if( (prop->key == SYNTHPOD__automationList)
+ && (prop->value.type == ATOM__Object) )
{
_add_automation(handle, (const LV2_Atom_Object *)&prop->value);
}
}
}
}
- else if(obj->body.otype == handle->regs.patch.copy.urid)
+ else if(obj->body.otype == PATCH__Copy)
{
const LV2_Atom_URID *subject = NULL;
const LV2_Atom_URID *destination = NULL;
lv2_atom_object_get(obj,
- handle->regs.patch.subject.urid, &subject,
- handle->regs.patch.destination.urid, &destination,
+ PATCH__subject, &subject,
+ PATCH__destination, &destination,
0);
- const LV2_URID subj = subject && (subject->atom.type == handle->forge.URID)
+ const LV2_URID subj = subject && (subject->atom.type == ATOM__URID)
? subject->body
: 0;
- const LV2_URID dest = destination && (destination->atom.type == handle->forge.URID)
+ const LV2_URID dest = destination && (destination->atom.type == ATOM__URID)
? destination->body
: 0;
@@ -9517,7 +9523,7 @@ port_event(LV2UI_Handle instance, uint32_t port_index, uint32_t size,
: bndl;
// reload presets for this module
- mod->presets = _preset_reload(handle->world, &handle->regs, mod->plug,
+ mod->presets = _preset_reload(handle->world, handle->regs, mod->plug,
mod->presets, bndl);
}
}
@@ -9571,27 +9577,14 @@ static const LV2UI_Idle_Interface idle_ext = {
.idle = _idle
};
-static int
-_resize(LV2UI_Handle instance, int width, int height)
-{
- DBG;
- plughandle_t *handle = instance;
-
- return nk_pugl_resize(&handle->win, width, height);
-}
-
-static const LV2UI_Resize resize_ext = {
- .ui_resize = _resize
-};
-
static const void *
extension_data(const char *uri)
{
DBG;
if(!strcmp(uri, LV2_UI__idleInterface))
+ {
return &idle_ext;
- else if(!strcmp(uri, LV2_UI__resize))
- return &resize_ext;
+ }
return NULL;
}
diff --git a/plugins/synthpod_keyboard_nk.c b/plugins/synthpod_keyboard_nk.c
index fee95747..8c28f8f5 100644
--- a/plugins/synthpod_keyboard_nk.c
+++ b/plugins/synthpod_keyboard_nk.c
@@ -249,13 +249,10 @@ instantiate(const LV2UI_Descriptor *descriptor, const char *plugin_uri,
return NULL;
void *parent = NULL;
- LV2UI_Resize *host_resize = NULL;
for(int i=0; features[i]; i++)
{
if(!strcmp(features[i]->URI, LV2_UI__parent))
parent = features[i]->data;
- else if(!strcmp(features[i]->URI, LV2_UI__resize))
- host_resize = features[i]->data;
else if(!strcmp(features[i]->URI, LV2_URID__map))
handle->map = features[i]->data;
}
@@ -293,7 +290,7 @@ instantiate(const LV2UI_Descriptor *descriptor, const char *plugin_uri,
cfg->title = "Keyboard";
cfg->parent = (intptr_t)parent;
cfg->data = handle;
- cfg->host_resize = host_resize;
+ cfg->host_resize = NULL;
cfg->expose = _expose;
cfg->font.face = NULL;
cfg->font.size = 16;
@@ -338,25 +335,13 @@ static const LV2UI_Idle_Interface idle_ext = {
.idle = _idle
};
-static int
-_resize(LV2UI_Handle instance, int width, int height)
-{
- plughandle_t *handle = instance;
-
- return nk_pugl_resize(&handle->win, width, height);
-}
-
-static const LV2UI_Resize resize_ext = {
- .ui_resize = _resize
-};
-
static const void *
extension_data(const char *uri)
{
if(!strcmp(uri, LV2_UI__idleInterface))
+ {
return &idle_ext;
- else if(!strcmp(uri, LV2_UI__resize))
- return &resize_ext;
+ }
return NULL;
}
diff --git a/plugins/synthpod_stereo.c b/plugins/synthpod_stereo.c
index 380a3e0d..ecebb964 100644
--- a/plugins/synthpod_stereo.c
+++ b/plugins/synthpod_stereo.c
@@ -21,6 +21,7 @@
#include <synthpod_lv2.h>
#include <synthpod_app.h>
+#include <synthpod_stat.h>
#include <lv2/lv2plug.in/ns/ext/atom/atom.h>
#include <lv2/lv2plug.in/ns/ext/atom/forge.h>
@@ -463,13 +464,13 @@ instantiate(const LV2_Descriptor* descriptor, double rate,
opt++)
{
if( (opt->key == handle->uri.bufsz.max_block_length)
- && (opt->type == handle->forge.notify.Int) )
+ && (opt->type == ATOM__Int) )
handle->driver.max_block_size = *(int32_t *)opt->value;
else if( (opt->key == handle->uri.bufsz.min_block_length)
- && (opt->type == handle->forge.notify.Int) )
+ && (opt->type == ATOM__Int) )
handle->driver.min_block_size = *(int32_t *)opt->value;
else if( (opt->key == handle->uri.bufsz.sequence_size)
- && (opt->type == handle->forge.notify.Int) )
+ && (opt->type == ATOM__Int) )
handle->driver.seq_size = *(int32_t *)opt->value;
//TODO handle more options
}
@@ -647,7 +648,7 @@ _process_pre(plughandle_t *handle, uint32_t nsamples, bool bypassed)
const LV2_Atom *atom = &ev->body;
const LV2_Atom_Object *obj = (const LV2_Atom_Object *)atom;
- if(atom->type == handle->forge.notify.Object)
+ if(atom->type == ATOM__Object)
{
// copy com events to com buffer
if(sp_app_com_event(handle->app, obj->body.otype))
diff --git a/plugins/synthpod_ui.ttl b/plugins/synthpod_ui.ttl
index 3b1b07d4..e7ea3b33 100644
--- a/plugins/synthpod_ui.ttl
+++ b/plugins/synthpod_ui.ttl
@@ -32,9 +32,9 @@ synthpod:common_4_nk
lv2:symbol "notify" ;
ui:protocol atom:eventTransfer ;
] ;
- lv2:optionalFeature ui:resize, log:log, ui:portSubscribe, opts:options, ui:requestValue, instacc: ;
+ lv2:optionalFeature log:log, ui:portSubscribe, opts:options, ui:requestValue, instacc: ;
lv2:requiredFeature ui:portMap, urid:map, urid:unmap, ui:idleInterface, ui:parent ;
- lv2:extensionData ui:idleInterface, ui:resize ;
+ lv2:extensionData ui:idleInterface ;
opts:supportedOption param:sampleRate, ui:updateRate, ui:scaleFactor .
synthpod:root_4_nk
ui:portNotification [
@@ -42,9 +42,9 @@ synthpod:root_4_nk
lv2:symbol "notify" ;
ui:protocol atom:eventTransfer ;
] ;
- lv2:optionalFeature ui:resize, log:log, ui:portSubscribe, opts:options, ui:requestValue, instacc: ;
+ lv2:optionalFeature log:log, ui:portSubscribe, opts:options, ui:requestValue, instacc: ;
lv2:requiredFeature ui:portMap, urid:map, urid:unmap, ui:idleInterface, ui:parent ;
- lv2:extensionData ui:idleInterface, ui:resize ;
+ lv2:extensionData ui:idleInterface ;
opts:supportedOption param:sampleRate, ui:updateRate, ui:scaleFactor .
# D2TK UIs
@@ -54,9 +54,9 @@ synthpod:common_5_d2tk
lv2:symbol "notify" ;
ui:protocol atom:eventTransfer ;
] ;
- lv2:optionalFeature ui:resize, log:log, ui:portSubscribe, opts:options, ui:requestValue, instacc: ;
+ lv2:optionalFeature log:log, ui:portSubscribe, opts:options, ui:requestValue, instacc: ;
lv2:requiredFeature ui:portMap, urid:map, urid:unmap, ui:idleInterface, ui:parent ;
- lv2:extensionData ui:idleInterface, ui:resize ;
+ lv2:extensionData ui:idleInterface ;
opts:supportedOption param:sampleRate, ui:updateRate, ui:scaleFactor .
synthpod:root_5_d2tk
ui:portNotification [
@@ -64,13 +64,13 @@ synthpod:root_5_d2tk
lv2:symbol "notify" ;
ui:protocol atom:eventTransfer ;
] ;
- lv2:optionalFeature ui:resize, log:log, ui:portSubscribe, opts:options, ui:requestValue, instacc: ;
+ lv2:optionalFeature log:log, ui:portSubscribe, opts:options, ui:requestValue, instacc: ;
lv2:requiredFeature ui:portMap, urid:map, urid:unmap, ui:idleInterface, ui:parent ;
- lv2:extensionData ui:idleInterface, ui:resize ;
+ lv2:extensionData ui:idleInterface ;
opts:supportedOption param:sampleRate, ui:updateRate, ui:scaleFactor .
# Keyboard UIs
synthpod:keyboard_4_nk
- lv2:optionalFeature ui:resize ;
+ lv2:optionalFeature ;
lv2:requiredFeature ui:idleInterface, urid:map, ui:parent ;
- lv2:extensionData ui:idleInterface, ui:resize .
+ lv2:extensionData ui:idleInterface .
diff --git a/sandbox_ui.lv2/meson.build b/sandbox_ui.lv2/meson.build
index 40d4ef45..48c3563e 100644
--- a/sandbox_ui.lv2/meson.build
+++ b/sandbox_ui.lv2/meson.build
@@ -1,9 +1,11 @@
-sbox_master = static_library('sbox_master', 'sandbox_master.c',
+sbox_master = static_library('sbox_master',
+ ['sandbox_master.c'],
include_directories : [varchunk_incs, mapper_incs, netatom_incs],
c_args : c_args,
dependencies : [lv2_dep, lilv_dep])
-sbox_slave = static_library('sbox_slave', 'sandbox_slave.c',
- include_directories : [varchunk_incs, mapper_incs, netatom_incs, xpress_incs],
+sbox_slave = static_library('sbox_slave',
+ ['sandbox_slave.c', '../bin/synthpod_stat.c'], #FIXME
+ include_directories : [inc_incs, ardour_incs, varchunk_incs, mapper_incs, netatom_incs, xpress_incs, extui_incs, osc_incs, canvas_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 d545d1ad..911ef838 100644
--- a/sandbox_ui.lv2/sandbox_slave.c
+++ b/sandbox_ui.lv2/sandbox_slave.c
@@ -24,6 +24,7 @@
#include <ctype.h>
#include <pthread.h>
+#include <synthpod_stat.h>
#include <sandbox_slave.h>
#include <sandbox_io.h>
@@ -33,7 +34,6 @@
#include <lv2/lv2plug.in/ns/ext/options/options.h>
#include <lv2/lv2plug.in/ns/ext/atom/forge.h>
#include <lv2/lv2plug.in/ns/ext/patch/patch.h>
-#include <lv2/lv2plug.in/ns/ext/uri-map/uri-map.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>
@@ -48,10 +48,6 @@ struct _sandbox_slave_t {
LV2_URID_Map *map;
LV2_URID_Unmap *unmap;
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
- LV2_URI_Map_Feature uri_id;
-#pragma GCC diagnostic pop
LV2_Atom_Forge forge;
@@ -75,8 +71,6 @@ struct _sandbox_slave_t {
xpress_map_t xmap;
xpress_t xpress;
- LV2UI_Resize host_resize;
-
LilvWorld *world;
LilvNode *plugin_bundle_node;
LilvNode *ui_bundle_node;
@@ -371,7 +365,9 @@ _request_value(LV2UI_Feature_Handle handle, LV2_URID key, LV2_URID type,
*endl = '\0';
}
- if(type == sb->forge.Path)
+ switch(type)
+ {
+ case ATOM__Path:
{
const uint32_t nports = lilv_plugin_get_num_ports(sb->plug);
LilvNode *patch_message_node = lilv_new_uri(sb->world, LV2_PATCH__Message);
@@ -417,10 +413,10 @@ _request_value(LV2UI_Feature_Handle handle, LV2_URID key, LV2_URID type,
lilv_node_free(core_inputport_node);
lilv_node_free(atom_atomport_node);
- return LV2UI_REQUEST_VALUE_SUCCESS;
- }
- else if( (type == sb->forge.String)
- || (type == sb->forge.Chunk) )
+ } return LV2UI_REQUEST_VALUE_SUCCESS;
+ case ATOM__String:
+ /* fall-through */
+ case ATOM__Chunk:
{
const uint32_t nports = lilv_plugin_get_num_ports(sb->plug);
LilvNode *patch_message_node = lilv_new_uri(sb->world, LV2_PATCH__Message);
@@ -473,7 +469,7 @@ _request_value(LV2UI_Feature_Handle handle, LV2_URID key, LV2_URID type,
lv2_atom_forge_key(&sb->forge, sb->patch_property);
lv2_atom_forge_urid(&sb->forge, key);
lv2_atom_forge_key(&sb->forge, sb->patch_value);
- if(type == sb->forge.String)
+ if(type == ATOM__String)
{
lv2_atom_forge_string(&sb->forge, (char *)body, body_len);
}
@@ -495,7 +491,7 @@ _request_value(LV2UI_Feature_Handle handle, LV2_URID key, LV2_URID type,
lilv_node_free(atom_atomport_node);
lilv_node_free(patch_message_node);
- return LV2UI_REQUEST_VALUE_SUCCESS;
+ } return LV2UI_REQUEST_VALUE_SUCCESS;
}
return LV2UI_REQUEST_VALUE_ERR_UNSUPPORTED;
@@ -515,18 +511,6 @@ _sandbox_recv_cb(LV2UI_Handle handle, uint32_t index, uint32_t size,
return true; // continue handling messages
}
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-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);
-}
-#pragma GCC diagnostic pop
-
static uint32_t
_voice_map_new_uuid(void *data, uint32_t flags __attribute__((unused)))
{
@@ -731,10 +715,8 @@ sandbox_slave_new(int argc, char **argv, const sandbox_slave_driver_t *driver,
sb->request_value.handle = sb;
sb->request_value.request= _request_value;
- sb->host_resize.handle = data;
- sb->host_resize.ui_resize = driver->resize_cb;
-
- if(!(sb->mapper = mapper_new(0x1000000, 0, NULL, NULL, NULL, NULL))) // 16M
+ if(!(sb->mapper = mapper_new(0x20000, STAT_URID_MAX, stat_uris,
+ NULL, NULL, NULL))) // 16M
{
fprintf(stderr, "mapper_new failed\n");
goto fail;
@@ -742,8 +724,6 @@ sandbox_slave_new(int argc, char **argv, const sandbox_slave_driver_t *driver,
sb->map = mapper_get_map(sb->mapper);
sb->unmap = mapper_get_unmap(sb->mapper);
- sb->uri_id.callback_data = sb;
- sb->uri_id.uri_to_id = _sb_uri_to_id;
lv2_atom_forge_init(&sb->forge, sb->map);
@@ -996,7 +976,7 @@ sandbox_slave_instantiate(sandbox_slave_t *sb, const LV2_Feature *parent_feature
.subject = 0,
.key = sb->io.ui_window_title,
.size = strlen(sb->plugin_uri) + 1,
- .type = sb->io.forge.String,
+ .type = ATOM__String,
.value = sb->plugin_uri
},
[1] = {
@@ -1004,7 +984,7 @@ sandbox_slave_instantiate(sandbox_slave_t *sb, const LV2_Feature *parent_feature
.subject = 0,
.key = sb->io.params_sample_rate,
.size = sizeof(float),
- .type = sb->io.forge.Float,
+ .type = ATOM__Float,
.value = &sb->sample_rate
},
[2] = {
@@ -1012,7 +992,7 @@ sandbox_slave_instantiate(sandbox_slave_t *sb, const LV2_Feature *parent_feature
.subject = 0,
.key = sb->io.ui_update_rate,
.size = sizeof(float),
- .type = sb->io.forge.Float,
+ .type = ATOM__Float,
.value = &sb->update_rate
},
[3] = {
@@ -1020,7 +1000,7 @@ sandbox_slave_instantiate(sandbox_slave_t *sb, const LV2_Feature *parent_feature
.subject = 0,
.key = sb->io.ui_scale_factor,
.size = sizeof(float),
- .type = sb->io.forge.Float,
+ .type = ATOM__Float,
.value = &sb->scale_factor
},
[4] = {
@@ -1028,7 +1008,7 @@ sandbox_slave_instantiate(sandbox_slave_t *sb, const LV2_Feature *parent_feature
.subject = 0,
.key = sb->io.ui_background_color,
.size = sizeof(int32_t),
- .type = sb->io.forge.Int,
+ .type = ATOM__Int,
.value = &sb->background_color
},
[5] = {
@@ -1036,7 +1016,7 @@ sandbox_slave_instantiate(sandbox_slave_t *sb, const LV2_Feature *parent_feature
.subject = 0,
.key = sb->io.ui_foreground_color,
.size = sizeof(int32_t),
- .type = sb->io.forge.Int,
+ .type = ATOM__Int,
.value = &sb->foreground_color
},
[6] = {
@@ -1053,10 +1033,6 @@ 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
@@ -1085,10 +1061,6 @@ sandbox_slave_instantiate(sandbox_slave_t *sb, const LV2_Feature *parent_feature
.URI = XPRESS__voiceMap,
.data = &sb->xmap
};
- const LV2_Feature resize_feature = {
- .URI = LV2_UI__resize,
- .data = &sb->host_resize
- };
const LV2_Feature instance_access_feature = {
.URI = LV2_INSTANCE_ACCESS_URI,
.data = dsp_handle
@@ -1099,10 +1071,9 @@ sandbox_slave_instantiate(sandbox_slave_t *sb, const LV2_Feature *parent_feature
};
unsigned i = 0;
- const LV2_Feature *features [16];
+ const LV2_Feature *features [12];
features[i++] = &map_feature;
features[i++] = &unmap_feature;
- features[i++] = &uri_id_feature;
features[i++] = &log_feature;
features[i++] = &port_map_feature;
features[i++] = &port_subscribe_feature;
@@ -1110,10 +1081,6 @@ sandbox_slave_instantiate(sandbox_slave_t *sb, const LV2_Feature *parent_feature
features[i++] = &request_value_feature;
features[i++] = &options_feature;
features[i++] = &voice_map_feature;
- if(sb->host_resize.ui_resize)
- {
- features[i++] = &resize_feature;
- }
if(parent_feature)
{
features[i++] = parent_feature;
@@ -1128,7 +1095,7 @@ sandbox_slave_instantiate(sandbox_slave_t *sb, const LV2_Feature *parent_feature
}
features[i] = NULL;
- assert(i <= 16);
+ assert(i <= 13);
//FIXME check features
diff --git a/sandbox_ui.lv2/sandbox_slave.h b/sandbox_ui.lv2/sandbox_slave.h
index 2cf5a4fb..ad1ab061 100644
--- a/sandbox_ui.lv2/sandbox_slave.h
+++ b/sandbox_ui.lv2/sandbox_slave.h
@@ -34,7 +34,6 @@ typedef struct _sandbox_slave_driver_t sandbox_slave_driver_t;
typedef int (*sandbox_slave_driver_init_t)(sandbox_slave_t *sb, void *data);
typedef void (*sandbox_slave_driver_run_t)(sandbox_slave_t *sb, float update_rate, void *data);
typedef void (*sandbox_slave_driver_deinit_t)(void *data);
-typedef int (*sandbox_slave_driver_resize_t)(void *data, int width, int height);
typedef int (*sandbox_slave_driver_request_t)(void *data, LV2_URID key,
size_t len, char *path);
@@ -42,7 +41,6 @@ struct _sandbox_slave_driver_t {
sandbox_slave_driver_init_t init_cb;
sandbox_slave_driver_run_t run_cb;
sandbox_slave_driver_deinit_t deinit_cb;
- sandbox_slave_driver_resize_t resize_cb;
sandbox_slave_driver_request_t request_cb;
};