pub struct PlayContext {
pub transport: Symbol,
pub tempo: TempoMapRef,
pub sample_rate: u32,
pub ppq: u32,
pub range: TimeRange,
pub seed: u64,
pub capabilities: Vec<String>,
pub site: SiteHint,
pub upstream: Vec<PlayEvent>,
}Expand description
Rendering context handed to a Playable during prepare/render/freeze.
Carries the transport identity, tempo map, clock resolution, time window, and any upstream events that a render run depends on.
Fields§
§transport: SymbolSymbol identifying the transport that drives this render.
tempo: TempoMapRefReference to the tempo map used to relate musical and wall-clock time.
sample_rate: u32Audio sample rate in hertz.
ppq: u32Pulses (ticks) per quarter note for tick-domain conversion.
range: TimeRangeTime window the render is clipped to.
seed: u64Deterministic seed for any randomized rendering.
capabilities: Vec<String>Capability tokens the render site advertises.
site: SiteHintHint describing where the render is expected to execute.
upstream: Vec<PlayEvent>Events fed in from upstream stages of a chain.
Implementations§
Source§impl PlayContext
impl PlayContext
Sourcepub fn new(range: TimeRange) -> Self
pub fn new(range: TimeRange) -> Self
Creates a context over range with offline transport defaults.
Sourcepub fn stream_metadata(
&self,
id: Symbol,
item_count: usize,
) -> Result<StreamMetadata>
pub fn stream_metadata( &self, id: Symbol, item_count: usize, ) -> Result<StreamMetadata>
Builds stream metadata for a source stream of item_count data items.
Trait Implementations§
Source§impl Clone for PlayContext
impl Clone for PlayContext
Source§fn clone(&self) -> PlayContext
fn clone(&self) -> PlayContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more