pub struct VuMeterConfig {
pub min_level: f32,
pub max_level: f32,
pub update_rate_hz: f32,
pub smoothing_tolerance: f32,
pub max_stale_ms: u64,
}Expand description
VU meter validation parameters
§Example
use jugar_probar::validators::VuMeterConfig;
let config = VuMeterConfig::default()
.with_min_level(0.1)
.with_update_rate_hz(30.0);Fields§
§min_level: f32Minimum expected level (0.0-1.0)
max_level: f32Maximum expected level (0.0-1.0)
update_rate_hz: f32Update frequency (Hz)
smoothing_tolerance: f32Smoothing factor validation tolerance
max_stale_ms: u64Maximum time without updates (staleness)
Implementations§
Source§impl VuMeterConfig
impl VuMeterConfig
Sourcepub fn with_min_level(self, level: f32) -> Self
pub fn with_min_level(self, level: f32) -> Self
Set minimum expected level
Sourcepub fn with_max_level(self, level: f32) -> Self
pub fn with_max_level(self, level: f32) -> Self
Set maximum expected level
Sourcepub fn with_update_rate_hz(self, rate: f32) -> Self
pub fn with_update_rate_hz(self, rate: f32) -> Self
Set expected update rate in Hz
Sourcepub fn with_max_stale_ms(self, ms: u64) -> Self
pub fn with_max_stale_ms(self, ms: u64) -> Self
Set staleness threshold
Sourcepub fn validate_sample(&self, level: f32) -> Result<(), VuMeterError>
pub fn validate_sample(&self, level: f32) -> Result<(), VuMeterError>
Validate a VU meter sample
Trait Implementations§
Source§impl Clone for VuMeterConfig
impl Clone for VuMeterConfig
Source§fn clone(&self) -> VuMeterConfig
fn clone(&self) -> VuMeterConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VuMeterConfig
impl Debug for VuMeterConfig
Auto Trait Implementations§
impl Freeze for VuMeterConfig
impl RefUnwindSafe for VuMeterConfig
impl Send for VuMeterConfig
impl Sync for VuMeterConfig
impl Unpin for VuMeterConfig
impl UnsafeUnpin for VuMeterConfig
impl UnwindSafe for VuMeterConfig
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