Skip to main content

BlockSource

Trait BlockSource 

Source
pub trait BlockSource: Send + Sync {
    // Required methods
    fn fill(&self, block: &Block, words: &mut [i32]);
    fn sent(&self, block: &Block, sent: bool);
    fn left_out(&self, samples: u64);
}
Expand description

A talker’s samples from another part of the program, one frame’s block at a time, as 32-bit words (crate::aaf::write_words). Its calls come on the talker’s thread as each frame is due, so they must not block or wait on a lock held long.

Required Methods§

Source

fn fill(&self, block: &Block, words: &mut [i32])

Fills words, block.samples frames of block.channels interleaved, for the next block.

Source

fn sent(&self, block: &Block, sent: bool)

The block last filled went out; sent is false where every send of it failed.

Source

fn left_out(&self, samples: u64)

The next samples sample frames are left out as too late to send, the block last filled among them where it did not go out: the stream goes on past them on its timeline.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§