Skip to content

Slow the session list down, and stop hiding the sample rate until Start - #51

Merged
revtex merged 1 commit into
mainfrom
record-transport-fixes
Sep 2, 2026
Merged

Slow the session list down, and stop hiding the sample rate until Start#51
revtex merged 1 commit into
mainfrom
record-transport-fixes

Conversation

@revtex

@revtex revtex commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Three faults on the Record page, reported together.

The session list scrolled three tracks per notch

RecordSavedList scrolled by item. Its rows are two lines tall, so one wheel notch moved about 150 DIP — three finished tracks at once, with no way to move through the list slowly.

MetadataTrackList was built with VirtualizingPanel.ScrollUnit="Pixel" and never had the problem. The session list simply never got the same line. One line, with a precedent in the same repo.

The sample rate appeared only once recording started

MP3 320K 48K showed its first two parts while idle and grew the third on Start, which reads as the display filling in rather than as the deliberate omission it was.

The reason recorded for it was wrong. The remark said the capture endpoint's rate "is not knowable until the endpoint is open" — but the rate is a property of the endpoint, and MMDevice reports its mix format at any time. It is also the same endpoint capture opens: LoopbackAudioCapture resolves the identical id through AudioEndpoints.Resolve and takes its format from the device, so the idle figure is the one the recording will use, not a guess.

A device that cannot be read still prints nothing rather than a placeholder — a wrong number on the line that claims to describe the file is worse than a short one.

Verified against a running build: an idle window's RecordFormat element now reads MP3 320K 48K, where it previously read MP3 320K.

The display ignored settings changed while idle

Fixing the above exposed this. FormatSummary always read settings fresh, but Sync() runs only at construction, on start and on stop — so changing the format, the bitrate or the capture device while idle left the page describing the file the previous settings would have produced, until something was recorded.

The controller now listens to SettingsDocument.Changed and raises OutputChanged. That is deliberately not StateChanged, which promises to mean "IsRunning changed" and would stop meaning it if settings borrowed it. Disposal unsubscribes.

Verification

  • .\build.ps1 -Test — 1,272 pass, 0 fail (265 UI + 1,007 Core), 0 warnings.
  • .\build.ps1 -VerifyFormat — clean.
  • Three new tests: the format line follows a bitrate changed while idle, OutputChanged fires on save, and disposal stops it firing.

The sample-rate read itself is not unit-tested — it crosses into WASAPI through AudioEndpoints.Resolve, and the existing tests deliberately keep the controller away from real devices. It is covered by the try/catch and checked against a live window instead; the assertions above use StartsWith so they pass on a machine with no audio endpoint at all.

Three faults on the Record page, all reported together.

The session list scrolled by item. Its rows are two lines tall, so one wheel notch
moved about 150 DIP — three finished tracks at a time, with no way to move through
it slowly. The Metadata list was built with ScrollUnit="Pixel" and never had the
problem; the session list simply never got the same line.

The sample rate was withheld while idle. The remark explaining why said the capture
endpoint's rate "is not knowable until the endpoint is open", and that is wrong: the
rate is a property of the endpoint and MMDevice reports its mix format at any time.
It is also the same endpoint capture opens — LoopbackAudioCapture resolves the
identical id through AudioEndpoints.Resolve and takes its format from the device —
so the idle figure is the one the recording will use, not a guess. Two thirds of the
line read from settings and were always there while the third appeared on Start,
which read as the display filling in rather than as a deliberate omission. A device
that cannot be read still prints nothing: a wrong number on the line that describes
the file is worse than a short one.

Fixing that exposed the third. FormatSummary always read settings fresh, but Sync
ran only at construction, on start and on stop, so changing the format, the bitrate
or the capture device while idle left the page describing the file the previous
settings would have produced. The controller now listens to the settings document
and raises OutputChanged, which is separate from StateChanged because StateChanged
promises to mean "IsRunning changed" and would stop meaning it if settings borrowed
it. Disposal unsubscribes, and there is a test for that as well as for the stale
bitrate and the event itself.
@revtex
revtex merged commit 9e82b86 into main Sep 2, 2026
6 checks passed
@revtex
revtex deleted the record-transport-fixes branch September 2, 2026 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant