Skip to main content

Module headless

Module headless 

Source
Expand description

HeadlessPlatform: a backend with no window, no clock, no heap counter and no memory tags (unless a test hands it them) and no sound card. It plays scripted input and system events, records the frames presented to it, keeps its storage in memory, and stands in for the music player (Speaker), so a screen that keeps time with the music is tested too.

The test Harness runs games on it, through the same App::frame the devices do. It is also the smallest complete backend, for anyone writing one (docs/platform-backends.md).

Structs§

AddedPlay
A play of a sound the game added at run time, as the Speaker heard it: the samples it played. Only the Speaker builds one (ADR-0039).
HeadlessPlatform
A backend with no devices, for tests and tools.
PlayingSound
A sound started with a handle that the Speaker holds as playing. Only the Speaker builds one (ADR-0039).
ScriptedKeyboard
A system keyboard that answers from a script: each time it opens it gives the next answer, at the next poll.
Speaker
The headless backend’s sound device: it records what the last frame played, works out which music “sounds” from the music commands and the clock, and keeps the sounds started with a handle until they stop (one that plays once too: it knows no lengths). Like shuyi-app, it mutes rather than pauses: while suspended its music clock runs on. It keeps the sounds the game added at run time, and hears every play of them (added_plays). A voice clip sounds from its request until it is stopped or replaced, or until the length a test gave clips has passed (set_voice_length).

Enums§

Presented
A frame as the headless backend keeps it.

Type Aliases§

PresentHook
What runs on each frame a HeadlessPlatform is presented, in its present: the work a device’s backend does there, such as a one-bit display’s conversion, so a frame measured headless counts it (HeadlessPlatform::set_present_hook).