pub trait PerformanceSource {
// Required methods
fn bind_input(&mut self, binding: PerformanceInputBinding) -> Result<()>;
fn poll_events(
&mut self,
inputs: Vec<PerformanceInput>,
) -> Result<Vec<PerformanceEvent>>;
fn panic(&mut self, input_time: Tick) -> Result<Vec<PerformanceEvent>>;
fn capture_start(&mut self, take_id: Symbol) -> Result<()>;
fn capture_stop(&mut self) -> Result<PerformanceTake>;
fn as_clip(&self, take: &PerformanceTake) -> Result<Music>;
}Expand description
A live performance source that turns inputs into events and captures takes.
Implementors bind an input, poll queued PerformanceInputs into transformed
PerformanceEvents, emit panics, record capture takes,
and render a captured PerformanceTake into Music.
Required Methods§
Sourcefn bind_input(&mut self, binding: PerformanceInputBinding) -> Result<()>
fn bind_input(&mut self, binding: PerformanceInputBinding) -> Result<()>
Binds an input to this source, setting its lane and channel.
Sourcefn poll_events(
&mut self,
inputs: Vec<PerformanceInput>,
) -> Result<Vec<PerformanceEvent>>
fn poll_events( &mut self, inputs: Vec<PerformanceInput>, ) -> Result<Vec<PerformanceEvent>>
Transforms queued inputs into events, updating held-note state.
Sourcefn panic(&mut self, input_time: Tick) -> Result<Vec<PerformanceEvent>>
fn panic(&mut self, input_time: Tick) -> Result<Vec<PerformanceEvent>>
Emits note-offs for all held notes followed by a panic event.
Sourcefn capture_start(&mut self, take_id: Symbol) -> Result<()>
fn capture_start(&mut self, take_id: Symbol) -> Result<()>
Begins capturing emitted events under take_id.
Sourcefn capture_stop(&mut self) -> Result<PerformanceTake>
fn capture_stop(&mut self) -> Result<PerformanceTake>
Ends capture and returns the recorded PerformanceTake.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".