pub struct Controller { /* private fields */ }Expand description
Implementations§
Source§impl Controller
impl Controller
pub fn new() -> Self
Sourcepub fn with_state(store: PresetStateStore) -> Self
pub fn with_state(store: PresetStateStore) -> Self
Create with a restored state store (from EEPROM/persistence).
Sourcepub fn process(&mut self, event: Event, now_ms: u32, config: &Config) -> Output
pub fn process(&mut self, event: Event, now_ms: u32, config: &Config) -> Output
Process a single input event. Returns all MIDI output, display events, and flags. System actions (preset switch, tap tempo) are handled internally.
Returns true if any button is currently held.
Returns the current button active state (toggle ON / momentary held).
Sourcepub fn active_preset(&self) -> u8
pub fn active_preset(&self) -> u8
Get the active preset index.
Sourcepub fn encoder_values(&self) -> [u8; 2]
pub fn encoder_values(&self) -> [u8; 2]
Get the encoder values.
Sourcepub fn snapshot_store(&self) -> PresetStateStore
pub fn snapshot_store(&self) -> PresetStateStore
Get a snapshot of the state store (with current working state saved). Use this for persistence — the caller decides the serialization format.
Sourcepub fn select_preset(&mut self, preset_idx: u8, config: &Config) -> Output
pub fn select_preset(&mut self, preset_idx: u8, config: &Config) -> Output
Manually switch to a preset (e.g., on boot or from external command). Returns on_enter + recall MIDI in the result.
Sourcepub fn set_encoder_value(&mut self, index: usize, value: u8)
pub fn set_encoder_value(&mut self, index: usize, value: u8)
Set encoder value (for initial state setup from config defaults).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Controller
impl RefUnwindSafe for Controller
impl Send for Controller
impl Sync for Controller
impl Unpin for Controller
impl UnsafeUnpin for Controller
impl UnwindSafe for Controller
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more