Merge pull request #1149 from redtide/submodule-updates-2023-04

Submodule updates 2023 04
This commit is contained in:
redtide 2023-04-09 16:36:12 +02:00 committed by GitHub
commit 696cad0f7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
112 changed files with 4483 additions and 12866 deletions

File diff suppressed because it is too large Load diff

2
external/filesystem vendored

@ -1 +1 @@
Subproject commit cd6805e94dd5d6346be1b75a54cdc27787319dd2
Subproject commit 8a2edd6d92ed820521d42c94d179462bf06b5ed3

View file

@ -1,71 +0,0 @@
/*
Copyright 2012-2018 David Robillard <http://drobilla.net>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "lv2/atom/atom.h"
#include "lv2/atom/forge.h"
#include "lv2/atom/util.h"
#include "lv2/urid/urid.h"
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
char** uris = NULL;
uint32_t n_uris = 0;
static char*
copy_string(const char* str)
{
const size_t len = strlen(str);
char* dup = (char*)malloc(len + 1);
memcpy(dup, str, len + 1);
return dup;
}
static LV2_URID
urid_map(LV2_URID_Map_Handle handle, const char* uri)
{
for (uint32_t i = 0; i < n_uris; ++i) {
if (!strcmp(uris[i], uri)) {
return i + 1;
}
}
uris = (char**)realloc(uris, ++n_uris * sizeof(char*));
uris[n_uris - 1] = copy_string(uri);
return n_uris;
}
static void
free_urid_map(void)
{
for (uint32_t i = 0; i < n_uris; ++i) {
free(uris[i]);
}
free(uris);
}
static int
test_fail(const char* fmt, ...)
{
va_list args;
va_start(args, fmt);
fprintf(stderr, "error: ");
vfprintf(stderr, fmt, args);
va_end(args);
return 1;
}

View file

@ -1,363 +0,0 @@
/*
Copyright 2012-2015 David Robillard <http://drobilla.net>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "lv2/atom/atom-test-utils.c"
#include "lv2/atom/atom.h"
#include "lv2/atom/forge.h"
#include "lv2/atom/util.h"
#include "lv2/urid/urid.h"
#include <stdint.h>
#include <stdlib.h>
int
main(void)
{
LV2_URID_Map map = { NULL, urid_map };
LV2_Atom_Forge forge;
lv2_atom_forge_init(&forge, &map);
LV2_URID eg_Object = urid_map(NULL, "http://example.org/Object");
LV2_URID eg_one = urid_map(NULL, "http://example.org/one");
LV2_URID eg_two = urid_map(NULL, "http://example.org/two");
LV2_URID eg_three = urid_map(NULL, "http://example.org/three");
LV2_URID eg_four = urid_map(NULL, "http://example.org/four");
LV2_URID eg_true = urid_map(NULL, "http://example.org/true");
LV2_URID eg_false = urid_map(NULL, "http://example.org/false");
LV2_URID eg_path = urid_map(NULL, "http://example.org/path");
LV2_URID eg_uri = urid_map(NULL, "http://example.org/uri");
LV2_URID eg_urid = urid_map(NULL, "http://example.org/urid");
LV2_URID eg_string = urid_map(NULL, "http://example.org/string");
LV2_URID eg_literal = urid_map(NULL, "http://example.org/literal");
LV2_URID eg_tuple = urid_map(NULL, "http://example.org/tuple");
LV2_URID eg_vector = urid_map(NULL, "http://example.org/vector");
LV2_URID eg_vector2 = urid_map(NULL, "http://example.org/vector2");
LV2_URID eg_seq = urid_map(NULL, "http://example.org/seq");
#define BUF_SIZE 1024
#define NUM_PROPS 15
uint8_t buf[BUF_SIZE];
lv2_atom_forge_set_buffer(&forge, buf, BUF_SIZE);
LV2_Atom_Forge_Frame obj_frame;
LV2_Atom* obj = lv2_atom_forge_deref(
&forge, lv2_atom_forge_object(&forge, &obj_frame, 0, eg_Object));
// eg_one = (Int)1
lv2_atom_forge_key(&forge, eg_one);
LV2_Atom_Int* one = (LV2_Atom_Int*)lv2_atom_forge_deref(
&forge, lv2_atom_forge_int(&forge, 1));
if (one->body != 1) {
return test_fail("%d != 1\n", one->body);
}
// eg_two = (Long)2
lv2_atom_forge_key(&forge, eg_two);
LV2_Atom_Long* two = (LV2_Atom_Long*)lv2_atom_forge_deref(
&forge, lv2_atom_forge_long(&forge, 2));
if (two->body != 2) {
return test_fail("%ld != 2\n", two->body);
}
// eg_three = (Float)3.0
lv2_atom_forge_key(&forge, eg_three);
LV2_Atom_Float* three = (LV2_Atom_Float*)lv2_atom_forge_deref(
&forge, lv2_atom_forge_float(&forge, 3.0f));
if (three->body != 3) {
return test_fail("%f != 3\n", three->body);
}
// eg_four = (Double)4.0
lv2_atom_forge_key(&forge, eg_four);
LV2_Atom_Double* four = (LV2_Atom_Double*)lv2_atom_forge_deref(
&forge, lv2_atom_forge_double(&forge, 4.0));
if (four->body != 4) {
return test_fail("%ld != 4\n", four->body);
}
// eg_true = (Bool)1
lv2_atom_forge_key(&forge, eg_true);
LV2_Atom_Bool* t = (LV2_Atom_Bool*)lv2_atom_forge_deref(
&forge, lv2_atom_forge_bool(&forge, true));
if (t->body != 1) {
return test_fail("%ld != 1 (true)\n", t->body);
}
// eg_false = (Bool)0
lv2_atom_forge_key(&forge, eg_false);
LV2_Atom_Bool* f = (LV2_Atom_Bool*)lv2_atom_forge_deref(
&forge, lv2_atom_forge_bool(&forge, false));
if (f->body != 0) {
return test_fail("%ld != 0 (false)\n", f->body);
}
// eg_path = (Path)"/foo/bar"
const char* pstr = "/foo/bar";
const uint32_t pstr_len = (uint32_t)strlen(pstr);
lv2_atom_forge_key(&forge, eg_path);
LV2_Atom_String* path = (LV2_Atom_String*)lv2_atom_forge_deref(
&forge, lv2_atom_forge_uri(&forge, pstr, pstr_len));
char* pbody = (char*)LV2_ATOM_BODY(path);
if (strcmp(pbody, pstr)) {
return test_fail("%s != \"%s\"\n", pbody, pstr);
}
// eg_uri = (URI)"http://example.org/value"
const char* ustr = "http://example.org/value";
const uint32_t ustr_len = (uint32_t)strlen(ustr);
lv2_atom_forge_key(&forge, eg_uri);
LV2_Atom_String* uri = (LV2_Atom_String*)lv2_atom_forge_deref(
&forge, lv2_atom_forge_uri(&forge, ustr, ustr_len));
char* ubody = (char*)LV2_ATOM_BODY(uri);
if (strcmp(ubody, ustr)) {
return test_fail("%s != \"%s\"\n", ubody, ustr);
}
// eg_urid = (URID)"http://example.org/value"
LV2_URID eg_value = urid_map(NULL, "http://example.org/value");
lv2_atom_forge_key(&forge, eg_urid);
LV2_Atom_URID* urid = (LV2_Atom_URID*)lv2_atom_forge_deref(
&forge, lv2_atom_forge_urid(&forge, eg_value));
if (urid->body != eg_value) {
return test_fail("%u != %u\n", urid->body, eg_value);
}
// eg_string = (String)"hello"
lv2_atom_forge_key(&forge, eg_string);
LV2_Atom_String* string = (LV2_Atom_String*)lv2_atom_forge_deref(
&forge, lv2_atom_forge_string(
&forge, "hello", strlen("hello")));
char* sbody = (char*)LV2_ATOM_BODY(string);
if (strcmp(sbody, "hello")) {
return test_fail("%s != \"hello\"\n", sbody);
}
// eg_literal = (Literal)"hello"@fr
lv2_atom_forge_key(&forge, eg_literal);
LV2_Atom_Literal* literal = (LV2_Atom_Literal*)lv2_atom_forge_deref(
&forge, lv2_atom_forge_literal(
&forge, "bonjour", strlen("bonjour"),
0, urid_map(NULL, "http://lexvo.org/id/term/fr")));
char* lbody = (char*)LV2_ATOM_CONTENTS(LV2_Atom_Literal, literal);
if (strcmp(lbody, "bonjour")) {
return test_fail("%s != \"bonjour\"\n", lbody);
}
// eg_tuple = "foo",true
lv2_atom_forge_key(&forge, eg_tuple);
LV2_Atom_Forge_Frame tuple_frame;
LV2_Atom_Tuple* tuple = (LV2_Atom_Tuple*)lv2_atom_forge_deref(
&forge, lv2_atom_forge_tuple(&forge, &tuple_frame));
LV2_Atom_String* tup0 = (LV2_Atom_String*)lv2_atom_forge_deref(
&forge, lv2_atom_forge_string(
&forge, "foo", strlen("foo")));
LV2_Atom_Bool* tup1 = (LV2_Atom_Bool*)lv2_atom_forge_deref(
&forge, lv2_atom_forge_bool(&forge, true));
lv2_atom_forge_pop(&forge, &tuple_frame);
LV2_Atom* i = lv2_atom_tuple_begin(tuple);
if (lv2_atom_tuple_is_end(LV2_ATOM_BODY(tuple), tuple->atom.size, i)) {
return test_fail("Tuple iterator is empty\n");
}
LV2_Atom* tup0i = i;
if (!lv2_atom_equals((LV2_Atom*)tup0, tup0i)) {
return test_fail("Corrupt tuple element 0\n");
}
i = lv2_atom_tuple_next(i);
if (lv2_atom_tuple_is_end(LV2_ATOM_BODY(tuple), tuple->atom.size, i)) {
return test_fail("Premature end of tuple iterator\n");
}
LV2_Atom* tup1i = i;
if (!lv2_atom_equals((LV2_Atom*)tup1, tup1i)) {
return test_fail("Corrupt tuple element 1\n");
}
i = lv2_atom_tuple_next(i);
if (!lv2_atom_tuple_is_end(LV2_ATOM_BODY(tuple), tuple->atom.size, i)) {
return test_fail("Tuple iter is not at end\n");
}
// eg_vector = (Vector<Int>)1,2,3,4
lv2_atom_forge_key(&forge, eg_vector);
int32_t elems[] = { 1, 2, 3, 4 };
LV2_Atom_Vector* vector = (LV2_Atom_Vector*)lv2_atom_forge_deref(
&forge, lv2_atom_forge_vector(
&forge, sizeof(int32_t), forge.Int, 4, elems));
void* vec_body = LV2_ATOM_CONTENTS(LV2_Atom_Vector, vector);
if (memcmp(elems, vec_body, sizeof(elems))) {
return test_fail("Corrupt vector\n");
}
// eg_vector2 = (Vector<Int>)1,2,3,4
lv2_atom_forge_key(&forge, eg_vector2);
LV2_Atom_Forge_Frame vec_frame;
LV2_Atom_Vector* vector2 = (LV2_Atom_Vector*)lv2_atom_forge_deref(
&forge, lv2_atom_forge_vector_head(
&forge, &vec_frame, sizeof(int32_t), forge.Int));
for (unsigned e = 0; e < sizeof(elems) / sizeof(int32_t); ++e) {
lv2_atom_forge_int(&forge, elems[e]);
}
lv2_atom_forge_pop(&forge, &vec_frame);
if (!lv2_atom_equals(&vector->atom, &vector2->atom)) {
return test_fail("Vector != Vector2\n");
}
// eg_seq = (Sequence)1, 2
lv2_atom_forge_key(&forge, eg_seq);
LV2_Atom_Forge_Frame seq_frame;
LV2_Atom_Sequence* seq = (LV2_Atom_Sequence*)lv2_atom_forge_deref(
&forge, lv2_atom_forge_sequence_head(&forge, &seq_frame, 0));
lv2_atom_forge_frame_time(&forge, 0);
lv2_atom_forge_int(&forge, 1);
lv2_atom_forge_frame_time(&forge, 1);
lv2_atom_forge_int(&forge, 2);
lv2_atom_forge_pop(&forge, &seq_frame);
lv2_atom_forge_pop(&forge, &obj_frame);
// Test equality
LV2_Atom_Int itwo = { { forge.Int, sizeof(int32_t) }, 2 };
if (lv2_atom_equals((LV2_Atom*)one, (LV2_Atom*)two)) {
return test_fail("1 == 2.0\n");
} else if (lv2_atom_equals((LV2_Atom*)one, (LV2_Atom*)&itwo)) {
return test_fail("1 == 2\n");
} else if (!lv2_atom_equals((LV2_Atom*)one, (LV2_Atom*)one)) {
return test_fail("1 != 1\n");
}
unsigned n_events = 0;
LV2_ATOM_SEQUENCE_FOREACH(seq, ev) {
if (ev->time.frames != n_events) {
return test_fail("Corrupt event %u has bad time\n", n_events);
} else if (ev->body.type != forge.Int) {
return test_fail("Corrupt event %u has bad type\n", n_events);
} else if (((LV2_Atom_Int*)&ev->body)->body != (int)n_events + 1) {
return test_fail("Event %u != %d\n", n_events, n_events + 1);
}
++n_events;
}
int n_props = 0;
LV2_ATOM_OBJECT_FOREACH((LV2_Atom_Object*)obj, prop) {
if (!prop->key) {
return test_fail("Corrupt property %u has no key\n", n_props);
} else if (prop->context) {
return test_fail("Corrupt property %u has context\n", n_props);
}
++n_props;
}
if (n_props != NUM_PROPS) {
return test_fail("Corrupt object has %u properties != %u\n",
n_props, NUM_PROPS);
}
struct {
const LV2_Atom* one;
const LV2_Atom* two;
const LV2_Atom* three;
const LV2_Atom* four;
const LV2_Atom* affirmative;
const LV2_Atom* negative;
const LV2_Atom* path;
const LV2_Atom* uri;
const LV2_Atom* urid;
const LV2_Atom* string;
const LV2_Atom* literal;
const LV2_Atom* tuple;
const LV2_Atom* vector;
const LV2_Atom* vector2;
const LV2_Atom* seq;
} matches;
memset(&matches, 0, sizeof(matches));
LV2_Atom_Object_Query q[] = {
{ eg_one, &matches.one },
{ eg_two, &matches.two },
{ eg_three, &matches.three },
{ eg_four, &matches.four },
{ eg_true, &matches.affirmative },
{ eg_false, &matches.negative },
{ eg_path, &matches.path },
{ eg_uri, &matches.uri },
{ eg_urid, &matches.urid },
{ eg_string, &matches.string },
{ eg_literal, &matches.literal },
{ eg_tuple, &matches.tuple },
{ eg_vector, &matches.vector },
{ eg_vector2, &matches.vector2 },
{ eg_seq, &matches.seq },
LV2_ATOM_OBJECT_QUERY_END
};
int n_matches = lv2_atom_object_query((LV2_Atom_Object*)obj, q);
for (int n = 0; n < 2; ++n) {
if (n_matches != n_props) {
return test_fail("Query failed, %u matches != %u\n",
n_matches, n_props);
} else if (!lv2_atom_equals((LV2_Atom*)one, matches.one)) {
return test_fail("Bad match one\n");
} else if (!lv2_atom_equals((LV2_Atom*)two, matches.two)) {
return test_fail("Bad match two\n");
} else if (!lv2_atom_equals((LV2_Atom*)three, matches.three)) {
return test_fail("Bad match three\n");
} else if (!lv2_atom_equals((LV2_Atom*)four, matches.four)) {
return test_fail("Bad match four\n");
} else if (!lv2_atom_equals((LV2_Atom*)t, matches.affirmative)) {
return test_fail("Bad match true\n");
} else if (!lv2_atom_equals((LV2_Atom*)f, matches.negative)) {
return test_fail("Bad match false\n");
} else if (!lv2_atom_equals((LV2_Atom*)path, matches.path)) {
return test_fail("Bad match path\n");
} else if (!lv2_atom_equals((LV2_Atom*)uri, matches.uri)) {
return test_fail("Bad match URI\n");
} else if (!lv2_atom_equals((LV2_Atom*)string, matches.string)) {
return test_fail("Bad match string\n");
} else if (!lv2_atom_equals((LV2_Atom*)literal, matches.literal)) {
return test_fail("Bad match literal\n");
} else if (!lv2_atom_equals((LV2_Atom*)tuple, matches.tuple)) {
return test_fail("Bad match tuple\n");
} else if (!lv2_atom_equals((LV2_Atom*)vector, matches.vector)) {
return test_fail("Bad match vector\n");
} else if (!lv2_atom_equals((LV2_Atom*)vector, matches.vector2)) {
return test_fail("Bad match vector2\n");
} else if (!lv2_atom_equals((LV2_Atom*)seq, matches.seq)) {
return test_fail("Bad match sequence\n");
}
memset(&matches, 0, sizeof(matches));
n_matches = lv2_atom_object_get((LV2_Atom_Object*)obj,
eg_one, &matches.one,
eg_two, &matches.two,
eg_three, &matches.three,
eg_four, &matches.four,
eg_true, &matches.affirmative,
eg_false, &matches.negative,
eg_path, &matches.path,
eg_uri, &matches.uri,
eg_urid, &matches.urid,
eg_string, &matches.string,
eg_literal, &matches.literal,
eg_tuple, &matches.tuple,
eg_vector, &matches.vector,
eg_vector2, &matches.vector2,
eg_seq, &matches.seq,
0);
}
free_urid_map();
return 0;
}

View file

@ -1,34 +1,24 @@
/*
Copyright 2008-2016 David Robillard <http://drobilla.net>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/**
@defgroup atom Atom
A generic value container and several data types, see
<http://lv2plug.in/ns/ext/atom> for details.
@{
*/
// Copyright 2008-2016 David Robillard <d@drobilla.net>
// SPDX-License-Identifier: ISC
#ifndef LV2_ATOM_H
#define LV2_ATOM_H
#include <stddef.h>
/**
@defgroup atom Atom
@ingroup lv2
A generic value container and several data types.
See <http://lv2plug.in/ns/ext/atom> for details.
@{
*/
#include <stdint.h>
// clang-format off
#define LV2_ATOM_URI "http://lv2plug.in/ns/ext/atom" ///< http://lv2plug.in/ns/ext/atom
#define LV2_ATOM_PREFIX LV2_ATOM_URI "#" ///< http://lv2plug.in/ns/ext/atom#
@ -64,6 +54,8 @@
#define LV2_ATOM__supports LV2_ATOM_PREFIX "supports" ///< http://lv2plug.in/ns/ext/atom#supports
#define LV2_ATOM__timeUnit LV2_ATOM_PREFIX "timeUnit" ///< http://lv2plug.in/ns/ext/atom#timeUnit
// clang-format on
#define LV2_ATOM_REFERENCE_TYPE 0 ///< The special type for a reference atom
#ifdef __cplusplus
@ -72,18 +64,17 @@ extern "C" {
/** @cond */
/** This expression will fail to compile if double does not fit in 64 bits. */
typedef char lv2_atom_assert_double_fits_in_64_bits[
((sizeof(double) <= sizeof(uint64_t)) * 2) - 1];
typedef char lv2_atom_assert_double_fits_in_64_bits
[((sizeof(double) <= sizeof(uint64_t)) * 2) - 1];
/** @endcond */
/**
Return a pointer to the contents of an Atom. The "contents" of an atom
is the data past the complete type-specific header.
@param type The type of the atom, e.g. LV2_Atom_String.
@param type The type of the atom, for example LV2_Atom_String.
@param atom A variable-sized atom.
*/
#define LV2_ATOM_CONTENTS(type, atom) \
((void*)((uint8_t*)(atom) + sizeof(type)))
#define LV2_ATOM_CONTENTS(type, atom) ((void*)((uint8_t*)(atom) + sizeof(type)))
/**
Const version of LV2_ATOM_CONTENTS.
@ -179,7 +170,7 @@ typedef struct {
LV2_Atom_Vector_Body body; /**< Body. */
} LV2_Atom_Vector;
/** The body of an atom:Property (e.g. in an atom:Object). */
/** The body of an atom:Property (typically in an atom:Object). */
typedef struct {
uint32_t key; /**< Key (predicate) (mapped URI). */
uint32_t context; /**< Context URID (may be, and generally is, 0). */
@ -225,12 +216,12 @@ typedef struct {
LV2_Descriptor::run(), the default stamp type is audio frames.
The contents of a sequence is a series of LV2_Atom_Event, each aligned
to 64-bits, e.g.:
to 64-bits, for example:
<pre>
| Event 1 (size 6) | Event 2
| | | | | | | | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|FRAMES |SUBFRMS|TYPE |SIZE |DATADATADATAPAD|FRAMES |SUBFRMS|...
|FRAMES |TYPE |SIZE |DATADATADATAPAD|FRAMES |...
</pre>
*/
typedef struct {
@ -245,12 +236,12 @@ typedef struct {
LV2_Atom_Sequence_Body body; /**< Body. */
} LV2_Atom_Sequence;
/**
@}
*/
#ifdef __cplusplus
} /* extern "C" */
#endif
/**
@}
*/
#endif /* LV2_ATOM_H */

View file

@ -1,602 +0,0 @@
@prefix atom: <http://lv2plug.in/ns/ext/atom#> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ui: <http://lv2plug.in/ns/extensions/ui#> .
@prefix units: <http://lv2plug.in/ns/extensions/units#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<http://lv2plug.in/ns/ext/atom>
a owl:Ontology ;
rdfs:seeAlso <atom.h> ,
<util.h> ,
<forge.h> ,
<lv2-atom.doap.ttl> ;
lv2:documentation """
<p>An #Atom is a simple generic data container for holding any type of Plain
Old Data (POD). An #Atom can contain simple primitive types like integers,
floating point numbers, and strings; as well as structured data like lists and
dictionary-like <q>Objects</q>. Since Atoms are POD, they can be easily copied
(e.g. using <code>memcpy</code>) anywhere and are suitable for use in real-time
code.</p>
<p>Every atom starts with an LV2_Atom header, followed by the contents. This
allows code to process atoms without requiring special code for every type of
data. For example, plugins that mutually understand a type can be used
together in a host that does not understand that type, because the host is only
required to copy atoms, not interpret their contents. Similarly, plugins (such
as routers, delays, or data structures) can meaningfully process atoms of a
type unknown to them.</p>
<p>Atoms should be used anywhere values of various types must be stored or
transmitted. The port type #AtomPort can be used to transmit atoms via ports.
An #AtomPort that contains an #Sequence can be used for sample accurate event
communication, such as MIDI, and replaces the earlier event extension.</p>
<h3>Serialisation</h3>
<p>Each Atom type defines a binary format for use at runtime, but also a
serialisation that is natural to express in Turtle format. Thus, this
specification defines a powerful real-time appropriate data model, as well as a
portable way to serialise any data in that model. This is particularly useful
for inter-process communication, saving/restoring state, and describing values
in plugin data files.</p>
<h3>Custom Atom Types</h3>
<p>While it is possible to define new Atom types for any binary format, the
standard types defined here are powerful enough to describe almost anything.
Implementations SHOULD build structures out of the types provided here, rather
than define new binary formats (e.g. use #Tuple or #Object rather than
a new C <code>struct</code> type). Current implementations have support for
serialising all standard types, so new binary formats are an implementation
burden which harms interoperabilty. In particular, plugins SHOULD NOT expect
UI communication or state saving with custom Atom types to work. In general,
new Atom types should only be defined where absolutely necessary due to
performance reasons and serialisation is not a concern.</p>
""" .
atom:cType
a rdf:Property ,
owl:DatatypeProperty ,
owl:FunctionalProperty ;
rdfs:label "C type" ;
rdfs:domain rdfs:Class ;
rdfs:range lv2:Symbol ;
rdfs:comment """The identifier for a C type describing the binary representation of an Atom of this type.""" .
atom:Atom
a rdfs:Class ;
rdfs:label "Atom" ;
atom:cType "LV2_Atom" ;
lv2:documentation """
<p>Abstract base class for all atoms. An LV2_Atom has a 32-bit
<code>size</code> and <code>type</code> followed by a body of <code>size</code>
bytes. Atoms MUST be 64-bit aligned.</p>
<p>All concrete Atom types (subclasses of this class) MUST define a precise
binary layout for their body.</p>
<p>The <code>type</code> field is the URI of an Atom type mapped to an integer.
Implementations SHOULD gracefully pass through, or ignore, atoms with unknown
types.</p>
<p>All atoms are POD by definition except references, which as a special case
have <code>type = 0</code>. An Atom MUST NOT contain a Reference. It is safe
to copy any non-reference Atom with a simple <code>memcpy</code>, even if the
implementation does not understand <code>type</code>. Though this extension
reserves the type 0 for references, the details of reference handling are
currently unspecified. A future revision of this extension, or a different
extension, may define how to use non-POD data and references. Implementations
MUST NOT send references to another implementation unless the receiver is
explicitly known to support references (e.g. by supporting a feature).</p>
<p>The atom with both <code>type</code> <em>and</em> <code>size</code> 0 is
<q>null</q>, which is not considered a Reference.</p>
""" .
atom:Chunk
a rdfs:Class ,
rdfs:Datatype ;
rdfs:subClassOf atom:Atom ;
rdfs:label "Chunk of memory" ;
owl:onDatatype xsd:base64Binary ;
lv2:documentation """
<p>A chunk of memory with undefined contents. This type is used to indicate a
certain amount of space is available. For example, output ports with a
variably sized type are connected to a Chunk so the plugin knows the size of
the buffer available for writing.</p>
<p>The use of a Chunk should be constrained to a local scope, since
interpreting it is impossible without context. However, if serialised to RDF,
a Chunk may be represented directly as an xsd:base64Binary string, e.g.:</p>
<pre class="turtle-code">
[] eg:someChunk "vu/erQ=="^^xsd:base64Binary .
</pre>
""" .
atom:Number
a rdfs:Class ;
rdfs:subClassOf atom:Atom ;
rdfs:label "Number" .
atom:Int
a rdfs:Class ,
rdfs:Datatype ;
rdfs:subClassOf atom:Number ;
rdfs:label "Signed 32-bit integer" ;
atom:cType "LV2_Atom_Int" ;
owl:onDatatype xsd:int .
atom:Long
a rdfs:Class ,
rdfs:Datatype ;
rdfs:subClassOf atom:Number ;
rdfs:label "Signed 64-bit integer" ;
atom:cType "LV2_Atom_Long" ;
owl:onDatatype xsd:long .
atom:Float
a rdfs:Class ,
rdfs:Datatype ;
rdfs:subClassOf atom:Number ;
rdfs:label "32-bit floating point number" ;
atom:cType "LV2_Atom_Float" ;
owl:onDatatype xsd:float .
atom:Double
a rdfs:Class ,
rdfs:Datatype ;
rdfs:subClassOf atom:Number ;
rdfs:label "64-bit floating point number" ;
atom:cType "LV2_Atom_Double" ;
owl:onDatatype xsd:double .
atom:Bool
a rdfs:Class ,
rdfs:Datatype ;
rdfs:subClassOf atom:Atom ;
rdfs:label "Boolean" ;
atom:cType "LV2_Atom_Bool" ;
owl:onDatatype xsd:boolean ;
rdfs:comment "An Int where 0 is false and any other value is true." .
atom:String
a rdfs:Class ,
rdfs:Datatype ;
rdfs:subClassOf atom:Atom ;
rdfs:label "String" ;
atom:cType "LV2_Atom_String" ;
owl:onDatatype xsd:string ;
lv2:documentation """
<p>A UTF-8 encoded string.</p>
<p>The body of an LV2_Atom_String is a C string in UTF-8 encoding, i.e. an
array of bytes (<code>uint8_t</code>) terminated with a NULL byte
(<code>'\\0'</code>).</p>
<p>This type is for free-form strings, but SHOULD NOT be used for typed data or
text in any language. Use atom:Literal unless translating the string does not
make sense and the string has no meaningful datatype.</p>
""" .
atom:Literal
a rdfs:Class ;
rdfs:subClassOf atom:Atom ;
rdfs:label "String Literal" ;
atom:cType "LV2_Atom_Literal" ;
lv2:documentation """
<p>A UTF-8 encoded string literal, with an optional datatype or language.</p>
<p>This type is compatible with rdfs:Literal and is capable of expressing a
string in any language or a value of any type. A Literal has a
<code>datatype</code> and <code>lang</code> followed by string data in UTF-8
encoding. The length of the string data in bytes is <code>size -
sizeof(LV2_Atom_Literal)</code>, including the terminating NULL character. The
<code>lang</code> field SHOULD be a URI of the form
&lt;http://lexvo.org/id/iso639-3/LANG&gt; or
&lt;http://lexvo.org/id/iso639-1/LANG&gt; where LANG is a 3-character ISO 693-3
language code, or a 2-character ISO 693-1 language code, respectively.</p>
<p>A Literal may have a <code>datatype</code> OR a <code>lang</code>, but never
both.</p>
<p>For example, a Literal can be "Hello" in English:</p>
<pre class="c-code">
void set_to_hello_in_english(LV2_Atom_Literal* lit) {
lit->atom.type = map(expand("atom:Literal"));
lit->atom.size = 14;
lit->body.datatype = 0;
lit->body.lang = map("http://lexvo.org/id/iso639-1/en");
memcpy(LV2_ATOM_CONTENTS(LV2_Atom_Literal, lit),
"Hello",
sizeof("Hello")); // Assumes enough space
}
</pre>
<p>or a Turtle string:</p>
<pre class="c-code">
void set_to_turtle_string(LV2_Atom_Literal* lit, const char* ttl) {
lit->atom.type = map(expand("atom:Literal"));
lit->atom.size = 64;
lit->body.datatype = map("http://www.w3.org/2008/turtle#turtle");
lit->body.lang = 0;
memcpy(LV2_ATOM_CONTENTS(LV2_Atom_Literal, lit),
ttl,
strlen(ttl) + 1); // Assumes enough space
}
</pre>
""" .
atom:Path
a rdfs:Class ,
rdfs:Datatype ;
rdfs:subClassOf atom:URI ;
owl:onDatatype atom:URI ;
rdfs:label "File path string" ;
lv2:documentation """
<p>A local file path.</p>
<p>A Path is a URI reference with only a path component: no scheme, authority,
query, or fragment. In particular, paths to files in the same bundle may be
cleanly written in Turtle files as a relative URI. However, implementations
may assume any binary Path (e.g. in an event payload) is a valid file path
which can passed to system functions like fopen() directly, without any
character encoding or escape expansion required.</p>
<p>Any implemenation that creates a Path atom to transmit to another is
responsible for ensuring it is valid. A Path SHOULD always be absolute, unless
there is some mechanism in place that defines a base path. Since this is not
the case for plugin instances, effectively any Path sent to or received from a
plugin instance MUST be absolute.</p>
""" .
atom:URI
a rdfs:Class ,
rdfs:Datatype ;
rdfs:subClassOf atom:String ;
owl:onDatatype xsd:anyURI ;
rdfs:label "URI string" ;
lv2:documentation """
<p>A URI string. This is useful when a URI is needed but mapping is
inappropriate, for example with temporary or relative URIs. Since the ability
to distinguish URIs from plain strings is often necessary, URIs MUST NOT be
transmitted as atom:String.</p>
<p>This is not strictly a URI, since UTF-8 is allowed. Escaping and related
issues are the host's responsibility.</p>
""" .
atom:URID
a rdfs:Class ;
rdfs:subClassOf atom:Atom ;
rdfs:label "Integer URID" ;
atom:cType "LV2_Atom_URID" ;
lv2:documentation """
<p>An unsigned 32-bit integer mapped from a URI (e.g. with LV2_URID_Map).</p>
""" .
atom:Vector
a rdfs:Class ;
rdfs:subClassOf atom:Atom ;
rdfs:label "Vector" ;
atom:cType "LV2_Atom_Vector" ;
lv2:documentation """
<p>A homogeneous series of atom bodies with equivalent type and size.</p>
<p>An LV2_Atom_Vector is a 32-bit <code>child_size</code> and
<code>child_type</code> followed by <code>size / child_size</code> atom
bodies.</p>
<p>For example, an atom:Vector containing 42 elements of type atom:Float:</p>
<pre class="c-code">
struct VectorOf42Floats {
uint32_t size; // sizeof(LV2_Atom_Vector_Body) + (42 * sizeof(float);
uint32_t type; // map(expand("atom:Vector"))
uint32_t child_size; // sizeof(float)
uint32_t child_type; // map(expand("atom:Float"))
float elems[42];
};
</pre>
<p>Note that it is possible to construct a valid Atom for each element
of the vector, even by an implementation which does not understand
<code>child_type</code>.</p>
<p>If serialised to RDF, a Vector SHOULD have the form:</p>
<pre class="turtle-code">
eg:someVector
a atom:Vector ;
atom:childType atom:Int ;
rdf:value (
"1"^^xsd:int
"2"^^xsd:int
"3"^^xsd:int
"4"^^xsd:int
) .
</pre>
""" .
atom:Tuple
a rdfs:Class ;
rdfs:subClassOf atom:Atom ;
rdfs:label "Tuple" ;
lv2:documentation """
<p>A series of Atoms with varying <code>type</code> and <code>size</code>.</p>
<p>The body of a Tuple is simply a series of complete atoms, each aligned to
64 bits.</p>
<p>If serialised to RDF, a Tuple SHOULD have the form:</p>
<pre class="turtle-code">
eg:someVector
a atom:Tuple ;
rdf:value (
"1"^^xsd:int
"3.5"^^xsd:float
"etc"
) .
</pre>
""" .
atom:Property
a rdfs:Class ;
rdfs:subClassOf atom:Atom ;
rdfs:label "Property" ;
atom:cType "LV2_Atom_Property" ;
lv2:documentation """
<p>A property of an atom:Object. An LV2_Atom_Property has a URID
<code>key</code> and <code>context</code>, and an Atom <code>value</code>.
This corresponds to an RDF Property, where the <q>key</q> is the <q>predicate</q>
and the <q>value</q> is the object.</p>
<p>The <code>context</code> field can be used to specify a different context
for each property, where this is useful. Otherwise, it may be 0.</p>
<p>Properties generally only exist as part of an atom:Object. Accordingly,
they will typically be represented directly as properties in RDF (see
atom:Object). If this is not possible, they may be expressed as partial
reified statements, e.g.:</p>
<pre class="turtle-code">
eg:someProperty
rdf:predicate eg:theKey ;
rdf:object eg:theValue .
</pre>
""" .
atom:Object
a rdfs:Class ;
rdfs:subClassOf atom:Atom ;
rdfs:label "Object" ;
atom:cType "LV2_Atom_Object" ;
lv2:documentation """
<p>An <q>Object</q> is an atom with a set of properties. This corresponds to
an RDF Resource, and can be thought of as a dictionary with URID keys.</p>
<p>An LV2_Atom_Object body has a uint32_t <code>id</code> and
<code>type</code>, followed by a series of atom:Property bodies
(LV2_Atom_Property_Body). The LV2_Atom_Object_Body::otype field is equivalent
to a property with key rdf:type, but is included in the structure to allow for
fast dispatching.</p>
<p>Code SHOULD check for objects using lv2_atom_forge_is_object() or
lv2_atom_forge_is_blank() if a forge is available, rather than checking the
atom type directly. This will correctly handle the deprecated atom:Resource
and atom:Blank types.</p>
<p>When serialised to RDF, an Object is represented as a resource, e.g.:</p>
<pre class="turtle-code">
eg:someObject
eg:firstPropertyKey "first property value" ;
eg:secondPropertyKey "first loser" ;
eg:andSoOn "and so on" .
</pre>
""" .
atom:Resource
a rdfs:Class ;
rdfs:subClassOf atom:Object ;
rdfs:label "Resource" ;
owl:deprecated "true"^^xsd:boolean ;
atom:cType "LV2_Atom_Object" ;
lv2:documentation """
<p>This class is deprecated. Use atom:Object instead.</p>
<p>An atom:Object where the <code>id</code> field is a URID, i.e. an Object
with a URI.</p>
""" .
atom:Blank
a rdfs:Class ;
rdfs:subClassOf atom:Object ;
rdfs:label "Blank" ;
owl:deprecated "true"^^xsd:boolean ;
atom:cType "LV2_Atom_Object" ;
lv2:documentation """
<p>This class is deprecated. Use atom:Object with ID 0 instead.</p>
<p>An atom:Object where the LV2_Atom_Object::id is a blank node ID (NOT a URI).
The ID of a Blank is valid only within the context the Blank appears in. For
ports this is the context of the associated run() call, i.e. all ports share
the same context so outputs can contain IDs that correspond to IDs of blanks in
the input.</p>
""" .
atom:Sound
a rdfs:Class ;
rdfs:subClassOf atom:Vector ;
rdfs:label "Sound" ;
atom:cType "LV2_Atom_Sound" ;
lv2:documentation """
<p>An atom:Vector of atom:Float which represents an audio waveform. The format
is the same as the buffer format for lv2:AudioPort (except the size may be
arbitrary). An atom:Sound inherently depends on the sample rate, which is
assumed to be known from context. Because of this, directly serialising an
atom:Sound is probably a bad idea, use a standard format like WAV instead.</p>
""" .
atom:frameTime
a rdf:Property ,
owl:DatatypeProperty ,
owl:FunctionalProperty ;
rdfs:range xsd:decimal ;
rdfs:label "frame time" ;
lv2:documentation """
<p>Time stamp in audio frames. Typically used for events.</p>
""" .
atom:beatTime
a rdf:Property ,
owl:DatatypeProperty ,
owl:FunctionalProperty ;
rdfs:range xsd:decimal ;
rdfs:label "beat time" ;
lv2:documentation """
<p>Time stamp in beats. Typically used for events.</p>
""" .
atom:Event
a rdfs:Class ;
rdfs:label "Event" ;
atom:cType "LV2_Atom_Event" ;
lv2:documentation """
<p>An atom with a time stamp prefix, typically an element of an atom:Sequence.
Note this is not an Atom type.</p>
""" .
atom:Sequence
a rdfs:Class ;
rdfs:subClassOf atom:Atom ;
rdfs:label "Sequence" ;
atom:cType "LV2_Atom_Sequence" ;
lv2:documentation """
<p>A sequence of atom:Event, i.e. a series of time-stamped Atoms.</p>
<p>LV2_Atom_Sequence_Body.unit describes the time unit for the contained atoms.
If the unit is known from context (e.g. run() stamps are always audio frames),
this field may be zero. Otherwise, it SHOULD be either units:frame or
units:beat, in which case ev.time.frames or ev.time.beats is valid,
respectively.</p>
<p>If serialised to RDF, a Sequence has a similar form to atom:Vector, but for
brevity the elements may be assumed to be atom:Event, e.g.:</p>
<pre class="turtle-code">
eg:someSequence
a atom:Sequence ;
rdf:value (
[
atom:frameTime 1 ;
rdf:value "901A01"^^midi:MidiEvent
] [
atom:frameTime 3 ;
rdf:value "902B02"^^midi:MidiEvent
]
) .
</pre>
""" .
atom:AtomPort
a rdfs:Class ;
rdfs:subClassOf lv2:Port ;
rdfs:label "Atom Port" ;
lv2:documentation """
<p>A port which contains an atom:Atom. Ports of this type are connected to an
LV2_Atom with a type specified by atom:bufferType.</p>
<p>Output ports with a variably sized type MUST be initialised by the host
before every run() to an atom:Chunk with size set to the available space. The
plugin reads this size to know how much space is available for writing. In all
cases, the plugin MUST write a complete atom (including header) to outputs.
However, to be robust, hosts SHOULD initialise output ports to a safe sentinel
(e.g. the null Atom) before calling run().</p>
""" .
atom:bufferType
a rdf:Property ,
owl:ObjectProperty ;
rdfs:domain atom:AtomPort ;
rdfs:range rdfs:Class ;
rdfs:label "buffer type" ;
lv2:documentation """
<p>Indicates that an AtomPort may be connected to a certain Atom type. A port
MAY support several buffer types. The host MUST NOT connect a port to an Atom
with a type not explicitly listed with this property. The value of this
property MUST be a sub-class of atom:Atom. For example, an input port that is
connected directly to an LV2_Atom_Double value is described like so:</p>
<pre class="turtle-code">
&lt;plugin&gt;
lv2:port [
a lv2:InputPort , atom:AtomPort ;
atom:bufferType atom:Double ;
] .
</pre>
<p>This property only describes the types a port may be <em>directly</em>
connected to. It says nothing about the expected contents of containers. For
that, use atom:supports.</p>
""" .
atom:childType
a rdf:Property ,
owl:ObjectProperty ;
rdfs:label "child type" ;
rdfs:comment "The type of a container's children." .
atom:supports
a rdf:Property ;
rdfs:label "supports" ;
rdfs:range rdfs:Class ;
lv2:documentation """
<p>Indicates that a particular Atom type is supported.</p>
<p>This property is defined loosely, it may be used to indicate that anything
<q>supports</q> an Atom type, wherever that may be useful. It applies
<q>recursively</q> where collections are involved.</p>
<p>In particular, this property can be used to describe which event types are
expected by a port. For example, a port that receives MIDI events is described
like so:</p>
<pre class="turtle-code">
&lt;plugin&gt;
lv2:port [
a lv2:InputPort , atom:AtomPort ;
atom:bufferType atom:Sequence ;
atom:supports midi:MidiEvent ;
] .
</pre>
""" .
atom:eventTransfer
a ui:PortProtocol ;
rdfs:label "event transfer" ;
lv2:documentation """
<p>Transfer of individual events in a port buffer. Useful as the
<code>format</code> for a LV2UI_Write_Function.</p>
<p>This protocol applies to ports which contain events, usually in an
atom:Sequence. The host must transfer each individual event to the recipient.
The format of the received data is an LV2_Atom, there is no timestamp
header.</p>
""" .
atom:atomTransfer
a ui:PortProtocol ;
rdfs:label "atom transfer" ;
lv2:documentation """
<p>Transfer of the complete atom in a port buffer. Useful as the
<code>format</code> for a LV2UI_Write_Function.</p>
<p>This protocol applies to atom ports. The host must transfer the complete
atom contained in the port, including header.</p>
""" .

View file

@ -1,237 +0,0 @@
/*
Copyright 2019 David Robillard <http://drobilla.net>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "lv2/atom/atom-test-utils.c"
#include "lv2/atom/atom.h"
#include "lv2/atom/forge.h"
#include "lv2/atom/util.h"
#include "lv2/urid/urid.h"
#include <assert.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
static int
test_string_overflow(void)
{
#define MAX_CHARS 15
static const size_t capacity = sizeof(LV2_Atom_String) + MAX_CHARS + 1;
static const char* str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
uint8_t* buf = (uint8_t*)malloc(capacity);
LV2_URID_Map map = { NULL, urid_map };
LV2_Atom_Forge forge;
lv2_atom_forge_init(&forge, &map);
// Check that writing increasingly long strings fails at the right point
for (size_t count = 0; count < MAX_CHARS; ++count) {
lv2_atom_forge_set_buffer(&forge, buf, capacity);
const LV2_Atom_Forge_Ref ref =
lv2_atom_forge_string(&forge, str, count);
if (!ref) {
return test_fail("Failed to write %zu byte string\n", count);
}
}
// Failure writing to an exactly full forge
LV2_Atom_Forge_Ref ref = 0;
if ((ref = lv2_atom_forge_string(&forge, str, MAX_CHARS + 1))) {
return test_fail("Successfully wrote past end of buffer\n");
}
// Failure writing body after successfully writing header
lv2_atom_forge_set_buffer(&forge, buf, sizeof(LV2_Atom) + 1);
if ((ref = lv2_atom_forge_string(&forge, "AB", 2))) {
return test_fail("Successfully wrote atom header past end\n");
}
free(buf);
return 0;
}
static int
test_literal_overflow(void)
{
static const size_t capacity = sizeof(LV2_Atom_Literal) + 2;
uint8_t* buf = (uint8_t*)malloc(capacity);
LV2_URID_Map map = { NULL, urid_map };
LV2_Atom_Forge_Ref ref = 0;
LV2_Atom_Forge forge;
lv2_atom_forge_init(&forge, &map);
// Failure in atom header
lv2_atom_forge_set_buffer(&forge, buf, 1);
if ((ref = lv2_atom_forge_literal(&forge, "A", 1, 0, 0))) {
return test_fail("Successfully wrote atom header past end\n");
}
// Failure in literal header
lv2_atom_forge_set_buffer(&forge, buf, sizeof(LV2_Atom) + 1);
if ((ref = lv2_atom_forge_literal(&forge, "A", 1, 0, 0))) {
return test_fail("Successfully wrote literal header past end\n");
}
// Success (only room for one character + null terminator)
lv2_atom_forge_set_buffer(&forge, buf, capacity);
if (!(ref = lv2_atom_forge_literal(&forge, "A", 1, 0, 0))) {
return test_fail("Failed to write small enough literal\n");
}
// Failure in body
lv2_atom_forge_set_buffer(&forge, buf, capacity);
if ((ref = lv2_atom_forge_literal(&forge, "AB", 2, 0, 0))) {
return test_fail("Successfully wrote literal body past end\n");
}
free(buf);
return 0;
}
static int
test_sequence_overflow(void)
{
static const size_t size = sizeof(LV2_Atom_Sequence) + 6 * sizeof(LV2_Atom);
LV2_URID_Map map = { NULL, urid_map };
// Test over a range that fails in the sequence header and event components
for (size_t capacity = 1; capacity < size; ++capacity) {
uint8_t* buf = (uint8_t*)malloc(capacity);
LV2_Atom_Forge forge;
lv2_atom_forge_init(&forge, &map);
lv2_atom_forge_set_buffer(&forge, buf, capacity);
LV2_Atom_Forge_Frame frame;
LV2_Atom_Forge_Ref ref =
lv2_atom_forge_sequence_head(&forge, &frame, 0);
assert(capacity >= sizeof(LV2_Atom_Sequence) || !frame.ref);
assert(capacity >= sizeof(LV2_Atom_Sequence) || !ref);
lv2_atom_forge_frame_time(&forge, 0);
lv2_atom_forge_int(&forge, 42);
lv2_atom_forge_pop(&forge, &frame);
free(buf);
}
return 0;
}
static int
test_vector_head_overflow(void)
{
static const size_t size = sizeof(LV2_Atom_Vector) + 3 * sizeof(LV2_Atom);
LV2_URID_Map map = { NULL, urid_map };
// Test over a range that fails in the vector header and elements
for (size_t capacity = 1; capacity < size; ++capacity) {
uint8_t* buf = (uint8_t*)malloc(capacity);
LV2_Atom_Forge forge;
lv2_atom_forge_init(&forge, &map);
lv2_atom_forge_set_buffer(&forge, buf, capacity);
LV2_Atom_Forge_Frame frame;
LV2_Atom_Forge_Ref ref = lv2_atom_forge_vector_head(
&forge, &frame, sizeof(int32_t), forge.Int);
assert(capacity >= sizeof(LV2_Atom_Vector) || !frame.ref);
assert(capacity >= sizeof(LV2_Atom_Vector) || !ref);
lv2_atom_forge_int(&forge, 1);
lv2_atom_forge_int(&forge, 2);
lv2_atom_forge_int(&forge, 3);
lv2_atom_forge_pop(&forge, &frame);
free(buf);
}
return 0;
}
static int
test_vector_overflow(void)
{
static const size_t size = sizeof(LV2_Atom_Vector) + 3 * sizeof(LV2_Atom);
static const int32_t vec[] = { 1, 2, 3 };
LV2_URID_Map map = { NULL, urid_map };
// Test over a range that fails in the vector header and elements
for (size_t capacity = 1; capacity < size; ++capacity) {
uint8_t* buf = (uint8_t*)malloc(capacity);
LV2_Atom_Forge forge;
lv2_atom_forge_init(&forge, &map);
lv2_atom_forge_set_buffer(&forge, buf, capacity);
LV2_Atom_Forge_Ref ref = lv2_atom_forge_vector(
&forge, sizeof(int32_t), forge.Int, 3, vec);
assert(capacity >= sizeof(LV2_Atom_Vector) || !ref);
free(buf);
}
return 0;
}
static int
test_tuple_overflow(void)
{
static const size_t size = sizeof(LV2_Atom_Tuple) + 3 * sizeof(LV2_Atom);
LV2_URID_Map map = { NULL, urid_map };
// Test over a range that fails in the tuple header and elements
for (size_t capacity = 1; capacity < size; ++capacity) {
uint8_t* buf = (uint8_t*)malloc(capacity);
LV2_Atom_Forge forge;
lv2_atom_forge_init(&forge, &map);
lv2_atom_forge_set_buffer(&forge, buf, capacity);
LV2_Atom_Forge_Frame frame;
LV2_Atom_Forge_Ref ref = lv2_atom_forge_tuple(&forge, &frame);
assert(capacity >= sizeof(LV2_Atom_Tuple) || !frame.ref);
assert(capacity >= sizeof(LV2_Atom_Tuple) || !ref);
lv2_atom_forge_int(&forge, 1);
lv2_atom_forge_float(&forge, 2.0f);
lv2_atom_forge_string(&forge, "three", 5);
lv2_atom_forge_pop(&forge, &frame);
free(buf);
}
return 0;
}
int
main(void)
{
const int ret = test_string_overflow() || test_literal_overflow() ||
test_sequence_overflow() || test_vector_head_overflow() ||
test_vector_overflow() || test_tuple_overflow();
free_urid_map();
return ret;
}

View file

@ -1,18 +1,5 @@
/*
Copyright 2008-2016 David Robillard <http://drobilla.net>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
// Copyright 2008-2016 David Robillard <d@drobilla.net>
// SPDX-License-Identifier: ISC
/**
@file forge.h An API for constructing LV2 atoms.
@ -27,8 +14,8 @@
must be popped when the container is finished.
All output is written to a user-provided buffer or sink function. This
makes it popssible to create create atoms on the stack, on the heap, in LV2
port buffers, in a ringbuffer, or elsewhere, all using the same API.
makes it possible to create atoms on the stack, on the heap, in LV2 port
buffers, in a ringbuffer, or elsewhere, all using the same API.
This entire API is realtime safe if used with a buffer or a realtime safe
sink, except lv2_atom_forge_init() which is only realtime safe if the URI
@ -39,15 +26,18 @@
This header is non-normative, it is provided for convenience.
*/
#ifndef LV2_ATOM_FORGE_H
#define LV2_ATOM_FORGE_H
/**
@defgroup forge Forge
@ingroup atom
An API for constructing LV2 atoms.
@{
*/
#ifndef LV2_ATOM_FORGE_H
#define LV2_ATOM_FORGE_H
#include "lv2/atom/atom.h"
#include "lv2/atom/util.h"
#include "lv2/core/attributes.h"
@ -55,6 +45,8 @@
#include <assert.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#ifdef __cplusplus
extern "C" {
@ -70,19 +62,19 @@ typedef void* LV2_Atom_Forge_Sink_Handle;
typedef intptr_t LV2_Atom_Forge_Ref;
/** Sink function for writing output. See lv2_atom_forge_set_sink(). */
typedef LV2_Atom_Forge_Ref
(*LV2_Atom_Forge_Sink)(LV2_Atom_Forge_Sink_Handle handle,
typedef LV2_Atom_Forge_Ref (*LV2_Atom_Forge_Sink)(
LV2_Atom_Forge_Sink_Handle handle,
const void* buf,
uint32_t size);
/** Function for resolving a reference. See lv2_atom_forge_set_sink(). */
typedef LV2_Atom*
(*LV2_Atom_Forge_Deref_Func)(LV2_Atom_Forge_Sink_Handle handle,
typedef LV2_Atom* (*LV2_Atom_Forge_Deref_Func)(
LV2_Atom_Forge_Sink_Handle handle,
LV2_Atom_Forge_Ref ref);
/** A stack frame used for keeping track of nested Atom containers. */
typedef struct _LV2_Atom_Forge_Frame {
struct _LV2_Atom_Forge_Frame* parent;
typedef struct LV2_Atom_Forge_Frame {
struct LV2_Atom_Forge_Frame* parent;
LV2_Atom_Forge_Ref ref;
} LV2_Atom_Forge_Frame;
@ -208,8 +200,7 @@ lv2_atom_forge_top_is(LV2_Atom_Forge* forge, uint32_t type)
static inline bool
lv2_atom_forge_is_object_type(const LV2_Atom_Forge* forge, uint32_t type)
{
return (type == forge->Object ||
type == forge->Blank ||
return (type == forge->Object || type == forge->Blank ||
type == forge->Resource);
}
@ -219,8 +210,7 @@ lv2_atom_forge_is_blank(const LV2_Atom_Forge* forge,
uint32_t type,
const LV2_Atom_Object_Body* body)
{
return (type == forge->Blank ||
(type == forge->Object && body->id == 0));
return (type == forge->Blank || (type == forge->Object && body->id == 0));
}
/**
@ -279,7 +269,7 @@ lv2_atom_forge_set_sink(LV2_Atom_Forge* forge,
/**
Write raw output. This is used internally, but is also useful for writing
atom types not explicitly supported by the forge API. Note the caller is
responsible for ensuring the output is approriately padded.
responsible for ensuring the output is appropriately padded.
*/
static inline LV2_Atom_Forge_Ref
lv2_atom_forge_raw(LV2_Atom_Forge* forge, const void* data, uint32_t size)
@ -324,9 +314,7 @@ lv2_atom_forge_write(LV2_Atom_Forge* forge, const void* data, uint32_t size)
/** Write a null-terminated string body. */
static inline LV2_Atom_Forge_Ref
lv2_atom_forge_string_body(LV2_Atom_Forge* forge,
const char* str,
uint32_t len)
lv2_atom_forge_string_body(LV2_Atom_Forge* forge, const char* str, uint32_t len)
{
LV2_Atom_Forge_Ref out = lv2_atom_forge_raw(forge, str, len);
if (out && (out = lv2_atom_forge_raw(forge, "", 1))) {
@ -345,7 +333,7 @@ lv2_atom_forge_string_body(LV2_Atom_Forge* forge,
static inline LV2_Atom_Forge_Ref
lv2_atom_forge_atom(LV2_Atom_Forge* forge, uint32_t size, uint32_t type)
{
const LV2_Atom a = { size, type };
const LV2_Atom a = {size, type};
return lv2_atom_forge_raw(forge, &a, sizeof(a));
}
@ -353,58 +341,58 @@ lv2_atom_forge_atom(LV2_Atom_Forge* forge, uint32_t size, uint32_t type)
static inline LV2_Atom_Forge_Ref
lv2_atom_forge_primitive(LV2_Atom_Forge* forge, const LV2_Atom* a)
{
return (lv2_atom_forge_top_is(forge, forge->Vector)
return (
lv2_atom_forge_top_is(forge, forge->Vector)
? lv2_atom_forge_raw(forge, LV2_ATOM_BODY_CONST(a), a->size)
: lv2_atom_forge_write(
forge, a, (uint32_t)sizeof(LV2_Atom) + a->size));
: lv2_atom_forge_write(forge, a, (uint32_t)sizeof(LV2_Atom) + a->size));
}
/** Write an atom:Int. */
static inline LV2_Atom_Forge_Ref
lv2_atom_forge_int(LV2_Atom_Forge* forge, int32_t val)
{
const LV2_Atom_Int a = { { sizeof(val), forge->Int }, val };
return lv2_atom_forge_primitive(forge, &a.atom);
const LV2_Atom_Int a = {{sizeof(val), forge->Int}, val};
return lv2_atom_forge_primitive(forge, (const LV2_Atom*)&a);
}
/** Write an atom:Long. */
static inline LV2_Atom_Forge_Ref
lv2_atom_forge_long(LV2_Atom_Forge* forge, int64_t val)
{
const LV2_Atom_Long a = { { sizeof(val), forge->Long }, val };
return lv2_atom_forge_primitive(forge, &a.atom);
const LV2_Atom_Long a = {{sizeof(val), forge->Long}, val};
return lv2_atom_forge_primitive(forge, (const LV2_Atom*)&a);
}
/** Write an atom:Float. */
static inline LV2_Atom_Forge_Ref
lv2_atom_forge_float(LV2_Atom_Forge* forge, float val)
{
const LV2_Atom_Float a = { { sizeof(val), forge->Float }, val };
return lv2_atom_forge_primitive(forge, &a.atom);
const LV2_Atom_Float a = {{sizeof(val), forge->Float}, val};
return lv2_atom_forge_primitive(forge, (const LV2_Atom*)&a);
}
/** Write an atom:Double. */
static inline LV2_Atom_Forge_Ref
lv2_atom_forge_double(LV2_Atom_Forge* forge, double val)
{
const LV2_Atom_Double a = { { sizeof(val), forge->Double }, val };
return lv2_atom_forge_primitive(forge, &a.atom);
const LV2_Atom_Double a = {{sizeof(val), forge->Double}, val};
return lv2_atom_forge_primitive(forge, (const LV2_Atom*)&a);
}
/** Write an atom:Bool. */
static inline LV2_Atom_Forge_Ref
lv2_atom_forge_bool(LV2_Atom_Forge* forge, bool val)
{
const LV2_Atom_Bool a = { { sizeof(int32_t), forge->Bool }, val ? 1 : 0 };
return lv2_atom_forge_primitive(forge, &a.atom);
const LV2_Atom_Bool a = {{sizeof(int32_t), forge->Bool}, val ? 1 : 0};
return lv2_atom_forge_primitive(forge, (const LV2_Atom*)&a);
}
/** Write an atom:URID. */
static inline LV2_Atom_Forge_Ref
lv2_atom_forge_urid(LV2_Atom_Forge* forge, LV2_URID id)
{
const LV2_Atom_URID a = { { sizeof(id), forge->URID }, id };
return lv2_atom_forge_primitive(forge, &a.atom);
const LV2_Atom_URID a = {{sizeof(id), forge->URID}, id};
return lv2_atom_forge_primitive(forge, (const LV2_Atom*)&a);
}
/** Write an atom compatible with atom:String. Used internally. */
@ -414,7 +402,7 @@ lv2_atom_forge_typed_string(LV2_Atom_Forge* forge,
const char* str,
uint32_t len)
{
const LV2_Atom_String a = { { len + 1, type } };
const LV2_Atom_String a = {{len + 1, type}};
LV2_Atom_Forge_Ref out = lv2_atom_forge_raw(forge, &a, sizeof(a));
if (out) {
if (!lv2_atom_forge_string_body(forge, str, len)) {
@ -460,11 +448,9 @@ lv2_atom_forge_literal(LV2_Atom_Forge* forge,
uint32_t lang)
{
const LV2_Atom_Literal a = {
{ (uint32_t)(sizeof(LV2_Atom_Literal) - sizeof(LV2_Atom) + len + 1),
forge->Literal },
{ datatype,
lang }
};
{(uint32_t)(sizeof(LV2_Atom_Literal) - sizeof(LV2_Atom) + len + 1),
forge->Literal},
{datatype, lang}};
LV2_Atom_Forge_Ref out = lv2_atom_forge_raw(forge, &a, sizeof(a));
if (out) {
if (!lv2_atom_forge_string_body(forge, str, len)) {
@ -483,10 +469,8 @@ lv2_atom_forge_vector_head(LV2_Atom_Forge* forge,
uint32_t child_size,
uint32_t child_type)
{
const LV2_Atom_Vector a = {
{ sizeof(LV2_Atom_Vector_Body), forge->Vector },
{ child_size, child_type }
};
const LV2_Atom_Vector a = {{sizeof(LV2_Atom_Vector_Body), forge->Vector},
{child_size, child_type}};
return lv2_atom_forge_push(
forge, frame, lv2_atom_forge_write(forge, &a, sizeof(a)));
}
@ -500,10 +484,9 @@ lv2_atom_forge_vector(LV2_Atom_Forge* forge,
const void* elems)
{
const LV2_Atom_Vector a = {
{ (uint32_t)(sizeof(LV2_Atom_Vector_Body) + n_elems * child_size),
forge->Vector },
{ child_size, child_type }
};
{(uint32_t)sizeof(LV2_Atom_Vector_Body) + n_elems * child_size,
forge->Vector},
{child_size, child_type}};
LV2_Atom_Forge_Ref out = lv2_atom_forge_write(forge, &a, sizeof(a));
if (out) {
lv2_atom_forge_write(forge, elems, child_size * n_elems);
@ -523,7 +506,7 @@ lv2_atom_forge_vector(LV2_Atom_Forge* forge,
// Write tuple (1, 2.0)
LV2_Atom_Forge_Frame frame;
LV2_Atom* tup = (LV2_Atom*)lv2_atom_forge_tuple(forge, &frame);
lv2_atom_forge_int32(forge, 1);
lv2_atom_forge_int(forge, 1);
lv2_atom_forge_float(forge, 2.0);
lv2_atom_forge_pop(forge, &frame);
@endcode
@ -531,7 +514,7 @@ lv2_atom_forge_vector(LV2_Atom_Forge* forge,
static inline LV2_Atom_Forge_Ref
lv2_atom_forge_tuple(LV2_Atom_Forge* forge, LV2_Atom_Forge_Frame* frame)
{
const LV2_Atom_Tuple a = { { 0, forge->Tuple } };
const LV2_Atom_Tuple a = {{0, forge->Tuple}};
return lv2_atom_forge_push(
forge, frame, lv2_atom_forge_write(forge, &a, sizeof(a)));
}
@ -567,9 +550,7 @@ lv2_atom_forge_object(LV2_Atom_Forge* forge,
LV2_URID otype)
{
const LV2_Atom_Object a = {
{ (uint32_t)sizeof(LV2_Atom_Object_Body), forge->Object },
{ id, otype }
};
{(uint32_t)sizeof(LV2_Atom_Object_Body), forge->Object}, {id, otype}};
return lv2_atom_forge_push(
forge, frame, lv2_atom_forge_write(forge, &a, sizeof(a)));
}
@ -588,9 +569,7 @@ lv2_atom_forge_resource(LV2_Atom_Forge* forge,
LV2_URID otype)
{
const LV2_Atom_Object a = {
{ (uint32_t)sizeof(LV2_Atom_Object_Body), forge->Resource },
{ id, otype }
};
{(uint32_t)sizeof(LV2_Atom_Object_Body), forge->Resource}, {id, otype}};
return lv2_atom_forge_push(
forge, frame, lv2_atom_forge_write(forge, &a, sizeof(a)));
}
@ -609,9 +588,7 @@ lv2_atom_forge_blank(LV2_Atom_Forge* forge,
LV2_URID otype)
{
const LV2_Atom_Object a = {
{ (uint32_t)sizeof(LV2_Atom_Object_Body), forge->Blank },
{ id, otype }
};
{(uint32_t)sizeof(LV2_Atom_Object_Body), forge->Blank}, {id, otype}};
return lv2_atom_forge_push(
forge, frame, lv2_atom_forge_write(forge, &a, sizeof(a)));
}
@ -622,10 +599,9 @@ lv2_atom_forge_blank(LV2_Atom_Forge* forge,
See lv2_atom_forge_object() documentation for an example.
*/
static inline LV2_Atom_Forge_Ref
lv2_atom_forge_key(LV2_Atom_Forge* forge,
LV2_URID key)
lv2_atom_forge_key(LV2_Atom_Forge* forge, LV2_URID key)
{
const LV2_Atom_Property_Body a = { key, 0, { 0, 0 } };
const LV2_Atom_Property_Body a = {key, 0, {0, 0}};
return lv2_atom_forge_write(forge, &a, 2 * (uint32_t)sizeof(uint32_t));
}
@ -640,7 +616,7 @@ lv2_atom_forge_property_head(LV2_Atom_Forge* forge,
LV2_URID key,
LV2_URID context)
{
const LV2_Atom_Property_Body a = { key, context, { 0, 0 } };
const LV2_Atom_Property_Body a = {key, context, {0, 0}};
return lv2_atom_forge_write(forge, &a, 2 * (uint32_t)sizeof(uint32_t));
}
@ -653,9 +629,7 @@ lv2_atom_forge_sequence_head(LV2_Atom_Forge* forge,
uint32_t unit)
{
const LV2_Atom_Sequence a = {
{ (uint32_t)sizeof(LV2_Atom_Sequence_Body), forge->Sequence },
{ unit, 0 }
};
{(uint32_t)sizeof(LV2_Atom_Sequence_Body), forge->Sequence}, {unit, 0}};
return lv2_atom_forge_push(
forge, frame, lv2_atom_forge_write(forge, &a, sizeof(a)));
}
@ -682,15 +656,15 @@ lv2_atom_forge_beat_time(LV2_Atom_Forge* forge, double beats)
return lv2_atom_forge_write(forge, &beats, sizeof(beats));
}
/**
@}
@}
*/
LV2_RESTORE_WARNINGS
#ifdef __cplusplus
} /* extern "C" */
#endif
/**
@}
@}
*/
#endif /* LV2_ATOM_FORGE_H */

View file

@ -1,103 +0,0 @@
@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/atom>
a doap:Project ;
doap:name "LV2 Atom" ;
doap:shortdesc "A generic value container and several data types." ;
doap:license <http://opensource.org/licenses/isc> ;
doap:created "2007-00-00" ;
doap:developer <http://drobilla.net/drobilla#me> ;
doap:release [
doap:revision "2.2" ;
doap:created "2019-02-03" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.16.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Add lv2_atom_object_get_typed() for easy type-safe access to object properties."
]
]
] , [
doap:revision "2.0" ;
doap:created "2014-08-08" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.10.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Deprecate Blank and Resource in favour of just Object."
] , [
rdfs:label "Add lv2_atom_forge_is_object_type() and lv2_atom_forge_is_blank() to ease backwards compatibility."
] , [
rdfs:label "Add lv2_atom_forge_key() for terser object writing."
] , [
rdfs:label "Add lv2_atom_sequence_clear() and lv2_atom_sequence_append_event() helper functions."
]
]
] , [
doap:revision "1.8" ;
doap:created "2014-01-04" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.8.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Make lv2_atom_*_is_end() arguments const."
]
]
] , [
doap:revision "1.6" ;
doap:created "2013-05-26" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.6.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Fix crash in forge.h when pushing atoms to a full buffer."
]
]
] , [
doap:revision "1.4" ;
doap:created "2013-01-27" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.4.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Fix lv2_atom_sequence_end()."
] , [
rdfs:label "Remove atom:stringType in favour of owl:onDatatype so generic tools can understand and validate atom literals."
] , [
rdfs:label "Improve atom documentation."
]
]
] , [
doap:revision "1.2" ;
doap:created "2012-10-14" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.2.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Fix implicit conversions in forge.h that are invalid in C++11."
] , [
rdfs:label "Fix lv2_atom_object_next() on 32-bit platforms."
] , [
rdfs:label "Add lv2_atom_object_body_get()."
] , [
rdfs:label "Fix outdated documentation in forge.h."
] , [
rdfs:label "Use consistent label style."
] , [
rdfs:label "Add LV2_ATOM_CONTENTS_CONST and LV2_ATOM_BODY_CONST."
]
]
] , [
doap:revision "1.0" ;
doap:created "2012-04-17" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Initial release."
]
]
] .

View file

@ -1,8 +0,0 @@
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/atom>
a lv2:Specification ;
lv2:minorVersion 2 ;
lv2:microVersion 2 ;
rdfs:seeAlso <atom.ttl> .

View file

@ -1,18 +1,8 @@
/*
Copyright 2008-2015 David Robillard <http://drobilla.net>
// Copyright 2008-2015 David Robillard <d@drobilla.net>
// SPDX-License-Identifier: ISC
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef LV2_ATOM_UTIL_H
#define LV2_ATOM_UTIL_H
/**
@file util.h Helper functions for the LV2 Atom extension.
@ -25,12 +15,12 @@
/**
@defgroup util Utilities
@ingroup atom
Utilities for working with atoms.
@{
*/
#ifndef LV2_ATOM_UTIL_H
#define LV2_ATOM_UTIL_H
#include "lv2/atom/atom.h"
#include <stdarg.h>
@ -67,8 +57,7 @@ lv2_atom_is_null(const LV2_Atom* atom)
static inline bool
lv2_atom_equals(const LV2_Atom* a, const LV2_Atom* b)
{
return (a == b) || ((a->type == b->type) &&
(a->size == b->size) &&
return (a == b) || ((a->type == b->type) && (a->size == b->size) &&
!memcmp(a + 1, b + 1, a->size));
}
@ -104,9 +93,8 @@ lv2_atom_sequence_is_end(const LV2_Atom_Sequence_Body* body,
static inline LV2_Atom_Event*
lv2_atom_sequence_next(const LV2_Atom_Event* i)
{
return (LV2_Atom_Event*)((const uint8_t*)i
+ sizeof(LV2_Atom_Event)
+ lv2_atom_pad_size(i->body.size));
return (LV2_Atom_Event*)((const uint8_t*)i + sizeof(LV2_Atom_Event) +
lv2_atom_pad_size(i->body.size));
}
/**
@ -114,7 +102,9 @@ lv2_atom_sequence_next(const LV2_Atom_Event* i)
@param seq The sequence to iterate over
@param iter The name of the iterator
This macro is used similarly to a for loop (which it expands to), e.g.:
This macro is used similarly to a for loop (which it expands to), for
example:
@code
LV2_ATOM_SEQUENCE_FOREACH(sequence, ev) {
// Do something with ev (an LV2_Atom_Event*) here...
@ -122,13 +112,13 @@ lv2_atom_sequence_next(const LV2_Atom_Event* i)
@endcode
*/
#define LV2_ATOM_SEQUENCE_FOREACH(seq, iter) \
for (LV2_Atom_Event* iter = lv2_atom_sequence_begin(&(seq)->body); \
for (LV2_Atom_Event * iter = lv2_atom_sequence_begin(&(seq)->body); \
!lv2_atom_sequence_is_end(&(seq)->body, (seq)->atom.size, (iter)); \
(iter) = lv2_atom_sequence_next(iter))
/** Like LV2_ATOM_SEQUENCE_FOREACH but for a headerless sequence body. */
#define LV2_ATOM_SEQUENCE_BODY_FOREACH(body, size, iter) \
for (LV2_Atom_Event* iter = lv2_atom_sequence_begin(body); \
for (LV2_Atom_Event * iter = lv2_atom_sequence_begin(body); \
!lv2_atom_sequence_is_end(body, size, (iter)); \
(iter) = lv2_atom_sequence_next(iter))
@ -154,7 +144,7 @@ lv2_atom_sequence_clear(LV2_Atom_Sequence* seq)
@param seq Sequence to append to.
@param capacity Total capacity of the sequence atom
(e.g. as set by the host for sequence output ports).
(as set by the host for sequence output ports).
@param event Event to write.
@return A pointer to the newly written event in `seq`,
@ -202,8 +192,8 @@ lv2_atom_tuple_is_end(const void* body, uint32_t size, const LV2_Atom* i)
static inline LV2_Atom*
lv2_atom_tuple_next(const LV2_Atom* i)
{
return (LV2_Atom*)(
(const uint8_t*)i + sizeof(LV2_Atom) + lv2_atom_pad_size(i->size));
return (LV2_Atom*)((const uint8_t*)i + sizeof(LV2_Atom) +
lv2_atom_pad_size(i->size));
}
/**
@ -211,7 +201,9 @@ lv2_atom_tuple_next(const LV2_Atom* i)
@param tuple The tuple to iterate over
@param iter The name of the iterator
This macro is used similarly to a for loop (which it expands to), e.g.:
This macro is used similarly to a for loop (which it expands to), for
example:
@code
LV2_ATOM_TUPLE_FOREACH(tuple, elem) {
// Do something with elem (an LV2_Atom*) here...
@ -219,13 +211,14 @@ lv2_atom_tuple_next(const LV2_Atom* i)
@endcode
*/
#define LV2_ATOM_TUPLE_FOREACH(tuple, iter) \
for (LV2_Atom* iter = lv2_atom_tuple_begin(tuple); \
!lv2_atom_tuple_is_end(LV2_ATOM_BODY(tuple), (tuple)->atom.size, (iter)); \
for (LV2_Atom * iter = lv2_atom_tuple_begin(tuple); \
!lv2_atom_tuple_is_end( \
LV2_ATOM_BODY(tuple), (tuple)->atom.size, (iter)); \
(iter) = lv2_atom_tuple_next(iter))
/** Like LV2_ATOM_TUPLE_FOREACH but for a headerless tuple body. */
#define LV2_ATOM_TUPLE_BODY_FOREACH(body, size, iter) \
for (LV2_Atom* iter = (LV2_Atom*)(body); \
for (LV2_Atom * iter = (LV2_Atom*)(body); \
!lv2_atom_tuple_is_end(body, size, (iter)); \
(iter) = lv2_atom_tuple_next(iter))
@ -255,11 +248,12 @@ lv2_atom_object_is_end(const LV2_Atom_Object_Body* body,
static inline LV2_Atom_Property_Body*
lv2_atom_object_next(const LV2_Atom_Property_Body* i)
{
const LV2_Atom* const value = (const LV2_Atom*)(
(const uint8_t*)i + 2 * sizeof(uint32_t));
return (LV2_Atom_Property_Body*)(
(const uint8_t*)i + lv2_atom_pad_size(
(uint32_t)sizeof(LV2_Atom_Property_Body) + value->size));
const LV2_Atom* const value =
(const LV2_Atom*)((const uint8_t*)i + 2 * sizeof(uint32_t));
return (LV2_Atom_Property_Body*)((const uint8_t*)i +
lv2_atom_pad_size(
(uint32_t)sizeof(LV2_Atom_Property_Body) +
value->size));
}
/**
@ -267,7 +261,9 @@ lv2_atom_object_next(const LV2_Atom_Property_Body* i)
@param obj The object to iterate over
@param iter The name of the iterator
This macro is used similarly to a for loop (which it expands to), e.g.:
This macro is used similarly to a for loop (which it expands to), for
example:
@code
LV2_ATOM_OBJECT_FOREACH(object, i) {
// Do something with i (an LV2_Atom_Property_Body*) here...
@ -275,13 +271,13 @@ lv2_atom_object_next(const LV2_Atom_Property_Body* i)
@endcode
*/
#define LV2_ATOM_OBJECT_FOREACH(obj, iter) \
for (LV2_Atom_Property_Body* iter = lv2_atom_object_begin(&(obj)->body); \
for (LV2_Atom_Property_Body * iter = lv2_atom_object_begin(&(obj)->body); \
!lv2_atom_object_is_end(&(obj)->body, (obj)->atom.size, (iter)); \
(iter) = lv2_atom_object_next(iter))
/** Like LV2_ATOM_OBJECT_FOREACH but for a headerless object body. */
#define LV2_ATOM_OBJECT_BODY_FOREACH(body, size, iter) \
for (LV2_Atom_Property_Body* iter = lv2_atom_object_begin(body); \
for (LV2_Atom_Property_Body * iter = lv2_atom_object_begin(body); \
!lv2_atom_object_is_end(body, size, (iter)); \
(iter) = lv2_atom_object_next(iter))
@ -298,7 +294,7 @@ typedef struct {
} LV2_Atom_Object_Query;
/** Sentinel for lv2_atom_object_query(). */
static const LV2_Atom_Object_Query LV2_ATOM_OBJECT_QUERY_END = { 0, NULL };
static const LV2_Atom_Object_Query LV2_ATOM_OBJECT_QUERY_END = {0, NULL};
/**
Get an object's values for various keys.
@ -337,7 +333,7 @@ lv2_atom_object_query(const LV2_Atom_Object* object,
++n_queries;
}
LV2_ATOM_OBJECT_FOREACH(object, prop) {
LV2_ATOM_OBJECT_FOREACH (object, prop) {
for (LV2_Atom_Object_Query* q = query; q->key; ++q) {
if (q->key == prop->key && !*q->value) {
*q->value = &prop->value;
@ -365,12 +361,13 @@ lv2_atom_object_body_get(uint32_t size, const LV2_Atom_Object_Body* body, ...)
va_start(args, body);
for (n_queries = 0; va_arg(args, uint32_t); ++n_queries) {
if (!va_arg(args, const LV2_Atom**)) {
va_end(args);
return -1;
}
}
va_end(args);
LV2_ATOM_OBJECT_BODY_FOREACH(body, size, prop) {
LV2_ATOM_OBJECT_BODY_FOREACH (body, size, prop) {
va_start(args, body);
for (int i = 0; i < n_queries; ++i) {
uint32_t qkey = va_arg(args, uint32_t);
@ -378,6 +375,7 @@ lv2_atom_object_body_get(uint32_t size, const LV2_Atom_Object_Body* body, ...)
if (qkey == prop->key && !*qval) {
*qval = &prop->value;
if (++matches == n_queries) {
va_end(args);
return matches;
}
break;
@ -418,12 +416,13 @@ lv2_atom_object_get(const LV2_Atom_Object* object, ...)
va_start(args, object);
for (n_queries = 0; va_arg(args, uint32_t); ++n_queries) {
if (!va_arg(args, const LV2_Atom**)) {
va_end(args);
return -1;
}
}
va_end(args);
LV2_ATOM_OBJECT_FOREACH(object, prop) {
LV2_ATOM_OBJECT_FOREACH (object, prop) {
va_start(args, object);
for (int i = 0; i < n_queries; ++i) {
uint32_t qkey = va_arg(args, uint32_t);
@ -431,6 +430,7 @@ lv2_atom_object_get(const LV2_Atom_Object* object, ...)
if (qkey == prop->key && !*qval) {
*qval = &prop->value;
if (++matches == n_queries) {
va_end(args);
return matches;
}
break;
@ -471,14 +471,14 @@ lv2_atom_object_get_typed(const LV2_Atom_Object* object, ...)
va_list args;
va_start(args, object);
for (n_queries = 0; va_arg(args, uint32_t); ++n_queries) {
if (!va_arg(args, const LV2_Atom**) ||
!va_arg(args, uint32_t)) {
if (!va_arg(args, const LV2_Atom**) || !va_arg(args, uint32_t)) {
va_end(args);
return -1;
}
}
va_end(args);
LV2_ATOM_OBJECT_FOREACH(object, prop) {
LV2_ATOM_OBJECT_FOREACH (object, prop) {
va_start(args, object);
for (int i = 0; i < n_queries; ++i) {
const uint32_t qkey = va_arg(args, uint32_t);
@ -487,6 +487,7 @@ lv2_atom_object_get_typed(const LV2_Atom_Object* object, ...)
if (!*qval && qkey == prop->key && qtype == prop->value.type) {
*qval = &prop->value;
if (++matches == n_queries) {
va_end(args);
return matches;
}
break;
@ -497,13 +498,13 @@ lv2_atom_object_get_typed(const LV2_Atom_Object* object, ...)
return matches;
}
#ifdef __cplusplus
} /* extern "C" */
#endif
/**
@}
@}
*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* LV2_ATOM_UTIL_H */

View file

@ -1,35 +1,27 @@
/*
Copyright 2007-2016 David Robillard <http://drobilla.net>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
// Copyright 2007-2016 David Robillard <d@drobilla.net>
// SPDX-License-Identifier: ISC
#ifndef LV2_BUF_SIZE_H
#define LV2_BUF_SIZE_H
/**
@defgroup buf-size Buffer Size
@ingroup lv2
Access to, and restrictions on, buffer sizes; see
<http://lv2plug.in/ns/ext/buf-size> for details.
Access to, and restrictions on, buffer sizes.
See <http://lv2plug.in/ns/ext/buf-size> for details.
@{
*/
// clang-format off
#define LV2_BUF_SIZE_URI "http://lv2plug.in/ns/ext/buf-size" ///< http://lv2plug.in/ns/ext/buf-size
#define LV2_BUF_SIZE_PREFIX LV2_BUF_SIZE_URI "#" ///< http://lv2plug.in/ns/ext/buf-size#
#define LV2_BUF_SIZE__boundedBlockLength LV2_BUF_SIZE_PREFIX "boundedBlockLength" ///< http://lv2plug.in/ns/ext/buf-size#boundedBlockLength
#define LV2_BUF_SIZE__coarseBlockLength LV2_BUF_SIZE_PREFIX "coarseBlockLength" ///< http://lv2plug.in/ns/ext/buf-size#coarseBlockLength
#define LV2_BUF_SIZE__fixedBlockLength LV2_BUF_SIZE_PREFIX "fixedBlockLength" ///< http://lv2plug.in/ns/ext/buf-size#fixedBlockLength
#define LV2_BUF_SIZE__maxBlockLength LV2_BUF_SIZE_PREFIX "maxBlockLength" ///< http://lv2plug.in/ns/ext/buf-size#maxBlockLength
#define LV2_BUF_SIZE__minBlockLength LV2_BUF_SIZE_PREFIX "minBlockLength" ///< http://lv2plug.in/ns/ext/buf-size#minBlockLength
@ -37,6 +29,8 @@
#define LV2_BUF_SIZE__powerOf2BlockLength LV2_BUF_SIZE_PREFIX "powerOf2BlockLength" ///< http://lv2plug.in/ns/ext/buf-size#powerOf2BlockLength
#define LV2_BUF_SIZE__sequenceSize LV2_BUF_SIZE_PREFIX "sequenceSize" ///< http://lv2plug.in/ns/ext/buf-size#sequenceSize
// clang-format on
/**
@}
*/

View file

@ -1,129 +0,0 @@
@prefix bufsz: <http://lv2plug.in/ns/ext/buf-size#> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix opts: <http://lv2plug.in/ns/ext/options#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<http://lv2plug.in/ns/ext/buf-size>
a lv2:Specification ;
rdfs:seeAlso <buf-size.h> ,
<lv2-buf-size.doap.ttl> ;
lv2:documentation """
<p>This extension defines a facility for plugins to get information about the
block length (the sample_count parameter of LV2_Descriptor::run) and
port buffer sizes, as well as several features which can be used to restrict
the block length.</p>
<p>This extension defines features and properties but has no special purpose
API of its own. The host provides all the relevant information to the plugin
as <a href="options.html#options">options</a>.</p>
<p>To require restrictions on the block length, plugins can require additional
features: bufsz:boundedBlockLength, bufsz:powerOf2BlockLength, and
bufsz:fixedBlockLength. These features are data-only, that is they merely
indicate a restriction and do not carry any data or API.</p>
""" .
bufsz:boundedBlockLength
a lv2:Feature ;
lv2:documentation """
<p>A feature that indicates the host will provide both the bufsz:minBlockLength
and bufsz:maxBlockLength options to the plugin. Plugins that copy data from
audio inputs can require this feature to ensure they know how much space is
required for auxiliary buffers. Note the minimum may be zero, this feature is
mainly useful to ensure a maximum is available.</p>
<p>All hosts SHOULD support this feature, since it is simple to support and
necessary for any plugins that may need to copy the input.</p>
""" .
bufsz:fixedBlockLength
a lv2:Feature ;
lv2:documentation """
<p>A feature that indicates the host will always call LV2_Descriptor::run()
with the same value for sample_count. This length MUST be provided as the
value of both the bufsz:minBlockLength and bufsz:maxBlockLength options.</p>
<p>Note that requiring this feature may severely limit the number of hosts
capable of running the plugin.</p>
""" .
bufsz:powerOf2BlockLength
a lv2:Feature ;
lv2:documentation """
<p>A feature that indicates the host will always call LV2_Descriptor::run()
with a power of two sample_count. Note that this feature does not guarantee
the value is the same each call, to guarantee a fixed power of two block length
plugins must require both this feature and bufsz:fixedBlockLength.</p>
<p>Note that requiring this feature may severely limit the number of hosts
capable of running the plugin.</p>
""" .
bufsz:coarseBlockLength
a lv2:Feature ;
rdfs:label "coarse block length" ;
lv2:documentation """
<p>A feature that indicates the plugin prefers coarse, regular block lengths.
For example, plugins that do not implement sample-accurate control use this
feature to indicate that the host should not split the run cycle because
controls have changed.</p>
<p>Note that this feature is merely a hint, and does not guarantee a fixed
block length. The run cycle may be split for other reasons, and the blocksize
itself may change anytime.</p>
""" .
bufsz:maxBlockLength
a rdf:Property ,
owl:DatatypeProperty ,
opts:Option ;
rdfs:label "maximum block length" ;
rdfs:range xsd:nonNegativeInteger ;
lv2:documentation """
<p>The maximum block length the host will ever request the plugin to process at
once, that is, the maximum <code>sample_count</code> parameter that will ever
be passed to LV2_Descriptor::run().</p>
""" .
bufsz:minBlockLength
a rdf:Property ,
owl:DatatypeProperty ,
opts:Option ;
rdfs:label "minimum block length" ;
rdfs:range xsd:nonNegativeInteger ;
lv2:documentation """
<p>The minimum block length the host will ever request the plugin to process at
once, that is, the minimum <code>sample_count</code> parameter that will ever
be passed to LV2_Descriptor::run().</p>
""" .
bufsz:nominalBlockLength
a rdf:Property ,
owl:DatatypeProperty ,
opts:Option ;
rdfs:label "nominal block length" ;
rdfs:range xsd:nonNegativeInteger ;
lv2:documentation """
<p>The typical block length the host will request the plugin to process at
once, that is, the typical <code>sample_count</code> parameter that will
be passed to LV2_Descriptor::run(). This will usually be equivalent, or close
to, the maximum block length, but there are no strong guarantees about this
value whatsoever. Plugins may use this length for optimization purposes, but
MUST NOT assume the host will always process blocks of this length. In
particular, the host MAY process longer blocks.</p>
""" .
bufsz:sequenceSize
a rdf:Property ,
owl:DatatypeProperty ,
opts:Option ;
rdfs:label "sequence size" ;
rdfs:range xsd:nonNegativeInteger ;
lv2:documentation """
<p>The maximum size of a sequence, in bytes. This should be provided as an
option by hosts that support event ports (including but not limited to MIDI),
so plugins have the ability to allocate auxiliary buffers large enough to copy
the input.</p> """ .

View file

@ -1,44 +0,0 @@
@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/buf-size>
a doap:Project ;
doap:name "LV2 Buf Size" ;
doap:shortdesc "Access to, and restrictions on, buffer sizes." ;
doap:created "2012-08-07" ;
doap:developer <http://drobilla.net/drobilla#me> ;
doap:release [
doap:revision "1.4" ;
doap:created "2015-09-18" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.14.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Add bufsz:nominalBlockLength option."
] , [
rdfs:label "Add bufsz:coarseBlockLength feature."
]
]
] , [
doap:revision "1.2" ;
doap:created "2012-12-21" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.4.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Fix typo in bufsz:sequenceSize label."
]
]
] , [
doap:revision "1.0" ;
doap:created "2012-10-14" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.2.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Initial release."
]
]
] .

View file

@ -1,9 +0,0 @@
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/buf-size>
a lv2:Specification ;
lv2:minorVersion 1 ;
lv2:microVersion 4 ;
rdfs:seeAlso <buf-size.ttl> .

View file

@ -1,54 +1,42 @@
/*
Copyright 2018 David Robillard <http://drobilla.net>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
// Copyright 2018 David Robillard <d@drobilla.net>
// SPDX-License-Identifier: ISC
#ifndef LV2_CORE_ATTRIBUTES_H
#define LV2_CORE_ATTRIBUTES_H
/**
@defgroup attributes Attributes
@ingroup lv2
Macros for source code attributes.
@{
*/
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
#define LV2_DEPRECATED __attribute__((__deprecated__))
#if defined(__GNUC__) && __GNUC__ > 3
# define LV2_DEPRECATED __attribute__((__deprecated__))
#else
#define LV2_DEPRECATED
# define LV2_DEPRECATED
#endif
#if defined(__clang__)
#define LV2_DISABLE_DEPRECATION_WARNINGS \
# define LV2_DISABLE_DEPRECATION_WARNINGS \
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
#define LV2_DISABLE_DEPRECATION_WARNINGS \
#elif defined(__GNUC__) && __GNUC__ > 4
# define LV2_DISABLE_DEPRECATION_WARNINGS \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
#else
#define LV2_DISABLE_DEPRECATION_WARNINGS
# define LV2_DISABLE_DEPRECATION_WARNINGS
#endif
#if defined(__clang__)
#define LV2_RESTORE_WARNINGS _Pragma("clang diagnostic pop")
#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
#define LV2_RESTORE_WARNINGS _Pragma("GCC diagnostic pop")
# define LV2_RESTORE_WARNINGS _Pragma("clang diagnostic pop")
#elif defined(__GNUC__) && __GNUC__ > 4
# define LV2_RESTORE_WARNINGS _Pragma("GCC diagnostic pop")
#else
#define LV2_RESTORE_WARNINGS
# define LV2_RESTORE_WARNINGS
#endif
/**

View file

@ -1,36 +1,33 @@
/*
LV2 - An audio plugin interface specification.
Copyright 2006-2012 Steve Harris, David Robillard.
// Copyright 2006-2020 David Robillard <d@drobilla.net>
// Copyright 2006-2012 Steve Harris <steve@plugin.org.uk>
// Copyright 2000-2002 Richard W.E. Furse, Paul Barton-Davis, Stefan Westerfeld.
// SPDX-License-Identifier: ISC
Based on LADSPA, Copyright 2000-2002 Richard W.E. Furse,
Paul Barton-Davis, Stefan Westerfeld.
#ifndef LV2_H_INCLUDED
#define LV2_H_INCLUDED
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
/**
@defgroup lv2 LV2
THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
The LV2 specification.
@{
*/
/**
@defgroup lv2core LV2 Core
Core LV2 specification, see <http://lv2plug.in/ns/lv2core> for details.
Core LV2 specification.
See <http://lv2plug.in/ns/lv2core> for details.
@{
*/
#ifndef LV2_H_INCLUDED
#define LV2_H_INCLUDED
#include <stdint.h>
// clang-format off
#define LV2_CORE_URI "http://lv2plug.in/ns/lv2core" ///< http://lv2plug.in/ns/lv2core
#define LV2_CORE_PREFIX LV2_CORE_URI "#" ///< http://lv2plug.in/ns/lv2core#
@ -93,6 +90,7 @@
#define LV2_CORE__default LV2_CORE_PREFIX "default" ///< http://lv2plug.in/ns/lv2core#default
#define LV2_CORE__designation LV2_CORE_PREFIX "designation" ///< http://lv2plug.in/ns/lv2core#designation
#define LV2_CORE__documentation LV2_CORE_PREFIX "documentation" ///< http://lv2plug.in/ns/lv2core#documentation
#define LV2_CORE__enabled LV2_CORE_PREFIX "enabled" ///< http://lv2plug.in/ns/lv2core#enabled
#define LV2_CORE__enumeration LV2_CORE_PREFIX "enumeration" ///< http://lv2plug.in/ns/lv2core#enumeration
#define LV2_CORE__extensionData LV2_CORE_PREFIX "extensionData" ///< http://lv2plug.in/ns/lv2core#extensionData
#define LV2_CORE__freeWheeling LV2_CORE_PREFIX "freeWheeling" ///< http://lv2plug.in/ns/lv2core#freeWheeling
@ -119,6 +117,8 @@
#define LV2_CORE__symbol LV2_CORE_PREFIX "symbol" ///< http://lv2plug.in/ns/lv2core#symbol
#define LV2_CORE__toggled LV2_CORE_PREFIX "toggled" ///< http://lv2plug.in/ns/lv2core#toggled
// clang-format on
#ifdef __cplusplus
extern "C" {
#endif
@ -130,7 +130,7 @@ extern "C" {
compare to NULL (or 0 for C++) but otherwise the host MUST NOT attempt to
interpret it.
*/
typedef void * LV2_Handle;
typedef void* LV2_Handle;
/**
Feature.
@ -140,13 +140,13 @@ typedef void * LV2_Handle;
features and specify the `URI` and `data` to be used if necessary.
Some features, such as lv2:isLive, do not require the host to pass data.
*/
typedef struct _LV2_Feature {
typedef struct {
/**
A globally unique, case-sensitive identifier (URI) for this feature.
This MUST be a valid URI string as defined by RFC 3986.
*/
const char * URI;
const char* URI;
/**
Pointer to arbitrary data.
@ -154,7 +154,7 @@ typedef struct _LV2_Feature {
The format of this data is defined by the extension which describes the
feature with the given `URI`.
*/
void * data;
void* data;
} LV2_Feature;
/**
@ -163,7 +163,7 @@ typedef struct _LV2_Feature {
This structure provides the core functions necessary to instantiate and use
a plugin.
*/
typedef struct _LV2_Descriptor {
typedef struct LV2_Descriptor {
/**
A globally unique, case-sensitive identifier for this plugin.
@ -171,7 +171,7 @@ typedef struct _LV2_Descriptor {
the same URI MUST be compatible to some degree, see
http://lv2plug.in/ns/lv2core for details.
*/
const char * URI;
const char* URI;
/**
Instantiate the plugin.
@ -185,9 +185,8 @@ typedef struct _LV2_Descriptor {
@param sample_rate Sample rate, in Hz, for the new plugin instance.
@param bundle_path Path to the LV2 bundle which contains this plugin
binary. It MUST include the trailing directory separator (e.g. '/') so
that simply appending a filename will yield the path to that file in the
bundle.
binary. It MUST include the trailing directory separator so that simply
appending a filename will yield the path to that file in the bundle.
@param features A NULL terminated array of LV2_Feature structs which
represent the features the host supports. Plugins may refuse to
@ -201,10 +200,10 @@ typedef struct _LV2_Descriptor {
@return A handle for the new plugin instance, or NULL if instantiation
has failed.
*/
LV2_Handle (*instantiate)(const struct _LV2_Descriptor * descriptor,
LV2_Handle (*instantiate)(const struct LV2_Descriptor* descriptor,
double sample_rate,
const char * bundle_path,
const LV2_Feature *const * features);
const char* bundle_path,
const LV2_Feature* const* features);
/**
Connect a port on a plugin instance to a memory location.
@ -235,14 +234,12 @@ typedef struct _LV2_Descriptor {
it does, the plugin's behaviour is undefined (a crash is likely).
@param data_location Pointer to data of the type defined by the port
type in the plugin's RDF data (e.g. an array of float for an
type in the plugin's RDF data (for example, an array of float for an
lv2:AudioPort). This pointer must be stored by the plugin instance and
used to read/write data when run() is called. Data present at the time
of the connect_port() call MUST NOT be considered meaningful.
*/
void (*connect_port)(LV2_Handle instance,
uint32_t port,
void * data_location);
void (*connect_port)(LV2_Handle instance, uint32_t port, void* data_location);
/**
Initialise a plugin instance and activate it for use.
@ -279,10 +276,10 @@ typedef struct _LV2_Descriptor {
lv2core.ttl for details).
As a special case, when `sample_count` is 0, the plugin should update
any output ports that represent a single instant in time (e.g. control
ports, but not audio ports). This is particularly useful for latent
plugins, which should update their latency output port so hosts can
pre-roll plugins to compute latency. Plugins MUST NOT crash when
any output ports that represent a single instant in time (for example,
control ports, but not audio ports). This is particularly useful for
latent plugins, which should update their latency output port so hosts
can pre-roll plugins to compute latency. Plugins MUST NOT crash when
`sample_count` is 0.
@param instance Instance to be run.
@ -290,8 +287,7 @@ typedef struct _LV2_Descriptor {
@param sample_count The block size (in samples) for which the plugin
instance must run.
*/
void (*run)(LV2_Handle instance,
uint32_t sample_count);
void (*run)(LV2_Handle instance, uint32_t sample_count);
/**
Deactivate a plugin instance (counterpart to activate()).
@ -327,7 +323,7 @@ typedef struct _LV2_Descriptor {
void (*cleanup)(LV2_Handle instance);
/**
Return additional plugin data defined by some extenion.
Return additional plugin data defined by some extension.
A typical use of this facility is to return a struct containing function
pointers to extend the LV2_Descriptor API.
@ -339,7 +335,7 @@ typedef struct _LV2_Descriptor {
The host is never responsible for freeing the returned value.
*/
const void * (*extension_data)(const char * uri);
const void* (*extension_data)(const char* uri);
} LV2_Descriptor;
/**
@ -358,7 +354,8 @@ typedef struct _LV2_Descriptor {
#ifdef _WIN32
# define LV2_SYMBOL_EXPORT LV2_SYMBOL_EXTERN __declspec(dllexport)
#else
# define LV2_SYMBOL_EXPORT LV2_SYMBOL_EXTERN __attribute__((visibility("default")))
# define LV2_SYMBOL_EXPORT \
LV2_SYMBOL_EXTERN __attribute__((visibility("default")))
#endif
/**
@ -385,13 +382,13 @@ typedef struct _LV2_Descriptor {
consistent between loads of the plugin library.
*/
LV2_SYMBOL_EXPORT
const LV2_Descriptor * lv2_descriptor(uint32_t index);
const LV2_Descriptor*
lv2_descriptor(uint32_t index);
/**
Type of the lv2_descriptor() function in a library (old discovery API).
*/
typedef const LV2_Descriptor *
(*LV2_Descriptor_Function)(uint32_t index);
typedef const LV2_Descriptor* (*LV2_Descriptor_Function)(uint32_t index);
/**
Handle for a library descriptor.
@ -431,8 +428,7 @@ typedef struct {
indices MUST result in this function returning NULL, so the host can
enumerate plugins by increasing `index` until NULL is returned.
*/
const LV2_Descriptor * (*get_plugin)(LV2_Lib_Handle handle,
uint32_t index);
const LV2_Descriptor* (*get_plugin)(LV2_Lib_Handle handle, uint32_t index);
} LV2_Lib_Descriptor;
/**
@ -452,23 +448,23 @@ typedef struct {
from that library have been destroyed.
*/
LV2_SYMBOL_EXPORT
const LV2_Lib_Descriptor *
lv2_lib_descriptor(const char * bundle_path,
const LV2_Feature *const * features);
const LV2_Lib_Descriptor*
lv2_lib_descriptor(const char* bundle_path, const LV2_Feature* const* features);
/**
Type of the lv2_lib_descriptor() function in an LV2 library.
*/
typedef const LV2_Lib_Descriptor *
(*LV2_Lib_Descriptor_Function)(const char * bundle_path,
const LV2_Feature *const * features);
typedef const LV2_Lib_Descriptor* (*LV2_Lib_Descriptor_Function)(
const char* bundle_path,
const LV2_Feature* const* features);
#ifdef __cplusplus
}
} /* extern "C" */
#endif
#endif /* LV2_H_INCLUDED */
/**
@}
@}
*/
#endif /* LV2_H_INCLUDED */

View file

@ -1,18 +1,5 @@
/*
Copyright 2016 David Robillard <http://drobilla.net>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
// Copyright 2016 David Robillard <d@drobilla.net>
// SPDX-License-Identifier: ISC
/**
@defgroup util Utilities
@ -38,11 +25,10 @@ extern "C" {
present but have NULL data.
*/
static inline void*
lv2_features_data(const LV2_Feature*const* features,
const char* const uri)
lv2_features_data(const LV2_Feature* const* features, const char* const uri)
{
if (features) {
for (const LV2_Feature*const* f = features; *f; ++f) {
for (const LV2_Feature* const* f = features; *f; ++f) {
if (!strcmp(uri, (*f)->URI)) {
return (*f)->data;
}
@ -82,14 +68,16 @@ lv2_features_query(const LV2_Feature* const* features, ...)
const char* uri = NULL;
while ((uri = va_arg(args, const char*))) {
void** data = va_arg(args, void**);
bool required = va_arg(args, int);
bool required = (bool)va_arg(args, int);
*data = lv2_features_data(features, uri);
if (required && !*data) {
va_end(args);
return uri;
}
}
va_end(args);
return NULL;
}
@ -99,5 +87,4 @@ lv2_features_query(const LV2_Feature* const* features, ...)
/**
@}
@}
*/

View file

@ -1,204 +0,0 @@
@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/lv2core>
a doap:Project ;
rdfs:seeAlso <meta.ttl> ;
doap:license <http://opensource.org/licenses/isc> ;
doap:name "LV2" ;
doap:homepage <http://lv2plug.in> ;
doap:created "2004-04-21" ;
doap:shortdesc "An open and extensible audio plugin standard" ;
doap:programming-language "C" ;
doap:developer <http://plugin.org.uk/swh.xrdf#me> ,
<http://drobilla.net/drobilla#me> ;
doap:maintainer <http://drobilla.net/drobilla#me> ;
doap:release [
doap:revision "16.0" ;
doap:created "2019-02-03" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.16.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Add lv2:MIDIPlugin class."
] , [
rdfs:label "Rework port restrictions so that presets can be validated."
]
]
] , [
doap:revision "14.0" ;
doap:created "2016-09-18" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.14.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Add lv2_util.h with lv2_features_data() and lv2_features_query()."
] , [
rdfs:label "Add lv2:enabled designation."
]
]
] , [
doap:revision "12.4" ;
doap:created "2015-04-07" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.12.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Relax domain of lv2:minimum lv2:maximum and lv2:default so they can be used to describe properties/parameters as well."
] , [
rdfs:label "Add extern C and visibility attribute to LV2_SYMBOL_EXPORT."
] , [
rdfs:label "Add lv2:isSideChain port property."
]
]
] , [
doap:revision "12.2" ;
doap:created "2014-08-08" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.10.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Clarify lv2_descriptor() and lv2_lib_descriptor() documentation."
]
]
] , [
doap:revision "12.0" ;
doap:created "2014-01-04" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.8.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Add lv2:prototype for property inheritance."
]
]
] , [
doap:revision "10.0" ;
doap:created "2013-02-17" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.4.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Add lv2:EnvelopePlugin class."
] , [
rdfs:label "Add lv2:control for designating primary event-based control ports."
] , [
rdfs:label "Set range of lv2:designation to lv2:Designation."
] , [
rdfs:label "Make lv2:Parameter rdfs:subClassOf rdf:Property."
] , [
rdfs:label "Reserve minor version 0 for unstable development plugins."
]
]
] , [
doap:revision "8.2" ;
doap:created "2012-10-14" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.2.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Use consistent label style."
]
]
] , [
doap:revision "8.0" ;
doap:created "2012-04-17" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Fix LV2_SYMBOL_EXPORT and lv2_descriptor prototype for Windows."
] , [
rdfs:label "Add metadata concept of a designation, a channel or parameter description which can be assigned to ports for more intelligent use by hosts."
] , [
rdfs:label "Add new discovery API which allows libraries to read bundle files during discovery, makes library construction/destruction explicit, and adds extensibility to prevent future breakage."
] , [
rdfs:label "Relax the range of lv2:index so it can be used for things other than ports."
] , [
rdfs:label "Remove lv2:Resource, which turned out to be meaningless."
] , [
rdfs:label "Add lv2:CVPort."
] , [
rdfs:label "Merge with unified LV2 package."
]
]
] , [
doap:revision "6.0" ;
doap:created "2011-11-21" ;
doap:file-release <http://lv2plug.in/spec/lv2core-6.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Rename core.lv2 and lv2.ttl to lv2core.lv2 and lv2core.ttl to adhere to modern conventions."
] , [
rdfs:label "Add lv2:extensionData and lv2:ExtensionData for plugins to indicate that they support some URI for extension_data()."
] , [
rdfs:label "Remove lv2config in favour of the simple convention that specifications install headers to standard URI-based paths."
] , [
rdfs:label "Switch to the ISC license, a simple BSD-style license (with permission of all contributors to lv2.h and its ancestor, ladspa.h)."
] , [
rdfs:label "Make lv2core.ttl a valid OWL 2 DL ontology."
] , [
rdfs:label "Improve documentation."
]
]
] , [
doap:revision "4.0" ;
doap:created "2011-03-18" ;
doap:file-release <http://lv2plug.in/spec/lv2core-4.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Make doap:license suggested, but not required (for wrappers)."
] , [
rdfs:label "Define lv2:binary (MUST be in manifest.ttl)."
] , [
rdfs:label "Define lv2:minorVersion and lv2:microVersion (MUST be in manifest.ttl)."
] , [
rdfs:label "Define lv2:documentation and use it to document lv2core."
] , [
rdfs:label "Add lv2:FunctionPlugin and lv2:ConstantPlugin classes."
] , [
rdfs:label "Move lv2:AmplifierPlugin under lv2:DynamicsPlugin."
] , [
rdfs:label "Loosen domain of lv2:optionalFeature and lv2:requiredFeature (to allow re-use in extensions)."
] , [
rdfs:label "Add generic lv2:Resource and lv2:PluginBase classes."
] , [
rdfs:label "Fix definition of lv2:minimum etc. (used for values, not scale points)."
] , [
rdfs:label "More precisely define properties with OWL."
] , [
rdfs:label "Move project metadata to manifest."
] , [
rdfs:label "Add lv2:enumeration port property."
] , [
rdfs:label "Define run() pre-roll special case (sample_count == 0)."
]
]
] , [
doap:revision "3.0" ;
doap:created "2008-11-08" ;
doap:file-release <http://lv2plug.in/spec/lv2core-3.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Require that serialisations refer to ports by symbol rather than index."
] , [
rdfs:label "Minor stylistic changes to lv2.ttl."
] , [
rdfs:label "No header changes."
]
]
] , [
doap:revision "2.0" ;
doap:created "2008-02-10" ;
doap:file-release <http://lv2plug.in/spec/lv2core-2.0.tar.gz> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Initial release."
]
]
] .

File diff suppressed because it is too large Load diff

View file

@ -1,13 +0,0 @@
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/lv2core>
a lv2:Specification ;
lv2:minorVersion 16 ;
lv2:microVersion 0 ;
rdfs:seeAlso <lv2core.ttl> .
<http://lv2plug.in/ns/lv2>
a doap:Project ;
rdfs:seeAlso <meta.ttl> .

View file

@ -1,230 +0,0 @@
@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix meta: <http://lv2plug.in/ns/meta#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://opensource.org/licenses/isc>
rdf:value """
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
""" .
<http://lv2plug.in/ns/lv2>
a doap:Project ;
lv2:symbol "lv2" ;
doap:name "LV2" ;
doap:license <http://opensource.org/licenses/isc> ;
doap:shortdesc "The LV2 Plugin Interface Project" ;
doap:description "LV2 is a plugin standard for audio systems. It defines a minimal yet extensible C API for plugin code and a format for plugin bundles" ;
doap:created "2006-05-10" ;
doap:homepage <http://lv2plug.in/> ;
doap:mailing-list <http://lists.lv2plug.in/listinfo.cgi/devel-lv2plug.in> ;
doap:programming-language "C" ;
doap:repository [
a doap:SVNRepository ;
doap:location <http://lv2plug.in/repo>
] ;
doap:developer <http://drobilla.net/drobilla#me> ,
<http://plugin.org.uk/swh.xrdf#me> ;
doap:helper meta:larsl ,
meta:bmwiedemann ,
meta:gabrbedd ,
meta:daste ,
meta:kfoltman ,
meta:paniq ;
doap:release [
doap:revision "1.16.1" ;
doap:created "2019-03-27" ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Improve documentation."
]
]
] , [
doap:revision "1.16.0" ;
doap:created "2019-02-03" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.16.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Add core/attributes.h utility header."
] , [
rdfs:label "eg-sampler: Add waveform display to UI."
] , [
rdfs:label "eg-midigate: Respond to \"all notes off\" MIDI message."
] , [
rdfs:label "Simplify use of lv2specgen."
] , [
rdfs:label "Add lv2_validate utility."
] , [
rdfs:label "Install headers to simpler paths."
] , [
rdfs:label "Aggressively deprecate uri-map and event extensions."
] , [
rdfs:label "Upgrade build system and fix building with Python 3.7."
]
]
] , [
doap:revision "1.14.0" ;
doap:created "2016-09-19" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.14.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "eg-scope: Don't feed back UI state updates."
] , [
rdfs:label "eg-sampler: Fix handling of state file paths."
] , [
rdfs:label "eg-sampler: Support thread-safe state restoration."
]
]
] , [
doap:revision "1.12.0" ;
doap:created "2015-04-07" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.12.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "eg-sampler: Support patch:Get, and request initial state from UI."
] , [
rdfs:label "eg-sampler: Add gain parameter."
] , [
rdfs:label "Fix merging of version histories in specification documentation."
] , [
rdfs:label "Improve API documentation."
] , [
rdfs:label "Simplify property restrictions by removing redundancy."
]
]
] , [
doap:revision "1.10.0" ;
doap:created "2014-08-08" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.10.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "lv2specgen: Display deprecated warning on classes marked owl:deprecated."
] , [
rdfs:label "Fix -Wconversion warnings in headers."
] , [
rdfs:label "Upgrade to waf 1.7.16."
]
]
] , [
doap:revision "1.8.0" ;
doap:created "2014-01-04" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.8.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Add scope example plugin from Robin Gareus."
] , [
rdfs:label "lv2specgen: Fix links to externally defined terms."
] , [
rdfs:label "Install lv2specgen for use by other projects."
]
]
] , [
doap:revision "1.6.0" ;
doap:created "2013-08-09" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.6.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Fix port indices of metronome example."
] , [
rdfs:label "Fix lv2specgen usage from command line."
] , [
rdfs:label "Upgrade to waf 1.7.11."
]
]
] , [
doap:revision "1.4.0" ;
doap:created "2013-02-17" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.4.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Add metronome example plugin to demonstrate sample accurate tempo sync."
] , [
rdfs:label "Generate book-style HTML documentation from example plugins."
]
]
] , [
doap:revision "1.2.0" ;
doap:created "2012-10-14" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.2.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Move all project metadata for extensions (e.g. change log) to separate files to spare hosts from loading them during discovery."
] , [
rdfs:label "Use stricter datatype definitions conformant with the XSD and OWL specifications for better validation."
]
]
] , [
doap:revision "1.0.0" ;
doap:created "2012-04-16" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Initial release as a unified project. Projects can now simply depend on the pkg-config package 'lv2' for all official LV2 APIs."
] , [
rdfs:label "New extensions: atom, log, parameters, patch, port-groups, port-props, resize-port, state, time, worker."
]
]
] .
<http://drobilla.net/drobilla#me>
a foaf:Person ;
foaf:name "David Robillard" ;
foaf:mbox <mailto:d@drobilla.net> ;
rdfs:seeAlso <http://drobilla.net/drobilla> .
<http://plugin.org.uk/swh.xrdf#me>
a foaf:Person ;
foaf:name "Steve Harris" ;
foaf:mbox <mailto:steve@plugin.org.uk> ;
rdfs:seeAlso <http://plugin.org.uk/swh.xrdf> .
meta:larsl
a foaf:Person ;
foaf:name "Lars Luthman" ;
foaf:mbox <mailto:lars.luthman@gmail.com> .
meta:gabrbedd
a foaf:Person ;
foaf:name "Gabriel M. Beddingfield" ;
foaf:mbox <mailto:gabrbedd@gmail.com> .
meta:daste
a foaf:Person ;
foaf:name "Stefano D'Angelo" ;
foaf:mbox <mailto:zanga.mail@gmail.com> .
meta:kfoltman
a foaf:Person ;
foaf:name "Krzysztof Foltman" ;
foaf:mbox <mailto:wdev@foltman.com> .
meta:paniq
a foaf:Person ;
foaf:name "Leonard Ritter" ;
foaf:mbox <mailto:paniq@paniq.org> .
meta:harry
a foaf:Person ;
foaf:name "Harry van Haaren" ;
foaf:mbox <harryhaaren@gmail.com> .
meta:bmwiedemann
a foaf:Person ;
foaf:name "Bernhard M. Wiedemann" ;
foaf:mbox <bwiedemann@suse.de> .

View file

@ -1,35 +1,27 @@
/*
LV2 Data Access Extension
Copyright 2008-2016 David Robillard <http://drobilla.net>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/**
@defgroup data-access Data Access
Access to plugin extension_data() for UIs, see
<http://lv2plug.in/ns/ext/data-access> for details.
@{
*/
// Copyright 2008-2016 David Robillard <d@drobilla.net>
// SPDX-License-Identifier: ISC
#ifndef LV2_DATA_ACCESS_H
#define LV2_DATA_ACCESS_H
/**
@defgroup data-access Data Access
@ingroup lv2
Access to plugin extension_data() for UIs.
See <http://lv2plug.in/ns/ext/data-access> for details.
@{
*/
// clang-format off
#define LV2_DATA_ACCESS_URI "http://lv2plug.in/ns/ext/data-access" ///< http://lv2plug.in/ns/ext/data-access
#define LV2_DATA_ACCESS_PREFIX LV2_DATA_ACCESS_URI "#" ///< http://lv2plug.in/ns/ext/data-access#
// clang-format on
#ifdef __cplusplus
extern "C" {
#endif
@ -61,8 +53,8 @@ typedef struct {
} /* extern "C" */
#endif
#endif /* LV2_DATA_ACCESS_H */
/**
@}
*/
#endif /* LV2_DATA_ACCESS_H */

View file

@ -1,23 +0,0 @@
@prefix da: <http://lv2plug.in/ns/ext/data-access#> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/data-access>
a lv2:Feature ;
rdfs:seeAlso <data-access.h> ,
<lv2-data-access.doap.ttl> ;
lv2:documentation """
<p>This extension defines a feature, LV2_Extension_Data_Feature, which provides
access to LV2_Descriptor::extension_data() for plugin UIs or other potentially
remote users of a plugin.</p>
<p>Note that the use of this extension by UIs violates the important principle
of UI/plugin separation, and is potentially a source of many problems.
Accordingly, <strong>use of this extension is highly discouraged</strong>, and
plugins should not expect hosts to support it, since it is often impossible to
do so.</p>
<p>To support this feature the host must pass an LV2_Feature struct to the
instantiate method with URI LV2_DATA_ACCESS_URI and data pointed to an instance
of LV2_Extension_Data_Feature.</p>
""" .

View file

@ -1,58 +0,0 @@
@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/data-access>
a doap:Project ;
rdfs:seeAlso <data-access.h> ;
doap:license <http://opensource.org/licenses/isc> ;
doap:name "LV2 Data Access" ;
doap:shortdesc "Provides access to LV2_Descriptor::extension_data()." ;
doap:created "2008-00-00" ;
doap:developer <http://drobilla.net/drobilla#me> ;
doap:release [
doap:revision "1.6" ;
doap:created "2012-04-17" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Merge with unified LV2 package."
]
]
] , [
doap:revision "1.4" ;
doap:created "2011-11-21" ;
doap:file-release <http://lv2plug.in/spec/lv2-data-access-1.4.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Update packaging."
] , [
rdfs:label "Improve documentation."
]
]
] , [
doap:revision "1.2" ;
doap:created "2011-05-26" ;
doap:file-release <http://lv2plug.in/spec/lv2-data-access-1.2.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Add build system for installation."
] , [
rdfs:label "Switch to ISC license."
]
]
] , [
doap:revision "1.0" ;
doap:created "2010-10-04" ;
doap:file-release <http://lv2plug.in/spec/lv2-data-access-1.0.tar.gz> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Initial release."
]
]
] .

View file

@ -1,9 +0,0 @@
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/data-access>
a lv2:Specification ;
lv2:minorVersion 1 ;
lv2:microVersion 6 ;
rdfs:seeAlso <data-access.ttl> .

View file

@ -1,39 +1,31 @@
/*
Dynamic manifest specification for LV2
Copyright 2008-2011 Stefano D'Angelo <zanga.mail@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/**
@defgroup dynmanifest Dynamic Manifest
Support for dynamic data generation, see
<http://lv2plug.in/ns/ext/dynmanifest> for details.
@{
*/
// Copyright 2008-2011 Stefano D'Angelo <zanga.mail@gmail.com>
// SPDX-License-Identifier: ISC
#ifndef LV2_DYN_MANIFEST_H_INCLUDED
#define LV2_DYN_MANIFEST_H_INCLUDED
/**
@defgroup dynmanifest Dynamic Manifest
@ingroup lv2
Support for dynamic data generation.
See <http://lv2plug.in/ns/ext/dynmanifest> for details.
@{
*/
#include "lv2/core/lv2.h"
#include <stdio.h>
// clang-format off
#define LV2_DYN_MANIFEST_URI "http://lv2plug.in/ns/ext/dynmanifest" ///< http://lv2plug.in/ns/ext/dynmanifest
#define LV2_DYN_MANIFEST_PREFIX LV2_DYN_MANIFEST_URI "#" ///< http://lv2plug.in/ns/ext/dynmanifest#
// clang-format on
#ifdef __cplusplus
extern "C" {
#endif
@ -46,7 +38,7 @@ extern "C" {
NOT even valid to compare this to NULL. The dynamic manifest generator MAY
use it to reference internal data.
*/
typedef void * LV2_Dyn_Manifest_Handle;
typedef void* LV2_Dyn_Manifest_Handle;
/**
Generate the dynamic manifest.
@ -64,8 +56,9 @@ typedef void * LV2_Dyn_Manifest_Handle;
evaluate the result of the operation by examining the returned value and
MUST NOT try to interpret the value of handle.
*/
int lv2_dyn_manifest_open(LV2_Dyn_Manifest_Handle * handle,
const LV2_Feature *const * features);
int
lv2_dyn_manifest_open(LV2_Dyn_Manifest_Handle* handle,
const LV2_Feature* const* features);
/**
Fetch a "list" of subject URIs described in the dynamic manifest.
@ -77,7 +70,7 @@ int lv2_dyn_manifest_open(LV2_Dyn_Manifest_Handle * handle,
<http://example.org/plugin> a lv2:Plugin .
The objects that are elegible for exposure are those that would need to be
The objects that are eligible for exposure are those that would need to be
represented by a subject node in a static manifest.
@param handle Dynamic manifest generator handle.
@ -85,13 +78,13 @@ int lv2_dyn_manifest_open(LV2_Dyn_Manifest_Handle * handle,
@param fp FILE * identifying the resource the host has to set up for the
dynamic manifest generator. The host MUST pass a writable, empty resource to
this function, and the dynamic manifest generator MUST ONLY perform write
operations on it at the end of the stream (e.g., using only fprintf(),
fwrite() and similar).
operations on it at the end of the stream (for example, using only
fprintf(), fwrite() and similar).
@return 0 on success, otherwise a non-zero error code.
*/
int lv2_dyn_manifest_get_subjects(LV2_Dyn_Manifest_Handle handle,
FILE * fp);
int
lv2_dyn_manifest_get_subjects(LV2_Dyn_Manifest_Handle handle, FILE* fp);
/**
Function that fetches data related to a specific URI.
@ -115,17 +108,18 @@ int lv2_dyn_manifest_get_subjects(LV2_Dyn_Manifest_Handle handle,
@param fp FILE * identifying the resource the host has to set up for the
dynamic manifest generator. The host MUST pass a writable resource to this
function, and the dynamic manifest generator MUST ONLY perform write
operations on it at the current position of the stream (e.g. using only
fprintf(), fwrite() and similar).
operations on it at the current position of the stream (for example, using
only fprintf(), fwrite() and similar).
@param uri URI to get data about (in the "plain" form, i.e., absolute URI
without Turtle prefixes).
@return 0 on success, otherwise a non-zero error code.
*/
int lv2_dyn_manifest_get_data(LV2_Dyn_Manifest_Handle handle,
FILE * fp,
const char * uri);
int
lv2_dyn_manifest_get_data(LV2_Dyn_Manifest_Handle handle,
FILE* fp,
const char* uri);
/**
Function that ends the operations on the dynamic manifest generator.
@ -138,14 +132,15 @@ int lv2_dyn_manifest_get_data(LV2_Dyn_Manifest_Handle handle,
@param handle Dynamic manifest generator handle.
*/
void lv2_dyn_manifest_close(LV2_Dyn_Manifest_Handle handle);
void
lv2_dyn_manifest_close(LV2_Dyn_Manifest_Handle handle);
#ifdef __cplusplus
}
} /* extern "C" */
#endif
#endif /* LV2_DYN_MANIFEST_H_INCLUDED */
/**
@}
*/
#endif /* LV2_DYN_MANIFEST_H_INCLUDED */

View file

@ -1,85 +0,0 @@
@prefix dman: <http://lv2plug.in/ns/ext/dynmanifest#> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<http://lv2plug.in/ns/ext/dynmanifest>
a lv2:Specification ;
rdfs:seeAlso <dynmanifest.h> ,
<lv2-dynmanifest.doap.ttl> ;
lv2:documentation """
<p>The LV2 API, on its own, cannot be used to write plugin libraries where data
is dynamically generated at runtime (e.g. API wrappers), since LV2 requires
needed information to be provided in one or more static data (RDF) files. This
API addresses this limitation by extending the LV2 API.</p>
<p>To detect that a plugin library implements a dynamic manifest generator,
the host checks its static manifest for a description like:</p>
<pre class="turtle-code">
&lt;http://example.org/my-dynamic-manifest&gt;
a dman:DynManifest ;
lv2:binary &lt;mydynmanifest.so&gt; .
</pre>
<p>To load the data, the host loads the library
(e.g. <code>mydynmanifest.so</code>) as usual and fetches the dynamic Turtle
data from it using this API.</p>
<p>The host is allowed to request regeneration of the dynamic manifest multiple
times, and the plugin library is expected to provide updated data if/when
possible. All data and references provided via this API before the last
regeneration of the dynamic manifest is to be considered invalid by the host,
including plugin descriptors whose URIs were discovered using this API.</p>
<h3>Accessing Data</h3>
<p>Whenever a host wants to access data using this API, it could:</p>
<ol>
<li>Call lv2_dyn_manifest_open().</li>
<li>Create a FILE for functions to write data to (e.g. using tmpfile()).</li>
<li>Get a <q>list</q> of exposed subject URIs using
lv2_dyn_manifest_get_subjects().</li>
<li>Call lv2_dyn_manifest_get_data() for each URI of interest to
get the data related to that URI (which can be written to any FILE).</li>
<li>Call lv2_dyn_manifest_close().</li>
<li>Parse the content of the FILE(s).</li>
<li>Free/delete/unlink the FILE(s).</li>
</ol>
<p>Each call to the above mentioned dynamic manifest functions MUST write a
complete, valid Turtle document (including all needed prefix definitions) to
the output FILE.</p>
<p>Each call to lv2_dyn_manifest_open() causes the (re)generation of the
dynamic manifest data, and invalidates all data fetched before the call.</p>
<p>In case the plugin library uses this same API to access other dynamic
manifests, it MUST implement some mechanism to avoid potentially endless loops
(such as A loads B, B loads A, etc.) and, in case such a loop is detected, the
operation MUST fail. For this purpose, use of a static boolean flag is
suggested.</p>
<h3>Threading Rules</h3>
<p>All of the functions defined by this specification belong to the Discovery
class.</p>
""" .
dman:DynManifest
a rdfs:Class ;
rdfs:label "Dynamic Manifest" ;
rdfs:subClassOf [
a owl:Restriction ;
owl:onProperty lv2:binary ;
owl:minCardinality 1 ;
rdfs:comment "A DynManifest MUST have at least 1 lv2:binary, which MUST implement all the functions defined in dynmanifest.h."
] ;
rdfs:comment """The class which represents a dynamic manifest generator.
There MUST NOT be any instances of dman:DynManifest in the generated manifest.
All relative URIs in the generated data MUST be relative to the base path that would be used to parse a normal LV2 manifest (the bundle path).""" .

View file

@ -1,55 +0,0 @@
@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/dynmanifest>
a doap:Project ;
doap:license <http://opensource.org/licenses/isc> ;
doap:name "LV2 Dynamic Manifest" ;
doap:homepage <http://naspro.atheme.org> ;
doap:created "2009-06-13" ;
doap:shortdesc "Support for dynamic data generation." ;
doap:programming-language "C" ;
doap:developer <http://lv2plug.in/ns/meta#daste> ;
doap:release [
doap:revision "1.6" ;
doap:created "2012-10-14" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.2.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Use consistent label style."
]
]
] , [
doap:revision "1.4" ;
doap:created "2012-04-17" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Merge with unified LV2 package."
]
]
] , [
doap:revision "1.2" ;
doap:created "2011-11-21" ;
doap:file-release <http://lv2plug.in/spec/lv2-dynmanifest-1.2.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Improve documentation."
]
]
] , [
doap:revision "1.0" ;
doap:created "2010-04-10" ;
doap:file-release <http://lv2plug.in/spec/lv2-dyn-manifest-1.0.tar.gz> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Initial release."
]
]
] .

View file

@ -1,8 +0,0 @@
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/dynmanifest>
a lv2:Specification ;
lv2:minorVersion 1 ;
lv2:microVersion 6 ;
rdfs:seeAlso <dynmanifest.ttl> .

View file

@ -1,27 +1,14 @@
/*
Copyright 2008-2015 David Robillard <http://drobilla.net>
// Copyright 2008-2015 David Robillard <d@drobilla.net>
// SPDX-License-Identifier: ISC
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef LV2_EVENT_HELPERS_H
#define LV2_EVENT_HELPERS_H
/**
@file event-helpers.h Helper functions for the LV2 Event extension
<http://lv2plug.in/ns/ext/event>.
*/
#ifndef LV2_EVENT_HELPERS_H
#define LV2_EVENT_HELPERS_H
#include "lv2/core/attributes.h"
#include "lv2/event/event.h"
@ -47,15 +34,13 @@ LV2_DISABLE_DEPRECATION_WARNINGS
* Note that these functions are all static inline which basically means:
* do not take the address of these functions. */
/** Pad a size to 64 bits (for event sizes) */
static inline uint16_t
lv2_event_pad_size(uint16_t size)
{
return (uint16_t)(size + 7U) & (uint16_t)(~7U);
return (uint16_t)((size + 7U) & ~7U);
}
/** Initialize (empty, reset..) an existing event buffer.
* The contents of buf are ignored entirely and overwritten, except capacity
* which is unmodified. */
@ -71,7 +56,6 @@ lv2_event_buffer_reset(LV2_Event_Buffer* buf,
buf->size = 0;
}
/** Allocate a new, empty event buffer. */
static inline LV2_Event_Buffer*
lv2_event_buffer_new(uint32_t capacity, uint16_t stamp_type)
@ -80,35 +64,31 @@ lv2_event_buffer_new(uint32_t capacity, uint16_t stamp_type)
LV2_Event_Buffer* buf = (LV2_Event_Buffer*)malloc(size);
if (buf != NULL) {
buf->capacity = capacity;
lv2_event_buffer_reset(buf, stamp_type, (uint8_t *)(buf + 1));
lv2_event_buffer_reset(buf, stamp_type, (uint8_t*)(buf + 1));
return buf;
}
return NULL;
}
/** An iterator over an LV2_Event_Buffer.
*
* Multiple simultaneous read iterators over a single buffer is fine,
* but changing the buffer invalidates all iterators (e.g. RW Lock). */
* but changing the buffer invalidates all iterators. */
typedef struct {
LV2_Event_Buffer* buf;
uint32_t offset;
} LV2_Event_Iterator;
/** Reset an iterator to point to the start of `buf`.
* @return True if `iter` is valid, otherwise false (buffer is empty) */
static inline bool
lv2_event_begin(LV2_Event_Iterator* iter,
LV2_Event_Buffer* buf)
lv2_event_begin(LV2_Event_Iterator* iter, LV2_Event_Buffer* buf)
{
iter->buf = buf;
iter->offset = 0;
return (buf->size > 0);
}
/** Check if `iter` is valid.
* @return True if `iter` is valid, otherwise false (past end of buffer) */
static inline bool
@ -117,7 +97,6 @@ lv2_event_is_valid(LV2_Event_Iterator* iter)
return (iter->buf && (iter->offset < iter->buf->size));
}
/** Advance `iter` forward one event.
* `iter` must be valid.
* @return True if `iter` is valid, otherwise false (reached end of buffer) */
@ -130,13 +109,12 @@ lv2_event_increment(LV2_Event_Iterator* iter)
LV2_Event* const ev = (LV2_Event*)(iter->buf->data + iter->offset);
iter->offset += lv2_event_pad_size(
(uint16_t)((uint16_t)sizeof(LV2_Event) + ev->size));
iter->offset +=
lv2_event_pad_size((uint16_t)((uint16_t)sizeof(LV2_Event) + ev->size));
return true;
}
/** Dereference an event iterator (get the event currently pointed at).
* `iter` must be valid.
* `data` if non-NULL, will be set to point to the contents of the event
@ -145,8 +123,7 @@ lv2_event_increment(LV2_Event_Iterator* iter)
* if the end of the buffer is reached (in which case `data` is
* also set to NULL). */
static inline LV2_Event*
lv2_event_get(LV2_Event_Iterator* iter,
uint8_t** data)
lv2_event_get(LV2_Event_Iterator* iter, uint8_t** data)
{
if (!lv2_event_is_valid(iter)) {
return NULL;
@ -161,7 +138,6 @@ lv2_event_get(LV2_Event_Iterator* iter,
return ev;
}
/** Write an event at `iter`.
* The event (if any) pointed to by `iter` will be overwritten, and `iter`
* incremented to point to the following event (i.e. several calls to this
@ -199,7 +175,6 @@ lv2_event_write(LV2_Event_Iterator* iter,
return true;
}
/** Reserve space for an event in the buffer and return a pointer to
the memory where the caller can write the event data, or NULL if there
is not enough room in the buffer. */
@ -230,7 +205,6 @@ lv2_event_reserve(LV2_Event_Iterator* iter,
return (uint8_t*)ev + sizeof(LV2_Event);
}
/** Write an event at `iter`.
* The event (if any) pointed to by `iter` will be overwritten, and `iter`
* incremented to point to the following event (i.e. several calls to this

View file

@ -1,31 +1,22 @@
/*
Copyright 2008-2016 David Robillard <http://drobilla.net>
Copyright 2006-2007 Lars Luthman <lars.luthman@gmail.com>
// Copyright 2008-2016 David Robillard <d@drobilla.net>
// Copyright 2006-2007 Lars Luthman <lars.luthman@gmail.com>
// SPDX-License-Identifier: ISC
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef LV2_EVENT_H
#define LV2_EVENT_H
/**
@defgroup event Event
@ingroup lv2
Generic time-stamped events, see <http://lv2plug.in/ns/ext/event> for
details.
Generic time-stamped events.
See <http://lv2plug.in/ns/ext/event> for details.
@{
*/
#ifndef LV2_EVENT_H
#define LV2_EVENT_H
// clang-format off
#define LV2_EVENT_URI "http://lv2plug.in/ns/ext/event" ///< http://lv2plug.in/ns/ext/event
#define LV2_EVENT_PREFIX LV2_EVENT_URI "#" ///< http://lv2plug.in/ns/ext/event#
@ -41,6 +32,8 @@
#define LV2_EVENT__supportsEvent LV2_EVENT_PREFIX "supportsEvent" ///< http://lv2plug.in/ns/ext/event#supportsEvent
#define LV2_EVENT__supportsTimeStamp LV2_EVENT_PREFIX "supportsTimeStamp" ///< http://lv2plug.in/ns/ext/event#supportsTimeStamp
// clang-format on
#define LV2_EVENT_AUDIO_STAMP 0 ///< Special timestamp type for audio frames
#include "lv2/core/attributes.h"
@ -55,7 +48,7 @@ LV2_DISABLE_DEPRECATION_WARNINGS
/**
The best Pulses Per Quarter Note for tempo-based uint32_t timestamps.
Equal to 2^12 * 5 * 7 * 9 * 11 * 13 * 17, which is evenly divisble
Equal to 2^12 * 5 * 7 * 9 * 11 * 13 * 17, which is evenly divisible
by all integers from 1 through 18 inclusive, and powers of 2 up to 2^12.
*/
LV2_DEPRECATED
@ -80,7 +73,7 @@ typedef struct {
The frames portion of timestamp. The units used here can optionally be
set for a port (with the lv2ev:timeUnits property), otherwise this is
audio frames, corresponding to the sample_count parameter of the LV2 run
method (e.g. frame 0 is the first frame for that call to run).
method (frame 0 is the first frame for that call to run).
*/
uint32_t frames;
@ -118,7 +111,6 @@ typedef struct {
/* size bytes of data follow here */
} LV2_Event;
/**
A buffer of LV2 events (header only).
@ -215,14 +207,12 @@ typedef struct {
uint32_t size;
} LV2_Event_Buffer;
/**
Opaque pointer to host data.
*/
LV2_DEPRECATED
typedef void* LV2_Event_Callback_Data;
/**
Non-POD events feature.
@ -252,15 +242,11 @@ typedef struct {
If the event is only stored OR passed through, this is not necessary
(as the plugin already has 1 implicit reference).
@param callback_data The callback_data field of this struct.
@param event An event received at an input that will not be copied to
an output or stored in any way.
@param context The calling context. Like event types, this is a mapped
URI, see lv2_context.h. Simple plugin with just a run() method should
pass 0 here (the ID of the 'standard' LV2 run context). The host
guarantees that this function is realtime safe iff the context is
realtime safe.
PLUGINS THAT VIOLATE THESE RULES MAY CAUSE CRASHES AND MEMORY LEAKS.
*/
uint32_t (*lv2_event_ref)(LV2_Event_Callback_Data callback_data,
@ -275,15 +261,11 @@ typedef struct {
an output or store it internally somehow, it MUST call this function
on the event (more information on using non-POD events below).
@param callback_data The callback_data field of this struct.
@param event An event received at an input that will not be copied to an
output or stored in any way.
@param context The calling context. Like event types, this is a mapped
URI, see lv2_context.h. Simple plugin with just a run() method should
pass 0 here (the ID of the 'standard' LV2 run context). The host
guarantees that this function is realtime safe iff the context is
realtime safe.
PLUGINS THAT VIOLATE THESE RULES MAY CAUSE CRASHES AND MEMORY LEAKS.
*/
uint32_t (*lv2_event_unref)(LV2_Event_Callback_Data callback_data,
@ -296,8 +278,8 @@ LV2_RESTORE_WARNINGS
} /* extern "C" */
#endif
#endif /* LV2_EVENT_H */
/**
@}
*/
#endif /* LV2_EVENT_H */

View file

@ -1,114 +0,0 @@
@prefix ev: <http://lv2plug.in/ns/ext/event#> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/event>
a owl:Ontology ;
owl:deprecated true ;
rdfs:seeAlso <event.h> ,
<event-helpers.h> ,
<lv2-event.doap.ttl> ;
lv2:documentation """
<p>This extension defines a generic time-stamped event port type, which can be
used to create plugins that read and write real-time events, such as MIDI,
OSC, or any other type of event payload. The type(s) of event supported by
a port is defined in the data file for a plugin, for example:</p>
<pre class="turtle-code">
&lt;http://example.org/some-plugin&gt;
lv2:port [
a ev:EventPort, lv2:InputPort ;
lv2:index 0 ;
ev:supportsEvent &lt;http://lv2plug.in/ns/ext/midi#MidiEvent&gt; ;
lv2:symbol "midi_input" ;
lv2:name "MIDI input" ;
] .
</pre>
""" .
ev:EventPort
a rdfs:Class ;
rdfs:label "Event Port" ;
rdfs:subClassOf lv2:Port ;
rdfs:comment """Ports of this type will be connected to a struct of type LV2_Event_Buffer, defined in event.h. These ports contain a sequence of generic events (possibly several types mixed in a single stream), the specific types of which are defined by some URI in another LV2 extension.""" .
ev:Event
a rdfs:Class ;
rdfs:label "Event" ;
rdfs:comment """A single generic time-stamped event.
An ev:EventPort contains an LV2_Event_Buffer which contains a sequence of these events. The binary format of LV2 events is defined by the LV2_Event struct in event.h.
Specific event types (e.g. MIDI, OSC) are defined by extensions, and should be rdfs:subClassOf this class.""" .
ev:TimeStamp
a rdfs:Class ;
rdfs:label "Event Time Stamp" ;
rdfs:comment """The time stamp of an Event.
This defines the meaning of the 'frames' and 'subframes' fields of an LV2_Event (both unsigned 32-bit integers).""" .
ev:FrameStamp
a rdfs:Class ;
rdfs:subClassOf ev:TimeStamp ;
rdfs:label "Audio Frame Time Stamp" ;
rdfs:comment """The default time stamp unit for an LV2 event: the frames field represents
audio frames (in the sample rate passed to intantiate), and the subframes
field is 1/UINT32_MAX of a frame.""" .
ev:generic
a lv2:PortProperty ;
rdfs:label "generic event port" ;
rdfs:comment """Indicates that this port does something meaningful for any event type (e.g. event mixers, delays, serialisers, etc).
If this property is set, hosts should consider the port suitable for any type of event. Otherwise, hosts should consider the port 'appropriate' only for the specific event types listed with :supportsEvent. Note that plugins must gracefully handle unknown event types whether or not this property is present.""" .
ev:supportsEvent
a rdf:Property ;
rdfs:domain ev:EventPort ;
rdfs:range rdfs:Class ;
rdfs:label "supports event type" ;
rdfs:comment """Indicates that this port supports or "understands" a certain event type.
For input ports, this means the plugin understands and does something useful with events of this type. For output ports, this means the plugin may generate events of this type. If the plugin never actually generates events of this type, but might pass them through from an input, this property should not be set (use ev:inheritsEvent for that).
Plugins with event input ports must always gracefully handle any type of event, even if it does not 'support' it. This property should always be set for event types the plugin understands/generates so hosts can discover plugins appropriate for a given scenario (e.g. plugins with a MIDI input). Hosts are not expected to consider event ports suitable for some type of event if the relevant :supportsEvent property is not set, unless the ev:generic property for that port is also set.""" .
ev:inheritsEvent
a rdf:Property ;
rdfs:domain ev:EventPort ,
lv2:OutputPort ;
rdfs:range lv2:Port ;
rdfs:label "inherits event type" ;
rdfs:comment """Indicates that this output port might pass through events that arrived at some other input port (or generate an event of the same type as events arriving at that input). The host must always check the stamp type of all outputs when connecting an input, but this property should be set whenever it applies.""" .
ev:supportsTimeStamp
a rdf:Property ;
rdfs:domain ev:EventPort ,
lv2:InputPort ;
rdfs:range rdfs:Class ;
rdfs:label "supports time stamp type" ;
rdfs:comment """Indicates that this port supports or "understands" a certain time stamp type. Meaningful only for input ports, the host must never connect a port to an event buffer with a time stamp type that isn't supported by the port.""" .
ev:generatesTimeStamp
a rdf:Property ;
rdfs:domain ev:EventPort ,
lv2:OutputPort ;
rdfs:range rdfs:Class ;
rdfs:label "generates time stamp type" ;
rdfs:comment """Indicates that this port may output a certain time stamp type, regardless of the time stamp type of any input ports.
If the port outputs stamps based on what type inputs are connected to, this property should not be set (use the ev:inheritsTimeStamp property for that). Hosts MUST check the time_stamp value of any output port buffers after a call to connect_port on ANY event input port on the plugin.
If the plugin changes the stamp_type field of an output event buffer during a call to run(), the plugin must call the stamp_type_changed function provided by the host in the LV2_Event_Feature struct, if it is non-NULL.""" .
ev:inheritsTimeStamp
a rdf:Property ;
rdfs:domain ev:EventPort ,
lv2:OutputPort ;
rdfs:range lv2:Port ;
rdfs:label "inherits time stamp type" ;
rdfs:comment """Indicates that this port follows the time stamp type of an input port.
This property is not necessary, but it should be set for outputs that base their output type on an input port so the host can make more sense of the plugin and provide a more sensible interface.""" .

View file

@ -1,98 +0,0 @@
@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/event>
a doap:Project ;
doap:license <http://opensource.org/licenses/isc> ;
doap:name "LV2 Event" ;
doap:shortdesc "A port-based real-time generic event interface." ;
doap:created "2008-00-00" ;
doap:developer <http://drobilla.net/drobilla#me> ,
<http://lv2plug.in/ns/meta#larsl> ;
doap:release [
doap:revision "1.12" ;
doap:created "2014-08-08" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.10.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Minor documentation improvements."
]
]
] , [
doap:revision "1.10" ;
doap:created "2013-01-13" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.4.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Fix incorrect return type in lv2_event_get()."
]
]
] , [
doap:revision "1.8" ;
doap:created "2012-10-14" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.2.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Make event iterator gracefully handle optional ports."
] , [
rdfs:label "Remove asserts from event-helper.h."
] , [
rdfs:label "Use more precise domain and range for EventPort properties."
] , [
rdfs:label "Use consistent label style."
]
]
] , [
doap:revision "1.6" ;
doap:created "2012-04-17" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Fix bug in lv2_event_reserve()."
] , [
rdfs:label "Fix incorrect ranges of some properties."
] , [
rdfs:label "Merge with unified LV2 package."
]
]
] , [
doap:revision "1.4" ;
doap:created "2011-11-21" ;
doap:file-release <http://lv2plug.in/spec/lv2-event-1.4.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Update packaging."
]
]
] , [
doap:revision "1.2" ;
doap:created "2011-05-26" ;
doap:file-release <http://lv2plug.in/spec/lv2-event-1.2.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Add build system (for installation)."
] , [
rdfs:label "Convert documentation to HTML and use lv2:documentation."
] , [
rdfs:label "Use lv2:Specification to be discovered as an extension."
]
]
] , [
doap:revision "1.0" ;
doap:created "2010-11-24" ;
doap:file-release <http://lv2plug.in/spec/lv2-event-1.0.tar.gz> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Initial release."
]
]
] .

View file

@ -1,9 +0,0 @@
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/event>
a lv2:Specification ;
lv2:minorVersion 1 ;
lv2:microVersion 12 ;
rdfs:seeAlso <event.ttl> .

View file

@ -1,36 +1,28 @@
/*
LV2 Instance Access Extension
Copyright 2008-2016 David Robillard <http://drobilla.net>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/**
@defgroup instance-access Instance Access
Access to the LV2_Handle of a plugin for UIs; see
<http://lv2plug.in/ns/ext/instance-access> for details.
@{
*/
// Copyright 2008-2016 David Robillard <d@drobilla.net>
// SPDX-License-Identifier: ISC
#ifndef LV2_INSTANCE_ACCESS_H
#define LV2_INSTANCE_ACCESS_H
/**
@defgroup instance-access Instance Access
@ingroup lv2
Access to the LV2_Handle of a plugin for UIs.
See <http://lv2plug.in/ns/ext/instance-access> for details.
@{
*/
// clang-format off
#define LV2_INSTANCE_ACCESS_URI "http://lv2plug.in/ns/ext/instance-access" ///< http://lv2plug.in/ns/ext/instance-access
#endif /* LV2_INSTANCE_ACCESS_H */
// clang-format on
/**
@}
*/
#endif /* LV2_INSTANCE_ACCESS_H */

View file

@ -1,22 +0,0 @@
@prefix ia: <http://lv2plug.in/ns/ext/instance-access#> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/instance-access>
a lv2:Feature ;
rdfs:seeAlso <instance-access.h> ,
<lv2-instance-access.doap.ttl> ;
lv2:documentation """
<p>This extension defines a feature which allows plugin UIs to get a direct
handle to an LV2 plugin instance (LV2_Handle), if possible.</p>
<p>Note that the use of this extension by UIs violates the important principle
of UI/plugin separation, and is potentially a source of many problems.
Accordingly, <strong>use of this extension is highly discouraged</strong>, and
plugins should not expect hosts to support it, since it is often impossible to
do so.</p>
<p>To support this feature the host must pass an LV2_Feature struct to the UI
instantiate method with URI LV2_INSTANCE_ACCESS_URI and data pointed directly
to the LV2_Handle of the plugin instance.</p>
""" .

View file

@ -1,57 +0,0 @@
@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/instance-access>
a doap:Project ;
doap:license <http://opensource.org/licenses/isc> ;
doap:name "LV2 Instance Access" ;
doap:shortdesc "Provides access to the LV2_Handle of a plugin." ;
doap:created "2010-10-04" ;
doap:developer <http://drobilla.net/drobilla#me> ;
doap:release [
doap:revision "1.6" ;
doap:created "2012-04-17" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Merge with unified LV2 package."
]
]
] , [
doap:revision "1.4" ;
doap:created "2011-11-21" ;
doap:file-release <http://lv2plug.in/spec/lv2-instance-access-1.4.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Update packaging."
] , [
rdfs:label "Improve documentation."
]
]
] , [
doap:revision "1.2" ;
doap:created "2011-05-26" ;
doap:file-release <http://lv2plug.in/spec/lv2-instance-access-1.2.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Add build system for installation."
] , [
rdfs:label "Switch to ISC license."
]
]
] , [
doap:revision "1.0" ;
doap:created "2010-10-04" ;
doap:file-release <http://lv2plug.in/spec/lv2-instance-access-1.0.tar.gz> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Initial release."
]
]
] .

View file

@ -1,9 +0,0 @@
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/instance-access>
a lv2:Specification ;
lv2:minorVersion 1 ;
lv2:microVersion 6 ;
rdfs:seeAlso <instance-access.ttl> .

View file

@ -1,30 +1,21 @@
/*
Copyright 2012-2016 David Robillard <http://drobilla.net>
// Copyright 2012-2016 David Robillard <d@drobilla.net>
// SPDX-License-Identifier: ISC
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef LV2_LOG_H
#define LV2_LOG_H
/**
@defgroup log Log
@ingroup lv2
Interface for plugins to log via the host; see
<http://lv2plug.in/ns/ext/log> for details.
Interface for plugins to log via the host.
See <http://lv2plug.in/ns/ext/log> for details.
@{
*/
#ifndef LV2_LOG_H
#define LV2_LOG_H
// clang-format off
#define LV2_LOG_URI "http://lv2plug.in/ns/ext/log" ///< http://lv2plug.in/ns/ext/log
#define LV2_LOG_PREFIX LV2_LOG_URI "#" ///< http://lv2plug.in/ns/ext/log#
@ -36,6 +27,8 @@
#define LV2_LOG__Warning LV2_LOG_PREFIX "Warning" ///< http://lv2plug.in/ns/ext/log#Warning
#define LV2_LOG__log LV2_LOG_PREFIX "log" ///< http://lv2plug.in/ns/ext/log#log
// clang-format on
#include "lv2/urid/urid.h"
#include <stdarg.h>
@ -61,7 +54,7 @@ typedef void* LV2_Log_Handle;
/**
Log feature (LV2_LOG__log)
*/
typedef struct _LV2_Log {
typedef struct {
/**
Opaque pointer to host data.
@ -79,9 +72,7 @@ typedef struct _LV2_Log {
is @ref LV2_LOG__Trace.
*/
LV2_LOG_FUNC(3, 4)
int (*printf)(LV2_Log_Handle handle,
LV2_URID type,
const char* fmt, ...);
int (*printf)(LV2_Log_Handle handle, LV2_URID type, const char* fmt, ...);
/**
Log a message, passing format parameters in a va_list.
@ -102,8 +93,8 @@ typedef struct _LV2_Log {
} /* extern "C" */
#endif
#endif /* LV2_LOG_H */
/**
@}
*/
#endif /* LV2_LOG_H */

View file

@ -1,68 +0,0 @@
@prefix log: <http://lv2plug.in/ns/ext/log#> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<http://lv2plug.in/ns/ext/log>
a lv2:Specification ;
rdfs:seeAlso <log.h> ,
<lv2-log.doap.ttl> ;
lv2:documentation """
<p>This extension defines a feature, log:log, which allows plugins to print log
messages with an API much like the standard C printf functions. This allows,
for example, plugin logs to be nicely presented to the user in a graphical user
interface.</p>
<p>Different log levels (e.g. <q>error</q> or <q>information</q>) are defined
by URI and passed as an LV2_URID. This document defines the typical levels
which should be sufficient, but implementations may define and use additional
levels to suit their needs.</p>
""" .
log:Entry
a rdfs:Class ;
rdfs:label "Log Entry" ;
lv2:documentation """
<p>A log entry. Subclasses of this class can be passed to LV2_Log_Log methods
to describe the nature of the log message.</p>""" .
log:Error
a rdfs:Class ;
rdfs:label "Error" ;
rdfs:subClassOf log:Entry ;
rdfs:comment "An error message." .
log:Note
a rdfs:Class ;
rdfs:label "Note" ;
rdfs:subClassOf log:Entry ;
rdfs:comment "An informative message." .
log:Warning
a rdfs:Class ;
rdfs:label "Warning" ;
rdfs:subClassOf log:Entry ;
rdfs:comment "A warning message." .
log:Trace
a rdfs:Class ;
rdfs:label "Trace" ;
rdfs:subClassOf log:Entry ;
lv2:documentation """
<p>A debugging trace. These entries should not be displayed during normal
operation, but the host may implement an option to display them for debugging
purposes.</p>
<p>This entry type is special in that it may be written to in a real-time
thread. It is assumed that if debug tracing is enabled, real-time
considerations are not a concern.</p>
""" .
log:log
a lv2:Feature ;
lv2:documentation """
<p>A feature which plugins may use to log messages. To support this feature,
the host must pass an LV2_Feature to LV2_Descriptor::instantiate() with URI
LV2_LOG__log and data pointed to an instance of LV2_Log_Log.</p>
""" .

View file

@ -1,18 +1,8 @@
/*
Copyright 2012-2016 David Robillard <http://drobilla.net>
// Copyright 2012-2016 David Robillard <d@drobilla.net>
// SPDX-License-Identifier: ISC
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef LV2_ATOM_LOGGER_H
#define LV2_ATOM_LOGGER_H
/**
@defgroup logger Logger
@ -20,18 +10,16 @@
Convenience API for easy logging in plugin code. This API provides simple
wrappers for logging from a plugin, which automatically fall back to
printing to stderr if host support is unavailabe.
printing to stderr if host support is unavailable.
@{
*/
#ifndef LV2_ATOM_LOGGER_H
#define LV2_ATOM_LOGGER_H
#include "lv2/log/log.h"
#include "lv2/urid/urid.h"
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#ifdef __cplusplus
extern "C" {
@ -76,9 +64,7 @@ lv2_log_logger_set_map(LV2_Log_Logger* logger, LV2_URID_Map* map)
in which case the implementation will fall back to printing to stderr.
*/
static inline void
lv2_log_logger_init(LV2_Log_Logger* logger,
LV2_URID_Map* map,
LV2_Log_Log* log)
lv2_log_logger_init(LV2_Log_Logger* logger, LV2_URID_Map* map, LV2_Log_Log* log)
{
logger->log = log;
lv2_log_logger_set_map(logger, map);
@ -151,8 +137,8 @@ lv2_log_warning(LV2_Log_Logger* logger, const char* fmt, ...)
} /* extern "C" */
#endif
#endif /* LV2_LOG_LOGGER_H */
/**
@}
*/
#endif /* LV2_LOG_LOGGER_H */

View file

@ -1,52 +0,0 @@
@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/log>
a doap:Project ;
doap:name "LV2 Log" ;
doap:shortdesc "A feature for writing log messages." ;
doap:created "2012-01-12" ;
doap:developer <http://drobilla.net/drobilla#me> ;
doap:release [
doap:revision "2.4" ;
doap:created "2016-07-30" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.14.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Add lv2_log_logger_set_map() for changing the URI map of an existing logger."
]
]
] , [
doap:revision "2.2" ;
doap:created "2014-01-04" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.8.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Add missing include string.h to logger.h for memset."
]
]
] , [
doap:revision "2.0" ;
doap:created "2013-01-08" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.4.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Add logger convenience API."
]
]
] , [
doap:revision "1.0" ;
doap:created "2012-04-17" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Initial release."
]
]
] .

View file

@ -1,9 +0,0 @@
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/log>
a lv2:Specification ;
lv2:minorVersion 2 ;
lv2:microVersion 4 ;
rdfs:seeAlso <log.ttl> .

View file

@ -1,93 +0,0 @@
@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/midi>
a doap:Project ;
doap:license <http://opensource.org/licenses/isc> ;
doap:name "LV2 MIDI" ;
doap:shortdesc "A normalised definition of raw MIDI." ;
doap:maintainer <http://drobilla.net/drobilla#me> ;
doap:created "2006-00-00" ;
doap:developer <http://lv2plug.in/ns/meta#larsl> ,
<http://drobilla.net/drobilla#me> ;
doap:release [
doap:revision "1.10" ;
doap:created "2019-02-03" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.16.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Fix incorrect range of midi:chunk."
]
]
] , [
doap:revision "1.8" ;
doap:created "2012-10-14" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.2.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Use consistent label style."
] , [
rdfs:label "Add midi:binding and midi:channel predicates."
] , [
rdfs:label "Add midi:HexByte datatype for status bytes and masks."
] , [
rdfs:label "Remove non-standard midi:Tick message type."
] , [
rdfs:label "Add C definitions for message types and standard controllers."
] , [
rdfs:label "Fix definition of SystemExclusive status byte."
]
]
] , [
doap:revision "1.6" ;
doap:created "2012-04-17" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Add class definitions for various message types."
] , [
rdfs:label "Document how to serialise a MidiEvent to a string."
] , [
rdfs:label "Merge with unified LV2 package."
]
]
] , [
doap:revision "1.4" ;
doap:created "2011-11-21" ;
doap:file-release <http://lv2plug.in/spec/lv2-midi-1.4.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Update packaging."
] , [
rdfs:label "Improve documentation."
]
]
] , [
doap:revision "1.2" ;
doap:created "2011-05-26" ;
doap:file-release <http://lv2plug.in/spec/lv2-midi-1.2.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Add build system for installation."
] , [
rdfs:label "Switch to ISC license."
]
]
] , [
doap:revision "1.0" ;
doap:created "2010-10-04" ;
doap:file-release <http://lv2plug.in/spec/lv2-midi-1.0.tar.gz> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Initial release."
]
]
] .

View file

@ -1,9 +0,0 @@
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/midi>
a lv2:Specification ;
lv2:minorVersion 1 ;
lv2:microVersion 10 ;
rdfs:seeAlso <midi.ttl> .

View file

@ -1,31 +1,20 @@
/*
Copyright 2012-2016 David Robillard <http://drobilla.net>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/**
@defgroup midi MIDI
Definitions of standard MIDI messages, see <http://lv2plug.in/ns/ext/midi>
for details.
@{
*/
// Copyright 2012-2016 David Robillard <d@drobilla.net>
// SPDX-License-Identifier: ISC
#ifndef LV2_MIDI_H
#define LV2_MIDI_H
/**
@defgroup midi MIDI
@ingroup lv2
Definitions of standard MIDI messages.
See <http://lv2plug.in/ns/ext/midi> for details.
@{
*/
#include <stdbool.h>
#include <stdint.h>
@ -33,6 +22,8 @@
extern "C" {
#endif
// clang-format off
#define LV2_MIDI_URI "http://lv2plug.in/ns/ext/midi" ///< http://lv2plug.in/ns/ext/midi
#define LV2_MIDI_PREFIX LV2_MIDI_URI "#" ///< http://lv2plug.in/ns/ext/midi#
@ -78,6 +69,8 @@ extern "C" {
#define LV2_MIDI__statusMask LV2_MIDI_PREFIX "statusMask" ///< http://lv2plug.in/ns/ext/midi#statusMask
#define LV2_MIDI__velocity LV2_MIDI_PREFIX "velocity" ///< http://lv2plug.in/ns/ext/midi#velocity
// clang-format on
/**
MIDI Message Type.
@ -190,7 +183,8 @@ typedef enum {
Return true iff `msg` is a MIDI voice message (which has a channel).
*/
static inline bool
lv2_midi_is_voice_message(const uint8_t* msg) {
lv2_midi_is_voice_message(const uint8_t* msg)
{
return msg[0] >= 0x80 && msg[0] < 0xF0;
}
@ -198,12 +192,17 @@ lv2_midi_is_voice_message(const uint8_t* msg) {
Return true iff `msg` is a MIDI system message (which has no channel).
*/
static inline bool
lv2_midi_is_system_message(const uint8_t* msg) {
lv2_midi_is_system_message(const uint8_t* msg)
{
switch (msg[0]) {
case 0xF4: case 0xF5: case 0xF7: case 0xF9: case 0xFD:
case 0xF4:
case 0xF5:
case 0xF7:
case 0xF9:
case 0xFD:
return false;
default:
return (msg[0] & 0xF0) == 0xF0;
return (msg[0] & 0xF0U) == 0xF0U;
}
}
@ -212,22 +211,25 @@ lv2_midi_is_system_message(const uint8_t* msg) {
@param msg Pointer to the start (status byte) of a MIDI message.
*/
static inline LV2_Midi_Message_Type
lv2_midi_message_type(const uint8_t* msg) {
lv2_midi_message_type(const uint8_t* msg)
{
if (lv2_midi_is_voice_message(msg)) {
return (LV2_Midi_Message_Type)(msg[0] & 0xF0);
} else if (lv2_midi_is_system_message(msg)) {
return (LV2_Midi_Message_Type)msg[0];
} else {
return LV2_MIDI_MSG_INVALID;
return (LV2_Midi_Message_Type)(msg[0] & 0xF0U);
}
if (lv2_midi_is_system_message(msg)) {
return (LV2_Midi_Message_Type)msg[0];
}
return LV2_MIDI_MSG_INVALID;
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* LV2_MIDI_H */
/**
@}
*/
#endif /* LV2_MIDI_H */

View file

@ -1,397 +0,0 @@
@prefix atom: <http://lv2plug.in/ns/ext/atom#> .
@prefix ev: <http://lv2plug.in/ns/ext/event#> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix midi: <http://lv2plug.in/ns/ext/midi#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<http://lv2plug.in/ns/ext/midi>
a owl:Ontology ;
rdfs:seeAlso <midi.h> ,
<lv2-midi.doap.ttl> ;
lv2:documentation """
<p>This specification defines a data type for a MIDI message, midi:MidiEvent,
which is normalised for fast and convenient real-time processing. MIDI is the
<q>Musical Instrument Digital Interface</q>, a ubiquitous binary standard for
controlling digital music devices.</p>
<p>For plugins that process MIDI (or other situations where MIDI is sent via a
generic transport) the main type defined here, midi:MidiEvent, can be mapped to
an integer and used as the type of an LV2 <a
href="atom.html#Atom">Atom</a> or <a
href="event.html#Event">Event</a>.</p>
<p>This specification also defines a complete human and machine readable
description of the MIDI standard (except for standard controller numbers).
These descriptions are detailed enough to express any MIDI message as
properties.</p>
""" .
midi:ActiveSense
a rdfs:Class ;
rdfs:subClassOf midi:SystemRealtime ;
rdfs:label "Active Sense Message" ;
midi:status "FE"^^xsd:hexBinary .
midi:Aftertouch
a rdfs:Class ;
rdfs:subClassOf midi:VoiceMessage ;
rdfs:label "Aftertouch Message" ;
midi:statusMask "A0"^^xsd:hexBinary ;
midi:chunk [
midi:byteNumber 0 ;
midi:property midi:noteNumber
] , [
midi:byteNumber 1 ;
midi:property midi:pressure
] .
midi:Bender
a rdfs:Class ;
rdfs:subClassOf midi:VoiceMessage ;
rdfs:label "Bender Message" ;
midi:statusMask "E0"^^xsd:hexBinary ;
midi:chunk [
midi:byteNumber 0 ,
1 ;
midi:property midi:benderValue
] .
midi:ChannelPressure
a rdfs:Class ;
rdfs:subClassOf midi:VoiceMessage ;
rdfs:label "Channel Pressure Message" ;
midi:statusMask "D0"^^xsd:hexBinary ;
midi:chunk [
midi:byteNumber 0 ;
midi:property midi:pressure
] .
midi:Chunk
a rdfs:Class ;
rdfs:label "MIDI Chunk" ;
rdfs:comment "A series of contiguous bytes (usually one) in a message." .
midi:Clock
a rdfs:Class ;
rdfs:subClassOf midi:SystemRealtime ;
rdfs:label "Clock Message" ;
midi:status "F8"^^xsd:hexBinary .
midi:Continue
a rdfs:Class ;
rdfs:subClassOf midi:SystemRealtime ;
rdfs:label "Continue Message" ;
midi:status "FB"^^xsd:hexBinary .
midi:Controller
a rdfs:Class ;
rdfs:subClassOf midi:VoiceMessage ;
rdfs:label "Controller Change Message" ;
midi:statusMask "B0"^^xsd:hexBinary ;
midi:chunk [
midi:byteNumber 0 ;
midi:property midi:controllerNumber
] , [
midi:byteNumber 1 ;
midi:property midi:controllerValue
] .
midi:HexByte
a rdfs:Datatype ;
owl:onDatatype xsd:hexBinary ;
owl:withRestrictions (
[
xsd:maxInclusive "FF"
]
) ;
rdfs:comment "A hexadecimal byte, which is a xsd:hexBinary value <= FF" .
midi:MidiEvent
a rdfs:Class ,
rdfs:Datatype ;
rdfs:label "MIDI Message" ;
rdfs:subClassOf ev:Event ,
atom:Atom ;
owl:onDatatype xsd:hexBinary ;
lv2:documentation """
<p>A single raw MIDI message (i.e. a sequence of bytes).</p>
<p>This is equivalent to a standard MIDI messages, except with the following
restrictions to simplify handling:</p>
<ul>
<li>Running status is not allowed, every message must have its own status
byte.</li>
<li>Note On messages with velocity 0 are not allowed. These messages are
equivalent to Note Off in standard MIDI streams, but here only proper Note
Off messages are allowed.</li>
<li>"Realtime messages" (status bytes 0xF8 to 0xFF) are allowed, but may
not occur inside other messages like they can in standard MIDI streams.</li>
<li>All messages are complete valid MIDI messages. This means, for example,
that only the first byte in each event (the status byte) may have the eighth
bit set, that Note On and Note Off events are always 3 bytes long, etc.
Where messages are communicated, the writer is responsible for writing valid
messages, and the reader may assume that all events are valid.</li>
</ul>
<p>If a midi:MidiEvent is serialised to a string, the format should be
xsd:hexBinary, e.g. (in Turtle notation):</p>
<pre class="turtle-code">
[] eg:someEvent "901A01"^^midi:MidiEvent .
</pre>
""" .
midi:NoteOff
a rdfs:Class ;
rdfs:subClassOf midi:VoiceMessage ;
rdfs:label "Note Off Message" ;
midi:statusMask "80"^^xsd:hexBinary ;
midi:chunk [
midi:byteNumber 0 ;
midi:property midi:noteNumber
] , [
midi:byteNumber 1 ;
midi:property midi:velocity
] .
midi:NoteOn
a rdfs:Class ;
rdfs:subClassOf midi:VoiceMessage ;
rdfs:label "Note On Message" ;
midi:statusMask "90"^^xsd:hexBinary ;
midi:chunk [
midi:byteNumber 0 ;
midi:property midi:noteNumber
] , [
midi:byteNumber 1 ;
midi:property midi:velocity
] .
midi:ProgramChange
a rdfs:Class ;
rdfs:subClassOf midi:VoiceMessage ;
rdfs:label "Program Change Message" ;
midi:statusMask "C0"^^xsd:hexBinary ;
midi:chunk [
midi:byteNumber 0 ;
midi:property midi:programNumber
] .
midi:QuarterFrame
a rdfs:Class ;
rdfs:subClassOf midi:SystemCommon ;
rdfs:label "Quarter Frame Message" ;
midi:status "F1"^^xsd:hexBinary .
midi:Reset
a rdfs:Class ;
rdfs:subClassOf midi:SystemRealtime ;
rdfs:label "Reset Message" ;
midi:status "FF"^^xsd:hexBinary .
midi:SongPosition
a rdfs:Class ;
rdfs:subClassOf midi:SystemCommon ;
rdfs:label "Song Position Pointer Message" ;
midi:status "F2"^^xsd:hexBinary ;
midi:chunk [
midi:byteNumber 0 ,
1 ;
midi:property midi:songPosition
] .
midi:SongSelect
a rdfs:Class ;
rdfs:subClassOf midi:SystemCommon ;
rdfs:label "Song Select Message" ;
midi:status "F3"^^xsd:hexBinary .
midi:Start
a rdfs:Class ;
rdfs:subClassOf midi:SystemRealtime ;
rdfs:label "Start Message" ;
midi:status "FA"^^xsd:hexBinary .
midi:Stop
a rdfs:Class ;
rdfs:subClassOf midi:SystemRealtime ;
rdfs:label "Stop Message" ;
midi:status "FC"^^xsd:hexBinary .
midi:SystemCommon
a rdfs:Class ;
rdfs:subClassOf midi:SystemMessage ;
rdfs:label "System Common Message" .
midi:SystemExclusive
a rdfs:Class ;
rdfs:subClassOf midi:SystemMessage ;
rdfs:label "System Exclusive Message" ;
midi:status "F0"^^xsd:hexBinary .
midi:SystemMessage
a rdfs:Class ;
rdfs:subClassOf midi:MidiEvent ;
rdfs:label "System Message" ;
midi:statusMask "F0"^^xsd:hexBinary .
midi:SystemRealtime
a rdfs:Class ;
rdfs:subClassOf midi:SystemMessage ;
rdfs:label "System Realtime Message" .
midi:TuneRequest
a rdfs:Class ;
rdfs:subClassOf midi:SystemCommon ;
rdfs:label "Tune Request Message" ;
midi:status "F6"^^xsd:hexBinary .
midi:VoiceMessage
a rdfs:Class ;
rdfs:subClassOf midi:MidiEvent ;
rdfs:label "Voice Message" ;
midi:statusMask "F0"^^xsd:hexBinary .
midi:benderValue
a rdf:Property ,
owl:DatatypeProperty ,
owl:FunctionalProperty ;
rdfs:label "bender value" ;
rdfs:range xsd:short ;
rdfs:comment "The value of a pitch bender (-8192 to 8192)." .
midi:binding
a rdf:Property ,
owl:ObjectProperty ;
rdfs:range midi:MidiEvent ;
rdfs:label "binding" ;
lv2:documentation """
<p>The MIDI event to bind a parameter to. This describes which MIDI events
should be used to control a port, parameter, or other object. The binding
should be a midi:MidiEvent but the property that represents the control value may
be omitted. For example, to bind to the value of controller 17:</p>
<pre class="turtle-code">
port midi:binding [
a midi:Controller ;
midi:controllerNumber 17
] .
</pre>
""" .
midi:byteNumber
a rdf:Property ,
owl:DatatypeProperty ;
rdfs:label "byte number" ;
rdfs:domain midi:Chunk ;
rdfs:range xsd:unsignedByte ;
rdfs:comment "The 0-based index of a byte which is part of this chunk." .
midi:channel
a rdf:Property ,
owl:DatatypeProperty ,
owl:FunctionalProperty ;
rdfs:label "MIDI channel" ;
rdfs:range xsd:unsignedByte ;
rdfs:comment "The channel number of a MIDI message." .
midi:chunk
a rdf:Property ;
rdfs:range midi:Chunk ;
rdfs:label "MIDI chunk" ;
rdfs:comment "A chunk of a MIDI message." .
midi:controllerNumber
a rdf:Property ,
owl:DatatypeProperty ,
owl:FunctionalProperty ;
rdfs:label "MIDI controller number" ;
rdfs:range xsd:byte ;
rdfs:comment "The numeric ID of a controller (0 to 127)." .
midi:controllerValue
a rdf:Property ,
owl:DatatypeProperty ,
owl:FunctionalProperty ;
rdfs:label "MIDI controller value" ;
rdfs:range xsd:byte ;
rdfs:comment "The value of a controller (0 to 127)." .
midi:noteNumber
a rdf:Property ,
owl:DatatypeProperty ,
owl:FunctionalProperty ;
rdfs:label "note number" ;
rdfs:range xsd:byte ;
rdfs:comment "The numeric ID of a note (0 to 127)." .
midi:pressure
a rdf:Property ,
owl:DatatypeProperty ,
owl:FunctionalProperty ;
rdfs:label "key pressure" ;
rdfs:range xsd:byte ;
rdfs:comment "Key pressure (0 to 127)." .
midi:programNumber
a rdf:Property ,
owl:DatatypeProperty ,
owl:FunctionalProperty ;
rdfs:label "program number" ;
rdfs:range xsd:byte ;
rdfs:comment "The numeric ID of a program (0 to 127)." .
midi:property
a rdf:Property ,
owl:ObjectProperty ,
owl:FunctionalProperty ;
rdfs:label "property" ;
rdfs:domain midi:Chunk ;
rdfs:range rdf:Property ;
rdfs:comment "The property this chunk represents." .
midi:songNumber
a rdf:Property ,
owl:DatatypeProperty ,
owl:FunctionalProperty ;
rdfs:label "song number" ;
rdfs:range xsd:byte ;
rdfs:comment "The numeric ID of a song (0 to 127)." .
midi:songPosition
a rdf:Property ,
owl:DatatypeProperty ,
owl:FunctionalProperty ;
rdfs:label "song position" ;
rdfs:range xsd:short ;
rdfs:comment "Song position in MIDI beats (16th notes) (-8192 to 8192)." .
midi:status
a rdf:Property ,
owl:DatatypeProperty ,
owl:FunctionalProperty ;
rdfs:label "status byte" ;
rdfs:range midi:HexByte ;
rdfs:comment "The exact status byte for a message of this type." .
midi:statusMask
a rdf:Property ,
owl:DatatypeProperty ,
owl:FunctionalProperty ;
rdfs:label "status mask" ;
rdfs:range midi:HexByte ;
rdfs:comment """The status byte for a message of this type on channel 1, i.e. a status byte with the lower nibble set to zero.""" .
midi:velocity
a rdf:Property ,
owl:DatatypeProperty ,
owl:FunctionalProperty ;
rdfs:label "velocity" ;
rdfs:range midi:HexByte ;
rdfs:comment "The velocity of a note message (0 to 127)." .

View file

@ -1,22 +0,0 @@
@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/morph>
a doap:Project ;
doap:name "LV2 Morph" ;
doap:shortdesc "Ports that can dynamically change type." ;
doap:created "2012-05-22" ;
doap:developer <http://drobilla.net/drobilla#me> ;
doap:release [
doap:revision "1.0" ;
doap:created "2012-10-14" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.2.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Initial release."
]
]
] .

View file

@ -1,9 +0,0 @@
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/morph>
a lv2:Specification ;
lv2:minorVersion 1 ;
lv2:microVersion 0 ;
rdfs:seeAlso <morph.ttl> .

View file

@ -1,30 +1,21 @@
/*
Copyright 2012-2016 David Robillard <http://drobilla.net>
// Copyright 2012-2016 David Robillard <d@drobilla.net>
// SPDX-License-Identifier: ISC
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef LV2_MORPH_H
#define LV2_MORPH_H
/**
@defgroup morph Morph
@ingroup lv2
Ports that can dynamically change type, see <http://lv2plug.in/ns/ext/morph>
for details.
Ports that can dynamically change type.
See <http://lv2plug.in/ns/ext/morph> for details.
@{
*/
#ifndef LV2_MORPH_H
#define LV2_MORPH_H
// clang-format off
#define LV2_MORPH_URI "http://lv2plug.in/ns/ext/morph" ///< http://lv2plug.in/ns/ext/morph
#define LV2_MORPH_PREFIX LV2_MORPH_URI "#" ///< http://lv2plug.in/ns/ext/morph#
@ -35,8 +26,10 @@
#define LV2_MORPH__supportsType LV2_MORPH_PREFIX "supportsType" ///< http://lv2plug.in/ns/ext/morph#supportsType
#define LV2_MORPH__currentType LV2_MORPH_PREFIX "currentType" ///< http://lv2plug.in/ns/ext/morph#currentType
#endif /* LV2_MORPH_H */
// clang-format on
/**
@}
*/
#endif /* LV2_MORPH_H */

View file

@ -1,85 +0,0 @@
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix morph: <http://lv2plug.in/ns/ext/morph#> .
@prefix opts: <http://lv2plug.in/ns/ext/options#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<http://lv2plug.in/ns/ext/morph>
a owl:Ontology ;
rdfs:seeAlso <morph.h> ,
<lv2-morph.doap.ttl> ;
lv2:documentation """
<p>This extension defines two port types: morph:MorphPort, which has a
host-configurable type, and morph:AutoMorphPort, which may automatically change
type when a MorphPort's type is changed. These ports always have a default
type and work normally work in hosts that are unaware of this extension. Thus,
this extension provides a backwards compatibility mechanism which allows
plugins to use new port types but gracefully fall back to a default type in
hosts that do not support them.</p>
<p>This extension only defines port types and properties for describing morph
ports. The actual run-time switching is done via the opts:interface API.</p>
""" .
morph:MorphPort
a rdfs:Class ,
owl:Class ;
rdfs:subClassOf lv2:Port ;
rdfs:label "Morph Port" ;
lv2:documentation """
<p>Ports of this type MUST have another type which defines the default buffer
format (e.g. lv2:ControlPort) but can be dynamically changed to a different
type in hosts that support opts:interface.</p>
<p>The host may change the type of a MorphPort by setting its morph:currentType
with LV2_Options_Interface::set(). If the plugin has any morph:AutoMorphPort
ports, the host MUST check their types after changing any port type since they
may have changed.</p> """ .
morph:AutoMorphPort
a rdfs:Class ,
owl:Class ;
rdfs:subClassOf lv2:Port ;
rdfs:label "Auto Morph Port" ;
lv2:documentation """
<p>Ports of this type MUST have another type which defines the default buffer
format (e.g. lv2:ControlPort) but may dynamically change types based on the
configured types of any morph:MorphPort ports on the same plugin instance.</p>
<p>The type of a port may only change in response to a host call to
LV2_Options_Interface::set(). Whenever any port type on the instance changes,
the host MUST check the type of all morph:AutoMorphPort ports with
LV2_Options_Interface::get() before calling run() again, since they may have
changed. If the type of any port is zero, it means the current configuration
is invalid and the plugin may not be run (unless that port is
lv2:connectionOptional and connected to NULL).</p>
<p>This is mainly useful for outputs whose type depends on the type of
corresponding inputs.</p>
""" .
morph:supportsType
a rdf:Property ,
owl:ObjectProperty ;
rdfs:domain morph:MorphPort ;
rdfs:label "supports type" ;
lv2:documentation """
<p>Indicates that a port supports being switched to a certain type. A
MorphPort MUST list each type it supports being switched to in the plugin data
using this property.</p>
""" .
morph:currentType
a rdf:Property ,
opts:Option ,
owl:ObjectProperty ;
rdfs:domain morph:MorphPort ;
rdfs:label "current type" ;
lv2:documentation """
<p>The currently active type of the port. This is for dynamic use as an option
and SHOULD NOT be listed in the static plugin data.</p>
""" .

View file

@ -1,42 +0,0 @@
@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/options>
a doap:Project ;
doap:name "LV2 Options" ;
doap:shortdesc "Instantiation time options." ;
doap:created "2012-08-20" ;
doap:developer <http://drobilla.net/drobilla#me> ;
doap:release [
doap:revision "1.4" ;
doap:created "2019-02-03" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.16.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Relax range of opts:requiredOption and opts:supportedOption"
]
]
] , [
doap:revision "1.2" ;
doap:created "2013-01-10" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.4.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Set the range of opts:requiredOption and opts:supportedOption to opts:Option."
]
]
] , [
doap:revision "1.0" ;
doap:created "2012-10-14" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.2.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Initial release."
]
]
] .

View file

@ -1,8 +0,0 @@
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/options>
a lv2:Specification ;
lv2:minorVersion 1 ;
lv2:microVersion 4 ;
rdfs:seeAlso <options.ttl> .

View file

@ -1,36 +1,27 @@
/*
Copyright 2012-2016 David Robillard <http://drobilla.net>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/**
@defgroup options Options
Instantiation time options, see <http://lv2plug.in/ns/ext/options> for
details.
@{
*/
// Copyright 2012-2016 David Robillard <d@drobilla.net>
// SPDX-License-Identifier: ISC
#ifndef LV2_OPTIONS_H
#define LV2_OPTIONS_H
/**
@defgroup options Options
@ingroup lv2
Instantiation time options.
See <http://lv2plug.in/ns/ext/options> for details.
@{
*/
#include "lv2/core/lv2.h"
#include "lv2/urid/urid.h"
#include <stdint.h>
// clang-format off
#define LV2_OPTIONS_URI "http://lv2plug.in/ns/ext/options" ///< http://lv2plug.in/ns/ext/options
#define LV2_OPTIONS_PREFIX LV2_OPTIONS_URI "#" ///< http://lv2plug.in/ns/ext/options#
@ -40,6 +31,8 @@
#define LV2_OPTIONS__requiredOption LV2_OPTIONS_PREFIX "requiredOption" ///< http://lv2plug.in/ns/ext/options#requiredOption
#define LV2_OPTIONS__supportedOption LV2_OPTIONS_PREFIX "supportedOption" ///< http://lv2plug.in/ns/ext/options#supportedOption
// clang-format on
#ifdef __cplusplus
extern "C" {
#endif
@ -85,7 +78,7 @@ typedef enum {
with data pointed to an array of options terminated by a zeroed option, or
accessed/manipulated using LV2_Options_Interface.
*/
typedef struct _LV2_Options_Option {
typedef struct {
LV2_Options_Context context; /**< Context (type of subject). */
uint32_t subject; /**< Subject. */
LV2_URID key; /**< Key (property). */
@ -96,17 +89,17 @@ typedef struct _LV2_Options_Option {
/** A status code for option functions. */
typedef enum {
LV2_OPTIONS_SUCCESS = 0, /**< Completed successfully. */
LV2_OPTIONS_ERR_UNKNOWN = 1, /**< Unknown error. */
LV2_OPTIONS_ERR_BAD_SUBJECT = 1 << 1, /**< Invalid/unsupported subject. */
LV2_OPTIONS_ERR_BAD_KEY = 1 << 2, /**< Invalid/unsupported key. */
LV2_OPTIONS_ERR_BAD_VALUE = 1 << 3 /**< Invalid/unsupported value. */
LV2_OPTIONS_SUCCESS = 0U, /**< Completed successfully. */
LV2_OPTIONS_ERR_UNKNOWN = 1U, /**< Unknown error. */
LV2_OPTIONS_ERR_BAD_SUBJECT = 1U << 1U, /**< Invalid/unsupported subject. */
LV2_OPTIONS_ERR_BAD_KEY = 1U << 2U, /**< Invalid/unsupported key. */
LV2_OPTIONS_ERR_BAD_VALUE = 1U << 3U /**< Invalid/unsupported value. */
} LV2_Options_Status;
/**
Interface for dynamically setting options (LV2_OPTIONS__interface).
*/
typedef struct _LV2_Options_Interface {
typedef struct {
/**
Get the given options.
@ -119,8 +112,7 @@ typedef struct _LV2_Options_Interface {
@return Bitwise OR of LV2_Options_Status values.
*/
uint32_t (*get)(LV2_Handle instance,
LV2_Options_Option* options);
uint32_t (*get)(LV2_Handle instance, LV2_Options_Option* options);
/**
Set the given options.
@ -130,16 +122,15 @@ typedef struct _LV2_Options_Interface {
@return Bitwise OR of LV2_Options_Status values.
*/
uint32_t (*set)(LV2_Handle instance,
const LV2_Options_Option* options);
uint32_t (*set)(LV2_Handle instance, const LV2_Options_Option* options);
} LV2_Options_Interface;
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* LV2_OPTIONS_H */
/**
@}
*/
#endif /* LV2_OPTIONS_H */

View file

@ -1,103 +0,0 @@
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix opts: <http://lv2plug.in/ns/ext/options#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<http://lv2plug.in/ns/ext/options>
a owl:Ontology ;
rdfs:seeAlso <options.h> ,
<lv2-options.doap.ttl> ;
lv2:documentation """
<p>This extension defines a facility for <q>options</q>, which are dynamic
properties that may be changed at run time.</p>
<p>There are two facilities for passing options to an instance: opts:options
allows passing options at instantiation time, and the opts:interface interface
allows options to be dynamically set and retrieved after instantiation.</p>
<p>Note that this extension is only for allowing hosts to configure plugins,
and is not a <q>live</q> control mechanism. For real-time control, use
event-based control via an atom:AtomPort with an atom:Sequence buffer.</p>
<p>Instances may indicate they <q>require</q> an option with the
opts:requiredOption property, or that they optionally <q>support</q> an option
with the opts:supportedOption property.</p>
""" .
opts:Option
a rdfs:Class ;
rdfs:label "Option" ;
rdfs:subClassOf rdf:Property ;
lv2:documentation """
<p>A property intended to be used as a static option for an instance.</p>
<p>It is not required for a property to explicitly be an Option in order to be
used as such. However, properties which are primarily intended for use as
options, or are at least particularly useful as options, should be explicitly
given this type for documentation purposes, and to assist hosts in discovering
option definitions.</p>
""" .
opts:interface
a lv2:ExtensionData ;
lv2:documentation """
<p>An interface (LV2_Options_Interface) for dynamically setting and getting
options. Note this is intended for use by the host for configuring plugins
only, and and is <em>not</em> a <q>live</q> plugin control mechanism.</p>
<p>The plugin data file should describe this like so:</p>
<pre class="turtle-code">
@prefix opts: &lt;http://lv2plug.in/ns/ext/options#&gt; .
&lt;plugin&gt;
a lv2:Plugin ;
lv2:extensionData opts:interface .
</pre>
""" .
opts:options
a lv2:Feature ;
rdfs:label "options" ;
lv2:documentation """
<p>The feature used to provide options to an instance.</p>
<p>To implement this feature, hosts MUST pass an LV2_Feature to the appropriate
instantiate method with this URI and data pointed to an array of
LV2_Options_Option terminated by an element with both key and value set to
zero. The instance should cast this data pointer to <code>const
LV2_Options_Option*</code> and scan the array for any options of interest. The
instance MUST NOT modify the options array in any way.</p>
<p>Note that requiring this feature may reduce the number of compatible hosts.
Unless some options are strictly required by the instance, this feature SHOULD
be listed as a lv2:optionalFeature.</p>
""" .
opts:requiredOption
a rdf:Property ,
owl:ObjectProperty ;
rdfs:range rdf:Property ;
rdfs:label "required option" ;
lv2:documentation """
<p>An option required by the instance to function at all. The host MUST pass a
value for the specified option via opts:options in order to create an
instance.</p>
<p>Note that use of this property may reduce the number of compatible hosts.
Wherever possible, it is better to list options with opts:supportedOption and
fall back to a reasonable default value if it is not provided.</p>
""" .
opts:supportedOption
a rdf:Property ,
owl:ObjectProperty ;
rdfs:range rdf:Property ;
rdfs:label "supported option" ;
lv2:documentation """
<p>An option supported or <q>understood</q> by the instance. The host SHOULD
provide a value for the specified option if one is known, or provide the user
an opportunity to specify one if one is Indicates that the instance host MUST
pass a value for the specified option in order to instantiate the instance.</p>
""" .

View file

@ -1,47 +0,0 @@
@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/parameters>
a doap:Project ;
doap:name "LV2 Parameters" ;
doap:release [
doap:revision "1.4" ;
doap:created "2015-04-07" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.12.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Add range to parameters so hosts know how to control them."
]
]
] , [
doap:revision "1.2" ;
doap:created "2012-10-14" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.2.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Use consistent label style."
] , [
rdfs:label "Add param:sampleRate."
] , [
rdfs:label "Add parameters.h of URI defines for convenience."
]
]
] , [
doap:revision "1.0" ;
doap:created "2012-04-17" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Initial release."
]
]
] ;
doap:created "2009-00-00" ;
doap:shortdesc "Common parameters for audio processing." ;
doap:maintainer <http://drobilla.net/drobilla#me> ;
doap:developer <http://lv2plug.in/ns/meta#larsl> .

View file

@ -1,8 +0,0 @@
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/parameters>
a lv2:Specification ;
lv2:minorVersion 1 ;
lv2:microVersion 4 ;
rdfs:seeAlso <parameters.ttl> .

View file

@ -1,30 +1,21 @@
/*
Copyright 2012-2016 David Robillard <http://drobilla.net>
// Copyright 2012-2016 David Robillard <d@drobilla.net>
// SPDX-License-Identifier: ISC
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef LV2_PARAMETERS_H
#define LV2_PARAMETERS_H
/**
@defgroup parameters Parameters
@ingroup lv2
Common parameters for audio processing, see
<http://lv2plug.in/ns/ext/parameters>.
Common parameters for audio processing.
See <http://lv2plug.in/ns/ext/parameters> for details.
@{
*/
#ifndef LV2_PARAMETERS_H
#define LV2_PARAMETERS_H
// clang-format off
#define LV2_PARAMETERS_URI "http://lv2plug.in/ns/ext/parameters" ///< http://lv2plug.in/ns/ext/parameters
#define LV2_PARAMETERS_PREFIX LV2_PARAMETERS_URI "#" ///< http://lv2plug.in/ns/ext/parameters#
@ -55,8 +46,10 @@
#define LV2_PARAMETERS__wetDryRatio LV2_PARAMETERS_PREFIX "wetDryRatio" ///< http://lv2plug.in/ns/ext/parameters#wetDryRatio
#define LV2_PARAMETERS__wetLevel LV2_PARAMETERS_PREFIX "wetLevel" ///< http://lv2plug.in/ns/ext/parameters#wetLevel
#endif /* LV2_PARAMETERS_H */
// clang-format on
/**
@}
*/
#endif /* LV2_PARAMETERS_H */

View file

@ -1,206 +0,0 @@
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix param: <http://lv2plug.in/ns/ext/parameters#> .
@prefix atom: <http://lv2plug.in/ns/ext/atom#> .
@prefix pg: <http://lv2plug.in/ns/ext/port-groups#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix units: <http://lv2plug.in/ns/extensions/units#> .
<http://lv2plug.in/ns/ext/parameters>
a lv2:Specification ;
rdfs:seeAlso <lv2-parameters.doap.ttl> ;
lv2:documentation """
<p>This vocabulary describes parameters common in audio processing software. A
<q>parameter</q> is purely a metadata concept, unrelated to any particular code
mechanism. Parameters are used to assign meaning to controls (e.g. using
lv2:designation for ports) so they can be used more intelligently or presented
to the user more efficiently.</p> """ .
param:ControlGroup
a rdfs:Class ;
rdfs:subClassOf pg:Group ;
rdfs:comment "A group representing a set of associated controls." .
param:amplitude
a lv2:Parameter ;
rdfs:range atom:Float ;
rdfs:label "amplitude" .
param:attack
a lv2:Parameter ;
rdfs:range atom:Float ;
rdfs:label "attack" ;
rdfs:comment "The duration of an envelope's attack stage." .
param:cutoffFrequency
a lv2:Parameter ;
rdfs:range atom:Float ;
rdfs:label "cutoff frequency" .
param:decay
a lv2:Parameter ;
rdfs:range atom:Float ;
rdfs:label "decay" ;
rdfs:comment "The duration of an envelope's decay stage." .
param:delay
a lv2:Parameter ;
rdfs:range atom:Float ;
rdfs:label "delay" ;
rdfs:comment "The duration of an envelope's delay stage." .
param:frequency
a lv2:Parameter ;
rdfs:range atom:Float ;
rdfs:label "frequency" .
param:hold
a lv2:Parameter ;
rdfs:range atom:Float ;
rdfs:label "hold" ;
rdfs:comment "The duration of an envelope's hold stage." .
param:pulseWidth
a lv2:Parameter ;
rdfs:range atom:Float ;
rdfs:label "pulse width" ;
rdfs:comment "The width of a pulse of a rectangular waveform." .
param:ratio
a lv2:Parameter ;
rdfs:range atom:Float ;
rdfs:label "ratio" ;
rdfs:comment "Compression ratio." .
param:release
a lv2:Parameter ;
rdfs:range atom:Float ;
rdfs:label "release" ;
rdfs:comment "The duration of an envelope's release stage." .
param:resonance
a lv2:Parameter ;
rdfs:range atom:Float ;
rdfs:label "resonance" ;
rdfs:comment "The resonance of a filter." .
param:sustain
a lv2:Parameter ;
rdfs:label "sustain" ;
rdfs:range atom:Float ;
rdfs:comment "The level (not duration) of an envelope's sustain stage." .
param:threshold
a lv2:Parameter ;
rdfs:range atom:Float ;
rdfs:label "threshold" ;
rdfs:comment "Compression threshold." .
param:waveform
a lv2:Parameter ;
rdfs:range atom:Float ;
rdfs:label "waveform" .
param:gain
a lv2:Parameter ;
rdfs:range atom:Float ;
lv2:default 0.0 ;
lv2:minimum -20.0 ;
lv2:maximum 20.0 ;
units:unit units:db ;
rdfs:label "gain" ;
rdfs:comment "Gain in decibels." .
param:wetDryRatio
a lv2:Parameter ;
rdfs:label "wet/dry ratio" ;
lv2:documentation """
<p>The ratio between processed and bypass components in output signal. The dry
and wet percentages can be calculated from the following equations:</p>
<pre class="c-code">
dry = (wetDryRatio.maximum - wetDryRatio.value) / wetDryRatio.maximum
wet = wetDryRatio.value / wetDryRatio.maximum
</pre>
<p>Typically, maximum value of 1 or 100 and minimum value of 0 should be
used.</p>
""" .
param:wetLevel
a lv2:Parameter ;
rdfs:label "wet level" ;
rdfs:comment "The level of the processed component of a signal." .
param:dryLevel
a lv2:Parameter ;
rdfs:label "dry level" ;
rdfs:comment "The level of the unprocessed component of a signal." .
param:bypass
a lv2:Parameter ;
rdfs:label "bypass" ;
rdfs:comment "A boolean parameter that disabled processing if true." .
param:sampleRate
a lv2:Parameter ;
rdfs:label "sample rate" ;
rdfs:comment "A sample rate in Hz." .
param:EnvelopeControls
a rdfs:Class ;
rdfs:subClassOf param:ControlGroup ;
rdfs:label "DAHDSR Envelope Controls" ;
pg:element [
lv2:index 0 ;
lv2:designation param:delay
] , [
lv2:index 1 ;
lv2:designation param:attack
] , [
lv2:index 2 ;
lv2:designation param:hold
] , [
lv2:index 3 ;
lv2:designation param:decay
] , [
lv2:index 4 ;
lv2:designation param:sustain
] , [
lv2:index 5 ;
lv2:designation param:release
] .
param:OscillatorControls
a rdfs:Class ;
rdfs:subClassOf param:ControlGroup ;
rdfs:label "Oscillator Controls" ;
pg:element [
lv2:designation param:frequency
] , [
lv2:designation param:amplitude
] , [
lv2:designation param:waveform
] , [
lv2:designation param:pulseWidth
] .
param:FilterControls
a rdfs:Class ;
rdfs:subClassOf param:ControlGroup ;
rdfs:label "Filter Controls" ;
pg:element [
lv2:designation param:cutoffFrequency
] , [
lv2:designation param:resonance
] .
param:CompressorControls
a rdfs:Class ;
rdfs:subClassOf param:ControlGroup ;
rdfs:label "Compressor Controls" ;
pg:element [
lv2:designation param:threshold
] , [
lv2:designation param:ratio
] .

View file

@ -1,69 +0,0 @@
@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/patch>
a doap:Project ;
doap:created "2012-02-09" ;
doap:license <http://opensource.org/licenses/isc> ;
doap:developer <http://drobilla.net/drobilla#me> ;
doap:name "LV2 Patch" ;
doap:shortdesc "Messages for accessing and manipulating properties." ;
doap:release [
doap:revision "2.6" ;
doap:created "2019-02-03" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.16.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Add patch:accept property."
] , [
rdfs:label "Add patch:context property."
]
]
] , [
doap:revision "2.4" ;
doap:created "2015-04-07" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.12.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Define patch:Get with no subject to implicitly apply to reciever. This can be used by UIs to get an initial description of a plugin."
] , [
rdfs:label "Add patch:Copy method."
]
]
] , [
doap:revision "2.2" ;
doap:created "2014-08-08" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.10.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Add patch:sequenceNumber for associating replies with requests."
]
]
] , [
doap:revision "2.0" ;
doap:created "2013-01-10" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.4.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Make patch:Set a compact message for setting one property."
] , [
rdfs:label "Add patch:readable and patch:writable for describing available properties."
]
]
] , [
doap:revision "1.0" ;
doap:created "2012-04-17" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Initial release."
]
]
] .

View file

@ -1,8 +0,0 @@
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/patch>
a lv2:Specification ;
lv2:minorVersion 2 ;
lv2:microVersion 6 ;
rdfs:seeAlso <patch.ttl> .

View file

@ -1,33 +1,24 @@
/*
Copyright 2012-2016 David Robillard <http://drobilla.net>
// Copyright 2012-2016 David Robillard <d@drobilla.net>
// SPDX-License-Identifier: ISC
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef LV2_PATCH_H
#define LV2_PATCH_H
/**
@defgroup patch Patch
@ingroup lv2
Messages for accessing and manipulating properties, see
<http://lv2plug.in/ns/ext/patch> for details.
Messages for accessing and manipulating properties.
Note the patch extension is purely data, this header merely defines URIs for
convenience.
See <http://lv2plug.in/ns/ext/patch> for details.
@{
*/
#ifndef LV2_PATCH_H
#define LV2_PATCH_H
// clang-format off
#define LV2_PATCH_URI "http://lv2plug.in/ns/ext/patch" ///< http://lv2plug.in/ns/ext/patch
#define LV2_PATCH_PREFIX LV2_PATCH_URI "#" ///< http://lv2plug.in/ns/ext/patch#
@ -60,8 +51,10 @@
#define LV2_PATCH__wildcard LV2_PATCH_PREFIX "wildcard" ///< http://lv2plug.in/ns/ext/patch#wildcard
#define LV2_PATCH__writable LV2_PATCH_PREFIX "writable" ///< http://lv2plug.in/ns/ext/patch#writable
#endif /* LV2_PATCH_H */
// clang-format on
/**
@}
*/
#endif /* LV2_PATCH_H */

View file

@ -1,402 +0,0 @@
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix patch: <http://lv2plug.in/ns/ext/patch#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<http://lv2plug.in/ns/ext/patch>
a owl:Ontology ;
rdfs:seeAlso <patch.h> ,
<lv2-patch.doap.ttl> ;
lv2:documentation """
<p>This vocabulary defines messages which can be used to access and manipulate
properties. It is designed to provide a dynamic control interface for LV2
plugins, but is useful in many contexts.</p>
<p>The main feature of this design is that the messages themselves are
described in the same format as the data they work with. In particular,
messages can be serialised as a binary <a
href="atom.html#Object">Object</a> or in Turtle (or any other RDF
serialisation).</p>
<p>The idea behind using a property-based interface for control is to prevent
an an explosion of message types. Instead of a custom message for each action,
control is achieved via manipulating properties (which are likely already
defined for other reasons). Note, however, that this is purely conceptual;
there is no requirement that the receiver actually implement a store of
resources with properties.</p>
<p>For example, consider an object that can blink. Rather than define a
specific interface to control this (e.g. <code>obj.start_blinking();
obj.stop_blinking()</code>), set a <q>blinking</q> property to true or false
(e.g. <code>obj.set(blinking, true)</code>) to achieve the desired behaviour.
One benefit of this approach is that a persistent state model is available
<q>for free</q>: simply serialise the <q>blinking</q> property.</p>
<p>This specification is strictly metadata and does not define any binary
mechanism, though it can be completely expressed by standard types in the <a
href="atom.html">LV2 Atom</a> extension. Thus, hosts can be expected
to be capable of transmitting it between plugins, or between a plugin and its
UI, making it a good choice for advanced plugin control.</p>
""" .
patch:Ack
a rdfs:Class ;
rdfs:subClassOf patch:Response ;
rdfs:label "Ack" ;
rdfs:comment """An acknowledgement that a request has been successfully processed. This is returned as a reply when a specific reply type is not necessary or appropriate. """ .
patch:Copy
a rdfs:Class ;
rdfs:subClassOf patch:Request ;
rdfs:label "Copy" ;
rdfs:subClassOf [
a owl:Restriction ;
owl:minCardinality 1 ;
owl:onProperty patch:subject
] , [
a owl:Restriction ;
owl:cardinality 1 ;
owl:onProperty patch:destination
] ;
rdfs:comment """Copy the patch:subject to patch:destination. After this, patch:destination has the description patch:subject had prior to this request's execution, and patch:subject is unchanged. It is an error if the subject does not exist or the destination already exists.
Multiple patch:subject properties may be given if the patch:destination is a container, the semantics of this use case are application defined.""" .
patch:Delete
a rdfs:Class ;
rdfs:subClassOf patch:Request ;
rdfs:label "Delete" ;
rdfs:comment "Request the subject(s) be deleted." .
patch:Error
a rdfs:Class ;
rdfs:subClassOf patch:Response ;
rdfs:label "Error" ;
rdfs:comment "A response indicating an error processing a request." .
patch:Get
a rdfs:Class ;
rdfs:subClassOf patch:Request ;
rdfs:label "Get" ;
rdfs:comment "Request a description of the subject." ;
lv2:documentation """
<p>Request a description of the subject.</p>
<p>The detail of the response is not specified, it may be a flat description of
all the properties of the subject, or a more expressive description with
several subjects. A good choice is a <q><a
href="http://www.w3.org/Submission/CBD/">concise bounded description</a></q>,
i.e. a description which recursively includes all properties with blank node
values.</p>
<p>The response should have the same patch:subject property as the request, and
a patch:body that is a description of that subject. For example:</p>
<pre class="turtle-code">
&lt;get-request&gt;
a patch:Get ;
patch:subject &lt;something&gt; .
</pre>
<p>Could result in:</p>
<pre class="turtle-code">
[]
a patch:Response ;
patch:request &lt;get-request&gt; ;
patch:subject &lt;something&gt; ;
patch:body [
eg:name "Something" ;
eg:ratio 1.6180339887 ;
] .
</pre>
<p>Note the use of blank nodes is not required; the value of patch:body may be
the actual resource node. Depending on the transport and syntax used this may
be preferable. For example, the same response could be written:</p>
<pre class="turtle-code">
&lt;something&gt;
eg:name "Something" ;
eg:ratio 1.6180339887 .
[]
a patch:Response ;
patch:request &lt;get-request&gt; ;
patch:subject &lt;something&gt; ;
patch:body &lt;something&gt; .
</pre>
<p>If the patch:subject property is absent, then the Get implicitly applies to
the receiver.</p>
""" .
patch:Insert
a rdfs:Class ;
rdfs:subClassOf patch:Request ;
rdfs:label "Insert" ;
rdfs:subClassOf [
a owl:Restriction ;
owl:cardinality 1 ;
owl:onProperty patch:subject
] ;
rdfs:comment """Insert the patch:body at patch:subject. If the subject does not exist, it is created. If the subject does already exist, it is added to. This request only adds properties, it never removes them. The user must take care that multiple values are not set for properties which should only have one value.""" .
patch:Message
a rdfs:Class ;
rdfs:label "Patch Message" .
patch:Move
a rdfs:Class ;
rdfs:subClassOf patch:Request ;
rdfs:label "Move" ;
rdfs:subClassOf [
a owl:Restriction ;
owl:cardinality 1 ;
owl:onProperty patch:subject
] , [
a owl:Restriction ;
owl:cardinality 1 ;
owl:onProperty patch:destination
] ;
rdfs:comment "Move the patch:subject to patch:destination. After this, patch:destination has the description patch:subject had prior to this request's execution, and patch:subject no longer exists. It is an error if the subject does not exist or the destination already exists." .
patch:Patch
a rdfs:Class ;
rdfs:subClassOf patch:Request ,
[
a owl:Restriction ;
owl:minCardinality 1 ;
owl:onProperty patch:subject
] ;
rdfs:label "Patch" ;
rdfs:comment "Add and/or remove properties of the subject." ;
lv2:documentation """
<p>Add and/or remove properties of the subject.</p>
<p>This method always has at least one patch:subject, and exactly one patch:add
and patch:remove property. The value of patch:add and patch:remove are nodes
which have the properties to add or remove from the subject(s), respectively.
The special value patch:wildcard may be used as the value of a remove property
to remove all properties with the given predicate. For example:</p>
<pre class="turtle-code">
[]
a patch:Patch ;
patch:subject &lt;something&gt; ;
patch:add [
eg:name "New name" ;
eg:age 42 ;
] ;
patch:remove [
eg:name "Old name" ;
eg:age patch:wildcard ; # Remove all old eg:age properties
] .
</pre>
""" .
patch:Put
a rdfs:Class ;
rdfs:subClassOf patch:Request ;
rdfs:label "Put" ;
rdfs:subClassOf [
a owl:Restriction ;
owl:cardinality 1 ;
owl:onProperty patch:subject
] ;
lv2:documentation """<p>Put the patch:body as the patch:subject. If the subject does not already exist, it is created. If the subject does already exist, the patch:body is considered an updated version of it, and the previous version is replaced.</p>
<pre class="turtle-code">
[]
a patch:Put ;
patch:subject &lt;something&gt; ;
patch:body [
eg:name "New name" ;
eg:age 42 ;
] .
</pre>
""" .
patch:Request
a rdfs:Class ;
rdfs:label "Request" ;
rdfs:subClassOf patch:Message ;
rdfs:comment """A request. A request may have a patch:subject property, which indicates which resource the request applies to. The subject may be omitted in contexts where it is implicit (e.g. the recipient is the subject).""" .
patch:Response
a rdfs:Class ;
rdfs:subClassOf patch:Message ;
rdfs:label "Response" ;
rdfs:comment "A response to a message." .
patch:Set
a rdfs:Class ;
rdfs:label "Set" ;
rdfs:subClassOf patch:Request ,
[
a owl:Restriction ;
owl:cardinality 1 ;
owl:onProperty patch:property
] , [
a owl:Restriction ;
owl:cardinality 1 ;
owl:onProperty patch:value
] ;
rdfs:comment "Set one property to a specific value." ;
lv2:documentation """
<p>A compact message for setting one property to a specific value.</p>
<p>This is equivalent to a patch:Patch which removes <em>all</em> pre-existing
values for the property before setting the new value. For example:</p>
<pre class="turtle-code">
[]
a patch:Set ;
patch:subject &lt;something&gt; ;
patch:property eg:name ;
patch:value "New name" .
</pre>
<p>Which is equivalent to:</p>
<pre class="turtle-code">
[]
a patch:Patch ;
patch:subject &lt;something&gt; ;
patch:add [
eg:name "New name" ;
] ;
patch:remove [
eg:name patch:wildcard ;
] .
</pre>
""" .
patch:accept
a rdf:Property ;
rdfs:label "accept" ;
rdfs:domain patch:Request ;
rdfs:range rdfs:Class ;
rdfs:comment "An accepted type for a response." .
patch:add
a rdf:Property ,
owl:ObjectProperty ,
owl:FunctionalProperty ;
rdfs:domain patch:Message .
patch:body
a rdf:Property ,
owl:ObjectProperty ,
owl:FunctionalProperty ;
rdfs:domain patch:Message ;
rdfs:comment """The body of a message.
The details of this property's value depend on the type of message it is a
part of.""" .
patch:context
a rdf:Property ,
owl:ObjectProperty ;
rdfs:domain patch:Message ;
rdfs:comment """The context of properties in this message.
For example, a plugin may have a special context for ephemeral properties which
are only relevant during the lifetime of the instance and should not be saved
in state.
The specific uses for contexts are application specific. However, the context
MUST be a URI, and can be interpreted as the ID of a data model where
properties should be stored. Implementations MAY have special support for
contexts, for example by storing in a quad store or serializing to a format
that supports multiple RDF graphs such as TriG.
""" .
patch:destination
a rdf:Property ,
owl:ObjectProperty ,
owl:FunctionalProperty ;
rdfs:domain patch:Message .
patch:property
a rdf:Property ;
rdfs:label "property" ;
rdfs:domain patch:Set ;
rdfs:range rdf:Property ;
rdfs:comment "The property for a Set message." .
patch:readable
a rdf:Property ;
rdfs:label "readable" ;
rdfs:range rdf:Property ;
rdfs:comment """Indicates that the subject may have a property that can be read via a
patch:Get message. See the similar property patch:writable for details.""" .
patch:remove
a rdf:Property ,
owl:ObjectProperty ,
owl:FunctionalProperty ;
rdfs:label "remove" ;
rdfs:domain patch:Message .
patch:request
a rdf:Property ,
owl:ObjectProperty ,
owl:FunctionalProperty ;
rdfs:label "request" ;
rdfs:domain patch:Response ;
rdfs:range patch:Request ;
rdfs:comment """The request this is a response to. This can be used if referring directly to the URI or blank node ID of the request is possible. Otherwise, use patch:sequenceNumber.""" .
patch:sequenceNumber
a rdf:Property ,
owl:ObjectProperty ,
owl:FunctionalProperty ;
rdfs:label "sequence number" ;
rdfs:domain patch:Message ;
rdfs:range xsd:int ;
rdfs:comment """The sequence number of a request or response. This property is used to associate replies with requests when it is not feasible to refer to request URIs with patch:request. A patch:Response with a given sequence number is the reply to the previously send patch:Request with the same sequence number.
The special sequence number 0 means no reply is desired. """ .
patch:subject
a rdf:Property ,
owl:ObjectProperty ,
owl:FunctionalProperty ;
rdfs:domain patch:Message ;
rdfs:comment "The subject this message applies to." .
patch:value
a rdf:Property ;
rdfs:label "value" ;
rdfs:domain patch:Set ;
rdfs:range rdf:Property ;
rdfs:comment "The value of a property in a patch:Set message." .
patch:wildcard
a rdfs:Resource ;
rdfs:comment """A wildcard which matches any resource. This makes it possible to describe the removal of all values for a given property.""" .
patch:writable
a rdf:Property ;
rdfs:label "writable" ;
rdfs:range rdf:Property ;
lv2:documentation """
<p>Indicates that subject may have a property that can be written via a patch
message. This is used to list supported properties, e.g. so user interfaces
can present appropriate controls. For example:</p>
<pre class="turtle-code">
@prefix eg: &lt;http://example.org/&gt; .
@prefix rdf: &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt; .
@prefix rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt; .
eg:title
a rdf:Property ;
rdfs:label "title" ;
rdfs:range xsd:string .
eg:plugin
patch:writable eg:title .
</pre>
""" .

View file

@ -1,43 +0,0 @@
@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/port-groups>
a doap:Project ;
doap:license <http://opensource.org/licenses/isc> ;
doap:name "LV2 Port Groups" ;
doap:shortdesc "Multi-channel groups of LV2 ports." ;
doap:created "2008-00-00" ;
doap:developer <http://lv2plug.in/ns/meta#larsl> ,
<http://drobilla.net/drobilla#me> ;
doap:release [
doap:revision "1.3" ;
doap:created "2019-04-27" ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Replace broken links with detailed Ambisonic channel descriptions."
]
]
] , [
doap:revision "1.2" ;
doap:created "2012-10-14" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.2.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Use consistent label style."
]
]
] , [
doap:revision "1.0" ;
doap:created "2012-04-17" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Initial release."
]
]
] .

View file

@ -1,9 +0,0 @@
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/port-groups>
a lv2:Specification ;
lv2:minorVersion 1 ;
lv2:microVersion 3 ;
rdfs:seeAlso <port-groups.ttl> .

View file

@ -1,30 +1,21 @@
/*
Copyright 2012-2016 David Robillard <http://drobilla.net>
// Copyright 2012-2016 David Robillard <d@drobilla.net>
// SPDX-License-Identifier: ISC
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef LV2_PORT_GROUPS_H
#define LV2_PORT_GROUPS_H
/**
@defgroup port-groups Port Groups
@ingroup lv2
Multi-channel groups of LV2 ports, see
<http://lv2plug.in/ns/ext/port-groups> for details.
Multi-channel groups of LV2 ports.
See <http://lv2plug.in/ns/ext/port-groups> for details.
@{
*/
#ifndef LV2_PORT_GROUPS_H
#define LV2_PORT_GROUPS_H
// clang-format off
#define LV2_PORT_GROUPS_URI "http://lv2plug.in/ns/ext/port-groups" ///< http://lv2plug.in/ns/ext/port-groups
#define LV2_PORT_GROUPS_PREFIX LV2_PORT_GROUPS_URI "#" ///< http://lv2plug.in/ns/ext/port-groups#
@ -64,8 +55,10 @@
#define LV2_PORT_GROUPS__source LV2_PORT_GROUPS_PREFIX "source" ///< http://lv2plug.in/ns/ext/port-groups#source
#define LV2_PORT_GROUPS__subGroupOf LV2_PORT_GROUPS_PREFIX "subGroupOf" ///< http://lv2plug.in/ns/ext/port-groups#subGroupOf
#endif /* LV2_PORT_GROUPS_H */
// clang-format on
/**
@}
*/
#endif /* LV2_PORT_GROUPS_H */

View file

@ -1,749 +0,0 @@
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix pg: <http://lv2plug.in/ns/ext/port-groups#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<http://lv2plug.in/ns/ext/port-groups>
a owl:Ontology ;
rdfs:seeAlso <lv2-port-groups.doap.ttl> .
pg:Group
a rdfs:Class ;
rdfs:label "Port Group" ;
rdfs:subClassOf [
a owl:Restriction ;
owl:onProperty lv2:symbol ;
owl:cardinality 1 ;
rdfs:comment """A pg:Group MUST have exactly one string lv2:symbol.
This symbol must be unique according to the same rules as the lv2:symbol for an lv2:Port, where group symbols and port symbols reside in the same namespace. In other words, a group on a plugin MUST NOT have the same symbol as another group or a port on that plugin. This makes it possible to uniquely reference a port or group on a plugin with a single identifier and no context."""
] ;
rdfs:comment """A set of ports/channels/controls/etc that are are logically grouped together,
e.g. two audio ports in a group may form a stereo stream.
In order to avoid the need to define large numbers of identical group definitions, a group definition may be shared. For example, a plugin collection may define a single URI for a pg:StereoGroup with the symbol "input" and use it in many plugins.""" .
pg:InputGroup
a rdfs:Class ;
rdfs:subClassOf pg:Group ;
rdfs:label "Input Group" ;
rdfs:comment "A group which contains exclusively inputs." .
pg:OutputGroup
a rdfs:Class ;
rdfs:subClassOf pg:Group ;
rdfs:label "Output Group" ;
rdfs:comment "A group which contains exclusively outputs." .
pg:Element
a rdfs:Class ;
rdfs:label "Element" ;
rdfs:comment "An ordered element of a group." ;
rdfs:subClassOf [
a owl:Restriction ;
owl:onProperty lv2:designation ;
owl:cardinality 1 ;
rdfs:comment "An element MUST have exactly one lv2:designation."
] ;
rdfs:comment "An element of a group, which has a designation and an optional index." .
pg:element
a rdf:Property ,
owl:ObjectProperty ;
rdfs:range pg:Element ;
rdfs:label "element" ;
rdfs:comment """Indicates that a group has a certain element (a parameter or channel designation with a possible index).""" .
pg:sideChainOf
a rdf:Property ,
owl:ObjectProperty ;
rdfs:label "side-chain of" ;
rdfs:comment """Indicates that this port or group should be considered a "side chain" of some other port or group. The precise definition of "side chain" depends on the plugin, but in general this group should be considered a modifier to some other group, rather than an independent input itself.""" .
pg:subGroupOf
a rdf:Property ,
owl:ObjectProperty ,
owl:FunctionalProperty ;
rdfs:domain pg:Group ;
rdfs:range pg:Group ;
rdfs:label "sub-group of" ;
rdfs:comment """Indicates that this group is a child of another group. This property has no meaning with respect to plugin execution, but the host may find this information useful (e.g. to provide a compact user interface). Note that being a sub-group does not relax the restriction that the group MUST have a unique symbol with respect to the plugin.""" .
pg:source
a rdf:Property ,
owl:ObjectProperty ;
rdfs:domain pg:OutputGroup ;
rdfs:range pg:InputGroup ;
rdfs:label "source" ;
rdfs:comment """Indicates that this port or group should be considered the "result" of some other port or group. This property only makes sense on groups with outputs when the source is a group with inputs. This can be used to convey a relationship between corresponding input and output groups with different types, e.g. a mono->stereo plugin.""" .
pg:mainInput
a rdf:Property ,
owl:ObjectProperty ,
owl:FunctionalProperty ;
rdfs:domain lv2:Plugin ;
rdfs:range pg:InputGroup ;
rdfs:label "main input" ;
rdfs:comment """Indicates that this group should be considered the "main" input, i.e. the primary task is processing the signal in this group. A plugin MUST NOT have more than one pg:mainInput property.""" .
pg:mainOutput
a rdf:Property ,
owl:ObjectProperty ,
owl:FunctionalProperty ;
rdfs:domain lv2:Plugin ;
rdfs:range pg:OutputGroup ;
rdfs:label "main output" ;
rdfs:comment """Indicates that this group should be considered the "main" output. The main output group SHOULD have the main input group as a pg:source.""" .
pg:group
a rdf:Property ,
owl:ObjectProperty ,
owl:FunctionalProperty ;
rdfs:domain lv2:Port ;
rdfs:range pg:Group ;
rdfs:label "group" ;
rdfs:comment """Indicates that this port is a part of a group of ports on the plugin. The port should also have an lv2:designation property to define its designation within that group.""" .
pg:DiscreteGroup
a rdfs:Class ;
rdfs:subClassOf pg:Group ;
rdfs:comment """Discrete channel configurations. These groups are divided into channels where each represents a particular speaker location. The position of sound in one of these groups depends on a particular speaker configuration.""" .
pg:left
a lv2:Channel ;
rdfs:label "left" .
pg:right
a lv2:Channel ;
rdfs:label "right" .
pg:center
a lv2:Channel ;
rdfs:label "center" .
pg:side
a lv2:Channel ;
rdfs:label "side" .
pg:centerLeft
a lv2:Channel ;
rdfs:label "center left" .
pg:centerRight
a lv2:Channel ;
rdfs:label "center right" .
pg:sideLeft
a lv2:Channel ;
rdfs:label "side left" .
pg:sideRight
a lv2:Channel ;
rdfs:label "side right" .
pg:rearLeft
a lv2:Channel ;
rdfs:label "rear left" .
pg:rearRight
a lv2:Channel ;
rdfs:label "rear right" .
pg:rearCenter
a lv2:Channel ;
rdfs:label "rear center" .
pg:lowFrequencyEffects
a lv2:Channel ;
rdfs:label "low-frequency effects" .
pg:MonoGroup
a rdfs:Class ;
rdfs:subClassOf pg:DiscreteGroup ;
rdfs:label "Mono" ;
pg:element [
lv2:index 0 ;
lv2:designation pg:center
] .
pg:StereoGroup
a rdfs:Class ;
rdfs:subClassOf pg:DiscreteGroup ;
rdfs:label "Stereo" ;
pg:element [
lv2:index 0 ;
lv2:designation pg:left
] , [
lv2:index 1 ;
lv2:designation pg:right
] .
pg:MidSideGroup
a rdfs:Class ;
rdfs:subClassOf pg:DiscreteGroup ;
rdfs:label "Mid-Side Stereo" ;
pg:element [
lv2:index 0 ;
lv2:designation pg:center
] , [
lv2:index 1 ;
lv2:designation pg:side
] .
pg:ThreePointZeroGroup
a rdfs:Class ;
rdfs:subClassOf pg:DiscreteGroup ;
rdfs:label "3.0 Surround" ;
pg:element [
lv2:index 0 ;
lv2:designation pg:left
] , [
lv2:index 1 ;
lv2:designation pg:right
] , [
lv2:index 2 ;
lv2:designation pg:rearCenter
] .
pg:FourPointZeroGroup
a rdfs:Class ;
rdfs:subClassOf pg:DiscreteGroup ;
rdfs:label "4.0 Surround (Quadraphonic)" ;
pg:element [
lv2:index 0 ;
lv2:designation pg:left
] , [
lv2:index 1 ;
lv2:designation pg:center
] , [
lv2:index 2 ;
lv2:designation pg:right
] , [
lv2:index 3 ;
lv2:designation pg:rearCenter
] .
pg:FivePointZeroGroup
a rdfs:Class ;
rdfs:subClassOf pg:DiscreteGroup ;
rdfs:label "5.0 Surround (3-2 stereo)" ;
pg:element [
lv2:index 0 ;
lv2:designation pg:left
] , [
lv2:index 1 ;
lv2:designation pg:center
] , [
lv2:index 2 ;
lv2:designation pg:right
] , [
lv2:index 3 ;
lv2:designation pg:rearLeft
] , [
lv2:index 4 ;
lv2:designation pg:rearRight
] .
pg:FivePointOneGroup
a rdfs:Class ;
rdfs:subClassOf pg:DiscreteGroup ;
rdfs:label "5.1 Surround (3-2 stereo)" ;
pg:element [
lv2:index 0 ;
lv2:designation pg:left
] , [
lv2:index 1 ;
lv2:designation pg:center
] , [
lv2:index 2 ;
lv2:designation pg:right
] , [
lv2:index 3 ;
lv2:designation pg:rearLeft
] , [
lv2:index 4 ;
lv2:designation pg:rearRight
] , [
lv2:index 5 ;
lv2:designation pg:lowFrequencyEffects
] .
pg:SixPointOneGroup
a rdfs:Class ;
rdfs:subClassOf pg:DiscreteGroup ;
rdfs:label "6.1 Surround" ;
pg:element [
lv2:index 0 ;
lv2:designation pg:left
] , [
lv2:index 1 ;
lv2:designation pg:center
] , [
lv2:index 2 ;
lv2:designation pg:right
] , [
lv2:index 3 ;
lv2:designation pg:sideLeft
] , [
lv2:index 4 ;
lv2:designation pg:sideRight
] , [
lv2:index 5 ;
lv2:designation pg:rearCenter
] , [
lv2:index 6 ;
lv2:designation pg:lowFrequencyEffects
] .
pg:SevenPointOneGroup
a rdfs:Class ;
rdfs:subClassOf pg:DiscreteGroup ;
rdfs:label "7.1 Surround" ;
pg:element [
lv2:index 0 ;
lv2:designation pg:left
] , [
lv2:index 1 ;
lv2:designation pg:center
] , [
lv2:index 2 ;
lv2:designation pg:right
] , [
lv2:index 3 ;
lv2:designation pg:sideLeft
] , [
lv2:index 4 ;
lv2:designation pg:sideRight
] , [
lv2:index 5 ;
lv2:designation pg:rearLeft
] , [
lv2:index 6 ;
lv2:designation pg:rearRight
] , [
lv2:index 7 ;
lv2:designation pg:lowFrequencyEffects
] .
pg:SevenPointOneWideGroup
a rdfs:Class ;
rdfs:subClassOf pg:DiscreteGroup ;
rdfs:label "7.1 Surround (Wide)" ;
pg:element [
lv2:index 0 ;
lv2:designation pg:left
] , [
lv2:index 1 ;
lv2:designation pg:centerLeft
] , [
lv2:index 2 ;
lv2:designation pg:center
] , [
lv2:index 3 ;
lv2:designation pg:centerRight
] , [
lv2:index 4 ;
lv2:designation pg:right
] , [
lv2:index 5 ;
lv2:designation pg:rearLeft
] , [
lv2:index 6 ;
lv2:designation pg:rearRight
] , [
lv2:index 7 ;
lv2:designation pg:lowFrequencyEffects
] .
pg:letterCode
a rdf:Property ,
owl:DatatypeProperty ,
owl:InverseFunctionalProperty ;
rdfs:domain lv2:Channel ;
rdfs:range rdf:PlainLiteral ;
rdfs:label "ambisonic letter code" ;
rdfs:comment "The YuMa letter code for an Ambisonic channel." .
pg:harmonicDegree
a rdf:Property ,
owl:DatatypeProperty ;
rdfs:domain lv2:Channel ;
rdfs:range xsd:integer ;
rdfs:label "harmonic degree" ;
rdfs:comment """The degree coefficient (l) of the spherical harmonic for
an Ambisonic channel.
""" .
pg:harmonicIndex
a rdf:Property ,
owl:DatatypeProperty ;
rdfs:domain lv2:Channel ;
rdfs:range xsd:integer ;
rdfs:label "harmonic index" ;
rdfs:comment """The index coefficient (m) of the spherical harmonic for
an Ambisonic channel.
""" .
pg:ACN0
a lv2:Channel ;
pg:letterCode "W" ;
pg:harmonicDegree 0 ;
pg:harmonicIndex 0 .
pg:ACN1
a lv2:Channel ;
pg:letterCode "Y" ;
pg:harmonicDegree 1 ;
pg:harmonicIndex -1 .
pg:ACN2
a lv2:Channel ;
pg:letterCode "Z" ;
pg:harmonicDegree 1 ;
pg:harmonicIndex 0 .
pg:ACN3
a lv2:Channel ;
pg:letterCode "X" ;
pg:harmonicDegree 1 ;
pg:harmonicIndex 1 .
pg:ACN4
a lv2:Channel ;
pg:letterCode "V" ;
pg:harmonicDegree 2 ;
pg:harmonicIndex -2 .
pg:ACN5
a lv2:Channel ;
pg:letterCode "T" ;
pg:harmonicDegree 2 ;
pg:harmonicIndex -1 .
pg:ACN6
a lv2:Channel ;
pg:letterCode "R" ;
pg:harmonicDegree 2 ;
pg:harmonicIndex 0 .
pg:ACN7
a lv2:Channel ;
pg:letterCode "S" ;
pg:harmonicDegree 2 ;
pg:harmonicIndex 1 .
pg:ACN8
a lv2:Channel ;
pg:letterCode "U" ;
pg:harmonicDegree 2 ;
pg:harmonicIndex 2 .
pg:ACN9
a lv2:Channel ;
pg:letterCode "Q" ;
pg:harmonicDegree 3 ;
pg:harmonicIndex -3 .
pg:ACN10
a lv2:Channel ;
pg:letterCode "O" ;
pg:harmonicDegree 3 ;
pg:harmonicIndex -2 .
pg:ACN11
a lv2:Channel ;
pg:letterCode "M" ;
pg:harmonicDegree 3 ;
pg:harmonicIndex -1 .
pg:ACN12
a lv2:Channel ;
pg:letterCode "K" ;
pg:harmonicDegree 3 ;
pg:harmonicIndex 0 .
pg:ACN13
a lv2:Channel ;
pg:letterCode "L" ;
pg:harmonicDegree 3 ;
pg:harmonicIndex 1 .
pg:ACN14
a lv2:Channel ;
pg:letterCode "N" ;
pg:harmonicDegree 3 ;
pg:harmonicIndex 2 .
pg:ACN15
a lv2:Channel ;
pg:letterCode "P" ;
pg:harmonicDegree 3 ;
pg:harmonicIndex 3 .
pg:AmbisonicGroup
a rdfs:Class ;
rdfs:subClassOf pg:Group ;
rdfs:comment """Ambisonic channel configurations. These groups are divided into channels which together represent a position in an abstract n-dimensional space. The position of sound in one of these groups does not depend on a particular speaker configuration; a decoder can be used to convert an ambisonic stream for any speaker configuration.""" .
pg:AmbisonicBH1P0Group
a rdfs:Class ;
rdfs:subClassOf pg:AmbisonicGroup ;
rdfs:label "Ambisonic B stream of horizontal order 1 and peripheral order 0." ;
pg:element [
lv2:index 0 ;
lv2:designation pg:ACN0
] , [
lv2:index 1 ;
lv2:designation pg:ACN1
] , [
lv2:index 2 ;
lv2:designation pg:ACN3
] .
pg:AmbisonicBH1P1Group
a rdfs:Class ;
rdfs:subClassOf pg:AmbisonicGroup ;
rdfs:label "Ambisonic B stream of horizontal order 1 and peripheral order 1." ;
pg:element [
lv2:index 0 ;
lv2:designation pg:ACN0
] , [
lv2:index 1 ;
lv2:designation pg:ACN1
] , [
lv2:index 2 ;
lv2:designation pg:ACN2
] , [
lv2:index 3 ;
lv2:designation pg:ACN3
] .
pg:AmbisonicBH2P0Group
a rdfs:Class ;
rdfs:subClassOf pg:AmbisonicGroup ;
rdfs:label "Ambisonic B stream of horizontal order 2 and peripheral order 0." ;
pg:element [
lv2:index 0 ;
lv2:designation pg:ACN0
] , [
lv2:index 1 ;
lv2:designation pg:ACN1
] , [
lv2:index 2 ;
lv2:designation pg:ACN3
] , [
lv2:index 3 ;
lv2:designation pg:ACN4
] , [
lv2:index 4 ;
lv2:designation pg:ACN8
] .
pg:AmbisonicBH2P1Group
a rdfs:Class ;
rdfs:subClassOf pg:AmbisonicGroup ;
rdfs:label "Ambisonic B stream of horizontal order 2 and peripheral order 1." ;
pg:element [
lv2:index 0 ;
lv2:designation pg:ACN0
] , [
lv2:index 1 ;
lv2:designation pg:ACN1
] , [
lv2:index 2 ;
lv2:designation pg:ACN2
] , [
lv2:index 3 ;
lv2:designation pg:ACN3
] , [
lv2:index 4 ;
lv2:designation pg:ACN4
] , [
lv2:index 5 ;
lv2:designation pg:ACN8
] .
pg:AmbisonicBH2P2Group
a rdfs:Class ;
rdfs:subClassOf pg:AmbisonicGroup ;
rdfs:label "Ambisonic B stream of horizontal order 2 and peripheral order 2." ;
pg:element [
lv2:index 0 ;
lv2:designation pg:ACN0
] , [
lv2:index 1 ;
lv2:designation pg:ACN1
] , [
lv2:index 2 ;
lv2:designation pg:ACN2
] , [
lv2:index 3 ;
lv2:designation pg:ACN3
] , [
lv2:index 4 ;
lv2:designation pg:ACN4
] , [
lv2:index 5 ;
lv2:designation pg:ACN5
] , [
lv2:index 6 ;
lv2:designation pg:ACN6
] , [
lv2:index 7 ;
lv2:designation pg:ACN7
] , [
lv2:index 8 ;
lv2:designation pg:ACN8
] .
pg:AmbisonicBH3P0Group
a rdfs:Class ;
rdfs:subClassOf pg:AmbisonicGroup ;
rdfs:label "Ambisonic B stream of horizontal order 3 and peripheral order 0." ;
pg:element [
lv2:index 0 ;
lv2:designation pg:ACN0
] , [
lv2:index 1 ;
lv2:designation pg:ACN1
] , [
lv2:index 2 ;
lv2:designation pg:ACN3
] , [
lv2:index 3 ;
lv2:designation pg:ACN4
] , [
lv2:index 4 ;
lv2:designation pg:ACN8
] , [
lv2:index 5 ;
lv2:designation pg:ACN9
] , [
lv2:index 6 ;
lv2:designation pg:ACN15
] .
pg:AmbisonicBH3P1Group
a rdfs:Class ;
rdfs:subClassOf pg:AmbisonicGroup ;
rdfs:label "Ambisonic B stream of horizontal order 3 and peripheral order 1." ;
pg:element [
lv2:index 0 ;
lv2:designation pg:ACN0
] , [
lv2:index 1 ;
lv2:designation pg:ACN1
] , [
lv2:index 2 ;
lv2:designation pg:ACN2
] , [
lv2:index 3 ;
lv2:designation pg:ACN3
] , [
lv2:index 4 ;
lv2:designation pg:ACN4
] , [
lv2:index 5 ;
lv2:designation pg:ACN8
] , [
lv2:index 6 ;
lv2:designation pg:ACN9
] , [
lv2:index 7 ;
lv2:designation pg:ACN15
] .
pg:AmbisonicBH3P2Group
a rdfs:Class ;
rdfs:subClassOf pg:AmbisonicGroup ;
rdfs:label "Ambisonic B stream of horizontal order 3 and peripheral order 2." ;
pg:element [
lv2:index 0 ;
lv2:designation pg:ACN0
] , [
lv2:index 1 ;
lv2:designation pg:ACN1
] , [
lv2:index 2 ;
lv2:designation pg:ACN2
] , [
lv2:index 3 ;
lv2:designation pg:ACN3
] , [
lv2:index 4 ;
lv2:designation pg:ACN4
] , [
lv2:index 5 ;
lv2:designation pg:ACN5
] , [
lv2:index 6 ;
lv2:designation pg:ACN6
] , [
lv2:index 7 ;
lv2:designation pg:ACN7
] , [
lv2:index 8 ;
lv2:designation pg:ACN8
] , [
lv2:index 9 ;
lv2:designation pg:ACN9
] , [
lv2:index 10 ;
lv2:designation pg:ACN15
] .
pg:AmbisonicBH3P3Group
a rdfs:Class ;
rdfs:subClassOf pg:AmbisonicGroup ;
rdfs:label "Ambisonic B stream of horizontal order 3 and peripheral order 3." ;
pg:element [
lv2:index 0 ;
lv2:designation pg:ACN0
] , [
lv2:index 1 ;
lv2:designation pg:ACN1
] , [
lv2:index 2 ;
lv2:designation pg:ACN2
] , [
lv2:index 3 ;
lv2:designation pg:ACN3
] , [
lv2:index 4 ;
lv2:designation pg:ACN4
] , [
lv2:index 5 ;
lv2:designation pg:ACN5
] , [
lv2:index 6 ;
lv2:designation pg:ACN6
] , [
lv2:index 7 ;
lv2:designation pg:ACN7
] , [
lv2:index 8 ;
lv2:designation pg:ACN8
] , [
lv2:index 9 ;
lv2:designation pg:ACN9
] , [
lv2:index 10 ;
lv2:designation pg:ACN10
] , [
lv2:index 11 ;
lv2:designation pg:ACN11
] , [
lv2:index 12 ;
lv2:designation pg:ACN12
] , [
lv2:index 13 ;
lv2:designation pg:ACN13
] , [
lv2:index 14 ;
lv2:designation pg:ACN14
] , [
lv2:index 15 ;
lv2:designation pg:ACN15
] .

View file

@ -1,33 +0,0 @@
@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/port-props>
a doap:Project ;
doap:name "LV2 Port Properties" ;
doap:created "2009-01-01" ;
doap:shortdesc "Various port properties." ;
doap:maintainer <http://drobilla.net/drobilla#me> ;
doap:developer <http://lv2plug.in/ns/meta#kfoltman> ;
doap:release [
doap:revision "1.2" ;
doap:created "2012-10-14" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.2.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Use consistent label style."
]
]
] , [
doap:revision "1.0" ;
doap:created "2012-04-17" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Initial release."
]
]
] .

View file

@ -1,8 +0,0 @@
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/port-props>
a lv2:Specification ;
lv2:minorVersion 1 ;
lv2:microVersion 2 ;
rdfs:seeAlso <port-props.ttl> .

View file

@ -1,29 +1,19 @@
/*
Copyright 2012-2016 David Robillard <http://drobilla.net>
// Copyright 2012-2016 David Robillard <d@drobilla.net>
// SPDX-License-Identifier: ISC
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef LV2_PORT_PROPS_H
#define LV2_PORT_PROPS_H
/**
@defgroup port-props Port Properties
@ingroup lv2
Various port properties.
@{
*/
#ifndef LV2_PORT_PROPS_H
#define LV2_PORT_PROPS_H
// clang-format off
#define LV2_PORT_PROPS_URI "http://lv2plug.in/ns/ext/port-props" ///< http://lv2plug.in/ns/ext/port-props
#define LV2_PORT_PROPS_PREFIX LV2_PORT_PROPS_URI "#" ///< http://lv2plug.in/ns/ext/port-props#
@ -41,8 +31,10 @@
#define LV2_PORT_PROPS__supportsStrictBounds LV2_PORT_PROPS_PREFIX "supportsStrictBounds" ///< http://lv2plug.in/ns/ext/port-props#supportsStrictBounds
#define LV2_PORT_PROPS__trigger LV2_PORT_PROPS_PREFIX "trigger" ///< http://lv2plug.in/ns/ext/port-props#trigger
#endif /* LV2_PORT_PROPS_H */
// clang-format on
/**
@}
*/
#endif /* LV2_PORT_PROPS_H */

View file

@ -1,105 +0,0 @@
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix pprops: <http://lv2plug.in/ns/ext/port-props#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<http://lv2plug.in/ns/ext/port-props>
a owl:Ontology ;
rdfs:seeAlso <lv2-port-props.doap.ttl> ;
lv2:documentation """
<p>This vocabulary defines various properties for plugin ports, which can be
used to better describe how a plugin can be controlled. Using this metadata,
hosts can build better UIs for plugins, and provide more advanced automatic
functionality.</p>""" .
pprops:trigger
a lv2:PortProperty ;
rdfs:label "trigger" ;
rdfs:comment """Indicates that the data item corresponds to a momentary event that has been detected (control output ports) or is to be triggered (control input ports). For input ports, the port needs to be reset to lv2:default value after run() function of the plugin has returned. If the control port is assigned a GUI widget by the host, the widget should be of auto-off (momentary, one-shot) type - for example, a push button if the port is also declared as lv2:toggled, or a series of push button or auto-clear input box with a "Send" button if the port is also lv2:integer.""" .
pprops:supportsStrictBounds
a lv2:Feature ;
rdfs:label "supports strict bounds" ;
rdfs:comment """Indicates use of host support for pprops:hasStrictBounds port property. A plugin that specifies it as optional feature can omit value clamping for hasStrictBounds ports, if the feature is supported by the host. When specified as required feature, it indicates that the plugin does not do any clamping for input ports that have a pprops:hasStrictBounds property.""" .
pprops:hasStrictBounds
a lv2:PortProperty ;
rdfs:label "has strict bounds" ;
rdfs:comment """For hosts that support pprops:supportsStrictBounds, this indicates that the value of the port should never exceed the port's minimum and maximum control points. For input ports, it moves the responsibility for limiting the range of values to host, if it supports pprops:supportsStrictBounds. For output ports, it indicates that values within specified range are to be expected, and breaking that should be considered by the host as error in plugin implementation.""" .
pprops:expensive
a lv2:PortProperty ;
rdfs:label "changes are expensive" ;
rdfs:comment """Input ports only. Indicates that any changes to the port value may trigger expensive background calculation (e.g. regenerate some lookup tables in a background thread). Any value changes may have not have immediate effect, or may cause silence or diminished-quality version of the output until background processing is finished. Ports having this property are typically not well suited for connection to outputs of other plugins, and should not be offered as connection targets or for automation by default.""" .
pprops:causesArtifacts
a lv2:PortProperty ;
rdfs:label "changes cause artifacts" ;
rdfs:comment """Input ports only. Indicates that any changes to the port value may produce slight artifacts to produced audio signals (zipper noise and other results of signal discontinuities). Connecting ports of this type to continuous signals is not recommended, and when presenting a list of automation targets, those ports may be marked as artifact-producing.""" .
pprops:continuousCV
a lv2:PortProperty ;
rdfs:label "smooth modulation signal" ;
rdfs:comment """Indicates that the port carries a "smooth" modulation signal. Control input ports of this type are well-suited for being connected to sources of smooth signals (knobs with smoothing, modulation rate oscillators, output ports with continuousCV type, etc.). Typically, the plugin with ports which have this property will implement appropriate smoothing to avoid audio artifacts. For output ports, this property suggests the value of the port is likely to change frequently, and describes a smooth signal (e.g. successive values may be considered points along a curve).""" .
pprops:discreteCV
a lv2:PortProperty ;
rdfs:label "discrete modulation signal" ;
rdfs:comment """Indicates that the port carries a "discrete" modulation signal. Input ports of this type are well-suited for being connected to sources of discrete signals (switches, buttons, classifiers, event detectors, etc.). May be combined with pprops:trigger property. For output ports, this property suggests the value of the port describe discrete values that should be interpreted as steps (and not points along a curve).""" .
pprops:logarithmic
a lv2:PortProperty ;
rdfs:label "logarithmic scale" ;
rdfs:comment """Indicates that port value behaviour within specified range (bounds) is a value using logarithmic scale. The lower and upper bounds must be specified, and must be of the same sign.""" .
pprops:notAutomatic
a lv2:PortProperty ;
rdfs:label "not intended as a CV input" ;
rdfs:comment """Indicates that the port is not primarily intended to be fed with modulation signals from external sources (other plugins, etc.). It is merely a UI hint and hosts may allow the user to override it.""" .
pprops:notOnGUI
a lv2:PortProperty ;
rdfs:label "not on GUI" ;
rdfs:comment """Indicates that the port is not primarily intended to be represented by a separate control in the user interface window (or any similar mechanism used for direct, immediate control of control ports). It is merely a UI hint and hosts may allow the user to override it.""" .
pprops:displayPriority
a rdf:Property ;
rdfs:domain lv2:Port ;
rdfs:range xsd:nonNegativeInteger ;
rdfs:label "display priority" ;
rdfs:comment """Indicates how important a port is to controlling the plugin. If a host can only display some ports of a plugin, it should prefer ports with a higher display priority. Priorities do not need to be unique, and are only meaningful when compared to each other.""" .
pprops:rangeSteps
a rdf:Property ;
rdfs:domain lv2:Port ;
rdfs:range xsd:nonNegativeInteger ;
rdfs:label "number of value steps" ;
lv2:documentation """
<p>This value indicates into how many evenly-divided points the (control) port
range should be divided for step-wise control. This may be used for changing
the value with step-based controllers like arrow keys, mouse wheel, rotary
encoders, etc.</p>
<p>Note that when used with a pprops:logarithmic port, the steps are
logarithmic too, and port value can be calculated as:</p>
<pre class="c-code">
value = lower * pow(upper / lower, step / (steps - 1))
</pre>
<p>and the step from value is:</p>
<pre class="c-code">
step = (steps - 1) * log(value / lower) / log(upper / lower)
</pre>
<p>where:</p>
<ul>
<li><code>value</code> is the port value</li>
<li><code>step</code> is the step number (0..steps)</li>
<li><code>steps</code> is the number of steps (= value of :rangeSteps property)</li>
<li><code>lower</code> and <code>upper</code> are the bounds</li>
</ul>
""" .

View file

@ -1,61 +0,0 @@
@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/presets>
a doap:Project ;
doap:license <http://opensource.org/licenses/isc> ;
doap:name "LV2 Presets" ;
doap:shortdesc "Presets for LV2 plugins." ;
doap:created "2009-00-00" ;
doap:developer <http://drobilla.net/drobilla#me> ;
doap:release [
doap:revision "2.8" ;
doap:created "2012-10-14" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.2.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Use consistent label style."
] , [
rdfs:label "Add preset banks."
]
]
] , [
doap:revision "2.6" ;
doap:created "2012-04-17" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Add pset:preset property for describing the preset currently applied to a plugin instance."
] , [
rdfs:label "Remove pset:appliesTo property, use lv2:appliesTo instead."
] , [
rdfs:label "Merge with unified LV2 package."
]
]
] , [
doap:revision "2.2" ;
doap:created "2011-11-21" ;
doap:file-release <http://lv2plug.in/spec/lv2-presets-2.2.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Update packaging."
] , [
rdfs:label "Improve documentation."
]
]
] , [
doap:revision "2.0" ;
doap:created "2010-10-04" ;
doap:file-release <http://lv2plug.in/spec/lv2-presets-2.0.tar.gz> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Initial release."
]
]
] .

View file

@ -1,9 +0,0 @@
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/presets>
a lv2:Specification ;
lv2:minorVersion 2 ;
lv2:microVersion 8 ;
rdfs:seeAlso <presets.ttl> .

View file

@ -1,29 +1,21 @@
/*
Copyright 2012-2016 David Robillard <http://drobilla.net>
// Copyright 2012-2016 David Robillard <d@drobilla.net>
// SPDX-License-Identifier: ISC
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef LV2_PRESETS_H
#define LV2_PRESETS_H
/**
@defgroup presets Presets
@ingroup lv2
Presets for plugins, see <http://lv2plug.in/ns/ext/presets> for details.
Presets for plugins.
See <http://lv2plug.in/ns/ext/presets> for details.
@{
*/
#ifndef LV2_PRESETS_H
#define LV2_PRESETS_H
// clang-format off
#define LV2_PRESETS_URI "http://lv2plug.in/ns/ext/presets" ///< http://lv2plug.in/ns/ext/presets
#define LV2_PRESETS_PREFIX LV2_PRESETS_URI "#" ///< http://lv2plug.in/ns/ext/presets#
@ -34,8 +26,10 @@
#define LV2_PRESETS__preset LV2_PRESETS_PREFIX "preset" ///< http://lv2plug.in/ns/ext/presets#preset
#define LV2_PRESETS__value LV2_PRESETS_PREFIX "value" ///< http://lv2plug.in/ns/ext/presets#value
#endif /* LV2_PRESETS_H */
// clang-format on
/**
@}
*/
#endif /* LV2_PRESETS_H */

View file

@ -1,105 +0,0 @@
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix pset: <http://lv2plug.in/ns/ext/presets#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<http://lv2plug.in/ns/ext/presets>
a owl:Ontology ;
rdfs:seeAlso <lv2-presets.doap.ttl> ;
lv2:documentation """
<p>This vocabulary describes a format for presets (i.e. named sets of control
values and possibly other state) for LV2 plugins. The structure of a
pset:Preset is deliberately identical to that of an lv2:Plugin, and can be
thought of as a plugin template or overlay.</p>
<p>Presets may be defined in any bundle, including the plugin's bundle,
separate third party preset bundles, or user preset bundles saved by hosts.
Since preset data tends to be large, it is recommended that plugins describe
presets in a separate file(s) to avoid slowing down hosts. The manifest.ttl of
a bundle containing presets should list the presets like so:</p>
<pre class="turtle-code">
eg:mypreset
a pset:Preset ;
lv2:appliesTo eg:myplugin ;
rdfs:seeAlso &lt;mypreset.ttl&gt; .
</pre>
""" .
pset:Bank
a rdfs:Class ;
rdfs:label "Bank" ;
rdfs:subClassOf [
a owl:Restriction ;
owl:onProperty rdfs:label ;
owl:someValuesFrom xsd:string ;
rdfs:comment "A Bank MUST have at least one string rdfs:label."
] ;
rdfs:comment "A bank of presets." .
pset:Preset
a rdfs:Class ;
rdfs:subClassOf lv2:PluginBase ;
rdfs:label "Preset" ;
rdfs:subClassOf [
a owl:Restriction ;
owl:onProperty rdfs:label ;
owl:someValuesFrom xsd:string ;
rdfs:comment "A Preset MUST have at least one string rdfs:label."
] ;
lv2:documentation """
<p>A Preset for an LV2 Plugin. The structure of a Preset deliberately mirrors that
of a plugin, so existing predicates can be used to describe any data associated with
the preset. For example:</p>
<pre class="turtle-code">
@prefix eg: &lt;http://example.org/&gt; .
eg:mypreset
a pset:Preset ;
rdfs:label "One louder" ;
lv2:appliesTo eg:myplugin ;
lv2:port [
lv2:symbol "volume1" ;
pset:value 11.0
] , [
lv2:symbol "volume2" ;
pset:value 11.0
] .
</pre>
<p>A Preset SHOULD have at least one lv2:appliesTo property. Each Port on a
Preset MUST have at least a lv2:symbol property and a pset:value property.</p>
<p>Hosts SHOULD save user presets to a bundle in the user-local LV2 directory
(e.g. ~/.lv2) with a name like
<code>&lt;Plugin_Name&gt;_&lt;Preset_Name&gt;.preset.lv2</code>
(e.g. <code>LV2_Amp_At_Eleven.preset.lv2</code>), where names are transformed
to be valid LV2 symbols for maximum compatibility.</p>
""" .
pset:bank
a rdf:Property ;
rdfs:domain pset:Preset ;
rdfs:range pset:Bank ;
rdfs:label "bank" ;
rdfs:comment "The bank this preset belongs to." .
pset:value
a rdf:Property ;
rdfs:domain lv2:PortBase ;
rdfs:label "value" ;
rdfs:comment """Specifies the value of a Port on some Preset. This property is used in a similar way to e.g. lv2:default.""" .
pset:preset
a rdf:Property ;
rdfs:domain lv2:PluginBase ;
rdfs:range pset:Preset ;
rdfs:label "preset" ;
lv2:documentation """
<p>Specifies the preset currently applied to a plugin instance. This property
may be useful for saving state, or notifying a plugin instance at run-time
about a preset change.</p>
""" .

View file

@ -1,22 +0,0 @@
@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/resize-port>
a doap:Project ;
doap:name "LV2 Resize Port" ;
doap:shortdesc "Dynamically sized LV2 port buffers." ;
doap:created "2007-00-00" ;
doap:developer <http://drobilla.net/drobilla#me> ;
doap:release [
doap:revision "1.0" ;
doap:created "2012-04-17" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Initial release."
]
]
] .

View file

@ -1,9 +0,0 @@
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/resize-port>
a lv2:Specification ;
lv2:minorVersion 1 ;
lv2:microVersion 0 ;
rdfs:seeAlso <resize-port.ttl> .

View file

@ -1,34 +1,23 @@
/*
Copyright 2007-2016 David Robillard <http://drobilla.net>
// Copyright 2007-2016 David Robillard <d@drobilla.net>
// SPDX-License-Identifier: ISC
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef LV2_RESIZE_PORT_H
#define LV2_RESIZE_PORT_H
/**
@defgroup resize-port Resize Port
@ingroup lv2
Dynamically sized LV2 port buffers.
@{
*/
#ifndef LV2_RESIZE_PORT_H
#define LV2_RESIZE_PORT_H
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
// clang-format off
#define LV2_RESIZE_PORT_URI "http://lv2plug.in/ns/ext/resize-port" ///< http://lv2plug.in/ns/ext/resize-port
#define LV2_RESIZE_PORT_PREFIX LV2_RESIZE_PORT_URI "#" ///< http://lv2plug.in/ns/ext/resize-port#
@ -36,6 +25,8 @@
#define LV2_RESIZE_PORT__minimumSize LV2_RESIZE_PORT_PREFIX "minimumSize" ///< http://lv2plug.in/ns/ext/resize-port#minimumSize
#define LV2_RESIZE_PORT__resize LV2_RESIZE_PORT_PREFIX "resize" ///< http://lv2plug.in/ns/ext/resize-port#resize
// clang-format on
#ifdef __cplusplus
extern "C" {
#endif
@ -78,8 +69,8 @@ typedef struct {
} /* extern "C" */
#endif
#endif /* LV2_RESIZE_PORT_H */
/**
@}
*/
#endif /* LV2_RESIZE_PORT_H */

View file

@ -1,64 +0,0 @@
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rsz: <http://lv2plug.in/ns/ext/resize-port#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<http://lv2plug.in/ns/ext/resize-port>
a lv2:Specification ;
rdfs:seeAlso <resize-port.h> ,
<lv2-resize-port.doap.ttl> ;
lv2:documentation """
<p>This extension defines a feature, rsz:resize, which allows plugins to
dynamically resize their output port buffers.</p>
<p>In addition to the dynamic feature, there are properties which describe the
space required for a particular port buffer which can be used statically in
data files.</p>
""" .
rsz:resize
a lv2:Feature ;
lv2:documentation """
<p>A feature to resize output port buffers in LV2_Plugin_Descriptor::run().</p>
<p>To support this feature, the host must pass an LV2_Feature to the plugin's
instantiate method with URI LV2_RESIZE_PORT__resize and a pointer to a
LV2_Resize_Port_Resize structure. This structure provides a resize_port
function which plugins may use to resize output port buffers as necessary.</p>
""" .
rsz:asLargeAs
a rdf:Property ,
owl:DatatypeProperty ;
rdfs:domain lv2:Port ;
rdfs:range lv2:Symbol ;
rdfs:label "as large as" ;
lv2:documentation """
<p>Indicates that a port requires at least as much buffer space as the port
with the given symbol on the same plugin instance. This may be used for any
ports, but is generally most useful to indicate an output port must be at least
as large as some input port (because it will copy from it). If a port is
asLargeAs several ports, it is asLargeAs the largest such port (not the sum of
those ports' sizes).</p>
<p>The host guarantees that whenever an ObjectPort's run method is called, any
output O that is asLargeAs an input I is connected to a buffer large enough
to copy I, or NULL if the port is lv2:connectionOptional.</p>
""" .
rsz:minimumSize
a rdf:Property ,
owl:DatatypeProperty ,
owl:FunctionalProperty ;
rdfs:domain lv2:Port ;
rdfs:range xsd:nonNegativeInteger ;
rdfs:label "minimum size" ;
rdfs:comment """
Indicates that a port requires a buffer at least this large, in bytes. Any
host that supports the resize-port feature MUST connect any port with a
minimumSize specified to a buffer at least as large as the value given for this
property. Any host, especially those that do NOT support dynamic port
resizing, SHOULD do so or reduced functionality may result.
""" .

View file

@ -1,76 +0,0 @@
@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/state>
a doap:Project ;
doap:created "2010-11-09" ;
doap:name "LV2 State" ;
doap:shortdesc "An interface for LV2 plugins to save and restore state." ;
doap:license <http://opensource.org/licenses/isc> ;
doap:developer <http://lv2plug.in/ns/meta#paniq> ,
<http://drobilla.net/drobilla#me> ;
doap:maintainer <http://drobilla.net/drobilla#me> ;
doap:release [
doap:revision "2.5" ;
doap:created "2019-06-03" ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Add state:freePath feature."
]
]
] , [
doap:revision "2.4" ;
doap:created "2019-02-03" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.16.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Add state:StateChanged for notification events."
]
]
] , [
doap:revision "2.2" ;
doap:created "2016-07-31" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.14.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Add LV2_STATE_ERR_NO_SPACE status flag."
] , [
rdfs:label "Add state:threadSafeRestore feature for dropout-free state restoration."
]
]
] , [
doap:revision "2.0" ;
doap:created "2013-01-16" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.4.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Add state:loadDefaultState feature so plugins can have their default state loaded without hard-coding default state as a special case."
]
]
] , [
doap:revision "1.2" ;
doap:created "2012-10-14" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.2.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Use consistent label style."
]
]
] , [
doap:revision "1.0" ;
doap:created "2012-04-17" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Initial release."
]
]
] .

View file

@ -1,8 +0,0 @@
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/state>
a lv2:Specification ;
lv2:minorVersion 2 ;
lv2:microVersion 5 ;
rdfs:seeAlso <state.ttl> .

View file

@ -1,38 +1,28 @@
/*
Copyright 2010-2016 David Robillard <http://drobilla.net>
Copyright 2010 Leonard Ritter <paniq@paniq.org>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/**
@defgroup state State
An interface for LV2 plugins to save and restore state, see
<http://lv2plug.in/ns/ext/state> for details.
@{
*/
// Copyright 2010-2016 David Robillard <d@drobilla.net>
// Copyright 2010 Leonard Ritter <paniq@paniq.org>
// SPDX-License-Identifier: ISC
#ifndef LV2_STATE_H
#define LV2_STATE_H
/**
@defgroup state State
@ingroup lv2
An interface for LV2 plugins to save and restore state.
See <http://lv2plug.in/ns/ext/state> for details.
@{
*/
#include "lv2/core/lv2.h"
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
// clang-format off
#define LV2_STATE_URI "http://lv2plug.in/ns/ext/state" ///< http://lv2plug.in/ns/ext/state
#define LV2_STATE_PREFIX LV2_STATE_URI "#" ///< http://lv2plug.in/ns/ext/state#
@ -46,14 +36,19 @@
#define LV2_STATE__threadSafeRestore LV2_STATE_PREFIX "threadSafeRestore" ///< http://lv2plug.in/ns/ext/state#threadSafeRestore
#define LV2_STATE__StateChanged LV2_STATE_PREFIX "StateChanged" ///< http://lv2plug.in/ns/ext/state#StateChanged
// clang-format on
#ifdef __cplusplus
extern "C" {
#endif
typedef void* LV2_State_Handle; ///< Opaque handle for state save/restore
typedef void* LV2_State_Free_Path_Handle; ///< Opaque handle for state:freePath feature
typedef void* LV2_State_Map_Path_Handle; ///< Opaque handle for state:mapPath feature
typedef void* LV2_State_Make_Path_Handle; ///< Opaque handle for state:makePath feature
typedef void*
LV2_State_Free_Path_Handle; ///< Opaque handle for state:freePath feature
typedef void*
LV2_State_Map_Path_Handle; ///< Opaque handle for state:mapPath feature
typedef void*
LV2_State_Make_Path_Handle; ///< Opaque handle for state:makePath feature
/**
Flags describing value characteristics.
@ -68,13 +63,13 @@ typedef enum {
Values with this flag contain no pointers or references to other areas
of memory. It is safe to copy POD values with a simple memcpy and store
them for the duration of the process. A POD value is not necessarily
safe to trasmit between processes or machines (e.g. filenames are POD),
see LV2_STATE_IS_PORTABLE for details.
safe to transmit between processes or machines (for example, filenames
are POD), see LV2_STATE_IS_PORTABLE for details.
Implementations MUST NOT attempt to copy or serialise a non-POD value if
they do not understand its type (and thus know how to correctly do so).
*/
LV2_STATE_IS_POD = 1,
LV2_STATE_IS_POD = 1U << 0U,
/**
Portable (architecture independent) data.
@ -85,18 +80,18 @@ typedef enum {
values MUST NOT depend on architecture-specific properties like
endianness or alignment. Portable values MUST NOT contain filenames.
*/
LV2_STATE_IS_PORTABLE = 1 << 1,
LV2_STATE_IS_PORTABLE = 1U << 1U,
/**
Native data.
This flag is used by the host to indicate that the saved data is only
going to be used locally in the currently running process (e.g. for
instance duplication or snapshots), so the plugin should use the most
efficient representation possible and not worry about serialisation
going to be used locally in the currently running process (for things
like instance duplication or snapshots), so the plugin should use the
most efficient representation possible and not worry about serialisation
and portability.
*/
LV2_STATE_IS_NATIVE = 1 << 2
LV2_STATE_IS_NATIVE = 1U << 2U
} LV2_State_Flags;
/** A status code for state functions. */
@ -127,7 +122,7 @@ typedef enum {
DO NOT INVENT NONSENSE URI SCHEMES FOR THE KEY. Best is to use keys from
existing vocabularies. If nothing appropriate is available, use http URIs
that point to somewhere you can host documents so documentation can be made
resolvable (e.g. a child of the plugin or project URI). If this is not
resolvable (typically a child of the plugin or project URI). If this is not
possible, invent a URN scheme, e.g. urn:myproj:whatever. The plugin MUST
NOT pass an invalid URI key.
@ -143,8 +138,7 @@ typedef enum {
The plugin MUST NOT attempt to use this function outside of the
LV2_State_Interface.restore() context.
*/
typedef LV2_State_Status (*LV2_State_Store_Function)(
LV2_State_Handle handle,
typedef LV2_State_Status (*LV2_State_Store_Function)(LV2_State_Handle handle,
uint32_t key,
const void* value,
size_t size,
@ -169,8 +163,7 @@ typedef LV2_State_Status (*LV2_State_Store_Function)(
returns. The plugin MUST NOT attempt to use this function, or any value
returned from it, outside of the LV2_State_Interface.restore() context.
*/
typedef const void* (*LV2_State_Retrieve_Function)(
LV2_State_Handle handle,
typedef const void* (*LV2_State_Retrieve_Function)(LV2_State_Handle handle,
uint32_t key,
size_t* size,
uint32_t* type,
@ -194,7 +187,7 @@ typedef const void* (*LV2_State_Retrieve_Function)(
authors should consider this possibility, and always store sensible data
with meaningful types to avoid such problems in the future.
*/
typedef struct _LV2_State_Interface {
typedef struct {
/**
Save plugin state using a host-provided `store` callback.
@ -218,10 +211,10 @@ typedef struct _LV2_State_Interface {
This function has its own special threading class: it may not be called
concurrently with any "Instantiation" function, but it may be called
concurrently with functions in any other class, unless the definition of
that class prohibits it (e.g. it may not be called concurrently with a
"Discovery" function, but it may be called concurrently with an "Audio"
function. The plugin is responsible for any locking or lock-free
techniques necessary to make this possible.
that class prohibits it (for example, it may not be called concurrently
with a "Discovery" function, but it may be called concurrently with an
"Audio" function. The plugin is responsible for any locking or
lock-free techniques necessary to make this possible.
Note that in the simple case where state is only modified by restore(),
there are no synchronization issues since save() is never called
@ -235,7 +228,7 @@ typedef struct _LV2_State_Interface {
LV2_State_Store_Function store,
LV2_State_Handle handle,
uint32_t flags,
const LV2_Feature *const * features);
const LV2_Feature* const* features);
/**
Restore plugin state using a host-provided `retrieve` callback.
@ -266,7 +259,7 @@ typedef struct _LV2_State_Interface {
LV2_State_Retrieve_Function retrieve,
LV2_State_Handle handle,
uint32_t flags,
const LV2_Feature *const * features);
const LV2_Feature* const* features);
} LV2_State_Interface;
/**
@ -303,7 +296,7 @@ typedef struct {
/**
Map an abstract path from plugin state to an absolute path.
@param handle MUST be the `handle` member of this struct.
@param abstract_path An abstract path (e.g. a path from plugin state).
@param abstract_path An abstract path (typically from plugin state).
@return An absolute file system path.
The plugin MUST use this function in order to actually open or otherwise
@ -339,8 +332,8 @@ typedef struct {
LV2_Descriptor.instantiate()).
The host MUST do whatever is necessary for the plugin to be able to
create a file at the returned path (e.g. using fopen), including
creating any leading directories.
create a file at the returned path (for example, using fopen()),
including creating any leading directories.
If this function is passed to LV2_Descriptor.instantiate(), it may be
called from any non-realtime context. If it is passed to
@ -350,8 +343,7 @@ typedef struct {
The caller must free the returned value with
LV2_State_Free_Path.free_path().
*/
char* (*path)(LV2_State_Make_Path_Handle handle,
const char* path);
char* (*path)(LV2_State_Make_Path_Handle handle, const char* path);
} LV2_State_Make_Path;
/**
@ -373,16 +365,15 @@ typedef struct {
and returned by state features (LV2_State_Map_Path.abstract_path(),
LV2_State_Map_Path.absolute_path(), and LV2_State_Make_Path.path()).
*/
void (*free_path)(LV2_State_Free_Path_Handle handle,
char* path);
void (*free_path)(LV2_State_Free_Path_Handle handle, char* path);
} LV2_State_Free_Path;
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* LV2_STATE_H */
/**
@}
*/
#endif /* LV2_STATE_H */

View file

@ -1,391 +0,0 @@
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix state: <http://lv2plug.in/ns/ext/state#> .
<http://lv2plug.in/ns/ext/state>
a lv2:Specification ;
rdfs:seeAlso <state.h> ,
<lv2-state.doap.ttl> ;
lv2:documentation """
<p>This extension defines a simple mechanism which allows hosts to save and
restore a plugin instance's state. The goal is for an instance's state to be
<em>completely</em> described by port values (as with all LV2 plugins) and a
simple dictionary.</p>
<p>The <q>state</q> defined here is conceptually a key:value dictionary, with
URI keys and values of any type. For performance reasons the key and value
type are actually a <q>URID</q>, a URI mapped to an integer. A single
key:value pair is called a <q>property</q>.</p>
<p>This state model is simple yet has many benefits:</p>
<ul>
<li>Both fast and extensible thanks to URID keys.</li>
<li>No limitations on possible value types.</li>
<li>Easy to serialise in almost any format.</li>
<li>Easy to store in a typical <q>map</q> or <q>dictionary</q> data
structure.</li>
<li>Elegantly described in Turtle, so state can be described in LV2 data
files (including presets).</li>
<li>Does not impose any file formats, data structures, or file system
requirements.</li>
<li>Suitable for portable persistent state as well as fast in-memory
snapshots.</li>
<li>Keys <em>may</em> be well-defined and used meaningfully across several
implementations.</li>
<li>State <em>may</em> be dynamic, but plugins are not required to have a
dynamic dictionary data structure available.</li>
</ul>
<p>To implement state, the plugin provides a state:interface to the host. To
save or restore, the host calls LV2_State_Interface::save() or
LV2_State_Interface::restore(), passing a callback to be used for handling a
single property. The host is free to implement property storage and retrieval
in any way.</p>
<p>Since value types are defined by URI, any type is possible. However, a set
of standard types is defined by the <a href="atom.html">LV2 Atom</a>
extension. Use of these types is recommended. Hosts MUST implement at least
<a href="atom.html#String">atom:String</a>, which is simply a C
string.</p>
<h3>Referring to Files</h3>
<p>Plugins may need to refer to existing files (e.g. loaded samples) in their
state. This is done by storing the file's path as a property just like any
other value. However, there are some rules which MUST be followed when storing
paths, see state:mapPath for details. Plugins MUST use the type <a
href="atom.html#Path">atom:Path</a> for all paths in their state.</p>
<p>Plugins are strongly encouraged to avoid creating files, instead storing all
state as properties. However, occasionally the ability to create files is
necessary. To make this possible, the host can provide the feature
state:makePath which allocates paths for plugin-created files. Plugins MUST
NOT create files in any other locations.</p>
<h3>Plugin Code Example</h3>
<pre class="c-code">
/* Namespace for this plugin's keys. This SHOULD be something that could be
published as a document, even if that document does not exist right now.
*/
#define NS_MY "http://example.org/myplugin/schema#"
#define DEFAULT_GREETING "Hello"
LV2_Handle
my_instantiate(...)
{
MyPlugin* plugin = ...;
plugin->uris.atom_String = map_uri(LV2_ATOM__String);
plugin->uris.my_greeting = map_uri(NS_MY "greeting");
plugin->state.greeting = strdup(DEFAULT_GREETING);
return plugin;
}
LV2_State_Status
my_save(LV2_Handle instance,
LV2_State_Store_Function store,
LV2_State_Handle handle,
uint32_t flags,
const LV2_Feature *const * features)
{
MyPlugin* plugin = (MyPlugin*)instance;
const char* greeting = plugin->state.greeting;
store(handle,
plugin->uris.my_greeting,
greeting,
strlen(greeting) + 1, // Careful! Need space for terminator
plugin->uris.atom_String,
LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE);
return LV2_STATE_SUCCESS;
}
LV2_State_Status
my_restore(LV2_Handle instance,
LV2_State_Retrieve_Function retrieve,
LV2_State_Handle handle,
uint32_t flags,
const LV2_Feature *const * features)
{
MyPlugin* plugin = (MyPlugin*)instance;
size_t size;
uint32_t type;
uint32_t flags;
const char* greeting = retrieve(
handle, plugin->uris.my_greeting, &amp;size, &amp;type, &amp;flags);
if (greeting) {
free(plugin->state->greeting);
plugin->state->greeting = strdup(greeting);
} else {
plugin->state->greeting = strdup(DEFAULT_GREETING);
}
return LV2_STATE_SUCCESS;
}
const void*
my_extension_data(const char* uri)
{
static const LV2_State_Interface state_iface = { my_save, my_restore };
if (!strcmp(uri, LV2_STATE__interface)) {
return &amp;state_iface;
}
}
</pre>
<h3>Host Code Example</h3>
<pre class="c-code">
LV2_State_Status
store_callback(LV2_State_Handle handle,
uint32_t key,
const void* value,
size_t size,
uint32_t type,
uint32_t flags)
{
if ((flags &amp; LV2_STATE_IS_POD)) {
/* We only care about POD since we're keeping state in memory only.
For disk or network use, LV2_STATE_IS_PORTABLE must also be checked.
*/
Map* state_map = (Map*)handle;
state_map->insert(key, Value(copy(value), size, type));
return 0;
} else {
return 1; /* Non-POD events are unsupported. */
}
}
Map
get_plugin_state(LV2_Handle instance)
{
LV2_State* state = instance.extension_data(LV2_STATE__interface);
Map state_map;
/** Request a fast/native/POD save, since we're just copying in memory */
state.save(instance, store_callback, &amp;state_map,
LV2_STATE_IS_POD|LV2_STATE_IS_NATIVE);
return state_map;
}
</pre>
<h3>Extensions to this Specification</h3>
<p>It is likely that other interfaces for working with plugin state will be
developed as needed. This is encouraged, however everything SHOULD work within
the state <em>model</em> defined here. That is, <strong>do not complicate the
state model</strong>. Implementations can assume the following:</p>
<ul>
<li>The current port values and state dictionary completely describe a plugin
instance, at least well enough that saving and restoring will yield an
<q>identical</q> instance from the user's perspective.</li>
<li>Hosts are not expected to save and/or restore any other attributes of a
plugin instance.</li>
</ul>
<h3>The <q>Property Principle</q></h3>
<p>The main benefit of this meaningful state model is that it can double as a
plugin control/query mechanism. For plugins that require more advanced control
than simple control ports, instead of defining a set of commands, define
properties whose values can be set appropriately. This provides both a way to
control and save that state <q>for free</q>, since there is no need to define
commands <em>and</em> a set of properties for storing their effects. In
particular, this is a good way for UIs to achieve more advanced control of
plugins.</p>
<p>This <q>property principle</q> is summed up in the phrase:
<q>Don't stop; set playing to false</q>.</p>
<p>This extension does not define a dynamic mechanism for state access and
manipulation. The <a href="patch.html">LV2 Patch</a> extension
defines a generic set of messages which can be used to access or manipulate
properties, and the <a href="atom.html">LV2 Atom</a> extension defines
a port type and data container capable of transmitting those messages.</p>
""" .
state:interface
a lv2:ExtensionData ;
lv2:documentation """
<p>A structure (LV2_State_Interface) which contains functions to be called by
the host to save and restore state. In order to support this extension, the
plugin must return a valid LV2_State_Interface from
LV2_Descriptor::extension_data() when it is called with URI
LV2_STATE__interface.</p>
<p>The plugin data file should describe this like so:</p>
<pre class="turtle-code">
@prefix state: &lt;http://lv2plug.in/ns/ext/state#&gt; .
&lt;plugin&gt;
a lv2:Plugin ;
lv2:extensionData state:interface .
</pre>
""" .
state:State
a rdfs:Class ;
rdfs:label "State" ;
lv2:documentation """
<p>A state dictionary. This type should be used wherever instance state is
described. The properties of a resource with this type correspond directly to
the properties of the state dictionary (except the property that states it has
this type).</p>
""" .
state:loadDefaultState
a lv2:Feature ;
lv2:documentation """
<p>This feature indicates that the plugin has default state listed with the
state:state property which should be loaded by the host before running the
plugin. Requiring this feature allows plugins to implement a single state
loading mechanism which works for initialisation as well as restoration,
without having to hard-code default state.</p>
<p>To support this feature, the host MUST <q>restore</q> the default state
after instantiating the plugin but before calling run().</p>
""" .
state:state
a rdf:Property ;
rdfs:label "state" ;
rdfs:range state:State ;
lv2:documentation """
<p>The state of this instance. This property may be used anywhere a state
needs to be described, for example:</p>
<pre class="turtle-code">
@prefix eg: &lt;http://example.org/&gt; .
&lt;plugin-instance&gt;
state:state [
eg:somekey "some value" ;
eg:someotherkey "some other value" ;
eg:favourite-number 2
] .
</pre>
""" .
state:mapPath
a lv2:Feature ;
rdfs:label "map file paths" ;
lv2:documentation """
<p>This feature maps absolute paths to/from <q>abstract paths</q> which are
stored in state. To support this feature a host must pass an LV2_Feature with
URI LV2_STATE__mapPath and data pointed to an LV2_State_Map_Path to the
plugin's LV2_State_Interface methods.</p>
<p>The plugin MUST map <em>all</em> paths stored in its state (including those
inside any files in its state). This is necessary to enable host to handle
file system references correctly, e.g. for distribution or archival.</p>
<p>For example, a plugin may write a path to a state file like so:</p>
<pre class="c-code">
void write_path(LV2_State_Map_Path* map_path, FILE* myfile, const char* path)
{
char* abstract_path = map_path->abstract_path(map_path->handle, path);
fprintf(myfile, "%s", abstract_path);
free(abstract_path);
}
</pre>
<p>Then, later reload the path like so:</p>
<pre class="c-code">
char* read_path(LV2_State_Map_Path* map_path, FILE* myfile)
{
/* Obviously this is not production quality code! */
char abstract_path[1024];
fscanf(myfile, "%s", abstract_path);
return map_path->absolute_path(map_path->handle, abstract_path);
}
</pre>
""" .
state:makePath
a lv2:Feature ;
rdfs:label "create new file paths" ;
lv2:documentation """
<p>This feature allows plugins to create new files and/or directories. To
support this feature the host passes an LV2_Feature with URI
LV2_STATE__makePath and data pointed to an LV2_State_Make_Path to the plugin.
The host may make this feature available only during save by passing it to
LV2_State_Interface::save(), or available any time by passing it to
LV2_Descriptor::instantiate(). If passed to LV2_State_Interface::save(), the
feature MUST NOT be used beyond the scope of that call.</p>
<p>The plugin is guaranteed a hierarchical namespace unique to that plugin
instance, and may expect the returned path to have the requested path as a
suffix. There is <em>one</em> such namespace, even if the feature is passed to
both LV2_Descriptor::instantiate() <em>and</em> LV2_State_Interface::save().
Beyond this, the plugin MUST NOT make any assumptions about the returned
paths.</p>
<p>Like any other paths, the plugin MUST map these paths using state:mapPath
before storing them in state. The plugin MUST NOT assume these paths will be
available across a save/restore otherwise, i.e. only mapped paths saved to
state are persistent, any other created paths are temporary.</p>
<p>For example, a plugin may create a file in a subdirectory like so:</p>
<pre class="c-code">
char* save_myfile(LV2_State_Make_Path* make_path)
{
char* path = make_path->path(make_path->handle, "foo/bar/myfile.txt");
FILE* myfile = fopen(path, 'w');
fprintf(myfile, "I am some data");
fclose(myfile);
return path;
}
</pre>
""" .
state:threadSafeRestore
a lv2:Feature ;
rdfs:label "thread-safe restore" ;
lv2:documentation """
<p>If a plugin supports this feature, its LV2_State_Interface::restore method
is thread-safe and may be called concurrently with audio class functions.</p>
<p>To support this feature, the host MUST pass a <a
href="worker.html#schedule">work:schedule</a> feature to the restore
method, which will be used to complete the state restoration. The usual
mechanics of the worker apply: the host will call the plugin's work method,
which emits a response which is later applied in the audio thread.</p>
<p>The host is not required to block run() while restore() and work() load the
state, so this feature allows state to be restored without dropouts.</p>
""" .
state:freePath
a lv2:Feature ;
rdfs:label "free a file path" ;
lv2:documentation """
<p>This feature provides a function that can be used by plugins to free paths
that were allocated by the host via other state features (state:mapPath and
state:makePath).</p>
""" .
state:Changed
a rdfs:Class ;
rdfs:label "State changed" ;
lv2:documentation """
<p>A notification that the internal state of the plugin has been changed in a
way that the host can not otherwise know about.</p>
<p>This is a one-way notification, intended to be used as the type of an <a
href="atom.html#Object">Object</a> sent from plugins when
necessary.</p>
<p>Plugins SHOULD emit such an event whenever a change has occurred that would
result in a different state being saved, but not when the host explicity makes
a change which it knows is likely to have that effect, such as changing a
parameter.</p>
""" .

View file

@ -1,52 +0,0 @@
@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/time>
a doap:Project ;
doap:name "LV2 Time" ;
doap:shortdesc "Properties for describing time." ;
doap:created "2011-10-05" ;
doap:developer <http://drobilla.net/drobilla#me> ;
doap:release [
doap:revision "1.6" ;
doap:created "2019-02-03" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.16.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Clarify time:beat origin."
]
]
] , [
doap:revision "1.4" ;
doap:created "2016-07-31" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.14.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Define LV2_TIME_PREFIX."
]
]
] , [
doap:revision "1.2" ;
doap:created "2012-10-14" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.2.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Use consistent label style."
]
]
] , [
doap:revision "1.0" ;
doap:created "2012-04-17" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Initial release."
]
]
] .

View file

@ -1,9 +0,0 @@
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/time>
a lv2:Specification ;
lv2:minorVersion 1 ;
lv2:microVersion 6 ;
rdfs:seeAlso <time.ttl> .

View file

@ -1,33 +1,24 @@
/*
Copyright 2011-2016 David Robillard <http://drobilla.net>
// Copyright 2011-2016 David Robillard <d@drobilla.net>
// SPDX-License-Identifier: ISC
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef LV2_TIME_H
#define LV2_TIME_H
/**
@defgroup time Time
@ingroup lv2
Properties for describing time, see <http://lv2plug.in/ns/ext/time> for
details.
Properties for describing time.
Note the time extension is purely data, this header merely defines URIs for
convenience.
See <http://lv2plug.in/ns/ext/time> for details.
@{
*/
#ifndef LV2_TIME_H
#define LV2_TIME_H
// clang-format off
#define LV2_TIME_URI "http://lv2plug.in/ns/ext/time" ///< http://lv2plug.in/ns/ext/time
#define LV2_TIME_PREFIX LV2_TIME_URI "#" ///< http://lv2plug.in/ns/ext/time#
@ -46,6 +37,8 @@
#define LV2_TIME__framesPerSecond LV2_TIME_PREFIX "framesPerSecond" ///< http://lv2plug.in/ns/ext/time#framesPerSecond
#define LV2_TIME__speed LV2_TIME_PREFIX "speed" ///< http://lv2plug.in/ns/ext/time#speed
// clang-format on
/**
@}
*/

View file

@ -1,143 +0,0 @@
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix time: <http://lv2plug.in/ns/ext/time#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<http://lv2plug.in/ns/ext/time>
a owl:Ontology ;
rdfs:seeAlso <time.h> ,
<lv2-time.doap.ttl> ;
lv2:documentation """
<p>This is a vocabulary for precisely describing a position in time and the
passage of time itself, in both real and musical terms.</p>
<p>In addition to real time (e.g. seconds), two units of time are used:
<q>frames</q> and <q>beats</q>. A frame is a numbered quantum of time. Frame
time is related to real-time by the <q>frame rate</q> or <q>sample rate</q>,
time:framesPerSecond. A beat is a single pulse of musical time. Beat time is
related to real-time by the <q>tempo</q>, time:beatsPerMinute.</p>
<p>Musical time additionally has a <q>meter</q> which describes passage of time
in terms of musical <q>bars</q>. A bar is a higher level grouping of beats.
The meter describes how many beats are in one bar.</p>
""" .
time:Time
a rdfs:Class ;
rdfs:subClassOf time:Position ;
rdfs:label "Time" ;
rdfs:comment "A point in time in some unit/dimension." .
time:Position
a rdfs:Class ;
rdfs:label "Position" ;
lv2:documentation """
<p>A point in time and/or the speed at which time is passing. A position is
both a point and a speed, which precisely defines a time within a timeline.</p>
""" .
time:Rate
a rdfs:Class ;
rdfs:subClassOf time:Position ;
rdfs:label "Rate" ;
lv2:documentation """
<p>The rate of passage of time in terms of one unit with respect to
another.</p> """ .
time:position
a rdf:Property ,
owl:ObjectProperty ,
owl:FunctionalProperty ;
rdfs:range time:Position ;
rdfs:label "position" .
time:barBeat
a rdf:Property ,
owl:DatatypeProperty ,
owl:FunctionalProperty ;
rdfs:domain time:Time ;
rdfs:range xsd:float ;
rdfs:label "beat within bar" ;
rdfs:comment "The beat number within the bar, from 0 to beatsPerBar." .
time:bar
a rdf:Property ,
owl:DatatypeProperty ,
owl:FunctionalProperty ;
rdfs:domain time:Time ;
rdfs:range xsd:long ;
rdfs:label "bar" .
time:beat
a rdf:Property ,
owl:DatatypeProperty ,
owl:FunctionalProperty ;
rdfs:domain time:Time ;
rdfs:range xsd:double ;
rdfs:label "beat" ;
rdfs:comment """
The global running beat number. This is not the beat within a bar like barBeat,
but relative to the same origin as time:bar and monotonically increases unless
the transport is repositioned.
""" .
time:beatUnit
a rdf:Property ,
owl:DatatypeProperty ,
owl:FunctionalProperty ;
rdfs:domain time:Rate ;
rdfs:range xsd:nonNegativeInteger ;
lv2:documentation """
<p>Beat unit, the note value that counts as one beat. This is the bottom number
in a time signature: 2 for half note, 4 for quarter note, and so on.</p>
""" .
time:beatsPerBar
a rdf:Property ,
owl:DatatypeProperty ,
owl:FunctionalProperty ;
rdfs:domain time:Rate ;
rdfs:range xsd:float ;
rdfs:label "beats per bar" .
time:beatsPerMinute
a rdf:Property ,
owl:DatatypeProperty ,
owl:FunctionalProperty ;
rdfs:domain time:Rate ;
rdfs:range xsd:float ;
rdfs:label "beats per minute" ;
rdfs:comment "Tempo in beats per minute." .
time:frame
a rdf:Property ,
owl:DatatypeProperty ,
owl:FunctionalProperty ;
rdfs:domain time:Time ;
rdfs:range xsd:long ;
rdfs:label "frame" .
time:framesPerSecond
a rdf:Property ,
owl:DatatypeProperty ,
owl:FunctionalProperty ;
rdfs:domain time:Rate ;
rdfs:range xsd:float ;
rdfs:label "frames per second" ;
rdfs:comment "Frame rate in frames per second." .
time:speed
a rdf:Property ,
owl:DatatypeProperty ,
owl:FunctionalProperty ;
rdfs:domain time:Rate ;
rdfs:range xsd:float ;
rdfs:label "speed" ;
lv2:documentation """
<p>The rate of the progress of time as a fraction of normal speed. For
example, a rate of 0.0 is stopped, 1.0 is rolling at normal speed, 0.5 is
rolling at half speed, -1.0 is reverse, and so on.
</p>
""" .

View file

@ -1,146 +0,0 @@
@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/extensions/ui>
a doap:Project ;
doap:license <http://opensource.org/licenses/isc> ;
doap:name "LV2 UI" ;
doap:shortdesc "LV2 plugin UIs of any type." ;
doap:created "2006-00-00" ;
doap:developer <http://lv2plug.in/ns/meta#larsl> ;
doap:maintainer <http://drobilla.net/drobilla#me> ;
doap:release [
doap:revision "2.20" ;
doap:created "2015-07-25" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.14.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Improve documentation."
] , [
rdfs:label "Add missing property labels."
]
]
] , [
doap:revision "2.18" ;
doap:created "2014-08-08" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.10.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Add show interface so UIs can gracefully degrade to separate windows if hosts can not use their widget directly."
] , [
rdfs:label "Fix identifier typos in documentation."
]
]
] , [
doap:revision "2.16" ;
doap:created "2014-01-04" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.8.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Fix LV2_UI_INVALID_PORT_INDEX identifier in documentation."
]
]
] , [
doap:revision "2.14" ;
doap:created "2013-03-18" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.6.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Add idle interface so native UIs and foreign toolkits can drive their event loops."
] , [
rdfs:label "Add ui:updateRate property."
]
]
] , [
doap:revision "2.12" ;
doap:created "2012-12-01" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.4.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Fix incorrect linker flag in ui:makeSONameResident documentation."
]
]
] , [
doap:revision "2.10" ;
doap:created "2012-10-14" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.2.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Add types for WindowsUI, CocoaUI, and Gtk3UI."
] , [
rdfs:label "Use consistent label style."
] , [
rdfs:label "Add missing LV2_SYMBOL_EXPORT declaration for lv2ui_descriptor prototype."
]
]
] , [
doap:revision "2.8" ;
doap:created "2012-04-17" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Add ui:parent and ui:resize."
] , [
rdfs:label "Add support for referring to ports by symbol."
] , [
rdfs:label "Add ui:portMap for accessing ports by symbol, allowing for UIs to be distributed separately from plugins."
] , [
rdfs:label "Add port protocols and a dynamic notification subscription mechanism, for more flexible communication, and audio port metering without control port kludges."
] , [
rdfs:label "Add touch feature to notify the host that the user has grabbed a control."
] , [
rdfs:label "Merge with unified LV2 package."
]
]
] , [
doap:revision "2.4" ;
doap:created "2011-11-21" ;
doap:file-release <http://lv2plug.in/spec/lv2-ui-2.4.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Deprecate ui:makeSONameResident."
] , [
rdfs:label "Add Qt4 and X11 widget types."
] , [
rdfs:label "Install header to URI-based system path."
] , [
rdfs:label "Add pkg-config file."
] , [
rdfs:label "Make ui.ttl a valid OWL 2 DL ontology."
]
]
] , [
doap:revision "2.2" ;
doap:created "2011-05-26" ;
doap:file-release <http://lv2plug.in/spec/lv2-ui-2.2.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Add build system (for installation)."
] , [
rdfs:label "Convert documentation to HTML and use lv2:documentation."
] , [
rdfs:label "Use lv2:Specification to be discovered as an extension."
]
]
] , [
doap:revision "2.0" ;
doap:created "2010-10-06" ;
doap:file-release <http://lv2plug.in/spec/lv2-ui-2.0.tar.gz> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Initial release."
]
]
] .

View file

@ -1,8 +0,0 @@
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/extensions/ui>
a lv2:Specification ;
lv2:minorVersion 2 ;
lv2:microVersion 20 ;
rdfs:seeAlso <ui.ttl> .

View file

@ -1,38 +1,29 @@
/*
LV2 UI Extension
Copyright 2009-2016 David Robillard <d@drobilla.net>
Copyright 2006-2011 Lars Luthman <lars.luthman@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/**
@defgroup ui User Interfaces
User interfaces of any type for plugins,
<http://lv2plug.in/ns/extensions/ui> for details.
@{
*/
// Copyright 2009-2016 David Robillard <d@drobilla.net>
// Copyright 2006-2011 Lars Luthman <lars.luthman@gmail.com>
// SPDX-License-Identifier: ISC
#ifndef LV2_UI_H
#define LV2_UI_H
/**
@defgroup ui User Interfaces
@ingroup lv2
User interfaces of any type for plugins.
See <http://lv2plug.in/ns/extensions/ui> for details.
@{
*/
#include "lv2/core/lv2.h"
#include "lv2/urid/urid.h"
#include <stdbool.h>
#include <stdint.h>
// clang-format off
#define LV2_UI_URI "http://lv2plug.in/ns/extensions/ui" ///< http://lv2plug.in/ns/extensions/ui
#define LV2_UI_PREFIX LV2_UI_URI "#" ///< http://lv2plug.in/ns/extensions/ui#
@ -58,6 +49,7 @@
#define LV2_UI__portNotification LV2_UI_PREFIX "portNotification" ///< http://lv2plug.in/ns/extensions/ui#portNotification
#define LV2_UI__portSubscribe LV2_UI_PREFIX "portSubscribe" ///< http://lv2plug.in/ns/extensions/ui#portSubscribe
#define LV2_UI__protocol LV2_UI_PREFIX "protocol" ///< http://lv2plug.in/ns/extensions/ui#protocol
#define LV2_UI__requestValue LV2_UI_PREFIX "requestValue" ///< http://lv2plug.in/ns/extensions/ui#requestValue
#define LV2_UI__floatProtocol LV2_UI_PREFIX "floatProtocol" ///< http://lv2plug.in/ns/extensions/ui#floatProtocol
#define LV2_UI__peakProtocol LV2_UI_PREFIX "peakProtocol" ///< http://lv2plug.in/ns/extensions/ui#peakProtocol
#define LV2_UI__resize LV2_UI_PREFIX "resize" ///< http://lv2plug.in/ns/extensions/ui#resize
@ -66,6 +58,11 @@
#define LV2_UI__ui LV2_UI_PREFIX "ui" ///< http://lv2plug.in/ns/extensions/ui#ui
#define LV2_UI__updateRate LV2_UI_PREFIX "updateRate" ///< http://lv2plug.in/ns/extensions/ui#updateRate
#define LV2_UI__windowTitle LV2_UI_PREFIX "windowTitle" ///< http://lv2plug.in/ns/extensions/ui#windowTitle
#define LV2_UI__scaleFactor LV2_UI_PREFIX "scaleFactor" ///< http://lv2plug.in/ns/extensions/ui#scaleFactor
#define LV2_UI__foregroundColor LV2_UI_PREFIX "foregroundColor" ///< http://lv2plug.in/ns/extensions/ui#foregroundColor
#define LV2_UI__backgroundColor LV2_UI_PREFIX "backgroundColor" ///< http://lv2plug.in/ns/extensions/ui#backgroundColor
// clang-format on
/**
The index returned by LV2UI_Port_Map::port_index() for unknown ports.
@ -133,7 +130,7 @@ typedef void (*LV2UI_Write_Function)(LV2UI_Controller controller,
A pointer to an object of this type is returned by the lv2ui_descriptor()
function.
*/
typedef struct _LV2UI_Descriptor {
typedef struct LV2UI_Descriptor {
/**
The URI for this UI (not for the plugin it controls).
*/
@ -165,7 +162,7 @@ typedef struct _LV2UI_Descriptor {
features are not necessarily the same.
*/
LV2UI_Handle (*instantiate)(const struct _LV2UI_Descriptor* descriptor,
LV2UI_Handle (*instantiate)(const struct LV2UI_Descriptor* descriptor,
const char* plugin_uri,
const char* bundle_path,
LV2UI_Write_Function write_function,
@ -173,7 +170,6 @@ typedef struct _LV2UI_Descriptor {
LV2UI_Widget* widget,
const LV2_Feature* const* features);
/**
Destroy the UI. The host must not try to access the widget after
calling this function.
@ -192,7 +188,7 @@ typedef struct _LV2UI_Descriptor {
By default, the host should only call this function for lv2:ControlPort
inputs. However, the UI can request updates for other ports statically
with ui:portNotification or dynamicaly with ui:portSubscribe.
with ui:portNotification or dynamically with ui:portSubscribe.
The UI MUST NOT retain any reference to `buffer` after this function
returns, it is only valid for the duration of the call.
@ -223,7 +219,7 @@ typedef struct _LV2UI_Descriptor {
LV2UI_Descriptor::instantiate(), or as an interface provided by a UI via
LV2UI_Descriptor::extension_data()).
*/
typedef struct _LV2UI_Resize {
typedef struct {
/**
Pointer to opaque data which must be passed to ui_resize().
*/
@ -251,7 +247,7 @@ typedef struct _LV2UI_Resize {
symbol. This makes it possible to implement and distribute a UI separately
from the plugin (since symbol, unlike index, is a stable port identifier).
*/
typedef struct _LV2UI_Port_Map {
typedef struct {
/**
Pointer to opaque data which must be passed to port_index().
*/
@ -269,7 +265,7 @@ typedef struct _LV2UI_Port_Map {
/**
Feature to subscribe to port updates (LV2_UI__portSubscribe).
*/
typedef struct _LV2UI_Port_Subscribe {
typedef struct {
/**
Pointer to opaque data which must be passed to subscribe() and
unsubscribe().
@ -320,9 +316,9 @@ typedef struct _LV2UI_Port_Subscribe {
/**
A feature to notify the host that the user has grabbed a UI control.
*/
typedef struct _LV2UI_Touch {
typedef struct {
/**
Pointer to opaque data which must be passed to ui_resize().
Pointer to opaque data which must be passed to touch().
*/
LV2UI_Feature_Handle handle;
@ -337,18 +333,104 @@ typedef struct _LV2UI_Touch {
@param grabbed If true, the control has been grabbed, otherwise the
control has been released.
*/
void (*touch)(LV2UI_Feature_Handle handle,
uint32_t port_index,
bool grabbed);
void (*touch)(LV2UI_Feature_Handle handle, uint32_t port_index, bool grabbed);
} LV2UI_Touch;
/**
A status code for LV2UI_Request_Value::request().
*/
typedef enum {
/**
Completed successfully.
The host will set the parameter later if the user chooses a new value.
*/
LV2UI_REQUEST_VALUE_SUCCESS,
/**
Parameter already being requested.
The host is already requesting a parameter from the user (for example, a
dialog is visible), or the UI is otherwise busy and can not make this
request.
*/
LV2UI_REQUEST_VALUE_BUSY,
/**
Unknown parameter.
The host is not aware of this parameter, and is not able to set a new
value for it.
*/
LV2UI_REQUEST_VALUE_ERR_UNKNOWN,
/**
Unsupported parameter.
The host knows about this parameter, but does not support requesting a
new value for it from the user. This is likely because the host does
not have UI support for choosing a value with the appropriate type.
*/
LV2UI_REQUEST_VALUE_ERR_UNSUPPORTED
} LV2UI_Request_Value_Status;
/**
A feature to request a new parameter value from the host.
*/
typedef struct {
/**
Pointer to opaque data which must be passed to request().
*/
LV2UI_Feature_Handle handle;
/**
Request a value for a parameter from the host.
This is mainly used by UIs to request values for complex parameters that
don't change often, such as file paths, but it may be used to request
any parameter value.
This function returns immediately, and the return value indicates
whether the host can fulfil the request. The host may notify the
plugin about the new parameter value, for example when a file is
selected by the user, via the usual mechanism. Typically, the host will
send a message to the plugin that sets the new parameter value, and the
plugin will notify the UI via a message as usual for any other parameter
change.
To provide an appropriate UI, the host can determine details about the
parameter from the plugin data as usual. The additional parameters of
this function provide support for more advanced use cases, but in the
simple common case, the plugin will simply pass the key of the desired
parameter and zero for everything else.
@param handle The handle field of this struct.
@param key The URID of the parameter.
@param type The optional type of the value to request. This can be used
to request a specific value type for parameters that support several.
If non-zero, it must be the URID of an instance of rdfs:Class or
rdfs:Datatype.
@param features Additional features for this request, or NULL.
@return A status code which is 0 on success.
*/
LV2UI_Request_Value_Status (*request)(LV2UI_Feature_Handle handle,
LV2_URID key,
LV2_URID type,
const LV2_Feature* const* features);
} LV2UI_Request_Value;
/**
UI Idle Interface (LV2_UI__idleInterface)
UIs can provide this interface to have an idle() callback called by the host
rapidly to update the UI.
*/
typedef struct _LV2UI_Idle_Interface {
typedef struct {
/**
Run a single iteration of the UI's idle loop.
@ -373,11 +455,12 @@ typedef struct _LV2UI_Idle_Interface {
If used:
- The host MUST use LV2UI_Idle_Interface to drive the UI.
- The UI MUST return non-zero from LV2UI_Idle_Interface::idle() when it has been closed.
- The UI MUST return non-zero from LV2UI_Idle_Interface::idle() when it has
been closed.
- If idle() returns non-zero, the host MUST call hide() and stop calling
idle(). It MAY later call show() then resume calling idle().
*/
typedef struct _LV2UI_Show_Interface {
typedef struct {
/**
Show a window for this UI.
@ -400,7 +483,7 @@ typedef struct _LV2UI_Show_Interface {
/**
Peak data for a slice of time, the update format for ui:peakProtocol.
*/
typedef struct _LV2UI_Peak_Data {
typedef struct {
/**
The start of the measurement period. This is just a running counter
that is only meaningful in comparison to previous values and must not be
@ -427,7 +510,8 @@ typedef struct _LV2UI_Peak_Data {
lv2_descriptor() but for UIs rather than plugins.
*/
LV2_SYMBOL_EXPORT
const LV2UI_Descriptor* lv2ui_descriptor(uint32_t index);
const LV2UI_Descriptor*
lv2ui_descriptor(uint32_t index);
/**
The type of the lv2ui_descriptor() function.
@ -438,8 +522,8 @@ typedef const LV2UI_Descriptor* (*LV2UI_DescriptorFunction)(uint32_t index);
}
#endif
#endif /* LV2_UI_H */
/**
@}
*/
#endif /* LV2_UI_H */

View file

@ -1,461 +0,0 @@
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ui: <http://lv2plug.in/ns/extensions/ui#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<http://lv2plug.in/ns/extensions/ui>
a owl:Ontology ;
owl:imports <http://lv2plug.in/ns/lv2core> ;
rdfs:seeAlso <ui.h> ,
<lv2-ui.doap.ttl> ;
lv2:documentation """
<p>This extension is used to create User Interfaces (UIs) for LV2 plugins.</p>
<p>UIs are implemented as an LV2UI_Descriptor loaded via lv2ui_descriptor() in
a shared library, and are distributed in bundles just like plugins.</p>
<p>UIs are associated with plugins in data:</p>
<pre class="turtle-code">
@prefix ui: &lt;http://lv2plug.in/ns/extensions/ui#&gt; .
&lt;http://my.plugin&gt; ui:ui &lt;http://my.pluginui&gt; .
&lt;http://my.pluginui&gt; a ui:GtkUI ;
ui:binary &lt;myui.so&gt; .
</pre>
<p>where &lt;http://my.plugin&gt; is the URI of the plugin,
&lt;http://my.pluginui&gt; is the URI of the plugin UI and &lt;myui.so&gt; is
the relative URI to the shared object file.</p>
<p>While it is possible to have the plugin UI and the plugin in the same shared
object file it is probably a good idea to keep them separate so that hosts that
don't want UIs don't have to load the UI code. A UI MUST specify its class in
the RDF data (ui:GtkUI in the above example). The class defines what type the
UI is, e.g. what graphics toolkit it uses. Any type of UI class can be defined
separately from this extension.</p>
<p>It is possible to have multiple UIs for the same plugin, or to have the UI
for a plugin in a different bundle from the actual plugin - this way people
other than the plugin author can write plugin UIs independently without editing
the original plugin bundle.</p>
<p>Note that the process that loads the shared object file containing the UI
code and the process that loads the shared object file containing the actual
plugin implementation are not necessarily the same process (and not even
necessarily on the same machine). This means that plugin and UI code MUST NOT
use singletons and global variables and expect them to refer to the same
objects in the UI and the actual plugin. The function callback interface
defined in this header is the only method of communication between UIs and
plugin instances (extensions may define more, though this is discouraged unless
absolutely necessary since the significant benefits of network transparency and
serialisability are lost).</p>
<p>UI functionality may be extended via features, much like plugins:</p>
<pre class="turtle-code">
&lt;http://my.pluginui&gt; lv2:requiredFeature &lt;http://my.feature&gt; .
&lt;http://my.pluginui&gt; lv2:optionalFeature &lt;http://my.feature&gt; .
</pre>
<p>The rules for a UI with a required or optional feature are identical to
those of lv2:Plugin instances: if a UI declares a feature as required, the host
is NOT allowed to load it unless it supports that feature; and if it does
support a feature, it MUST pass an appropriate LV2_Feature struct to the UI's
instantiate() method. This extension defines several standard features for
common functionality.</p>
<p>UIs written to this specification do not need to be thread-safe. All
functions may only be called in the <q>UI thread</q>. There is only one UI
thread (for toolkits, the one the UI main loop runs in). There is no
requirement that a <q>UI</q> actually be a graphical widget.</p>
<p>Note that UIs are completely separate from plugins. From the plugin's
perspective, control from a UI is indistinguishable from any other control, as
it all occcurs via ports.</p>
""" .
ui:UI
a rdfs:Class ,
owl:Class ;
rdfs:label "User Interface" ;
rdfs:comment "A UI for an LV2 plugin" .
ui:GtkUI
a rdfs:Class ,
owl:Class ;
rdfs:subClassOf ui:UI ;
rdfs:label "GTK2 UI" ;
rdfs:comment """A UI where the LV2_Widget is a pointer to a Gtk+ 2.0 compatible GtkWidget, and the host guarantees that the Gtk+ library has been initialised and the Glib main loop is running before a UI of this type is instantiated.""" .
ui:Gtk3UI
a rdfs:Class ,
owl:Class ;
rdfs:subClassOf ui:UI ;
rdfs:label "GTK3 UI" ;
rdfs:comment """A UI where the LV2_Widget is a pointer to a Gtk+ 3.0 compatible GtkWidget, and the host guarantees that the Gtk+ library has been initialised and the Glib main loop is running before a UI of this type is instantiated.""" .
ui:Qt4UI
a rdfs:Class ,
owl:Class ;
rdfs:subClassOf ui:UI ;
rdfs:label "Qt4 UI" ;
rdfs:comment """A UI where the LV2_Widget is a pointer to a Qt4 compatible QWidget, and the host guarantees that the Qt4 library has been initialised and the Qt4 main loop is running before a UI of this type is instantiated.""" .
ui:Qt5UI
a rdfs:Class ,
owl:Class ;
rdfs:subClassOf ui:UI ;
rdfs:label "Qt5 UI" ;
rdfs:comment """A UI where the LV2_Widget is a pointer to a Qt5 compatible QWidget, and the host guarantees that the Qt5 library has been initialised and the Qt5 main loop is running before a UI of this type is instantiated.""" .
ui:X11UI
a rdfs:Class ,
owl:Class ;
rdfs:subClassOf ui:UI ;
rdfs:label "X11 UI" ;
rdfs:comment """A UI where the LV2_Widget is an X11 window ID. Note this is actually an integer, i.e. the LV2_Widget is not a pointer to an X11 window ID, but should be itself taken as an integer value. This is the native UI type on most POSIX systems.""" .
ui:WindowsUI
a rdfs:Class ,
owl:Class ;
rdfs:subClassOf ui:UI ;
rdfs:label "Windows UI" ;
rdfs:comment """A UI where the LV2_Widget is a Windows HWND window ID. Note this is actually an unsigned 32-bit integer, i.e. the LV2_Widget is not a pointer to a HWND but should be interpreted as an HWND itself. This is the native UI type on Microsoft Windows.""" .
ui:CocoaUI
a rdfs:Class ,
owl:Class ;
rdfs:subClassOf ui:UI ;
rdfs:label "Cocoa UI" ;
rdfs:comment """A UI where the LV2_Widget is a pointer to a NSView, the basic view type for the Cocoa API (formerly OpenStep). This is the native UI type on Mac OS X.""" .
ui:ui
a rdf:Property ;
rdfs:domain lv2:Plugin ;
rdfs:range ui:UI ;
rdfs:label "user interface" ;
rdfs:comment """Relates a plugin to a UI that applies to it.""" .
ui:binary
a rdf:Property ;
owl:sameAs lv2:binary ;
owl:deprecated "true"^^xsd:boolean ;
rdfs:label "binary" ;
rdfs:comment """The shared library a UI resides in. This property is redundant, new UIs SHOULD use lv2:binary, however hosts MUST still support ui:binary at this time.""" .
ui:makeSONameResident
a lv2:Feature ;
owl:deprecated "true"^^xsd:boolean ;
lv2:documentation """
<p>DEPRECATED</p>
<p>This feature was intended to support UIs that link against toolkit
libraries which may not be unloaded during the lifetime of the host.
This is better achieved by using the appropriate flags when linking the
UI, e.g. <code>gcc -Wl,-z,nodelete</code>.</p>
""" .
ui:noUserResize
a lv2:Feature ;
lv2:documentation """
<p>If a UI requires this feature it indicates that it does not make sense
to let the user resize the main widget, and the host should prevent that.
This feature may not make sense for all UI types. The data pointer for the
LV2_Feature for this feature should always be set to NULL.</p>
""" .
ui:fixedSize
a lv2:Feature ;
lv2:documentation """
<p>If a UI requires this feature it indicates the same thing as
ui:noUserResize, and additionally it means that the UI will not resize
the main widget on its own - it will always remain the same size (e.g. a
pixmap based GUI). This feature may not make sense for all UI types.
The data pointer for the LV2_Feature for this feature should always be set
to NULL.</p>
""" .
ui:parent
a lv2:Feature ;
lv2:documentation """
<p>The parent for the UI.</p>
<p>This feature can be used to pass a parent (e.g. a widget, container, canvas,
etc.) the UI should be a child of. The format of data pointer of this feature
is determined by the UI type, and is generally the same type as the LV2_Widget
the UI would return (e.g. for a GtkUI the data would be a pointer to a
GtkWidget which is a GtkContainer). This is particularly useful for
cross-toolkit embedding, where the parent often must be known at construction
time for embedding to work correctly. UIs should not require this feature
unless it is absolutely necessary for them to work at all.</p>
""" .
ui:PortNotification
a rdfs:Class ,
owl:Class ;
rdfs:subClassOf [
a owl:Restriction ;
owl:onProperty ui:plugin ;
owl:cardinality 1 ;
rdfs:comment "A PortNotification MUST have exactly one ui:plugin." ;
] ;
lv2:documentation """
<p>A port notification. This describes which ports the host must send
notifications to the UI about. The port can be specific by index, using the
ui:portIndex property, or symbol, using the lv2:symbol property. Since port
indices are not guaranteed to be stable between different revisions (or even
instantiations) of a plugin, symbol is recommended, and index may only be used
by UIs shipped in the same bundle as the plugin.</p>
<p>A ui:PortNotification MUST have either a ui:portIndex or a lv2:symbol to
indicate which port it refers to.</p>
""" .
ui:portNotification
a rdf:Property ,
owl:ObjectProperty ;
rdfs:domain ui:UI ;
rdfs:range ui:PortNotification ;
rdfs:label "port notification" ;
lv2:documentation """
<p>Indicates that a UI should receive notification (via
LV2UI_Descriptor::port_event()) when a particular port's value changes.</p>
<p>For example:</p>
<pre class="turtle-code">
eg:ui
a ui:GtkUI ;
ui:portNotification [
ui:plugin eg:plugin ;
lv2:symbol "gain" ;
ui:protocol ui:floatProtocol
] .
</pre>
""" .
ui:plugin
a rdf:Property ,
owl:ObjectProperty ;
rdfs:domain ui:PortNotification ;
rdfs:range lv2:Plugin ;
rdfs:label "plugin" ;
rdfs:comment "The plugin a portNotification applies to." .
ui:portIndex
a rdf:Property ,
owl:DatatypeProperty ;
rdfs:domain ui:PortNotification ;
rdfs:range xsd:decimal ;
rdfs:label "port index" ;
rdfs:comment "The index of the port a portNotification applies to." .
ui:notifyType
a rdf:Property ;
rdfs:domain ui:PortNotification ;
rdfs:label "notify type" ;
lv2:documentation """
<p>Indicates a particular type that the UI should be notified of. In the case
of ports where several types of data can be present (e.g. event ports), this
can be used to indicate that only a particular type of data should cause
notification. This is useful where port traffic is very dense, but only a
certain small number of events are actually of interest to the UI.</p>
""" .
ui:resize
a lv2:Feature ,
lv2:ExtensionData ;
lv2:documentation """
<p>A feature that allows the UI to notify the host about its current size, or
request a size change. This feature corresponds to the LV2UI_Resize struct,
which should be passed with the URI LV2_UI__resize. This struct may also be
provided by the UI as extension data using the same URI, in which case it is
used by the host to request that the UI change its size.</p>
""" .
ui:portMap
a lv2:Feature ;
lv2:documentation """
<p>A feature for accessing the index of a port by symbol. This makes it
possible to implement and distribute UIs separately from the plugin binaries
they control. This feature corresponds to the LV2UI_Port_Index struct, which
should be passed with the URI LV2_UI__portIndex.</p>
""" .
ui:portSubscribe
a lv2:Feature ;
lv2:documentation """
<p>A feature for dynamically subscribing to updates from a port. This makes it
possible for a UI to explicitly request a particular style of update from a
port at run-time, in a more flexible and powerful way than listing
subscriptions statically allows. This feature corresponds to the
LV2UI_Port_Subscribe struct, which should be passed with the URI
LV2_UI__portSubscribe.</p>
""" .
ui:touch
a lv2:Feature ;
lv2:documentation """
<p>A feature to notify the host that the user has grabbed a particular port
control. This is useful for automation, so the host can allow the user to take
control of a port, even if that port would otherwise be automated (much like
grabbing a physical morotised fader). It can also be used for MIDI learn or in
any other situation where the host needs to do something with a particular
control and it would be convenient for the user to select it directly from the
plugin UI. This feature corresponds to the LV2UI_Touch struct, which
should be passed with the URI LV2_UI__touch.</p>
""" .
ui:idleInterface
a lv2:Feature ,
lv2:ExtensionData ;
lv2:documentation """
<p>A feature that provides a callback for the host to call rapidly to drive the
UI. To support this feature, the UI should list it as a lv2:optionalFeature or
lv2:requiredFeature in its data, and also as lv2:extensionData. When the UI's
extension_data() is called with this URI (LV2_UI__idleInterface), it should
return a pointer to an LV2UI_Idle_Interface.</p>
<p>To indicate support, the host should pass a feature to instantiate() with
this URI, with NULL for data.</p>
""" .
ui:showInterface
a lv2:ExtensionData ;
lv2:documentation """
<p>An interface for showing and hiding a window for a UI. This allows UIs to
gracefully degrade to separate windows when the host is unable to embed the UI
widget for whatever reason. When the UI's extension_data() is called with this
URI (LV2_UI__showInterface), it should return a pointer to an
LV2UI_Show_Interface.</p>
""" .
ui:windowTitle
a rdf:Property ;
rdfs:range xsd:string ;
rdfs:label "window title" ;
rdfs:comment "The title for the window shown by LV2UI_Show_Interface." .
ui:updateRate
a rdf:Property ;
rdfs:range xsd:float ;
rdfs:label "update rate" ;
rdfs:comment "The target rate, in Hz, to send updates to the UI." .
ui:protocol
a rdf:Property ;
rdfs:domain ui:PortNotification ;
rdfs:range ui:PortProtocol ;
rdfs:label "protocol" ;
rdfs:comment "The protocol to be used for this notification." .
ui:PortProtocol
a rdfs:Class ;
rdfs:subClassOf lv2:Feature ;
rdfs:label "Port Protocol" ;
lv2:documentation """
<p>A PortProtocol defines a method to communicate port data between a UI and
plugin.</p>
<p>Any PortProtocol MUST define:</p>
<table>
<tr><th>Port Type</th>
<td>Which plugin port types the buffer type is valid for.</td></tr>
<tr><th>Feature Data</th>
<td>What data (if any) should be passed in the LV2_Feature.</td></tr>
</table>
<p>Any PortProtocol for an output port MUST define:</p>
<table>
<tr><th>Update Frequency</th>
<td>When the host should call port_event().</td></tr>
<tr><th>Update Format</th>
<td>The format of the data in the buffer passed to port_event().</td></tr>
<tr><th>Options</th>
<td>The format of the options passed to subscribe() and unsubscribe().</td>
</tr></table>
<p>Any PortProtocol for an input port MUST define:</p>
<table>
<tr><th>Write Format</th>
<td>The format of the data in the buffer passed to write_port().</td></tr>
<tr><th>Write Effect</th>
<td>What happens when the UI calls write_port().</td></tr>
</table>
<p>For an example, see ui:floatProtocol or ui:peakProtocol.
</p>
<p>PortProtocol is a subclass of lv2:Feature, so UIs use lv2:optionalFeature and
lv2:requiredFeature to specify which PortProtocols they want to use.
</p>
""" .
ui:floatProtocol
a ui:PortProtocol ;
rdfs:label "floating point value" ;
lv2:documentation """
<p>A protocol for transferring single floating point values. The rules for
this protocol are:</p>
<table>
<tr><th>Port Type</th>
<td>lv2:ControlPort</td></tr>
<tr><th>Feature Data</th>
<td>None.</td></tr>
<tr><th>Update Frequency</th>
<td>The host SHOULD call port_event() as soon as possible when the port
value has changed, but there are no timing guarantees.</td></tr>
<tr><th>Update Format</th>
<td>A single <code>float</code>.</td></tr>
<tr><th>Options</th>
<td>None.</td></tr>
<tr><th>Write Format</th>
<td>A single <code>float</code>.</td></tr>
<tr><th>Write Effect</th>
<td>The host SHOULD set the port to the received value as soon as possible,
but there is no guarantee that run() actually sees this value.</td></tr>
</table>
""" .
ui:peakProtocol
a ui:PortProtocol ;
rdfs:label "peak measurement for a period of audio" ;
lv2:documentation """
<p>This port protocol defines a way for the host to send continuous peak
measurements of the audio signal at a certain port to the UI. The
intended use is visualisation, e.g. an animated meter widget that shows
the level of the audio input or output.</p>
<p>A contiguous sequence of audio samples for which a peak value has been
computed is called a <em>measurement period</em>.</p>
<p>The rules for this protocol are:</p>
<table>
<tr><th>Port Type</th>
<td>lv2:AudioPort</td></tr>
<tr><th>Feature Data</th>
<td>None.</td></tr>
<tr><th>Update Frequency</th>
<td>The host SHOULD call port_event() at regular intervals. The
measurement periods used for calls to port_event() for the same port SHOULD
be contiguous (i.e. the measurement period for one call should begin right
after the end of the measurement period for the previous call ends) unless
the UI has removed and re-added the port subscription between those calls.
However, UIs MUST NOT depend on either the regularity of the calls or the
contiguity of the measurement periods; hosts may change the call rate or
skip calls for performance or other reasons. Measurement periods for
different calls to port_event() for the same port MUST NOT
overlap.</td></tr>
<tr><th>Update Format</th>
<td>A single LV2UI_Peak_Data object.</td></tr>
<tr><th>Options</th>
<td>None.</td></tr>
<tr><th>Write Format</th>
<td>None.</td></tr>
<tr><th>Write Effect</th>
<td>None.</td></tr>
</table>
""" .

View file

@ -1,109 +0,0 @@
@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/extensions/units>
a doap:Project ;
doap:name "LV2 Units" ;
doap:shortdesc "Units for LV2 values." ;
doap:created "2007-02-06" ;
doap:homepage <http://lv2plug.in/ns/extensions/units> ;
doap:license <http://opensource.org/licenses/isc> ;
doap:release [
doap:revision "5.12" ;
doap:created "2019-02-03" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.16.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Fix outdated port description in documentation."
] , [
rdfs:label "Remove overly restrictive domain from units:unit."
]
]
] , [
doap:revision "5.10" ;
doap:created "2015-04-07" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.12.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Fix non-existent port type in examples."
] , [
rdfs:label "Add lv2:Parameter to domain of units:unit."
]
]
] , [
doap:revision "5.8" ;
doap:created "2012-10-14" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.2.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Remove units:name in favour of rdfs:label."
] , [
rdfs:label "Use consistent label style."
]
]
] , [
doap:revision "5.6" ;
doap:created "2012-04-17" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Add unit for audio frames."
] , [
rdfs:label "Add header of URI defines."
] , [
rdfs:label "Merge with unified LV2 package."
]
]
] , [
doap:revision "5.4" ;
doap:created "2011-11-21" ;
doap:file-release <http://lv2plug.in/spec/lv2-units-5.4.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Make units.ttl a valid OWL 2 DL ontology."
] , [
rdfs:label "Define used but undefined resources (units:name, units:render, units:symbol, units:Conversion, units:conversion, units:prefixConversion, units:to, and units:factor)."
] , [
rdfs:label "Update packaging."
] , [
rdfs:label "Improve documentation."
]
]
] , [
doap:revision "5.2" ;
doap:created "2010-10-05" ;
doap:file-release <http://lv2plug.in/spec/lv2-units-5.2.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Add build system (for installation)."
] , [
rdfs:label "Convert documentation to HTML and use lv2:documentation."
]
]
] , [
doap:revision "5.0" ;
doap:created "2010-10-05" ;
doap:file-release <http://lv2plug.in/spec/lv2-units-5.0.tar.gz> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Initial release."
] , [
rdfs:label "Define used but undefined resources (units:name, units:render, units:symbol, units:Conversion, units:conversion, units:prefixConversion, units:to, and units:factor)."
] , [
rdfs:label "Update packaging."
] , [
rdfs:label "Improve documentation."
]
]
] ;
doap:developer <http://plugin.org.uk/swh.xrdf#me> ;
doap:maintainer <http://drobilla.net/drobilla#me> .

View file

@ -1,9 +0,0 @@
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/extensions/units>
a lv2:Specification ;
lv2:minorVersion 5 ;
lv2:microVersion 12 ;
rdfs:seeAlso <units.ttl> .

View file

@ -1,30 +1,21 @@
/*
Copyright 2012-2016 David Robillard <http://drobilla.net>
// Copyright 2012-2016 David Robillard <d@drobilla.net>
// SPDX-License-Identifier: ISC
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef LV2_UNITS_H
#define LV2_UNITS_H
/**
@defgroup units Units
@ingroup lv2
Units for LV2 values, see <http://lv2plug.in/ns/extensions/units> for
details.
Units for LV2 values.
See <http://lv2plug.in/ns/extensions/units> for details.
@{
*/
#ifndef LV2_UNITS_H
#define LV2_UNITS_H
// clang-format off
#define LV2_UNITS_URI "http://lv2plug.in/ns/extensions/units" ///< http://lv2plug.in/ns/extensions/units
#define LV2_UNITS_PREFIX LV2_UNITS_URI "#" ///< http://lv2plug.in/ns/extensions/units#
@ -62,8 +53,10 @@
#define LV2_UNITS__symbol LV2_UNITS_PREFIX "symbol" ///< http://lv2plug.in/ns/extensions/units#symbol
#define LV2_UNITS__unit LV2_UNITS_PREFIX "unit" ///< http://lv2plug.in/ns/extensions/units#unit
#endif /* LV2_UNITS_H */
// clang-format on
/**
@}
*/
#endif /* LV2_UNITS_H */

View file

@ -1,393 +0,0 @@
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix units: <http://lv2plug.in/ns/extensions/units#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<http://lv2plug.in/ns/extensions/units>
a owl:Ontology ;
owl:imports <http://lv2plug.in/ns/lv2core> ;
rdfs:seeAlso <units.h> ,
<lv2-units.doap.ttl> ;
lv2:documentation """
<p>This vocabulary defines a number of units for use in audio processing.</p>
<p>For example, to say that a gain port's value is in decibels (units:db)</p>
<pre class="turtle-code">
@prefix units: &lt;http://lv2plug.in/ns/extensions/units#&gt; .
@prefix eg: &lt;http://example.org/&gt; .
eg:plugin lv2:port [
a lv2:ControlPort , lv2:InputPort ;
lv2:index 0 ;
lv2:symbol "gain" ;
lv2:name "gain" ;
units:unit units:db
] .
</pre>
<p>Using the same form, plugins may also specify one-off units inline, to give
better display hints to hosts:</p>
<pre class="turtle-code">
eg:plugin lv2:port [
a lv2:ControlPort , lv2:InputPort ;
lv2:index 0 ;
lv2:symbol "frob" ;
lv2:name "frob level" ;
units:unit [
a units:Unit ;
rdfs:label "frobnication" ;
units:symbol "fr" ;
units:render "%f f"
]
] .
</pre>
<p>It is also possible to define conversions between various units, which makes
it possible for hosts to automatically and generically convert from a given
unit to a desired unit. The units defined in this extension include conversion
definitions where it makes sense to do so.</p>
""" .
units:Unit
a rdfs:Class ,
owl:Class ;
rdfs:label "Unit" ;
rdfs:comment "A unit for LV2 port data" .
units:unit
a rdf:Property ,
owl:ObjectProperty ;
rdfs:range units:Unit ;
rdfs:label "unit" ;
rdfs:comment "The unit used by the value of a port or parameter." .
units:render
a rdf:Property ,
owl:DatatypeProperty ;
rdfs:label "unit format string" ;
rdfs:domain units:Unit ;
rdfs:range xsd:string ;
rdfs:comment """A printf format string for rendering a value (eg. "%f dB").""" .
units:symbol
a rdf:Property ,
owl:DatatypeProperty ;
rdfs:label "unit symbol" ;
rdfs:domain units:Unit ;
rdfs:range xsd:string ;
rdfs:comment "The abbreviated symbol for the unit (e.g. dB)." .
units:Conversion
a rdfs:Class ,
owl:Class ;
rdfs:subClassOf [
a owl:Restriction ;
owl:onProperty units:to ;
owl:cardinality 1 ;
rdfs:comment "A conversion MUST have exactly 1 units:to property."
] ;
rdfs:label "Conversion" ;
rdfs:comment "A conversion from one unit to another." .
units:conversion
a rdf:Property ,
owl:ObjectProperty ;
rdfs:domain units:Unit ;
rdfs:range units:Conversion ;
rdfs:label "conversion" ;
rdfs:comment "A conversion from this unit to another." .
units:prefixConversion
a rdf:Property ,
owl:ObjectProperty ;
rdfs:subPropertyOf units:conversion ;
rdfs:domain units:Unit ;
rdfs:range units:Conversion ;
rdfs:label "prefix conversion" ;
rdfs:comment """A conversion from this unit to the same unit but with a different SI prefix (e.g. Hz to kHz).""" .
units:to
a rdf:Property ,
owl:ObjectProperty ;
rdfs:domain units:Conversion ;
rdfs:range units:Unit ;
rdfs:label "conversion target" ;
rdfs:comment "The target unit this conversion converts to." .
units:factor
a rdf:Property ,
owl:DatatypeProperty ;
rdfs:domain units:Conversion ;
rdfs:label "conversion factor" ;
rdfs:comment """The factor to multiply the source value by in order to convert to the target unit.""" .
units:s
a units:Unit ;
units:conversion [
units:factor 0.0166666666 ;
units:to units:min
] ;
rdfs:label "seconds" ;
units:prefixConversion [
units:factor 1000 ;
units:to units:ms
] ;
units:render "%f s" ;
units:symbol "s" .
units:ms
a units:Unit ;
rdfs:label "milliseconds" ;
units:prefixConversion [
units:factor 0.001 ;
units:to units:s
] ;
units:render "%f ms" ;
units:symbol "ms" .
units:min
a units:Unit ;
units:conversion [
units:factor 60.0 ;
units:to units:s
] ;
rdfs:label "minutes" ;
units:render "%f mins" ;
units:symbol "min" .
units:bar
a units:Unit ;
rdfs:label "bars" ;
units:render "%f bars" ;
units:symbol "bars" .
units:beat
a units:Unit ;
rdfs:label "beats" ;
units:render "%f beats" ;
units:symbol "beats" .
units:frame
a units:Unit ;
rdfs:label "audio frames" ;
units:render "%f frames" ;
units:symbol "frames" .
units:m
a units:Unit ;
units:conversion [
units:factor 39.37 ;
units:to units:inch
] ;
rdfs:label "metres" ;
units:prefixConversion [
units:factor 100 ;
units:to units:cm
] , [
units:factor 1000 ;
units:to units:mm
] , [
units:factor 0.001 ;
units:to units:km
] ;
units:render "%f m" ;
units:symbol "m" .
units:cm
a units:Unit ;
units:conversion [
units:factor 0.3937 ;
units:to units:inch
] ;
rdfs:label "centimetres" ;
units:prefixConversion [
units:factor 0.01 ;
units:to units:m
] , [
units:factor 10 ;
units:to units:mm
] , [
units:factor 0.00001 ;
units:to units:km
] ;
units:render "%f cm" ;
units:symbol "cm" .
units:mm
a units:Unit ;
units:conversion [
units:factor 0.03937 ;
units:to units:inch
] ;
rdfs:label "millimetres" ;
units:prefixConversion [
units:factor 0.001 ;
units:to units:m
] , [
units:factor 0.1 ;
units:to units:cm
] , [
units:factor 0.000001 ;
units:to units:km
] ;
units:render "%f mm" ;
units:symbol "mm" .
units:km
a units:Unit ;
units:conversion [
units:factor 0.62138818 ;
units:to units:mile
] ;
rdfs:label "kilometres" ;
units:prefixConversion [
units:factor 1000 ;
units:to units:m
] , [
units:factor 100000 ;
units:to units:cm
] , [
units:factor 1000000 ;
units:to units:mm
] ;
units:render "%f km" ;
units:symbol "km" .
units:inch
a units:Unit ;
units:conversion [
units:factor 2.54 ;
units:to units:cm
] ;
rdfs:label "inches" ;
units:render """%f\"""" ;
units:symbol "in" .
units:mile
a units:Unit ;
units:conversion [
units:factor 1.6093 ;
units:to units:km
] ;
rdfs:label "miles" ;
units:render "%f mi" ;
units:symbol "mi" .
units:db
a units:Unit ;
rdfs:label "decibels" ;
units:render "%f dB" ;
units:symbol "dB" .
units:pc
a units:Unit ;
units:conversion [
units:factor 0.01 ;
units:to units:coef
] ;
rdfs:label "percent" ;
units:render "%f%%" ;
units:symbol "%" .
units:coef
a units:Unit ;
units:conversion [
units:factor 100 ;
units:to units:pc
] ;
rdfs:label "coefficient" ;
units:render "* %f" ;
units:symbol "" .
units:hz
a units:Unit ;
rdfs:label "hertz" ;
units:prefixConversion [
units:factor 0.001 ;
units:to units:khz
] , [
units:factor 0.000001 ;
units:to units:mhz
] ;
units:render "%f Hz" ;
units:symbol "Hz" .
units:khz
a units:Unit ;
rdfs:label "kilohertz" ;
units:prefixConversion [
units:factor 1000 ;
units:to units:hz
] , [
units:factor 0.001 ;
units:to units:mhz
] ;
units:render "%f kHz" ;
units:symbol "kHz" .
units:mhz
a units:Unit ;
rdfs:label "megahertz" ;
units:prefixConversion [
units:factor 1000000 ;
units:to units:hz
] , [
units:factor 0.001 ;
units:to units:khz
] ;
units:render "%f MHz" ;
units:symbol "MHz" .
units:bpm
a units:Unit ;
rdfs:label "beats per minute" ;
units:prefixConversion [
units:factor 0.0166666666 ;
units:to units:hz
] ;
units:render "%f BPM" ;
units:symbol "BPM" .
units:oct
a units:Unit ;
units:conversion [
units:factor 12.0 ;
units:to units:semitone12TET
] ;
rdfs:label "octaves" ;
units:render "%f octaves" ;
units:symbol "oct" .
units:cent
a units:Unit ;
units:conversion [
units:factor 0.01 ;
units:to units:semitone12TET
] ;
rdfs:label "cents" ;
units:render "%f ct" ;
units:symbol "ct" .
units:semitone12TET
a units:Unit ;
units:conversion [
units:factor 0.083333333 ;
units:to units:oct
] ;
rdfs:label "semitones" ;
units:render "%f semi" ;
units:symbol "semi" .
units:degree
a units:Unit ;
rdfs:label "degrees" ;
units:render "%f deg" ;
units:symbol "deg" .
units:midiNote
a units:Unit ;
rdfs:label "MIDI note" ;
units:render "MIDI note %d" ;
units:symbol "note" .

View file

@ -1,56 +0,0 @@
@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/uri-map>
a doap:Project ;
doap:maintainer <http://drobilla.net/drobilla#me> ;
doap:created "2008-00-00" ;
doap:developer <http://lv2plug.in/ns/meta#larsl> ,
<http://drobilla.net/drobilla#me> ;
doap:license <http://opensource.org/licenses/isc> ;
doap:name "LV2 URI Map" ;
doap:shortdesc "A feature for mapping URIs to integers." ;
doap:release [
doap:revision "1.6" ;
doap:created "2012-04-17" ;
doap:file-release <http://lv2plug.in/spec/lv2-1.0.0.tar.bz2> ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Merge with unified LV2 package."
]
]
] , [
doap:revision "1.4" ;
doap:created "2011-11-21" ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Update packaging."
] , [
rdfs:label "Deprecate uri-map in favour of urid."
]
]
] , [
doap:revision "1.2" ;
doap:created "2011-05-26" ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Add build system (for installation)."
] , [
rdfs:label "Mark up documentation in HTML using lv2:documentation."
]
]
] , [
doap:revision "1.0" ;
doap:created "2010-10-18" ;
dcs:blame <http://drobilla.net/drobilla#me> ;
dcs:changeset [
dcs:item [
rdfs:label "Initial release."
]
]
] .

View file

@ -1,8 +0,0 @@
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://lv2plug.in/ns/ext/uri-map>
a lv2:Specification ;
lv2:minorVersion 1 ;
lv2:microVersion 6 ;
rdfs:seeAlso <uri-map.ttl> .

View file

@ -1,23 +1,14 @@
/*
Copyright 2008-2016 David Robillard <http://drobilla.net>
// Copyright 2008-2016 David Robillard <d@drobilla.net>
// SPDX-License-Identifier: ISC
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef LV2_URI_MAP_H
#define LV2_URI_MAP_H
/**
@defgroup uri-map URI Map
@ingroup lv2
C API for the LV2 URI Map extension <http://lv2plug.in/ns/ext/uri-map>.
A feature for mapping URIs to integers.
This extension defines a simple mechanism for plugins to map URIs to
integers, usually for performance reasons (e.g. processing events typed by
@ -27,15 +18,18 @@
This allows the extensibility of RDF with the performance of integers (or
centrally defined enumerations).
See <http://lv2plug.in/ns/ext/uri-map> for details.
@{
*/
#ifndef LV2_URI_MAP_H
#define LV2_URI_MAP_H
// clang-format off
#define LV2_URI_MAP_URI "http://lv2plug.in/ns/ext/uri-map" ///< http://lv2plug.in/ns/ext/uri-map
#define LV2_URI_MAP_PREFIX LV2_URI_MAP_URI "#" ///< http://lv2plug.in/ns/ext/uri-map#
// clang-format on
#include "lv2/core/attributes.h"
#include <stdint.h>
@ -107,8 +101,8 @@ LV2_RESTORE_WARNINGS
} /* extern "C" */
#endif
#endif /* LV2_URI_MAP_H */
/**
@}
*/
#endif /* LV2_URI_MAP_H */

View file

@ -1,24 +0,0 @@
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix umap: <http://lv2plug.in/ns/ext/uri-map#> .
<http://lv2plug.in/ns/ext/uri-map>
a lv2:Feature ;
owl:deprecated true ;
rdfs:seeAlso <uri-map.h> ,
<lv2-uri-map.doap.ttl> ;
lv2:documentation """
<p><span class="warning">This extension is deprecated.</span> New
implementations should use <a href="urid.html">LV2 URID</a>
instead.</p>
<p>This extension defines a simple mechanism for plugins to map URIs to
integers, usually for performance reasons (e.g. processing events typed by URIs
in real time). The expected use case is for plugins to map URIs to integers
for things they 'understand' at instantiation time, and store those values for
use in the audio thread without doing any string comparison. This allows the
extensibility of RDF with the performance of integers (or centrally defined
enumerations).</p>
""" .

Some files were not shown because too many files have changed in this diff Show more