Struct vst::buffer::SendEventBuffer
source · pub struct SendEventBuffer { /* private fields */ }Expand description
This buffer is used for sending midi events through the VST interface.
The purpose of this is to convert outgoing midi events from event::Event to api::Events.
It only allocates memory in new() and reuses the memory between calls.
Implementations§
source§impl SendEventBuffer
impl SendEventBuffer
sourcepub fn new(capacity: usize) -> Self
pub fn new(capacity: usize) -> Self
Creates a buffer for sending up to the given number of midi events per frame
sourcepub fn send_events<T: IntoIterator<Item = U>, U: WriteIntoPlaceholder>(
&mut self,
events: T,
host: &mut dyn Host
)
pub fn send_events<T: IntoIterator<Item = U>, U: WriteIntoPlaceholder>(
&mut self,
events: T,
host: &mut dyn Host
)
Sends events to the host. See the fwd_midi example.
Example
fn process(&mut self, buffer: &mut AudioBuffer<f32>){
let events: Vec<MidiEvent> = vec![
// ...
];
self.send_buffer.send_events(&events, &mut self.host);
}sourcepub fn store_events<T: IntoIterator<Item = U>, U: WriteIntoPlaceholder>(
&mut self,
events: T
)
pub fn store_events<T: IntoIterator<Item = U>, U: WriteIntoPlaceholder>(
&mut self,
events: T
)
Stores events in the buffer, replacing the buffer’s current content.
Use this in process_events to store received input events, then read them in process using events.