fn determine_volume_limits(&self, target: PropertyTarget) -> VolumeLimits {
        // If the property doesn't have a state, there are no limits, so return the default min
        // and max.
        let mut max_volume: f32 = MAX_VOLUME;
        let mut min_volume: f32 = MIN_VOLUME;

        if let Some(property) = self.state.properties.get(&target) {
            for policy in property.active_policies.iter() {
                match policy.transform {
                    // Only the lowest max volume applies.
                    audio_policy::Transform::Max(max) => max_volume = max_volume.min(max),
                    // Only the highest min volume applies
                    audio_policy::Transform::Min(min) => min_volume = min_volume.max(min),
                }
            }
        }
        VolumeLimits { min_volume, max_volume }
    }
/// Determines the max and min volume levels for the given property based on the active
/// transforms.
///
/// Returns a struct containing the min and max volume limits.
Determines the max and min volume levels for the given property based on the active
transforms.

Returns a struct containing the min and max volume limits.
Determines the max and min volume levels for the given property based on the active transforms . Returns a struct containing the min and max volume limits .
fn determine_volume_limits(&self, target: PropertyTarget) -> VolumeLimits {
        // If the property doesn't have a state, there are no limits, so return the default min
        // and max.
        let mut max_volume: f32 = MAX_VOLUME;
        let mut min_volume: f32 = MIN_VOLUME;
        if let Some(property) = self.state.properties.get(&target) {
            for policy in property.active_policies.iter() {
                match policy.transform {
                    // Only the lowest max volume applies.
                    audio_policy::Transform::Max(max) => max_volume = max_volume.min(max),
                    // Only the highest min volume applies
                    audio_policy::Transform::Min(min) => min_volume = min_volume.max(min),
                }
            }
        }
        VolumeLimits { min_volume, max_volume }
    }
fn determine_volume_limits ( & self , target : PropertyTarget ) -> VolumeLimits { // If the property doesn't have a state, there are no limits, so return the default min // and max. let mut max_volume : f32 = MAX_VOLUME ; let mut min_volume : f32 = MIN_VOLUME ; if let Some ( property ) = self . state . properties . get ( & target ) { for policy in property . active_policies . iter ( ) { match policy . transform { // Only the lowest max volume applies. audio_policy :: Transform :: Max ( max ) => max_volume = max_volume . min ( max ) , // Only the highest min volume applies audio_policy :: Transform :: Min ( min ) => min_volume = min_volume . max ( min ) , } } } VolumeLimits { min_volume , max_volume } }
Determines the max and min volume levels for the given property based on the active
transforms.
Determines the max and min volume levels for the given property based on the active transforms .
&self
target
PropertyTarget
&self
target
PropertyTarget