pub struct NoteEndEvent { /* private fields */ }Expand description
An event sent by the plugin to the host to indicate that a note has finished playing.
The port, channel, key, and note_id are those given by the host in the NoteOnEvent.
This event is useful to help the host match the plugin’s voice life time, especially when
using polyphonic modulations, as only the plugin knows when a voice is truly finished.
Implementations§
Source§impl NoteEndEvent
impl NoteEndEvent
Sourcepub const fn new(time: u32, pckn: Pckn) -> NoteEndEvent
pub const fn new(time: u32, pckn: Pckn) -> NoteEndEvent
Creates a new NoteEndEvent from a time stamp and a Pckn target.
Sourcepub const fn pckn(&self) -> Pckn
pub const fn pckn(&self) -> Pckn
The Pckn tuple indicating which note(s) this note event targets.
Sourcepub const fn with_pckn(self, pckn: Pckn) -> NoteEndEvent
pub const fn with_pckn(self, pckn: Pckn) -> NoteEndEvent
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.
Sourcepub const fn port_index(&self) -> Match<u16>
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.
Sourcepub const fn set_port_index(&mut self, port_index: Match<u16>)
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.
Sourcepub const fn with_port_index(self, port_index: Match<u16>) -> NoteEndEvent
pub const fn with_port_index(self, port_index: Match<u16>) -> NoteEndEvent
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.
Sourcepub const fn channel(&self) -> Match<u16>
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.
Sourcepub const fn set_channel(&mut self, channel: Match<u16>)
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.
Sourcepub const fn with_channel(self, channel: Match<u16>) -> NoteEndEvent
pub const fn with_channel(self, channel: Match<u16>) -> NoteEndEvent
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.
Sourcepub const fn key(&self) -> Match<u16>
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.
Sourcepub const fn set_key(&mut self, key: Match<u16>)
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.
Sourcepub const fn with_key(self, key: Match<u16>) -> NoteEndEvent
pub const fn with_key(self, key: Match<u16>) -> NoteEndEvent
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.
Sourcepub const fn note_id(&self) -> Match<u32>
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.
Sourcepub const fn set_note_id(&mut self, note_id: Match<u32>)
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.
Sourcepub const fn with_note_id(self, note_id: Match<u32>) -> NoteEndEvent
pub const fn with_note_id(self, note_id: Match<u32>) -> NoteEndEvent
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.
Sourcepub const fn as_raw(&self) -> &clap_event_note
pub const fn as_raw(&self) -> &clap_event_note
Returns a shared reference to the underlying raw, C-FFI compatible event struct.
Sourcepub const unsafe fn as_raw_mut(&mut self) -> &mut clap_event_note
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.
Sourcepub const fn from_raw(raw: &clap_event_note) -> NoteEndEvent
pub const fn from_raw(raw: &clap_event_note) -> NoteEndEvent
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.
Sourcepub const fn from_raw_ref(raw: &clap_event_note) -> &NoteEndEvent
pub const fn from_raw_ref(raw: &clap_event_note) -> &NoteEndEvent
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.
Sourcepub const fn from_raw_mut(raw: &mut clap_event_note) -> &mut NoteEndEvent
pub const fn from_raw_mut(raw: &mut clap_event_note) -> &mut NoteEndEvent
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 NoteEndEvent
impl AsRef<UnknownEvent> for NoteEndEvent
Source§fn as_ref(&self) -> &UnknownEvent
fn as_ref(&self) -> &UnknownEvent
Source§impl Clone for NoteEndEvent
impl Clone for NoteEndEvent
Source§fn clone(&self) -> NoteEndEvent
fn clone(&self) -> NoteEndEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for NoteEndEvent
Source§impl Debug for NoteEndEvent
impl Debug for NoteEndEvent
Source§impl Event for NoteEndEvent
impl Event for NoteEndEvent
Source§const TYPE_ID: u16 = CLAP_EVENT_NOTE_END
const TYPE_ID: u16 = CLAP_EVENT_NOTE_END
Source§type EventSpace<'a> = CoreEventSpace<'a>
type EventSpace<'a> = CoreEventSpace<'a>
Source§fn flags(&self) -> EventFlags
fn flags(&self) -> EventFlags
EventFlags of this event.Source§fn set_flags(&mut self, flags: EventFlags)
fn set_flags(&mut self, flags: EventFlags)
EventFlags of this event.Source§fn with_flags(self, flags: EventFlags) -> Self
fn with_flags(self, flags: EventFlags) -> Self
EventFlags, and returns it. Read moreSource§fn with_time(self, time: u32) -> Self
fn with_time(self, time: u32) -> Self
Source§fn header(&self) -> &EventHeader<Self>
fn header(&self) -> &EventHeader<Self>
Source§fn header_mut(&mut self) -> &mut EventHeader<Self>
fn header_mut(&mut self) -> &mut EventHeader<Self>
Source§fn as_unknown(&self) -> &UnknownEvent
fn as_unknown(&self) -> &UnknownEvent
UnknownEvent.