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§
Sourcefn get_channel_outputs(&self) -> [f32; 3]
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§
Sourcefn on_cache_refill(&mut self)
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.