pub struct Mixer {
scratch: Scratch,
graph: BusGraph,
order: Vec<u64>,
}Fields§
§scratch: Scratch§graph: BusGraph§order: Vec<u64>graph.order() copied once per block so the flush loop can hold &mut graph.
Implementations§
Source§impl Mixer
impl Mixer
pub fn new() -> Self
Sourcepub fn graph(&self) -> &BusGraph
pub fn graph(&self) -> &BusGraph
The bus graph as of the last mix — the mixer panel reads its meters from here.
Sourcepub fn mix(
&mut self,
project: &Project,
t: f64,
pool: &mut DecoderPool,
out: &mut [f32],
)
pub fn mix( &mut self, project: &Project, t: f64, pool: &mut DecoderPool, out: &mut [f32], )
Mix into out (interleaved stereo, frames = out.len()/2) starting at timeline time t.
out is zeroed first. For each audio track with project.active(track), each enabled clip
overlapping [t, t + frames/48000): read pool.audio(asset.path, clip.audio_stream) at
clip.src_time(..) for the overlapping sub-range, apply clip.volume (ramped linearly from the
value at the block start to the block end), add into the clip’s bus. Buses are then flushed in
evaluation order and the result clamped to [-1, 1].
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Mixer
impl RefUnwindSafe for Mixer
impl Send for Mixer
impl Sync for Mixer
impl Unpin for Mixer
impl UnwindSafe for Mixer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more