Struct Convolution Transition
pub struct ConvolutionTransition<E: TransitionEngine> { /* private fields */ }Expand description
Audio-owned transition. Between construction and drop, process and reset
perform no allocation, deallocation, locking, I/O or panic: every engine handed
back first has queue capacity reserved (or the one deferred slot), and a
completed fade whose engine has nowhere to go keeps that engine as a silent,
unprocessed outgoing owner until a later block boundary can return it.
Drop behaviour (construct and drop this endpoint outside the audio callback):
dropping it frees its current, outgoing, priming, waiting and deferred engines
on the dropping thread. The three queues, including any engines still queued in the
handoff or returned queue, are freed by whichever endpoint is dropped last. If
the control endpoint is dropped first, process continues: retirements still
move into the (now unread) returned queue and, once it is full, the deferred
slot; nothing is freed until this endpoint is dropped.
Implementations§
§impl<E: TransitionEngine> ConvolutionTransition<E>
impl<E: TransitionEngine> ConvolutionTransition<E>
pub fn process(
&mut self,
input: &[&[E::Sample]],
output: &mut [&mut [E::Sample]],
frames: usize,
) -> Result<TransitionStatus, ConvolutionProcessError>
pub fn process( &mut self, input: &[&[E::Sample]], output: &mut [&mut [E::Sample]], frames: usize, ) -> Result<TransitionStatus, ConvolutionProcessError>
Process the first frames frames of every channel. Channel count, the
maximum and every prefix are admitted before any state changes; a refused
call takes no proposal and leaves histories, fade position and output
unchanged. An admitted call (including frames == 0) first handles at most
one proposal at this block boundary, then renders, blending while a fade
is in progress. Per-frame fade gains are computed once per block.
pub fn reset(&mut self)
pub fn reset(&mut self)
Clear the histories of the current and (if fading) outgoing engines. The fade position, waiting proposal and handoff are unchanged.
With continuity policies, reset also forgets the recorded input history, forgets both delay lines in constant time (alignment delays and output latency unchanged; during a fade the delayed path, old or new, reads zeros for its delay after the reset) and resets a proposal being primed with zero remaining lag, so its fade starts at the next block boundary from empty history.
pub fn latency_samples(&self) -> usize
pub fn latency_samples(&self) -> usize
Current engine latency in frames.
pub fn outgoing_latency_samples(&self) -> Option<usize>
pub fn outgoing_latency_samples(&self) -> Option<usize>
Outgoing engine latency while a fade is in progress.
pub fn tail_samples(&self) -> usize
pub fn tail_samples(&self) -> usize
Largest tail of the current and outgoing engines.
pub fn current_sequence(&self) -> u64
pub fn current_sequence(&self) -> u64
Sequence of the current engine (0 for the initial engine).
pub fn fade_position(&self) -> Option<usize>
pub fn fade_position(&self) -> Option<usize>
Frames into the running fade, if any.
pub fn waiting_sequence(&self) -> Option<u64>
pub fn waiting_sequence(&self) -> Option<u64>
Sequence waiting under MidFadePolicy::LatestWins.
pub fn frames_processed(&self) -> u64
pub fn frames_processed(&self) -> u64
Absolute frames accepted so far (saturating).
pub fn maximum_frames(&self) -> usize
pub fn maximum_frames(&self) -> usize
Maximum frames per call.
pub fn options(&self) -> TransitionOptions
pub fn options(&self) -> TransitionOptions
Fixed configuration.
pub fn continuity(&self) -> TransitionContinuity
pub fn continuity(&self) -> TransitionContinuity
Fixed continuity policies.
pub fn output_latency_samples(&self) -> Option<usize>
pub fn output_latency_samples(&self) -> Option<usize>
Aligned output latency in frames under AlignmentPolicy::DelayLower
(the delay from input to output of the audible signal after the last
processed frame), or None without alignment.
pub fn priming_sequence(&self) -> Option<u64>
pub fn priming_sequence(&self) -> Option<u64>
Sequence being primed under PrimingPolicy::History (delayed fade).
pub fn priming_lag(&self) -> Option<usize>
pub fn priming_lag(&self) -> Option<usize>
Remaining history frames the priming engine lags behind the live input.