|
LMMS
|
#include <stddef.h>#include <stdint.h>#include "lv2/lv2plug.in/ns/lv2core/lv2.h"#include <stdbool.h>Go to the source code of this file.
Classes | |
| struct | _LV2_State_Interface |
| struct | LV2_State_Map_Path |
| struct | LV2_State_Make_Path |
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__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" |
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) |
| typedef const void *(* | LV2_State_Retrieve_Function) (LV2_State_Handle handle, uint32_t key, size_t *size, uint32_t *type, uint32_t *flags) |
| typedef struct _LV2_State_Interface | LV2_State_Interface |
Enumerations | |
| enum | LV2_State_Flags { LV2_STATE_IS_POD = 1 , LV2_STATE_IS_PORTABLE = 1 << 1 , LV2_STATE_IS_NATIVE = 1 << 2 } |
| 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 } |
| #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" |
| #define LV2_STATE_PREFIX LV2_STATE_URI "#" |
| #define LV2_STATE_URI "http://lv2plug.in/ns/ext/state" |
| typedef void* LV2_State_Handle |
| typedef struct _LV2_State_Interface LV2_State_Interface |
When the plugin's extension_data is called with argument LV2_STATE__interface, the plugin MUST return an LV2_State_Interface structure, which remains valid for the lifetime of the plugin.
The host can use the contained function pointers to save and restore the state of a plugin instance at any time, provided the threading restrictions of the functions are met.
Stored data is only guaranteed to be compatible between instances of plugins with the same URI (i.e. if a change to a plugin would cause a fatal error when restoring state saved by a previous version of that plugin, the plugin URI MUST change just as it must when ports change incompatibly). Plugin authors should consider this possibility, and always store sensible data with meaningful types to avoid such problems in the future.
| typedef void* LV2_State_Make_Path_Handle |
| typedef void* LV2_State_Map_Path_Handle |
| 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.
| 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.
| 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.