Skip to main content

NoteOffEvent

Struct NoteOffEvent 

Source
pub struct NoteOffEvent { /* private fields */ }
Expand description

A note key released event.

Implementations§

Source§

impl NoteOffEvent

Source

pub const fn new(time: u32, pckn: Pckn, velocity: f64) -> NoteOffEvent

Creates a new NoteOffEvent from a time stamp, a Pckn target, and a velocity.

Source

pub const fn velocity(&self) -> f64

Returns the velocity of this NoteOnEvent.

Source

pub const fn set_velocity(&mut self, velocity: f64)

Sets the velocity of this NoteOnEvent.

Source

pub const fn with_velocity(self, velocity: f64) -> NoteOffEvent

Builds a NoteOffEvent with the given velocity, and returns it.

This is useful to use in a builder-style pattern.

Source

pub const fn pckn(&self) -> Pckn

The Pckn tuple indicating which note(s) this note event targets.

Source

pub const fn set_pckn(&mut self, pckn: Pckn)

Sets the Pckn tuple for this event.

Source

pub const fn with_pckn(self, pckn: Pckn) -> NoteOffEvent

Sets the Pckn tuple for this event.

This method takes and returns ownership of the event, allowing it to be used in a builder-style pattern.

Source

pub const fn port_index(&self) -> Match<u16>

The index of the note port this event targets.

This returns Match::All if this event targets all possible note ports.

Source

pub const fn set_port_index(&mut self, port_index: Match<u16>)

Sets the index of the note port this event targets.

Use Match::All to target all possible note ports.

Source

pub const fn with_port_index(self, port_index: Match<u16>) -> NoteOffEvent

Sets the index of the note port this event targets.

Use Match::All to target all possible note ports.

This method takes and returns ownership of the event, allowing it to be used in a builder-style pattern.

Source

pub const fn channel(&self) -> Match<u16>

The note channel this event targets (0-15).

This returns Match::All if this event targets all possible note channels.

Source

pub const fn set_channel(&mut self, channel: Match<u16>)

Sets the note channel this event targets (0-15).

Use Match::All to target all possible channels.

Source

pub const fn with_channel(self, channel: Match<u16>) -> NoteOffEvent

Sets the note channel this event targets (0-15).

Use Match::All to target all possible channels.

This method takes and returns ownership of the event, allowing it to be used in a builder-style pattern.

Source

pub const fn key(&self) -> Match<u16>

The key of the note(s) this event targets (0-127).

This returns Match::All if this event targets all possible note keys.

Source

pub const fn set_key(&mut self, key: Match<u16>)

Sets the key of the note(s) this event targets (0-127).

Use Match::All to target all possible note keys.

Source

pub const fn with_key(self, key: Match<u16>) -> NoteOffEvent

Sets the key of the note(s) this event targets (0-127).

Use Match::All to target all possible note keys.

This method takes and returns ownership of the event, allowing it to be used in a builder-style pattern.

Source

pub const fn note_id(&self) -> Match<u32>

The specific ID of the Note this event targets.

This returns Match::All if this event doesn’t target a specific note, or doesn’t provide a Note ID.

Source

pub const fn set_note_id(&mut self, note_id: Match<u32>)

Sets the specific ID of the Note this event targets.

Use Match::All to not target a single specific note in particular.

Source

pub const fn with_note_id(self, note_id: Match<u32>) -> NoteOffEvent

Sets the specific ID of the Note this event targets.

Use Match::All to not target a single specific note in particular.

This method takes and returns ownership of the event, allowing it to be used in a builder-style pattern.

Source

pub const fn as_raw(&self) -> &clap_event_note

Returns a shared reference to the underlying raw, C-FFI compatible event struct.

Source

pub const unsafe fn as_raw_mut(&mut self) -> &mut clap_event_note

Returns a mutable reference to the underlying raw, C-FFI compatible event struct.

§Safety

This method allows mutating the event header’s fields, most notably type_, size and space_id.

Modifying those fields may trigger Undefined Behavior, as it can make other readers of this event treat it as a type or size that it is actually not.

Source

pub const fn from_raw(raw: &clap_event_note) -> NoteOffEvent

Creates a new note event of this type from a reference to a raw, C-FFI compatible event struct.

§Panics

This method will panic if the given event struct’s header doesn’t actually match the expected note event type.

Source

pub const fn from_raw_ref(raw: &clap_event_note) -> &NoteOffEvent

Creates a reference to a note event of this type from a reference to a raw, C-FFI compatible event struct.

§Panics

This method will panic if the given event struct’s header doesn’t actually match the expected note event type.

Source

pub const fn from_raw_mut(raw: &mut clap_event_note) -> &mut NoteOffEvent

Creates a mutable reference to a note event of this type from a reference to a raw, C-FFI compatible event struct.

§Panics

This method will panic if the given event struct’s header doesn’t actually match the expected note event type.

Trait Implementations§

Source§

impl AsRef<UnknownEvent> for NoteOffEvent

Source§

fn as_ref(&self) -> &UnknownEvent

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for NoteOffEvent

Source§

fn clone(&self) -> NoteOffEvent

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 Copy for NoteOffEvent

Source§

impl Debug for NoteOffEvent

Source§

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

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

impl Event for NoteOffEvent

Source§

const TYPE_ID: u16 = CLAP_EVENT_NOTE_OFF

The raw event type identifier for this event type. Read more
Source§

type EventSpace<'a> = CoreEventSpace<'a>

The event space this event type is a part of.
Source§

fn flags(&self) -> EventFlags

Returns the EventFlags of this event.
Source§

fn set_flags(&mut self, flags: EventFlags)

Sets the EventFlags of this event.
Source§

fn with_flags(self, flags: EventFlags) -> Self

Builds an event with the given EventFlags, and returns it. Read more
Source§

fn time(&self) -> u32

Returns the time stamp of this event, in samples.
Source§

fn set_time(&mut self, time: u32)

Sets the time stamp of this event, in samples.
Source§

fn with_time(self, time: u32) -> Self

Builds an event with the given time stamp, and returns it. Read more
Source§

fn header(&self) -> &EventHeader<Self>

Returns a shared, immutable reference to this event’s header.
Source§

fn header_mut(&mut self) -> &mut EventHeader<Self>

Returns an exclusive, mutable reference to this event’s header.
Source§

fn as_unknown(&self) -> &UnknownEvent

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

fn raw_header(&self) -> &clap_event_header

Returns a shared, immutable reference to the raw, C-FFI compatible representation of this header’s event.
Source§

unsafe fn raw_header_mut(&mut self) -> &mut clap_event_header

Returns an exclusive, mutable reference to the raw, C-FFI compatible representation of this header’s event. Read more
Source§

impl PartialEq for NoteOffEvent

Source§

fn eq(&self, other: &NoteOffEvent) -> bool

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for NoteOffEvent

Auto Trait Implementations§

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> InputEventBuffer for T
where T: Event,

Source§

fn len(&self) -> u32

Returns the number of events in this list.
Source§

fn get(&self, index: u32) -> Option<&UnknownEvent>

Returns the event at the given index. Read more
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.