#[repr(u8)]pub enum Transform {
Max = 1,
Min = 2,
}
Expand description
Possible transforms for a policy target.
A transform is an operation that is applied to a policy property when the fuchsia.settings.Audio API is used. Multiple transforms of the same time can be active for a single property.
Variants§
Max = 1
Limits the maximum value of an audio stream to a certain level.
Max volume limits are transparent to clients of fuchsia.settings.Audio. Clients will always be able to set the volume to 1.0 (max) to prevent user confusion about not being able to set the volume to max. The internal volume, which is communicated to AudioCore to set the true volume level, will always be clamped to the specified maximum.
Externally, the volume percentage will always be a percentage of the max allowed by policy. For example, if the max limit is set to 0.8, a client setting the volume to 1.0 translates to 0.8 internally. An external volume of 0.5 would be scaled to 0.4 internally.
If a min volume limit is present, the minimum external volume will be the min volume limit divided by the max volume limit. For example, if the max volume limit is 0.8 and the min volume limit is 0.2, the lowest possible external volume is 0.25, since 0.2 is 25% of 0.8. The min range is not transparent to clients to prevent the confusion of volume being at 0% but still being able to hear audio.
Min = 2
Limits the minimum value of an audio stream to a certain level.
If the volume is below the specified minimum level when the policy is added, it will automatically be raised to the specified minimum. Calls to set the volume below the minimum level will not fail, but the actual volume will stay above the specified minimum level.
Note that the minimum volume limit is a limit on the internal “true” volume level. If a maximum volume policy is set, the minimum that clients of fuchsia.settings.Audio will see is higher. See the documentation of the MAX volume transform for more information.
Implementations§
Source§impl Transform
impl Transform
pub fn from_primitive(prim: u8) -> Option<Self>
pub const fn into_primitive(self) -> u8
pub fn is_unknown(&self) -> bool
is_unknown
Trait Implementations§
Source§impl<D: ResourceDialect> Decode<Transform, D> for Transform
impl<D: ResourceDialect> Decode<Transform, D> for Transform
Source§impl Ord for Transform
impl Ord for Transform
Source§impl PartialOrd for Transform
impl PartialOrd for Transform
Source§impl TypeMarker for Transform
impl TypeMarker for Transform
Source§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
Source§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align
.Source§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned
to a single memcpy. Read moreSource§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned
to a single memcpy.Source§impl ValueTypeMarker for Transform
impl ValueTypeMarker for Transform
impl Copy for Transform
impl Eq for Transform
impl StructuralPartialEq for Transform
Auto Trait Implementations§
impl Freeze for Transform
impl RefUnwindSafe for Transform
impl Send for Transform
impl Sync for Transform
impl Unpin for Transform
impl UnwindSafe for Transform
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)