pub struct PerformanceTake {
pub source_id: Symbol,
pub take_id: Symbol,
pub events: Vec<PerformanceEvent>,
/* private fields */
}Expand description
A captured recording of performance events with a content-addressed cassette.
Stores the raw PerformanceEvents plus a derived
stream cassette and a stable content hash, and can replay, convert to notes, or
render to Music.
Fields§
§source_id: SymbolSymbol of the source that captured the take.
take_id: SymbolSymbol identifying the take.
events: Vec<PerformanceEvent>Captured performance events in order.
Implementations§
Source§impl PerformanceTake
impl PerformanceTake
Sourcepub fn new(
source_id: Symbol,
take_id: Symbol,
events: Vec<PerformanceEvent>,
) -> Result<Self>
pub fn new( source_id: Symbol, take_id: Symbol, events: Vec<PerformanceEvent>, ) -> Result<Self>
Builds a take from events, deriving its cassette and content hash.
Sourcepub fn cassette(&self) -> &StreamCassette
pub fn cassette(&self) -> &StreamCassette
Returns the stream cassette derived from the take’s events.
Sourcepub fn content_hash(&self) -> &str
pub fn content_hash(&self) -> &str
Returns the stable content hash of the take’s cassette.
Sourcepub fn replay_events(&self) -> Result<Vec<PerformanceEvent>>
pub fn replay_events(&self) -> Result<Vec<PerformanceEvent>>
Decodes the take’s events back from its cassette.
Sourcepub fn replay_content_hash(&self) -> Result<String>
pub fn replay_content_hash(&self) -> Result<String>
Recomputes the content hash from the cassette-replayed events.
Sourcepub fn note_events(&self) -> Result<Vec<NoteEvent>>
pub fn note_events(&self) -> Result<Vec<NoteEvent>>
Pairs note-on/note-off events into timed NoteEvents.
Sourcepub fn play_events(&self) -> Result<Vec<PlayEvent>>
pub fn play_events(&self) -> Result<Vec<PlayEvent>>
Returns the take’s notes wrapped as PlayEvents.
Sourcepub fn player_chain_context(&self, cx: &PlayContext) -> Result<PlayContext>
pub fn player_chain_context(&self, cx: &PlayContext) -> Result<PlayContext>
Returns cx with the take’s play events merged into its upstream, ordered.
Trait Implementations§
Source§impl Clone for PerformanceTake
impl Clone for PerformanceTake
Source§fn clone(&self) -> PerformanceTake
fn clone(&self) -> PerformanceTake
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more