pub enum Action {
Midi {
data: [u8; 3],
len: u8,
},
CcCycle {
cc: u8,
channel: u8,
reverse: bool,
},
SetLed {
color: Color,
animation: LedAnimation,
},
Delay(u16),
PresetSelect(u8),
PresetNext,
PresetPrev,
BankUp,
BankDown,
TapTempo,
}Variants§
Midi
Raw MIDI message (1-3 bytes, pre-encoded by CLI).
Use midi2::BytesMessage::try_from(&data[..len]) for structured debug output.
CcCycle
CC cycling through button’s cycle_values list on each press (stateful)
SetLed
Set LED state (for sequencing LED changes in action lists)
Delay(u16)
Delay in ms between actions in a sequence
PresetSelect(u8)
Switch to preset by index
PresetNext
Next preset
PresetPrev
Previous preset
BankUp
Bank up (scroll preset page)
BankDown
Bank down
TapTempo
Tap tempo: updates MIDI clock BPM from press intervals. Averages the last 3 intervals (needs 4 taps). Resets after 2s idle.
Implementations§
Source§impl Action
impl Action
Sourcepub fn cc(cc: u8, value: u8, channel: u8) -> Option<Self>
pub fn cc(cc: u8, value: u8, channel: u8) -> Option<Self>
Control Change (status 0xBn).
Returns None if cc > 127, value > 127, or channel not in 1..=16.
Sourcepub fn program_change(program: u8, channel: u8) -> Option<Self>
pub fn program_change(program: u8, channel: u8) -> Option<Self>
Program Change (status 0xCn).
Returns None if program > 127 or channel not in 1..=16.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Action
impl<'de> Deserialize<'de> for Action
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Action
impl StructuralPartialEq for Action
Auto Trait Implementations§
impl Freeze for Action
impl RefUnwindSafe for Action
impl Send for Action
impl Sync for Action
impl Unpin for Action
impl UnsafeUnpin for Action
impl UnwindSafe for Action
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