Add audio output badges and pretty device names
- Add AudioOutputBadges component showing DAC/Exclusive mode status - Badges are reactive to actual player state, not just settings - Add device tooltip on hover showing current output device - Create audioDeviceNames helper for ALSA name to friendly name mapping - Use pretty names in Settings dropdown while storing raw names - Add get_audio_output_status backend command - Store current device name in player SharedState
This commit is contained in:
1 parent
4b07618ed0
commit
dd9d5558fa
7 files changed
+384
-6
No files matched your search
@@ -326,3 +326,24 @@ pub fn get_audio_devices() -> Result<Vec<AudioDevice>, String> {
|
||||
log::info!("Found {} audio output devices", devices.len());
|
||||
Ok(devices)
|
||||
}
|
||||
|
||||
/// Current audio output status
|
||||
#[derive(serde::Serialize)]
|
||||
pub struct AudioOutputStatus {
|
||||
pub device_name: Option<String>,
|
||||
pub is_playing: bool,
|
||||
}
|
||||
|
||||
/// Get current audio output status (what device is actually being used)
|
||||
#[tauri::command]
|
||||
pub fn get_audio_output_status(
|
||||
state: tauri::State<'_, crate::AppState>,
|
||||
) -> Result<AudioOutputStatus, String> {
|
||||
let device_name = state.player.state.current_device();
|
||||
let is_playing = state.player.state.is_playing();
|
||||
|
||||
Ok(AudioOutputStatus {
|
||||
device_name,
|
||||
is_playing,
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user