Struct rsynth::backend::vst_backend::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) -> 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 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