AudioEngine pt.3: arranger init with jack

This commit is contained in:
🪞👃🪞 2024-11-03 05:00:29 +02:00
parent 746e29aeb3
commit b1ff549514
4 changed files with 40 additions and 47 deletions

View file

@ -36,12 +36,12 @@ impl JackClient {
}
pub fn activate_with <T: Audio + 'static> (
self,
init: impl FnOnce(&Arc<RwLock<JackClient>>)->T
init: impl FnOnce(&Arc<RwLock<JackClient>>)->Usually<T>
)
-> Usually<Arc<RwLock<T>>>
{
let client = Arc::new(RwLock::new(self));
let target = Arc::new(RwLock::new(init(&client)));
let target = Arc::new(RwLock::new(init(&client)?));
let event = Box::new(move|_|{/*TODO*/}) as Box<dyn Fn(JackEvent) + Send + Sync>;
let events = Notifications(event);
let frame = Box::new({