LevelControl

public class LevelControl : AudioControl

A HAL audio level control object

Remark

This class correponds to objects with base class kAudioLevelControlClassID
  • Undocumented

    Declaration

    Swift

    public override var debugDescription: String { get }
  • Returns the control’s scalar value

    Remark

    This corresponds to the property kAudioLevelControlPropertyScalarValue

    Declaration

    Swift

    public func scalarValue() throws -> Float
  • Sets the control’s scalar value

    Remark

    This corresponds to the property kAudioLevelControlPropertyScalarValue

    Declaration

    Swift

    public func setScalarValue(_ value: Float) throws
  • Returns the control’s decibel value

    Remark

    This corresponds to the property kAudioLevelControlPropertyDecibelValue

    Declaration

    Swift

    public func decibelValue() throws -> Float
  • Sets the control’s decibel value

    Remark

    This corresponds to the property kAudioLevelControlPropertyDecibelValue

    Declaration

    Swift

    public func setDecibelValue(_ value: Float) throws
  • Returns the decibel range

    Remark

    This corresponds to the property kAudioLevelControlPropertyDecibelRange

    Declaration

    Swift

    public func decibelRange() throws -> ClosedRange<Float>
  • Converts scalar to decibels and returns the converted value

    Remark

    This corresponds to the property kAudioLevelControlPropertyConvertScalarToDecibels

    Declaration

    Swift

    public func convertToDecibels(fromScalar scalar: Float) throws -> Float

    Parameters

    scalar

    The value to convert

  • Converts decibels to scalar and returns the converted value

    Remark

    This corresponds to the property kAudioLevelControlPropertyConvertDecibelsToScalar

    Declaration

    Swift

    public func convertToScalar(fromDecibels decibels: Float) throws -> Float

    Parameters

    decibels

    The value to convert

  • Returns true if self has selector

    Declaration

    Swift

    public func hasSelector(_ selector: AudioObjectSelector<LevelControl>) -> Bool

    Parameters

    selector

    The selector of the desired property

  • Returns true if selector is settable

    Throws

    An error if self does not have the requested property

    Declaration

    Swift

    public func isSelectorSettable(_ selector: AudioObjectSelector<LevelControl>) throws -> Bool

    Parameters

    selector

    The selector of the desired property

  • Registers block to be performed when selector changes

    Throws

    An error if the property listener could not be registered

    Declaration

    Swift

    public func whenSelectorChanges(_ selector: AudioObjectSelector<LevelControl>, perform block: PropertyChangeNotificationBlock?) throws

    Parameters

    selector

    The selector of the desired property

    block

    A closure to invoke when the property changes or nil to remove the previous value