pub struct ChipState {
pub parameters: ChipParameters,
/* private fields */
}
Expand description
The current state of the LSynth chip.
Fields
parameters: ChipParameters
Details how this chip is intended to operate.
Implementations
sourceimpl 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 RefUnwindSafe for ChipState
impl Send for ChipState
impl Sync for ChipState
impl Unpin for ChipState
impl UnwindSafe for ChipState
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more