38 lines
834 B
Rust
38 lines
834 B
Rust
use engine::Engine;
|
|
use lv2::prelude::*;
|
|
use params::ParamStore;
|
|
|
|
#[derive(PortCollection)]
|
|
struct Ports {
|
|
out_l: OutputPort<Audio>,
|
|
out_r: OutputPort<Audio>,
|
|
}
|
|
|
|
#[uri("https://git.yokai.digital/deadYokai/tenko")]
|
|
struct TenkoLv2 {
|
|
engine: Engine,
|
|
}
|
|
|
|
impl Plugin for TenkoLv2 {
|
|
type Ports = Ports;
|
|
type InitFeatures = ();
|
|
type AudioFeatures = ();
|
|
|
|
fn new(info: &PluginInfo, _features: &mut ()) -> Option<Self> {
|
|
let params = ParamStore::new();
|
|
let engine = Engine::new(params, info.sample_rate() as f32);
|
|
Some(Self { engine })
|
|
}
|
|
|
|
fn run(&mut self, ports: &mut Ports, _: &mut (), _: u32) {
|
|
for s in ports.out_l.iter_mut() {
|
|
*s = 0.0;
|
|
}
|
|
for s in ports.out_r.iter_mut() {
|
|
*s = 0.0;
|
|
}
|
|
}
|
|
}
|
|
|
|
lv2_descriptors!(TenkoLv2);
|