Commit db160cef authored by Hanspeter Portner's avatar Hanspeter Portner

support parameter of type Nil.

parent 57a8fd13
......@@ -5,4 +5,3 @@
* gui: clipboard support
* gui: external editor
* gui: control port dials
* gui: nil parameter as place holder
......@@ -34,8 +34,8 @@ _lstateresponder_register_access(lua_State *L, moony_t *moony, int64_t frames,
// uses 'key' (at index -2) and 'value' (at index -1)
const LV2_URID key = luaL_checkinteger(L, -2);
const char *label = "undefined"; // fallback
LV2_URID range = moony->forge.Int; // fallback
const char *label = ""; // fallback
LV2_URID range = 0; // fallback
if(lua_geti(L, -1, moony->uris.rdfs_label) == LUA_TSTRING)
label = lua_tostring(L, -1);
......@@ -422,7 +422,7 @@ _lstateresponder__call(lua_State *L)
if(found_it)
{
LV2_URID range = moony->forge.Int; // fallback
LV2_URID range = 0; // fallback
// get atom type
if(lua_geti(L, -1, moony->uris.rdfs_range) == LUA_TNUMBER)
......@@ -609,7 +609,7 @@ _lstateresponder_stash(lua_State *L)
{
// uses 'key' (at index -2) and 'value' (at index -1)
const LV2_URID key = luaL_checkinteger(L, -2);
LV2_URID range = lforge->forge->Int; // fallback
LV2_URID range = 0; // fallback
if(lua_geti(L, -1, moony->uris.rdfs_range) == LUA_TNUMBER) // prop[RDFS.range]
range = lua_tointeger(L, -1);
......
......@@ -730,6 +730,8 @@ _prop_free(plughandle_t *handle, prop_t *prop)
if(prop->points)
free(prop->points);
prop->key = 0;
}
LV2_Atom_Forge_Ref
......@@ -1748,6 +1750,14 @@ _parameter_widget_chunk(plughandle_t *handle, struct nk_context *ctx, prop_t *pr
}
}
static void
_parameter_widget_nil(plughandle_t *handle, struct nk_context *ctx, prop_t *prop,
bool editable, bool has_shift_enter, float dy, int ndy)
{
nk_layout_row_dynamic(ctx, dy*(ndy-1), 1);
nk_spacing(ctx, 1);
}
static void
_parameter_widget_unsupported(plughandle_t *handle, struct nk_context *ctx, prop_t *prop,
bool editable, bool has_shift_enter, float dy, int ndy)
......@@ -1800,6 +1810,10 @@ _parameter_widget(plughandle_t *handle, struct nk_context *ctx, prop_t *prop,
{
_parameter_widget_chunk(handle, ctx, prop, editable, has_shift_enter, dy, ndy);
}
else if(prop->range == 0)
{
_parameter_widget_nil(handle, ctx, prop, editable, has_shift_enter, dy, ndy);
}
else
{
_parameter_widget_unsupported(handle, ctx, prop, editable, has_shift_enter, dy, ndy);
......@@ -2122,7 +2136,7 @@ _expose(struct nk_context *ctx, struct nk_rect wbounds, void *data)
for(int p = 0; p < handle->n_writable; p++)
{
prop_t *prop = &handle->writables[p];
if(!prop->key || !prop->range || !prop->label) // marked for removal
if(!prop->key) // marked for removal
continue;
_parameter_widget(handle, ctx, prop, true, has_shift_enter, dy, ndy);
......@@ -2130,7 +2144,7 @@ _expose(struct nk_context *ctx, struct nk_rect wbounds, void *data)
for(int p = 0; p < handle->n_readable; p++)
{
prop_t *prop = &handle->readables[p];
if(!prop->key || !prop->range || !prop->label) // marked for removal
if(!prop->key) // marked for removal
continue;
_parameter_widget(handle, ctx, prop, false, has_shift_enter, dy, ndy);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment