lilv.state
class State
Types 1
classState
Snapshot of plugin state (presets, session save/restore).
A State is owned by the caller and freed in the destructor. Like other lilv objects, it keeps the World alive until the State is destroyed.
Most State operations need an LV2_URID_Map (and often Unmap). The host is responsible for providing those; lilv does not implement a map for you.
Methods
int setMetadata(uint key, const(void)[] value, uint type, StateFlags flags) @nogc nothrowSet a single metadata property on this state.void emitPortValues(LilvSetPortValueFunc setValue, void * userData) @nogc nothrowEmit all port values in this state via a callback. Does not touch a live Instance; useful for hosts that apply ports themselves. Low overhead C callback version which is potentially real-time safe.void emitPortValues(SetPortValueDelegate setValueDg)Emit all port values in this state via a callback. Does not touch a live Instance; useful for hosts that apply ports themselves. Uses a delegate which may result in GC allocation or exceptions. NOT...void restore(Instance instance, LilvSetPortValueFunc setValue, void * userData, StateFlags flags,
const(LV2_Feature *) * features = null) @nogc nothrowRestore this state onto a plugin instance. Low overhead C callback version which is potentially real-time safe.void restore(Instance instance, SetPortValueDelegate setValueDg, StateFlags flags, Feature[] features = null)Restore this state onto a plugin instance. Uses a delegate instead of a C callback and dynamic array of Feature structures which may result in GC allocation and is NOT real-time safe.int save(LV2_URID_Map * map, LV2_URID_Unmap * unmap, string uri, string dir,
string filename)Save this state to a bundle directory / file on disk.string toString(LV2_URID_Map * map, LV2_URID_Unmap * unmap, string uri = null, string baseUri = null)Serialize this state to a string (Turtle).int deleteFromWorld() @nogc nothrowDelete the resources for this state from the World (saved bundle files, etc.). Returns: 0 on successState fromWorld(World world, LV2_URID_Map * map, Node subject) staticLoad state from a resource already present in the World model.State fromFile(World world, LV2_URID_Map * map, Node subject, string path) staticLoad state from a Turtle file.State fromString(World world, LV2_URID_Map * map, string str) staticLoad state from a string previously produced by toString(). Params: world = Lilv world map = URID map str = The string state returned by toString() Returns: New State object or null on errorState fromInstance(Plugin plugin, Instance instance, LV2_URID_Map * map, string scratchDir, string copyDir,
string linkDir, string saveDir, LilvGetPortValueFunc getValue, void * userData, StateFlags flags,
const(LV2_Feature *) * features = null) staticSnapshot state from a live plugin instance.State fromInstance(Plugin plugin, Instance instance, LV2_URID_Map * map, string scratchDir, string copyDir,
string linkDir, string saveDir, GetPortValueDelegate getValueDg, StateFlags flags, Feature[] features = null) staticSnapshot state from a live plugin instance.Constructors
Destructors