CacheablePlayer

Trait CacheablePlayer 

Source
pub trait CacheablePlayer: ChiptunePlayerBase {
    // Required method
    fn get_channel_outputs(&self) -> [f32; 3];

    // Provided method
    fn on_cache_refill(&mut self) { ... }
}
Expand description

Trait for players that can be wrapped with caching.

This trait provides the hooks needed by CachedPlayer to interact with the underlying player.

Required Methods§

Source

fn get_channel_outputs(&self) -> [f32; 3]

Get the current channel outputs from the chip.

Returns [channel_a, channel_b, channel_c] as f32 values.

Provided Methods§

Source

fn on_cache_refill(&mut self)

Called when the cache is about to be refilled.

Override this to perform any pre-fill setup. Default is no-op.

Implementors§