feat(dock): the LIP-SYNC bay — offset, readout, zero detent
Unit 8. Re-houses the shipped TASK 22 offset in the dock:
- slider −200…+200 ms, snapping to 5 ms ticks (the existing property still clamps and persists)
- readable readout: "0 ms (aligned)" when right, signed otherwise ("+50 ms", "−120 ms")
- presets 0 / +50 / +100; 0 IS the detent — a button is easier to hit than a snap, and "the lip-sync
is right" deserves one click.
Guard: SyncBayTests pins the binding, the readout, the presets and the snapping, and that the
offset stays the persisted property (no second source of truth).
This commit is contained in:
@@ -194,11 +194,21 @@ public partial class MainViewModel
|
||||
set
|
||||
{
|
||||
var clamped = Math.Clamp(value, -500, 500);
|
||||
if (SetProperty(ref _audioSyncOffsetMs, clamped))
|
||||
ScheduleSave();
|
||||
if (!SetProperty(ref _audioSyncOffsetMs, clamped)) return;
|
||||
OnPropertyChanged(nameof(SyncOffsetLabel));
|
||||
ScheduleSave();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>"0 ms (aligned)", "+50 ms", "−120 ms" — what the dock shows beside the slider.</summary>
|
||||
public string SyncOffsetLabel => AudioSyncOffsetMs == 0
|
||||
? "0 ms (aligned)"
|
||||
: (AudioSyncOffsetMs > 0 ? "+" : "−") + Math.Abs(AudioSyncOffsetMs) + " ms";
|
||||
|
||||
/// <summary>Preset buttons in the LIP-SYNC bay. 0 is the detent: the offset that means "the
|
||||
/// lip-sync is right", so it deserves one click, not a drag.</summary>
|
||||
internal void SetSyncOffset(int milliseconds) => AudioSyncOffsetMs = milliseconds;
|
||||
|
||||
private void ToggleMicMute()
|
||||
{
|
||||
if (MicMuted)
|
||||
|
||||
Reference in New Issue
Block a user