Skip to main content

CoreEventSpace

Enum CoreEventSpace 

Source
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>

Source§

fn clone(&self) -> CoreEventSpace<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for CoreEventSpace<'a>

Source§

impl Debug for CoreEventSpace<'_>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'a> EventSpace<'a> for CoreEventSpace<'a>

Source§

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§

const NAME: &'static CStr = c""

The specified name of this event space. Read more
Source§

fn as_unknown(&self) -> &'a UnknownEvent

Returns this event as a type-erased UnknownEvent.
Source§

impl<'a> PartialEq for CoreEventSpace<'a>

Source§

fn eq(&self, other: &CoreEventSpace<'a>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<'a> StructuralPartialEq for CoreEventSpace<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for CoreEventSpace<'a>

§

impl<'a> RefUnwindSafe for CoreEventSpace<'a>

§

impl<'a> Send for CoreEventSpace<'a>

§

impl<'a> Sync for CoreEventSpace<'a>

§

impl<'a> Unpin for CoreEventSpace<'a>

§

impl<'a> UnsafeUnpin for CoreEventSpace<'a>

§

impl<'a> UnwindSafe for CoreEventSpace<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.