aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2016-01-21 18:27:06 +0100
committerHanspeter Portner <dev@open-music-kontrollers.ch>2016-01-21 18:27:06 +0100
commit72a1ee32ce83cc003cdf348d30a0f33bcd341fbf (patch)
tree4b229b4a11dac65deb188555d11d74525d54ba47
parent960f8f6dce806536180abee6ef4af2407192de7a (diff)
downloadsherlock.lv2-72a1ee32ce83cc003cdf348d30a0f33bcd341fbf.tar.xz
add support for rdfs:comment.
-rw-r--r--props.h17
-rw-r--r--test/props.c7
-rw-r--r--test/props.ttl10
3 files changed, 32 insertions, 2 deletions
diff --git a/props.h b/props.h
index e4bb632..1494fc5 100644
--- a/props.h
+++ b/props.h
@@ -112,6 +112,7 @@ struct _props_scale_point_t {
struct _props_def_t {
const char *label;
+ const char *comment;
const char *property;
const char *access;
const char *unit;
@@ -165,6 +166,7 @@ struct _props_t {
LV2_URID rdfs_label;
LV2_URID rdfs_range;
+ LV2_URID rdfs_comment;
LV2_URID lv2_minimum;
LV2_URID lv2_maximum;
@@ -581,6 +583,11 @@ _props_reg(props_t *props, LV2_Atom_Forge *forge, uint32_t frames, props_impl_t
ref = lv2_atom_forge_urid(forge, props->urid.patch_wildcard);
if(ref)
+ ref = lv2_atom_forge_key(forge, props->urid.rdfs_comment);
+ if(ref)
+ ref = lv2_atom_forge_urid(forge, props->urid.patch_wildcard);
+
+ if(ref)
ref = lv2_atom_forge_key(forge, props->urid.lv2_minimum);
if(ref)
ref = lv2_atom_forge_urid(forge, props->urid.patch_wildcard);
@@ -621,6 +628,14 @@ _props_reg(props_t *props, LV2_Atom_Forge *forge, uint32_t frames, props_impl_t
ref = lv2_atom_forge_string(forge, def->label, strlen(def->label));
}
+ if(def->comment)
+ {
+ if(ref)
+ ref = lv2_atom_forge_key(forge, props->urid.rdfs_comment);
+ if(ref)
+ ref = lv2_atom_forge_string(forge, def->comment, strlen(def->comment));
+ }
+
if(ref)
ref = lv2_atom_forge_key(forge, props->urid.lv2_minimum);
if(ref)
@@ -709,6 +724,8 @@ props_init(props_t *props, const size_t max_nimpls, const char *subject,
"http://www.w3.org/2000/01/rdf-schema#label");
props->urid.rdfs_range = map->map(map->handle,
"http://www.w3.org/2000/01/rdf-schema#range");
+ props->urid.rdfs_comment = map->map(map->handle,
+ "http://www.w3.org/2000/01/rdf-schema#comment");
props->urid.lv2_minimum = map->map(map->handle, LV2_CORE__minimum);
props->urid.lv2_maximum = map->map(map->handle, LV2_CORE__maximum);
diff --git a/test/props.c b/test/props.c
index c466592..5916b8f 100644
--- a/test/props.c
+++ b/test/props.c
@@ -70,6 +70,7 @@ struct _plughandle_t {
static const props_def_t dyn1 = {
.label = "Int",
+ .comment = "This is a 32-bit integer",
.property = PROPS_PREFIX"Int",
.access = LV2_PATCH__writable,
.unit = LV2_UNITS__hz,
@@ -81,6 +82,7 @@ static const props_def_t dyn1 = {
static const props_def_t dyn2 = {
.label = "Long",
+ .comment = "This is a 64-bit integer",
.property = PROPS_PREFIX"Long",
.access = LV2_PATCH__readable,
.unit = LV2_UNITS__khz,
@@ -92,6 +94,7 @@ static const props_def_t dyn2 = {
static const props_def_t dyn3 = {
.label = "Float",
+ .comment = "This is a 32-bit floating point",
.property = PROPS_PREFIX"Float",
.access = LV2_PATCH__writable,
.unit = LV2_UNITS__mhz,
@@ -103,6 +106,7 @@ static const props_def_t dyn3 = {
static const props_def_t dyn4 = {
.label = "Double",
+ .comment = "This is a 64-bit floating point",
.property = PROPS_PREFIX"Double",
.access = LV2_PATCH__readable,
.unit = LV2_UNITS__db,
@@ -122,6 +126,7 @@ static const props_scale_point_t scale_points5 [] = {
static const props_def_t dyn5 = {
.label = "scaleInt",
+ .comment = "This is a 32-bit integer enumeration",
.property = PROPS_PREFIX"scaleInt",
.access = LV2_PATCH__writable,
.type = LV2_ATOM__Int,
@@ -133,6 +138,7 @@ static const props_def_t dyn5 = {
static const props_def_t dyn6 = {
.label = "Bool",
+ .comment = "This is a boolean",
.property = PROPS_PREFIX"Bool",
.access = LV2_PATCH__writable,
.type = LV2_ATOM__Bool,
@@ -143,6 +149,7 @@ static const props_def_t dyn6 = {
static const props_def_t dyn7 = {
.label = "String",
+ .comment = "This is a string",
.property = PROPS_PREFIX"String",
.access = LV2_PATCH__writable,
.type = LV2_ATOM__String,
diff --git a/test/props.ttl b/test/props.ttl
index 451665c..7c5e111 100644
--- a/test/props.ttl
+++ b/test/props.ttl
@@ -49,6 +49,7 @@ props:statInt
a lv2:Parameter ;
rdfs:range atom:Int ;
rdfs:label "statInt" ;
+ rdfs:comment "This is a 32-bit integer" ;
units:unit units:hz ;
lv2:minimum 0 ;
lv2:maximum 10 .
@@ -57,6 +58,7 @@ props:statLong
a lv2:Parameter ;
rdfs:range atom:Long ;
rdfs:label "statLong" ;
+ rdfs:comment "This is a 64-bit integer" ;
units:unit units:khz ;
lv2:minimum 0 ;
lv2:maximum 20 .
@@ -65,6 +67,7 @@ props:statFloat
a lv2:Parameter ;
rdfs:range atom:Float ;
rdfs:label "statFloat" ;
+ rdfs:comment "This is a 32-bit float" ;
units:unit units:mhz ;
lv2:minimum -0.5 ;
lv2:maximum 0.5 .
@@ -73,6 +76,7 @@ props:statDouble
a lv2:Parameter ;
rdfs:range atom:Double ;
rdfs:label "statDouble" ;
+ rdfs:comment "This is a 64-bit double" ;
units:unit units:db ;
lv2:minimum -1.0 ;
lv2:maximum 1.0 .
@@ -80,12 +84,14 @@ props:statDouble
props:statString
a lv2:Parameter ;
rdfs:range atom:String ;
- rdfs:label "statString" .
+ rdfs:label "statString" ;
+ rdfs:comment "This is a string" .
props:statPath
a lv2:Parameter ;
rdfs:range atom:Path ;
- rdfs:label "statPath" .
+ rdfs:label "statPath" ;
+ rdfs:comment "This is a path" .
# Looper Test
props:test