feat: show actual stream quality in player UI

Issue #34 - Display actual stream quality, not track metadata

Backend changes:
- Add sample_rate and bit_depth to PlaybackEvent
- Add stream quality tracking to SharedState
- Extract bit_depth from FLAC/M4A headers in streaming path
- Player sets stream quality when decoding audio

Frontend changes:
- Update PlaybackEvent interface with new fields
- Update currentTrack with actual stream quality from backend

This allows the UI to show the actual quality being played (e.g., 44.1kHz
when streaming a 192kHz track at CD Quality) instead of the track's
maximum advertised quality.
This commit is contained in:
vicrodh committed 2026-01-31 23:32:29 -06:00
1 parent 38b7ea7aef
commit 8b7e4dab27
4 files changed
+110 -31

No files matched your search

+4
View File
@@ -382,12 +382,16 @@ pub fn run() {
let should_update_mpris = should_emit || (track_id == 0 && last_track_id != 0);
if should_emit {
let sample_rate = player_state.get_sample_rate();
let bit_depth = player_state.get_bit_depth();
let event = player::PlaybackEvent {
is_playing,
position,
duration,
track_id,
volume,
sample_rate: if sample_rate > 0 { Some(sample_rate) } else { None },
bit_depth: if bit_depth > 0 { Some(bit_depth) } else { None },
};
let _ = app_handle.emit("playback:state", &event);
last_position = position;