AUDIO
Source snapshot · 11 November 2026

API reference / ravet_plugin::state

Module state 

Expand description

The versioned state envelope every export format stores.

One byte layout is used unchanged in VST3 component state, the AU class-info dictionary, AAX chunks, CLAP state and LV2 state properties. All integers are little-endian:

BytesField
8Magic RAVETSTA
2Envelope version, currently 1
2Flags, currently 0
8Product state tag (StateFormat::tag)
4Product state version (StateFormat::version)
4Parameter count n, at most 1,024
8 × nParameter ID (u32) and physical value (f32)
4Extra data length m, at most 16 MiB
mExtra data owned by the product

Read-only parameters are not saved. Every function here allocates and must run on a control thread, never in an audio callback.

Structs§

NoHooks
Hooks that accept earlier versions unchanged and reject foreign data.
Restored
State matched to the current product, ready to publish as a whole.
SavedState
The contents of an envelope, before matching against the current product.

Enums§

Source
Where restored state came from.
StateError
Reasons state cannot be written or restored. Nothing is partially applied.

Constants§

ENVELOPE_VERSION
Envelope layout version written by this release.
MAGIC
Magic bytes at the start of every RAVET state envelope.
MAXIMUM_EXTRA_BYTES
Maximum product extra data.
MAXIMUM_SAVED_PARAMETERS
Maximum saved parameters.

Traits§

StateHooks
Product hooks for older and foreign state. Both run on a control thread.

Functions§

encode
Write an envelope from physical values in declaration order.
read
Parse an envelope for format without matching it to parameters.
restore
Read, import or migrate as needed, then match saved values to the product.