Struct Gain Processor
pub struct GainProcessor { /* private fields */ }Implementations§
§impl GainProcessor
impl GainProcessor
pub fn new(smoothing_ms: f64) -> Result<Self, SmoothingError>
pub fn new(smoothing_ms: f64) -> Result<Self, SmoothingError>
Construct an inactive unity-gain processor. Preparation converts this nonnegative, finite duration to samples for the actual sample rate.
pub fn requested_gain(&self) -> f32
pub fn effective_gain(&self) -> f32
pub fn bypassed(&self) -> bool
pub fn meters(&self) -> GainMeters
pub fn meters(&self) -> GainMeters
Last successful nonempty block; zero-frame and rejected blocks retain it.
pub fn parameter_state(&self) -> ParameterState<'static, 2>
pub fn parameter_state(&self) -> ParameterState<'static, 2>
Capture requested values, excluding smoothing progress and telemetry.
pub fn restore_parameters(
&mut self,
state: &ParameterState<'_, 2>,
) -> Result<(), ParameterError>
pub fn restore_parameters( &mut self, state: &ParameterState<'_, 2>, ) -> Result<(), ParameterError>
Restore a complete gain/bypass snapshot, snapping smoothing. Schema and values are revalidated before mutation, even for a caller-created schema.
Trait Implementations§
§impl Debug for GainProcessor
impl Debug for GainProcessor
§impl Default for GainProcessor
impl Default for GainProcessor
§impl Processor for GainProcessor
impl Processor for GainProcessor
fn prepare(&mut self, config: ProcessConfig) -> Result<(), PrepareError>
fn process(&mut self, block: &mut ProcessBlock<'_, '_, '_>) -> ProcessStatus
fn reset(&mut self)
fn deactivate(&mut self)
§fn start_audio(&mut self) -> Result<(), ProcessError>
fn start_audio(&mut self) -> Result<(), ProcessError>
Optional explicit audio-owner session start, after prepare and before
rendering. Default is a no-op. Consumers using these hooks call once on
the audio owner and stop there before transfer/deactivation. Failure must
leave this processor stopped; earlier successful nodes may be stopped.
Hooks follow prepared callback allocation/locking/I/O obligations. Existing
adapters do not implicitly opt in; explicit graph sessions supply them.
§fn stop_audio(&mut self)
fn stop_audio(&mut self)
End an explicitly started session on its audio owner, without deactivation
or storage destruction. Default no-op; preparation/history may be retained.
§fn try_reset(&mut self) -> Result<(), ProcessError>
fn try_reset(&mut self) -> Result<(), ProcessError>
Attempt history reset without allocating or changing configuration.
Existing processors delegate to their successful legacy reset by default.
A refusal may follow earlier reset work; consumers must remain faulted.
§fn latency_samples(&self) -> u32
fn latency_samples(&self) -> u32
Prepared algorithmic latency in samples. Changes are advertised by adapters
using their format’s restart/latency protocol outside the audio callback.
§fn tail(&self) -> Tail
fn tail(&self) -> Tail
Decay policy after input stops. Adapters must map this to the host protocol.
Auto Trait Implementations§
impl Freeze for GainProcessor
impl RefUnwindSafe for GainProcessor
impl Send for GainProcessor
impl Sync for GainProcessor
impl Unpin for GainProcessor
impl UnsafeUnpin for GainProcessor
impl UnwindSafe for GainProcessor
Blanket Implementations§
impl<T> AutoreleaseSafe for T
§impl<T> BorrowMut<T> for T
impl<T> BorrowMut<T> for T
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more