Slow the session list down, and stop hiding the sample rate until Start - #51
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three faults on the Record page, reported together.
The session list scrolled three tracks per notch
RecordSavedListscrolled 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.MetadataTrackListwas built withVirtualizingPanel.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 48Kshowed 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
MMDevicereports its mix format at any time. It is also the same endpoint capture opens:LoopbackAudioCaptureresolves the identical id throughAudioEndpoints.Resolveand 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
RecordFormatelement now readsMP3 320K 48K, where it previously readMP3 320K.The display ignored settings changed while idle
Fixing the above exposed this.
FormatSummaryalways read settings fresh, butSync()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.Changedand raisesOutputChanged. That is deliberately notStateChanged, 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.OutputChangedfires 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 useStartsWithso they pass on a machine with no audio endpoint at all.