[][src]Struct resid::Sid

pub struct Sid { /* fields omitted */ }

Methods

impl Sid[src]

pub fn new(chip_model: ChipModel) -> Self[src]

pub fn set_sampling_parameters(
    &mut self,
    method: SamplingMethod,
    clock_freq: u32,
    sample_freq: u32
)
[src]

pub fn clock(&mut self)[src]

pub fn clock_delta(&mut self, delta: u32)[src]

pub fn enable_external_filter(&mut self, enabled: bool)[src]

pub fn enable_filter(&mut self, enabled: bool)[src]

pub fn input(&mut self, sample: i32)[src]

pub fn output(&self) -> i16[src]

pub fn reset(&mut self)[src]

pub fn sample(
    &mut self,
    delta: u32,
    buffer: &mut [i16],
    interleave: usize
) -> (usize, u32)
[src]

SID clocking with audio sampling. Fixpoint arithmetics is used.

The example below shows how to clock the SID a specified amount of cycles while producing audio output:

This example is not tested
let mut buffer = [0i16; 8192];
while delta > 0 {
    let (samples, next_delta) = self.resid.sample(delta, &mut buffer[..], 1);
    let mut output = self.sound_buffer.lock().unwrap();
    for i in 0..samples {
        output.write(buffer[i]);
    }
    delta = next_delta;
}

pub fn read(&self, reg: u8) -> u8[src]

pub fn write(&mut self, reg: u8, value: u8)[src]

pub fn read_state(&self) -> State[src]

pub fn write_state(&mut self, state: &State)[src]

Auto Trait Implementations

impl Unpin for Sid

impl !Send for Sid

impl !Sync for Sid

impl !UnwindSafe for Sid

impl !RefUnwindSafe for Sid

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = !

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]