+7
-4
src/app.rs
+7
-4
src/app.rs
···
301
301
let mut last_poll = Instant::now();
302
302
303
303
loop {
304
-
let audio_frame = self.frame_rx.recv().unwrap();
305
-
let channels =
306
-
stream_to_matrix(audio_frame.data.iter().cloned(), audio_frame.channels, 1.);
304
+
let channels = (!self.graph.pause)
305
+
.then(|| self.frame_rx.recv().unwrap())
306
+
.map(|audio_frame| {
307
+
stream_to_matrix(audio_frame.data.iter().cloned(), audio_frame.channels, 1.)
308
+
});
307
309
308
310
fps += 1;
309
311
···
321
323
datasets.append(&mut current_display.references(&graph));
322
324
}
323
325
}
324
-
if let Some(current_display) = self.current_display_mut() {
326
+
if let Some((current_display, channels)) = self.current_display_mut().zip(channels)
327
+
{
325
328
datasets.append(&mut current_display.process(&graph, &channels));
326
329
}
327
330
terminal