pub enum GainControlRequest {
SetGain {
payload: GainControlSetGainRequest,
responder: GainControlSetGainResponder,
},
SetMute {
payload: GainControlSetMuteRequest,
responder: GainControlSetMuteResponder,
},
}
Expand description
Enables control and monitoring of audio gain. This interface is typically a tear-off of other interfaces.
§Knobs
This interface exposes two orthogonal knobs:
-
The gain knob controls a single value in “relative decibels”. A value of 0 applies no gain, positive values increase gain, and negative values decrease gain. Depending on context, gain may be applied relative to an input stream or relative to some absolute reference point, such as the maximum loudness of a speaker.
This knob has no defined maximum or minimum value. Individual implementations may clamp to an implementation-defined maximum value or treat all values below an implementation-defined minimum value equivalent to “muted”, but this behavior is not required.
-
The mute knob controls a single boolean value. When
true
, the GainControl is muted and the effective gain is negative infinity. Whenfalse
, gain is controlled by the gain knob.
§Scheduling
Changes to the gain and mute knobs can be scheduled for a time in the future. Scheduling happens on timestamps relative to a reference clock which must be established when this protocol is created.
TODO(https://fxbug.dev/42176154): scheduling semantics are subject to change
Variants§
Implementations§
Source§impl GainControlRequest
impl GainControlRequest
pub fn into_set_gain( self, ) -> Option<(GainControlSetGainRequest, GainControlSetGainResponder)>
pub fn into_set_mute( self, ) -> Option<(GainControlSetMuteRequest, GainControlSetMuteResponder)>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL