pub struct ChipState {
pub parameters: ChipParameters,
/* private fields */
}Expand description
The current state of the LSynth chip.
Fields§
§parameters: ChipParametersDetails how this chip is intended to operate.
Implementations§
Source§impl ChipState
impl ChipState
Sourcepub fn new(channel_count: usize, parameters: ChipParameters) -> ChipState
pub fn new(channel_count: usize, parameters: ChipParameters) -> ChipState
Creates a new LSynth chip.
Sourcepub fn generate(
&mut self,
buffer: &mut [f32],
) -> Result<ChipGenerationData, LSynthError>
pub fn generate( &mut self, buffer: &mut [f32], ) -> Result<ChipGenerationData, LSynthError>
Writes a tick worth of interlaced stereo samples generated by the chip to the start of the provided slice, then returns a struct containing information about how many samples it generated, and how many samples still need to be generated to complete a tick.
If the number of remaining samples is anything but zero, then the tick was not completed. Commands can still be sent at this point, but they will occur in between ticks.
Sourcepub fn send_command(
&mut self,
command: Command,
channel: usize,
) -> Result<(), LSynthError>
pub fn send_command( &mut self, command: Command, channel: usize, ) -> Result<(), LSynthError>
Executes a command on the given channel.
Auto Trait Implementations§
impl Freeze for ChipState
impl RefUnwindSafe for ChipState
impl Send for ChipState
impl Sync for ChipState
impl Unpin for ChipState
impl UnwindSafe for ChipState
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