Skip to main content

SceneRenderer

Struct SceneRenderer 

Source
pub struct SceneRenderer { /* private fields */ }
Expand description

Mixes a Scene block by block.

Implementations§

Source§

impl SceneRenderer

Source

pub fn new(scene: Arc<Scene>) -> SceneRenderer

Source

pub fn scene(&self) -> &Arc<Scene> ⓘ

Source

pub fn cursor(&self) -> u64

The frame the next block starts on.

Source

pub fn active_voices(&self) -> usize

How many voices are sounding.

Source

pub fn is_finished(&self) -> bool

Nothing is sounding and no event is left.

Source

pub fn seek(&mut self, frame: u64)

Moves to frame: every voice stops, and events from frame on are still to come.

Source

pub fn render(&mut self, out: &mut [f32])

Fills out (interleaved, scene.channels() per frame; a trailing partial frame is silenced) and advances. Allocation-free and lock-free.

Auto Trait Implementations§

§

impl Forget for SceneRenderer

§

impl Freeze for SceneRenderer
where *const ArcInner<Scene> is !null: Freeze, PhantomData<ArcInner<Scene>>: Freeze, *const u8 is !null: Freeze, PhantomData<Voice>: Freeze,

§

impl Move for SceneRenderer

§

impl RefUnwindSafe for SceneRenderer

§

impl Send for SceneRenderer
where Arc<Scene>: Send, RawVecInner: Send,

§

impl Sync for SceneRenderer
where Arc<Scene>: Sync, RawVecInner: Sync,

§

impl Unpin for SceneRenderer
where Arc<Scene>: Unpin, *const u8 is !null: Unpin,

§

impl UnsafeUnpin for SceneRenderer
where *const ArcInner<Scene> is !null: UnsafeUnpin, PhantomData<ArcInner<Scene>>: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<Voice>: UnsafeUnpin,

§

impl UnwindSafe for SceneRenderer
where Arc<Scene>: UnwindSafe, RawVecInner: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.