use crate::buffer::AudioBuffer;
use crate::bus::BusLayout;
use crate::editor::Editor;
use crate::events::EventList;
use crate::info::PluginInfo;
use crate::process::{ProcessContext, ProcessStatus};
use truce_params::sample::Sample;
pub trait Plugin: Send + 'static {
type Sample: Sample;
#[must_use]
fn supports_in_place() -> bool
where
Self: Sized,
{
false
}
fn info() -> PluginInfo
where
Self: Sized;
#[must_use]
fn bus_layouts() -> Vec<BusLayout>
where
Self: Sized,
{
vec![BusLayout::stereo()]
}
fn init(&mut self) {}
fn reset(&mut self, sample_rate: f64, max_block_size: usize);
fn process(
&mut self,
buffer: &mut AudioBuffer<Self::Sample>,
events: &EventList,
context: &mut ProcessContext,
) -> ProcessStatus;
fn save_state(&self) -> Vec<u8> {
Vec::new()
}
fn load_state(&mut self, _data: &[u8]) -> Result<(), crate::state::StateLoadError> {
Ok(())
}
fn editor(&mut self) -> Option<Box<dyn Editor>> {
None
}
fn latency(&self) -> u32 {
0
}
fn tail(&self) -> u32 {
0
}
fn get_meter(&self, _meter_id: u32) -> f32 {
0.0
}
}