Skip to main content

PerformanceSource

Trait PerformanceSource 

Source
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§

Source

fn bind_input(&mut self, binding: PerformanceInputBinding) -> Result<()>

Binds an input to this source, setting its lane and channel.

Source

fn poll_events( &mut self, inputs: Vec<PerformanceInput>, ) -> Result<Vec<PerformanceEvent>>

Transforms queued inputs into events, updating held-note state.

Source

fn panic(&mut self, input_time: Tick) -> Result<Vec<PerformanceEvent>>

Emits note-offs for all held notes followed by a panic event.

Source

fn capture_start(&mut self, take_id: Symbol) -> Result<()>

Begins capturing emitted events under take_id.

Source

fn capture_stop(&mut self) -> Result<PerformanceTake>

Ends capture and returns the recorded PerformanceTake.

Source

fn as_clip(&self, take: &PerformanceTake) -> Result<Music>

Renders a captured take into a Music clip.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§