pub struct PlayerChain {
pub source_id: Symbol,
pub source: Music,
pub devices: Vec<ChainDevice>,
pub target: PlayerTargetDescriptor,
}Expand description
A source music object plus an ordered chain of devices and an output target.
Fields§
§source_id: SymbolSymbol identifying the source.
source: MusicSource music rendered at the head of the chain.
devices: Vec<ChainDevice>Devices applied in order to the source events.
target: PlayerTargetDescriptorDescriptor of the chain’s output target.
Implementations§
Source§impl PlayerChain
impl PlayerChain
Sourcepub fn new(
source_id: Symbol,
source: Music,
devices: Vec<ChainDevice>,
target: PlayerTargetDescriptor,
) -> Self
pub fn new( source_id: Symbol, source: Music, devices: Vec<ChainDevice>, target: PlayerTargetDescriptor, ) -> Self
Creates a chain from a source and its devices and target.
Sourcepub fn stable_devices(&self) -> Vec<&ChainDevice>
pub fn stable_devices(&self) -> Vec<&ChainDevice>
Returns the devices in stable order by order then id.
Sourcepub fn placement_plan(&self) -> ChainPlacementPlan
pub fn placement_plan(&self) -> ChainPlacementPlan
Builds the placement plan for the chain’s devices.
Sourcepub fn render_chain(&self, cx: &PlayContext) -> Result<ChainRender>
pub fn render_chain(&self, cx: &PlayContext) -> Result<ChainRender>
Renders the source through every active device into events and traces.
Sourcepub fn record_source(&self, cx: &PlayContext) -> SourceRecording
pub fn record_source(&self, cx: &PlayContext) -> SourceRecording
Records source metadata (hashes, seed, placement) without rendering output.
Sourcepub fn record_direct(&self, cx: &PlayContext) -> Result<DirectRecording>
pub fn record_direct(&self, cx: &PlayContext) -> Result<DirectRecording>
Freezes the chain and captures it as a direct recording.
Sourcepub fn freeze_chain(&self, cx: &PlayContext) -> Result<FrozenPlayerChain>
pub fn freeze_chain(&self, cx: &PlayContext) -> Result<FrozenPlayerChain>
Renders the chain and freezes it with metadata into a FrozenPlayerChain.
Sourcepub fn freeze_meta(
&self,
cx: &PlayContext,
events: &[PlayEvent],
traces: &[ChainTraceRecord],
) -> FreezeMeta
pub fn freeze_meta( &self, cx: &PlayContext, events: &[PlayEvent], traces: &[ChainTraceRecord], ) -> FreezeMeta
Builds freeze metadata for already-rendered events and traces.
Sourcepub fn chain_hash(&self) -> String
pub fn chain_hash(&self) -> String
Returns a stable hash over the source id, devices, and target.
Trait Implementations§
Source§impl Clone for PlayerChain
impl Clone for PlayerChain
Source§fn clone(&self) -> PlayerChain
fn clone(&self) -> PlayerChain
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PlayerChain
impl Debug for PlayerChain
Source§impl Playable for PlayerChain
impl Playable for PlayerChain
Source§fn describe(&self) -> Result<PlayableDescriptor>
fn describe(&self) -> Result<PlayableDescriptor>
Source§fn render_range(&self, cx: &PlayContext) -> Result<PlayStream>
fn render_range(&self, cx: &PlayContext) -> Result<PlayStream>
Source§fn freeze(&self, cx: &PlayContext) -> Result<FrozenPlayable>
fn freeze(&self, cx: &PlayContext) -> Result<FrozenPlayable>
FrozenPlayable.Source§fn prepare(&mut self, _cx: &PlayContext) -> Result<()>
fn prepare(&mut self, _cx: &PlayContext) -> Result<()>
cx; defaults to a no-op.Source§fn render_preview(&self, cx: &PlayContext) -> Result<PlayStream>
fn render_preview(&self, cx: &PlayContext) -> Result<PlayStream>
Playable::render_range.Source§fn as_shape(&self) -> PlayableShape
fn as_shape(&self) -> PlayableShape
PlayableShape::music_object.