Feat: cleanup

This commit is contained in:
2026-02-22 13:28:03 +01:00
parent 3093b40dbc
commit 3d552ec072
26 changed files with 213 additions and 181 deletions

View File

@@ -1,3 +1,5 @@
//! Audio output stream (cpal) and FFT spectrum analysis.
use ringbuf::{traits::*, HeapRb};
use rustfft::{num_complex::Complex, FftPlanner};
use std::sync::atomic::{AtomicBool, AtomicU32, Ordering};
@@ -173,8 +175,8 @@ impl SpectrumAnalyzer {
pub struct AnalysisHandle {
running: Arc<AtomicBool>,
#[allow(dead_code)]
thread: Option<JoinHandle<()>>,
// Held to keep the thread alive until this handle is dropped.
_thread: Option<JoinHandle<()>>,
}
impl Drop for AnalysisHandle {
@@ -202,7 +204,7 @@ pub fn spawn_analysis_thread(
let handle = AnalysisHandle {
running,
thread: Some(thread),
_thread: Some(thread),
};
(producer, handle)