Enforces size constraints on host resizes that bypassed the format’s
negotiation hooks. Some hosts resize the plugin’s embedded window
directly at the windowing-system level (Bitwig on Linux/X11 resizes
the embed window itself), so no checkSizeConstraint-style preflight
ever runs - the editor’s own Resized handler is the last place that
can enforce min_size / max_size / aspect_ratio.
Bridge between the editor and the host / plugin. Format wrappers
(CLAP / VST3 / VST2 / AU / AAX / LV2) implement this trait - or
build a ClosureBridge from per-method closures - and pass an
Arc<dyn EditorBridge> to the editor through PluginContext.
f32-precision parameter reads on PluginContext. Brought into
scope by truce::prelude / truce::prelude32 / truce::prelude64m
(the f32-buffer preludes). GUI binding crates (slint, egui,
iced) take f32 natively, so this is the common case.
f64-precision parameter reads on PluginContext. Brought into
scope by truce::prelude64. Same surface as
PluginContextReadF32 but returns the bridge’s f64 value
directly without narrowing.
Clamp a host-committed size to the editor’s [min, max] bounds only,
leaving the aspect ratio untouched so the editor fills the host window
exactly. The commit-time counterpart to fit_logical_size: on-ratio
shaping already happened during the host’s drag negotiation (a preflight
such as VST3 checkSizeConstraint), so re-fitting onto the ratio here
would only floor the editor a pixel under the window and leave an
unpainted letterbox line. The max clamp keeps the surface inside the
window; the min clamp upholds the editor’s “can’t render smaller than
this” floor even when a host hands over a too-small box.
Same fit as fit_logical_size but over raw constraints rather than
an &dyn Editor. Lets call sites that have already captured the
bounds (e.g. an Objective-C resize callback that can’t carry a trait
object) reuse the identical rule.
Build a PluginContext backed only by params. All write
closures are no-ops; reads delegate to the params Arc; the
transport reports the deterministic
crate::events::TransportInfo::for_screenshot state so
screenshot tests stay reproducible across CI runs.