pub enum CoreEventSpace<'a> {
Show 13 variants
NoteOn(&'a NoteOnEvent),
NoteOff(&'a NoteOffEvent),
NoteChoke(&'a NoteChokeEvent),
NoteEnd(&'a NoteEndEvent),
NoteExpression(&'a NoteExpressionEvent),
ParamValue(&'a ParamValueEvent),
ParamMod(&'a ParamModEvent),
ParamGestureBegin(&'a ParamGestureBeginEvent),
ParamGestureEnd(&'a ParamGestureEndEvent),
Transport(&'a TransportEvent),
Midi(&'a MidiEvent),
Midi2(&'a Midi2Event),
MidiSysEx(&'a MidiSysExEvent),
}Expand description
Core CLAP event set.
This enum represents the standard events defined in the CLAP specification
(e.g. NoteOnEvent, ParamValueEvent).
It can be constructed from an UnknownEvent when the event is one of the core types.
§Example
Converting from UnknownEvent to a CoreEventSpace:
use clack_common::events::UnknownEvent;
use clack_common::events::spaces::CoreEventSpace;
fn handle_event(event: &UnknownEvent) {
if let Some(ev) = event.as_core_event() {
match ev {
CoreEventSpace::NoteOn(note) => { /* handle note‑on */ }
CoreEventSpace::ParamValue(param) => { /* handle param change */ }
_ => {}
}
}
}Variants§
NoteOn(&'a NoteOnEvent)
A note-on event (key press / attack)
NoteOff(&'a NoteOffEvent)
A note-off event (key release)
NoteChoke(&'a NoteChokeEvent)
A note choke (forcibly ends a note)
NoteEnd(&'a NoteEndEvent)
A note end (natural end of note)
NoteExpression(&'a NoteExpressionEvent)
A note expression change (e.g. per-note pitch)
ParamValue(&'a ParamValueEvent)
A parameter value change
ParamMod(&'a ParamModEvent)
A parameter modulation change
ParamGestureBegin(&'a ParamGestureBeginEvent)
Begin of a gesture (automation touch)
ParamGestureEnd(&'a ParamGestureEndEvent)
End of a gesture (automation release)
Transport(&'a TransportEvent)
Transport info (playhead, tempo, etc.)
Midi(&'a MidiEvent)
MIDI 1.0 event
Midi2(&'a Midi2Event)
MIDI 2.0 event
MidiSysEx(&'a MidiSysExEvent)
MIDI SysEx event
Trait Implementations§
Source§impl<'a> Clone for CoreEventSpace<'a>
impl<'a> Clone for CoreEventSpace<'a>
Source§fn clone(&self) -> CoreEventSpace<'a>
fn clone(&self) -> CoreEventSpace<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<'a> Copy for CoreEventSpace<'a>
Source§impl Debug for CoreEventSpace<'_>
impl Debug for CoreEventSpace<'_>
Source§impl<'a> EventSpace<'a> for CoreEventSpace<'a>
impl<'a> EventSpace<'a> for CoreEventSpace<'a>
Source§unsafe fn from_unknown(event: &'a UnknownEvent) -> Option<CoreEventSpace<'a>>
unsafe fn from_unknown(event: &'a UnknownEvent) -> Option<CoreEventSpace<'a>>
Attempts to reinterpret a raw UnknownEvent as one of the core event types.
Returns None if the event does not belong to this event space.
Source§fn as_unknown(&self) -> &'a UnknownEvent
fn as_unknown(&self) -> &'a UnknownEvent
UnknownEvent.