mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 21:26:43 +01:00
chore: tidy
This commit is contained in:
parent
1b7892d11f
commit
f48f17e9a4
8 changed files with 66 additions and 73 deletions
28
src/device/chain/plugin/lv2.rs
Normal file
28
src/device/chain/plugin/lv2.rs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
use crate::prelude::*;
|
||||
use super::*;
|
||||
|
||||
pub fn plug (uri: &str) -> Usually<PluginKind> {
|
||||
let world = ::livi::World::with_load_bundle(&uri);
|
||||
let features = world.build_features(::livi::FeaturesBuilder {
|
||||
min_block_length: 1,
|
||||
max_block_length: 65536,
|
||||
});
|
||||
let mut plugin = None;
|
||||
for p in world.iter_plugins() {
|
||||
plugin = Some(p);
|
||||
break
|
||||
}
|
||||
let plugin = plugin.unwrap();
|
||||
let mut portList = vec![];
|
||||
for port in plugin.ports() {
|
||||
portList.push(port);
|
||||
}
|
||||
Ok(PluginKind::LV2 {
|
||||
instance: unsafe {
|
||||
plugin.instantiate(features.clone(), 48000.0).expect("boop")
|
||||
},
|
||||
portList,
|
||||
features,
|
||||
world,
|
||||
})
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue