MCPcopy Create free account
hub / github.com/altic-dev/FluidVoice / refreshDevices

Method refreshDevices

Sources/Fluid/ContentView.swift:1521–1541  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1519 // Audio settings merged into SettingsView
1520
1521 private func refreshDevices() {
1522 // Query CoreAudio off the main thread — during device topology changes, synchronous
1523 // CoreAudio calls on main can deadlock while the HAL is still settling.
1524 DispatchQueue.global(qos: .userInitiated).async {
1525 let inputs = AudioDevice.listInputDevicesRefreshingLiveness()
1526 let outputs = AudioDevice.listOutputDevices()
1527 let defaultInputUID = AudioDevice.getDefaultInputDevice()?.uid
1528 DispatchQueue.main.async {
1529 self.inputDevices = inputs
1530 self.outputDevices = outputs
1531 if let selectedInput = self.appServices.microphonePreferenceCoordinator
1532 .reconcileMicrophoneSelection(
1533 availableInputs: inputs,
1534 defaultInputUID: defaultInputUID
1535 )
1536 {
1537 self.selectedInputUID = selectedInput.uid
1538 }
1539 }
1540 }
1541 }
1542
1543 private func refreshInputDevices() {
1544 DispatchQueue.global(qos: .userInitiated).async {

Tested by

no test coverage detected