P2 leftovers: every inline dialog now audited + one shared sample clamp (review complete bar peer extraction)
Inline-built dialogs were invisible to the accessibility audit - which is exactly how mnemonic-less buttons kept slipping through (the single-instance dialog Andre caught, and now TWO more found by this very change: ManualPeerPrompt's OK/Cancel and ProfileSaveAsPrompt's Cancel had no mnemonics - both fixed). Each inline dialog's construction is split from its ShowDialog into a Build seam, and the audit now covers 15 dialog surfaces (was 8): manual peer prompt, quick profile switch, change password, password manager, profile name prompt, and the service Additional-options window join the eight Form dialogs. Behaviour unchanged. The encoder-boundary clamp is now ONE shared rule (Core SampleClamp) instead of three private copies in MixingEngine / AsioCaptureBackend / PushModeWasapiBackend - and the ASIO copy's up-to-four interlocked increments per frame became one batched add per buffer on the RT thread. Pinned by a new self-test (over-range clamps to exactly +/-1 and counts; +/-1 exactly passes untouched). Gate 61/61. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -19,8 +19,25 @@ internal sealed class QuickProfileSwitchDialog
|
||||
public static string? Show(IReadOnlyList<ProfileEntry> profiles)
|
||||
{
|
||||
if (profiles.Count == 0) return null;
|
||||
var (dialog, list, chosenPath) = Build(profiles);
|
||||
using (dialog)
|
||||
{
|
||||
dialog.Shown += (_, _) =>
|
||||
{
|
||||
BringToForeground(dialog);
|
||||
list.Focus();
|
||||
};
|
||||
return dialog.ShowDialog() == DialogResult.OK ? chosenPath() : null;
|
||||
}
|
||||
}
|
||||
|
||||
using var dialog = new Form
|
||||
/// <summary>Audit seam: the real dialog, built with a placeholder profile, never shown. Inline-built
|
||||
/// dialogs used to be invisible to the accessibility audit — how missing mnemonics slipped through.</summary>
|
||||
internal static Form BuildForAudit() => Build(new[] { new ProfileEntry("Audit profile", "audit", true) }).Dialog;
|
||||
|
||||
private static (Form Dialog, ListBox List, Func<string?> ChosenPath) Build(IReadOnlyList<ProfileEntry> profiles)
|
||||
{
|
||||
var dialog = new Form
|
||||
{
|
||||
Text = "Quick profile switch",
|
||||
AccessibleName = "Quick profile switch",
|
||||
@@ -123,14 +140,7 @@ internal sealed class QuickProfileSwitchDialog
|
||||
}
|
||||
};
|
||||
|
||||
dialog.Shown += (_, _) =>
|
||||
{
|
||||
BringToForeground(dialog);
|
||||
list.Focus();
|
||||
};
|
||||
|
||||
var result = dialog.ShowDialog();
|
||||
return result == DialogResult.OK ? chosenPath : null;
|
||||
return (dialog, list, () => chosenPath);
|
||||
}
|
||||
|
||||
private static void BringToForeground(Form form)
|
||||
|
||||
Reference in New Issue
Block a user