pub struct ParamModEvent { /* private fields */ }Expand description
Sets a parameter modulation amount.
Implementations§
Source§impl ParamModEvent
impl ParamModEvent
Sourcepub const fn new(
time: u32,
param_id: ClapId,
pckn: Pckn,
amount: f64,
) -> ParamModEvent
pub const fn new( time: u32, param_id: ClapId, pckn: Pckn, amount: f64, ) -> ParamModEvent
Creates a new ParamModEvent from a time stamp, a parameter ID, a Pckn target and
a parameter modulation amount.
Sourcepub const fn param_id(&self) -> Option<ClapId>
pub const fn param_id(&self) -> Option<ClapId>
Returns the parameter ID this event targets.
This returns None if the parameter ID is invalid.
Sourcepub const fn set_param_id(&mut self, param_id: ClapId)
pub const fn set_param_id(&mut self, param_id: ClapId)
Sets the parameter ID this event targets.
Sourcepub const fn with_param_id(self, param_id: ClapId) -> ParamModEvent
pub const fn with_param_id(self, param_id: ClapId) -> ParamModEvent
Builds a ParamValueEvent with the given parameter ID target, and returns it.
This is useful to use in a builder-style pattern.
Sourcepub const fn set_amount(&mut self, amount: f64)
pub const fn set_amount(&mut self, amount: f64)
Sets the parameter modulation amount of this event.
Sourcepub const fn with_amount(self, amount: f64) -> ParamModEvent
pub const fn with_amount(self, amount: f64) -> ParamModEvent
Builds a ParamModEvent with the given parameter modulation amount, and returns it.
This is useful to use in a builder-style pattern.
Sourcepub const fn as_raw(&self) -> &clap_event_param_mod
pub const fn as_raw(&self) -> &clap_event_param_mod
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_param_mod
pub const unsafe fn as_raw_mut(&mut self) -> &mut clap_event_param_mod
Returns an exclusive, mutable reference to the 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_param_mod) -> ParamModEvent
pub const fn from_raw(raw: &clap_event_param_mod) -> ParamModEvent
Creates a new 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 event type.
Sourcepub const fn from_raw_ref(raw: &clap_event_param_mod) -> &ParamModEvent
pub const fn from_raw_ref(raw: &clap_event_param_mod) -> &ParamModEvent
Creates a reference to an 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 event type.
Sourcepub const fn from_raw_mut(raw: &mut clap_event_param_mod) -> &mut ParamModEvent
pub const fn from_raw_mut(raw: &mut clap_event_param_mod) -> &mut ParamModEvent
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.
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) -> ParamModEvent
pub const fn with_pckn(self, pckn: Pckn) -> ParamModEvent
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>) -> ParamModEvent
pub const fn with_port_index(self, port_index: Match<u16>) -> ParamModEvent
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>) -> ParamModEvent
pub const fn with_channel(self, channel: Match<u16>) -> ParamModEvent
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>) -> ParamModEvent
pub const fn with_key(self, key: Match<u16>) -> ParamModEvent
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>) -> ParamModEvent
pub const fn with_note_id(self, note_id: Match<u32>) -> ParamModEvent
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.
The Cookie sent alongside this event.
Builds a ParamValueEvent with the given Cookie, and returns it.
This is useful to use in a builder-style pattern.
§Safety
Users must ensure that this cookie is either Cookie::empty(), or matches this event’s
target parameter’s current cookie when this event is delivered to the plugin.
Trait Implementations§
Source§impl AsRef<UnknownEvent> for ParamModEvent
impl AsRef<UnknownEvent> for ParamModEvent
Source§fn as_ref(&self) -> &UnknownEvent
fn as_ref(&self) -> &UnknownEvent
Source§impl Clone for ParamModEvent
impl Clone for ParamModEvent
Source§fn clone(&self) -> ParamModEvent
fn clone(&self) -> ParamModEvent
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 ParamModEvent
Source§impl Debug for ParamModEvent
impl Debug for ParamModEvent
Source§impl Event for ParamModEvent
impl Event for ParamModEvent
Source§const TYPE_ID: u16 = CLAP_EVENT_PARAM_MOD
const TYPE_ID: u16 = CLAP_EVENT_PARAM_MOD
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.