chore: tidy

This commit is contained in:
🪞👃🪞 2024-06-29 05:39:52 +03:00
parent 1b7892d11f
commit f48f17e9a4
8 changed files with 66 additions and 73 deletions

View 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,
})
}