wip: vst2 host?

This commit is contained in:
🪞👃🪞 2024-06-20 20:12:26 +03:00
parent 228805d30d
commit 4b0055a21c
7 changed files with 151 additions and 42 deletions

View file

@ -1,17 +1,28 @@
use crate::prelude::*;
pub struct Plugin {
name: String
name: String,
plugin: Option<::vst::host::PluginInstance>
}
impl Plugin {
pub fn new (name: &str) -> Result<DynamicDevice<Self>, Box<dyn Error>> {
Ok(DynamicDevice::new(render, handle, process, Self {
name: name.into()
}))
let device = DynamicDevice::new(render, handle, process, Self {
name: name.into(),
plugin: None,
});
let mut loader = ::vst::host::PluginLoader::load(
&std::path::Path::new("/nix/store/ij3sz7nqg5l7v2dygdvzy3w6cj62bd6r-helm-0.9.0/lib/lxvst/helm.so"),
device.state.clone()
)?;
let plugin = loader.instance()?;
device.state.lock().unwrap().plugin = Some(plugin);
Ok(device)
}
}
impl ::vst::host::Host for Plugin {}
pub fn process (_: &mut Plugin, _: &Client, _: &ProcessScope) -> Control {
Control::Continue
}