pub struct ChannelState { /* private fields */ }Expand description
Runtime state of a mixer channel
Implementations§
Source§impl ChannelState
impl ChannelState
Sourcepub fn new(config: ChannelConfig) -> Self
pub fn new(config: ChannelConfig) -> Self
Create a new channel state
Sourcepub fn process_mono(&mut self, input: f32) -> (f32, f32)
pub fn process_mono(&mut self, input: f32) -> (f32, f32)
Process a mono sample through the channel with pan
Sourcepub fn process_stereo(&mut self, left: f32, right: f32) -> (f32, f32)
pub fn process_stereo(&mut self, left: f32, right: f32) -> (f32, f32)
Process a stereo sample through the channel
Sourcepub fn set_config(&mut self, config: ChannelConfig)
pub fn set_config(&mut self, config: ChannelConfig)
Update configuration
Sourcepub fn config(&self) -> &ChannelConfig
pub fn config(&self) -> &ChannelConfig
Get current configuration
Sourcepub fn set_smoothing(&mut self, factor: f32)
pub fn set_smoothing(&mut self, factor: f32)
Set smoothing factor (0.0 = instant, 1.0 = very slow)
Sourcepub fn current_volume(&self) -> f32
pub fn current_volume(&self) -> f32
Get current volume (after smoothing)
Sourcepub fn current_pan(&self) -> f32
pub fn current_pan(&self) -> f32
Get current pan (after smoothing)
Trait Implementations§
Source§impl Clone for ChannelState
impl Clone for ChannelState
Source§fn clone(&self) -> ChannelState
fn clone(&self) -> ChannelState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ChannelState
impl RefUnwindSafe for ChannelState
impl Send for ChannelState
impl Sync for ChannelState
impl Unpin for ChannelState
impl UnsafeUnpin for ChannelState
impl UnwindSafe for ChannelState
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