AudioClockDevice
public class AudioClockDevice : AudioObject
A HAL audio clock device object
This class has a single scope (kAudioObjectPropertyScopeGlobal
) and a single element (kAudioObjectPropertyElementMaster
)
Remark
This class correponds to objects with base classkAudioClockDeviceClassID
-
Returns the available audio clock devices
Remark
This corresponds to the propertykAudioHardwarePropertyClockDeviceList
onkAudioObjectSystemObject
Declaration
Swift
public class func clockDevices() throws -> [AudioClockDevice]
-
Returns an initialized
AudioClockDevice
withuid
ornil
if unknownRemark
This corresponds to the propertykAudioHardwarePropertyTranslateUIDToClockDevice
onkAudioObjectSystemObject
Declaration
Swift
public class func makeClockDevice(forUID uid: String) throws -> AudioClockDevice?
Parameters
uid
The UID of the desired clock device
-
Returns the clock device UID
Remark
This corresponds to the propertykAudioClockDevicePropertyDeviceUID
Declaration
Swift
public func deviceUID() throws -> String
-
Returns the transport type
Remark
This corresponds to the propertykAudioClockDevicePropertyTransportType
Declaration
Swift
public func transportType() throws -> AudioDevice.TransportType
-
Returns the domain
Remark
This corresponds to the propertykAudioClockDevicePropertyClockDomain
Declaration
Swift
public func domain() throws -> UInt32
-
Returns
true
if the clock device is aliveRemark
This corresponds to the propertykAudioClockDevicePropertyDeviceIsAlive
Declaration
Swift
public func isAlive() throws -> Bool
-
Returns
true
if the clock device is runningRemark
This corresponds to the propertykAudioClockDevicePropertyClockDomain
Declaration
Swift
public func isRunning() throws -> Bool
-
Returns the latency
Remark
This corresponds to the propertykAudioClockDevicePropertyDeviceIsRunning
Declaration
Swift
public func latency() throws -> UInt32
-
Returns the audio controls owned by
self
Remark
This corresponds to the propertykAudioClockDevicePropertyControlList
Declaration
Swift
public func controlList() throws -> [AudioControl]
-
Returns the sample rate
Remark
This corresponds to the propertykAudioClockDevicePropertyNominalSampleRate
Declaration
Swift
public func sampleRate() throws -> Double
-
Returns the available sample rates
Remark
This corresponds to the propertykAudioClockDevicePropertyAvailableNominalSampleRates
Declaration
Swift
public func availableSampleRates() throws -> [ClosedRange<Double>]
-
Returns
true
ifself
hasselector
Declaration
Swift
public func hasSelector(_ selector: AudioObjectSelector<AudioClockDevice>) -> 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<AudioClockDevice>) 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<AudioClockDevice>, 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