aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2019-04-03 19:19:49 +0200
committerGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2019-04-03 19:19:49 +0200
commit6297ed217f343e60dfc08e71a056cb287301d631 (patch)
tree15cae59f3570a4043eb469d01a4e61f63f0db723
parent46a4257545c66cd9e52504cb3ecb622c24af260d (diff)
parent348ed9350f500096fe4f717ebf30a2b5af5e0218 (diff)
downloadlink.lv2-6297ed217f343e60dfc08e71a056cb287301d631.zip
link.lv2-6297ed217f343e60dfc08e71a056cb287301d631.tar.gz
link.lv2-6297ed217f343e60dfc08e71a056cb287301d631.tar.bz2
link.lv2-6297ed217f343e60dfc08e71a056cb287301d631.tar.xz
Merge branch 'master' of /media/sdext/omk/link.lv2
-rw-r--r--.gitlab-ci.yml3
-rw-r--r--VERSION2
-rw-r--r--props.lv2/VERSION2
-rw-r--r--props.lv2/props.h113
-rw-r--r--props.lv2/test/props.ttl2
5 files changed, 60 insertions, 62 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2d770e6..859fc6f 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -19,7 +19,8 @@ stages:
.build_template: &build_definition
<<: *common_definition
script:
- - meson --prefix="/" --libdir="lib" --cross-file "${CI_BUILD_NAME}" build
+ - meson --prefix="/opt/${CI_BUILD_NAME}" --libdir="lib" --cross-file "${CI_BUILD_NAME}" -Db_lto=false build
+ - sed -i -e '/framework/s/-Wl,-O1//g' -e '/framework/s/-Wl,--start-group//g' -e '/framework/s/-Wl,--end-group//g' -e '/framework/s/-Wl,-soname,.*dylib//g' build/build.ninja
- ninja -C build
- DESTDIR="${CI_PROJECT_DIR}/${BASE_NAME}-$(cat VERSION)/${CI_BUILD_NAME}" ninja -C build install
diff --git a/VERSION b/VERSION
index 37f868f..c892edd 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.41
+0.1.51
diff --git a/props.lv2/VERSION b/props.lv2/VERSION
index 496a825..3234805 100644
--- a/props.lv2/VERSION
+++ b/props.lv2/VERSION
@@ -1 +1 @@
-0.1.91
+0.1.101
diff --git a/props.lv2/props.h b/props.lv2/props.h
index 463e123..9aad570 100644
--- a/props.lv2/props.h
+++ b/props.lv2/props.h
@@ -53,6 +53,7 @@ struct _props_def_t {
const char *type;
const char *access;
size_t offset;
+ bool hidden;
uint32_t max_size;
props_event_cb_t event_cb;
@@ -120,12 +121,12 @@ struct _props_t {
uint32_t max_size;
unsigned nimpls;
- props_impl_t impls [0];
+ props_impl_t impls [1];
};
#define PROPS_T(PROPS, MAX_NIMPLS) \
props_t (PROPS); \
- props_impl_t _impls [(MAX_NIMPLS)]
+ props_impl_t _impls [MAX_NIMPLS]
// rt-safe
static inline int
@@ -223,52 +224,40 @@ _props_restoring_set(props_t *props)
atomic_store_explicit(&props->restoring, true, memory_order_release);
}
-static inline void
-_props_qsort(props_impl_t *A, int n)
+static inline props_impl_t *
+_props_impl_get(props_t *props, LV2_URID property)
{
- if(n < 2)
- return;
-
- const props_impl_t *p = A;
-
- int i = -1;
- int j = n;
-
- while(true)
+ for(unsigned i = 0, idx = (property + i) % props->nimpls;
+ i < props->nimpls;
+ i++, idx = (property + i) % props->nimpls)
{
- do {
- i += 1;
- } while(A[i].property < p->property);
-
- do {
- j -= 1;
- } while(A[j].property > p->property);
-
- if(i >= j)
- break;
+ props_impl_t *impl = &props->impls[idx];
- const props_impl_t tmp = A[i];
- A[i] = A[j];
- A[j] = tmp;
+ if(impl->property == property)
+ {
+ return impl;
+ }
}
- _props_qsort(A, j + 1);
- _props_qsort(A + j + 1, n - j - 1);
+ return NULL;
}
static inline props_impl_t *
-_props_bsearch(props_t *props, LV2_URID property)
+_props_impl_add(props_t *props, LV2_URID property)
{
- props_impl_t *base = props->impls;
-
- for(int N = props->nimpls, half; N > 1; N -= half)
+ for(unsigned i = 0, idx = (property + i) % props->nimpls;
+ i < props->nimpls;
+ i++, idx = (property + i) % props->nimpls)
{
- half = N/2;
- props_impl_t *dst = &base[half];
- base = (dst->property > property) ? base : dst;
+ props_impl_t *impl = &props->impls[idx];
+
+ if(impl->property == 0)
+ {
+ return impl;
+ }
}
- return (base->property == property) ? base : NULL;
+ return NULL;
}
static inline LV2_Atom_Forge_Ref
@@ -390,7 +379,7 @@ _props_impl_restore(props_t *props, LV2_Atom_Forge *forge, uint32_t frames,
_props_impl_unlock(impl, PROP_STATE_NONE);
- if(*ref)
+ if(*ref && !impl->def->hidden)
*ref = _props_patch_set(props, forge, frames, impl, 0);
const props_def_t *def = impl->def;
@@ -417,7 +406,7 @@ static inline int
_props_impl_init(props_t *props, props_impl_t *impl, const props_def_t *def,
void *value_base, void *stash_base, LV2_URID_Map *map)
{
- if(!def->property || !def->type)
+ if(!impl || !def->property || !def->type)
return 0;
const LV2_URID type = map->map(map->handle, def->type);
@@ -536,14 +525,14 @@ props_init(props_t *props, const char *subject,
int status = 1;
for(unsigned i = 0; i < props->nimpls; i++)
{
- props_impl_t *impl = &props->impls[i];
+ const props_def_t *def = &defs[i];
+ const LV2_URID property = map->map(map->handle, def->property);
+ props_impl_t *impl = _props_impl_add(props, property);
status = status
- && _props_impl_init(props, impl, &defs[i], value_base, stash_base, map);
+ && _props_impl_init(props, impl, def, value_base, stash_base, map);
}
- _props_qsort(props->impls, props->nimpls);
-
return status;
}
@@ -616,7 +605,7 @@ props_advance(props_t *props, LV2_Atom_Forge *forge, uint32_t frames,
{
props_impl_t *impl = &props->impls[i];
- if(*ref)
+ if(*ref && !impl->def->hidden)
*ref = _props_patch_set(props, forge, frames, impl, sequence_num);
}
@@ -624,22 +613,25 @@ props_advance(props_t *props, LV2_Atom_Forge *forge, uint32_t frames,
}
else if(property->atom.type == props->urid.atom_urid)
{
- props_impl_t *impl = _props_bsearch(props, property->body);
+ props_impl_t *impl = _props_impl_get(props, property->body);
if(impl)
{
- *ref = _props_patch_set(props, forge, frames, impl, sequence_num);
+ if(*ref && !impl->def->hidden)
+ *ref = _props_patch_set(props, forge, frames, impl, sequence_num);
return 1;
}
else if(sequence_num)
{
- *ref = _props_patch_error(props, forge, frames, sequence_num);
+ if(*ref)
+ *ref = _props_patch_error(props, forge, frames, sequence_num);
}
}
else if(sequence_num)
{
- *ref = _props_patch_error(props, forge, frames, sequence_num);
+ if(*ref)
+ *ref = _props_patch_error(props, forge, frames, sequence_num);
}
}
else if(obj->body.otype == props->urid.patch_set)
@@ -674,13 +666,14 @@ props_advance(props_t *props, LV2_Atom_Forge *forge, uint32_t frames,
{
if(sequence_num)
{
- *ref = _props_patch_error(props, forge, frames, sequence_num);
+ if(ref)
+ *ref = _props_patch_error(props, forge, frames, sequence_num);
}
return 0;
}
- props_impl_t *impl = _props_bsearch(props, property->body);
+ props_impl_t *impl = _props_impl_get(props, property->body);
if(impl && (impl->access == props->urid.patch_writable) )
{
_props_impl_set(props, impl, value->type, value->size,
@@ -692,14 +685,16 @@ props_advance(props_t *props, LV2_Atom_Forge *forge, uint32_t frames,
if(sequence_num)
{
- *ref = _props_patch_ack(props, forge, frames, sequence_num);
+ if(*ref)
+ *ref = _props_patch_ack(props, forge, frames, sequence_num);
}
return 1;
}
else if(sequence_num)
{
- *ref = _props_patch_error(props, forge, frames, sequence_num);
+ if(*ref)
+ *ref = _props_patch_error(props, forge, frames, sequence_num);
}
}
else if(obj->body.otype == props->urid.patch_put)
@@ -732,7 +727,8 @@ props_advance(props_t *props, LV2_Atom_Forge *forge, uint32_t frames,
{
if(sequence_num)
{
- *ref = _props_patch_error(props, forge, frames, sequence_num);
+ if(*ref)
+ *ref = _props_patch_error(props, forge, frames, sequence_num);
}
return 0;
@@ -743,7 +739,7 @@ props_advance(props_t *props, LV2_Atom_Forge *forge, uint32_t frames,
const LV2_URID property = prop->key;
const LV2_Atom *value = &prop->value;
- props_impl_t *impl = _props_bsearch(props, property);
+ props_impl_t *impl = _props_impl_get(props, property);
if(impl && (impl->access == props->urid.patch_writable) )
{
_props_impl_set(props, impl, value->type, value->size,
@@ -757,7 +753,8 @@ props_advance(props_t *props, LV2_Atom_Forge *forge, uint32_t frames,
if(sequence_num)
{
- *ref = _props_patch_ack(props, forge, frames, sequence_num);
+ if(*ref)
+ *ref = _props_patch_ack(props, forge, frames, sequence_num);
}
return 1;
@@ -770,13 +767,13 @@ static inline void
props_set(props_t *props, LV2_Atom_Forge *forge, uint32_t frames,
LV2_URID property, LV2_Atom_Forge_Ref *ref)
{
- props_impl_t *impl = _props_bsearch(props, property);
+ props_impl_t *impl = _props_impl_get(props, property);
if(impl)
{
_props_impl_stash(props, impl);
- if(*ref) //TODO use patch:sequenceNumber
+ if(*ref && !impl->def->hidden) //TODO use patch:sequenceNumber
*ref = _props_patch_set(props, forge, frames, impl, 0);
}
}
@@ -784,7 +781,7 @@ props_set(props_t *props, LV2_Atom_Forge *forge, uint32_t frames,
static inline void
props_stash(props_t *props, LV2_URID property)
{
- props_impl_t *impl = _props_bsearch(props, property);
+ props_impl_t *impl = _props_impl_get(props, property);
if(impl)
_props_impl_stash(props, impl);
@@ -807,7 +804,7 @@ props_map(props_t *props, const char *uri)
static inline const char *
props_unmap(props_t *props, LV2_URID property)
{
- props_impl_t *impl = _props_bsearch(props, property);
+ props_impl_t *impl = _props_impl_get(props, property);
if(impl)
return impl->def->property;
diff --git a/props.lv2/test/props.ttl b/props.lv2/test/props.ttl
index 0ce45d6..b9456d6 100644
--- a/props.lv2/test/props.ttl
+++ b/props.lv2/test/props.ttl
@@ -147,6 +147,6 @@ props:test
props:statInt 4 ;
props:statFloat "0.4"^^xsd:float ;
props:statString "Hello world" ;
- props:statPath <props.ttl> ;
+ props:statPath <file://tmp/props.ttl> ;
props:statChunk "AQIDBAUGBw=="^^xsd:base64Binary ;
] .