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) -> SendEventBuffer
pub fn new(capacity: usize) -> SendEventBuffer
Creates a buffer for sending up to the given number of midi events per frame
Sourcepub fn send_events<T, U>(&mut self, events: T, host: &mut dyn Host)where
T: IntoIterator<Item = U>,
U: WriteIntoPlaceholder,
pub fn send_events<T, U>(&mut self, events: T, host: &mut dyn Host)where
T: IntoIterator<Item = U>,
U: WriteIntoPlaceholder,
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 send_events_to_plugin<T, U>(
&mut self,
events: T,
plugin: &mut dyn Plugin,
)where
T: IntoIterator<Item = U>,
U: WriteIntoPlaceholder,
pub fn send_events_to_plugin<T, U>(
&mut self,
events: T,
plugin: &mut dyn Plugin,
)where
T: IntoIterator<Item = U>,
U: WriteIntoPlaceholder,
Sends events from the host to a plugin.
Trait Implementations§
Source§impl Default for SendEventBuffer
impl Default for SendEventBuffer
Source§fn default() -> SendEventBuffer
fn default() -> SendEventBuffer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SendEventBuffer
impl RefUnwindSafe for SendEventBuffer
impl !Send for SendEventBuffer
impl !Sync for SendEventBuffer
impl Unpin for SendEventBuffer
impl UnwindSafe for SendEventBuffer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more