Feat: fixing stderr catching and scope not drawing completely

This commit is contained in:
2026-02-23 21:53:53 +01:00
parent 979b7639ac
commit 77b7fa1f9e
4 changed files with 31 additions and 4 deletions

View File

@@ -83,6 +83,7 @@ fn main() -> io::Result<()> {
let mut _stream = b.stream;
let mut _analysis_handle = b.analysis_handle;
let mut midi_rx = b.midi_rx;
let mut stream_error_rx = b.stream_error_rx;
enable_raw_mode()?;
io::stdout().execute(EnableBracketedPaste)?;
@@ -110,6 +111,9 @@ fn main() -> io::Result<()> {
max_voices: app.audio.config.max_voices,
};
let (new_error_tx, new_error_rx) = crossbeam_channel::bounded(16);
stream_error_rx = new_error_rx;
let mut restart_samples = Vec::new();
for path in &app.audio.config.sample_paths {
let index = doux::sampling::scan_samples_dir(path);
@@ -132,6 +136,7 @@ fn main() -> io::Result<()> {
Arc::clone(&metrics),
restart_samples,
Arc::clone(&audio_sample_pos),
new_error_tx,
) {
Ok((new_stream, info, new_analysis, registry)) => {
_stream = Some(new_stream);
@@ -161,6 +166,10 @@ fn main() -> io::Result<()> {
}
}
while let Ok(err) = stream_error_rx.try_recv() {
app.ui.flash(&err, 3000, state::FlashKind::Error);
}
app.playback.playing = playing.load(Ordering::Relaxed);
while let Ok(midi_cmd) = midi_rx.try_recv() {