Expand description
The wire protocol between ferraus and a plugin host process (ferraus-plughost for CLAP,
ferraus-plughost-vst3 for VST3). See PROTOCOL.md in this crate for the full spec.
- Control: length-prefixed JSON frames (
u32little-endian byte length, then UTF-8 JSON) on the host’s stdin (requests) and stdout (replies). Exactly one reply per request, in order. The host’s own stdout is redirected to stderr before any plugin code runs, so a chatty plugin can never corrupt the stream. - Audio: a memory-mapped temp file created by the client, holding a 64-byte header and a
ring of
slotsblocks; each slot has planarf32input channels followed by planar output channels ofblock_sizeframes.
This module has no dependency on ferraus-core, so the host binaries link only this.
Structs§
- Descriptor
- What a plugin declares about itself (no instantiation needed).
- Note
Port Info - Param
Assign name=valueas given on the command line.- Param
Info - One parameter, with its range in plain (plugin) units.
- Param
Value - A parameter’s value after a set/get.
- Plugin
Info - Everything ferraus needs after instantiation.
- Port
Info - Preset
Info - ShmLayout
- Geometry of the shared-memory audio file.
Enums§
Constants§
- MAX_
FRAME - Largest accepted frame (64 MiB): states and preset lists are the only big payloads.
- PROTOCOL_
VERSION - Bumped on any incompatible change to the messages or the shared-memory layout.
- SHM_
HEADER - Size of the shared-memory header in bytes.
- SHM_
MAGIC - First 8 bytes of the shared-memory file.
Traits§
- Param
Text - Hooks into a plugin’s own text conversion.
Functions§
- f32_
slice_ ⚠mut - View
nf32 values at byte offsetoffof a mapped region. - find_
param - Find a parameter by stable id (
12,id:12) or display name (exact, case-insensitive, punctuation-insensitive, ormodule/name). - infer_
unit - The unit suffix of a display string:
"-6.00 dB"→dB. - read_
frame - Read one frame.
Ok(None)on a clean end of stream before a frame starts. - resolve_
value - Convert a ferraus value string to the plugin’s plain value:
norm:x, the plugin’s own text parser (with unit-spelling variants), a plain in-range number, or a stepped label. - text_
candidates - Text variants to try against a plugin’s
text_to_valuefor a ferraus-style value."2.5kHz"yields["2.5kHz", "2500 Hz", "2500Hz", "2500", "2.5 kHz", "2.5"]. - write_
frame - Write one frame:
u32LE length followed by the JSON bytes.