EarIn

Trait EarIn 

Source
pub trait EarIn {
    // Required methods
    fn set_ear_in(&mut self, ear_in: bool, delta_fts: u32);
    fn feed_ear_in<I: Iterator<Item = NonZeroU32>>(
        &mut self,
        fts_deltas: I,
        max_frames_threshold: Option<usize>,
    );
    fn purge_ear_in_changes(&mut self, ear_in: bool);
    fn read_ear_in_count(&self) -> u32;

    // Provided methods
    fn read_ear_mode(&self) -> ReadEarMode { ... }
    fn set_read_ear_mode(&mut self, _mode: ReadEarMode) { ... }
}
Expand description

A trait for feeding the EAR line input.

Required Methods§

Source

fn set_ear_in(&mut self, ear_in: bool, delta_fts: u32)

Sets EAR IN bit state after the provided interval in ∆ T-states counted from the last recorded change.

Source

fn feed_ear_in<I: Iterator<Item = NonZeroU32>>( &mut self, fts_deltas: I, max_frames_threshold: Option<usize>, )

Feeds the EAR IN buffer with changes.

The provided iterator should yield time intervals measured in T-state ∆ differences after which the state of the EAR IN bit should be toggled.

max_frames_threshold may be optionally provided as a number of frames to limit the buffered changes. This is useful if the given iterator provides data largely exceeding the duration of a single frame.

Source

fn purge_ear_in_changes(&mut self, ear_in: bool)

Removes all buffered so far EAR IN changes.

Changes are usually consumed only when a call is made to crate::chip::ControlUnit::ensure_next_frame. Provide the current value of EAR IN bit as ear_in.

This may be useful when tape data is already buffered but the user decided to stop the tape playback immediately.

Source

fn read_ear_in_count(&self) -> u32

Returns the counter of how many times the EAR input line was read since the beginning of the current frame.

This can be used to help to implement the autoloading of tape data.

Provided Methods§

Source

fn read_ear_mode(&self) -> ReadEarMode

Returns the current mode.

Source

fn set_read_ear_mode(&mut self, _mode: ReadEarMode)

Changes the current mode.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§