feat(audio): expose normalization gain in playback events
Add normalization_gain field to SharedState and PlaybackEvent so the frontend can display whether normalization is actively applied to the current track. The gain factor is stored as AtomicU32 (f32 bits) and emitted with each playback:state event. cc
This commit is contained in:
1 parent
6edd2a3cda
commit
717eb6fed2
2 files changed
+26
No files matched your search
@@ -324,6 +324,7 @@ pub fn run() {
|
||||
queue::RepeatMode::All => "all",
|
||||
queue::RepeatMode::One => "one",
|
||||
};
|
||||
let normalization_gain = player_state.get_normalization_gain();
|
||||
let event = player::PlaybackEvent {
|
||||
is_playing,
|
||||
position,
|
||||
@@ -334,6 +335,7 @@ pub fn run() {
|
||||
bit_depth: if bit_depth > 0 { Some(bit_depth) } else { None },
|
||||
shuffle: Some(shuffle),
|
||||
repeat: Some(repeat.to_string()),
|
||||
normalization_gain,
|
||||
};
|
||||
let _ = app_handle.emit("playback:state", &event);
|
||||
api_server::broadcast_playback_event(&app_handle, &event);
|
||||
|
||||
Reference in new issue
Block a user