Feat: integrating workshop fixes
All checks were successful
Deploy Website / deploy (push) Has been skipped

This commit is contained in:
2026-03-03 19:46:50 +01:00
parent 16d6d76422
commit e8cf8c506b
15 changed files with 119 additions and 8387 deletions

View File

@@ -161,6 +161,7 @@ struct CagireDesktop {
_input_stream: Option<cpal::Stream>,
_analysis_handle: Option<AnalysisHandle>,
midi_rx: Receiver<MidiCommand>,
device_lost: Arc<AtomicBool>,
stream_error_rx: crossbeam_channel::Receiver<String>,
current_font: FontChoice,
zoom_factor: f32,
@@ -207,6 +208,7 @@ impl CagireDesktop {
_input_stream: b.input_stream,
_analysis_handle: b.analysis_handle,
midi_rx: b.midi_rx,
device_lost: b.device_lost,
stream_error_rx: b.stream_error_rx,
current_font,
zoom_factor,
@@ -277,6 +279,7 @@ impl CagireDesktop {
Arc::clone(&self.audio_sample_pos),
new_error_tx,
&self.app.audio.config.sample_paths,
Arc::clone(&self.device_lost),
) {
Ok((new_stream, new_input, info, new_analysis, registry)) => {
self._stream = Some(new_stream);
@@ -373,6 +376,11 @@ impl eframe::App for CagireDesktop {
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
self.handle_audio_restart();
if self.device_lost.load(Ordering::Acquire) {
self.device_lost.store(false, Ordering::Release);
self.app.audio.restart_pending = true;
}
while let Ok(err) = self.stream_error_rx.try_recv() {
self.app.ui.flash(&err, 3000, cagire::state::FlashKind::Error);
}