From bc7157b7eef457072158d1a250383244cd867005 Mon Sep 17 00:00:00 2001 From: Joshua Parmenter Date: Sun, 28 Jun 2026 15:26:14 -0700 Subject: [PATCH] Reflect input-channel count in the input picker before Start MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Engine config edits (In/Out/Rate) now apply to the stopped engine immediately rather than only at Start, so the input-source picker — which lists 0.. --- .../LyrebirdShoeGazeUI/EngineConfigView.swift | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) 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 {