#[repr(C)]pub struct Events {
pub num_events: i32,
pub _reserved: isize,
pub events: [*mut Event; 2],
}
Expand description
A struct which contains events.
Fields§
§num_events: i32
Number of events.
_reserved: isize
Reserved for future use. Should be 0.
events: [*mut Event; 2]
Variable-length array of pointers to api::Event
objects.
The VST standard specifies a variable length array of initial size 2. If there are more than 2 elements a larger array must be stored in this structure.
Implementations§
source§impl Events
impl Events
sourcepub fn events<'a>(&'a self) -> impl Iterator<Item = Event<'a>>
pub fn events<'a>(&'a self) -> impl Iterator<Item = Event<'a>>
Use this in your impl of process_events() to process the incoming midi events.
Example
fn process_events(&mut self, events: &api::Events) {
for e in events.events() {
match e {
Event::Midi(MidiEvent { data, .. }) => {
// ...
}
_ => ()
}
}
}