pub struct Performance { /* private fields */ }Expand description
A running program — see the module docs.
Implementations§
Source§impl Performance
impl Performance
Sourcepub fn new(program: Arc<Program>) -> Self
pub fn new(program: Arc<Program>) -> Self
Load a compiled program, stopped at frame 0. The engine’s sample rate is the program’s.
Sourcepub fn transport(&self) -> &Transport
pub fn transport(&self) -> &Transport
The transport (position, loops — seek helpers are also commands).
Sourcepub fn master_gain(&self) -> f32
pub fn master_gain(&self) -> f32
The current master gain.
Sourcepub fn metrics(&self) -> PerformanceMetrics
pub fn metrics(&self) -> PerformanceMetrics
A health snapshot (queue depth is sampled at call time).
Sourcepub fn queue_depth(&self) -> usize
pub fn queue_depth(&self) -> usize
The current queue depth.
Sourcepub fn schedule(
&mut self,
command: Command,
at: At,
) -> Result<u64, PerformanceError>
pub fn schedule( &mut self, command: Command, at: At, ) -> Result<u64, PerformanceError>
Schedule a command at at. Musical positions resolve to exact frames
now; identical frames execute in submission order. A full queue
rejects the command (counted in the metrics).
Sourcepub fn stinger(
&mut self,
doc: &SoundDoc,
gain: f32,
at: At,
) -> Result<u64, PerformanceError>
pub fn stinger( &mut self, doc: &SoundDoc, gain: f32, at: At, ) -> Result<u64, PerformanceError>
Schedule a stinger: render the doc NOW — the fire inside fill
then only mixes a pre-rendered buffer, so the render path never
renders or allocates at fire time — and fire it at at with gain.
Sourcepub fn swap_to(
&mut self,
program: Arc<Program>,
at: At,
) -> Result<u64, PerformanceError>
pub fn swap_to( &mut self, program: Arc<Program>, at: At, ) -> Result<u64, PerformanceError>
Schedule a program swap (crossfaded at at). The target must load
clean — a rejected target changes nothing (the last valid program
keeps running).
Sourcepub fn transition_to_section(
&mut self,
name: &str,
at: At,
) -> Result<u64, PerformanceError>
pub fn transition_to_section( &mut self, name: &str, at: At, ) -> Result<u64, PerformanceError>
A quantized section transition: seek to the section’s first bar at
the next bar line (or immediately with At::Immediate). The latest
transition wins: scheduling one while another is pending drops the
older pending seek (defined interruption behavior). An unknown
section is rejected now — never a silent no-op later.
Sourcepub fn start_capture(&mut self)
pub fn start_capture(&mut self)
Start recording scheduled commands for deterministic replay.
Sourcepub fn stop_capture(&mut self) -> Vec<TimestampedCommand>
pub fn stop_capture(&mut self) -> Vec<TimestampedCommand>
Stop recording and take the captured commands.
Sourcepub fn replay(&mut self, commands: &[TimestampedCommand])
pub fn replay(&mut self, commands: &[TimestampedCommand])
Replay captured commands at their recorded frames, in order.
Sourcepub fn snapshot(&self) -> PerformanceSnapshot
pub fn snapshot(&self) -> PerformanceSnapshot
A state snapshot: transport position/state, master gain, loop range. Applying it returns the performance to this exact control state.
Sourcepub fn apply_snapshot(&mut self, snapshot: &PerformanceSnapshot)
pub fn apply_snapshot(&mut self, snapshot: &PerformanceSnapshot)
Restore a snapshot (deterministic: the song source re-seeks).
Trait Implementations§
Source§impl AudioSource for Performance
impl AudioSource for Performance
Source§fn fill(&mut self, out: &mut [f32]) -> usize
fn fill(&mut self, out: &mut [f32]) -> usize
Render interleaved stereo, executing due commands at their exact frames (submission order on ties) — the block is split at command boundaries so a command never lands early or late.
Source§fn reset(&mut self)
fn reset(&mut self)
AdaptiveMusic::reset
calls this on each layer.