mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 21:26:43 +01:00
wip: vst2 host?
This commit is contained in:
parent
228805d30d
commit
4b0055a21c
7 changed files with 151 additions and 42 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue