Add audio visualizer backend infrastructure
- Add spectrum-analyzer crate for FFT processing - Create visualizer module with: - RingBuffer: lockless SPSC buffer for audio samples - FFT processor: dedicated thread for spectrum analysis - TappedSource: rodio Source wrapper for sample capture - VisualizerTap: shared state for audio thread integration - Add Tauri commands: set_visualizer_enabled, is_visualizer_enabled - Register visualizer in AppState and lib.rs Backend compiles. Next: integrate with audio thread to capture samples.
This commit is contained in:
1 parent
5a93ac509d
commit
b8cfcfb34a
8 files changed
+614
No files matched your search
@@ -24,6 +24,7 @@ pub mod search;
|
||||
pub mod share;
|
||||
pub mod smart_playlists;
|
||||
pub mod remote_metadata;
|
||||
pub mod visualizer;
|
||||
|
||||
pub use audio_backends::*;
|
||||
pub use audio_diagnostics::*;
|
||||
@@ -47,3 +48,4 @@ pub use search::*;
|
||||
pub use share::*;
|
||||
pub use smart_playlists::*;
|
||||
pub use remote_metadata::*;
|
||||
pub use visualizer::*;
|
||||
@@ -0,0 +1,19 @@
|
||||
//! Visualizer Commands
|
||||
//!
|
||||
//! Tauri commands for controlling the audio visualizer.
|
||||
|
||||
use tauri::State;
|
||||
use crate::AppState;
|
||||
|
||||
/// Enable or disable the audio visualizer
|
||||
#[tauri::command]
|
||||
pub fn set_visualizer_enabled(enabled: bool, state: State<'_, AppState>) -> Result<(), String> {
|
||||
state.visualizer.set_enabled(enabled);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Check if the visualizer is enabled
|
||||
#[tauri::command]
|
||||
pub fn is_visualizer_enabled(state: State<'_, AppState>) -> bool {
|
||||
state.visualizer.is_enabled()
|
||||
}
|
||||
Reference in new issue
Block a user