Controller ownership and reconciliation¶
Unsafe parameters::Provider::from_raw establishes the trusted native table,
code and thread contract. Its borrowed control facade is neither Send nor Sync.
Controller calls require an initialized, stopped, deactivated, non-faulted child
on its original platform main thread. All mutable CONTROL operations across its
parent module require every borrowed audio scope to have joined. Prepare and
start multiple children before lending their independent audio scopes; joining
one child does not permit control mutation while another remains borrowed.
Foreign control reentry is rejected. Provider code must remain loaded through
process exit when native references force pinning; a Rust borrow does not retain
an independently unloadable provider DLL.
refresh_parameters validates and copies a complete catalogue of at most 1024
parameters. IDs are unique and distinct from the SDK sentinel; defaults are finite
and normalized, step counts nonnegative, flags recognized and internally
consistent. Titles, short titles and units come from bounded native UTF16 and
become owned UTF8 strings. Bypass and program-selector flags are explicit; opaque
unit IDs do not imply unit enumeration or program-bank support. Failed refresh
keeps the previous native metadata available for inspection but invalidates
parameter preparation. Existing owned Rust catalogues remain valid values.
Stopped reads, plain/normalized conversions, formatting, parsing and edits call
the controller. Normalized values must be finite in [0,1]; plain results must
be finite. Parsing accepts at most 384 UTF8 bytes and 127 UTF16 code units without
embedded NUL. Text output has 512-byte native capacity including termination.
Read-only and hidden parameters cannot be edited or delivered as timed points.
Successful controller edits change controller state only. Deliver DSP changes
separately through process_parameters; the framework does not infer that a
controller edit reached the component.
A refused or thrown foreign edit may already have mutated private state. It
invalidates parameter preparation without rollback. Malformed successful edit
reports or values also invalidate the Rust companion. Local shape rejection
preserves preparation. Recovery requires explicit successful refresh and
prepare_parameters, or a fresh child if the native lifecycle is faulted.
Successful state restore invalidates parameter compatibility and the previous
audio profile; refresh and prepare explicitly before restarting. Restart flags
are observable requests, with no automatic clearing or reconciliation.