AUDIO
Source snapshot · 11 November 2026

API reference / ravet_clap::translate_transport

Function translate_transport 

pub fn translate_transport(
    event: Option<&TransportEvent>,
    sample_rate: f64,
) -> Result<Transport, BridgeError>
Expand description

Convert known CLAP block-start fields into portable transport context.

No context leaves all optional fields absent. Unadvertised fields are ignored. Advertised tempo must be finite and positive; seconds convert to the nearest sample at the validated rate, rejecting overflow rather than saturating. Additional flags, signature, tempo increment, bar and active loop metadata are forwarded only with their matching validity flags. Loop bounds must remain strictly increasing after sample rounding. Inactive loop fields are ignored. Discontinuity detection belongs to the prepared bridge; no mid-block updates.