LevelControl
public class LevelControl : AudioControl
A HAL audio level control object
Remark
This class correponds to objects with base classkAudioLevelControlClassID
-
Undocumented
Declaration
Swift
public override var debugDescription: String { get }
-
Returns the control’s scalar value
Remark
This corresponds to the propertykAudioLevelControlPropertyScalarValue
Declaration
Swift
public func scalarValue() throws -> Float
-
Sets the control’s scalar value
Remark
This corresponds to the propertykAudioLevelControlPropertyScalarValue
Declaration
Swift
public func setScalarValue(_ value: Float) throws
-
Returns the control’s decibel value
Remark
This corresponds to the propertykAudioLevelControlPropertyDecibelValue
Declaration
Swift
public func decibelValue() throws -> Float
-
Sets the control’s decibel value
Remark
This corresponds to the propertykAudioLevelControlPropertyDecibelValue
Declaration
Swift
public func setDecibelValue(_ value: Float) throws
-
Returns the decibel range
Remark
This corresponds to the propertykAudioLevelControlPropertyDecibelRange
Declaration
Swift
public func decibelRange() throws -> ClosedRange<Float>
-
Converts
scalar
to decibels and returns the converted valueRemark
This corresponds to the propertykAudioLevelControlPropertyConvertScalarToDecibels
Declaration
Swift
public func convertToDecibels(fromScalar scalar: Float) throws -> Float
Parameters
scalar
The value to convert
-
Converts
decibels
to scalar and returns the converted valueRemark
This corresponds to the propertykAudioLevelControlPropertyConvertDecibelsToScalar
Declaration
Swift
public func convertToScalar(fromDecibels decibels: Float) throws -> Float
Parameters
decibels
The value to convert
-
Returns
true
ifself
hasselector
Declaration
Swift
public func hasSelector(_ selector: AudioObjectSelector<LevelControl>) -> Bool
Parameters
selector
The selector of the desired property
-
Returns
true
ifselector
is settableThrows
An error ifself
does not have the requested propertyDeclaration
Swift
public func isSelectorSettable(_ selector: AudioObjectSelector<LevelControl>) throws -> Bool
Parameters
selector
The selector of the desired property
-
Registers
block
to be performed whenselector
changesThrows
An error if the property listener could not be registeredDeclaration
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