You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit aa9151a
Browse filesBrowse the repository at this point in the historyBrowse files
Render the window where there is no screen to show it on
takt4 is worked on from sessions that have a window station but no display, and
§5.9's window could not be looked at from one. Measured, both ways: a screen DC
does not exist at all — CreateDC("DISPLAY", …) returns null and BitBlt from
GetDC(NULL) fails — and PrintWindow with PW_RENDERFULLCONTENT hands back the
frame with a white client area, on the Skia/OpenGL renderer and under
SLINT_BACKEND=winit-skia-software alike. So the window built, launched, sized
itself correctly and closed cleanly, and nobody could say whether it looked
right.
takt4-shot does not need a screen. A slint::platform::Platform of our own hands
the runtime a window adapter whose SoftwareRenderer draws into a buffer we own,
and that goes out as a BMP. It is the real component — real layout, real fonts,
real colours — not a mock-up of it. The readouts are filled by running the
tracker over tests/data/features/synthetic.wav, so the picture holds numbers the
engine actually produced and can be checked against what `takt4-cli track` prints
for the same file: 127.66 BPM, locked, 4/4. The pickers are filled from whatever
audio hardware is present.
Looking at the first render found four things immediately, all fixed here:
* A y binding on a child of a layout is silently ignored — the layout owns its
children's positions. "BPM" floated above the number instead of sitting on
its baseline; vertical-alignment is what that wanted. The bar dots carried
the same dead binding.
* A VerticalLayout's default alignment spreads leftover height *between*
children that cannot stretch, so the tempo readouts were pushed forty pixels
apart with the meter left stranded halfway down the window.
* "folded from N BPM" tested the difference between the raw and published
tempo, so it fired on the beat-spacing refinement — 126.8 against 127.66 —
and called it an octave fold. A fold is a halving or a doubling, so the test
is the ratio.
* The activation trace was pinned at 88 px while the readouts took every spare
pixel. That is backwards: the trace is the one thing here worth more when it
is bigger, and §5.9 says it is what carries this UI.
ui/window_state.cpp comes out of app.cpp so there is one place that knows how an
engine value becomes a window property, and both the live window and takt4-shot
use it. That is what lets the shot tool fill the window with no tracker, no timer
and no audio device behind it.
158 tests, unchanged: this adds no engine code. Builds clean with the UI on and
with it off.
0 commit comments