From b00a4cbd5ed25a9653ea2ca90092d186504fd1b1 Mon Sep 17 00:00:00 2001 From: gramps Date: Fri, 7 Aug 2026 17:44:16 -0700 Subject: [PATCH] Mic audio UX: realtime read-only meter + mic picker - Meter is a READ-ONLY realtime level display: fill = Math.Min(1, AudioLevel * MicVolume) (AudioLevel = live input from the future mixer, 0 with no input; MicVolume is gain on ambient noise). While the slider is dragged the bar previews the slider position (PreviewMouseLeftButtonDown/Up + LostMouseCapture -> SetVolumeAdjusting); on release it returns to the live level (bounces to 0 with no input). Clicking the meter does nothing. - MicVolume drives MicMuted (read-only, muted <=> volume 0): sliding to 0 flips the speaker to the red slashed mute icon, sliding up from 0 clears it; speaker button runs volume to 0 or restores the prior level (_volumeBeforeMute, default 0.8) and flashes the meter to the restored position for ~300ms (BeginVolumeFlash/EndVolumeFlash DispatcherTimer, cancelled if the slider is grabbed). - MIC label opens MicPickerDialog (WinRT audio-capture device enumeration, mirrors camera picker, no new packages); the chosen voice source name shows left-justified INSIDE the meter bar (fill at 75% opacity so text + ruler markings show through). - New files: Services/IMicrophoneEnumerator, MicrophoneDeviceInfo, WinRtMicrophoneEnumerator; ViewModels/MicPickerViewModel; MicPickerDialog. - Docs updated (ai.md, TASKS.md, Services/index.md, ViewModels/index.md); build 0 warnings, 65 tests passing --- MainWindow.xaml | 126 ++++++++++++++--------- MainWindow.xaml.cs | 32 ++++++ MicPickerDialog.xaml | 90 ++++++++++++++++ MicPickerDialog.xaml.cs | 25 +++++ Services/IMicrophoneEnumerator.cs | 10 ++ Services/MicrophoneDeviceInfo.cs | 13 +++ Services/WinRtMicrophoneEnumerator.cs | 15 +++ Services/index.md | 3 + TASKS.md | 2 +- Themes/Controls.xaml | 65 ++++++++++-- ViewModels/MainViewModel.cs | 142 +++++++++++++++++++++++--- ViewModels/MicPickerViewModel.cs | 86 ++++++++++++++++ ViewModels/index.md | 3 +- ai.md | 2 +- 14 files changed, 536 insertions(+), 78 deletions(-) create mode 100644 MicPickerDialog.xaml create mode 100644 MicPickerDialog.xaml.cs create mode 100644 Services/IMicrophoneEnumerator.cs create mode 100644 Services/MicrophoneDeviceInfo.cs create mode 100644 Services/WinRtMicrophoneEnumerator.cs create mode 100644 ViewModels/MicPickerViewModel.cs diff --git a/MainWindow.xaml b/MainWindow.xaml index c3f3665..6e5b5e5 100644 --- a/MainWindow.xaml +++ b/MainWindow.xaml @@ -753,8 +753,70 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -771,9 +833,20 @@ + Foreground="White" Margin="0,0,24,0"> + + + + + + + + @@ -801,53 +874,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -