AUDIO
Source snapshot · 11 November 2026

API reference / ravet_plugin::editor

Module editor 

Expand description

The RAVET editor protocol: JSON text messages between a plug-in and its web editor, addressed by parameter key.

Every format adapter uses this protocol, so products write no editor codec. Messages are JSON objects with a type field. Values are physical values in the parameter’s range unless sent as normalized (0 to 1).

Editor to plug-in (parse), at most MAXIMUM_INCOMING_BYTES:

typeFieldsMeaning
readyprotocolPage loaded; reply with info and snapshot
beginkeyStart a continuous gesture
setkey, value or normalizedA value inside an open gesture
endkeyEnd a gesture
commitkey, value or normalizedOne complete edit (begin, set, end)
productdataProduct-defined message

Plug-in to editor (built by the functions below):

typeFields
infoprotocol, product (name, vendor, version), parameters (metadata by key, in declaration order)
snapshotsequence, parameters (all values by key), optional telemetry and product
changessequence, parameters (changed values by key)
productdata

sequence increases with every snapshot or change message, so an editor can ignore stale data. All functions allocate and run on the main thread.

Structs§

Gestures
Tracks open gestures for one editor, so adapters can reject unbalanced messages and end every gesture when the editor closes.

Enums§

EditorMessage
A validated editor message. Parameters are identified by declaration index.
GestureError
A gesture message that does not match the open gestures.
ProtocolError
Reasons an editor message is rejected. Nothing is applied.

Constants§

CLIENT_SCRIPT
The editor client script injected into every editor page.
MAXIMUM_INCOMING_BYTES
Largest accepted editor message, matching the web view message limit.
PROTOCOL_VERSION
Protocol version carried by ready and info.

Functions§

changes
The changes message with changed values as (declaration index, value).
info
The info message: product and parameter metadata for building the editor.
page
The product’s page with the editor client injected at the start of <head>, or at the start of the document when there is no <head>.
parse
Parse and validate one editor message.
product_message
A product-defined message to the editor.
snapshot
The snapshot message with every parameter value in declaration order. Nonfinite values are omitted; they cannot occur in validated state.