pub trait Stop: HostInterface { }
Expand description
A marker trait that indicates that the backend can be stopped.
Example
The following illustrates a plugin that works with backends that support stopping.
Based on some condition (plugin_has_finished
), the plugin can signal to the backend
that processing is finished by calling stop()
.
use rsynth::ContextualAudioRenderer;
use rsynth::backend::{HostInterface, Stop};
use rsynth::buffer::AudioBufferInOut;
struct MyPlugin { /* ... */ }
impl<H> ContextualAudioRenderer<f32, H> for MyPlugin
where H: HostInterface + Stop
{
fn render_buffer(
&mut self,
buffer: &mut AudioBufferInOut<f32>,
context: &mut H)
{
let plugin_has_finished = unimplemented!();
if plugin_has_finished {
context.stop();
}
}
}