#[non_exhaustive]pub struct AudioConfig {
pub sample_rate: f64,
pub max_block_size: usize,
pub process_mode: ProcessMode,
}Expand description
Activation-time configuration handed to reset.
#[non_exhaustive] so future prepare-time fields (a bus layout, host
latency budget) can be added without breaking the reset signature.
Construct with Self::new (defaults to ProcessMode::Realtime)
plus Self::with_process_mode; read the fields directly.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.sample_rate: f64Host sample rate in Hz.
max_block_size: usizeLargest block the host will hand process. Size preallocations
against this - the host never sends a bigger block this activation.
process_mode: ProcessModeHow the host drives audio this activation. See ProcessMode.
Implementations§
Source§impl AudioConfig
impl AudioConfig
Sourcepub fn new(sample_rate: f64, max_block_size: usize) -> Self
pub fn new(sample_rate: f64, max_block_size: usize) -> Self
New config at the default ProcessMode::Realtime. Chain
Self::with_process_mode for an offline / buffered activation.
Sourcepub fn with_process_mode(self, mode: ProcessMode) -> Self
pub fn with_process_mode(self, mode: ProcessMode) -> Self
Set the processing mode for this activation.
Trait Implementations§
Source§impl Clone for AudioConfig
impl Clone for AudioConfig
Source§fn clone(&self) -> AudioConfig
fn clone(&self) -> AudioConfig
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 moreimpl Copy for AudioConfig
Source§impl Debug for AudioConfig
impl Debug for AudioConfig
Source§impl PartialEq for AudioConfig
impl PartialEq for AudioConfig
impl StructuralPartialEq for AudioConfig
Auto Trait Implementations§
impl Freeze for AudioConfig
impl RefUnwindSafe for AudioConfig
impl Send for AudioConfig
impl Sync for AudioConfig
impl Unpin for AudioConfig
impl UnsafeUnpin for AudioConfig
impl UnwindSafe for AudioConfig
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