ew cant async because rust reaps thread running tinyaudio need holder

This commit is contained in:
Bel LaPointe
2026-03-13 11:41:36 -06:00
parent f00923b414
commit 6c0b918612

View File

@@ -30,17 +30,40 @@ fn play_with_flags(flags: &flags::Flags) {
));
let mut i = 0;
let mut sync = true;
for p in flags.play.iter() {
for p in play::new(p.clone()) {
syn_seq.append(i as i32, p);
i += 1;
}
}
if i == 0 {
sync = false;
let s: String = prompt!("> ").parse().expect("failed to readline");
panic!("not impl");
let sync = i > 0;
if !sync {
let mut to_break = false;
let mut payload = vec![];
loop {
let mut s: String = prompt!("> ").parse().expect("failed to readline");
s = s.split_whitespace().join(" ");
payload.push(s.clone());
match s.as_ref() {
"" => match to_break {
false => {
to_break = true;
}
true => {
break;
}
},
_ => {
to_break = false;
}
};
}
for p in play::new(payload.join("\n")) {
syn_seq.append(i as i32, p);
i += 1;
}
}
play(syn_seq, flags.sample_rate, flags.bpm, sync);