pub struct ChipParameters { /* private fields */ }Expand description
Parameters detailing how an LSynth chip is intended to operate.
Implementations§
Source§impl ChipParameters
impl ChipParameters
Sourcepub fn new(samplerate: usize, amplitude: f32, tick_rate: f32) -> ChipParameters
pub fn new(samplerate: usize, amplitude: f32, tick_rate: f32) -> ChipParameters
Creates a new set of chip parameters. Tick rate is ticks per second.
Sourcepub fn set_sample_rate(&mut self, samplerate: usize)
pub fn set_sample_rate(&mut self, samplerate: usize)
Sets the samplerate of the chip in hertz.
Sourcepub fn set_tick_rate(&mut self, tick_rate: f32)
pub fn set_tick_rate(&mut self, tick_rate: f32)
Sets the tick rate of the chip in hertz.
Sourcepub fn get_tick_frames(&self) -> f32
pub fn get_tick_frames(&self) -> f32
Returns the number of samples in a single tick.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ChipParameters
impl<'de> Deserialize<'de> for ChipParameters
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ChipParameters
impl RefUnwindSafe for ChipParameters
impl Send for ChipParameters
impl Sync for ChipParameters
impl Unpin for ChipParameters
impl UnwindSafe for ChipParameters
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more