feat(bridge,core): add is_hard_muted and get_output_gain readback (TODO-037)
Add bridge read-back functions for hard-mute state and output gain. Add core output_gain() getter. Document feature gaps in SRS.
This commit is contained in:
@@ -1113,6 +1113,21 @@ impl ChanoraSession {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Read the current master output gain. Returns `1.0` (unity) if
|
||||
/// audio is not started.
|
||||
pub async fn output_gain(&self) -> f32 {
|
||||
let guard = self.inner.lock().await;
|
||||
let state = match guard.as_ref() {
|
||||
Some(s) => s,
|
||||
None => return 1.0,
|
||||
};
|
||||
let audio = match state.audio.as_ref() {
|
||||
Some(a) => a,
|
||||
None => return 1.0,
|
||||
};
|
||||
audio.output_gain()
|
||||
}
|
||||
|
||||
/// Set per-client output volume (SRS-075). `1.0` is unity, `0.0`
|
||||
/// mutes. No-op if audio is not started or client has no active
|
||||
/// voice queue.
|
||||
|
||||
Reference in New Issue
Block a user