Signed-off-by: falkTX <falktx@falktx.com>pull/375/head
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
Copyright 2008-2013 David Robillard <http://drobilla.net> | |||||
Copyright 2008-2016 David Robillard <http://drobilla.net> | |||||
Permission to use, copy, modify, and/or distribute this software for any | Permission to use, copy, modify, and/or distribute this software for any | ||||
purpose with or without fee is hereby granted, provided that the above | purpose with or without fee is hereby granted, provided that the above | ||||
@@ -39,6 +39,12 @@ | |||||
This header is non-normative, it is provided for convenience. | This header is non-normative, it is provided for convenience. | ||||
*/ | */ | ||||
/** | |||||
@defgroup forge Forge | |||||
@ingroup atom | |||||
@{ | |||||
*/ | |||||
#ifndef LV2_ATOM_FORGE_H | #ifndef LV2_ATOM_FORGE_H | ||||
#define LV2_ATOM_FORGE_H | #define LV2_ATOM_FORGE_H | ||||
@@ -48,7 +54,7 @@ | |||||
#include "atom-util.h" | #include "atom-util.h" | ||||
#include "urid.h" | #include "urid.h" | ||||
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) | |||||
#if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) | |||||
# define LV2_ATOM_FORGE_DEPRECATED __attribute__((__deprecated__)) | # define LV2_ATOM_FORGE_DEPRECATED __attribute__((__deprecated__)) | ||||
#else | #else | ||||
# define LV2_ATOM_FORGE_DEPRECATED | # define LV2_ATOM_FORGE_DEPRECATED | ||||
@@ -60,6 +66,15 @@ extern "C" { | |||||
# include <stdbool.h> | # include <stdbool.h> | ||||
#endif | #endif | ||||
// Disable deprecation warnings for Blank and Resource | |||||
#if defined(__clang__) | |||||
# pragma clang diagnostic push | |||||
# pragma clang diagnostic ignored "-Wdeprecated-declarations" | |||||
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||||
# pragma GCC diagnostic push | |||||
# pragma GCC diagnostic ignored "-Wdeprecated-declarations" | |||||
#endif | |||||
/** Handle for LV2_Atom_Forge_Sink. */ | /** Handle for LV2_Atom_Forge_Sink. */ | ||||
typedef void* LV2_Atom_Forge_Sink_Handle; | typedef void* LV2_Atom_Forge_Sink_Handle; | ||||
@@ -119,21 +134,14 @@ static inline void | |||||
lv2_atom_forge_set_buffer(LV2_Atom_Forge* forge, uint8_t* buf, size_t size); | lv2_atom_forge_set_buffer(LV2_Atom_Forge* forge, uint8_t* buf, size_t size); | ||||
/** | /** | ||||
Initialise @p forge. | |||||
Initialise `forge`. | |||||
URIs will be mapped using @p map and stored, a reference to @p map itself is | |||||
URIs will be mapped using `map` and stored, a reference to `map` itself is | |||||
not held. | not held. | ||||
*/ | */ | ||||
static inline void | static inline void | ||||
lv2_atom_forge_init(LV2_Atom_Forge* forge, const LV2_URID_Map* map) | lv2_atom_forge_init(LV2_Atom_Forge* forge, const LV2_URID_Map* map) | ||||
{ | { | ||||
#if defined(__clang__) | |||||
# pragma clang diagnostic push | |||||
# pragma clang diagnostic ignored "-Wdeprecated-declarations" | |||||
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||||
# pragma GCC diagnostic push | |||||
# pragma GCC diagnostic ignored "-Wdeprecated-declarations" | |||||
#endif | |||||
lv2_atom_forge_set_buffer(forge, NULL, 0); | lv2_atom_forge_set_buffer(forge, NULL, 0); | ||||
forge->Blank = map->map(map->handle, LV2_ATOM__Blank); | forge->Blank = map->map(map->handle, LV2_ATOM__Blank); | ||||
forge->Bool = map->map(map->handle, LV2_ATOM__Bool); | forge->Bool = map->map(map->handle, LV2_ATOM__Bool); | ||||
@@ -153,13 +161,9 @@ lv2_atom_forge_init(LV2_Atom_Forge* forge, const LV2_URID_Map* map) | |||||
forge->URI = map->map(map->handle, LV2_ATOM__URI); | forge->URI = map->map(map->handle, LV2_ATOM__URI); | ||||
forge->URID = map->map(map->handle, LV2_ATOM__URID); | forge->URID = map->map(map->handle, LV2_ATOM__URID); | ||||
forge->Vector = map->map(map->handle, LV2_ATOM__Vector); | forge->Vector = map->map(map->handle, LV2_ATOM__Vector); | ||||
#if defined(__clang__) | |||||
# pragma clang diagnostic pop | |||||
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||||
# pragma GCC diagnostic pop | |||||
#endif | |||||
} | } | ||||
/** Access the Atom pointed to by a reference. */ | |||||
static inline LV2_Atom* | static inline LV2_Atom* | ||||
lv2_atom_forge_deref(LV2_Atom_Forge* forge, LV2_Atom_Forge_Ref ref) | lv2_atom_forge_deref(LV2_Atom_Forge* forge, LV2_Atom_Forge_Ref ref) | ||||
{ | { | ||||
@@ -208,47 +212,23 @@ lv2_atom_forge_top_is(LV2_Atom_Forge* forge, uint32_t type) | |||||
(lv2_atom_forge_deref(forge, forge->stack->ref)->type == type); | (lv2_atom_forge_deref(forge, forge->stack->ref)->type == type); | ||||
} | } | ||||
/** Return true iff @p type is an atom:Object. */ | |||||
/** Return true iff `type` is an atom:Object. */ | |||||
static inline bool | static inline bool | ||||
lv2_atom_forge_is_object_type(const LV2_Atom_Forge* forge, uint32_t type) | lv2_atom_forge_is_object_type(const LV2_Atom_Forge* forge, uint32_t type) | ||||
{ | { | ||||
#if defined(__clang__) | |||||
# pragma clang diagnostic push | |||||
# pragma clang diagnostic ignored "-Wdeprecated-declarations" | |||||
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||||
# pragma GCC diagnostic push | |||||
# pragma GCC diagnostic ignored "-Wdeprecated-declarations" | |||||
#endif | |||||
return (type == forge->Object || | return (type == forge->Object || | ||||
type == forge->Blank || | type == forge->Blank || | ||||
type == forge->Resource); | type == forge->Resource); | ||||
#if defined(__clang__) | |||||
# pragma clang diagnostic pop | |||||
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||||
# pragma GCC diagnostic pop | |||||
#endif | |||||
} | } | ||||
/** Return true iff @p type is an atom:Object with a blank ID. */ | |||||
/** Return true iff `type` is an atom:Object with a blank ID. */ | |||||
static inline bool | static inline bool | ||||
lv2_atom_forge_is_blank(const LV2_Atom_Forge* forge, | lv2_atom_forge_is_blank(const LV2_Atom_Forge* forge, | ||||
uint32_t type, | uint32_t type, | ||||
const LV2_Atom_Object_Body* body) | const LV2_Atom_Object_Body* body) | ||||
{ | { | ||||
#if defined(__clang__) | |||||
# pragma clang diagnostic push | |||||
# pragma clang diagnostic ignored "-Wdeprecated-declarations" | |||||
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||||
# pragma GCC diagnostic push | |||||
# pragma GCC diagnostic ignored "-Wdeprecated-declarations" | |||||
#endif | |||||
return (type == forge->Blank || | return (type == forge->Blank || | ||||
(type == forge->Object && body->id == 0)); | (type == forge->Object && body->id == 0)); | ||||
#if defined(__clang__) | |||||
# pragma clang diagnostic pop | |||||
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||||
# pragma GCC diagnostic pop | |||||
#endif | |||||
} | } | ||||
/** | /** | ||||
@@ -257,7 +237,7 @@ lv2_atom_forge_is_blank(const LV2_Atom_Forge* forge, | |||||
@{ | @{ | ||||
*/ | */ | ||||
/** Set the output buffer where @p forge will write atoms. */ | |||||
/** Set the output buffer where `forge` will write atoms. */ | |||||
static inline void | static inline void | ||||
lv2_atom_forge_set_buffer(LV2_Atom_Forge* forge, uint8_t* buf, size_t size) | lv2_atom_forge_set_buffer(LV2_Atom_Forge* forge, uint8_t* buf, size_t size) | ||||
{ | { | ||||
@@ -271,7 +251,7 @@ lv2_atom_forge_set_buffer(LV2_Atom_Forge* forge, uint8_t* buf, size_t size) | |||||
} | } | ||||
/** | /** | ||||
Set the sink function where @p forge will write output. | |||||
Set the sink function where `forge` will write output. | |||||
The return value of forge functions is an LV2_Atom_Forge_Ref which is an | The return value of forge functions is an LV2_Atom_Forge_Ref which is an | ||||
integer type safe to use as a pointer but is otherwise opaque. The sink | integer type safe to use as a pointer but is otherwise opaque. The sink | ||||
@@ -456,7 +436,7 @@ lv2_atom_forge_typed_string(LV2_Atom_Forge* forge, | |||||
return out; | return out; | ||||
} | } | ||||
/** Write an atom:String. Note that @p str need not be NULL terminated. */ | |||||
/** Write an atom:String. Note that `str` need not be NULL terminated. */ | |||||
static inline LV2_Atom_Forge_Ref | static inline LV2_Atom_Forge_Ref | ||||
lv2_atom_forge_string(LV2_Atom_Forge* forge, const char* str, uint32_t len) | lv2_atom_forge_string(LV2_Atom_Forge* forge, const char* str, uint32_t len) | ||||
{ | { | ||||
@@ -464,7 +444,7 @@ lv2_atom_forge_string(LV2_Atom_Forge* forge, const char* str, uint32_t len) | |||||
} | } | ||||
/** | /** | ||||
Write an atom:URI. Note that @p uri need not be NULL terminated. | |||||
Write an atom:URI. Note that `uri` need not be NULL terminated. | |||||
This does not map the URI, but writes the complete URI string. To write | This does not map the URI, but writes the complete URI string. To write | ||||
a mapped URI, use lv2_atom_forge_urid(). | a mapped URI, use lv2_atom_forge_urid(). | ||||
*/ | */ | ||||
@@ -474,7 +454,7 @@ lv2_atom_forge_uri(LV2_Atom_Forge* forge, const char* uri, uint32_t len) | |||||
return lv2_atom_forge_typed_string(forge, forge->URI, uri, len); | return lv2_atom_forge_typed_string(forge, forge->URI, uri, len); | ||||
} | } | ||||
/** Write an atom:Path. Note that @p path need not be NULL terminated. */ | |||||
/** Write an atom:Path. Note that `path` need not be NULL terminated. */ | |||||
static inline LV2_Atom_Forge_Ref | static inline LV2_Atom_Forge_Ref | ||||
lv2_atom_forge_path(LV2_Atom_Forge* forge, const char* path, uint32_t len) | lv2_atom_forge_path(LV2_Atom_Forge* forge, const char* path, uint32_t len) | ||||
{ | { | ||||
@@ -617,24 +597,12 @@ lv2_atom_forge_resource(LV2_Atom_Forge* forge, | |||||
LV2_URID id, | LV2_URID id, | ||||
LV2_URID otype) | LV2_URID otype) | ||||
{ | { | ||||
#if defined(__clang__) | |||||
# pragma clang diagnostic push | |||||
# pragma clang diagnostic ignored "-Wdeprecated-declarations" | |||||
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||||
# pragma GCC diagnostic push | |||||
# pragma GCC diagnostic ignored "-Wdeprecated-declarations" | |||||
#endif | |||||
const LV2_Atom_Object a = { | const LV2_Atom_Object a = { | ||||
{ (uint32_t)sizeof(LV2_Atom_Object_Body), forge->Resource }, | { (uint32_t)sizeof(LV2_Atom_Object_Body), forge->Resource }, | ||||
{ id, otype } | { id, otype } | ||||
}; | }; | ||||
return lv2_atom_forge_push( | return lv2_atom_forge_push( | ||||
forge, frame, lv2_atom_forge_write(forge, &a, sizeof(a))); | forge, frame, lv2_atom_forge_write(forge, &a, sizeof(a))); | ||||
#if defined(__clang__) | |||||
# pragma clang diagnostic pop | |||||
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||||
# pragma GCC diagnostic pop | |||||
#endif | |||||
} | } | ||||
/** | /** | ||||
@@ -650,24 +618,12 @@ lv2_atom_forge_blank(LV2_Atom_Forge* forge, | |||||
uint32_t id, | uint32_t id, | ||||
LV2_URID otype) | LV2_URID otype) | ||||
{ | { | ||||
#if defined(__clang__) | |||||
# pragma clang diagnostic push | |||||
# pragma clang diagnostic ignored "-Wdeprecated-declarations" | |||||
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||||
# pragma GCC diagnostic push | |||||
# pragma GCC diagnostic ignored "-Wdeprecated-declarations" | |||||
#endif | |||||
const LV2_Atom_Object a = { | const LV2_Atom_Object a = { | ||||
{ (uint32_t)sizeof(LV2_Atom_Object_Body), forge->Blank }, | { (uint32_t)sizeof(LV2_Atom_Object_Body), forge->Blank }, | ||||
{ id, otype } | { id, otype } | ||||
}; | }; | ||||
return lv2_atom_forge_push( | return lv2_atom_forge_push( | ||||
forge, frame, lv2_atom_forge_write(forge, &a, sizeof(a))); | forge, frame, lv2_atom_forge_write(forge, &a, sizeof(a))); | ||||
#if defined(__clang__) | |||||
# pragma clang diagnostic pop | |||||
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||||
# pragma GCC diagnostic pop | |||||
#endif | |||||
} | } | ||||
/** | /** | ||||
@@ -738,8 +694,15 @@ lv2_atom_forge_beat_time(LV2_Atom_Forge* forge, double beats) | |||||
/** | /** | ||||
@} | @} | ||||
@} | |||||
*/ | */ | ||||
#if defined(__clang__) | |||||
# pragma clang diagnostic pop | |||||
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||||
# pragma GCC diagnostic pop | |||||
#endif | |||||
#ifdef __cplusplus | #ifdef __cplusplus | ||||
} /* extern "C" */ | } /* extern "C" */ | ||||
#endif | #endif | ||||
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
Copyright 2008-2013 David Robillard <http://drobilla.net> | |||||
Copyright 2008-2015 David Robillard <http://drobilla.net> | |||||
Permission to use, copy, modify, and/or distribute this software for any | Permission to use, copy, modify, and/or distribute this software for any | ||||
purpose with or without fee is hereby granted, provided that the above | purpose with or without fee is hereby granted, provided that the above | ||||
@@ -22,6 +22,12 @@ | |||||
This header is non-normative, it is provided for convenience. | This header is non-normative, it is provided for convenience. | ||||
*/ | */ | ||||
/** | |||||
@defgroup util Utilities | |||||
@ingroup atom | |||||
@{ | |||||
*/ | |||||
#ifndef LV2_ATOM_UTIL_H | #ifndef LV2_ATOM_UTIL_H | ||||
#define LV2_ATOM_UTIL_H | #define LV2_ATOM_UTIL_H | ||||
@@ -44,21 +50,21 @@ lv2_atom_pad_size(uint32_t size) | |||||
return (size + 7U) & (~7U); | return (size + 7U) & (~7U); | ||||
} | } | ||||
/** Return the total size of @p atom, including the header. */ | |||||
/** Return the total size of `atom`, including the header. */ | |||||
static inline uint32_t | static inline uint32_t | ||||
lv2_atom_total_size(const LV2_Atom* atom) | lv2_atom_total_size(const LV2_Atom* atom) | ||||
{ | { | ||||
return (uint32_t)sizeof(LV2_Atom) + atom->size; | return (uint32_t)sizeof(LV2_Atom) + atom->size; | ||||
} | } | ||||
/** Return true iff @p atom is null. */ | |||||
/** Return true iff `atom` is null. */ | |||||
static inline bool | static inline bool | ||||
lv2_atom_is_null(const LV2_Atom* atom) | lv2_atom_is_null(const LV2_Atom* atom) | ||||
{ | { | ||||
return !atom || (atom->type == 0 && atom->size == 0); | return !atom || (atom->type == 0 && atom->size == 0); | ||||
} | } | ||||
/** Return true iff @p a is equal to @p b. */ | |||||
/** Return true iff `a` is equal to `b`. */ | |||||
static inline bool | static inline bool | ||||
lv2_atom_equals(const LV2_Atom* a, const LV2_Atom* b) | lv2_atom_equals(const LV2_Atom* a, const LV2_Atom* b) | ||||
{ | { | ||||
@@ -79,14 +85,21 @@ lv2_atom_sequence_begin(const LV2_Atom_Sequence_Body* body) | |||||
return (const LV2_Atom_Event*)(body + 1); | return (const LV2_Atom_Event*)(body + 1); | ||||
} | } | ||||
/** Get an iterator pointing to the end of a Sequence body. */ | |||||
static inline const LV2_Atom_Event* | |||||
lv2_atom_sequence_end(const LV2_Atom_Sequence_Body* body, uint32_t size) | |||||
{ | |||||
return (const LV2_Atom_Event*)((const uint8_t*)body + lv2_atom_pad_size(size)); | |||||
} | |||||
/** Get an iterator pointing to the end of a Sequence body. */ | /** Get an iterator pointing to the end of a Sequence body. */ | ||||
static inline LV2_Atom_Event* | static inline LV2_Atom_Event* | ||||
lv2_atom_sequence_end(LV2_Atom_Sequence_Body* body, uint32_t size) | |||||
lv2_atom_sequence_end2(LV2_Atom_Sequence_Body* body, uint32_t size) | |||||
{ | { | ||||
return (LV2_Atom_Event*)((uint8_t*)body + lv2_atom_pad_size(size)); | return (LV2_Atom_Event*)((uint8_t*)body + lv2_atom_pad_size(size)); | ||||
} | } | ||||
/** Return true iff @p i has reached the end of @p body. */ | |||||
/** Return true iff `i` has reached the end of `body`. */ | |||||
static inline bool | static inline bool | ||||
lv2_atom_sequence_is_end(const LV2_Atom_Sequence_Body* body, | lv2_atom_sequence_is_end(const LV2_Atom_Sequence_Body* body, | ||||
uint32_t size, | uint32_t size, | ||||
@@ -95,7 +108,7 @@ lv2_atom_sequence_is_end(const LV2_Atom_Sequence_Body* body, | |||||
return (const uint8_t*)i >= ((const uint8_t*)body + size); | return (const uint8_t*)i >= ((const uint8_t*)body + size); | ||||
} | } | ||||
/** Return an iterator to the element following @p i. */ | |||||
/** Return an iterator to the element following `i`. */ | |||||
static inline const LV2_Atom_Event* | static inline const LV2_Atom_Event* | ||||
lv2_atom_sequence_next(const LV2_Atom_Event* i) | lv2_atom_sequence_next(const LV2_Atom_Event* i) | ||||
{ | { | ||||
@@ -119,13 +132,13 @@ lv2_atom_sequence_next(const LV2_Atom_Event* i) | |||||
#define LV2_ATOM_SEQUENCE_FOREACH(seq, iter) \ | #define LV2_ATOM_SEQUENCE_FOREACH(seq, iter) \ | ||||
for (const LV2_Atom_Event* iter = lv2_atom_sequence_begin(&(seq)->body); \ | for (const LV2_Atom_Event* iter = lv2_atom_sequence_begin(&(seq)->body); \ | ||||
!lv2_atom_sequence_is_end(&(seq)->body, (seq)->atom.size, (iter)); \ | !lv2_atom_sequence_is_end(&(seq)->body, (seq)->atom.size, (iter)); \ | ||||
(iter) = lv2_atom_sequence_next(iter)) | |||||
iter = lv2_atom_sequence_next(iter)) | |||||
/** Like LV2_ATOM_SEQUENCE_FOREACH but for a headerless sequence body. */ | /** Like LV2_ATOM_SEQUENCE_FOREACH but for a headerless sequence body. */ | ||||
#define LV2_ATOM_SEQUENCE_BODY_FOREACH(body, size, iter) \ | #define LV2_ATOM_SEQUENCE_BODY_FOREACH(body, size, iter) \ | ||||
for (const LV2_Atom_Event* iter = lv2_atom_sequence_begin(body); \ | for (const LV2_Atom_Event* iter = lv2_atom_sequence_begin(body); \ | ||||
!lv2_atom_sequence_is_end(body, size, (iter)); \ | !lv2_atom_sequence_is_end(body, size, (iter)); \ | ||||
(iter) = lv2_atom_sequence_next(iter)) | |||||
iter = lv2_atom_sequence_next(iter)) | |||||
/** | /** | ||||
@} | @} | ||||
@@ -134,7 +147,7 @@ lv2_atom_sequence_next(const LV2_Atom_Event* i) | |||||
*/ | */ | ||||
/** | /** | ||||
Clear all events from @p sequence. | |||||
Clear all events from `sequence`. | |||||
This simply resets the size field, the other fields are left untouched. | This simply resets the size field, the other fields are left untouched. | ||||
*/ | */ | ||||
@@ -145,14 +158,14 @@ lv2_atom_sequence_clear(LV2_Atom_Sequence* seq) | |||||
} | } | ||||
/** | /** | ||||
Append an event at the end of @p sequence. | |||||
Append an event at the end of `sequence`. | |||||
@param seq Sequence to append to. | @param seq Sequence to append to. | ||||
@param capacity Total capacity of the sequence atom | @param capacity Total capacity of the sequence atom | ||||
(e.g. as set by the host for sequence output ports). | (e.g. as set by the host for sequence output ports). | ||||
@param event Event to write. | @param event Event to write. | ||||
@return A pointer to the newly written event in @p seq, | |||||
@return A pointer to the newly written event in `seq`, | |||||
or NULL on failure (insufficient space). | or NULL on failure (insufficient space). | ||||
*/ | */ | ||||
static inline LV2_Atom_Event* | static inline LV2_Atom_Event* | ||||
@@ -165,7 +178,7 @@ lv2_atom_sequence_append_event(LV2_Atom_Sequence* seq, | |||||
return NULL; | return NULL; | ||||
} | } | ||||
LV2_Atom_Event* e = lv2_atom_sequence_end(&seq->body, seq->atom.size); | |||||
LV2_Atom_Event* e = lv2_atom_sequence_end2(&seq->body, seq->atom.size); | |||||
memcpy(e, event, total_size); | memcpy(e, event, total_size); | ||||
seq->atom.size += lv2_atom_pad_size(total_size); | seq->atom.size += lv2_atom_pad_size(total_size); | ||||
@@ -179,21 +192,21 @@ lv2_atom_sequence_append_event(LV2_Atom_Sequence* seq, | |||||
@{ | @{ | ||||
*/ | */ | ||||
/** Get an iterator pointing to the first element in @p tup. */ | |||||
/** Get an iterator pointing to the first element in `tup`. */ | |||||
static inline const LV2_Atom* | static inline const LV2_Atom* | ||||
lv2_atom_tuple_begin(const LV2_Atom_Tuple* tup) | lv2_atom_tuple_begin(const LV2_Atom_Tuple* tup) | ||||
{ | { | ||||
return (const LV2_Atom*)(LV2_ATOM_BODY_CONST(tup)); | return (const LV2_Atom*)(LV2_ATOM_BODY_CONST(tup)); | ||||
} | } | ||||
/** Return true iff @p i has reached the end of @p body. */ | |||||
/** Return true iff `i` has reached the end of `body`. */ | |||||
static inline bool | static inline bool | ||||
lv2_atom_tuple_is_end(const void* body, uint32_t size, const LV2_Atom* i) | lv2_atom_tuple_is_end(const void* body, uint32_t size, const LV2_Atom* i) | ||||
{ | { | ||||
return (const uint8_t*)i >= ((const uint8_t*)body + size); | return (const uint8_t*)i >= ((const uint8_t*)body + size); | ||||
} | } | ||||
/** Return an iterator to the element following @p i. */ | |||||
/** Return an iterator to the element following `i`. */ | |||||
static inline const LV2_Atom* | static inline const LV2_Atom* | ||||
lv2_atom_tuple_next(const LV2_Atom* i) | lv2_atom_tuple_next(const LV2_Atom* i) | ||||
{ | { | ||||
@@ -208,21 +221,21 @@ lv2_atom_tuple_next(const LV2_Atom* i) | |||||
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), e.g.: | ||||
@code | @code | ||||
LV2_ATOMO_TUPLE_FOREACH(tuple, elem) { | |||||
LV2_ATOM_TUPLE_FOREACH(tuple, elem) { | |||||
// Do something with elem (an LV2_Atom*) here... | // Do something with elem (an LV2_Atom*) here... | ||||
} | } | ||||
@endcode | @endcode | ||||
*/ | */ | ||||
#define LV2_ATOM_TUPLE_FOREACH(tuple, iter) \ | #define LV2_ATOM_TUPLE_FOREACH(tuple, iter) \ | ||||
for (const LV2_Atom* iter = lv2_atom_tuple_begin(tuple); \ | for (const LV2_Atom* iter = lv2_atom_tuple_begin(tuple); \ | ||||
!lv2_atom_tuple_is_end(LV2_ATOM_BODY_CONST(tuple), (tuple)->size, (iter)); \ | |||||
(iter) = lv2_atom_tuple_next(iter)) | |||||
!lv2_atom_tuple_is_end(LV2_ATOM_BODY_CONST(tuple), (tuple)->atom.size, (iter)); \ | |||||
iter = lv2_atom_tuple_next(iter)) | |||||
/** Like LV2_ATOM_TUPLE_FOREACH but for a headerless tuple body. */ | /** Like LV2_ATOM_TUPLE_FOREACH but for a headerless tuple body. */ | ||||
#define LV2_ATOM_TUPLE_BODY_FOREACH(body, size, iter) \ | #define LV2_ATOM_TUPLE_BODY_FOREACH(body, size, iter) \ | ||||
for (const LV2_Atom* iter = (const LV2_Atom*)body; \ | for (const LV2_Atom* iter = (const LV2_Atom*)body; \ | ||||
!lv2_atom_tuple_is_end(body, size, (iter)); \ | !lv2_atom_tuple_is_end(body, size, (iter)); \ | ||||
(iter) = lv2_atom_tuple_next(iter)) | |||||
iter = lv2_atom_tuple_next(iter)) | |||||
/** | /** | ||||
@} | @} | ||||
@@ -230,14 +243,14 @@ lv2_atom_tuple_next(const LV2_Atom* i) | |||||
@{ | @{ | ||||
*/ | */ | ||||
/** Return a pointer to the first property in @p body. */ | |||||
/** Return a pointer to the first property in `body`. */ | |||||
static inline const LV2_Atom_Property_Body* | static inline const LV2_Atom_Property_Body* | ||||
lv2_atom_object_begin(const LV2_Atom_Object_Body* body) | lv2_atom_object_begin(const LV2_Atom_Object_Body* body) | ||||
{ | { | ||||
return (const LV2_Atom_Property_Body*)(body + 1); | return (const LV2_Atom_Property_Body*)(body + 1); | ||||
} | } | ||||
/** Return true iff @p i has reached the end of @p obj. */ | |||||
/** Return true iff `i` has reached the end of `obj`. */ | |||||
static inline bool | static inline bool | ||||
lv2_atom_object_is_end(const LV2_Atom_Object_Body* body, | lv2_atom_object_is_end(const LV2_Atom_Object_Body* body, | ||||
uint32_t size, | uint32_t size, | ||||
@@ -246,7 +259,7 @@ lv2_atom_object_is_end(const LV2_Atom_Object_Body* body, | |||||
return (const uint8_t*)i >= ((const uint8_t*)body + size); | return (const uint8_t*)i >= ((const uint8_t*)body + size); | ||||
} | } | ||||
/** Return an iterator to the property following @p i. */ | |||||
/** Return an iterator to the property following `i`. */ | |||||
static inline const LV2_Atom_Property_Body* | static inline const LV2_Atom_Property_Body* | ||||
lv2_atom_object_next(const LV2_Atom_Property_Body* i) | lv2_atom_object_next(const LV2_Atom_Property_Body* i) | ||||
{ | { | ||||
@@ -272,13 +285,13 @@ lv2_atom_object_next(const LV2_Atom_Property_Body* i) | |||||
#define LV2_ATOM_OBJECT_FOREACH(obj, iter) \ | #define LV2_ATOM_OBJECT_FOREACH(obj, iter) \ | ||||
for (const LV2_Atom_Property_Body* iter = lv2_atom_object_begin(&(obj)->body); \ | for (const LV2_Atom_Property_Body* iter = lv2_atom_object_begin(&(obj)->body); \ | ||||
!lv2_atom_object_is_end(&(obj)->body, (obj)->atom.size, (iter)); \ | !lv2_atom_object_is_end(&(obj)->body, (obj)->atom.size, (iter)); \ | ||||
(iter) = lv2_atom_object_next(iter)) | |||||
iter = lv2_atom_object_next(iter)) | |||||
/** Like LV2_ATOM_OBJECT_FOREACH but for a headerless object body. */ | /** Like LV2_ATOM_OBJECT_FOREACH but for a headerless object body. */ | ||||
#define LV2_ATOM_OBJECT_BODY_FOREACH(body, size, iter) \ | #define LV2_ATOM_OBJECT_BODY_FOREACH(body, size, iter) \ | ||||
for (const LV2_Atom_Property_Body* iter = lv2_atom_object_begin(body); \ | for (const LV2_Atom_Property_Body* iter = lv2_atom_object_begin(body); \ | ||||
!lv2_atom_object_is_end(body, size, (iter)); \ | !lv2_atom_object_is_end(body, size, (iter)); \ | ||||
(iter) = lv2_atom_object_next(iter)) | |||||
iter = lv2_atom_object_next(iter)) | |||||
/** | /** | ||||
@} | @} | ||||
@@ -297,10 +310,10 @@ static const LV2_Atom_Object_Query LV2_ATOM_OBJECT_QUERY_END = { 0, NULL }; | |||||
/** | /** | ||||
Get an object's values for various keys. | Get an object's values for various keys. | ||||
The value pointer of each item in @p query will be set to the location of | |||||
the corresponding value in @p object. Every value pointer in @p query MUST | |||||
be initialised to NULL. This function reads @p object in a single linear | |||||
sweep. By allocating @p query on the stack, objects can be "queried" | |||||
The value pointer of each item in `query` will be set to the location of | |||||
the corresponding value in `object`. Every value pointer in `query` MUST | |||||
be initialised to NULL. This function reads `object` in a single linear | |||||
sweep. By allocating `query` on the stack, objects can be "queried" | |||||
quickly without allocating any memory. This function is realtime safe. | quickly without allocating any memory. This function is realtime safe. | ||||
This function can only do "flat" queries, it is not smart enough to match | This function can only do "flat" queries, it is not smart enough to match | ||||
@@ -359,6 +372,7 @@ lv2_atom_object_body_get(uint32_t size, const LV2_Atom_Object_Body* body, ...) | |||||
va_start(args, body); | va_start(args, body); | ||||
for (n_queries = 0; va_arg(args, uint32_t); ++n_queries) { | for (n_queries = 0; va_arg(args, uint32_t); ++n_queries) { | ||||
if (!va_arg(args, const LV2_Atom**)) { | if (!va_arg(args, const LV2_Atom**)) { | ||||
va_end(args); | |||||
return -1; | return -1; | ||||
} | } | ||||
} | } | ||||
@@ -372,6 +386,7 @@ lv2_atom_object_body_get(uint32_t size, const LV2_Atom_Object_Body* body, ...) | |||||
if (qkey == prop->key && !*qval) { | if (qkey == prop->key && !*qval) { | ||||
*qval = &prop->value; | *qval = &prop->value; | ||||
if (++matches == n_queries) { | if (++matches == n_queries) { | ||||
va_end(args); | |||||
return matches; | return matches; | ||||
} | } | ||||
break; | break; | ||||
@@ -436,6 +451,63 @@ lv2_atom_object_get(const LV2_Atom_Object* object, ...) | |||||
} | } | ||||
/** | /** | ||||
Variable argument version of lv2_atom_object_query() with types. | |||||
This is like lv2_atom_object_get(), but each entry has an additional | |||||
parameter to specify the required type. Only atoms with a matching type | |||||
will be selected. | |||||
The arguments should be a series of uint32_t key, const LV2_Atom**, uint32_t | |||||
type triples, terminated by a zero key. The value pointers MUST be | |||||
initialized to NULL. For example: | |||||
@code | |||||
const LV2_Atom_String* name = NULL; | |||||
const LV2_Atom_Int* age = NULL; | |||||
lv2_atom_object_get(obj, | |||||
uris.name_key, &name, uris.atom_String, | |||||
uris.age_key, &age, uris.atom_Int | |||||
0); | |||||
@endcode | |||||
*/ | |||||
static inline int | |||||
lv2_atom_object_get_typed(const LV2_Atom_Object* object, ...) | |||||
{ | |||||
int matches = 0; | |||||
int n_queries = 0; | |||||
/* Count number of keys so we can short-circuit when done */ | |||||
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)) { | |||||
return -1; | |||||
} | |||||
} | |||||
va_end(args); | |||||
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); | |||||
const LV2_Atom** qval = va_arg(args, const LV2_Atom**); | |||||
const uint32_t qtype = va_arg(args, uint32_t); | |||||
if (!*qval && qkey == prop->key && qtype == prop->value.type) { | |||||
*qval = &prop->value; | |||||
if (++matches == n_queries) { | |||||
return matches; | |||||
} | |||||
break; | |||||
} | |||||
} | |||||
va_end(args); | |||||
} | |||||
return matches; | |||||
} | |||||
/** | |||||
@} | |||||
@} | @} | ||||
*/ | */ | ||||
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
Copyright 2008-2012 David Robillard <http://drobilla.net> | |||||
Copyright 2008-2016 David Robillard <http://drobilla.net> | |||||
Permission to use, copy, modify, and/or distribute this software for any | Permission to use, copy, modify, and/or distribute this software for any | ||||
purpose with or without fee is hereby granted, provided that the above | purpose with or without fee is hereby granted, provided that the above | ||||
@@ -15,8 +15,12 @@ | |||||
*/ | */ | ||||
/** | /** | ||||
@file atom.h C header for the LV2 Atom extension | |||||
<http://lv2plug.in/ns/ext/atom>. | |||||
@defgroup atom Atom | |||||
A generic value container and several data types, see | |||||
<http://lv2plug.in/ns/ext/atom> for details. | |||||
@{ | |||||
*/ | */ | ||||
#ifndef LV2_ATOM_H | #ifndef LV2_ATOM_H | ||||
@@ -25,50 +29,52 @@ | |||||
#include <stdint.h> | #include <stdint.h> | ||||
#include <stddef.h> | #include <stddef.h> | ||||
#define LV2_ATOM_URI "http://lv2plug.in/ns/ext/atom" | |||||
#define LV2_ATOM_PREFIX LV2_ATOM_URI "#" | |||||
#define LV2_ATOM__Atom LV2_ATOM_PREFIX "Atom" | |||||
#define LV2_ATOM__AtomPort LV2_ATOM_PREFIX "AtomPort" | |||||
#define LV2_ATOM__Blank LV2_ATOM_PREFIX "Blank" | |||||
#define LV2_ATOM__Bool LV2_ATOM_PREFIX "Bool" | |||||
#define LV2_ATOM__Chunk LV2_ATOM_PREFIX "Chunk" | |||||
#define LV2_ATOM__Double LV2_ATOM_PREFIX "Double" | |||||
#define LV2_ATOM__Event LV2_ATOM_PREFIX "Event" | |||||
#define LV2_ATOM__Float LV2_ATOM_PREFIX "Float" | |||||
#define LV2_ATOM__Int LV2_ATOM_PREFIX "Int" | |||||
#define LV2_ATOM__Literal LV2_ATOM_PREFIX "Literal" | |||||
#define LV2_ATOM__Long LV2_ATOM_PREFIX "Long" | |||||
#define LV2_ATOM__Number LV2_ATOM_PREFIX "Number" | |||||
#define LV2_ATOM__Object LV2_ATOM_PREFIX "Object" | |||||
#define LV2_ATOM__Path LV2_ATOM_PREFIX "Path" | |||||
#define LV2_ATOM__Property LV2_ATOM_PREFIX "Property" | |||||
#define LV2_ATOM__Resource LV2_ATOM_PREFIX "Resource" | |||||
#define LV2_ATOM__Sequence LV2_ATOM_PREFIX "Sequence" | |||||
#define LV2_ATOM__Sound LV2_ATOM_PREFIX "Sound" | |||||
#define LV2_ATOM__String LV2_ATOM_PREFIX "String" | |||||
#define LV2_ATOM__Tuple LV2_ATOM_PREFIX "Tuple" | |||||
#define LV2_ATOM__URI LV2_ATOM_PREFIX "URI" | |||||
#define LV2_ATOM__URID LV2_ATOM_PREFIX "URID" | |||||
#define LV2_ATOM__Vector LV2_ATOM_PREFIX "Vector" | |||||
#define LV2_ATOM__atomTransfer LV2_ATOM_PREFIX "atomTransfer" | |||||
#define LV2_ATOM__beatTime LV2_ATOM_PREFIX "beatTime" | |||||
#define LV2_ATOM__bufferType LV2_ATOM_PREFIX "bufferType" | |||||
#define LV2_ATOM__childType LV2_ATOM_PREFIX "childType" | |||||
#define LV2_ATOM__eventTransfer LV2_ATOM_PREFIX "eventTransfer" | |||||
#define LV2_ATOM__frameTime LV2_ATOM_PREFIX "frameTime" | |||||
#define LV2_ATOM__supports LV2_ATOM_PREFIX "supports" | |||||
#define LV2_ATOM__timeUnit LV2_ATOM_PREFIX "timeUnit" | |||||
#define LV2_ATOM_REFERENCE_TYPE 0 | |||||
#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# | |||||
#define LV2_ATOM__Atom LV2_ATOM_PREFIX "Atom" ///< http://lv2plug.in/ns/ext/atom#Atom | |||||
#define LV2_ATOM__AtomPort LV2_ATOM_PREFIX "AtomPort" ///< http://lv2plug.in/ns/ext/atom#AtomPort | |||||
#define LV2_ATOM__Blank LV2_ATOM_PREFIX "Blank" ///< http://lv2plug.in/ns/ext/atom#Blank | |||||
#define LV2_ATOM__Bool LV2_ATOM_PREFIX "Bool" ///< http://lv2plug.in/ns/ext/atom#Bool | |||||
#define LV2_ATOM__Chunk LV2_ATOM_PREFIX "Chunk" ///< http://lv2plug.in/ns/ext/atom#Chunk | |||||
#define LV2_ATOM__Double LV2_ATOM_PREFIX "Double" ///< http://lv2plug.in/ns/ext/atom#Double | |||||
#define LV2_ATOM__Event LV2_ATOM_PREFIX "Event" ///< http://lv2plug.in/ns/ext/atom#Event | |||||
#define LV2_ATOM__Float LV2_ATOM_PREFIX "Float" ///< http://lv2plug.in/ns/ext/atom#Float | |||||
#define LV2_ATOM__Int LV2_ATOM_PREFIX "Int" ///< http://lv2plug.in/ns/ext/atom#Int | |||||
#define LV2_ATOM__Literal LV2_ATOM_PREFIX "Literal" ///< http://lv2plug.in/ns/ext/atom#Literal | |||||
#define LV2_ATOM__Long LV2_ATOM_PREFIX "Long" ///< http://lv2plug.in/ns/ext/atom#Long | |||||
#define LV2_ATOM__Number LV2_ATOM_PREFIX "Number" ///< http://lv2plug.in/ns/ext/atom#Number | |||||
#define LV2_ATOM__Object LV2_ATOM_PREFIX "Object" ///< http://lv2plug.in/ns/ext/atom#Object | |||||
#define LV2_ATOM__Path LV2_ATOM_PREFIX "Path" ///< http://lv2plug.in/ns/ext/atom#Path | |||||
#define LV2_ATOM__Property LV2_ATOM_PREFIX "Property" ///< http://lv2plug.in/ns/ext/atom#Property | |||||
#define LV2_ATOM__Resource LV2_ATOM_PREFIX "Resource" ///< http://lv2plug.in/ns/ext/atom#Resource | |||||
#define LV2_ATOM__Sequence LV2_ATOM_PREFIX "Sequence" ///< http://lv2plug.in/ns/ext/atom#Sequence | |||||
#define LV2_ATOM__Sound LV2_ATOM_PREFIX "Sound" ///< http://lv2plug.in/ns/ext/atom#Sound | |||||
#define LV2_ATOM__String LV2_ATOM_PREFIX "String" ///< http://lv2plug.in/ns/ext/atom#String | |||||
#define LV2_ATOM__Tuple LV2_ATOM_PREFIX "Tuple" ///< http://lv2plug.in/ns/ext/atom#Tuple | |||||
#define LV2_ATOM__URI LV2_ATOM_PREFIX "URI" ///< http://lv2plug.in/ns/ext/atom#URI | |||||
#define LV2_ATOM__URID LV2_ATOM_PREFIX "URID" ///< http://lv2plug.in/ns/ext/atom#URID | |||||
#define LV2_ATOM__Vector LV2_ATOM_PREFIX "Vector" ///< http://lv2plug.in/ns/ext/atom#Vector | |||||
#define LV2_ATOM__atomTransfer LV2_ATOM_PREFIX "atomTransfer" ///< http://lv2plug.in/ns/ext/atom#atomTransfer | |||||
#define LV2_ATOM__beatTime LV2_ATOM_PREFIX "beatTime" ///< http://lv2plug.in/ns/ext/atom#beatTime | |||||
#define LV2_ATOM__bufferType LV2_ATOM_PREFIX "bufferType" ///< http://lv2plug.in/ns/ext/atom#bufferType | |||||
#define LV2_ATOM__childType LV2_ATOM_PREFIX "childType" ///< http://lv2plug.in/ns/ext/atom#childType | |||||
#define LV2_ATOM__eventTransfer LV2_ATOM_PREFIX "eventTransfer" ///< http://lv2plug.in/ns/ext/atom#eventTransfer | |||||
#define LV2_ATOM__frameTime LV2_ATOM_PREFIX "frameTime" ///< http://lv2plug.in/ns/ext/atom#frameTime | |||||
#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 | |||||
#define LV2_ATOM_REFERENCE_TYPE 0 ///< The special type for a reference atom | |||||
#ifdef __cplusplus | #ifdef __cplusplus | ||||
extern "C" { | extern "C" { | ||||
#endif | #endif | ||||
/** @cond */ | |||||
/** This expression will fail to compile if double does not fit in 64 bits. */ | /** This expression will fail to compile if double does not fit in 64 bits. */ | ||||
typedef char lv2_atom_assert_double_fits_in_64_bits[ | typedef char lv2_atom_assert_double_fits_in_64_bits[ | ||||
((sizeof(double) <= sizeof(uint64_t)) * 2) - 1]; | ((sizeof(double) <= sizeof(uint64_t)) * 2) - 1]; | ||||
/** @endcond */ | |||||
/** | /** | ||||
Return a pointer to the contents of an Atom. The "contents" of an atom | Return a pointer to the contents of an Atom. The "contents" of an atom | ||||
@@ -239,6 +245,10 @@ typedef struct { | |||||
LV2_Atom_Sequence_Body body; /**< Body. */ | LV2_Atom_Sequence_Body body; /**< Body. */ | ||||
} LV2_Atom_Sequence; | } LV2_Atom_Sequence; | ||||
/** | |||||
@} | |||||
*/ | |||||
#ifdef __cplusplus | #ifdef __cplusplus | ||||
} /* extern "C" */ | } /* extern "C" */ | ||||
#endif | #endif | ||||
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
Copyright 2007-2012 David Robillard <http://drobilla.net> | |||||
Copyright 2007-2016 David Robillard <http://drobilla.net> | |||||
Permission to use, copy, modify, and/or distribute this software for any | Permission to use, copy, modify, and/or distribute this software for any | ||||
purpose with or without fee is hereby granted, provided that the above | purpose with or without fee is hereby granted, provided that the above | ||||
@@ -17,15 +17,28 @@ | |||||
#ifndef LV2_BUF_SIZE_H | #ifndef LV2_BUF_SIZE_H | ||||
#define LV2_BUF_SIZE_H | #define LV2_BUF_SIZE_H | ||||
#define LV2_BUF_SIZE_URI "http://lv2plug.in/ns/ext/buf-size" | |||||
#define LV2_BUF_SIZE_PREFIX LV2_BUF_SIZE_URI "#" | |||||
/** | |||||
@defgroup buf-size Buffer Size | |||||
#define LV2_BUF_SIZE__boundedBlockLength LV2_BUF_SIZE_PREFIX "boundedBlockLength" | |||||
#define LV2_BUF_SIZE__fixedBlockLength LV2_BUF_SIZE_PREFIX "fixedBlockLength" | |||||
#define LV2_BUF_SIZE__maxBlockLength LV2_BUF_SIZE_PREFIX "maxBlockLength" | |||||
#define LV2_BUF_SIZE__minBlockLength LV2_BUF_SIZE_PREFIX "minBlockLength" | |||||
#define LV2_BUF_SIZE__nominalBlockLength LV2_BUF_SIZE_PREFIX "nominalBlockLength" | |||||
#define LV2_BUF_SIZE__powerOf2BlockLength LV2_BUF_SIZE_PREFIX "powerOf2BlockLength" | |||||
#define LV2_BUF_SIZE__sequenceSize LV2_BUF_SIZE_PREFIX "sequenceSize" | |||||
Access to, and restrictions on, buffer sizes; see | |||||
<http://lv2plug.in/ns/ext/buf-size> for details. | |||||
@{ | |||||
*/ | |||||
#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__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 | |||||
#define LV2_BUF_SIZE__nominalBlockLength LV2_BUF_SIZE_PREFIX "nominalBlockLength" ///< http://lv2plug.in/ns/ext/buf-size#nominalBlockLength | |||||
#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 | |||||
/** | |||||
@} | |||||
*/ | |||||
#endif /* LV2_BUF_SIZE_H */ | #endif /* LV2_BUF_SIZE_H */ |
@@ -1,6 +1,6 @@ | |||||
/* | /* | ||||
LV2 Data Access Extension | LV2 Data Access Extension | ||||
Copyright 2008-2011 David Robillard <http://drobilla.net> | |||||
Copyright 2008-2016 David Robillard <http://drobilla.net> | |||||
Permission to use, copy, modify, and/or distribute this software for any | Permission to use, copy, modify, and/or distribute this software for any | ||||
purpose with or without fee is hereby granted, provided that the above | purpose with or without fee is hereby granted, provided that the above | ||||
@@ -16,18 +16,19 @@ | |||||
*/ | */ | ||||
/** | /** | ||||
@file data-access.h | |||||
C header for the LV2 Extension Data extension | |||||
<http://lv2plug.in/ns/ext/data-access>. | |||||
@defgroup data-access Data Access | |||||
This extension defines a method for (e.g.) plugin UIs to have (possibly | |||||
marshalled) access to the extension_data function on a plugin instance. | |||||
Access to plugin extension_data() for UIs, see | |||||
<http://lv2plug.in/ns/ext/data-acess> for details. | |||||
@{ | |||||
*/ | */ | ||||
#ifndef LV2_DATA_ACCESS_H | #ifndef LV2_DATA_ACCESS_H | ||||
#define LV2_DATA_ACCESS_H | #define LV2_DATA_ACCESS_H | ||||
#define LV2_DATA_ACCESS_URI "http://lv2plug.in/ns/ext/data-access" | |||||
#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# | |||||
#ifdef __cplusplus | #ifdef __cplusplus | ||||
extern "C" { | extern "C" { | ||||
@@ -61,3 +62,7 @@ typedef struct { | |||||
#endif | #endif | ||||
#endif /* LV2_DATA_ACCESS_H */ | #endif /* LV2_DATA_ACCESS_H */ | ||||
/** | |||||
@} | |||||
*/ |
@@ -16,10 +16,12 @@ | |||||
*/ | */ | ||||
/** | /** | ||||
@file dynmanifest.h | |||||
C header for the LV2 Dynamic Manifest extension | |||||
<http://lv2plug.in/ns/ext/dynmanifest>. | |||||
Revision: 1.2 | |||||
@defgroup dynmanifest Dynamic Manifest | |||||
Support for dynamic data generation, see | |||||
<http://lv2plug.in/ns/ext/dynmanifest> for details. | |||||
@{ | |||||
*/ | */ | ||||
#ifndef LV2_DYN_MANIFEST_H_INCLUDED | #ifndef LV2_DYN_MANIFEST_H_INCLUDED | ||||
@@ -29,7 +31,8 @@ | |||||
#include "lv2.h" | #include "lv2.h" | ||||
#define LV2_DYN_MANIFEST_URI "http://lv2plug.in/ns/ext/dynmanifest" | |||||
#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# | |||||
#ifdef __cplusplus | #ifdef __cplusplus | ||||
extern "C" { | extern "C" { | ||||
@@ -142,3 +145,7 @@ void lv2_dyn_manifest_close(LV2_Dyn_Manifest_Handle handle); | |||||
#endif | #endif | ||||
#endif /* LV2_DYN_MANIFEST_H_INCLUDED */ | #endif /* LV2_DYN_MANIFEST_H_INCLUDED */ | ||||
/** | |||||
@} | |||||
*/ |
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
Copyright 2008-2012 David Robillard <http://drobilla.net> | |||||
Copyright 2008-2015 David Robillard <http://drobilla.net> | |||||
Permission to use, copy, modify, and/or distribute this software for any | Permission to use, copy, modify, and/or distribute this software for any | ||||
purpose with or without fee is hereby granted, provided that the above | purpose with or without fee is hereby granted, provided that the above | ||||
@@ -96,8 +96,8 @@ typedef struct { | |||||
} LV2_Event_Iterator; | } LV2_Event_Iterator; | ||||
/** Reset an iterator to point to the start of @a buf. | |||||
* @return True if @a iter is valid, otherwise false (buffer is empty) */ | |||||
/** Reset an iterator to point to the start of `buf`. | |||||
* @return True if `iter` is valid, otherwise false (buffer is empty) */ | |||||
static inline bool | static inline bool | ||||
lv2_event_begin(LV2_Event_Iterator* iter, | lv2_event_begin(LV2_Event_Iterator* iter, | ||||
LV2_Event_Buffer* buf) | LV2_Event_Buffer* buf) | ||||
@@ -108,8 +108,8 @@ lv2_event_begin(LV2_Event_Iterator* iter, | |||||
} | } | ||||
/** Check if @a iter is valid. | |||||
* @return True if @a iter is valid, otherwise false (past end of buffer) */ | |||||
/** Check if `iter` is valid. | |||||
* @return True if `iter` is valid, otherwise false (past end of buffer) */ | |||||
static inline bool | static inline bool | ||||
lv2_event_is_valid(LV2_Event_Iterator* iter) | lv2_event_is_valid(LV2_Event_Iterator* iter) | ||||
{ | { | ||||
@@ -117,9 +117,9 @@ lv2_event_is_valid(LV2_Event_Iterator* iter) | |||||
} | } | ||||
/** Advance @a iter forward one event. | |||||
* @a iter must be valid. | |||||
* @return True if @a iter is valid, otherwise false (reached end of buffer) */ | |||||
/** Advance `iter` forward one event. | |||||
* `iter` must be valid. | |||||
* @return True if `iter` is valid, otherwise false (reached end of buffer) */ | |||||
static inline bool | static inline bool | ||||
lv2_event_increment(LV2_Event_Iterator* iter) | lv2_event_increment(LV2_Event_Iterator* iter) | ||||
{ | { | ||||
@@ -138,11 +138,11 @@ lv2_event_increment(LV2_Event_Iterator* iter) | |||||
/** Dereference an event iterator (get the event currently pointed at). | /** Dereference an event iterator (get the event currently pointed at). | ||||
* @a iter must be valid. | |||||
* @a data if non-NULL, will be set to point to the contents of the event | |||||
* `iter` must be valid. | |||||
* `data` if non-NULL, will be set to point to the contents of the event | |||||
* returned. | * returned. | ||||
* @return A Pointer to the event @a iter is currently pointing at, or NULL | |||||
* if the end of the buffer is reached (in which case @a data is | |||||
* @return A Pointer to the event `iter` is currently pointing at, or NULL | |||||
* if the end of the buffer is reached (in which case `data` is | |||||
* also set to NULL). */ | * also set to NULL). */ | ||||
static inline LV2_Event* | static inline LV2_Event* | ||||
lv2_event_get(LV2_Event_Iterator* iter, | lv2_event_get(LV2_Event_Iterator* iter, | ||||
@@ -162,8 +162,8 @@ lv2_event_get(LV2_Event_Iterator* iter, | |||||
} | } | ||||
/** Write an event at @a iter. | |||||
* The event (if any) pointed to by @a iter will be overwritten, and @a iter | |||||
/** 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 | * incremented to point to the following event (i.e. several calls to this | ||||
* function can be done in sequence without twiddling iter in-between). | * function can be done in sequence without twiddling iter in-between). | ||||
* @return True if event was written, otherwise false (buffer is full). */ | * @return True if event was written, otherwise false (buffer is full). */ | ||||
@@ -230,8 +230,8 @@ lv2_event_reserve(LV2_Event_Iterator* iter, | |||||
} | } | ||||
/** Write an event at @a iter. | |||||
* The event (if any) pointed to by @a iter will be overwritten, and @a iter | |||||
/** 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 | * incremented to point to the following event (i.e. several calls to this | ||||
* function can be done in sequence without twiddling iter in-between). | * function can be done in sequence without twiddling iter in-between). | ||||
* @return True if event was written, otherwise false (buffer is full). */ | * @return True if event was written, otherwise false (buffer is full). */ | ||||
@@ -263,4 +263,3 @@ lv2_event_write_event(LV2_Event_Iterator* iter, | |||||
#endif | #endif | ||||
#endif /* LV2_EVENT_HELPERS_H */ | #endif /* LV2_EVENT_HELPERS_H */ | ||||
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
Copyright 2008-2011 David Robillard <http://drobilla.net> | |||||
Copyright 2008-2016 David Robillard <http://drobilla.net> | |||||
Copyright 2006-2007 Lars Luthman <lars.luthman@gmail.com> | Copyright 2006-2007 Lars Luthman <lars.luthman@gmail.com> | ||||
Permission to use, copy, modify, and/or distribute this software for any | Permission to use, copy, modify, and/or distribute this software for any | ||||
@@ -16,38 +16,32 @@ | |||||
*/ | */ | ||||
/** | /** | ||||
@file event.h | |||||
C API for the LV2 Event extension <http://lv2plug.in/ns/ext/event>. | |||||
This extension is a generic transport mechanism for time stamped events | |||||
of any type (e.g. MIDI, OSC, ramps, etc). Each port can transport mixed | |||||
events of any type; the type of events and timestamps are defined by a URI | |||||
which is mapped to an integer by the host for performance reasons. | |||||
This extension requires the host to support the LV2 URI Map extension. | |||||
Any host which supports this extension MUST guarantee that any call to | |||||
the LV2 URI Map uri_to_id function with the URI of this extension as the | |||||
'map' argument returns a value within the range of uint16_t. | |||||
@defgroup event Event | |||||
Generic time-stamped events, see <http://lv2plug.in/ns/ext/event> for | |||||
details. | |||||
@{ | |||||
*/ | */ | ||||
#ifndef LV2_EVENT_H | #ifndef LV2_EVENT_H | ||||
#define LV2_EVENT_H | #define LV2_EVENT_H | ||||
#define LV2_EVENT_URI "http://lv2plug.in/ns/ext/event" | |||||
#define LV2_EVENT_PREFIX LV2_EVENT_URI "#" | |||||
#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# | |||||
#define LV2_EVENT__Event LV2_EVENT_PREFIX "Event" | |||||
#define LV2_EVENT__EventPort LV2_EVENT_PREFIX "EventPort" | |||||
#define LV2_EVENT__FrameStamp LV2_EVENT_PREFIX "FrameStamp" | |||||
#define LV2_EVENT__TimeStamp LV2_EVENT_PREFIX "TimeStamp" | |||||
#define LV2_EVENT__generatesTimeStamp LV2_EVENT_PREFIX "generatesTimeStamp" | |||||
#define LV2_EVENT__generic LV2_EVENT_PREFIX "generic" | |||||
#define LV2_EVENT__inheritsEvent LV2_EVENT_PREFIX "inheritsEvent" | |||||
#define LV2_EVENT__inheritsTimeStamp LV2_EVENT_PREFIX "inheritsTimeStamp" | |||||
#define LV2_EVENT__supportsEvent LV2_EVENT_PREFIX "supportsEvent" | |||||
#define LV2_EVENT__supportsTimeStamp LV2_EVENT_PREFIX "supportsTimeStamp" | |||||
#define LV2_EVENT__Event LV2_EVENT_PREFIX "Event" ///< http://lv2plug.in/ns/ext/event#Event | |||||
#define LV2_EVENT__EventPort LV2_EVENT_PREFIX "EventPort" ///< http://lv2plug.in/ns/ext/event#EventPort | |||||
#define LV2_EVENT__FrameStamp LV2_EVENT_PREFIX "FrameStamp" ///< http://lv2plug.in/ns/ext/event#FrameStamp | |||||
#define LV2_EVENT__TimeStamp LV2_EVENT_PREFIX "TimeStamp" ///< http://lv2plug.in/ns/ext/event#TimeStamp | |||||
#define LV2_EVENT__generatesTimeStamp LV2_EVENT_PREFIX "generatesTimeStamp" ///< http://lv2plug.in/ns/ext/event#generatesTimeStamp | |||||
#define LV2_EVENT__generic LV2_EVENT_PREFIX "generic" ///< http://lv2plug.in/ns/ext/event#generic | |||||
#define LV2_EVENT__inheritsEvent LV2_EVENT_PREFIX "inheritsEvent" ///< http://lv2plug.in/ns/ext/event#inheritsEvent | |||||
#define LV2_EVENT__inheritsTimeStamp LV2_EVENT_PREFIX "inheritsTimeStamp" ///< http://lv2plug.in/ns/ext/event#inheritsTimeStamp | |||||
#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 | |||||
#define LV2_EVENT_AUDIO_STAMP 0 | |||||
#define LV2_EVENT_AUDIO_STAMP 0 ///< Special timestamp type for audio frames | |||||
#include <stdint.h> | #include <stdint.h> | ||||
@@ -255,7 +249,7 @@ typedef struct { | |||||
@param context The calling context. Like event types, this is a mapped | @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 | 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 | pass 0 here (the ID of the 'standard' LV2 run context). The host | ||||
guarantees that this function is realtime safe iff @a context is | |||||
guarantees that this function is realtime safe iff the context is | |||||
realtime safe. | realtime safe. | ||||
PLUGINS THAT VIOLATE THESE RULES MAY CAUSE CRASHES AND MEMORY LEAKS. | PLUGINS THAT VIOLATE THESE RULES MAY CAUSE CRASHES AND MEMORY LEAKS. | ||||
@@ -278,7 +272,7 @@ typedef struct { | |||||
@param context The calling context. Like event types, this is a mapped | @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 | 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 | pass 0 here (the ID of the 'standard' LV2 run context). The host | ||||
guarantees that this function is realtime safe iff @a context is | |||||
guarantees that this function is realtime safe iff the context is | |||||
realtime safe. | realtime safe. | ||||
PLUGINS THAT VIOLATE THESE RULES MAY CAUSE CRASHES AND MEMORY LEAKS. | PLUGINS THAT VIOLATE THESE RULES MAY CAUSE CRASHES AND MEMORY LEAKS. | ||||
@@ -292,3 +286,7 @@ typedef struct { | |||||
#endif | #endif | ||||
#endif /* LV2_EVENT_H */ | #endif /* LV2_EVENT_H */ | ||||
/** | |||||
@} | |||||
*/ |
@@ -1,6 +1,6 @@ | |||||
/* | /* | ||||
LV2 Instance Access Extension | LV2 Instance Access Extension | ||||
Copyright 2008-2012 David Robillard <http://drobilla.net> | |||||
Copyright 2008-2016 David Robillard <http://drobilla.net> | |||||
Permission to use, copy, modify, and/or distribute this software for any | Permission to use, copy, modify, and/or distribute this software for any | ||||
purpose with or without fee is hereby granted, provided that the above | purpose with or without fee is hereby granted, provided that the above | ||||
@@ -15,23 +15,22 @@ | |||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||||
*/ | */ | ||||
#ifndef LV2_INSTANCE_ACCESS_H | |||||
#define LV2_INSTANCE_ACCESS_H | |||||
/** | |||||
@defgroup instance-access Instance Access | |||||
#define LV2_INSTANCE_ACCESS_URI "http://lv2plug.in/ns/ext/instance-access" | |||||
Access to the LV2_Handle of a plugin for UIs; see | |||||
<http://lv2plug.in/ns/ext/instance-access> for details. | |||||
/** | |||||
@file instance-access.h | |||||
C header for the LV2 Instance Access extension | |||||
<http://lv2plug.in/ns/ext/instance-access>. | |||||
This extension defines a method for (e.g.) plugin UIs to get a direct | |||||
handle to an LV2 plugin instance (LV2_Handle), if possible. | |||||
To support this feature the host must pass an LV2_Feature struct to the | |||||
UI instantiate method with URI "http://lv2plug.in/ns/ext/instance-access" | |||||
and data pointed directly to the LV2_Handle of the plugin instance. | |||||
@{ | |||||
*/ | */ | ||||
#ifndef LV2_INSTANCE_ACCESS_H | |||||
#define LV2_INSTANCE_ACCESS_H | |||||
#define LV2_INSTANCE_ACCESS_URI "http://lv2plug.in/ns/ext/instance-access" ///< http://lv2plug.in/ns/ext/instance-access | |||||
#endif /* LV2_INSTANCE_ACCESS_H */ | #endif /* LV2_INSTANCE_ACCESS_H */ | ||||
/** | |||||
@} | |||||
*/ |
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
Copyright 2012 David Robillard <http://drobilla.net> | |||||
Copyright 2012-2016 David Robillard <http://drobilla.net> | |||||
Permission to use, copy, modify, and/or distribute this software for any | Permission to use, copy, modify, and/or distribute this software for any | ||||
purpose with or without fee is hereby granted, provided that the above | purpose with or without fee is hereby granted, provided that the above | ||||
@@ -15,22 +15,26 @@ | |||||
*/ | */ | ||||
/** | /** | ||||
@file log.h C header for the LV2 Log extension | |||||
<http://lv2plug.in/ns/ext/log>. | |||||
@defgroup log Log | |||||
Interface for plugins to log via the host; see | |||||
<http://lv2plug.in/ns/ext/log> for details. | |||||
@{ | |||||
*/ | */ | ||||
#ifndef LV2_LOG_H | #ifndef LV2_LOG_H | ||||
#define LV2_LOG_H | #define LV2_LOG_H | ||||
#define LV2_LOG_URI "http://lv2plug.in/ns/ext/log" | |||||
#define LV2_LOG_PREFIX LV2_LOG_URI "#" | |||||
#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# | |||||
#define LV2_LOG__Entry LV2_LOG_PREFIX "Entry" | |||||
#define LV2_LOG__Error LV2_LOG_PREFIX "Error" | |||||
#define LV2_LOG__Note LV2_LOG_PREFIX "Note" | |||||
#define LV2_LOG__Trace LV2_LOG_PREFIX "Trace" | |||||
#define LV2_LOG__Warning LV2_LOG_PREFIX "Warning" | |||||
#define LV2_LOG__log LV2_LOG_PREFIX "log" | |||||
#define LV2_LOG__Entry LV2_LOG_PREFIX "Entry" ///< http://lv2plug.in/ns/ext/log#Entry | |||||
#define LV2_LOG__Error LV2_LOG_PREFIX "Error" ///< http://lv2plug.in/ns/ext/log#Error | |||||
#define LV2_LOG__Note LV2_LOG_PREFIX "Note" ///< http://lv2plug.in/ns/ext/log#Note | |||||
#define LV2_LOG__Trace LV2_LOG_PREFIX "Trace" ///< http://lv2plug.in/ns/ext/log#Trace | |||||
#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 | |||||
#include <stdarg.h> | #include <stdarg.h> | ||||
@@ -40,12 +44,14 @@ | |||||
extern "C" { | extern "C" { | ||||
#endif | #endif | ||||
/** @cond */ | |||||
#ifdef __GNUC__ | #ifdef __GNUC__ | ||||
/** Allow type checking of printf-like functions. */ | /** Allow type checking of printf-like functions. */ | ||||
# define LV2_LOG_FUNC(fmt, arg1) __attribute__((format(printf, fmt, arg1))) | # define LV2_LOG_FUNC(fmt, arg1) __attribute__((format(printf, fmt, arg1))) | ||||
#else | #else | ||||
# define LV2_LOG_FUNC(fmt, arg1) | # define LV2_LOG_FUNC(fmt, arg1) | ||||
#endif | #endif | ||||
/** @endcond */ | |||||
/** | /** | ||||
Opaque data to host data for LV2_Log_Log. | Opaque data to host data for LV2_Log_Log. | ||||
@@ -69,7 +75,7 @@ typedef struct _LV2_Log { | |||||
The API of this function matches that of the standard C printf function, | The API of this function matches that of the standard C printf function, | ||||
except for the addition of the first two parameters. This function may | except for the addition of the first two parameters. This function may | ||||
be called from any non-realtime context, or from any context if @p type | |||||
be called from any non-realtime context, or from any context if `type` | |||||
is @ref LV2_LOG__Trace. | is @ref LV2_LOG__Trace. | ||||
*/ | */ | ||||
LV2_LOG_FUNC(3, 4) | LV2_LOG_FUNC(3, 4) | ||||
@@ -83,7 +89,7 @@ typedef struct _LV2_Log { | |||||
The API of this function matches that of the standard C vprintf | The API of this function matches that of the standard C vprintf | ||||
function, except for the addition of the first two parameters. This | function, except for the addition of the first two parameters. This | ||||
function may be called from any non-realtime context, or from any | function may be called from any non-realtime context, or from any | ||||
context if @p type is @ref LV2_LOG__Trace. | |||||
context if `type` is @ref LV2_LOG__Trace. | |||||
*/ | */ | ||||
LV2_LOG_FUNC(3, 0) | LV2_LOG_FUNC(3, 0) | ||||
int (*vprintf)(LV2_Log_Handle handle, | int (*vprintf)(LV2_Log_Handle handle, | ||||
@@ -97,3 +103,7 @@ typedef struct _LV2_Log { | |||||
#endif | #endif | ||||
#endif /* LV2_LOG_H */ | #endif /* LV2_LOG_H */ | ||||
/** | |||||
@} | |||||
*/ |
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
Copyright 2012-2013 David Robillard <http://drobilla.net> | |||||
Copyright 2012-2016 David Robillard <http://drobilla.net> | |||||
Permission to use, copy, modify, and/or distribute this software for any | Permission to use, copy, modify, and/or distribute this software for any | ||||
purpose with or without fee is hereby granted, provided that the above | purpose with or without fee is hereby granted, provided that the above | ||||
@@ -15,13 +15,14 @@ | |||||
*/ | */ | ||||
/** | /** | ||||
@file logger.h Convenience API for easy logging in plugin code. | |||||
@defgroup logger Logger | |||||
@ingroup log | |||||
This file provides simple wrappers for the most common log operations for | |||||
use in plugin implementations. If host support for logging is not | |||||
available, then these functions will print to stderr instead. | |||||
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. | |||||
This header is non-normative, it is provided for convenience. | |||||
@{ | |||||
*/ | */ | ||||
#ifndef LV2_ATOM_LOGGER_H | #ifndef LV2_ATOM_LOGGER_H | ||||
@@ -49,27 +50,40 @@ typedef struct { | |||||
} LV2_Log_Logger; | } LV2_Log_Logger; | ||||
/** | /** | ||||
Initialise @p logger. | |||||
Set `map` as the URI map for `logger`. | |||||
URIs will be mapped using @p map and stored, a reference to @p map itself is | |||||
not held. Both @p map and @p log may be NULL when unsupported by the host, | |||||
in which case the implementation will fall back to printing to stderr. | |||||
This affects the message type URIDs (Error, Warning, etc) which are passed | |||||
to the log's print functions. | |||||
*/ | */ | ||||
static inline void | static inline void | ||||
lv2_log_logger_init(LV2_Log_Logger* logger, | |||||
LV2_URID_Map* map, | |||||
LV2_Log_Log* log) | |||||
lv2_log_logger_set_map(LV2_Log_Logger* logger, LV2_URID_Map* map) | |||||
{ | { | ||||
memset(logger, 0, sizeof(LV2_Log_Logger)); | |||||
logger->log = log; | |||||
if (map) { | if (map) { | ||||
logger->Error = map->map(map->handle, LV2_LOG__Error); | logger->Error = map->map(map->handle, LV2_LOG__Error); | ||||
logger->Note = map->map(map->handle, LV2_LOG__Note); | logger->Note = map->map(map->handle, LV2_LOG__Note); | ||||
logger->Trace = map->map(map->handle, LV2_LOG__Trace); | logger->Trace = map->map(map->handle, LV2_LOG__Trace); | ||||
logger->Warning = map->map(map->handle, LV2_LOG__Warning); | logger->Warning = map->map(map->handle, LV2_LOG__Warning); | ||||
} else { | |||||
logger->Error = logger->Note = logger->Trace = logger->Warning = 0; | |||||
} | } | ||||
} | } | ||||
/** | |||||
Initialise `logger`. | |||||
URIs will be mapped using `map` and stored, a reference to `map` itself is | |||||
not held. Both `map` and `log` may be NULL when unsupported by the host, | |||||
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) | |||||
{ | |||||
logger->log = log; | |||||
lv2_log_logger_set_map(logger, map); | |||||
} | |||||
/** | /** | ||||
Log a message to the host, or stderr if support is unavailable. | Log a message to the host, or stderr if support is unavailable. | ||||
*/ | */ | ||||
@@ -80,7 +94,7 @@ lv2_log_vprintf(LV2_Log_Logger* logger, | |||||
const char* fmt, | const char* fmt, | ||||
va_list args) | va_list args) | ||||
{ | { | ||||
if (logger->log) { | |||||
if (logger && logger->log) { | |||||
return logger->log->vprintf(logger->log->handle, type, fmt, args); | return logger->log->vprintf(logger->log->handle, type, fmt, args); | ||||
} else { | } else { | ||||
return vfprintf(stderr, fmt, args); | return vfprintf(stderr, fmt, args); | ||||
@@ -135,12 +149,12 @@ lv2_log_warning(LV2_Log_Logger* logger, const char* fmt, ...) | |||||
return ret; | return ret; | ||||
} | } | ||||
/** | |||||
@} | |||||
*/ | |||||
#ifdef __cplusplus | #ifdef __cplusplus | ||||
} /* extern "C" */ | } /* extern "C" */ | ||||
#endif | #endif | ||||
#endif /* LV2_LOG_LOGGER_H */ | #endif /* LV2_LOG_LOGGER_H */ | ||||
/** | |||||
@} | |||||
*/ |
@@ -19,9 +19,11 @@ | |||||
*/ | */ | ||||
/** | /** | ||||
@file lv2.h | |||||
API for the LV2 specification <http://lv2plug.in/ns/lv2core>. | |||||
Revision: 12.0 | |||||
@defgroup lv2core LV2 Core | |||||
Core LV2 specification, see <http://lv2plug.in/ns/lv2core> for details. | |||||
@{ | |||||
*/ | */ | ||||
#ifndef LV2_H_INCLUDED | #ifndef LV2_H_INCLUDED | ||||
@@ -29,93 +31,93 @@ | |||||
#include <stdint.h> | #include <stdint.h> | ||||
#define LV2_CORE_URI "http://lv2plug.in/ns/lv2core" | |||||
#define LV2_CORE_PREFIX LV2_CORE_URI "#" | |||||
#define LV2_CORE__AllpassPlugin LV2_CORE_PREFIX "AllpassPlugin" | |||||
#define LV2_CORE__AmplifierPlugin LV2_CORE_PREFIX "AmplifierPlugin" | |||||
#define LV2_CORE__AnalyserPlugin LV2_CORE_PREFIX "AnalyserPlugin" | |||||
#define LV2_CORE__AudioPort LV2_CORE_PREFIX "AudioPort" | |||||
#define LV2_CORE__BandpassPlugin LV2_CORE_PREFIX "BandpassPlugin" | |||||
#define LV2_CORE__CVPort LV2_CORE_PREFIX "CVPort" | |||||
#define LV2_CORE__ChorusPlugin LV2_CORE_PREFIX "ChorusPlugin" | |||||
#define LV2_CORE__CombPlugin LV2_CORE_PREFIX "CombPlugin" | |||||
#define LV2_CORE__CompressorPlugin LV2_CORE_PREFIX "CompressorPlugin" | |||||
#define LV2_CORE__ConstantPlugin LV2_CORE_PREFIX "ConstantPlugin" | |||||
#define LV2_CORE__ControlPort LV2_CORE_PREFIX "ControlPort" | |||||
#define LV2_CORE__ConverterPlugin LV2_CORE_PREFIX "ConverterPlugin" | |||||
#define LV2_CORE__DelayPlugin LV2_CORE_PREFIX "DelayPlugin" | |||||
#define LV2_CORE__DistortionPlugin LV2_CORE_PREFIX "DistortionPlugin" | |||||
#define LV2_CORE__DynamicsPlugin LV2_CORE_PREFIX "DynamicsPlugin" | |||||
#define LV2_CORE__EQPlugin LV2_CORE_PREFIX "EQPlugin" | |||||
#define LV2_CORE__EnvelopePlugin LV2_CORE_PREFIX "EnvelopePlugin" | |||||
#define LV2_CORE__ExpanderPlugin LV2_CORE_PREFIX "ExpanderPlugin" | |||||
#define LV2_CORE__ExtensionData LV2_CORE_PREFIX "ExtensionData" | |||||
#define LV2_CORE__Feature LV2_CORE_PREFIX "Feature" | |||||
#define LV2_CORE__FilterPlugin LV2_CORE_PREFIX "FilterPlugin" | |||||
#define LV2_CORE__FlangerPlugin LV2_CORE_PREFIX "FlangerPlugin" | |||||
#define LV2_CORE__FunctionPlugin LV2_CORE_PREFIX "FunctionPlugin" | |||||
#define LV2_CORE__GatePlugin LV2_CORE_PREFIX "GatePlugin" | |||||
#define LV2_CORE__GeneratorPlugin LV2_CORE_PREFIX "GeneratorPlugin" | |||||
#define LV2_CORE__HighpassPlugin LV2_CORE_PREFIX "HighpassPlugin" | |||||
#define LV2_CORE__InputPort LV2_CORE_PREFIX "InputPort" | |||||
#define LV2_CORE__InstrumentPlugin LV2_CORE_PREFIX "InstrumentPlugin" | |||||
#define LV2_CORE__LimiterPlugin LV2_CORE_PREFIX "LimiterPlugin" | |||||
#define LV2_CORE__LowpassPlugin LV2_CORE_PREFIX "LowpassPlugin" | |||||
#define LV2_CORE__MixerPlugin LV2_CORE_PREFIX "MixerPlugin" | |||||
#define LV2_CORE__ModulatorPlugin LV2_CORE_PREFIX "ModulatorPlugin" | |||||
#define LV2_CORE__MultiEQPlugin LV2_CORE_PREFIX "MultiEQPlugin" | |||||
#define LV2_CORE__OscillatorPlugin LV2_CORE_PREFIX "OscillatorPlugin" | |||||
#define LV2_CORE__OutputPort LV2_CORE_PREFIX "OutputPort" | |||||
#define LV2_CORE__ParaEQPlugin LV2_CORE_PREFIX "ParaEQPlugin" | |||||
#define LV2_CORE__PhaserPlugin LV2_CORE_PREFIX "PhaserPlugin" | |||||
#define LV2_CORE__PitchPlugin LV2_CORE_PREFIX "PitchPlugin" | |||||
#define LV2_CORE__Plugin LV2_CORE_PREFIX "Plugin" | |||||
#define LV2_CORE__PluginBase LV2_CORE_PREFIX "PluginBase" | |||||
#define LV2_CORE__Point LV2_CORE_PREFIX "Point" | |||||
#define LV2_CORE__Port LV2_CORE_PREFIX "Port" | |||||
#define LV2_CORE__PortProperty LV2_CORE_PREFIX "PortProperty" | |||||
#define LV2_CORE__Resource LV2_CORE_PREFIX "Resource" | |||||
#define LV2_CORE__ReverbPlugin LV2_CORE_PREFIX "ReverbPlugin" | |||||
#define LV2_CORE__ScalePoint LV2_CORE_PREFIX "ScalePoint" | |||||
#define LV2_CORE__SimulatorPlugin LV2_CORE_PREFIX "SimulatorPlugin" | |||||
#define LV2_CORE__SpatialPlugin LV2_CORE_PREFIX "SpatialPlugin" | |||||
#define LV2_CORE__Specification LV2_CORE_PREFIX "Specification" | |||||
#define LV2_CORE__SpectralPlugin LV2_CORE_PREFIX "SpectralPlugin" | |||||
#define LV2_CORE__UtilityPlugin LV2_CORE_PREFIX "UtilityPlugin" | |||||
#define LV2_CORE__WaveshaperPlugin LV2_CORE_PREFIX "WaveshaperPlugin" | |||||
#define LV2_CORE__appliesTo LV2_CORE_PREFIX "appliesTo" | |||||
#define LV2_CORE__binary LV2_CORE_PREFIX "binary" | |||||
#define LV2_CORE__connectionOptional LV2_CORE_PREFIX "connectionOptional" | |||||
#define LV2_CORE__control LV2_CORE_PREFIX "control" | |||||
#define LV2_CORE__default LV2_CORE_PREFIX "default" | |||||
#define LV2_CORE__designation LV2_CORE_PREFIX "designation" | |||||
#define LV2_CORE__documentation LV2_CORE_PREFIX "documentation" | |||||
#define LV2_CORE__enumeration LV2_CORE_PREFIX "enumeration" | |||||
#define LV2_CORE__extensionData LV2_CORE_PREFIX "extensionData" | |||||
#define LV2_CORE__freeWheeling LV2_CORE_PREFIX "freeWheeling" | |||||
#define LV2_CORE__hardRTCapable LV2_CORE_PREFIX "hardRTCapable" | |||||
#define LV2_CORE__inPlaceBroken LV2_CORE_PREFIX "inPlaceBroken" | |||||
#define LV2_CORE__index LV2_CORE_PREFIX "index" | |||||
#define LV2_CORE__integer LV2_CORE_PREFIX "integer" | |||||
#define LV2_CORE__isLive LV2_CORE_PREFIX "isLive" | |||||
#define LV2_CORE__latency LV2_CORE_PREFIX "latency" | |||||
#define LV2_CORE__maximum LV2_CORE_PREFIX "maximum" | |||||
#define LV2_CORE__microVersion LV2_CORE_PREFIX "microVersion" | |||||
#define LV2_CORE__minimum LV2_CORE_PREFIX "minimum" | |||||
#define LV2_CORE__minorVersion LV2_CORE_PREFIX "minorVersion" | |||||
#define LV2_CORE__name LV2_CORE_PREFIX "name" | |||||
#define LV2_CORE__optionalFeature LV2_CORE_PREFIX "optionalFeature" | |||||
#define LV2_CORE__port LV2_CORE_PREFIX "port" | |||||
#define LV2_CORE__portProperty LV2_CORE_PREFIX "portProperty" | |||||
#define LV2_CORE__project LV2_CORE_PREFIX "project" | |||||
#define LV2_CORE__prototype LV2_CORE_PREFIX "prototype" | |||||
#define LV2_CORE__reportsLatency LV2_CORE_PREFIX "reportsLatency" | |||||
#define LV2_CORE__requiredFeature LV2_CORE_PREFIX "requiredFeature" | |||||
#define LV2_CORE__sampleRate LV2_CORE_PREFIX "sampleRate" | |||||
#define LV2_CORE__scalePoint LV2_CORE_PREFIX "scalePoint" | |||||
#define LV2_CORE__symbol LV2_CORE_PREFIX "symbol" | |||||
#define LV2_CORE__toggled LV2_CORE_PREFIX "toggled" | |||||
#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# | |||||
#define LV2_CORE__AllpassPlugin LV2_CORE_PREFIX "AllpassPlugin" ///< http://lv2plug.in/ns/lv2core#AllpassPlugin | |||||
#define LV2_CORE__AmplifierPlugin LV2_CORE_PREFIX "AmplifierPlugin" ///< http://lv2plug.in/ns/lv2core#AmplifierPlugin | |||||
#define LV2_CORE__AnalyserPlugin LV2_CORE_PREFIX "AnalyserPlugin" ///< http://lv2plug.in/ns/lv2core#AnalyserPlugin | |||||
#define LV2_CORE__AudioPort LV2_CORE_PREFIX "AudioPort" ///< http://lv2plug.in/ns/lv2core#AudioPort | |||||
#define LV2_CORE__BandpassPlugin LV2_CORE_PREFIX "BandpassPlugin" ///< http://lv2plug.in/ns/lv2core#BandpassPlugin | |||||
#define LV2_CORE__CVPort LV2_CORE_PREFIX "CVPort" ///< http://lv2plug.in/ns/lv2core#CVPort | |||||
#define LV2_CORE__ChorusPlugin LV2_CORE_PREFIX "ChorusPlugin" ///< http://lv2plug.in/ns/lv2core#ChorusPlugin | |||||
#define LV2_CORE__CombPlugin LV2_CORE_PREFIX "CombPlugin" ///< http://lv2plug.in/ns/lv2core#CombPlugin | |||||
#define LV2_CORE__CompressorPlugin LV2_CORE_PREFIX "CompressorPlugin" ///< http://lv2plug.in/ns/lv2core#CompressorPlugin | |||||
#define LV2_CORE__ConstantPlugin LV2_CORE_PREFIX "ConstantPlugin" ///< http://lv2plug.in/ns/lv2core#ConstantPlugin | |||||
#define LV2_CORE__ControlPort LV2_CORE_PREFIX "ControlPort" ///< http://lv2plug.in/ns/lv2core#ControlPort | |||||
#define LV2_CORE__ConverterPlugin LV2_CORE_PREFIX "ConverterPlugin" ///< http://lv2plug.in/ns/lv2core#ConverterPlugin | |||||
#define LV2_CORE__DelayPlugin LV2_CORE_PREFIX "DelayPlugin" ///< http://lv2plug.in/ns/lv2core#DelayPlugin | |||||
#define LV2_CORE__DistortionPlugin LV2_CORE_PREFIX "DistortionPlugin" ///< http://lv2plug.in/ns/lv2core#DistortionPlugin | |||||
#define LV2_CORE__DynamicsPlugin LV2_CORE_PREFIX "DynamicsPlugin" ///< http://lv2plug.in/ns/lv2core#DynamicsPlugin | |||||
#define LV2_CORE__EQPlugin LV2_CORE_PREFIX "EQPlugin" ///< http://lv2plug.in/ns/lv2core#EQPlugin | |||||
#define LV2_CORE__EnvelopePlugin LV2_CORE_PREFIX "EnvelopePlugin" ///< http://lv2plug.in/ns/lv2core#EnvelopePlugin | |||||
#define LV2_CORE__ExpanderPlugin LV2_CORE_PREFIX "ExpanderPlugin" ///< http://lv2plug.in/ns/lv2core#ExpanderPlugin | |||||
#define LV2_CORE__ExtensionData LV2_CORE_PREFIX "ExtensionData" ///< http://lv2plug.in/ns/lv2core#ExtensionData | |||||
#define LV2_CORE__Feature LV2_CORE_PREFIX "Feature" ///< http://lv2plug.in/ns/lv2core#Feature | |||||
#define LV2_CORE__FilterPlugin LV2_CORE_PREFIX "FilterPlugin" ///< http://lv2plug.in/ns/lv2core#FilterPlugin | |||||
#define LV2_CORE__FlangerPlugin LV2_CORE_PREFIX "FlangerPlugin" ///< http://lv2plug.in/ns/lv2core#FlangerPlugin | |||||
#define LV2_CORE__FunctionPlugin LV2_CORE_PREFIX "FunctionPlugin" ///< http://lv2plug.in/ns/lv2core#FunctionPlugin | |||||
#define LV2_CORE__GatePlugin LV2_CORE_PREFIX "GatePlugin" ///< http://lv2plug.in/ns/lv2core#GatePlugin | |||||
#define LV2_CORE__GeneratorPlugin LV2_CORE_PREFIX "GeneratorPlugin" ///< http://lv2plug.in/ns/lv2core#GeneratorPlugin | |||||
#define LV2_CORE__HighpassPlugin LV2_CORE_PREFIX "HighpassPlugin" ///< http://lv2plug.in/ns/lv2core#HighpassPlugin | |||||
#define LV2_CORE__InputPort LV2_CORE_PREFIX "InputPort" ///< http://lv2plug.in/ns/lv2core#InputPort | |||||
#define LV2_CORE__InstrumentPlugin LV2_CORE_PREFIX "InstrumentPlugin" ///< http://lv2plug.in/ns/lv2core#InstrumentPlugin | |||||
#define LV2_CORE__LimiterPlugin LV2_CORE_PREFIX "LimiterPlugin" ///< http://lv2plug.in/ns/lv2core#LimiterPlugin | |||||
#define LV2_CORE__LowpassPlugin LV2_CORE_PREFIX "LowpassPlugin" ///< http://lv2plug.in/ns/lv2core#LowpassPlugin | |||||
#define LV2_CORE__MixerPlugin LV2_CORE_PREFIX "MixerPlugin" ///< http://lv2plug.in/ns/lv2core#MixerPlugin | |||||
#define LV2_CORE__ModulatorPlugin LV2_CORE_PREFIX "ModulatorPlugin" ///< http://lv2plug.in/ns/lv2core#ModulatorPlugin | |||||
#define LV2_CORE__MultiEQPlugin LV2_CORE_PREFIX "MultiEQPlugin" ///< http://lv2plug.in/ns/lv2core#MultiEQPlugin | |||||
#define LV2_CORE__OscillatorPlugin LV2_CORE_PREFIX "OscillatorPlugin" ///< http://lv2plug.in/ns/lv2core#OscillatorPlugin | |||||
#define LV2_CORE__OutputPort LV2_CORE_PREFIX "OutputPort" ///< http://lv2plug.in/ns/lv2core#OutputPort | |||||
#define LV2_CORE__ParaEQPlugin LV2_CORE_PREFIX "ParaEQPlugin" ///< http://lv2plug.in/ns/lv2core#ParaEQPlugin | |||||
#define LV2_CORE__PhaserPlugin LV2_CORE_PREFIX "PhaserPlugin" ///< http://lv2plug.in/ns/lv2core#PhaserPlugin | |||||
#define LV2_CORE__PitchPlugin LV2_CORE_PREFIX "PitchPlugin" ///< http://lv2plug.in/ns/lv2core#PitchPlugin | |||||
#define LV2_CORE__Plugin LV2_CORE_PREFIX "Plugin" ///< http://lv2plug.in/ns/lv2core#Plugin | |||||
#define LV2_CORE__PluginBase LV2_CORE_PREFIX "PluginBase" ///< http://lv2plug.in/ns/lv2core#PluginBase | |||||
#define LV2_CORE__Point LV2_CORE_PREFIX "Point" ///< http://lv2plug.in/ns/lv2core#Point | |||||
#define LV2_CORE__Port LV2_CORE_PREFIX "Port" ///< http://lv2plug.in/ns/lv2core#Port | |||||
#define LV2_CORE__PortProperty LV2_CORE_PREFIX "PortProperty" ///< http://lv2plug.in/ns/lv2core#PortProperty | |||||
#define LV2_CORE__Resource LV2_CORE_PREFIX "Resource" ///< http://lv2plug.in/ns/lv2core#Resource | |||||
#define LV2_CORE__ReverbPlugin LV2_CORE_PREFIX "ReverbPlugin" ///< http://lv2plug.in/ns/lv2core#ReverbPlugin | |||||
#define LV2_CORE__ScalePoint LV2_CORE_PREFIX "ScalePoint" ///< http://lv2plug.in/ns/lv2core#ScalePoint | |||||
#define LV2_CORE__SimulatorPlugin LV2_CORE_PREFIX "SimulatorPlugin" ///< http://lv2plug.in/ns/lv2core#SimulatorPlugin | |||||
#define LV2_CORE__SpatialPlugin LV2_CORE_PREFIX "SpatialPlugin" ///< http://lv2plug.in/ns/lv2core#SpatialPlugin | |||||
#define LV2_CORE__Specification LV2_CORE_PREFIX "Specification" ///< http://lv2plug.in/ns/lv2core#Specification | |||||
#define LV2_CORE__SpectralPlugin LV2_CORE_PREFIX "SpectralPlugin" ///< http://lv2plug.in/ns/lv2core#SpectralPlugin | |||||
#define LV2_CORE__UtilityPlugin LV2_CORE_PREFIX "UtilityPlugin" ///< http://lv2plug.in/ns/lv2core#UtilityPlugin | |||||
#define LV2_CORE__WaveshaperPlugin LV2_CORE_PREFIX "WaveshaperPlugin" ///< http://lv2plug.in/ns/lv2core#WaveshaperPlugin | |||||
#define LV2_CORE__appliesTo LV2_CORE_PREFIX "appliesTo" ///< http://lv2plug.in/ns/lv2core#appliesTo | |||||
#define LV2_CORE__binary LV2_CORE_PREFIX "binary" ///< http://lv2plug.in/ns/lv2core#binary | |||||
#define LV2_CORE__connectionOptional LV2_CORE_PREFIX "connectionOptional" ///< http://lv2plug.in/ns/lv2core#connectionOptional | |||||
#define LV2_CORE__control LV2_CORE_PREFIX "control" ///< http://lv2plug.in/ns/lv2core#control | |||||
#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__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 | |||||
#define LV2_CORE__hardRTCapable LV2_CORE_PREFIX "hardRTCapable" ///< http://lv2plug.in/ns/lv2core#hardRTCapable | |||||
#define LV2_CORE__inPlaceBroken LV2_CORE_PREFIX "inPlaceBroken" ///< http://lv2plug.in/ns/lv2core#inPlaceBroken | |||||
#define LV2_CORE__index LV2_CORE_PREFIX "index" ///< http://lv2plug.in/ns/lv2core#index | |||||
#define LV2_CORE__integer LV2_CORE_PREFIX "integer" ///< http://lv2plug.in/ns/lv2core#integer | |||||
#define LV2_CORE__isLive LV2_CORE_PREFIX "isLive" ///< http://lv2plug.in/ns/lv2core#isLive | |||||
#define LV2_CORE__latency LV2_CORE_PREFIX "latency" ///< http://lv2plug.in/ns/lv2core#latency | |||||
#define LV2_CORE__maximum LV2_CORE_PREFIX "maximum" ///< http://lv2plug.in/ns/lv2core#maximum | |||||
#define LV2_CORE__microVersion LV2_CORE_PREFIX "microVersion" ///< http://lv2plug.in/ns/lv2core#microVersion | |||||
#define LV2_CORE__minimum LV2_CORE_PREFIX "minimum" ///< http://lv2plug.in/ns/lv2core#minimum | |||||
#define LV2_CORE__minorVersion LV2_CORE_PREFIX "minorVersion" ///< http://lv2plug.in/ns/lv2core#minorVersion | |||||
#define LV2_CORE__name LV2_CORE_PREFIX "name" ///< http://lv2plug.in/ns/lv2core#name | |||||
#define LV2_CORE__optionalFeature LV2_CORE_PREFIX "optionalFeature" ///< http://lv2plug.in/ns/lv2core#optionalFeature | |||||
#define LV2_CORE__port LV2_CORE_PREFIX "port" ///< http://lv2plug.in/ns/lv2core#port | |||||
#define LV2_CORE__portProperty LV2_CORE_PREFIX "portProperty" ///< http://lv2plug.in/ns/lv2core#portProperty | |||||
#define LV2_CORE__project LV2_CORE_PREFIX "project" ///< http://lv2plug.in/ns/lv2core#project | |||||
#define LV2_CORE__prototype LV2_CORE_PREFIX "prototype" ///< http://lv2plug.in/ns/lv2core#prototype | |||||
#define LV2_CORE__reportsLatency LV2_CORE_PREFIX "reportsLatency" ///< http://lv2plug.in/ns/lv2core#reportsLatency | |||||
#define LV2_CORE__requiredFeature LV2_CORE_PREFIX "requiredFeature" ///< http://lv2plug.in/ns/lv2core#requiredFeature | |||||
#define LV2_CORE__sampleRate LV2_CORE_PREFIX "sampleRate" ///< http://lv2plug.in/ns/lv2core#sampleRate | |||||
#define LV2_CORE__scalePoint LV2_CORE_PREFIX "scalePoint" ///< http://lv2plug.in/ns/lv2core#scalePoint | |||||
#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 | |||||
#ifdef __cplusplus | #ifdef __cplusplus | ||||
extern "C" { | extern "C" { | ||||
@@ -135,7 +137,7 @@ typedef void * LV2_Handle; | |||||
Features allow hosts to make additional functionality available to plugins | Features allow hosts to make additional functionality available to plugins | ||||
without requiring modification to the LV2 API. Extensions may define new | without requiring modification to the LV2 API. Extensions may define new | ||||
features and specify the @ref URI and @ref data to be used if necessary. | |||||
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. | Some features, such as lv2:isLive, do not require the host to pass data. | ||||
*/ | */ | ||||
typedef struct _LV2_Feature { | typedef struct _LV2_Feature { | ||||
@@ -150,7 +152,7 @@ typedef struct _LV2_Feature { | |||||
Pointer to arbitrary data. | Pointer to arbitrary data. | ||||
The format of this data is defined by the extension which describes the | The format of this data is defined by the extension which describes the | ||||
feature with the given @ref URI. | |||||
feature with the given `URI`. | |||||
*/ | */ | ||||
void * data; | void * data; | ||||
} LV2_Feature; | } LV2_Feature; | ||||
@@ -276,12 +278,12 @@ typedef struct _LV2_Descriptor { | |||||
things that the plugin MUST NOT do within the run() function (see | things that the plugin MUST NOT do within the run() function (see | ||||
lv2core.ttl for details). | lv2core.ttl for details). | ||||
As a special case, when @p sample_count == 0, the plugin should update | |||||
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 | any output ports that represent a single instant in time (e.g. control | ||||
ports, but not audio ports). This is particularly useful for latent | ports, but not audio ports). This is particularly useful for latent | ||||
plugins, which should update their latency output port so hosts can | plugins, which should update their latency output port so hosts can | ||||
pre-roll plugins to compute latency. Plugins MUST NOT crash when | pre-roll plugins to compute latency. Plugins MUST NOT crash when | ||||
@p sample_count == 0. | |||||
`sample_count` is 0. | |||||
@param instance Instance to be run. | @param instance Instance to be run. | ||||
@@ -340,14 +342,23 @@ typedef struct _LV2_Descriptor { | |||||
const void * (*extension_data)(const char * uri); | const void * (*extension_data)(const char * uri); | ||||
} LV2_Descriptor; | } LV2_Descriptor; | ||||
/** | |||||
Helper macro needed for LV2_SYMBOL_EXPORT when using C++. | |||||
*/ | |||||
#ifdef __cplusplus | |||||
# define LV2_SYMBOL_EXTERN extern "C" | |||||
#else | |||||
# define LV2_SYMBOL_EXTERN | |||||
#endif | |||||
/** | /** | ||||
Put this (LV2_SYMBOL_EXPORT) before any functions that are to be loaded | Put this (LV2_SYMBOL_EXPORT) before any functions that are to be loaded | ||||
by the host as a symbol from the dynamic library. | by the host as a symbol from the dynamic library. | ||||
*/ | */ | ||||
#ifdef _WIN32 | #ifdef _WIN32 | ||||
# define LV2_SYMBOL_EXPORT __declspec(dllexport) | |||||
# define LV2_SYMBOL_EXPORT LV2_SYMBOL_EXTERN __declspec(dllexport) | |||||
#else | #else | ||||
# define LV2_SYMBOL_EXPORT | |||||
# define LV2_SYMBOL_EXPORT LV2_SYMBOL_EXTERN __attribute__((visibility("default"))) | |||||
#endif | #endif | ||||
/** | /** | ||||
@@ -368,9 +379,9 @@ typedef struct _LV2_Descriptor { | |||||
function to find the LV2_Descriptor for the desired plugin. Plugins are | function to find the LV2_Descriptor for the desired plugin. Plugins are | ||||
accessed by index using values from 0 upwards. This function MUST return | accessed by index using values from 0 upwards. This function MUST return | ||||
NULL for out of range indices, so the host can enumerate plugins by | NULL for out of range indices, so the host can enumerate plugins by | ||||
increasing @p index until NULL is returned. | |||||
increasing `index` until NULL is returned. | |||||
Note that @p index has no meaning, hosts MUST NOT depend on it remaining | |||||
Note that `index` has no meaning, hosts MUST NOT depend on it remaining | |||||
consistent between loads of the plugin library. | consistent between loads of the plugin library. | ||||
*/ | */ | ||||
LV2_SYMBOL_EXPORT | LV2_SYMBOL_EXPORT | ||||
@@ -418,7 +429,7 @@ typedef struct { | |||||
Plugins are accessed by index using values from 0 upwards. Out of range | Plugins are accessed by index using values from 0 upwards. Out of range | ||||
indices MUST result in this function returning NULL, so the host can | indices MUST result in this function returning NULL, so the host can | ||||
enumerate plugins by increasing @a index until NULL is returned. | |||||
enumerate plugins by increasing `index` until NULL is returned. | |||||
*/ | */ | ||||
const LV2_Descriptor * (*get_plugin)(LV2_Lib_Handle handle, | const LV2_Descriptor * (*get_plugin)(LV2_Lib_Handle handle, | ||||
uint32_t index); | uint32_t index); | ||||
@@ -440,6 +451,7 @@ typedef struct { | |||||
be destroyed (using LV2_Lib_Descriptor::cleanup()) until all plugins loaded | be destroyed (using LV2_Lib_Descriptor::cleanup()) until all plugins loaded | ||||
from that library have been destroyed. | from that library have been destroyed. | ||||
*/ | */ | ||||
LV2_SYMBOL_EXPORT | |||||
const LV2_Lib_Descriptor * | const LV2_Lib_Descriptor * | ||||
lv2_lib_descriptor(const char * bundle_path, | lv2_lib_descriptor(const char * bundle_path, | ||||
const LV2_Feature *const * features); | const LV2_Feature *const * features); | ||||
@@ -456,3 +468,7 @@ typedef const LV2_Lib_Descriptor * | |||||
#endif | #endif | ||||
#endif /* LV2_H_INCLUDED */ | #endif /* LV2_H_INCLUDED */ | ||||
/** | |||||
@} | |||||
*/ |
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
Copyright 2012 David Robillard <http://drobilla.net> | |||||
Copyright 2012-2016 David Robillard <http://drobilla.net> | |||||
Permission to use, copy, modify, and/or distribute this software for any | Permission to use, copy, modify, and/or distribute this software for any | ||||
purpose with or without fee is hereby granted, provided that the above | purpose with or without fee is hereby granted, provided that the above | ||||
@@ -15,8 +15,12 @@ | |||||
*/ | */ | ||||
/** | /** | ||||
@file midi.h | |||||
C definitions for the LV2 MIDI extension <http://lv2plug.in/ns/ext/midi>. | |||||
@defgroup midi MIDI | |||||
Definitions of standard MIDI messages, see <http://lv2plug.in/ns/ext/midi> | |||||
for details. | |||||
@{ | |||||
*/ | */ | ||||
#ifndef LV2_MIDI_H | #ifndef LV2_MIDI_H | ||||
@@ -30,50 +34,50 @@ extern "C" { | |||||
# include <stdbool.h> | # include <stdbool.h> | ||||
#endif | #endif | ||||
#define LV2_MIDI_URI "http://lv2plug.in/ns/ext/midi" | |||||
#define LV2_MIDI_PREFIX LV2_MIDI_URI "#" | |||||
#define LV2_MIDI__ActiveSense LV2_MIDI_PREFIX "ActiveSense" | |||||
#define LV2_MIDI__Aftertouch LV2_MIDI_PREFIX "Aftertouch" | |||||
#define LV2_MIDI__Bender LV2_MIDI_PREFIX "Bender" | |||||
#define LV2_MIDI__ChannelPressure LV2_MIDI_PREFIX "ChannelPressure" | |||||
#define LV2_MIDI__Chunk LV2_MIDI_PREFIX "Chunk" | |||||
#define LV2_MIDI__Clock LV2_MIDI_PREFIX "Clock" | |||||
#define LV2_MIDI__Continue LV2_MIDI_PREFIX "Continue" | |||||
#define LV2_MIDI__Controller LV2_MIDI_PREFIX "Controller" | |||||
#define LV2_MIDI__MidiEvent LV2_MIDI_PREFIX "MidiEvent" | |||||
#define LV2_MIDI__NoteOff LV2_MIDI_PREFIX "NoteOff" | |||||
#define LV2_MIDI__NoteOn LV2_MIDI_PREFIX "NoteOn" | |||||
#define LV2_MIDI__ProgramChange LV2_MIDI_PREFIX "ProgramChange" | |||||
#define LV2_MIDI__QuarterFrame LV2_MIDI_PREFIX "QuarterFrame" | |||||
#define LV2_MIDI__Reset LV2_MIDI_PREFIX "Reset" | |||||
#define LV2_MIDI__SongPosition LV2_MIDI_PREFIX "SongPosition" | |||||
#define LV2_MIDI__SongSelect LV2_MIDI_PREFIX "SongSelect" | |||||
#define LV2_MIDI__Start LV2_MIDI_PREFIX "Start" | |||||
#define LV2_MIDI__Stop LV2_MIDI_PREFIX "Stop" | |||||
#define LV2_MIDI__SystemCommon LV2_MIDI_PREFIX "SystemCommon" | |||||
#define LV2_MIDI__SystemExclusive LV2_MIDI_PREFIX "SystemExclusive" | |||||
#define LV2_MIDI__SystemMessage LV2_MIDI_PREFIX "SystemMessage" | |||||
#define LV2_MIDI__SystemRealtime LV2_MIDI_PREFIX "SystemRealtime" | |||||
#define LV2_MIDI__Tick LV2_MIDI_PREFIX "Tick" | |||||
#define LV2_MIDI__TuneRequest LV2_MIDI_PREFIX "TuneRequest" | |||||
#define LV2_MIDI__VoiceMessage LV2_MIDI_PREFIX "VoiceMessage" | |||||
#define LV2_MIDI__benderValue LV2_MIDI_PREFIX "benderValue" | |||||
#define LV2_MIDI__binding LV2_MIDI_PREFIX "binding" | |||||
#define LV2_MIDI__byteNumber LV2_MIDI_PREFIX "byteNumber" | |||||
#define LV2_MIDI__channel LV2_MIDI_PREFIX "channel" | |||||
#define LV2_MIDI__chunk LV2_MIDI_PREFIX "chunk" | |||||
#define LV2_MIDI__controllerNumber LV2_MIDI_PREFIX "controllerNumber" | |||||
#define LV2_MIDI__controllerValue LV2_MIDI_PREFIX "controllerValue" | |||||
#define LV2_MIDI__noteNumber LV2_MIDI_PREFIX "noteNumber" | |||||
#define LV2_MIDI__pressure LV2_MIDI_PREFIX "pressure" | |||||
#define LV2_MIDI__programNumber LV2_MIDI_PREFIX "programNumber" | |||||
#define LV2_MIDI__property LV2_MIDI_PREFIX "property" | |||||
#define LV2_MIDI__songNumber LV2_MIDI_PREFIX "songNumber" | |||||
#define LV2_MIDI__songPosition LV2_MIDI_PREFIX "songPosition" | |||||
#define LV2_MIDI__status LV2_MIDI_PREFIX "status" | |||||
#define LV2_MIDI__statusMask LV2_MIDI_PREFIX "statusMask" | |||||
#define LV2_MIDI__velocity LV2_MIDI_PREFIX "velocity" | |||||
#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# | |||||
#define LV2_MIDI__ActiveSense LV2_MIDI_PREFIX "ActiveSense" ///< http://lv2plug.in/ns/ext/midi#ActiveSense | |||||
#define LV2_MIDI__Aftertouch LV2_MIDI_PREFIX "Aftertouch" ///< http://lv2plug.in/ns/ext/midi#Aftertouch | |||||
#define LV2_MIDI__Bender LV2_MIDI_PREFIX "Bender" ///< http://lv2plug.in/ns/ext/midi#Bender | |||||
#define LV2_MIDI__ChannelPressure LV2_MIDI_PREFIX "ChannelPressure" ///< http://lv2plug.in/ns/ext/midi#ChannelPressure | |||||
#define LV2_MIDI__Chunk LV2_MIDI_PREFIX "Chunk" ///< http://lv2plug.in/ns/ext/midi#Chunk | |||||
#define LV2_MIDI__Clock LV2_MIDI_PREFIX "Clock" ///< http://lv2plug.in/ns/ext/midi#Clock | |||||
#define LV2_MIDI__Continue LV2_MIDI_PREFIX "Continue" ///< http://lv2plug.in/ns/ext/midi#Continue | |||||
#define LV2_MIDI__Controller LV2_MIDI_PREFIX "Controller" ///< http://lv2plug.in/ns/ext/midi#Controller | |||||
#define LV2_MIDI__MidiEvent LV2_MIDI_PREFIX "MidiEvent" ///< http://lv2plug.in/ns/ext/midi#MidiEvent | |||||
#define LV2_MIDI__NoteOff LV2_MIDI_PREFIX "NoteOff" ///< http://lv2plug.in/ns/ext/midi#NoteOff | |||||
#define LV2_MIDI__NoteOn LV2_MIDI_PREFIX "NoteOn" ///< http://lv2plug.in/ns/ext/midi#NoteOn | |||||
#define LV2_MIDI__ProgramChange LV2_MIDI_PREFIX "ProgramChange" ///< http://lv2plug.in/ns/ext/midi#ProgramChange | |||||
#define LV2_MIDI__QuarterFrame LV2_MIDI_PREFIX "QuarterFrame" ///< http://lv2plug.in/ns/ext/midi#QuarterFrame | |||||
#define LV2_MIDI__Reset LV2_MIDI_PREFIX "Reset" ///< http://lv2plug.in/ns/ext/midi#Reset | |||||
#define LV2_MIDI__SongPosition LV2_MIDI_PREFIX "SongPosition" ///< http://lv2plug.in/ns/ext/midi#SongPosition | |||||
#define LV2_MIDI__SongSelect LV2_MIDI_PREFIX "SongSelect" ///< http://lv2plug.in/ns/ext/midi#SongSelect | |||||
#define LV2_MIDI__Start LV2_MIDI_PREFIX "Start" ///< http://lv2plug.in/ns/ext/midi#Start | |||||
#define LV2_MIDI__Stop LV2_MIDI_PREFIX "Stop" ///< http://lv2plug.in/ns/ext/midi#Stop | |||||
#define LV2_MIDI__SystemCommon LV2_MIDI_PREFIX "SystemCommon" ///< http://lv2plug.in/ns/ext/midi#SystemCommon | |||||
#define LV2_MIDI__SystemExclusive LV2_MIDI_PREFIX "SystemExclusive" ///< http://lv2plug.in/ns/ext/midi#SystemExclusive | |||||
#define LV2_MIDI__SystemMessage LV2_MIDI_PREFIX "SystemMessage" ///< http://lv2plug.in/ns/ext/midi#SystemMessage | |||||
#define LV2_MIDI__SystemRealtime LV2_MIDI_PREFIX "SystemRealtime" ///< http://lv2plug.in/ns/ext/midi#SystemRealtime | |||||
#define LV2_MIDI__Tick LV2_MIDI_PREFIX "Tick" ///< http://lv2plug.in/ns/ext/midi#Tick | |||||
#define LV2_MIDI__TuneRequest LV2_MIDI_PREFIX "TuneRequest" ///< http://lv2plug.in/ns/ext/midi#TuneRequest | |||||
#define LV2_MIDI__VoiceMessage LV2_MIDI_PREFIX "VoiceMessage" ///< http://lv2plug.in/ns/ext/midi#VoiceMessage | |||||
#define LV2_MIDI__benderValue LV2_MIDI_PREFIX "benderValue" ///< http://lv2plug.in/ns/ext/midi#benderValue | |||||
#define LV2_MIDI__binding LV2_MIDI_PREFIX "binding" ///< http://lv2plug.in/ns/ext/midi#binding | |||||
#define LV2_MIDI__byteNumber LV2_MIDI_PREFIX "byteNumber" ///< http://lv2plug.in/ns/ext/midi#byteNumber | |||||
#define LV2_MIDI__channel LV2_MIDI_PREFIX "channel" ///< http://lv2plug.in/ns/ext/midi#channel | |||||
#define LV2_MIDI__chunk LV2_MIDI_PREFIX "chunk" ///< http://lv2plug.in/ns/ext/midi#chunk | |||||
#define LV2_MIDI__controllerNumber LV2_MIDI_PREFIX "controllerNumber" ///< http://lv2plug.in/ns/ext/midi#controllerNumber | |||||
#define LV2_MIDI__controllerValue LV2_MIDI_PREFIX "controllerValue" ///< http://lv2plug.in/ns/ext/midi#controllerValue | |||||
#define LV2_MIDI__noteNumber LV2_MIDI_PREFIX "noteNumber" ///< http://lv2plug.in/ns/ext/midi#noteNumber | |||||
#define LV2_MIDI__pressure LV2_MIDI_PREFIX "pressure" ///< http://lv2plug.in/ns/ext/midi#pressure | |||||
#define LV2_MIDI__programNumber LV2_MIDI_PREFIX "programNumber" ///< http://lv2plug.in/ns/ext/midi#programNumber | |||||
#define LV2_MIDI__property LV2_MIDI_PREFIX "property" ///< http://lv2plug.in/ns/ext/midi#property | |||||
#define LV2_MIDI__songNumber LV2_MIDI_PREFIX "songNumber" ///< http://lv2plug.in/ns/ext/midi#songNumber | |||||
#define LV2_MIDI__songPosition LV2_MIDI_PREFIX "songPosition" ///< http://lv2plug.in/ns/ext/midi#songPosition | |||||
#define LV2_MIDI__status LV2_MIDI_PREFIX "status" ///< http://lv2plug.in/ns/ext/midi#status | |||||
#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 | |||||
/** | /** | ||||
MIDI Message Type. | MIDI Message Type. | ||||
@@ -184,7 +188,7 @@ typedef enum { | |||||
} LV2_Midi_Controller; | } LV2_Midi_Controller; | ||||
/** | /** | ||||
Return true iff @p msg is a MIDI voice message (which has a channel). | |||||
Return true iff `msg` is a MIDI voice message (which has a channel). | |||||
*/ | */ | ||||
static inline bool | static inline bool | ||||
lv2_midi_is_voice_message(const uint8_t* msg) { | lv2_midi_is_voice_message(const uint8_t* msg) { | ||||
@@ -192,7 +196,7 @@ lv2_midi_is_voice_message(const uint8_t* msg) { | |||||
} | } | ||||
/** | /** | ||||
Return true iff @p msg is a MIDI system message (which has no channel). | |||||
Return true iff `msg` is a MIDI system message (which has no channel). | |||||
*/ | */ | ||||
static inline bool | static inline bool | ||||
lv2_midi_is_system_message(const uint8_t* msg) { | lv2_midi_is_system_message(const uint8_t* msg) { | ||||
@@ -224,3 +228,7 @@ lv2_midi_message_type(const uint8_t* msg) { | |||||
#endif | #endif | ||||
#endif /* LV2_MIDI_H */ | #endif /* LV2_MIDI_H */ | ||||
/** | |||||
@} | |||||
*/ |
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
Copyright 2012 David Robillard <http://drobilla.net> | |||||
Copyright 2012-2016 David Robillard <http://drobilla.net> | |||||
Permission to use, copy, modify, and/or distribute this software for any | Permission to use, copy, modify, and/or distribute this software for any | ||||
purpose with or without fee is hereby granted, provided that the above | purpose with or without fee is hereby granted, provided that the above | ||||
@@ -14,21 +14,29 @@ | |||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||||
*/ | */ | ||||
#ifndef LV2_MORPH_H | |||||
#define LV2_MORPH_H | |||||
/** | |||||
@defgroup morph Morph | |||||
#include <stdint.h> | |||||
Ports that can dynamically change type, see <http://lv2plug.in/ns/ext/morph> | |||||
for details. | |||||
@{ | |||||
*/ | |||||
#include "lv2.h" | |||||
#include "urid.h" | |||||
#ifndef LV2_MORPH_H | |||||
#define LV2_MORPH_H | |||||
#define LV2_MORPH_URI "http://lv2plug.in/ns/ext/morph" | |||||
#define LV2_MORPH_PREFIX LV2_MORPH_URI "#" | |||||
#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# | |||||
#define LV2_MORPH__AutoMorphPort LV2_MORPH_PREFIX "AutoMorphPort" | |||||
#define LV2_MORPH__MorphPort LV2_MORPH_PREFIX "MorphPort" | |||||
#define LV2_MORPH__interface LV2_MORPH_PREFIX "interface" | |||||
#define LV2_MORPH__supportsType LV2_MORPH_PREFIX "supportsType" | |||||
#define LV2_MORPH__currentType LV2_MORPH_PREFIX "currentType" | |||||
#define LV2_MORPH__AutoMorphPort LV2_MORPH_PREFIX "AutoMorphPort" ///< http://lv2plug.in/ns/ext/morph#AutoMorphPort | |||||
#define LV2_MORPH__MorphPort LV2_MORPH_PREFIX "MorphPort" ///< http://lv2plug.in/ns/ext/morph#MorphPort | |||||
#define LV2_MORPH__interface LV2_MORPH_PREFIX "interface" ///< http://lv2plug.in/ns/ext/morph#interface | |||||
#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 */ | #endif /* LV2_MORPH_H */ | ||||
/** | |||||
@} | |||||
*/ |
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
Copyright 2012 David Robillard <http://drobilla.net> | |||||
Copyright 2012-2016 David Robillard <http://drobilla.net> | |||||
Permission to use, copy, modify, and/or distribute this software for any | Permission to use, copy, modify, and/or distribute this software for any | ||||
purpose with or without fee is hereby granted, provided that the above | purpose with or without fee is hereby granted, provided that the above | ||||
@@ -14,6 +14,15 @@ | |||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 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. | |||||
@{ | |||||
*/ | |||||
#ifndef LV2_OPTIONS_H | #ifndef LV2_OPTIONS_H | ||||
#define LV2_OPTIONS_H | #define LV2_OPTIONS_H | ||||
@@ -22,14 +31,14 @@ | |||||
#include "urid.h" | #include "urid.h" | ||||
#include "lv2.h" | #include "lv2.h" | ||||
#define LV2_OPTIONS_URI "http://lv2plug.in/ns/ext/options" | |||||
#define LV2_OPTIONS_PREFIX LV2_OPTIONS_URI "#" | |||||
#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# | |||||
#define LV2_OPTIONS__Option LV2_OPTIONS_PREFIX "Option" | |||||
#define LV2_OPTIONS__interface LV2_OPTIONS_PREFIX "interface" | |||||
#define LV2_OPTIONS__options LV2_OPTIONS_PREFIX "options" | |||||
#define LV2_OPTIONS__requiredOption LV2_OPTIONS_PREFIX "requiredOption" | |||||
#define LV2_OPTIONS__supportedOption LV2_OPTIONS_PREFIX "supportedOption" | |||||
#define LV2_OPTIONS__Option LV2_OPTIONS_PREFIX "Option" ///< http://lv2plug.in/ns/ext/options#Option | |||||
#define LV2_OPTIONS__interface LV2_OPTIONS_PREFIX "interface" ///< http://lv2plug.in/ns/ext/options#interface | |||||
#define LV2_OPTIONS__options LV2_OPTIONS_PREFIX "options" ///< http://lv2plug.in/ns/ext/options#options | |||||
#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 | |||||
#ifdef __cplusplus | #ifdef __cplusplus | ||||
extern "C" { | extern "C" { | ||||
@@ -130,3 +139,7 @@ typedef struct _LV2_Options_Interface { | |||||
#endif | #endif | ||||
#endif /* LV2_OPTIONS_H */ | #endif /* LV2_OPTIONS_H */ | ||||
/** | |||||
@} | |||||
*/ |
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
Copyright 2012 David Robillard <http://drobilla.net> | |||||
Copyright 2012-2016 David Robillard <http://drobilla.net> | |||||
Permission to use, copy, modify, and/or distribute this software for any | Permission to use, copy, modify, and/or distribute this software for any | ||||
purpose with or without fee is hereby granted, provided that the above | purpose with or without fee is hereby granted, provided that the above | ||||
@@ -14,36 +14,49 @@ | |||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||||
*/ | */ | ||||
/** | |||||
@defgroup parameters Parameters | |||||
Common parameters for audio processing, see | |||||
<http://lv2plug.in/ns/ext/parameters>. | |||||
@{ | |||||
*/ | |||||
#ifndef LV2_PARAMETERS_H | #ifndef LV2_PARAMETERS_H | ||||
#define LV2_PARAMETERS_H | #define LV2_PARAMETERS_H | ||||
#define LV2_PARAMETERS_URI "http://lv2plug.in/ns/ext/parameters" | |||||
#define LV2_PARAMETERS_PREFIX LV2_PARAMETERS_URI "#" | |||||
#define LV2_PARAMETERS__CompressorControls LV2_PARAMETERS_PREFIX "CompressorControls" | |||||
#define LV2_PARAMETERS__ControlGroup LV2_PARAMETERS_PREFIX "ControlGroup" | |||||
#define LV2_PARAMETERS__EnvelopeControls LV2_PARAMETERS_PREFIX "EnvelopeControls" | |||||
#define LV2_PARAMETERS__FilterControls LV2_PARAMETERS_PREFIX "FilterControls" | |||||
#define LV2_PARAMETERS__OscillatorControls LV2_PARAMETERS_PREFIX "OscillatorControls" | |||||
#define LV2_PARAMETERS__amplitude LV2_PARAMETERS_PREFIX "amplitude" | |||||
#define LV2_PARAMETERS__attack LV2_PARAMETERS_PREFIX "attack" | |||||
#define LV2_PARAMETERS__bypass LV2_PARAMETERS_PREFIX "bypass" | |||||
#define LV2_PARAMETERS__cutoffFrequency LV2_PARAMETERS_PREFIX "cutoffFrequency" | |||||
#define LV2_PARAMETERS__decay LV2_PARAMETERS_PREFIX "decay" | |||||
#define LV2_PARAMETERS__delay LV2_PARAMETERS_PREFIX "delay" | |||||
#define LV2_PARAMETERS__dryLevel LV2_PARAMETERS_PREFIX "dryLevel" | |||||
#define LV2_PARAMETERS__frequency LV2_PARAMETERS_PREFIX "frequency" | |||||
#define LV2_PARAMETERS__gain LV2_PARAMETERS_PREFIX "gain" | |||||
#define LV2_PARAMETERS__hold LV2_PARAMETERS_PREFIX "hold" | |||||
#define LV2_PARAMETERS__pulseWidth LV2_PARAMETERS_PREFIX "pulseWidth" | |||||
#define LV2_PARAMETERS__ratio LV2_PARAMETERS_PREFIX "ratio" | |||||
#define LV2_PARAMETERS__release LV2_PARAMETERS_PREFIX "release" | |||||
#define LV2_PARAMETERS__resonance LV2_PARAMETERS_PREFIX "resonance" | |||||
#define LV2_PARAMETERS__sampleRate LV2_PARAMETERS_PREFIX "sampleRate" | |||||
#define LV2_PARAMETERS__sustain LV2_PARAMETERS_PREFIX "sustain" | |||||
#define LV2_PARAMETERS__threshold LV2_PARAMETERS_PREFIX "threshold" | |||||
#define LV2_PARAMETERS__waveform LV2_PARAMETERS_PREFIX "waveform" | |||||
#define LV2_PARAMETERS__wetDryRatio LV2_PARAMETERS_PREFIX "wetDryRatio" | |||||
#define LV2_PARAMETERS__wetLevel LV2_PARAMETERS_PREFIX "wetLevel" | |||||
#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# | |||||
#define LV2_PARAMETERS__CompressorControls LV2_PARAMETERS_PREFIX "CompressorControls" ///< http://lv2plug.in/ns/ext/parameters#CompressorControls | |||||
#define LV2_PARAMETERS__ControlGroup LV2_PARAMETERS_PREFIX "ControlGroup" ///< http://lv2plug.in/ns/ext/parameters#ControlGroup | |||||
#define LV2_PARAMETERS__EnvelopeControls LV2_PARAMETERS_PREFIX "EnvelopeControls" ///< http://lv2plug.in/ns/ext/parameters#EnvelopeControls | |||||
#define LV2_PARAMETERS__FilterControls LV2_PARAMETERS_PREFIX "FilterControls" ///< http://lv2plug.in/ns/ext/parameters#FilterControls | |||||
#define LV2_PARAMETERS__OscillatorControls LV2_PARAMETERS_PREFIX "OscillatorControls" ///< http://lv2plug.in/ns/ext/parameters#OscillatorControls | |||||
#define LV2_PARAMETERS__amplitude LV2_PARAMETERS_PREFIX "amplitude" ///< http://lv2plug.in/ns/ext/parameters#amplitude | |||||
#define LV2_PARAMETERS__attack LV2_PARAMETERS_PREFIX "attack" ///< http://lv2plug.in/ns/ext/parameters#attack | |||||
#define LV2_PARAMETERS__bypass LV2_PARAMETERS_PREFIX "bypass" ///< http://lv2plug.in/ns/ext/parameters#bypass | |||||
#define LV2_PARAMETERS__cutoffFrequency LV2_PARAMETERS_PREFIX "cutoffFrequency" ///< http://lv2plug.in/ns/ext/parameters#cutoffFrequency | |||||
#define LV2_PARAMETERS__decay LV2_PARAMETERS_PREFIX "decay" ///< http://lv2plug.in/ns/ext/parameters#decay | |||||
#define LV2_PARAMETERS__delay LV2_PARAMETERS_PREFIX "delay" ///< http://lv2plug.in/ns/ext/parameters#delay | |||||
#define LV2_PARAMETERS__dryLevel LV2_PARAMETERS_PREFIX "dryLevel" ///< http://lv2plug.in/ns/ext/parameters#dryLevel | |||||
#define LV2_PARAMETERS__frequency LV2_PARAMETERS_PREFIX "frequency" ///< http://lv2plug.in/ns/ext/parameters#frequency | |||||
#define LV2_PARAMETERS__gain LV2_PARAMETERS_PREFIX "gain" ///< http://lv2plug.in/ns/ext/parameters#gain | |||||
#define LV2_PARAMETERS__hold LV2_PARAMETERS_PREFIX "hold" ///< http://lv2plug.in/ns/ext/parameters#hold | |||||
#define LV2_PARAMETERS__pulseWidth LV2_PARAMETERS_PREFIX "pulseWidth" ///< http://lv2plug.in/ns/ext/parameters#pulseWidth | |||||
#define LV2_PARAMETERS__ratio LV2_PARAMETERS_PREFIX "ratio" ///< http://lv2plug.in/ns/ext/parameters#ratio | |||||
#define LV2_PARAMETERS__release LV2_PARAMETERS_PREFIX "release" ///< http://lv2plug.in/ns/ext/parameters#release | |||||
#define LV2_PARAMETERS__resonance LV2_PARAMETERS_PREFIX "resonance" ///< http://lv2plug.in/ns/ext/parameters#resonance | |||||
#define LV2_PARAMETERS__sampleRate LV2_PARAMETERS_PREFIX "sampleRate" ///< http://lv2plug.in/ns/ext/parameters#sampleRate | |||||
#define LV2_PARAMETERS__sustain LV2_PARAMETERS_PREFIX "sustain" ///< http://lv2plug.in/ns/ext/parameters#sustain | |||||
#define LV2_PARAMETERS__threshold LV2_PARAMETERS_PREFIX "threshold" ///< http://lv2plug.in/ns/ext/parameters#threshold | |||||
#define LV2_PARAMETERS__waveform LV2_PARAMETERS_PREFIX "waveform" ///< http://lv2plug.in/ns/ext/parameters#waveform | |||||
#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 */ | #endif /* LV2_PARAMETERS_H */ | ||||
/** | |||||
@} | |||||
*/ |
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
Copyright 2012 David Robillard <http://drobilla.net> | |||||
Copyright 2012-2016 David Robillard <http://drobilla.net> | |||||
Permission to use, copy, modify, and/or distribute this software for any | Permission to use, copy, modify, and/or distribute this software for any | ||||
purpose with or without fee is hereby granted, provided that the above | purpose with or without fee is hereby granted, provided that the above | ||||
@@ -15,42 +15,52 @@ | |||||
*/ | */ | ||||
/** | /** | ||||
@file patch.h C header for the LV2 Patch extension | |||||
<http://lv2plug.in/ns/ext/patch>. | |||||
@defgroup patch Patch | |||||
The patch extension is purely data, this header merely defines URIs | |||||
for convenience. | |||||
Messages for accessing and manipulating properties, see | |||||
<http://lv2plug.in/ns/ext/patch> for details. | |||||
Note the patch extension is purely data, this header merely defines URIs for | |||||
convenience. | |||||
@{ | |||||
*/ | */ | ||||
#ifndef LV2_PATCH_H | #ifndef LV2_PATCH_H | ||||
#define LV2_PATCH_H | #define LV2_PATCH_H | ||||
#define LV2_PATCH_URI "http://lv2plug.in/ns/ext/patch" | |||||
#define LV2_PATCH_PREFIX LV2_PATCH_URI "#" | |||||
#define LV2_PATCH__Ack LV2_PATCH_PREFIX "Ack" | |||||
#define LV2_PATCH__Delete LV2_PATCH_PREFIX "Delete" | |||||
#define LV2_PATCH__Error LV2_PATCH_PREFIX "Error" | |||||
#define LV2_PATCH__Get LV2_PATCH_PREFIX "Get" | |||||
#define LV2_PATCH__Message LV2_PATCH_PREFIX "Message" | |||||
#define LV2_PATCH__Move LV2_PATCH_PREFIX "Move" | |||||
#define LV2_PATCH__Patch LV2_PATCH_PREFIX "Patch" | |||||
#define LV2_PATCH__Post LV2_PATCH_PREFIX "Post" | |||||
#define LV2_PATCH__Put LV2_PATCH_PREFIX "Put" | |||||
#define LV2_PATCH__Request LV2_PATCH_PREFIX "Request" | |||||
#define LV2_PATCH__Response LV2_PATCH_PREFIX "Response" | |||||
#define LV2_PATCH__Set LV2_PATCH_PREFIX "Set" | |||||
#define LV2_PATCH__add LV2_PATCH_PREFIX "add" | |||||
#define LV2_PATCH__body LV2_PATCH_PREFIX "body" | |||||
#define LV2_PATCH__destination LV2_PATCH_PREFIX "destination" | |||||
#define LV2_PATCH__property LV2_PATCH_PREFIX "property" | |||||
#define LV2_PATCH__readable LV2_PATCH_PREFIX "readable" | |||||
#define LV2_PATCH__remove LV2_PATCH_PREFIX "remove" | |||||
#define LV2_PATCH__request LV2_PATCH_PREFIX "request" | |||||
#define LV2_PATCH__subject LV2_PATCH_PREFIX "subject" | |||||
#define LV2_PATCH__sequenceNumber LV2_PATCH_PREFIX "sequenceNumber" | |||||
#define LV2_PATCH__value LV2_PATCH_PREFIX "value" | |||||
#define LV2_PATCH__wildcard LV2_PATCH_PREFIX "wildcard" | |||||
#define LV2_PATCH__writable LV2_PATCH_PREFIX "writable" | |||||
#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# | |||||
#define LV2_PATCH__Ack LV2_PATCH_PREFIX "Ack" ///< http://lv2plug.in/ns/ext/patch#Ack | |||||
#define LV2_PATCH__Delete LV2_PATCH_PREFIX "Delete" ///< http://lv2plug.in/ns/ext/patch#Delete | |||||
#define LV2_PATCH__Copy LV2_PATCH_PREFIX "Copy" ///< http://lv2plug.in/ns/ext/patch#Copy | |||||
#define LV2_PATCH__Error LV2_PATCH_PREFIX "Error" ///< http://lv2plug.in/ns/ext/patch#Error | |||||
#define LV2_PATCH__Get LV2_PATCH_PREFIX "Get" ///< http://lv2plug.in/ns/ext/patch#Get | |||||
#define LV2_PATCH__Message LV2_PATCH_PREFIX "Message" ///< http://lv2plug.in/ns/ext/patch#Message | |||||
#define LV2_PATCH__Move LV2_PATCH_PREFIX "Move" ///< http://lv2plug.in/ns/ext/patch#Move | |||||
#define LV2_PATCH__Patch LV2_PATCH_PREFIX "Patch" ///< http://lv2plug.in/ns/ext/patch#Patch | |||||
#define LV2_PATCH__Post LV2_PATCH_PREFIX "Post" ///< http://lv2plug.in/ns/ext/patch#Post | |||||
#define LV2_PATCH__Put LV2_PATCH_PREFIX "Put" ///< http://lv2plug.in/ns/ext/patch#Put | |||||
#define LV2_PATCH__Request LV2_PATCH_PREFIX "Request" ///< http://lv2plug.in/ns/ext/patch#Request | |||||
#define LV2_PATCH__Response LV2_PATCH_PREFIX "Response" ///< http://lv2plug.in/ns/ext/patch#Response | |||||
#define LV2_PATCH__Set LV2_PATCH_PREFIX "Set" ///< http://lv2plug.in/ns/ext/patch#Set | |||||
#define LV2_PATCH__accept LV2_PATCH_PREFIX "accept" ///< http://lv2plug.in/ns/ext/patch#accept | |||||
#define LV2_PATCH__add LV2_PATCH_PREFIX "add" ///< http://lv2plug.in/ns/ext/patch#add | |||||
#define LV2_PATCH__body LV2_PATCH_PREFIX "body" ///< http://lv2plug.in/ns/ext/patch#body | |||||
#define LV2_PATCH__destination LV2_PATCH_PREFIX "destination" ///< http://lv2plug.in/ns/ext/patch#destination | |||||
#define LV2_PATCH__property LV2_PATCH_PREFIX "property" ///< http://lv2plug.in/ns/ext/patch#property | |||||
#define LV2_PATCH__readable LV2_PATCH_PREFIX "readable" ///< http://lv2plug.in/ns/ext/patch#readable | |||||
#define LV2_PATCH__remove LV2_PATCH_PREFIX "remove" ///< http://lv2plug.in/ns/ext/patch#remove | |||||
#define LV2_PATCH__request LV2_PATCH_PREFIX "request" ///< http://lv2plug.in/ns/ext/patch#request | |||||
#define LV2_PATCH__subject LV2_PATCH_PREFIX "subject" ///< http://lv2plug.in/ns/ext/patch#subject | |||||
#define LV2_PATCH__sequenceNumber LV2_PATCH_PREFIX "sequenceNumber" ///< http://lv2plug.in/ns/ext/patch#sequenceNumber | |||||
#define LV2_PATCH__value LV2_PATCH_PREFIX "value" ///< http://lv2plug.in/ns/ext/patch#value | |||||
#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 */ | #endif /* LV2_PATCH_H */ | ||||
/** | |||||
@} | |||||
*/ |
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
Copyright 2012 David Robillard <http://drobilla.net> | |||||
Copyright 2012-2016 David Robillard <http://drobilla.net> | |||||
Permission to use, copy, modify, and/or distribute this software for any | Permission to use, copy, modify, and/or distribute this software for any | ||||
purpose with or without fee is hereby granted, provided that the above | purpose with or without fee is hereby granted, provided that the above | ||||
@@ -15,50 +15,57 @@ | |||||
*/ | */ | ||||
/** | /** | ||||
@file port-groups.h | |||||
C definitions for the LV2 Port Groups extension | |||||
<http://lv2plug.in/ns/ext/port-groups>. | |||||
@defgroup port-groups Port Groups | |||||
Multi-channel groups of LV2 ports, see | |||||
<http://lv2plug.in/ns/ext/port-groups> for details. | |||||
@{ | |||||
*/ | */ | ||||
#ifndef LV2_PORT_GROUPS_H | #ifndef LV2_PORT_GROUPS_H | ||||
#define LV2_PORT_GROUPS_H | #define LV2_PORT_GROUPS_H | ||||
#define LV2_PORT_GROUPS_URI "http://lv2plug.in/ns/ext/port-groups" | |||||
#define LV2_PORT_GROUPS_PREFIX LV2_PORT_GROUPS_URI "#" | |||||
#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# | |||||
#define LV2_PORT_GROUPS__DiscreteGroup LV2_PORT_GROUPS_PREFIX "DiscreteGroup" | |||||
#define LV2_PORT_GROUPS__Element LV2_PORT_GROUPS_PREFIX "Element" | |||||
#define LV2_PORT_GROUPS__FivePointOneGroup LV2_PORT_GROUPS_PREFIX "FivePointOneGroup" | |||||
#define LV2_PORT_GROUPS__FivePointZeroGroup LV2_PORT_GROUPS_PREFIX "FivePointZeroGroup" | |||||
#define LV2_PORT_GROUPS__FourPointZeroGroup LV2_PORT_GROUPS_PREFIX "FourPointZeroGroup" | |||||
#define LV2_PORT_GROUPS__Group LV2_PORT_GROUPS_PREFIX "Group" | |||||
#define LV2_PORT_GROUPS__InputGroup LV2_PORT_GROUPS_PREFIX "InputGroup" | |||||
#define LV2_PORT_GROUPS__MidSideGroup LV2_PORT_GROUPS_PREFIX "MidSideGroup" | |||||
#define LV2_PORT_GROUPS__MonoGroup LV2_PORT_GROUPS_PREFIX "MonoGroup" | |||||
#define LV2_PORT_GROUPS__OutputGroup LV2_PORT_GROUPS_PREFIX "OutputGroup" | |||||
#define LV2_PORT_GROUPS__SevenPointOneGroup LV2_PORT_GROUPS_PREFIX "SevenPointOneGroup" | |||||
#define LV2_PORT_GROUPS__SevenPointOneWideGroup LV2_PORT_GROUPS_PREFIX "SevenPointOneWideGroup" | |||||
#define LV2_PORT_GROUPS__SixPointOneGroup LV2_PORT_GROUPS_PREFIX "SixPointOneGroup" | |||||
#define LV2_PORT_GROUPS__StereoGroup LV2_PORT_GROUPS_PREFIX "StereoGroup" | |||||
#define LV2_PORT_GROUPS__ThreePointZeroGroup LV2_PORT_GROUPS_PREFIX "ThreePointZeroGroup" | |||||
#define LV2_PORT_GROUPS__center LV2_PORT_GROUPS_PREFIX "center" | |||||
#define LV2_PORT_GROUPS__centerLeft LV2_PORT_GROUPS_PREFIX "centerLeft" | |||||
#define LV2_PORT_GROUPS__centerRight LV2_PORT_GROUPS_PREFIX "centerRight" | |||||
#define LV2_PORT_GROUPS__element LV2_PORT_GROUPS_PREFIX "element" | |||||
#define LV2_PORT_GROUPS__group LV2_PORT_GROUPS_PREFIX "group" | |||||
#define LV2_PORT_GROUPS__left LV2_PORT_GROUPS_PREFIX "left" | |||||
#define LV2_PORT_GROUPS__lowFrequencyEffects LV2_PORT_GROUPS_PREFIX "lowFrequencyEffects" | |||||
#define LV2_PORT_GROUPS__mainInput LV2_PORT_GROUPS_PREFIX "mainInput" | |||||
#define LV2_PORT_GROUPS__mainOutput LV2_PORT_GROUPS_PREFIX "mainOutput" | |||||
#define LV2_PORT_GROUPS__rearCenter LV2_PORT_GROUPS_PREFIX "rearCenter" | |||||
#define LV2_PORT_GROUPS__rearLeft LV2_PORT_GROUPS_PREFIX "rearLeft" | |||||
#define LV2_PORT_GROUPS__rearRight LV2_PORT_GROUPS_PREFIX "rearRight" | |||||
#define LV2_PORT_GROUPS__right LV2_PORT_GROUPS_PREFIX "right" | |||||
#define LV2_PORT_GROUPS__side LV2_PORT_GROUPS_PREFIX "side" | |||||
#define LV2_PORT_GROUPS__sideChainOf LV2_PORT_GROUPS_PREFIX "sideChainOf" | |||||
#define LV2_PORT_GROUPS__sideLeft LV2_PORT_GROUPS_PREFIX "sideLeft" | |||||
#define LV2_PORT_GROUPS__sideRight LV2_PORT_GROUPS_PREFIX "sideRight" | |||||
#define LV2_PORT_GROUPS__source LV2_PORT_GROUPS_PREFIX "source" | |||||
#define LV2_PORT_GROUPS__subGroupOf LV2_PORT_GROUPS_PREFIX "subGroupOf" | |||||
#define LV2_PORT_GROUPS__DiscreteGroup LV2_PORT_GROUPS_PREFIX "DiscreteGroup" ///< http://lv2plug.in/ns/ext/port-groups#DiscreteGroup | |||||
#define LV2_PORT_GROUPS__Element LV2_PORT_GROUPS_PREFIX "Element" ///< http://lv2plug.in/ns/ext/port-groups#Element | |||||
#define LV2_PORT_GROUPS__FivePointOneGroup LV2_PORT_GROUPS_PREFIX "FivePointOneGroup" ///< http://lv2plug.in/ns/ext/port-groups#FivePointOneGroup | |||||
#define LV2_PORT_GROUPS__FivePointZeroGroup LV2_PORT_GROUPS_PREFIX "FivePointZeroGroup" ///< http://lv2plug.in/ns/ext/port-groups#FivePointZeroGroup | |||||
#define LV2_PORT_GROUPS__FourPointZeroGroup LV2_PORT_GROUPS_PREFIX "FourPointZeroGroup" ///< http://lv2plug.in/ns/ext/port-groups#FourPointZeroGroup | |||||
#define LV2_PORT_GROUPS__Group LV2_PORT_GROUPS_PREFIX "Group" ///< http://lv2plug.in/ns/ext/port-groups#Group | |||||
#define LV2_PORT_GROUPS__InputGroup LV2_PORT_GROUPS_PREFIX "InputGroup" ///< http://lv2plug.in/ns/ext/port-groups#InputGroup | |||||
#define LV2_PORT_GROUPS__MidSideGroup LV2_PORT_GROUPS_PREFIX "MidSideGroup" ///< http://lv2plug.in/ns/ext/port-groups#MidSideGroup | |||||
#define LV2_PORT_GROUPS__MonoGroup LV2_PORT_GROUPS_PREFIX "MonoGroup" ///< http://lv2plug.in/ns/ext/port-groups#MonoGroup | |||||
#define LV2_PORT_GROUPS__OutputGroup LV2_PORT_GROUPS_PREFIX "OutputGroup" ///< http://lv2plug.in/ns/ext/port-groups#OutputGroup | |||||
#define LV2_PORT_GROUPS__SevenPointOneGroup LV2_PORT_GROUPS_PREFIX "SevenPointOneGroup" ///< http://lv2plug.in/ns/ext/port-groups#SevenPointOneGroup | |||||
#define LV2_PORT_GROUPS__SevenPointOneWideGroup LV2_PORT_GROUPS_PREFIX "SevenPointOneWideGroup" ///< http://lv2plug.in/ns/ext/port-groups#SevenPointOneWideGroup | |||||
#define LV2_PORT_GROUPS__SixPointOneGroup LV2_PORT_GROUPS_PREFIX "SixPointOneGroup" ///< http://lv2plug.in/ns/ext/port-groups#SixPointOneGroup | |||||
#define LV2_PORT_GROUPS__StereoGroup LV2_PORT_GROUPS_PREFIX "StereoGroup" ///< http://lv2plug.in/ns/ext/port-groups#StereoGroup | |||||
#define LV2_PORT_GROUPS__ThreePointZeroGroup LV2_PORT_GROUPS_PREFIX "ThreePointZeroGroup" ///< http://lv2plug.in/ns/ext/port-groups#ThreePointZeroGroup | |||||
#define LV2_PORT_GROUPS__center LV2_PORT_GROUPS_PREFIX "center" ///< http://lv2plug.in/ns/ext/port-groups#center | |||||
#define LV2_PORT_GROUPS__centerLeft LV2_PORT_GROUPS_PREFIX "centerLeft" ///< http://lv2plug.in/ns/ext/port-groups#centerLeft | |||||
#define LV2_PORT_GROUPS__centerRight LV2_PORT_GROUPS_PREFIX "centerRight" ///< http://lv2plug.in/ns/ext/port-groups#centerRight | |||||
#define LV2_PORT_GROUPS__element LV2_PORT_GROUPS_PREFIX "element" ///< http://lv2plug.in/ns/ext/port-groups#element | |||||
#define LV2_PORT_GROUPS__group LV2_PORT_GROUPS_PREFIX "group" ///< http://lv2plug.in/ns/ext/port-groups#group | |||||
#define LV2_PORT_GROUPS__left LV2_PORT_GROUPS_PREFIX "left" ///< http://lv2plug.in/ns/ext/port-groups#left | |||||
#define LV2_PORT_GROUPS__lowFrequencyEffects LV2_PORT_GROUPS_PREFIX "lowFrequencyEffects" ///< http://lv2plug.in/ns/ext/port-groups#lowFrequencyEffects | |||||
#define LV2_PORT_GROUPS__mainInput LV2_PORT_GROUPS_PREFIX "mainInput" ///< http://lv2plug.in/ns/ext/port-groups#mainInput | |||||
#define LV2_PORT_GROUPS__mainOutput LV2_PORT_GROUPS_PREFIX "mainOutput" ///< http://lv2plug.in/ns/ext/port-groups#mainOutput | |||||
#define LV2_PORT_GROUPS__rearCenter LV2_PORT_GROUPS_PREFIX "rearCenter" ///< http://lv2plug.in/ns/ext/port-groups#rearCenter | |||||
#define LV2_PORT_GROUPS__rearLeft LV2_PORT_GROUPS_PREFIX "rearLeft" ///< http://lv2plug.in/ns/ext/port-groups#rearLeft | |||||
#define LV2_PORT_GROUPS__rearRight LV2_PORT_GROUPS_PREFIX "rearRight" ///< http://lv2plug.in/ns/ext/port-groups#rearRight | |||||
#define LV2_PORT_GROUPS__right LV2_PORT_GROUPS_PREFIX "right" ///< http://lv2plug.in/ns/ext/port-groups#right | |||||
#define LV2_PORT_GROUPS__side LV2_PORT_GROUPS_PREFIX "side" ///< http://lv2plug.in/ns/ext/port-groups#side | |||||
#define LV2_PORT_GROUPS__sideChainOf LV2_PORT_GROUPS_PREFIX "sideChainOf" ///< http://lv2plug.in/ns/ext/port-groups#sideChainOf | |||||
#define LV2_PORT_GROUPS__sideLeft LV2_PORT_GROUPS_PREFIX "sideLeft" ///< http://lv2plug.in/ns/ext/port-groups#sideLeft | |||||
#define LV2_PORT_GROUPS__sideRight LV2_PORT_GROUPS_PREFIX "sideRight" ///< http://lv2plug.in/ns/ext/port-groups#sideRight | |||||
#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 */ | #endif /* LV2_PORT_GROUPS_H */ | ||||
/** | |||||
@} | |||||
*/ |
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
Copyright 2012 David Robillard <http://drobilla.net> | |||||
Copyright 2012-2016 David Robillard <http://drobilla.net> | |||||
Permission to use, copy, modify, and/or distribute this software for any | Permission to use, copy, modify, and/or distribute this software for any | ||||
purpose with or without fee is hereby granted, provided that the above | purpose with or without fee is hereby granted, provided that the above | ||||
@@ -15,28 +15,34 @@ | |||||
*/ | */ | ||||
/** | /** | ||||
@file port-props.h | |||||
C definitions for the LV2 Port Props extension | |||||
<http://lv2plug.in/ns/ext/port-props>. | |||||
@defgroup port-props Port Properties | |||||
Various port properties. | |||||
@{ | |||||
*/ | */ | ||||
#ifndef LV2_PORT_PROPS_H | #ifndef LV2_PORT_PROPS_H | ||||
#define LV2_PORT_PROPS_H | #define LV2_PORT_PROPS_H | ||||
#define LV2_PORT_PROPS_URI "http://lv2plug.in/ns/ext/port-props" | |||||
#define LV2_PORT_PROPS_PREFIX LV2_PORT_PROPS_URI "#" | |||||
#define LV2_PORT_PROPS__causesArtifacts LV2_PORT_PROPS_PREFIX "causesArtifacts" | |||||
#define LV2_PORT_PROPS__continuousCV LV2_PORT_PROPS_PREFIX "continuousCV" | |||||
#define LV2_PORT_PROPS__discreteCV LV2_PORT_PROPS_PREFIX "discreteCV" | |||||
#define LV2_PORT_PROPS__displayPriority LV2_PORT_PROPS_PREFIX "displayPriority" | |||||
#define LV2_PORT_PROPS__expensive LV2_PORT_PROPS_PREFIX "expensive" | |||||
#define LV2_PORT_PROPS__hasStrictBounds LV2_PORT_PROPS_PREFIX "hasStrictBounds" | |||||
#define LV2_PORT_PROPS__logarithmic LV2_PORT_PROPS_PREFIX "logarithmic" | |||||
#define LV2_PORT_PROPS__notAutomatic LV2_PORT_PROPS_PREFIX "notAutomatic" | |||||
#define LV2_PORT_PROPS__notOnGUI LV2_PORT_PROPS_PREFIX "notOnGUI" | |||||
#define LV2_PORT_PROPS__rangeSteps LV2_PORT_PROPS_PREFIX "rangeSteps" | |||||
#define LV2_PORT_PROPS__supportsStrictBounds LV2_PORT_PROPS_PREFIX "supportsStrictBounds" | |||||
#define LV2_PORT_PROPS__trigger LV2_PORT_PROPS_PREFIX "trigger" | |||||
#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# | |||||
#define LV2_PORT_PROPS__causesArtifacts LV2_PORT_PROPS_PREFIX "causesArtifacts" ///< http://lv2plug.in/ns/ext/port-props#causesArtifacts | |||||
#define LV2_PORT_PROPS__continuousCV LV2_PORT_PROPS_PREFIX "continuousCV" ///< http://lv2plug.in/ns/ext/port-props#continuousCV | |||||
#define LV2_PORT_PROPS__discreteCV LV2_PORT_PROPS_PREFIX "discreteCV" ///< http://lv2plug.in/ns/ext/port-props#discreteCV | |||||
#define LV2_PORT_PROPS__displayPriority LV2_PORT_PROPS_PREFIX "displayPriority" ///< http://lv2plug.in/ns/ext/port-props#displayPriority | |||||
#define LV2_PORT_PROPS__expensive LV2_PORT_PROPS_PREFIX "expensive" ///< http://lv2plug.in/ns/ext/port-props#expensive | |||||
#define LV2_PORT_PROPS__hasStrictBounds LV2_PORT_PROPS_PREFIX "hasStrictBounds" ///< http://lv2plug.in/ns/ext/port-props#hasStrictBounds | |||||
#define LV2_PORT_PROPS__logarithmic LV2_PORT_PROPS_PREFIX "logarithmic" ///< http://lv2plug.in/ns/ext/port-props#logarithmic | |||||
#define LV2_PORT_PROPS__notAutomatic LV2_PORT_PROPS_PREFIX "notAutomatic" ///< http://lv2plug.in/ns/ext/port-props#notAutomatic | |||||
#define LV2_PORT_PROPS__notOnGUI LV2_PORT_PROPS_PREFIX "notOnGUI" ///< http://lv2plug.in/ns/ext/port-props#notOnGUI | |||||
#define LV2_PORT_PROPS__rangeSteps LV2_PORT_PROPS_PREFIX "rangeSteps" ///< http://lv2plug.in/ns/ext/port-props#rangeSteps | |||||
#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 */ | #endif /* LV2_PORT_PROPS_H */ | ||||
/** | |||||
@} | |||||
*/ |
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
Copyright 2012 David Robillard <http://drobilla.net> | |||||
Copyright 2012-2016 David Robillard <http://drobilla.net> | |||||
Permission to use, copy, modify, and/or distribute this software for any | Permission to use, copy, modify, and/or distribute this software for any | ||||
purpose with or without fee is hereby granted, provided that the above | purpose with or without fee is hereby granted, provided that the above | ||||
@@ -15,20 +15,27 @@ | |||||
*/ | */ | ||||
/** | /** | ||||
@file presets.h | |||||
@defgroup presets Presets | |||||
C definitions for the LV2 Presets extension | |||||
<http://lv2plug.in/ns/ext/presets>. | |||||
Presets for plugins, see <http://lv2plug.in/ns/ext/presets> for details. | |||||
@{ | |||||
*/ | */ | ||||
#ifndef LV2_PRESETS_H | #ifndef LV2_PRESETS_H | ||||
#define LV2_PRESETS_H | #define LV2_PRESETS_H | ||||
#define LV2_PRESETS_URI "http://lv2plug.in/ns/ext/presets" | |||||
#define LV2_PRESETS_PREFIX LV2_PRESETS_URI "#" | |||||
#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# | |||||
#define LV2_PRESETS__Preset LV2_PRESETS_PREFIX "Preset" | |||||
#define LV2_PRESETS__preset LV2_PRESETS_PREFIX "preset" | |||||
#define LV2_PRESETS__value LV2_PRESETS_PREFIX "value" | |||||
#define LV2_PRESETS__Bank LV2_PRESETS_PREFIX "Bank" ///< http://lv2plug.in/ns/ext/presets#Bank | |||||
#define LV2_PRESETS__Preset LV2_PRESETS_PREFIX "Preset" ///< http://lv2plug.in/ns/ext/presets#Preset | |||||
#define LV2_PRESETS__bank LV2_PRESETS_PREFIX "bank" ///< http://lv2plug.in/ns/ext/presets#bank | |||||
#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 */ | #endif /* LV2_PRESETS_H */ | ||||
/** | |||||
@} | |||||
*/ |
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
Copyright 2007-2012 David Robillard <http://drobilla.net> | |||||
Copyright 2007-2016 David Robillard <http://drobilla.net> | |||||
Permission to use, copy, modify, and/or distribute this software for any | Permission to use, copy, modify, and/or distribute this software for any | ||||
purpose with or without fee is hereby granted, provided that the above | purpose with or without fee is hereby granted, provided that the above | ||||
@@ -14,18 +14,26 @@ | |||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||||
*/ | */ | ||||
/** | |||||
@defgroup resize-port Resize Port | |||||
Dynamically sized LV2 port buffers. | |||||
@{ | |||||
*/ | |||||
#ifndef LV2_RESIZE_PORT_H | #ifndef LV2_RESIZE_PORT_H | ||||
#define LV2_RESIZE_PORT_H | #define LV2_RESIZE_PORT_H | ||||
#include <stddef.h> | #include <stddef.h> | ||||
#include <stdint.h> | #include <stdint.h> | ||||
#define LV2_RESIZE_PORT_URI "http://lv2plug.in/ns/ext/resize-port" | |||||
#define LV2_RESIZE_PORT_PREFIX LV2_RESIZE_PORT_URI "#" | |||||
#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# | |||||
#define LV2_RESIZE_PORT__asLargeAs LV2_RESIZE_PORT_PREFIX "asLargeAs" | |||||
#define LV2_RESIZE_PORT__minimumSize LV2_RESIZE_PORT_PREFIX "minimumSize" | |||||
#define LV2_RESIZE_PORT__resize LV2_RESIZE_PORT_PREFIX "resize" | |||||
#define LV2_RESIZE_PORT__asLargeAs LV2_RESIZE_PORT_PREFIX "asLargeAs" ///< http://lv2plug.in/ns/ext/port#asLargeAs | |||||
#define LV2_RESIZE_PORT__minimumSize LV2_RESIZE_PORT_PREFIX "minimumSize" ///< http://lv2plug.in/ns/ext/port#minimumSize | |||||
#define LV2_RESIZE_PORT__resize LV2_RESIZE_PORT_PREFIX "resize" ///< http://lv2plug.in/ns/ext/port#resize | |||||
#ifdef __cplusplus | #ifdef __cplusplus | ||||
extern "C" { | extern "C" { | ||||
@@ -40,22 +48,25 @@ typedef enum { | |||||
LV2_RESIZE_PORT_ERR_NO_SPACE = 2 /**< Insufficient space. */ | LV2_RESIZE_PORT_ERR_NO_SPACE = 2 /**< Insufficient space. */ | ||||
} LV2_Resize_Port_Status; | } LV2_Resize_Port_Status; | ||||
/** Opaque data for resize method. */ | |||||
typedef void* LV2_Resize_Port_Feature_Data; | typedef void* LV2_Resize_Port_Feature_Data; | ||||
/** Host feature to allow plugins to resize their port buffers. */ | |||||
typedef struct { | typedef struct { | ||||
/** Opaque data for resize method. */ | |||||
LV2_Resize_Port_Feature_Data data; | LV2_Resize_Port_Feature_Data data; | ||||
/** | /** | ||||
Resize a port buffer to at least @a size bytes. | |||||
Resize a port buffer to at least `size` bytes. | |||||
This function MAY return an error, in which case the port buffer was not | This function MAY return an error, in which case the port buffer was not | ||||
resized and the port is still connected to the same location. Plugins | resized and the port is still connected to the same location. Plugins | ||||
MUST gracefully handle this situation. | MUST gracefully handle this situation. | ||||
This function is in the audio threading class. | This function is in the audio threading class. | ||||
The host MUST preserve the contents of the port buffer when resizing. | The host MUST preserve the contents of the port buffer when resizing. | ||||
Plugins MAY resize a port many times in a single run callback. Hosts | Plugins MAY resize a port many times in a single run callback. Hosts | ||||
SHOULD make this as inexpensive as possible. | SHOULD make this as inexpensive as possible. | ||||
*/ | */ | ||||
@@ -70,3 +81,6 @@ typedef struct { | |||||
#endif /* LV2_RESIZE_PORT_H */ | #endif /* LV2_RESIZE_PORT_H */ | ||||
/** | |||||
@} | |||||
*/ |
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
Copyright 2010-2012 David Robillard <http://drobilla.net> | |||||
Copyright 2010-2016 David Robillard <http://drobilla.net> | |||||
Copyright 2010 Leonard Ritter <paniq@paniq.org> | Copyright 2010 Leonard Ritter <paniq@paniq.org> | ||||
Permission to use, copy, modify, and/or distribute this software for any | Permission to use, copy, modify, and/or distribute this software for any | ||||
@@ -16,37 +16,45 @@ | |||||
*/ | */ | ||||
/** | /** | ||||
@file state.h | |||||
C API for the LV2 State extension <http://lv2plug.in/ns/ext/state>. | |||||
@defgroup state State | |||||
@ingroup lv2 | |||||
An interface for LV2 plugins to save and restore state, see | |||||
<http://lv2plug.in/ns/ext/state> for details. | |||||
@{ | |||||
*/ | */ | ||||
#ifndef LV2_STATE_H | #ifndef LV2_STATE_H | ||||
#define LV2_STATE_H | #define LV2_STATE_H | ||||
#include "lv2.h" | |||||
#include <stdbool.h> | |||||
#include <stddef.h> | #include <stddef.h> | ||||
#include <stdint.h> | #include <stdint.h> | ||||
#include "lv2.h" | |||||
#define LV2_STATE_URI "http://lv2plug.in/ns/ext/state" | |||||
#define LV2_STATE_PREFIX LV2_STATE_URI "#" | |||||
#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# | |||||
#define LV2_STATE__State LV2_STATE_PREFIX "State" | |||||
#define LV2_STATE__interface LV2_STATE_PREFIX "interface" | |||||
#define LV2_STATE__loadDefaultState LV2_STATE_PREFIX "loadDefaultState" | |||||
#define LV2_STATE__makePath LV2_STATE_PREFIX "makePath" | |||||
#define LV2_STATE__mapPath LV2_STATE_PREFIX "mapPath" | |||||
#define LV2_STATE__state LV2_STATE_PREFIX "state" | |||||
#define LV2_STATE__State LV2_STATE_PREFIX "State" ///< http://lv2plug.in/ns/ext/state#State | |||||
#define LV2_STATE__interface LV2_STATE_PREFIX "interface" ///< http://lv2plug.in/ns/ext/state#interface | |||||
#define LV2_STATE__loadDefaultState LV2_STATE_PREFIX "loadDefaultState" ///< http://lv2plug.in/ns/ext/state#loadDefaultState | |||||
#define LV2_STATE__freePath LV2_STATE_PREFIX "freePath" ///< http://lv2plug.in/ns/ext/state#freePath | |||||
#define LV2_STATE__makePath LV2_STATE_PREFIX "makePath" ///< http://lv2plug.in/ns/ext/state#makePath | |||||
#define LV2_STATE__mapPath LV2_STATE_PREFIX "mapPath" ///< http://lv2plug.in/ns/ext/state#mapPath | |||||
#define LV2_STATE__state LV2_STATE_PREFIX "state" ///< http://lv2plug.in/ns/ext/state#state | |||||
#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 | |||||
#ifdef __cplusplus | #ifdef __cplusplus | ||||
extern "C" { | extern "C" { | ||||
#else | |||||
# include <stdbool.h> | |||||
#endif | #endif | ||||
typedef void* LV2_State_Handle; | |||||
typedef void* LV2_State_Map_Path_Handle; | |||||
typedef void* LV2_State_Make_Path_Handle; | |||||
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 | |||||
/** | /** | ||||
Flags describing value characteristics. | Flags describing value characteristics. | ||||
@@ -61,8 +69,8 @@ typedef enum { | |||||
Values with this flag contain no pointers or references to other areas | 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 | 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 | 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 trasmit 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 | 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). | they do not understand its type (and thus know how to correctly do so). | ||||
@@ -84,9 +92,9 @@ typedef enum { | |||||
Native data. | Native data. | ||||
This flag is used by the host to indicate that the saved data is only | 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. | and portability. | ||||
*/ | */ | ||||
LV2_STATE_IS_NATIVE = 1 << 2 | LV2_STATE_IS_NATIVE = 1 << 2 | ||||
@@ -106,11 +114,11 @@ typedef enum { | |||||
/** | /** | ||||
A host-provided function to store a property. | A host-provided function to store a property. | ||||
@param handle Must be the handle passed to LV2_State_Interface.save(). | @param handle Must be the handle passed to LV2_State_Interface.save(). | ||||
@param key The key to store @p value under (URID). | |||||
@param key The key to store `value` under (URID). | |||||
@param value Pointer to the value to be stored. | @param value Pointer to the value to be stored. | ||||
@param size The size of @p value in bytes. | |||||
@param type The type of @p value (URID). | |||||
@param flags LV2_State_Flags for @p value. | |||||
@param size The size of `value` in bytes. | |||||
@param type The type of `value` (URID). | |||||
@param flags LV2_State_Flags for `value`. | |||||
@return 0 on success, otherwise a non-zero error code. | @return 0 on success, otherwise a non-zero error code. | ||||
The host passes a callback of this type to LV2_State_Interface.save(). This | The host passes a callback of this type to LV2_State_Interface.save(). This | ||||
@@ -120,7 +128,7 @@ typedef enum { | |||||
DO NOT INVENT NONSENSE URI SCHEMES FOR THE KEY. Best is to use keys from | 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 | existing vocabularies. If nothing appropriate is available, use http URIs | ||||
that point to somewhere you can host documents so documentation can be made | 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 | possible, invent a URN scheme, e.g. urn:myproj:whatever. The plugin MUST | ||||
NOT pass an invalid URI key. | NOT pass an invalid URI key. | ||||
@@ -130,8 +138,8 @@ typedef enum { | |||||
(http://lv2plug.in/ns/ext/atom) wherever possible. The plugin SHOULD | (http://lv2plug.in/ns/ext/atom) wherever possible. The plugin SHOULD | ||||
attempt to fall-back and avoid the error if possible. | attempt to fall-back and avoid the error if possible. | ||||
Note that @p size MUST be > 0, and @p value MUST point to a valid region of | |||||
memory @p size bytes long (this is required to make restore unambiguous). | |||||
Note that `size` MUST be > 0, and `value` MUST point to a valid region of | |||||
memory `size` bytes long (this is required to make restore unambiguous). | |||||
The plugin MUST NOT attempt to use this function outside of the | The plugin MUST NOT attempt to use this function outside of the | ||||
LV2_State_Interface.restore() context. | LV2_State_Interface.restore() context. | ||||
@@ -152,7 +160,7 @@ typedef LV2_State_Status (*LV2_State_Store_Function)( | |||||
@param type (Output) If non-NULL, set to the type of the restored value. | @param type (Output) If non-NULL, set to the type of the restored value. | ||||
@param flags (Output) If non-NULL, set to the flags for the restored value. | @param flags (Output) If non-NULL, set to the flags for the restored value. | ||||
@return A pointer to the restored value (object), or NULL if no value | @return A pointer to the restored value (object), or NULL if no value | ||||
has been stored under @p key. | |||||
has been stored under `key`. | |||||
A callback of this type is passed by the host to | A callback of this type is passed by the host to | ||||
LV2_State_Interface.restore(). This callback is called repeatedly by the | LV2_State_Interface.restore(). This callback is called repeatedly by the | ||||
@@ -187,14 +195,14 @@ typedef const void* (*LV2_State_Retrieve_Function)( | |||||
authors should consider this possibility, and always store sensible data | authors should consider this possibility, and always store sensible data | ||||
with meaningful types to avoid such problems in the future. | with meaningful types to avoid such problems in the future. | ||||
*/ | */ | ||||
typedef struct _LV2_State_Interface { | |||||
typedef struct { | |||||
/** | /** | ||||
Save plugin state using a host-provided @p store callback. | |||||
Save plugin state using a host-provided `store` callback. | |||||
@param instance The instance handle of the plugin. | @param instance The instance handle of the plugin. | ||||
@param store The host-provided store callback. | @param store The host-provided store callback. | ||||
@param handle An opaque pointer to host data which MUST be passed as the | @param handle An opaque pointer to host data which MUST be passed as the | ||||
handle parameter to @p store if it is called. | |||||
handle parameter to `store` if it is called. | |||||
@param flags Flags describing desired properties of this save. These | @param flags Flags describing desired properties of this save. These | ||||
flags may be used to determine the most appropriate values to store. | flags may be used to determine the most appropriate values to store. | ||||
@param features Extensible parameter for passing any additional | @param features Extensible parameter for passing any additional | ||||
@@ -205,16 +213,16 @@ typedef struct _LV2_State_Interface { | |||||
possible, and consider the possibility of state being restored much | possible, and consider the possibility of state being restored much | ||||
later on a different machine. | later on a different machine. | ||||
The @p handle pointer and @p store function MUST NOT be used | |||||
The `handle` pointer and `store` function MUST NOT be used | |||||
beyond the scope of save(). | beyond the scope of save(). | ||||
This function has its own special threading class: it may not be called | 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 any "Instantiation" function, but it may be called | ||||
concurrently with functions in any other class, unless the definition of | 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(), | Note that in the simple case where state is only modified by restore(), | ||||
there are no synchronization issues since save() is never called | there are no synchronization issues since save() is never called | ||||
@@ -231,12 +239,12 @@ typedef struct _LV2_State_Interface { | |||||
const LV2_Feature *const * features); | const LV2_Feature *const * features); | ||||
/** | /** | ||||
Restore plugin state using a host-provided @p retrieve callback. | |||||
Restore plugin state using a host-provided `retrieve` callback. | |||||
@param instance The instance handle of the plugin. | @param instance The instance handle of the plugin. | ||||
@param retrieve The host-provided retrieve callback. | @param retrieve The host-provided retrieve callback. | ||||
@param handle An opaque pointer to host data which MUST be passed as the | @param handle An opaque pointer to host data which MUST be passed as the | ||||
handle parameter to @p retrieve if it is called. | |||||
handle parameter to `retrieve` if it is called. | |||||
@param flags Currently unused. | @param flags Currently unused. | ||||
@param features Extensible parameter for passing any additional | @param features Extensible parameter for passing any additional | ||||
features to be used for this restore. | features to be used for this restore. | ||||
@@ -248,7 +256,7 @@ typedef struct _LV2_State_Interface { | |||||
not be retrieved. This allows the host to reset the plugin state with | not be retrieved. This allows the host to reset the plugin state with | ||||
an empty map. | an empty map. | ||||
The @p handle pointer and @p store function MUST NOT be used | |||||
The `handle` pointer and `store` function MUST NOT be used | |||||
beyond the scope of restore(). | beyond the scope of restore(). | ||||
This function is in the "Instantiation" threading class as defined by | This function is in the "Instantiation" threading class as defined by | ||||
@@ -263,7 +271,7 @@ typedef struct _LV2_State_Interface { | |||||
} LV2_State_Interface; | } LV2_State_Interface; | ||||
/** | /** | ||||
Feature data for state:mapPath (LV2_STATE__mapPath). | |||||
Feature data for state:mapPath (@ref LV2_STATE__mapPath). | |||||
*/ | */ | ||||
typedef struct { | typedef struct { | ||||
/** | /** | ||||
@@ -273,38 +281,38 @@ typedef struct { | |||||
/** | /** | ||||
Map an absolute path to an abstract path for use in plugin state. | Map an absolute path to an abstract path for use in plugin state. | ||||
@param handle MUST be the @p handle member of this struct. | |||||
@param handle MUST be the `handle` member of this struct. | |||||
@param absolute_path The absolute path of a file. | @param absolute_path The absolute path of a file. | ||||
@return An abstract path suitable for use in plugin state. | @return An abstract path suitable for use in plugin state. | ||||
The plugin MUST use this function to map any paths that will be stored | The plugin MUST use this function to map any paths that will be stored | ||||
in plugin state. The returned value is an abstract path which MAY not | in plugin state. The returned value is an abstract path which MAY not | ||||
be an actual file system path; @ref absolute_path() MUST be used to map | |||||
be an actual file system path; absolute_path() MUST be used to map | |||||
it to an actual path in order to use the file. | it to an actual path in order to use the file. | ||||
Plugins MUST NOT make any assumptions about abstract paths except that | Plugins MUST NOT make any assumptions about abstract paths except that | ||||
they can be mapped back to the absolute path of the "same" file (though | they can be mapped back to the absolute path of the "same" file (though | ||||
not necessarily the same original path) using @ref absolute_path(). | |||||
not necessarily the same original path) using absolute_path(). | |||||
This function may only be called within the context of | This function may only be called within the context of | ||||
LV2_State_Interface methods. The caller is responsible for freeing the | |||||
returned value with free(). | |||||
LV2_State_Interface methods. The caller must free the returned value | |||||
with LV2_State_Free_Path.free_path(). | |||||
*/ | */ | ||||
char* (*abstract_path)(LV2_State_Map_Path_Handle handle, | char* (*abstract_path)(LV2_State_Map_Path_Handle handle, | ||||
const char* absolute_path); | const char* absolute_path); | ||||
/** | /** | ||||
Map an abstract path from plugin state to an absolute path. | Map an abstract path from plugin state to an absolute path. | ||||
@param handle MUST be the @p handle member of this struct. | |||||
@param abstract_path An abstract path (e.g. a path from plugin state). | |||||
@param handle MUST be the `handle` member of this struct. | |||||
@param abstract_path An abstract path (typically from plugin state). | |||||
@return An absolute file system path. | @return An absolute file system path. | ||||
The plugin MUST use this function in order to actually open or otherwise | The plugin MUST use this function in order to actually open or otherwise | ||||
use any paths loaded from plugin state. | use any paths loaded from plugin state. | ||||
This function may only be called within the context of | This function may only be called within the context of | ||||
LV2_State_Interface methods. The caller is responsible for freeing the | |||||
returned value with free(). | |||||
LV2_State_Interface methods. The caller must free the returned value | |||||
with LV2_State_Free_Path.free_path(). | |||||
*/ | */ | ||||
char* (*absolute_path)(LV2_State_Map_Path_Handle handle, | char* (*absolute_path)(LV2_State_Map_Path_Handle handle, | ||||
const char* abstract_path); | const char* abstract_path); | ||||
@@ -321,7 +329,7 @@ typedef struct { | |||||
/** | /** | ||||
Return a path the plugin may use to create a new file. | Return a path the plugin may use to create a new file. | ||||
@param handle MUST be the @p handle member of this struct. | |||||
@param handle MUST be the `handle` member of this struct. | |||||
@param path The path of the new file within a namespace unique to this | @param path The path of the new file within a namespace unique to this | ||||
plugin instance. | plugin instance. | ||||
@return The absolute path to use for the new file. | @return The absolute path to use for the new file. | ||||
@@ -332,22 +340,50 @@ typedef struct { | |||||
LV2_Descriptor.instantiate()). | LV2_Descriptor.instantiate()). | ||||
The host MUST do whatever is necessary for the plugin to be able to | 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 | If this function is passed to LV2_Descriptor.instantiate(), it may be | ||||
called from any non-realtime context. If it is passed to | called from any non-realtime context. If it is passed to | ||||
LV2_State_Interface.save(), it may only be called within the dynamic | LV2_State_Interface.save(), it may only be called within the dynamic | ||||
scope of that function call. | scope of that function call. | ||||
The caller is responsible for freeing the returned value with free(). | |||||
The caller must free the returned value with | |||||
LV2_State_Free_Path.free_path(). | |||||
*/ | */ | ||||
char* (*path)(LV2_State_Make_Path_Handle handle, | char* (*path)(LV2_State_Make_Path_Handle handle, | ||||
const char* path); | const char* path); | ||||
} LV2_State_Make_Path; | } LV2_State_Make_Path; | ||||
/** | |||||
Feature data for state:freePath (@ref LV2_STATE__freePath). | |||||
*/ | |||||
typedef struct { | |||||
/** | |||||
Opaque host data. | |||||
*/ | |||||
LV2_State_Free_Path_Handle handle; | |||||
/** | |||||
Free a path returned by a state feature. | |||||
@param handle MUST be the `handle` member of this struct. | |||||
@param path The path previously returned by a state feature. | |||||
This function can be used by plugins to free paths allocated by the host | |||||
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); | |||||
} LV2_State_Free_Path; | |||||
#ifdef __cplusplus | #ifdef __cplusplus | ||||
} /* extern "C" */ | } /* extern "C" */ | ||||
#endif | #endif | ||||
#endif /* LV2_STATE_H */ | #endif /* LV2_STATE_H */ | ||||
/** | |||||
@} | |||||
*/ |
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
Copyright 2011 David Robillard <http://drobilla.net> | |||||
Copyright 2011-2016 David Robillard <http://drobilla.net> | |||||
Permission to use, copy, modify, and/or distribute this software for any | Permission to use, copy, modify, and/or distribute this software for any | ||||
purpose with or without fee is hereby granted, provided that the above | purpose with or without fee is hereby granted, provided that the above | ||||
@@ -15,35 +15,39 @@ | |||||
*/ | */ | ||||
/** | /** | ||||
@file time.h C header for the LV2 Time extension | |||||
<http://lv2plug.in/ns/ext/time>. | |||||
@defgroup time Time | |||||
Properties for describing time, see <http://lv2plug.in/ns/ext/time> for | |||||
details. | |||||
Note the time extension is purely data, this header merely defines URIs for | |||||
convenience. | |||||
@{ | |||||
*/ | */ | ||||
#ifndef LV2_TIME_H | #ifndef LV2_TIME_H | ||||
#define LV2_TIME_H | #define LV2_TIME_H | ||||
#ifdef __cplusplus | |||||
extern "C" { | |||||
#endif | |||||
#define LV2_TIME_URI "http://lv2plug.in/ns/ext/time" | |||||
#define LV2_TIME__Time LV2_TIME_URI "#Time" | |||||
#define LV2_TIME__Position LV2_TIME_URI "#Position" | |||||
#define LV2_TIME__Rate LV2_TIME_URI "#Rate" | |||||
#define LV2_TIME__position LV2_TIME_URI "#position" | |||||
#define LV2_TIME__barBeat LV2_TIME_URI "#barBeat" | |||||
#define LV2_TIME__bar LV2_TIME_URI "#bar" | |||||
#define LV2_TIME__beat LV2_TIME_URI "#beat" | |||||
#define LV2_TIME__beatUnit LV2_TIME_URI "#beatUnit" | |||||
#define LV2_TIME__beatsPerBar LV2_TIME_URI "#beatsPerBar" | |||||
#define LV2_TIME__beatsPerMinute LV2_TIME_URI "#beatsPerMinute" | |||||
#define LV2_TIME__frame LV2_TIME_URI "#frame" | |||||
#define LV2_TIME__framesPerSecond LV2_TIME_URI "#framesPerSecond" | |||||
#define LV2_TIME__speed LV2_TIME_URI "#speed" | |||||
#ifdef __cplusplus | |||||
} /* extern "C" */ | |||||
#endif | |||||
#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# | |||||
#define LV2_TIME__Time LV2_TIME_PREFIX "Time" ///< http://lv2plug.in/ns/ext/time#Time | |||||
#define LV2_TIME__Position LV2_TIME_PREFIX "Position" ///< http://lv2plug.in/ns/ext/time#Position | |||||
#define LV2_TIME__Rate LV2_TIME_PREFIX "Rate" ///< http://lv2plug.in/ns/ext/time#Rate | |||||
#define LV2_TIME__position LV2_TIME_PREFIX "position" ///< http://lv2plug.in/ns/ext/time#position | |||||
#define LV2_TIME__barBeat LV2_TIME_PREFIX "barBeat" ///< http://lv2plug.in/ns/ext/time#barBeat | |||||
#define LV2_TIME__bar LV2_TIME_PREFIX "bar" ///< http://lv2plug.in/ns/ext/time#bar | |||||
#define LV2_TIME__beat LV2_TIME_PREFIX "beat" ///< http://lv2plug.in/ns/ext/time#beat | |||||
#define LV2_TIME__beatUnit LV2_TIME_PREFIX "beatUnit" ///< http://lv2plug.in/ns/ext/time#beatUnit | |||||
#define LV2_TIME__beatsPerBar LV2_TIME_PREFIX "beatsPerBar" ///< http://lv2plug.in/ns/ext/time#beatsPerBar | |||||
#define LV2_TIME__beatsPerMinute LV2_TIME_PREFIX "beatsPerMinute" ///< http://lv2plug.in/ns/ext/time#beatsPerMinute | |||||
#define LV2_TIME__frame LV2_TIME_PREFIX "frame" ///< http://lv2plug.in/ns/ext/time#frame | |||||
#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 | |||||
/** | |||||
@} | |||||
*/ | |||||
#endif /* LV2_TIME_H */ | #endif /* LV2_TIME_H */ |
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
Copyright 2012 David Robillard <http://drobilla.net> | |||||
Copyright 2012-2016 David Robillard <http://drobilla.net> | |||||
Permission to use, copy, modify, and/or distribute this software for any | Permission to use, copy, modify, and/or distribute this software for any | ||||
purpose with or without fee is hereby granted, provided that the above | purpose with or without fee is hereby granted, provided that the above | ||||
@@ -15,48 +15,55 @@ | |||||
*/ | */ | ||||
/** | /** | ||||
@file units.h | |||||
C definitions for the LV2 Units extension | |||||
<http://lv2plug.in/ns/extensions/units>. | |||||
@defgroup units Units | |||||
Units for LV2 values, see <http://lv2plug.in/ns/extensions/units> for | |||||
details. | |||||
@{ | |||||
*/ | */ | ||||
#ifndef LV2_UNITS_H | #ifndef LV2_UNITS_H | ||||
#define LV2_UNITS_H | #define LV2_UNITS_H | ||||
#define LV2_UNITS_URI "http://lv2plug.in/ns/extensions/units" | |||||
#define LV2_UNITS_PREFIX LV2_UNITS_URI "#" | |||||
#define LV2_UNITS__Conversion LV2_UNITS_PREFIX "Conversion" | |||||
#define LV2_UNITS__Unit LV2_UNITS_PREFIX "Unit" | |||||
#define LV2_UNITS__bar LV2_UNITS_PREFIX "bar" | |||||
#define LV2_UNITS__beat LV2_UNITS_PREFIX "beat" | |||||
#define LV2_UNITS__bpm LV2_UNITS_PREFIX "bpm" | |||||
#define LV2_UNITS__cent LV2_UNITS_PREFIX "cent" | |||||
#define LV2_UNITS__cm LV2_UNITS_PREFIX "cm" | |||||
#define LV2_UNITS__coef LV2_UNITS_PREFIX "coef" | |||||
#define LV2_UNITS__conversion LV2_UNITS_PREFIX "conversion" | |||||
#define LV2_UNITS__db LV2_UNITS_PREFIX "db" | |||||
#define LV2_UNITS__degree LV2_UNITS_PREFIX "degree" | |||||
#define LV2_UNITS__frame LV2_UNITS_PREFIX "frame" | |||||
#define LV2_UNITS__hz LV2_UNITS_PREFIX "hz" | |||||
#define LV2_UNITS__inch LV2_UNITS_PREFIX "inch" | |||||
#define LV2_UNITS__khz LV2_UNITS_PREFIX "khz" | |||||
#define LV2_UNITS__km LV2_UNITS_PREFIX "km" | |||||
#define LV2_UNITS__m LV2_UNITS_PREFIX "m" | |||||
#define LV2_UNITS__mhz LV2_UNITS_PREFIX "mhz" | |||||
#define LV2_UNITS__midiNote LV2_UNITS_PREFIX "midiNote" | |||||
#define LV2_UNITS__mile LV2_UNITS_PREFIX "mile" | |||||
#define LV2_UNITS__min LV2_UNITS_PREFIX "min" | |||||
#define LV2_UNITS__mm LV2_UNITS_PREFIX "mm" | |||||
#define LV2_UNITS__ms LV2_UNITS_PREFIX "ms" | |||||
#define LV2_UNITS__name LV2_UNITS_PREFIX "name" | |||||
#define LV2_UNITS__oct LV2_UNITS_PREFIX "oct" | |||||
#define LV2_UNITS__pc LV2_UNITS_PREFIX "pc" | |||||
#define LV2_UNITS__prefixConversion LV2_UNITS_PREFIX "prefixConversion" | |||||
#define LV2_UNITS__render LV2_UNITS_PREFIX "render" | |||||
#define LV2_UNITS__s LV2_UNITS_PREFIX "s" | |||||
#define LV2_UNITS__semitone12TET LV2_UNITS_PREFIX "semitone12TET" | |||||
#define LV2_UNITS__symbol LV2_UNITS_PREFIX "symbol" | |||||
#define LV2_UNITS__unit LV2_UNITS_PREFIX "unit" | |||||
#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# | |||||
#define LV2_UNITS__Conversion LV2_UNITS_PREFIX "Conversion" ///< http://lv2plug.in/ns/ext/units#Conversion | |||||
#define LV2_UNITS__Unit LV2_UNITS_PREFIX "Unit" ///< http://lv2plug.in/ns/ext/units#Unit | |||||
#define LV2_UNITS__bar LV2_UNITS_PREFIX "bar" ///< http://lv2plug.in/ns/ext/units#bar | |||||
#define LV2_UNITS__beat LV2_UNITS_PREFIX "beat" ///< http://lv2plug.in/ns/ext/units#beat | |||||
#define LV2_UNITS__bpm LV2_UNITS_PREFIX "bpm" ///< http://lv2plug.in/ns/ext/units#bpm | |||||
#define LV2_UNITS__cent LV2_UNITS_PREFIX "cent" ///< http://lv2plug.in/ns/ext/units#cent | |||||
#define LV2_UNITS__cm LV2_UNITS_PREFIX "cm" ///< http://lv2plug.in/ns/ext/units#cm | |||||
#define LV2_UNITS__coef LV2_UNITS_PREFIX "coef" ///< http://lv2plug.in/ns/ext/units#coef | |||||
#define LV2_UNITS__conversion LV2_UNITS_PREFIX "conversion" ///< http://lv2plug.in/ns/ext/units#conversion | |||||
#define LV2_UNITS__db LV2_UNITS_PREFIX "db" ///< http://lv2plug.in/ns/ext/units#db | |||||
#define LV2_UNITS__degree LV2_UNITS_PREFIX "degree" ///< http://lv2plug.in/ns/ext/units#degree | |||||
#define LV2_UNITS__frame LV2_UNITS_PREFIX "frame" ///< http://lv2plug.in/ns/ext/units#frame | |||||
#define LV2_UNITS__hz LV2_UNITS_PREFIX "hz" ///< http://lv2plug.in/ns/ext/units#hz | |||||
#define LV2_UNITS__inch LV2_UNITS_PREFIX "inch" ///< http://lv2plug.in/ns/ext/units#inch | |||||
#define LV2_UNITS__khz LV2_UNITS_PREFIX "khz" ///< http://lv2plug.in/ns/ext/units#khz | |||||
#define LV2_UNITS__km LV2_UNITS_PREFIX "km" ///< http://lv2plug.in/ns/ext/units#km | |||||
#define LV2_UNITS__m LV2_UNITS_PREFIX "m" ///< http://lv2plug.in/ns/ext/units#m | |||||
#define LV2_UNITS__mhz LV2_UNITS_PREFIX "mhz" ///< http://lv2plug.in/ns/ext/units#mhz | |||||
#define LV2_UNITS__midiNote LV2_UNITS_PREFIX "midiNote" ///< http://lv2plug.in/ns/ext/units#midiNote | |||||
#define LV2_UNITS__mile LV2_UNITS_PREFIX "mile" ///< http://lv2plug.in/ns/ext/units#mile | |||||
#define LV2_UNITS__min LV2_UNITS_PREFIX "min" ///< http://lv2plug.in/ns/ext/units#min | |||||
#define LV2_UNITS__mm LV2_UNITS_PREFIX "mm" ///< http://lv2plug.in/ns/ext/units#mm | |||||
#define LV2_UNITS__ms LV2_UNITS_PREFIX "ms" ///< http://lv2plug.in/ns/ext/units#ms | |||||
#define LV2_UNITS__name LV2_UNITS_PREFIX "name" ///< http://lv2plug.in/ns/ext/units#name | |||||
#define LV2_UNITS__oct LV2_UNITS_PREFIX "oct" ///< http://lv2plug.in/ns/ext/units#oct | |||||
#define LV2_UNITS__pc LV2_UNITS_PREFIX "pc" ///< http://lv2plug.in/ns/ext/units#pc | |||||
#define LV2_UNITS__prefixConversion LV2_UNITS_PREFIX "prefixConversion" ///< http://lv2plug.in/ns/ext/units#prefixConversion | |||||
#define LV2_UNITS__render LV2_UNITS_PREFIX "render" ///< http://lv2plug.in/ns/ext/units#render | |||||
#define LV2_UNITS__s LV2_UNITS_PREFIX "s" ///< http://lv2plug.in/ns/ext/units#s | |||||
#define LV2_UNITS__semitone12TET LV2_UNITS_PREFIX "semitone12TET" ///< http://lv2plug.in/ns/ext/units#semitone12TET | |||||
#define LV2_UNITS__symbol LV2_UNITS_PREFIX "symbol" ///< http://lv2plug.in/ns/ext/units#symbol | |||||
#define LV2_UNITS__unit LV2_UNITS_PREFIX "unit" ///< http://lv2plug.in/ns/ext/units#unit | |||||
#endif /* LV2_UNITS_H */ | #endif /* LV2_UNITS_H */ | ||||
/** | |||||
@} | |||||
*/ |
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
Copyright 2008-2011 David Robillard <http://drobilla.net> | |||||
Copyright 2008-2016 David Robillard <http://drobilla.net> | |||||
Permission to use, copy, modify, and/or distribute this software for any | Permission to use, copy, modify, and/or distribute this software for any | ||||
purpose with or without fee is hereby granted, provided that the above | purpose with or without fee is hereby granted, provided that the above | ||||
@@ -15,8 +15,9 @@ | |||||
*/ | */ | ||||
/** | /** | ||||
@file | |||||
C header for the LV2 URI Map extension <http://lv2plug.in/ns/ext/uri-map>. | |||||
@defgroup uri-map URI Map | |||||
C API for the LV2 URI Map extension <http://lv2plug.in/ns/ext/uri-map>. | |||||
This extension defines a simple mechanism for plugins to map URIs to | This extension defines a simple mechanism for plugins to map URIs to | ||||
integers, usually for performance reasons (e.g. processing events typed by | integers, usually for performance reasons (e.g. processing events typed by | ||||
@@ -25,12 +26,15 @@ | |||||
values for use in the audio thread without doing any string comparison. | values for use in the audio thread without doing any string comparison. | ||||
This allows the extensibility of RDF with the performance of integers (or | This allows the extensibility of RDF with the performance of integers (or | ||||
centrally defined enumerations). | centrally defined enumerations). | ||||
@{ | |||||
*/ | */ | ||||
#ifndef LV2_URI_MAP_H | #ifndef LV2_URI_MAP_H | ||||
#define LV2_URI_MAP_H | #define LV2_URI_MAP_H | ||||
#define LV2_URI_MAP_URI "http://lv2plug.in/ns/ext/uri-map" | |||||
#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# | |||||
#include <stdint.h> | #include <stdint.h> | ||||
@@ -96,3 +100,7 @@ typedef struct { | |||||
#endif | #endif | ||||
#endif /* LV2_URI_MAP_H */ | #endif /* LV2_URI_MAP_H */ | ||||
/** | |||||
@} | |||||
*/ |
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
Copyright 2008-2012 David Robillard <http://drobilla.net> | |||||
Copyright 2008-2016 David Robillard <http://drobilla.net> | |||||
Copyright 2011 Gabriel M. Beddingfield <gabrbedd@gmail.com> | Copyright 2011 Gabriel M. Beddingfield <gabrbedd@gmail.com> | ||||
Permission to use, copy, modify, and/or distribute this software for any | Permission to use, copy, modify, and/or distribute this software for any | ||||
@@ -16,22 +16,25 @@ | |||||
*/ | */ | ||||
/** | /** | ||||
@file urid.h | |||||
C header for the LV2 URID extension <http://lv2plug.in/ns/ext/urid> | |||||
@defgroup urid URID | |||||
Features for mapping URIs to and from integers, see | |||||
<http://lv2plug.in/ns/ext/urid> for details. | |||||
@{ | |||||
*/ | */ | ||||
#ifndef LV2_URID_H | #ifndef LV2_URID_H | ||||
#define LV2_URID_H | #define LV2_URID_H | ||||
#define LV2_URID_URI "http://lv2plug.in/ns/ext/urid" | |||||
#define LV2_URID_PREFIX LV2_URID_URI "#" | |||||
#define LV2_URID_URI "http://lv2plug.in/ns/ext/urid" ///< http://lv2plug.in/ns/ext/urid | |||||
#define LV2_URID_PREFIX LV2_URID_URI "#" ///< http://lv2plug.in/ns/ext/urid# | |||||
#define LV2_URID__map LV2_URID_PREFIX "map" | |||||
#define LV2_URID__unmap LV2_URID_PREFIX "unmap" | |||||
#define LV2_URID__map LV2_URID_PREFIX "map" ///< http://lv2plug.in/ns/ext/urid#map | |||||
#define LV2_URID__unmap LV2_URID_PREFIX "unmap" ///< http://lv2plug.in/ns/ext/urid#unmap | |||||
/* Legacy defines */ | |||||
#define LV2_URID_MAP_URI LV2_URID__map | |||||
#define LV2_URID_UNMAP_URI LV2_URID__unmap | |||||
#define LV2_URID_MAP_URI LV2_URID__map ///< Legacy | |||||
#define LV2_URID_UNMAP_URI LV2_URID__unmap ///< Legacy | |||||
#include <stdint.h> | #include <stdint.h> | ||||
@@ -106,11 +109,11 @@ typedef struct _LV2_URID_Unmap { | |||||
/** | /** | ||||
Get the URI for a previously mapped numeric ID. | Get the URI for a previously mapped numeric ID. | ||||
Returns NULL if @p urid is not yet mapped. Otherwise, the corresponding | |||||
Returns NULL if `urid` is not yet mapped. Otherwise, the corresponding | |||||
URI is returned in a canonical form. This MAY not be the exact same | URI is returned in a canonical form. This MAY not be the exact same | ||||
string that was originally passed to LV2_URID_Map::map(), but it MUST be | string that was originally passed to LV2_URID_Map::map(), but it MUST be | ||||
an identical URI according to the URI syntax specification (RFC3986). A | an identical URI according to the URI syntax specification (RFC3986). A | ||||
non-NULL return for a given @p urid will always be the same for the life | |||||
non-NULL return for a given `urid` will always be the same for the life | |||||
of the plugin. Plugins that intend to perform string comparison on | of the plugin. Plugins that intend to perform string comparison on | ||||
unmapped URIs SHOULD first canonicalise URI strings with a call to | unmapped URIs SHOULD first canonicalise URI strings with a call to | ||||
map_uri() followed by a call to unmap_uri(). | map_uri() followed by a call to unmap_uri(). | ||||
@@ -127,3 +130,7 @@ typedef struct _LV2_URID_Unmap { | |||||
#endif | #endif | ||||
#endif /* LV2_URID_H */ | #endif /* LV2_URID_H */ | ||||
/** | |||||
@} | |||||
*/ |
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
Copyright 2012 David Robillard <http://drobilla.net> | |||||
Copyright 2012-2016 David Robillard <http://drobilla.net> | |||||
Permission to use, copy, modify, and/or distribute this software for any | Permission to use, copy, modify, and/or distribute this software for any | ||||
purpose with or without fee is hereby granted, provided that the above | purpose with or without fee is hereby granted, provided that the above | ||||
@@ -15,8 +15,12 @@ | |||||
*/ | */ | ||||
/** | /** | ||||
@file worker.h C header for the LV2 Worker extension | |||||
<http://lv2plug.in/ns/ext/worker>. | |||||
@defgroup worker Worker | |||||
Support for non-realtime plugin operations, see | |||||
<http://lv2plug.in/ns/ext/worker> for details. | |||||
@{ | |||||
*/ | */ | ||||
#ifndef LV2_WORKER_H | #ifndef LV2_WORKER_H | ||||
@@ -26,18 +30,18 @@ | |||||
#include "lv2.h" | #include "lv2.h" | ||||
#define LV2_WORKER_URI "http://lv2plug.in/ns/ext/worker" | |||||
#define LV2_WORKER_PREFIX LV2_WORKER_URI "#" | |||||
#define LV2_WORKER_URI "http://lv2plug.in/ns/ext/worker" ///< http://lv2plug.in/ns/ext/worker | |||||
#define LV2_WORKER_PREFIX LV2_WORKER_URI "#" ///< http://lv2plug.in/ns/ext/worker# | |||||
#define LV2_WORKER__interface LV2_WORKER_PREFIX "interface" | |||||
#define LV2_WORKER__schedule LV2_WORKER_PREFIX "schedule" | |||||
#define LV2_WORKER__interface LV2_WORKER_PREFIX "interface" ///< http://lv2plug.in/ns/ext/worker#interface | |||||
#define LV2_WORKER__schedule LV2_WORKER_PREFIX "schedule" ///< http://lv2plug.in/ns/ext/worker#schedule | |||||
#ifdef __cplusplus | #ifdef __cplusplus | ||||
extern "C" { | extern "C" { | ||||
#endif | #endif | ||||
/** | /** | ||||
A status code for worker functions. | |||||
Status code for worker functions. | |||||
*/ | */ | ||||
typedef enum { | typedef enum { | ||||
LV2_WORKER_SUCCESS = 0, /**< Completed successfully. */ | LV2_WORKER_SUCCESS = 0, /**< Completed successfully. */ | ||||
@@ -45,12 +49,13 @@ typedef enum { | |||||
LV2_WORKER_ERR_NO_SPACE = 2 /**< Failed due to lack of space. */ | LV2_WORKER_ERR_NO_SPACE = 2 /**< Failed due to lack of space. */ | ||||
} LV2_Worker_Status; | } LV2_Worker_Status; | ||||
/** Opaque handle for LV2_Worker_Interface::work(). */ | |||||
typedef void* LV2_Worker_Respond_Handle; | typedef void* LV2_Worker_Respond_Handle; | ||||
/** | /** | ||||
A function to respond to run() from the worker method. | A function to respond to run() from the worker method. | ||||
The @p data MUST be safe for the host to copy and later pass to | |||||
The `data` MUST be safe for the host to copy and later pass to | |||||
work_response(), and the host MUST guarantee that it will be eventually | work_response(), and the host MUST guarantee that it will be eventually | ||||
passed to work_response() if this function returns LV2_WORKER_SUCCESS. | passed to work_response() if this function returns LV2_WORKER_SUCCESS. | ||||
*/ | */ | ||||
@@ -60,7 +65,7 @@ typedef LV2_Worker_Status (*LV2_Worker_Respond_Function)( | |||||
const void* data); | const void* data); | ||||
/** | /** | ||||
LV2 Plugin Worker Interface. | |||||
Plugin Worker Interface. | |||||
This is the interface provided by the plugin to implement a worker method. | This is the interface provided by the plugin to implement a worker method. | ||||
The plugin's extension_data() method should return an LV2_Worker_Interface | The plugin's extension_data() method should return an LV2_Worker_Interface | ||||
@@ -71,14 +76,17 @@ typedef struct _LV2_Worker_Interface { | |||||
The worker method. This is called by the host in a non-realtime context | The worker method. This is called by the host in a non-realtime context | ||||
as requested, possibly with an arbitrary message to handle. | as requested, possibly with an arbitrary message to handle. | ||||
A response can be sent to run() using @p respond. The plugin MUST NOT | |||||
make any assumptions about which thread calls this method, other than | |||||
the fact that there are no real-time requirements. | |||||
A response can be sent to run() using `respond`. The plugin MUST NOT | |||||
make any assumptions about which thread calls this method, except that | |||||
there are no real-time requirements and only one call may be executed at | |||||
a time. That is, the host MAY call this method from any non-real-time | |||||
thread, but MUST NOT make concurrent calls to this method from several | |||||
threads. | |||||
@param instance The LV2 instance this is a method on. | @param instance The LV2 instance this is a method on. | ||||
@param respond A function for sending a response to run(). | @param respond A function for sending a response to run(). | ||||
@param handle Must be passed to @p respond if it is called. | |||||
@param size The size of @p data. | |||||
@param handle Must be passed to `respond` if it is called. | |||||
@param size The size of `data`. | |||||
@param data Data from run(), or NULL. | @param data Data from run(), or NULL. | ||||
*/ | */ | ||||
LV2_Worker_Status (*work)(LV2_Handle instance, | LV2_Worker_Status (*work)(LV2_Handle instance, | ||||
@@ -92,7 +100,7 @@ typedef struct _LV2_Worker_Interface { | |||||
run() context when a response from the worker is ready. | run() context when a response from the worker is ready. | ||||
@param instance The LV2 instance this is a method on. | @param instance The LV2 instance this is a method on. | ||||
@param size The size of @p body. | |||||
@param size The size of `body`. | |||||
@param body Message body, or NULL. | @param body Message body, or NULL. | ||||
*/ | */ | ||||
LV2_Worker_Status (*work_response)(LV2_Handle instance, | LV2_Worker_Status (*work_response)(LV2_Handle instance, | ||||
@@ -112,8 +120,15 @@ typedef struct _LV2_Worker_Interface { | |||||
LV2_Worker_Status (*end_run)(LV2_Handle instance); | LV2_Worker_Status (*end_run)(LV2_Handle instance); | ||||
} LV2_Worker_Interface; | } LV2_Worker_Interface; | ||||
/** Opaque handle for LV2_Worker_Schedule. */ | |||||
typedef void* LV2_Worker_Schedule_Handle; | typedef void* LV2_Worker_Schedule_Handle; | ||||
/** | |||||
Schedule Worker Host Feature. | |||||
The host passes this feature to provide a schedule_work() function, which | |||||
the plugin can use to schedule a worker call from run(). | |||||
*/ | |||||
typedef struct _LV2_Worker_Schedule { | typedef struct _LV2_Worker_Schedule { | ||||
/** | /** | ||||
Opaque host data. | Opaque host data. | ||||
@@ -138,12 +153,12 @@ typedef struct _LV2_Worker_Schedule { | |||||
immediately, and responses from the worker are delivered immediately, | immediately, and responses from the worker are delivered immediately, | ||||
the effect of the work takes place immediately with sample accuracy. | the effect of the work takes place immediately with sample accuracy. | ||||
The @p data MUST be safe for the host to copy and later pass to work(), | |||||
The `data` MUST be safe for the host to copy and later pass to work(), | |||||
and the host MUST guarantee that it will be eventually passed to work() | and the host MUST guarantee that it will be eventually passed to work() | ||||
if this function returns LV2_WORKER_SUCCESS. | if this function returns LV2_WORKER_SUCCESS. | ||||
@param handle The handle field of this struct. | @param handle The handle field of this struct. | ||||
@param size The size of @p data. | |||||
@param size The size of `data`. | |||||
@param data Message to pass to work(), or NULL. | @param data Message to pass to work(), or NULL. | ||||
*/ | */ | ||||
LV2_Worker_Status (*schedule_work)(LV2_Worker_Schedule_Handle handle, | LV2_Worker_Status (*schedule_work)(LV2_Worker_Schedule_Handle handle, | ||||
@@ -156,3 +171,7 @@ typedef struct _LV2_Worker_Schedule { | |||||
#endif | #endif | ||||
#endif /* LV2_WORKER_H */ | #endif /* LV2_WORKER_H */ | ||||
/** | |||||
@} | |||||
*/ |