Skip to main content

Simulator

Trait Simulator 

Source
pub trait Simulator: Send {
    // Required methods
    fn handle(&mut self, msg: &[u8]) -> Vec<Vec<u8>>;
    fn idle_tick(&mut self);
    fn program(&self, slot: u16) -> Option<Vec<u8>>;
    fn edit_buffer(&self) -> Vec<u8> ⓘ;
    fn is_settled(&self) -> bool;
    fn faults(&self) -> &'static [&'static str];
    fn inject(&mut self, fault: &str);
}
Expand description

A sans-IO simulated synth, for tests and demo mode.

Required Methods§

Source

fn handle(&mut self, msg: &[u8]) -> Vec<Vec<u8>>

One complete SysEx message in, the replies out.

Source

fn idle_tick(&mut self)

One firmware main-loop pass with no MIDI traffic.

Source

fn program(&self, slot: u16) -> Option<Vec<u8>>

The program in slot, or None for a slot the synth does not have.

Source

fn edit_buffer(&self) -> Vec<u8> ⓘ

The edit buffer’s program.

Source

fn is_settled(&self) -> bool

No pending save and no corrupted reply state.

Source

fn faults(&self) -> &'static [&'static str]

Failures seen on hardware that Simulator::inject can switch on.

Source

fn inject(&mut self, fault: &str)

Switches on fault, one of Simulator::faults, until the simulator is dropped.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§