b00a4cbd5e
- 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
26 lines
709 B
C#
26 lines
709 B
C#
using System.Windows;
|
|
using ytLive.Helpers;
|
|
using ytLive.Services;
|
|
using ytLive.ViewModels;
|
|
|
|
namespace ytLive;
|
|
|
|
public partial class MicPickerDialog : Window
|
|
{
|
|
public MicrophoneDeviceInfo? PickedDevice { get; private set; }
|
|
|
|
public MicPickerDialog(MicPickerViewModel viewModel)
|
|
{
|
|
AppLog.Write("MicPickerDialog ctor: before InitializeComponent");
|
|
InitializeComponent();
|
|
AppLog.Write("MicPickerDialog ctor: after InitializeComponent");
|
|
DataContext = viewModel;
|
|
viewModel.UseRequested += device =>
|
|
{
|
|
PickedDevice = device;
|
|
DialogResult = true;
|
|
};
|
|
viewModel.CancelRequested += () => DialogResult = false;
|
|
}
|
|
}
|