remove Atom. almost there

This commit is contained in:
🪞👃🪞 2025-01-18 15:37:53 +01:00
parent dc7b713108
commit cf1fd5b45a
20 changed files with 539 additions and 739 deletions

View file

@ -257,19 +257,19 @@ fn draw_header (state: &Plugin, to: &mut TuiOut, x: u16, y: u16, w: u16) {
//}
//});
from_atom!("plugin/lv2" => |jack: &Arc<RwLock<JackConnection>>, args| -> Plugin {
let mut name = String::new();
let mut path = String::new();
atom!(atom in args {
Atom::Map(map) => {
if let Some(Atom::Str(n)) = map.get(&Atom::Key(":name")) {
name = String::from(*n);
}
if let Some(Atom::Str(p)) = map.get(&Atom::Key(":path")) {
path = String::from(*p);
}
},
_ => panic!("unexpected in lv2 '{name}'"),
});
Plugin::new_lv2(jack, &name, &path)
});
//from_atom!("plugin/lv2" => |jack: &Arc<RwLock<JackConnection>>, args| -> Plugin {
//let mut name = String::new();
//let mut path = String::new();
//atom!(atom in args {
//Atom::Map(map) => {
//if let Some(Atom::Str(n)) = map.get(&Atom::Key(":name")) {
//name = String::from(*n);
//}
//if let Some(Atom::Str(p)) = map.get(&Atom::Key(":path")) {
//path = String::from(*p);
//}
//},
//_ => panic!("unexpected in lv2 '{name}'"),
//});
//Plugin::new_lv2(jack, &name, &path)
//});