LV2
1.0.13
|
C API for the LV2 State extension http://lv2plug.in/ns/ext/state. More...
Data Structures | |
struct | LV2_State_Interface |
LV2 Plugin State Interface. More... | |
struct | LV2_State_Map_Path |
Feature data for state:mapPath (LV2_STATE__mapPath). More... | |
struct | LV2_State_Make_Path |
Feature data for state:makePath (LV2_STATE__makePath). More... | |
Macros | |
#define | LV2_STATE_URI "http://lv2plug.in/ns/ext/state" |
#define | LV2_STATE_PREFIX LV2_STATE_URI "#" |
#define | LV2_STATE__State LV2_STATE_PREFIX "State" |
#define | LV2_STATE__interface LV2_STATE_PREFIX "interface" |
#define | LV2_STATE__makePath LV2_STATE_PREFIX "makePath" |
#define | LV2_STATE__mapPath LV2_STATE_PREFIX "mapPath" |
#define | LV2_STATE__state LV2_STATE_PREFIX "state" |
Typedefs | |
typedef void * | LV2_State_Handle |
typedef void * | LV2_State_Map_Path_Handle |
typedef void * | LV2_State_Make_Path_Handle |
typedef LV2_State_Status(* | LV2_State_Store_Function )(LV2_State_Handle handle, uint32_t key, const void *value, size_t size, uint32_t type, uint32_t flags) |
A host-provided function to store a property. | |
typedef const void *(* | LV2_State_Retrieve_Function )(LV2_State_Handle handle, uint32_t key, size_t *size, uint32_t *type, uint32_t *flags) |
A host-provided function to retrieve a property. | |
Enumerations | |
enum | LV2_State_Flags { LV2_STATE_IS_POD = 1, LV2_STATE_IS_PORTABLE = 1 << 1, LV2_STATE_IS_NATIVE = 1 << 2 } |
Flags describing value characteristics. More... | |
enum | LV2_State_Status { LV2_STATE_SUCCESS = 0, LV2_STATE_ERR_UNKNOWN = 1, LV2_STATE_ERR_BAD_TYPE = 2, LV2_STATE_ERR_BAD_FLAGS = 3, LV2_STATE_ERR_NO_FEATURE = 4, LV2_STATE_ERR_NO_PROPERTY = 5 } |
A status code for state functions. More... | |
C API for the LV2 State extension http://lv2plug.in/ns/ext/state.
#define LV2_STATE_URI "http://lv2plug.in/ns/ext/state" |
#define LV2_STATE_PREFIX LV2_STATE_URI "#" |
#define LV2_STATE__State LV2_STATE_PREFIX "State" |
#define LV2_STATE__interface LV2_STATE_PREFIX "interface" |
#define LV2_STATE__makePath LV2_STATE_PREFIX "makePath" |
#define LV2_STATE__mapPath LV2_STATE_PREFIX "mapPath" |
#define LV2_STATE__state LV2_STATE_PREFIX "state" |
typedef void* LV2_State_Handle |
typedef void* LV2_State_Map_Path_Handle |
typedef void* LV2_State_Make_Path_Handle |
typedef LV2_State_Status(* LV2_State_Store_Function)(LV2_State_Handle handle, uint32_t key, const void *value, size_t size, uint32_t type, uint32_t flags) |
A host-provided function to store a property.
handle | Must be the handle passed to LV2_State_Interface.save(). |
key | The key to store value under (URID). |
value | Pointer to the value to be stored. |
size | The size of value in bytes. |
type | The type of value (URID). |
flags | LV2_State_Flags for value . |
The host passes a callback of this type to LV2_State_Interface.save(). This callback is called repeatedly by the plugin to store all the properties that describe its current state.
DO NOT INVENT NONSENSE URI SCHEMES FOR THE KEY. Best is to use keys from existing vocabularies. If nothing appropriate is available, use http URIs that point to somewhere you can host documents so documentation can be made resolvable (e.g. a child of the plugin or project URI). If this is not possible, invent a URN scheme, e.g. urn:myproj:whatever. The plugin MUST NOT pass an invalid URI key.
The host MAY fail to store a property for whatever reason, but SHOULD store any property that is LV2_STATE_IS_POD and LV2_STATE_IS_PORTABLE. Implementations SHOULD use the types from the LV2 Atom extension (http://lv2plug.in/ns/ext/atom) wherever possible. The plugin SHOULD attempt to fall-back and avoid the error if possible.
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 LV2_State_Interface.restore() context.
typedef const void*(* LV2_State_Retrieve_Function)(LV2_State_Handle handle, uint32_t key, size_t *size, uint32_t *type, uint32_t *flags) |
A host-provided function to retrieve a property.
handle | Must be the handle passed to LV2_State_Interface.restore(). |
key | The key of the property to retrieve (URID). |
size | (Output) If non-NULL, set to the size of the restored value. |
type | (Output) If non-NULL, set to the type of the restored value. |
flags | (Output) If non-NULL, set to the flags for the restored value. |
key
.A callback of this type is passed by the host to LV2_State_Interface.restore(). This callback is called repeatedly by the plugin to retrieve any properties it requires to restore its state.
The returned value MUST remain valid until LV2_State_Interface.restore() returns. The plugin MUST NOT attempt to use this function, or any value returned from it, outside of the LV2_State_Interface.restore() context.
enum LV2_State_Flags |
Flags describing value characteristics.
These flags are used along with the value's type URI to determine how to (de-)serialise the value data, or whether it is even possible to do so.
enum LV2_State_Status |
A status code for state functions.