LMMS
Loading...
Searching...
No Matches
State

Classes

struct  LV2_State_Interface
struct  LV2_State_Map_Path
struct  LV2_State_Make_Path
struct  LV2_State_Free_Path

Macros

#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"
 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
#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"
 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

Typedefs

typedef voidLV2_State_Handle
 Opaque handle for state save/restore.
typedef voidLV2_State_Free_Path_Handle
 Opaque handle for state:freePath feature.
typedef voidLV2_State_Map_Path_Handle
 Opaque handle for state:mapPath feature.
typedef voidLV2_State_Make_Path_Handle
 Opaque handle for state:makePath feature.
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 voidLV2_State_Handle
 Opaque handle for state save/restore.
typedef voidLV2_State_Free_Path_Handle
 Opaque handle for state:freePath feature.
typedef voidLV2_State_Map_Path_Handle
 Opaque handle for state:mapPath feature.
typedef voidLV2_State_Make_Path_Handle
 Opaque handle for state:makePath feature.
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)

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 , LV2_STATE_ERR_NO_SPACE = 6
}
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 , LV2_STATE_ERR_NO_SPACE = 6
}

Detailed Description

An interface for LV2 plugins to save and restore state, see http://lv2plug.in/ns/ext/state for details.

An interface for LV2 plugins to save and restore state.

See http://lv2plug.in/ns/ext/state for details.

Macro Definition Documentation

◆ LV2_STATE__freePath [1/2]

#define LV2_STATE__freePath   LV2_STATE_PREFIX "freePath"

◆ LV2_STATE__freePath [2/2]

#define LV2_STATE__freePath   LV2_STATE_PREFIX "freePath"

◆ LV2_STATE__interface [1/2]

#define LV2_STATE__interface   LV2_STATE_PREFIX "interface"

◆ LV2_STATE__interface [2/2]

#define LV2_STATE__interface   LV2_STATE_PREFIX "interface"

◆ LV2_STATE__loadDefaultState [1/2]

#define LV2_STATE__loadDefaultState   LV2_STATE_PREFIX "loadDefaultState"

◆ LV2_STATE__loadDefaultState [2/2]

#define LV2_STATE__loadDefaultState   LV2_STATE_PREFIX "loadDefaultState"

◆ LV2_STATE__makePath [1/2]

#define LV2_STATE__makePath   LV2_STATE_PREFIX "makePath"

◆ LV2_STATE__makePath [2/2]

#define LV2_STATE__makePath   LV2_STATE_PREFIX "makePath"

◆ LV2_STATE__mapPath [1/2]

#define LV2_STATE__mapPath   LV2_STATE_PREFIX "mapPath"

◆ LV2_STATE__mapPath [2/2]

#define LV2_STATE__mapPath   LV2_STATE_PREFIX "mapPath"

◆ LV2_STATE__State [1/2]

#define LV2_STATE__State   LV2_STATE_PREFIX "State"

◆ LV2_STATE__State [2/2]

#define LV2_STATE__State   LV2_STATE_PREFIX "State"

◆ LV2_STATE__state [1/2]

#define LV2_STATE__state   LV2_STATE_PREFIX "state"

◆ LV2_STATE__state [2/2]

#define LV2_STATE__state   LV2_STATE_PREFIX "state"

◆ LV2_STATE__StateChanged [1/2]

#define LV2_STATE__StateChanged   LV2_STATE_PREFIX "StateChanged"

◆ LV2_STATE__StateChanged [2/2]

#define LV2_STATE__StateChanged   LV2_STATE_PREFIX "StateChanged"

◆ LV2_STATE__threadSafeRestore [1/2]

#define LV2_STATE__threadSafeRestore   LV2_STATE_PREFIX "threadSafeRestore"

◆ LV2_STATE__threadSafeRestore [2/2]

#define LV2_STATE__threadSafeRestore   LV2_STATE_PREFIX "threadSafeRestore"

◆ LV2_STATE_PREFIX [1/2]

#define LV2_STATE_PREFIX   LV2_STATE_URI "#"

◆ LV2_STATE_PREFIX [2/2]

#define LV2_STATE_PREFIX   LV2_STATE_URI "#"

◆ LV2_STATE_URI [1/2]

#define LV2_STATE_URI   "http://lv2plug.in/ns/ext/state"

◆ LV2_STATE_URI [2/2]

#define LV2_STATE_URI   "http://lv2plug.in/ns/ext/state"

Typedef Documentation

◆ LV2_State_Free_Path_Handle [1/2]

Opaque handle for state:freePath feature.

◆ LV2_State_Free_Path_Handle [2/2]

Opaque handle for state:freePath feature.

◆ LV2_State_Handle [1/2]

Opaque handle for state save/restore.

◆ LV2_State_Handle [2/2]

Opaque handle for state save/restore.

◆ LV2_State_Make_Path_Handle [1/2]

Opaque handle for state:makePath feature.

◆ LV2_State_Make_Path_Handle [2/2]

Opaque handle for state:makePath feature.

◆ LV2_State_Map_Path_Handle [1/2]

Opaque handle for state:mapPath feature.

◆ LV2_State_Map_Path_Handle [2/2]

Opaque handle for state:mapPath feature.

◆ LV2_State_Retrieve_Function [1/2]

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.

Parameters
handleMust be the handle passed to LV2_State_Interface.restore().
keyThe 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.
Returns
A pointer to the restored value (object), or NULL if no value has been stored under 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.

◆ LV2_State_Retrieve_Function [2/2]

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.

Parameters
handleMust be the handle passed to LV2_State_Interface.restore().
keyThe 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.
Returns
A pointer to the restored value (object), or NULL if no value has been stored under 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.

◆ LV2_State_Store_Function [1/2]

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.

Parameters
handleMust be the handle passed to LV2_State_Interface.save().
keyThe key to store value under (URID).
valuePointer to the value to be stored.
sizeThe size of value in bytes.
typeThe type of value (URID).
flagsLV2_State_Flags for value.
Returns
0 on success, otherwise a non-zero error code.

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 (typically a child of the plugin or project URI). If this is not possible, invent a URN scheme, e.g. urn:myproj:whatever. The plugin MUST NOT pass an invalid URI key.

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.

◆ LV2_State_Store_Function [2/2]

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.

Parameters
handleMust be the handle passed to LV2_State_Interface.save().
keyThe key to store value under (URID).
valuePointer to the value to be stored.
sizeThe size of value in bytes.
typeThe type of value (URID).
flagsLV2_State_Flags for value.
Returns
0 on success, otherwise a non-zero error code.

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 (typically a child of the plugin or project URI). If this is not possible, invent a URN scheme, e.g. urn:myproj:whatever. The plugin MUST NOT pass an invalid URI key.

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.

Enumeration Type Documentation

◆ LV2_State_Flags [1/2]

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.

Enumerator
LV2_STATE_IS_POD 

Plain Old Data.

Values with this flag contain no pointers or references to other areas of memory. It is safe to copy POD values with a simple memcpy and store them for the duration of the process. A POD value is not necessarily safe to trasmit between processes or machines (for example, filenames are POD), see LV2_STATE_IS_PORTABLE for details.

Implementations MUST NOT attempt to copy or serialise a non-POD value if they do not understand its type (and thus know how to correctly do so).

LV2_STATE_IS_PORTABLE 

Portable (architecture independent) data.

Values with this flag are in a format that is usable on any architecture. A portable value saved on one machine can be restored on another machine regardless of architecture. The format of portable values MUST NOT depend on architecture-specific properties like endianness or alignment. Portable values MUST NOT contain filenames.

LV2_STATE_IS_NATIVE 

Native data.

This flag is used by the host to indicate that the saved data is only going to be used locally in the currently running process (for things like instance duplication or snapshots), so the plugin should use the most efficient representation possible and not worry about serialisation and portability.

◆ LV2_State_Flags [2/2]

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.

Enumerator
LV2_STATE_IS_POD 

Plain Old Data.

Values with this flag contain no pointers or references to other areas of memory. It is safe to copy POD values with a simple memcpy and store them for the duration of the process. A POD value is not necessarily safe to trasmit between processes or machines (for example, filenames are POD), see LV2_STATE_IS_PORTABLE for details.

Implementations MUST NOT attempt to copy or serialise a non-POD value if they do not understand its type (and thus know how to correctly do so).

LV2_STATE_IS_PORTABLE 

Portable (architecture independent) data.

Values with this flag are in a format that is usable on any architecture. A portable value saved on one machine can be restored on another machine regardless of architecture. The format of portable values MUST NOT depend on architecture-specific properties like endianness or alignment. Portable values MUST NOT contain filenames.

LV2_STATE_IS_NATIVE 

Native data.

This flag is used by the host to indicate that the saved data is only going to be used locally in the currently running process (for things like instance duplication or snapshots), so the plugin should use the most efficient representation possible and not worry about serialisation and portability.

◆ LV2_State_Status [1/2]

A status code for state functions.

Enumerator
LV2_STATE_SUCCESS 

Completed successfully.

LV2_STATE_ERR_UNKNOWN 

Unknown error.

LV2_STATE_ERR_BAD_TYPE 

Failed due to unsupported type.

LV2_STATE_ERR_BAD_FLAGS 

Failed due to unsupported flags.

LV2_STATE_ERR_NO_FEATURE 

Failed due to missing features.

LV2_STATE_ERR_NO_PROPERTY 

Failed due to missing property.

LV2_STATE_ERR_NO_SPACE 

Failed due to insufficient space.

◆ LV2_State_Status [2/2]

A status code for state functions.

Enumerator
LV2_STATE_SUCCESS 

Completed successfully.

LV2_STATE_ERR_UNKNOWN 

Unknown error.

LV2_STATE_ERR_BAD_TYPE 

Failed due to unsupported type.

LV2_STATE_ERR_BAD_FLAGS 

Failed due to unsupported flags.

LV2_STATE_ERR_NO_FEATURE 

Failed due to missing features.

LV2_STATE_ERR_NO_PROPERTY 

Failed due to missing property.

LV2_STATE_ERR_NO_SPACE 

Failed due to insufficient space.