Skip to main content

EventData

Enum EventData 

Source
#[non_exhaustive]
pub enum EventData<'a> { Midi([u8; 3]), SysEx(&'a [u8]), NoteOn(Note), NoteOff(Note), Expression(NoteExpression), }
Expand description

What an event carries.

Plugins receive notes and expressions in their format’s note events where it has them: CLAP note and note expression events on ports that take the CLAP dialect, and VST3 note events, note expression values, and poly pressure. VST3 names a note by its ID, so a note off or an expression without an ID reaches each note on its key by that note’s ID, and a note started without an ID takes no expression other than pressure. Ports that take MIDI only receive the MIDI 1.0 form of EventData::to_midi; the note ID and the precision beyond 7 bits are lost there, and an expression other than pressure has no such form and is not delivered. Output notes and expressions in a format’s note events become these variants; MIDI output stays MIDI.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Midi([u8; 3])

A MIDI 1.0 channel message. Program change and channel pressure use two bytes; the third is ignored. MPE is MIDI 1.0 on member channels and is delivered as MIDI.

§

SysEx(&'a [u8])

A complete system exclusive message, from its F0 to its F7.

§

NoteOn(Note)

Starts a note with normalized velocity and an optional independent note ID.

§

NoteOff(Note)

Ends the notes it addresses; velocity is the release velocity.

§

Expression(NoteExpression)

Changes an expression of the addressed note or notes.

Implementations§

Source§

impl EventData<'_>

Source

pub fn to_midi(&self) -> Option<[u8; 3]>

The MIDI 1.0 channel message form: the message itself, a note on (with a velocity of at least 1, since 0 would end the note) or note off, or poly pressure for a pressure expression. None for system exclusive data and the other expressions.

Trait Implementations§

Source§

impl<'a> Clone for EventData<'a>

Source§

fn clone(&self) -> Self

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 EventData<'a>

Source§

impl<'a> Debug for EventData<'a>

Source§

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

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

impl<'a> PartialEq for EventData<'a>

Source§

fn eq(&self, other: &Self) -> 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 EventData<'a>

Auto Trait Implementations§

§

impl<'a> Forget for EventData<'a>

§

impl<'a> Freeze for EventData<'a>

§

impl<'a> Move for EventData<'a>

§

impl<'a> RefUnwindSafe for EventData<'a>

§

impl<'a> Send for EventData<'a>

§

impl<'a> Sync for EventData<'a>

§

impl<'a> Unpin for EventData<'a>

§

impl<'a> UnsafeUnpin for EventData<'a>

§

impl<'a> UnwindSafe for EventData<'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.