Editor protocol¶
ravet_plugin::editor defines the JSON messages between a plug-in and its web
editor, so products write no editor codec. Messages are objects with a type;
parameters are addressed by key, and values are physical unless sent as
normalized.
| Direction | type |
Fields |
|---|---|---|
| Editor → plug-in | ready |
protocol (currently 1) |
begin, end |
key |
|
set |
key, value or normalized, inside an open gesture |
|
commit |
key, value or normalized: one complete edit |
|
product |
data, product-defined |
|
| Plug-in → editor | info |
protocol, product name/vendor/version/category, parameter metadata |
snapshot |
sequence, all values by key, optional telemetry and product |
|
changes |
sequence, changed values by key |
|
product |
data |
editor::parse rejects messages over 64 KiB, malformed JSON, unknown types or
keys, edits to read-only parameters, nonfinite values, and a protocol other than
1. Values clamp and snap to the parameter's range. Gestures tracks open
gestures per editor: set needs an open gesture, commit is refused while one
is open on the same parameter, and close_all returns the gestures to end when
the editor closes. Several parameters may have gestures open at once.
sequence increases with each snapshot or change message, so editors can drop
stale updates.
The transport and injected JavaScript client are described below.