diff --git a/Sources/LyrebirdShoeGazeUI/EngineConfigView.swift b/Sources/LyrebirdShoeGazeUI/EngineConfigView.swift index d96e8c6..52eb50b 100644 --- a/Sources/LyrebirdShoeGazeUI/EngineConfigView.swift +++ b/Sources/LyrebirdShoeGazeUI/EngineConfigView.swift @@ -123,6 +123,32 @@ public struct EngineConfigView: View { pendingInputs = shoeGaze.engine.numInputChannels pendingOutputs = shoeGaze.engine.numOutputChannels } + // Apply config edits to the (stopped) engine immediately so dependent UI — notably the + // input-source picker, which lists `0.. Void = applyConfig { + try applyConfig(pendingSampleRate, pendingInputs, pendingOutputs) + } else { + try shoeGaze.reconfigureEngine( + sampleRate: pendingSampleRate, + inputChannels: pendingInputs, + outputChannels: pendingOutputs + ) + } + onConfigApplied() + } catch { + print("[EngineConfigView] live reconfigure failed: \(error)") + } } private func label(_ text: String) -> some View {