Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7a77b731ea | ||
|
|
5764d218da | ||
|
|
fe23342a2a | ||
|
|
aa30659313 | ||
|
|
a6bebc4adf |
No files matched your search
+8
-2
@@ -9,7 +9,7 @@ barrier. It is written for the person who has just met one; the details for deve
|
||||
FrameLedger is a desktop program: its own window, its dialogs, its document windows, the icon by the clock and the
|
||||
notices Windows shows for it. It draws nothing inside a game, so it cannot make a game itself any easier to use.
|
||||
|
||||
*Beta software: this page describes version 0.1.0-beta.49. In the app: Help ▸ Accessibility.*
|
||||
*Beta software: this page describes version 0.1.0-beta.50. In the app: Help ▸ Accessibility.*
|
||||
|
||||
## What FrameLedger aims for
|
||||
|
||||
@@ -79,7 +79,10 @@ The same keys are in the user guide, [The screens](guide/07-screens.md#keyboard-
|
||||
- Labels such as *Hooking on* and *Not installed*, and the ray-tracing chips, always carry their words; a chip that reads
|
||||
*N/A* is also drawn with a dashed edge.
|
||||
- **No chart tells two series apart by colour alone**: its lines are solid, dashed or dotted, its points circles,
|
||||
triangles or squares, its shaded stretches striped or dotted.
|
||||
triangles or squares, its shaded stretches striped or dotted. The chart of what a session was played with puts each
|
||||
way of playing on a row of its own, named on the axis.
|
||||
- **A bar of shares** — frame generation, what a session was played with — is announced with every share in its
|
||||
name, and the table beside it has every number in text, each row with a swatch of its colour.
|
||||
|
||||
### Languages
|
||||
|
||||
@@ -113,6 +116,9 @@ Each one with what to do instead. A barrier that is not on this list is worth re
|
||||
- **A chart's points cannot be read one by one.** A screen reader hears the chart's name and where its numbers are:
|
||||
a session's figures and *Statistics per series* in its summary, the table under the Compare chart, the Sessions table
|
||||
and the list of changes under a trend chart, and **File ▸ Export ▸ Session CSV** or **Session JSON**.
|
||||
- **Under a Windows contrast theme, two of the four parts of the "Played with" bar share a colour** — a contrast
|
||||
theme has few colours. They are never next to each other, a gap separates every part, and the table under the bar
|
||||
names each with its share.
|
||||
- **In the user guide and the other documents the app shows, headings are read as ordinary text**: Windows' document
|
||||
view gives them no heading role. Their links and their order work as on any page.
|
||||
- **The short messages at the bottom of the window close after four seconds**, and cannot be read again once closed. A
|
||||
|
||||
+5
-74
@@ -35,82 +35,12 @@ numeric core and does not move; the heading is the full version — corrected 20
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
|
||||
- **A session records what it was played with — a controller, the keyboard and mouse, both, or neither** (D155–D163,
|
||||
the owner's decisions of 2026-11-14; *Settings ▸ Controllers and input*, on unless you switch it off). While a game
|
||||
is recorded, FrameLedger's agent notes — from Windows, never from the game — which game controllers are connected
|
||||
and in use, their battery level, and whether the keyboard or mouse is in use, and the session stores how the time
|
||||
the game was in front divides between them, how often each controller connected and dropped, and its battery. It
|
||||
works for a game FrameLedger does not measure too. **No button, stick, key or text is kept; nothing is sent to a
|
||||
controller; and nothing is read until you have accepted the Privacy Policy that describes it** — after this
|
||||
update, sessions recorded before FrameLedger has been opened once have no such figures. The screens that show the
|
||||
figures come with the same release. Xbox-compatible controllers and the DualSense are read for use; another
|
||||
controller is listed and never counted as in use. **None of this had been read from a real controller when it was
|
||||
written** — it was checked against data written by hand (`LIMITATIONS.md` §Controllers and input).
|
||||
- **The terms are shown once: Privacy Policy 2.22 and Disclaimer 2.18.** Both said FrameLedger never reads input.
|
||||
They now say what is read — that a controller, or the keyboard or mouse, is in use — what is kept, and what never
|
||||
is (`docs/legal-drift-history.md`).
|
||||
- **For developers: the arithmetic of controller statistics, with nothing reading a device yet** (D155–D163, the
|
||||
owner's decisions of 2026-11-14; `docs/21_INPUT_DEVICES.md`, `docs/03_METRICS.md` §Input). `FrameLedger.Domain.Input`
|
||||
says whether an XInput state or a DualSense report is a pad in use and what its battery is, adds a battery's readings
|
||||
up, counts switches, and decides when two entries are one pad seen twice; `Application.Input` holds one session's
|
||||
slices and turns them into a reading a second; `InputSessionBuilder` turns a session's readings into its totals, its
|
||||
controllers as JSON and its timeline. A telemetry sample can carry a reading; none does. **Every byte and reading
|
||||
under test was written by hand — no report from a real controller has passed through this code.**
|
||||
- **For developers: a session can store what it was played with — schema 0024** (D160; `docs/06_DATA_MODEL.md`). Nine
|
||||
columns on `sessions` (the time in front and its four classes, the switches of method, the sources that answered,
|
||||
the controllers as JSON) and three on `games` (what a store lists of controller support), ADD COLUMN only; the
|
||||
`.partial` file gains chunk 11, so a session recovered after the Agent died keeps its readings; the finalizer
|
||||
stores them for hooked and unhooked sessions alike; the input series are `sensor_blobs` rows named `input.*`, which
|
||||
the sensors' read leaves out. Nothing produces a reading yet. **A ledger this build has opened cannot be opened by
|
||||
0.1.0-beta.49 or earlier.**
|
||||
- **For developers: the input reader, which the Agent does not start yet** (D155, D158, D159; `docs/21_INPUT_DEVICES.md`
|
||||
§The reader). `Application.Input.InputReader` takes a slice about ten times a second from
|
||||
`Infrastructure.Input.Win32InputBackend` — raw input for joysticks and gamepads delivered to a window that is never
|
||||
shown, three of XInput's getters, the time of the last keyboard or mouse input, the window in front — on the thread
|
||||
of `InputDeviceHub`, which exists only while a session has a view of it. It opens no device, sends nothing to one,
|
||||
and registers for no keyboard or mouse. A new gate, `tools/input-readonly-check.ps1`, holds the reader's Windows
|
||||
calls to a committed list and refuses, on the list or off it, a call that sends to a device, injects input or reads
|
||||
a key; no other managed source and no native source may name an input function. **With no controller at hand, what
|
||||
the reader does with one connected is not established**: its tests use a Windows whose answers they write, and one
|
||||
suite runs it on the real Windows of the machine and asserts only that it opens, answers and closes.
|
||||
|
||||
### Changed
|
||||
|
||||
- **Advanced metrics is closed: the ten readings that were "being studied" are now "not read", with the reason**
|
||||
(D154, the owner's decision). What a game sets and asks through Streamline's own functions for a feature — DLSS
|
||||
frame generation's options and state, the video memory DLSS estimates for itself, the options of ray
|
||||
reconstruction, Image Scaling and Dynamic Vibrance, the PC-latency markers — is reached only by handing the game
|
||||
a function of FrameLedger's in place of Streamline's, which is refused. The *Sources* list says so, in English,
|
||||
Vietnamese and Japanese, and the guide no longer says a later release reads more. Nothing that was read stops
|
||||
being read.
|
||||
|
||||
- **The two lines of the graphics card's time say what each is, not which holds the other** (D152, the owner's
|
||||
decision). *GPU active render (idle time excluded)* and *GPU render, start to end (idle time included)* are now
|
||||
*GPU active render (the driver's own figure)* and *GPU render (between the driver's start and end marks)*, in
|
||||
English, Vietnamese and Japanese, and the guide says why: in Cyberpunk 2077 without frame generation the
|
||||
driver's active time is longer than its two marks are apart. The numbers are unchanged.
|
||||
|
||||
- **The guide's page on Advanced metrics says what two of the driver's switches mean** (`guide/12`): the latency
|
||||
report is there in a game that has Reflex built in, whether Reflex is on or off in its menu; `bUseGameSleep`
|
||||
says the game calls Reflex's sleep — NVIDIA asks for that even with Reflex off — and `bLowLatencyMode` is the
|
||||
one that says the mode is on; frame generation needs Reflex, not the reverse. From NVIDIA's Streamline guide
|
||||
for Reflex, and from the owner's ten sessions on 0.1.0-beta.49.
|
||||
|
||||
### Documentation
|
||||
|
||||
- **Owner-only item 47 was run and read** (`docs/HANDOFF.md`): in Cyberpunk 2077 without frame generation the
|
||||
driver's active GPU time is longer than its own two marks are apart on 4 917 of 5 394 frames (1 849 µs beside
|
||||
1 571 µs) and on none of 129 900 frames in five other games — the difference is the driver's; samples without a
|
||||
report are now confined to a game's start; a session with the option off has no latency line; and the stop of
|
||||
D141 fired in a real game for the first time (Kingdom Come: Deliverance II, one call of 5.3 ms while it
|
||||
started).
|
||||
- **Streamline's programming guides for Reflex and for DLSS Ray Reconstruction (2.14.16) read against the code**
|
||||
(`docs/spike-notes/30-reflex-latency.md`, *Added 2026-11-14*). Ray reconstruction was already measured the way
|
||||
the guide describes; two comments in the Overlay's source and one line of `17_HOOK_ENGINE` said super
|
||||
resolution and ray reconstruction run together, and they do not. `03_METRICS` and `05_DETECTION` no longer
|
||||
promise "PC latency as reported by Reflex" (D147). No code changed: comments only.
|
||||
- **0.1.0-beta.50's release facts are recorded** (`docs/HANDOFF.md` §Left open by this session): the run, the eight
|
||||
assets and their digests, the build id in the five native libraries, the delta, the wiki, the rehearsals, what
|
||||
SonarCloud and Qodana said of the released commit — and that the release shows two dates, the owner's day in
|
||||
the documents and UTC's on GitHub and in the legal texts.
|
||||
|
||||
## Releases
|
||||
|
||||
@@ -118,6 +48,7 @@ Newest first. Each file holds that release's section exactly as it stood here.
|
||||
|
||||
| Version | Date | Notes |
|
||||
|---|---|---|
|
||||
| `0.1.0-beta.50` | 2026-11-15 | [`docs/changelog/0.1.0-beta.50.md`](docs/changelog/0.1.0-beta.50.md) |
|
||||
| `0.1.0-beta.49` | 2026-11-14 | [`docs/changelog/0.1.0-beta.49.md`](docs/changelog/0.1.0-beta.49.md) |
|
||||
| `0.1.0-beta.48` | 2026-11-14 | [`docs/changelog/0.1.0-beta.48.md`](docs/changelog/0.1.0-beta.48.md) |
|
||||
| `0.1.0-beta.47` | 2026-11-14 | [`docs/changelog/0.1.0-beta.47.md`](docs/changelog/0.1.0-beta.47.md) |
|
||||
|
||||
@@ -158,17 +158,10 @@ src/
|
||||
# GetLastInputInfo - it opens no device and sends nothing to one) and InputDeviceHub
|
||||
# (one thread for the Agent, only while a session has a view). Read from OUTSIDE the
|
||||
# game, both tiers; `capture.input_devices`, on by default.
|
||||
# Controllers and input (0.1.0-beta.50, owner decisions D155-D163, docs/21_INPUT_DEVICES):
|
||||
# Input/ - InputReader (a slice ten times a second over the port IInputBackend),
|
||||
# InputTickAccumulator (one session's slices into a reading a tick), InputTerms (the
|
||||
# reading waits for Privacy Policy 2.22, D156), the ports IInputDevices /
|
||||
# IInputActivitySource; Recording/InputSessionBuilder (totals, the controllers as JSON,
|
||||
# the input.* series; schema 0024). Domain/Input holds the arithmetic and the two
|
||||
# parsers (an XInput state, a DualSense report). Infrastructure/Input is the Windows
|
||||
# side: Win32InputBackend (raw input for joysticks and gamepads, three XInput getters,
|
||||
# GetLastInputInfo - it opens no device and sends nothing to one) and InputDeviceHub
|
||||
# (one thread for the Agent, only while a session has a view). Read from OUTSIDE the
|
||||
# game, both tiers; `capture.input_devices`, on by default.
|
||||
# The App shows it since the same release: Services/InputPresentation (a session's
|
||||
# "Played with", from the stored row), Controls/ShareBar with InputShareBar and FgMixBar,
|
||||
# Charts/InputSeries with two charts and the controller marks on FrametimeChart,
|
||||
# Services/ControllerEvidence (a game's page: three pieces of evidence, no verdict, D163).
|
||||
FrameLedger.Infrastructure/ # SQLite, shm reader, vendor APIs, injector interop, parsers,
|
||||
# and Capture/ (PR-C): ShmRingAttacher/ShmCaptureSink over the
|
||||
# reader, HeldProcessLivenessSource, TargetResolver (path only,
|
||||
@@ -254,6 +247,7 @@ guide/ # the user guide (beta.12, D44): ~~eight~~ short
|
||||
# App (Help > User guide); README.md is its contents. docs/ is for developers.
|
||||
# (twelve since beta.17, D54: the screens, every setting, troubleshooting, a glossary;
|
||||
# and the guide is the wiki's End-user part)
|
||||
# (since 0.1.0-beta.50 also 13-controllers.md, Controllers and input)
|
||||
wiki/ # the wiki's own pages (beta.17, D53): Home, _Sidebar, the developer pages. wiki.yml
|
||||
# publishes them with guide/, LIMITATIONS.md and ACCESSIBILITY.md to the Wiki tab at a release;
|
||||
# tools/wiki-build.ps1 assembles and checks them (build.ps1 wiki-check)
|
||||
|
||||
+6
-1
@@ -5,7 +5,7 @@ hooking on for — and reading the graphics calls the game makes. That is why it
|
||||
resolution, the upscaler, frame generation and ray tracing apart. It is also where its limits come from. This
|
||||
page lists them in plain words; each item links to the document that has the details.
|
||||
|
||||
*Beta software: this page describes version 0.1.0-beta.49.*
|
||||
*Beta software: this page describes version 0.1.0-beta.50.*
|
||||
|
||||
## Games it will not measure
|
||||
|
||||
@@ -173,6 +173,11 @@ game — so it is there for a game FrameLedger does not measure as well.
|
||||
cent.
|
||||
- **Steam Input shows a controller twice** — the one you hold and an Xbox pad Steam presents for it. FrameLedger
|
||||
folds the two into one when they move together; with another remapper it may list two.
|
||||
- **"Does this game support controllers?" has no single answer here.** The game's page shows what Steam lists
|
||||
(read from the Steam app's file on your PC — only Steam games have it, and only on a PC where Steam knows the
|
||||
game), which input libraries the game loaded the last time it was measured from inside (several engines load one
|
||||
whether the game uses a controller or not), and how you have actually played it. FrameLedger does not turn them
|
||||
into a Yes or a No. ([Detection](docs/05_DETECTION.md))
|
||||
- **Nothing is read until you have accepted the Privacy Policy that describes it.** After an update, sessions
|
||||
recorded before FrameLedger has been opened once have no such figures, and say so in their notes.
|
||||
- **None of this had been read from a real controller when 0.1.0-beta.50 was written.** It was checked against data
|
||||
|
||||
@@ -13,7 +13,7 @@ app too (Help ▸ User guide, Help ▸ Limitations, Help ▸ Accessibility), and
|
||||
|
||||
<!-- accuracy-block:begin -->
|
||||
> ⚠ **What FrameLedger actually measures today — 2026-11-11.** The software is a beta; its latest
|
||||
> **beta is `0.1.0-beta.49`** (2026-11-14), an unsigned installer built from that tag with its
|
||||
> **beta is `0.1.0-beta.50`** (2026-11-15), an unsigned installer built from that tag with its
|
||||
> checksums published beside it (alphas — experimental builds that try a newer .NET — are published apart). The source holds the desktop app
|
||||
> (library, store import, charts, settings) and the background Agent, which records a session when a
|
||||
> game in the library runs (unless you switched its recording off), injects only into games you enabled
|
||||
@@ -225,7 +225,7 @@ Elevation is **optional — for everything.** Hooked capture is the normal path
|
||||
|
||||
## Install
|
||||
|
||||
> **The latest beta is `v0.1.0-beta.49` (2026-11-14); before it `v0.1.0-beta.48` (2026-11-14), `v0.1.0-beta.47` (2026-11-14), `v0.1.0-beta.46` (2026-11-13), `v0.1.0-beta.45` (2026-11-12), `v0.1.0-beta.44` (2026-11-12), `v0.1.0-beta.43` (2026-11-12), `v0.1.0-beta.42` (2026-11-12), `v0.1.0-beta.41` (2026-11-12), `v0.1.0-beta.40` (2026-11-12), `v0.1.0-beta.39` (2026-11-11), `v0.1.0-beta.38` (2026-11-11), `v0.1.0-beta.37` (2026-11-11), `v0.1.0-beta.36` (2026-11-10), `v0.1.0-beta.35` (2026-11-09), `v0.1.0-beta.34` (2026-11-06), `v0.1.0-beta.33` (2026-11-03), `v0.1.0-beta.32` (2026-10-31), `v0.1.0-beta.31` (2026-10-26), `v0.1.0-beta.30` (2026-10-26), `v0.1.0-beta.29` (2026-10-25), `v0.1.0-beta.28` (2026-10-20), `v0.1.0-beta.27` (2026-10-20), `v0.1.0-beta.26` (2026-10-19), `v0.1.0-beta.25` (2026-10-19), `v0.1.0-beta.24` (2026-10-19), `v0.1.0-beta.23` (2026-10-14), `v0.1.0-beta.22` (2026-10-13), `v0.1.0-beta.21` (2026-10-13), `v0.1.0-beta.20` (2026-10-12), `v0.1.0-beta.19` (2026-10-12), `v0.1.0-beta.18` (2026-10-07), `v0.1.0-beta.17` (2026-10-07), `v0.1.0-beta.16` (2026-10-06), `v0.1.0-beta.15` (2026-10-06), `v0.1.0-beta.14` (2026-10-06), `v0.1.0-beta.13` (2026-10-04), `v0.1.0-beta.12` (2026-10-04), `v0.1.0-beta.11` (2026-10-03), `v0.1.0-beta.10` (2026-09-28), `v0.1.0-beta.9` (2026-09-26), `v0.1.0-beta.8` (2026-09-25), `v0.1.0-beta.7` (2026-09-23), `v0.1.0-beta.6` (2026-09-23), `v0.1.0-beta.5` (2026-09-22), `v0.1.0-beta.4` (2026-09-21), `v0.1.0-beta.3` (2026-09-21), `v0.1.0-beta.2` (2026-09-17) and `v0.1.0-beta.1` (2026-09-16).** They are pre-releases: read the notes of the one you install — `CHANGELOG.md` links each release's own file under `docs/changelog/` — for what it measures, what it does not yet, and how to update, before installing. A source build is `docs/12_BUILD.md`.
|
||||
> **The latest beta is `v0.1.0-beta.50` (2026-11-15); before it `v0.1.0-beta.49` (2026-11-14), `v0.1.0-beta.48` (2026-11-14), `v0.1.0-beta.47` (2026-11-14), `v0.1.0-beta.46` (2026-11-13), `v0.1.0-beta.45` (2026-11-12), `v0.1.0-beta.44` (2026-11-12), `v0.1.0-beta.43` (2026-11-12), `v0.1.0-beta.42` (2026-11-12), `v0.1.0-beta.41` (2026-11-12), `v0.1.0-beta.40` (2026-11-12), `v0.1.0-beta.39` (2026-11-11), `v0.1.0-beta.38` (2026-11-11), `v0.1.0-beta.37` (2026-11-11), `v0.1.0-beta.36` (2026-11-10), `v0.1.0-beta.35` (2026-11-09), `v0.1.0-beta.34` (2026-11-06), `v0.1.0-beta.33` (2026-11-03), `v0.1.0-beta.32` (2026-10-31), `v0.1.0-beta.31` (2026-10-26), `v0.1.0-beta.30` (2026-10-26), `v0.1.0-beta.29` (2026-10-25), `v0.1.0-beta.28` (2026-10-20), `v0.1.0-beta.27` (2026-10-20), `v0.1.0-beta.26` (2026-10-19), `v0.1.0-beta.25` (2026-10-19), `v0.1.0-beta.24` (2026-10-19), `v0.1.0-beta.23` (2026-10-14), `v0.1.0-beta.22` (2026-10-13), `v0.1.0-beta.21` (2026-10-13), `v0.1.0-beta.20` (2026-10-12), `v0.1.0-beta.19` (2026-10-12), `v0.1.0-beta.18` (2026-10-07), `v0.1.0-beta.17` (2026-10-07), `v0.1.0-beta.16` (2026-10-06), `v0.1.0-beta.15` (2026-10-06), `v0.1.0-beta.14` (2026-10-06), `v0.1.0-beta.13` (2026-10-04), `v0.1.0-beta.12` (2026-10-04), `v0.1.0-beta.11` (2026-10-03), `v0.1.0-beta.10` (2026-09-28), `v0.1.0-beta.9` (2026-09-26), `v0.1.0-beta.8` (2026-09-25), `v0.1.0-beta.7` (2026-09-23), `v0.1.0-beta.6` (2026-09-23), `v0.1.0-beta.5` (2026-09-22), `v0.1.0-beta.4` (2026-09-21), `v0.1.0-beta.3` (2026-09-21), `v0.1.0-beta.2` (2026-09-17) and `v0.1.0-beta.1` (2026-09-16).** They are pre-releases: read the notes of the one you install — `CHANGELOG.md` links each release's own file under `docs/changelog/` — for what it measures, what it does not yet, and how to update, before installing. A source build is `docs/12_BUILD.md`.
|
||||
|
||||
1. Download the latest `FrameLedger.App-win-Setup.exe` from [Releases](https://github.com/poli0981/frameledger/releases). It installs into `%LOCALAPPDATA%\FrameLedger.App`; your data stays in `%LOCALAPPDATA%\FrameLedger`, and uninstalling asks before touching it.
|
||||
2. SmartScreen may warn — releases are not code-signed (free, open-source project). Verify the SHA-256 checksum published with each release, then **More info → Run anyway**.
|
||||
|
||||
+1
-1
@@ -1111,4 +1111,4 @@ Per-column sources, and what a *Tier-2* export does instead:
|
||||
| `vram_mb` | `vram_proc` per-frame blob. ~~Note the value is refreshed at 1 Hz (`17_HOOK_ENGINE` §Memory) so it is a held sample, not a per-frame measurement — the header block says so~~ **Corrected 2026-10-03: the Overlay never produced it, so the column has always been empty.** It stays in the list — the schema is fixed — and the header's note says so; the game's memory is the `# game_memory:` header line (beta.12, §Game process memory) | `N/A` |
|
||||
| `reflex_latency_us` | `latency_us` blob; **finalize must write it** | `N/A` |
|
||||
|
||||
Plus a `#`-prefixed header block: game, date, **capture tier**, api, present mode, swap effect, **the display line** (beta.10: `# display:` with each mode's milliseconds, the changes, the source and the window / back buffer / monitor sizes, or `N/A` for a session recorded before — §Display mode; a mode is the session's, not a frame's, so it is not a column), hardware snapshot, segment list, the tri-state flags with their sources, ~~and the note that `vram_mb` is 1 Hz-sampled~~ **the game's memory** (beta.12: `# game_memory:` with the dedicated GPU memory's mean / median / max, the shared max, the private working set's mean / median / max, the working set's and the commit's max — MiB, invariant — the process count and the sources, or `N/A` for a session recorded before or one where nothing answered; the session's figure, read once a second, so a header line like the display's), and the note that `vram_mb` is the in-game figure this build does not produce. The tier belongs in the header because a Tier-2 export is missing whole columns and anyone reading it later must know why.
|
||||
Plus a `#`-prefixed header block: game, date, **capture tier**, api, present mode, swap effect, **the display line** (beta.10: `# display:` with each mode's milliseconds, the changes, the source and the window / back buffer / monitor sizes, or `N/A` for a session recorded before — §Display mode; a mode is the session's, not a frame's, so it is not a column), hardware snapshot, segment list, the tri-state flags with their sources, ~~and the note that `vram_mb` is 1 Hz-sampled~~ **the game's memory** (beta.12: `# game_memory:` with the dedicated GPU memory's mean / median / max, the shared max, the private working set's mean / median / max, the working set's and the commit's max — MiB, invariant — the process count and the sources, or `N/A` for a session recorded before or one where nothing answered; the session's figure, read once a second, so a header line like the display's), **what the session was played with** (0.1.0-beta.50, D160: `# input:` with the milliseconds read, in front, with a controller, with the keyboard and mouse, with both and with neither, the method switches, the sources, then each controller — its number, maker, model, connection, the milliseconds in use and connected, its connects and disconnects — or `N/A` for a session where nothing was read; both tiers, invariant, §Input; never a button, a key, a serial number or an address, which the row does not have), and the note that `vram_mb` is the in-game figure this build does not produce. The tier belongs in the header because a Tier-2 export is missing whole columns and anyone reading it later must know why.
|
||||
@@ -471,6 +471,48 @@ names no census lists; which feature each serves is not established.)* The sessi
|
||||
difference ("the game ships 3.7.10.0: another copy was loaded"); since beta.24 the DLSS line says where each DLSS
|
||||
library was loaded from (the game, the graphics driver, Windows) — by folder, never who put it there.
|
||||
|
||||
## Does a game support controllers — three pieces of evidence, no verdict (0.1.0-beta.50, owner decision D163)
|
||||
|
||||
**The owner's request, 2026-11-14:** "check whether the game supports controllers, shown in its details." From
|
||||
outside a game FrameLedger can know that a controller was in use while the game was in front — not what the game
|
||||
did with it — and a store's listing is the store's word. So the game's page shows three rows, each with where it
|
||||
comes from, and FrameLedger adds no Yes or No of its own (`App.Services.ControllerEvidence`):
|
||||
|
||||
| Row | What it says | From | When it is N/A |
|
||||
|---|---|---|---|
|
||||
| **Controller support (store)** | *Full — as Steam lists it*, *Partial — as Steam lists it*, *Steam lists none* | `games.controller_support` (schema 0024), read from the Steam app's own file on this PC | a game no store file on this PC describes: not a Steam game, or Steam has no record of it here |
|
||||
| **Input libraries loaded** | each interface with the files seen — `XInput (xinput1_4.dll)`, `SDL (SDL2.dll)` — or *None seen* | the module snapshot of the newest session measured from inside (`sessions.runtime_modules`) | a game never measured from inside: an unhooked session takes no snapshot (`04_CAPTURE`) |
|
||||
| **Usually played with** | the share of the time in front with a controller, the keyboard and mouse, both, neither, over the sessions that recorded it | `sessions.input_*` (`03_METRICS` §Input) | no session has recorded it |
|
||||
|
||||
### What a store lists
|
||||
|
||||
**Steam's `appcache\appinfo.vdf`, on the disk** (`Infrastructure.Import.SteamAppInfo`). The Steam client keeps a copy
|
||||
of the store's application records there; a record's `common` section may hold `controller_support` = `full` or
|
||||
`partial`, and a record without it lists none. **No request is made to any store** (CLAUDE.md rule 8 — the
|
||||
setting `privacy.online_metadata` is still read by nothing). Only format 41 is read (magic `0x07564429`, keys as
|
||||
numbers into a table of strings at the end of the file); another magic is refused with the reason and the row reads
|
||||
N/A. The layout was checked on the developer's Steam folder on 2026-11-14: 3 581 records, every tree read to its
|
||||
last byte, 1 284 *full*, 440 *partial*, 1 857 with no such key. No length in the file is trusted — a record or a
|
||||
string that claims more than the file holds is a problem, and a file that cannot be read whole says nothing.
|
||||
|
||||
**Read when a game's page opens** (`App.Services.StoreControllerSupport`, from `GameLibrary.LoadAsync`): the game's
|
||||
Steam record is found as Play and the artwork find it (`StoreRecords.Owning`), the file is read for that one
|
||||
application, and the row is written only when the answer differs — `IGameRepository.SetControllerSupportAsync`,
|
||||
the UI's write, which moves no `updated_at`. **A viewer reads nothing of this PC** (D52) and shows what the copy's
|
||||
rows hold. GOG, Epic, itch and the Xbox app keep no such fact on the disk that this build knows of: their games read
|
||||
N/A.
|
||||
|
||||
### Input libraries
|
||||
|
||||
`Domain.Input.InputLibraries`: `xinput1_4.dll`, `xinput1_3.dll`, `xinput9_1_0.dll`, `xinputuap.dll` (XInput);
|
||||
`dinput8.dll`, `dinput.dll` (DirectInput); `windows.gaming.input.dll`; `gameinput.dll`; `sdl2.dll`, `sdl3.dll`
|
||||
(SDL). The Agent's module snapshot looks for them beside the upscaling and frame-generation libraries
|
||||
(`AgentServices`), so they are in `sessions.runtime_modules` — hooked sessions only, as that snapshot always was.
|
||||
The session summary's *Libraries* line leaves them out; they are the game page's.
|
||||
|
||||
**Loaded is not used.** Several engines load XInput whether the game reads a controller or not, and Steam's own
|
||||
overlay can bring an input library into a game. That is why this is one of three rows and not an answer.
|
||||
|
||||
## DLSS generation — evidence-bound (beta.24, owner decision D64)
|
||||
|
||||
**What a session can say about which DLSS ran, and nothing more.** `Domain.Detection.DlssGeneration` names a
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
`%LOCALAPPDATA%\FrameLedger\ledger.db`. Pragmas: `journal_mode=WAL`, `synchronous=NORMAL`, `foreign_keys=ON`, `busy_timeout=5000`. `Microsoft.Data.Sqlite` + Dapper; all writes in explicit transactions.
|
||||
|
||||
**Writer ownership:** Agent writes `sessions`, `session_segments`, `frame_blobs`, `sensor_blobs`, `hardware_snapshots`, *(since schema 0023, 2026-11-11)* `machine_profiles` and `session_advanced`, the hook-state columns on `games`, **and since P4 PR-1 (2026-09-14) the *detected* columns on `games`** — `engine`, `engine_version`, `platform` under the per-field provenance rule (`05_DETECTION` §Caching: a `user` field is never touched), `capability_flags` whole, and the cache key `detection_rules_version` / `detection_exe_size_bytes` / `detection_exe_mtime_ms`, and since schema 0011 (2026-09-25) the executable's own facts `exe_machine` / `exe_file_version` / `exe_product_version` / `library_versions`, written whole like the flags — through `IGameRepository.ApplyDetectionAsync` only. The UI and the Agent were both already writers of `games`; this adds columns to the Agent's half, not a third writer (HANDOFF §P4). **And since P4 PR-4 the UI's library import writes `platform`, `store_id` and `game_version` through `ApplyStoreMetadataAsync`** — the same per-field provenance rule, badged `detected` (a store's record is not the user's typing), on columns the UI already owned. **And since 2026-09-23 the Agent's relocator merges two entries for one executable under two drive letters** (`IGameMerge`, HANDOFF D26, `19_SAFETY` §A moved drive is the same executable): in one transaction it re-parents the dropped entry's `sessions` to the survivor (before the delete — `sessions.game_id` cascades), carries a block or a crash auto-disable still in force to the survivor (`hook_enabled` only ever to 0; `hook_blocked_reason` is copied, never originated or cleared), adds the crash counts, deletes the dropped `games` row, and then moves the survivor to the file's path (after the delete — `exe_path` is UNIQUE). It was the one Agent write that deletes a `games` row until beta.19; it never touches a consent column. **And since beta.19 (2026-10-12, D55) the Agent removes an entry whose game is no longer installed** (`IGamePrune`, `SqliteGamePrune`, asked by the detection sweep through `UninstalledEntryPrune`): one `DELETE` that holds every stored condition in the same statement — the same row at the same path, `removed_at` NULL, no session stored (`NOT EXISTS` on `sessions` — nothing cascades), no `hook_blocked_reason`, `hook_prescan_state` not `blocked`, no `ac_exception_at` and no `ac_exception_trial_failed_at` — behind `retention.remove_uninstalled_games`; a block, a grant and D38's mark are never removed with their entry (`19_SAFETY` §What a finding does to the game, *What clears it*). **And since 2026-09-23 the UI writes `record_sessions`** (schema 0009, FR-1.6): the entry's recording switch, which the Agent only reads — off, the watcher does not watch for the program. The script's one data change switches it off for entries an old import made for Steam's own tools (`SteamLibrarySource.KnownTools`, the ids as of the script); a twin merge keeps it off when either twin had it off. **And since 2026-09-25 the Agent's pre-scan of the library (`19_SAFETY` §What a finding does to the game) writes the hook-state columns of every entry, not only of those the user asked to hook** — `hook_prescan_state`, and on a finding `hook_enabled = 0` and `hook_blocked_reason` — and its own key, `hook_prescan_rules_version` / `hook_prescan_exe_size_bytes` / `hook_prescan_exe_mtime_ms` (schema 0010), through `IGameConsentStore.RecordPreScanAsync` only: columns that were already the Agent's, never over a block, never a new row. **And since 2026-09-26 (schema 0014, D33) the Agent writes the user-mode exception's columns** — `ac_exception_*` on `games` through `IGameConsentStore` only (eligibility from the sweep, a grant from the `SetAntiCheatException` command, every end), and `sessions.ac_exception_family` with the session — the grant only after the user accepted its disclosure in the UI, which asks and never writes. **And since 2026-10-03 (beta.11, D40) the Agent deletes sessions on request** — every session of one game or of every game, `DeleteSessions` over the pipe, through `ISessionRepository.DeleteSessionsAsync` in one transaction (segments, blobs and annotations cascade), never while one is being recorded; the UI asks and never deletes a session row itself *(for Delete all sessions; FR-1.4's removal is the App's own cascade, above — corrected 2026-10-04)*. **Maintenance (P4 PR-7) adds no writer:** the retention sweep on demand is the Agent's, asked over the pipe; the UI's `VACUUM` rewrites pages with the same contents and changes no row (§Retention built note). UI writes `games` (user-editable fields — since P3 PR-3 that is the FR-1.3 metadata, the `*_default` tri-states, and `removed_at`; ~~never a `hook_*` column~~ **and two downgrades** *(corrected 2026-10-04)*: *Change executable* (2026-09-21, `GameLibrary.ChangeExecutableAsync`) turns hooking off, clears the consent and pre-scan columns and ends an excepLine truncated
|
||||
**Writer ownership:** Agent writes `sessions`, `session_segments`, `frame_blobs`, `sensor_blobs`, `hardware_snapshots`, *(since schema 0023, 2026-11-11)* `machine_profiles` and `session_advanced`, the hook-state columns on `games`, **and since P4 PR-1 (2026-09-14) the *detected* columns on `games`** — `engine`, `engine_version`, `platform` under the per-field provenance rule (`05_DETECTION` §Caching: a `user` field is never touched), `capability_flags` whole, and the cache key `detection_rules_version` / `detection_exe_size_bytes` / `detection_exe_mtime_ms`, and since schema 0011 (2026-09-25) the executable's own facts `exe_machine` / `exe_file_version` / `exe_product_version` / `library_versions`, written whole like the flags — through `IGameRepository.ApplyDetectionAsync` only. The UI and the Agent were both already writers of `games`; this adds columns to the Agent's half, not a third writer (HANDOFF §P4). **And since 0.1.0-beta.50 (schema 0024, D163) the UI writes `controller_support`, `controller_support_source` and `controller_support_at`** — what the Steam app's own file on this PC lists, read when a game's page opens and written through `IGameRepository.SetControllerSupportAsync` only when it differs; no `updated_at` moves and no other column is touched. **And since P4 PR-4 the UI's library import writes `platform`, `store_id` and `game_version` through `ApplyStoreMetadataAsync`** — the same per-field provenance rule, badged `detected` (a store's record is not the user's typing), on columns the UI already owned. **And since 2026-09-23 the Agent's relocator merges two entries for one executable under two drive letters** (`IGameMerge`, HANDOFF D26, `19_SAFETY` §A moved drive is the same executable): in one transaction it re-parents the dropped entry's `sessions` to the survivor (before the delete — `sessions.game_id` cascades), carries a block or a crash auto-disable still in force to the survivor (`hook_enabled` only ever to 0; `hook_blocked_reason` is copied, never originated or cleared), adds the crash counts, deletes the dropped `games` row, and then moves the survivor to the file's path (after the delete — `exe_path` is UNIQUE). It was the one Agent write that deletes a `games` row until beta.19; it never touches a consent column. **And since beta.19 (2026-10-12, D55) the Agent removes an entry whose game is no longer installed** (`IGamePrune`, `SqliteGamePrune`, asked by the detection sweep through `UninstalledEntryPrune`): one `DELETE` that holds every stored condition in the same statement — the same row at the same path, `removed_at` NULL, no session stored (`NOT EXISTS` on `sessions` — nothing cascades), no `hook_blocked_reason`, `hook_prescan_state` not `blocked`, no `ac_exception_at` and no `ac_exception_trial_failed_at` — behind `retention.remove_uninstalled_games`; a block, a grant and D38's mark are never removed with their entry (`19_SAFETY` §What a finding does to the game, *What clears it*). **And since 2026-09-23 the UI writes `record_sessions`** (schema 0009, FR-1.6): the entry's recording switch, which the Agent only reads — off, the watcher does not watch for the program. The script's one data change switches it off for entries an old import made for Steam's own tools (`SteamLibrarySource.KnownTools`, the ids as of the script); a twin merge keeps it off when either twin had it off. **And since 2026-09-25 the Agent's pre-scan of the library (`19_SAFETY` §What a finding does to the game) writes the hook-state columns of every entry, not only of those the user asked to hook** — `hook_prescan_state`, and on a finding `hook_enabled = 0` and `hook_blocked_reason` — and its own key, `hook_prescan_rules_version` / `hook_prescan_exe_size_bytes` / `hook_prescan_exe_mtime_ms` (schema 0010), through `IGameConsentStore.RecordPreScanAsync` only: columns that were already the Agent's, never over a block, never a new row. **And since 2026-09-26 (schema 0014, D33) the Agent writes the user-mode exception's columns** — `ac_exception_*` on `games` through `IGameConsentStore` only (eligibility from the sweep, a grant from the `SetAntiCheatException` command, every end), and `sessions.ac_exception_family` with the session — the grant only after the user accepted its disclosure in the UI, which asks and never writes. **And since 2026-10-03 (beta.11, D40) the Agent deletes sessions on request** — every session of one game or of every game, `DeleteSessions` over the pipe, through `ISessionRepository.DeleteSessionsAsync` in one transaction (segments, blobs and annotations cascade), never while one is being recorded; the UI asks and never deletes a session row itself *(for Delete all sessions; FR-1.4's removal is the App's own cascade, above — corrected 2026-10-04)*. **Maintenance (P4 PR-7) adds no writer:** the retention sweep on demand is the Agent's, asked over the pipe; the UI's `VACUUM` rewrites pages with the same contents and changes no row (§Retention built nLine truncated
|
||||
|
||||
## Schema (v2 — hook architecture)
|
||||
|
||||
@@ -857,7 +857,7 @@ Sequential embedded SQL (`Migrations/0001_init.sql`, `0002_*.sql`, …), applied
|
||||
> (D156); on a game no store file describes. The series are `sensor_blobs` rows named `input.*` (§Blob encoding).
|
||||
> `LatestVersion` is 24; `LedgerDatabaseTests.ScriptTwentyFourAddsTheInputColumnsAndAnEarlierSessionAndGameHaveNone`,
|
||||
> the repository round trip. **Nothing produces a reading yet, and nothing writes the three `games` columns yet**:
|
||||
> the reader, the switch and the store file are the pull requests after this one.
|
||||
> the reader, the switch and the store file are the pull requests after this one *(all three are there since the pull requests that followed: `21_INPUT_DEVICES`, `05_DETECTION` §Does a game support controllers)*.
|
||||
> **A beta.49 cannot open a ledger a later build migrated.**
|
||||
|
||||
> **`0022_dlss_nr.sql` (beta.34, 2026-11-06, owner decision D84) — DLSS 5's neural rendering, measured.** One REAL column,
|
||||
|
||||
+22
-1
@@ -58,7 +58,7 @@ Compare showed the icon alone)*. Light/Dark/System themes via `ApplicationThemeM
|
||||
> **Help ▸ User guide, beta.12 (D44).** `guide/` — ~~eight~~ short English pages for players (install, record a game, read
|
||||
> your results, anti-cheat and safety, your data, questions and answers, the terms in plain words; *since beta.17, D54,
|
||||
> also the screens, every setting, what to do when something goes wrong and the words the App uses — twelve pages,
|
||||
> and the wiki's End-user part*) — embedded in the
|
||||
> and the wiki's End-user part; fourteen since 0.1.0-beta.50, with Advanced metrics (beta.39) and Controllers and input*) — embedded in the
|
||||
> App (`Services.EmbeddedDocuments.Guide`, titles from each page's first heading) and shown in a `Windows/DocumentWindow`
|
||||
> with a page list, Limitations last; a link between guide pages opens the page in the window. Help ▸ Documentation is
|
||||
> *Online documentation*: the README at this build's source. `GuideDocumentsTests` holds every page listed and titled and
|
||||
@@ -656,6 +656,27 @@ Stat cards (Avg uses `FpsReadout`, Median, 1% Low, 0.1% Low, Min/Max, σ, stutte
|
||||
> N % of rendered frames)* heads the line where the game was seen running it, its library listed like the others, *runtime
|
||||
> loaded, not seen running* where the Overlay looked and saw none (D84) — `05_DETECTION` §DLSS generation.)*
|
||||
|
||||
> **0.1.0-beta.50 (D155-D163): Played with.** Above the annotations, in either tier, the summary says what the session
|
||||
> was played with (`Services.InputPresentation`, from the row's stored totals and `sessions.input_devices` - nothing is
|
||||
> recomputed from the series): a line saying how long it was read and how long the game was in front; a bar
|
||||
> (`Controls.InputShareBar`, on `ShareBar`, which `FgMixBar` now derives from too) and a table of the four classes -
|
||||
> a controller, the keyboard and mouse, both at once, no input - each with its share of the time in front and its time;
|
||||
> the number of changes between a controller and the keyboard and mouse; a **Controllers** table (name, connection, in
|
||||
> use, connected, connected / dropped, and the battery: the state held longest and for how long, the first and last
|
||||
> level, the drain); each maker's share where there were two; and one sentence for each thing the reader could not do
|
||||
> or Windows showed twice. A session with no share says why in one line: the terms were not accepted yet, the game was
|
||||
> never in front, or nothing was recorded. Two charts follow from the session's `input.*` series
|
||||
> (`Charts.InputSeries`, gaps kept): **Input over the session** (`InputTimelineChart`: one row a class, a marker a
|
||||
> second, each row named on the axis and each class with a marker shape of its own) and **Controller battery**
|
||||
> (`InputBatteryChart`: a step line a controller, XInput's four levels drawn at thirds and labelled as four levels).
|
||||
> A controller's connections, drops and batteries that fell to low are `InputEvent`s: vertical lines on the timeline
|
||||
> and, behind the **Controller marks** box, on the frame-time chart of a hooked session whose frames say where they
|
||||
> sit on the sensors' clock (`SessionSeries.SensorOffsetS`) - each kind a line pattern of its own, sixty marks at most.
|
||||
> The four classes take palette roles that exist (`ChartPalette.InputFill`: Native, Displayed, Sensor, MixNone), so no
|
||||
> key was added. Trend has `ControllerShare` and `KeyboardMouseShare` (every tier, never partial); Compare has
|
||||
> *Played with* and *Controllers*, never ranked; the CSV has `# input:`. `InputPresentationTests`, `InputChartsTests`;
|
||||
> the summary the sweeps of `PagesLoadTests` draw carries the block. Checked against synthetic sessions only.
|
||||
|
||||
> **beta.27: one window per session, and no DLSS line that says only *DLSS*.** Opening a session whose summary window is
|
||||
> open — from a Sessions tab, a notification, the game page — brings that window forward, restored if minimised, rather
|
||||
> than opening a second (`SessionSummaryOpener`; the owner had two windows of one Silent Hill 2 session, 2026-10-20). The
|
||||
|
||||
+2
-1
@@ -334,7 +334,8 @@ CI/CD with the native build (`release.yml` exists since P4 PR-5, 2026-09-14 —
|
||||
|
||||
## After the controller train — the owner's order (2026-11-14)
|
||||
|
||||
Advanced metrics is closed (D154) and the controller feature is being built as 0.1.0-beta.50's train. Asked what
|
||||
Advanced metrics is closed (D154) and the controller feature ~~is being built as 0.1.0-beta.50's train~~ **was
|
||||
released as 0.1.0-beta.50 (2026-11-15), unproven on a real controller until owner-only item 48**. Asked what
|
||||
comes after, the owner was shown six directions and chose four of them, and added distribution. **This is the
|
||||
order of work after the controller train; each begins with a plan of its own and the owner's approval.** Nothing
|
||||
here is designed yet, and what is marked *to verify* is a lead, not a finding.
|
||||
|
||||
@@ -9,8 +9,9 @@ The numbers a session makes of it are in [`03_METRICS.md`](03_METRICS.md) §Inpu
|
||||
> (`FrameLedger.Domain.Input`, `FrameLedger.Application.Input`, `Application.Recording.InputSessionBuilder`), the
|
||||
> storage (schema 0024, the `.partial` file's chunk 11 — `06_DATA_MODEL`), the reader (`Application.Input.InputReader`,
|
||||
> `Infrastructure.Input`) and its composition into the Agent (`capture.input_devices`, `Application.Input.InputTerms`)
|
||||
> are written and under test. The screens, the store's word and the input libraries come in the pull requests after
|
||||
> this one, and this note is rewritten by each. **No report from a real controller has passed through any of this code**
|
||||
> are written and under test; and a game's page shows the three pieces of evidence for "supports controllers"
|
||||
> (`05_DETECTION` §Does a game support controllers). The session's own screens come in the next pull request, and
|
||||
> this note is rewritten by it. **No report from a real controller has passed through any of this code**
|
||||
> (owner decision D157): the developer has no controller, and what happens on a real one is owner-only item 48.
|
||||
|
||||
## The owner's request and decisions (2026-11-14)
|
||||
@@ -55,6 +56,13 @@ Everything is a Windows API in a library Windows ships. **No third-party library
|
||||
| `GetForegroundWindow`, `GetWindowThreadProcessId` | whose window is in front | already used for the focus sample (`04_CAPTURE`) |
|
||||
| Steam's `appcache\appinfo.vdf`, on the disk | whether the store lists controller support for a library game | a local file: no request is made (rule 8) |
|
||||
|
||||
**The time `GetLastInputInfo` gives is compared only with the time it gave before** — "did it change since the last
|
||||
slice". It is never set against a clock of .NET's. *Measured 2026-11-15, by accident*: on the developer PC, which
|
||||
had slept for five hours since it started, that time and `Environment.TickCount` stood five hours apart — Windows'
|
||||
tick counts the time asleep and .NET's does not — and a test that assumed one clock failed (it now asks only that
|
||||
the time does not go back). Anything built on these times later — the time actually played, `15_ROADMAP` §After the
|
||||
controller train — must work in differences of this one source, or it breaks on every PC that sleeps.
|
||||
|
||||
**Rejected, with the reason** (the checklist of `18_GPU_VENDOR_APIS` §Checklist applies to any library):
|
||||
|
||||
- **Windows.Gaming.Input** — its readings stop when the program is not in front, which the Agent never is.
|
||||
@@ -166,3 +174,26 @@ registration, how many reports came and how many could not be read, whether XInp
|
||||
states it returned, how often a controller's own reports said *in use* while XInput said nothing, whether the time of
|
||||
the last input could be read, how many slices were taken and how much processor time the reader's thread used. Counts
|
||||
and yes-or-no answers; nothing in it names a device.
|
||||
|
||||
## In the App
|
||||
|
||||
`08_UI` §Session summary has the detail; the short of it (0.1.0-beta.50):
|
||||
|
||||
| Where | What | From |
|
||||
|---|---|---|
|
||||
| A session's summary, **Played with** | the four classes as a bar and a table, the changes between a controller and the keyboard and mouse, the controllers with their batteries, the makers' shares, what the reader could not do; why a session has none | the row's `input_*` columns and `input_devices` (`Services.InputPresentation`) |
|
||||
| The same, two charts | what each second was played with; each controller's battery | the `input.*` series (`Charts.InputSeries`) |
|
||||
| The frame-time chart, **Controller marks** | a connection, a drop, a battery that fell to low, as lines across the frames | the same series, placed by `frame_blobs.first_present_ms`; hooked sessions only |
|
||||
| A game's page, **Details** | what the store lists, the input libraries loaded, how it was played | `05_DETECTION` §Does a game support controllers |
|
||||
| **Trend** | Controller share, Keyboard and mouse share | the row, every tier |
|
||||
| **Compare** | Played with, Controllers | the row, never ranked |
|
||||
| The CSV export | `# input:` - the milliseconds, the switches, the sources, each controller | `03_METRICS` §Export schema |
|
||||
| The JSON export, the bug report | the row's columns as they are | Privacy Policy 3A |
|
||||
|
||||
A mark is drawn from the series, not from the row: a controller's `input.dev.N.active` goes from no value to a value
|
||||
where it connected and back where it dropped, and the row's `connects` says whether the first of them was the
|
||||
session's start. A battery "fell to low" where its level went from above XInput's *low*, or above 10 %, to at or
|
||||
under it - a falling level is a battery running down, and the state is not in the series.
|
||||
|
||||
**Everything in this table has been drawn from synthetic sessions only.** What a real controller's series look like -
|
||||
how often a Bluetooth pad flaps, whether a DualSense's battery steps as the fixture's does - is owner-only item 48.
|
||||
+187
-107
@@ -88,6 +88,7 @@ owner-only items stay below; the history of every train, the passed owner-only i
|
||||
| `§beta.46`, what the owner's five sessions on beta.46 showed (item 44), the design of the train that followed as the plan's review left it (`§The train after 0.1.0-beta.46`), that release's facts, the traps of that train | [`handoff/history/0.1.0-beta.46.md`](handoff/history/0.1.0-beta.46.md) |
|
||||
| `§beta.47`, what that release decided beyond D136–D141, what item 44's last part showed, that release's facts, the traps of that train, its NEXT as the owner's sessions of 2026-11-14 changed it | [`handoff/history/0.1.0-beta.47.md`](handoff/history/0.1.0-beta.47.md) |
|
||||
| `§beta.48`, what that release decided beyond D142–D147, that release's facts, the traps of that train, its NEXT and its "Left open" as item 46 changed them | [`handoff/history/0.1.0-beta.48.md`](handoff/history/0.1.0-beta.48.md) |
|
||||
| `§beta.49`, what that release decided beyond D148–D151, that release's facts, the traps of that train, its NEXT and its "Left open" as item 47 and D152–D154 changed them | [`handoff/history/0.1.0-beta.49.md`](handoff/history/0.1.0-beta.49.md) |
|
||||
| `§Owner-only`, an open item | [§Owner-only](#owner-only--no-pr-can-close-these) below |
|
||||
| `§Owner-only`, a passed item (3, 12, 14–19, 38, 39) | [`handoff/owner-only-passed.md`](handoff/owner-only-passed.md) |
|
||||
| `§Traps`, `§Two corrections carried forward` | [`handoff/traps.md`](handoff/traps.md) |
|
||||
@@ -95,126 +96,146 @@ owner-only items stay below; the history of every train, the passed owner-only i
|
||||
|
||||
---
|
||||
|
||||
## **START HERE** — 2026-11-14, 0.1.0-beta.49: item 46 read; the frames counted for the log, Reflex and frame generation together; a read a second on a grid; the Agent keeps the reading that waits
|
||||
## **START HERE** — 2026-11-15, 0.1.0-beta.50: what a session was played with — controllers and input, read from outside the game, and built without a controller
|
||||
|
||||
*Status is `docs/changelog/0.1.0-beta.49.md`; this is what no other file carries.* The owner ran item 46 on
|
||||
beta.48 the afternoon it was released — ten sessions, then eight more — and said: check (#455, and item 46's last
|
||||
paragraphs, below). The read works, the samples are a second apart, both games give both of the driver's own
|
||||
times, the multipliers are listed, off means off, **and the owner's word: no hitch**. Two things were left, the
|
||||
owner said *do both*, and four answers given while planning made the train (D148–D151): #456 (the Overlay counts
|
||||
each summed frame for its log), #457 (the watchdog's periodic tick on a grid), #458 (the Agent keeps the reading
|
||||
that waits; the guide on whose switches the table shows), and this release. **beta.48's own section, its traps
|
||||
and its release facts are [`handoff/history/0.1.0-beta.48.md`](handoff/history/0.1.0-beta.48.md).**
|
||||
*Status is `docs/changelog/0.1.0-beta.50.md`; this is what no other file carries.* On 2026-11-14 the owner asked
|
||||
for nine things about controllers: whether a game supports them, on the game's page; which interfaces and
|
||||
libraries; the share of a session played with a controller and with the keyboard; connections and drops; the
|
||||
battery state that lasted longest; all of it stored and charted; changes between makers and each one's share; Xbox
|
||||
controllers and the DualSense first; and whatever rounds it out. Nine answers given while planning made the
|
||||
train (D155–D163, `21_INPUT_DEVICES` §The owner's request and decisions): #464 (the arithmetic), #466 (schema
|
||||
0024 and the `.partial` file's chunk 11), #467 (the reader), #468 (the Agent, the switch, Privacy Policy 2.22
|
||||
and Disclaimer 2.18, Tier 2's definition), #469 (what a store lists, the input libraries, the game's page),
|
||||
#470 (the session's summary, the charts, Trend, Compare, the export, the guide's page), and this release — which
|
||||
also carries D152 and D154 from `[Unreleased]`. **beta.49's own section, its traps, its release facts and its
|
||||
"Left open" are [`handoff/history/0.1.0-beta.49.md`](handoff/history/0.1.0-beta.49.md).**
|
||||
|
||||
### What this release decided, beyond D148–D151
|
||||
### The one thing to know: nothing here has met a controller
|
||||
|
||||
- **The counts are of each frame's own two numbers, with sums, and no threshold.** The draft counted spans of no
|
||||
length; a sample whose mean span is half a microsecond says spans of one or two microseconds exist, and a count
|
||||
of exact zeros would have read "the driver's" where it was "ours". So the frames that have both a span and an
|
||||
active time are kept in two heaps — active longer than the span, or not — each with its count and both sums.
|
||||
- **A batch's state is three things**: the driver's low-latency switch, its "the game sleeps" switch
|
||||
(`bUseGameSleep`: NVAPI's "is `NvAPI_D3D_Sleep()` being called") and its frame-generation multiplier. The second
|
||||
was added on the owner's word — Reflex goes with frame generation in the owner's games, and the low-latency
|
||||
switch can be the NVIDIA App's override — and Clair Obscur's two sessions read exactly that: `bUseGameSleep`
|
||||
off throughout without frame generation, on with ×3.
|
||||
- **Only the driver read and the publication are the periodic tick's.** The request is still followed on every
|
||||
tick, so the hooks a session asks for go in on the tick the loader woke — a game that has just loaded
|
||||
Streamline calls it at once. A draft that moved the whole block would have missed those calls.
|
||||
- **One read is armed at every periodic tick, and the grid is what keeps two apart**: half a second at the least,
|
||||
after a tick that ran that late. "At most once a second" is no longer said anywhere.
|
||||
- **A session's first publication may hold a moment's worth.** A request seen on a woken tick is published by the
|
||||
periodic tick that follows, however soon. One test read a single publication as complete and had to stop.
|
||||
- **The Agent keeps two sets, and an empty one does not wait.** A reading can stand at the sample after the one it
|
||||
would have ridden — a second later. With the sensor interval above a second the oldest is still pushed out.
|
||||
- **No legal text changed (D149)**, although a bug report carries the Overlay's logs and so these lines: the
|
||||
owner was told and chose it. The Privacy Policy names the logs of the component loaded into games.
|
||||
- **The plan was reviewed against the source by a second reader before the owner saw it, and sixteen things in
|
||||
the draft were wrong** — among them the three above, and the whole of the Agent's half, which the draft did not
|
||||
have.
|
||||
**The developer has no controller, and the owner chose to build without a probe run first (D157).** So:
|
||||
|
||||
- **Checked against a real Windows, with no controller connected**: `Win32InputBackendTests` (the registration is
|
||||
accepted, the window drains, the reader reports "no controller"); the shipped Agent in a scratch data folder
|
||||
(`tools/agent-cost.ps1 -Keep`) stored `input_observed_ms` 29 826 of a 30.9 s session, `input_source`
|
||||
`rawinput+xinput+lastinput`, the `input.class` series and the reader's counters, and stored nothing with the
|
||||
option off or the terms not accepted; the Agent's cost per second of session was inside the run-to-run noise
|
||||
(2.06 % of a core without, 1.54 % with — `20_OPEN_QUESTIONS` §M17).
|
||||
- **Checked against the owner's own file**: the Steam app's `appinfo.vdf` on the developer PC parsed to 3 581
|
||||
records — 1 284 full, 440 partial, 1 857 with no entry.
|
||||
- **Checked against bytes and sessions written by hand, and against nothing else**: every DualSense report
|
||||
layout, XInput's states and battery words, a background program being given a controller's reports at all,
|
||||
Steam's virtual pad and the fold that makes one controller of two, the battery arithmetic, the marks, every
|
||||
share the App shows, and the reader's cost with a controller connected.
|
||||
|
||||
`LIMITATIONS.md`, the accuracy statement, the guide's page and the release's notes all say so. **Item 48 is where
|
||||
it meets the owner's Xbox controller and DualSense.**
|
||||
|
||||
### What this release decided, beyond D155–D163
|
||||
|
||||
- **Only Xbox-compatible controllers (through XInput) and the DualSense (through its own reports) are read for
|
||||
use.** Any other controller is listed with its connections and is never "in use": the reader parses no other
|
||||
report, and `LIMITATIONS.md` says so. Adding one is a parser in `Domain/Input` and bytes to test it with.
|
||||
- **A DualSense's transport decides how its report is read, not the report's length**: Windows pads the short
|
||||
Bluetooth report to the device's longest, so `DualSenseReport.TryRead` takes the transport.
|
||||
- **"Both at once" is a class of its own**, in the table, the bar and the series. Trend's *Controller share* and
|
||||
*Keyboard and mouse share* are the two exclusive classes; neither includes "both".
|
||||
- **A mark is made from the series**: a controller's `input.dev.N.active` going from no value to a value is a
|
||||
connection; a battery "fell to low" where its level crossed XInput's *low*, or 10 %, downwards. The row's
|
||||
`connects` decides whether the first rise was the session's start. Sixty marks a chart at most.
|
||||
- **Steam's `appinfo.vdf` is read in format 41 only**; another format is refused with the reason, and the game's
|
||||
page says N/A.
|
||||
- **`InputTerms.MinimumPrivacyVersion` is `2.22` and is compared as "at least"**: a later Privacy Policy does not
|
||||
stop the reading, and the next change to what is read raises the number in the same pull request.
|
||||
- **No chart colour was added**: the four classes use roles the palette has. Under a Windows contrast theme two
|
||||
of them share a colour; `ACCESSIBILITY.md` §Known limitations says what tells them apart.
|
||||
- **`ShareBar`** is the base of `FgMixBar` and `InputShareBar`.
|
||||
|
||||
### Traps this train left
|
||||
|
||||
- **A cause I offered and then counted away**: "the holes are the sensor library's fifth tick" — 25 of 134 fell on
|
||||
one. The pattern that was there (46 of 134 exactly five samples apart) was the Agent's own attach rule, found
|
||||
by reading `SessionRecorder`, not by looking harder at the Overlay.
|
||||
- **A fixture that proved nothing**: the case for a woken watchdog first churned `sl.common.dll`, which wakes
|
||||
nobody — it is in neither the inventory nor the census — and passed. It was caught only because the case
|
||||
asserts, from the log, that the watchdog *was* woken (0 early ticks). **A test of a mechanism asserts that the
|
||||
mechanism ran.** `opengl32.dll` is the wake that unloads nothing under a hook.
|
||||
- **Qodana's native report reads the tests**: `static_cast<unsigned long long>(a * b)` is
|
||||
`bugprone-implicit-widening-of-multiplication-result`. Widen an operand, not the product.
|
||||
- **A here-document with an apostrophe in it failed again.** Edit scripts are files.
|
||||
- **No edit while a gate runs still holds when CI asks for one**: the Qodana fix went into a second worktree of
|
||||
the lower branch, and reached the upper one by a merge.
|
||||
- **The item's own text said "nothing is lost by it" of the holes**, on a reading of the Overlay alone. A reading
|
||||
was lost at every return to step. Say what was looked at.
|
||||
- **A stack of pull requests that are squash-merged**: when the lower one merges, GitHub deletes its branch and
|
||||
retargets the upper one to `main`, which then conflicts with itself. Check `git diff origin/main <the lower
|
||||
branch's last tip>` is empty, then `git merge -S -s ours origin/main` on the upper branch, and merge that up
|
||||
the stack. **Look at `gh pr view` before pushing to a lower branch**: a push to a branch GitHub deleted
|
||||
re-creates it (it happened once here, and the branch was deleted again).
|
||||
- **An edit script that is run twice must change nothing the second time.** Two of this train's were not: the
|
||||
guide's settings page listed *Controllers and input* twice (#468; fixed in #469) and `CLAUDE.md`'s layout said
|
||||
the input types twice (#468; fixed in this pull request).
|
||||
- **A picture of a window from a test does not show its charts**: ScottPlot's control does not draw through a
|
||||
`VisualBrush`. Save each plot with `Plot.SavePng`. The picture is how two legends that covered their charts
|
||||
were found; the test is not in the tree.
|
||||
- **`MarkdownRendererTests` counts the embedded documents**: a new guide page is one more.
|
||||
- **`plot.Add.Scatter([..], [..])` does not compile** — two overloads fit a collection expression; name the arrays.
|
||||
- **A test cannot call `ChartPalette.For`**: it needs the App's resources. Parse the palette's XAML, as
|
||||
`ChartMathTests` does.
|
||||
- **FluentAssertions' `OnlyContain` fails on an empty collection** — which is what the real backend returns on a
|
||||
PC with no controller.
|
||||
- **A stored session of the test ledger with frames takes its own sensor blobs now** (`SessionWithFramesAsync`'s
|
||||
`sensors`), with their own `t_ms`.
|
||||
- **`GetLastInputInfo`'s time is not on `Environment.TickCount`'s clock once the PC has slept**: five hours apart
|
||||
on the developer PC after a sleep of five hours. The reader never compares the two; a test of #467 did, passed
|
||||
on every runner (they do not sleep) and failed the local gate before this release — fixed here
|
||||
(`21_INPUT_DEVICES` §What is read). **The time actually played, next on the roadmap, must not make the same
|
||||
assumption.**
|
||||
- **Auto-merge does not wait for Qodana: it is advisory.** #470 merged with one notice of Qodana's on `main` (a
|
||||
parameter used only for its null check) — a notice counts against the gate of zero, and the script that read the
|
||||
local inspection's SARIF skipped notices. Fixed in this pull request, and the script counts them now. With
|
||||
auto-merge on, read Qodana's report **before** the required checks finish, or enable auto-merge after it.
|
||||
- **`dotnet format --verify-no-changes` through a pipe that counts lines says nothing when it fails** — print its
|
||||
exit code. #470's first push carried a naming violation in a test fixture that way; `check` and the first
|
||||
rehearsal (run 43646963371) caught it, and the second rehearsal is of the fixed tree.
|
||||
|
||||
### NEXT
|
||||
|
||||
1. ~~**The owner runs item 47**~~ **Run and read 2026-11-14** (item 47, *Run 2026-11-14*): the difference in
|
||||
Cyberpunk 2077 is the driver's, the holes are gone from steady play, off means off, and the stop fired once.
|
||||
2. **The two GPU labels were reworded on the owner's word** (D152, 2026-11-14; strings in three languages, the
|
||||
guide — in `[Unreleased]`, not in a release yet). **D141's stop stays as it is, and nothing more of Reflex is read** (D153, the owner
|
||||
the same evening: "it only has to tell whether the game has it or not; Kingdom Come: Deliverance II has no
|
||||
Reflex in its settings" — so that session lost nothing to the stop). (f) and (g) are said: the App's *Low
|
||||
Latency Mode* is off, and no hitch.
|
||||
3. **`slAllocateResources`** keeps its patch (D135); looked at again when there are more sessions.
|
||||
4. ~~**Train D**~~ **Advanced metrics is closed (D154, 2026-11-14): train D is not built.** The owner was shown
|
||||
the catalog — 140 entries, 110 read — and what the ten entries of reach `Spike` hold (Streamline's own headers,
|
||||
2.14.16: DLSS frame generation's options and state, the video-memory estimates, ray reconstruction's, Image
|
||||
Scaling's and Dynamic Vibrance's options, the PCL markers), with what reading them takes: a function of ours
|
||||
handed to the game in place of Streamline's (rule 4), which a game that fetched its functions before the
|
||||
attach never calls. The owner: "Đóng luôn". The ten are `RefusedRoute` now, the guide no longer says a later
|
||||
release reads more, and §M15 is decided. **What is next is the controller feature**, planned in a session of
|
||||
its own.
|
||||
1. **The owner runs item 48** and says *check*; a copy of the ledger and the Agent's log are read. What it shows
|
||||
comes first: a route that failed is said in `LIMITATIONS.md`, a layout that is wrong is a parser fix with the
|
||||
owner's bytes as its test, and the accuracy statement's sentence about controllers is the owner's to reword
|
||||
once they have been read.
|
||||
2. **Then the order the owner set on 2026-11-14: [`15_ROADMAP.md`](15_ROADMAP.md) §After the controller train.**
|
||||
It is not repeated here. Its first item uses what this train stores.
|
||||
|
||||
### Left open by this session
|
||||
|
||||
- ~~**This release's own facts** — the tag's run, the digests, the delta — are not in any file yet: the release is cut
|
||||
after this text. Record them in the next pull request, with what SonarCloud and Qodana said.~~ **Recorded
|
||||
2026-11-14: 0.1.0-beta.49 was released 2026-11-14T11:12:44Z** (18:12 in the owner's time zone) from the signed
|
||||
tag on `afe4984` (#459), by run 43587336452 — green at the first attempt, one run for the one tag push. Eight
|
||||
assets; the seven digests of `SHA256SUMS.txt` equal the ones GitHub computed, and the portable package hashed
|
||||
here equals its line; the five native libraries in it carry `FL_BUILD_ID v0.1.0-beta.49`, none of them
|
||||
`-dirty`. The delta from beta.48 is 1 100 211 bytes beside a full package of 110 803 443 — "Delta processed
|
||||
0452 files. 0023 patched, 0429 unchanged". The wiki was published by run 43588972123. **Two rehearsals on the
|
||||
release branch**: run 43580081466 at `1ab2809`, and — after a test-only fix reached the branch — run
|
||||
43581734484 at `9f94356`, whose tree is the released one (a delta of 1 134 949 bytes, the same file counts).
|
||||
**SonarCloud analysed `afe4984`: the quality gate passed and no issue is open on `main`. Qodana's two reports,
|
||||
CodeQL and `check` are green on that commit.** On the way two advisory checks did find something, each in a
|
||||
test of this train and each fixed before its pull request merged: Qodana's native report on #456 (two
|
||||
products widened after the multiplication), SonarCloud on #457 (a line of the log handed to `printf`). **The
|
||||
train stopped once for the owner**: two signed merges timed out at the passphrase prompt after #457; it went on
|
||||
when the owner had unlocked the key. The tag's message reads `FrameLedger 0.1.0-beta.49` where the tags before
|
||||
it read the bare version — nothing reads it, and a pushed tag is not moved.
|
||||
- **Why Cyberpunk 2077's active render is longer than its span without frame generation** — item 47's to say. A
|
||||
third session that afternoon repeated it (233: 3.40 against 3.13 ms at 292 of 296 samples) and a session of
|
||||
menus did not (232: 0 of 126).
|
||||
- **The Agent's half of the holes is read from the code and fits the ledger; it is not measured.** And with both
|
||||
sides on a second a slip of phase can still leave a sample without a report: item 47 counts them.
|
||||
- **A game that exits by itself loses the batch of counts in hand** — under a minute. Not changed: nothing runs
|
||||
at a process's exit.
|
||||
- **Where the third of a second of a poll goes is not established** (the history file of beta.48 has what is
|
||||
known). Not looked at in this train.
|
||||
- **With the sensor interval above one second, some readings of the driver's report are not stored** — the oldest
|
||||
of the two that wait is pushed out. Said in the guide; not changed.
|
||||
- **No test runs the whole path through the real Agent**: the injected tests stop at the shared memory, the
|
||||
sampler's and the pending queue's start from it.
|
||||
- **Two install batches of beta.46 took 0.61 s and 1.26 s and nothing explains them.** Item 46's ten sessions had none
|
||||
above 191 ms.
|
||||
- **The Japanese strings are unreviewed**, as every `ja` string is; this release added none.
|
||||
- **(c) and (h) of item 43**, which only the owner sees, are still not exercised.
|
||||
- **Valor Mortis's crash at 51 s** (twice, beta.40 and beta.44) **and Black Myth: Wukong's fault in Steam's crash
|
||||
handler at every exit** are not explained. One session of each with hooking off is the comparison that is missing.
|
||||
- **What item 41 left unexercised**: a configure through the FidelityFX 2.3 loader (Cyberpunk 2077 with FSR frame
|
||||
generation), a game with neither library.
|
||||
- **A fault while a game is closing is not seen by a hooked session** (D127: written down, not changed).
|
||||
- **`docs/LIST_GAME_TESTED.md` is as of 2026-11-06**: refreshing it is a new copy of the ledger and the owner's review.
|
||||
- **Item 40 (d)** was not exercised and the owner has not said item 40 passed. **Items 36 (d) and 37 are still open.**
|
||||
- **`LIMITATIONS.md` and the accuracy statement still say the processor's, the memory's and the motherboard's
|
||||
sensors "have never been read on real hardware"** — the owner's to reword. The alpha line still rests (D98).
|
||||
- ~~**This release's own facts** — the tag's run, the digests, the delta, what SonarCloud and Qodana said of the
|
||||
released commit — are not in any file yet: the release is cut after this text. Record them in the next pull
|
||||
request.~~ **Recorded 2026-11-15: 0.1.0-beta.50 was released 2026-11-14T23:41:15Z** (06:41 on 2026-11-15 in the
|
||||
owner's time zone) from the signed tag on `5764d21` (#471), by run 43652686348 — green at the first attempt, one
|
||||
run for the one tag push. Eight assets; the seven digests of `SHA256SUMS.txt` equal the ones GitHub computed,
|
||||
and the portable package hashed here equals its line; the five native libraries in it carry `FL_BUILD_ID
|
||||
v0.1.0-beta.50`, none of them `-dirty`, and both entry points are there. The delta from beta.49 is 3 099 231
|
||||
bytes beside a full package of 111 085 471 — "Delta processed 0452 files. 0026 patched, 0426 unchanged". The
|
||||
wiki was published by run 43654502311 (31 pages, the new *Controllers and input* among them). **The tag's
|
||||
message reads `0.1.0-beta.50`**, the bare version again.
|
||||
**Three rehearsals on the release branch, and the third is of the released tree**: run 43646963371 at `9c69a32`
|
||||
failed in the quality gate on a naming violation in a test fixture of #470; run 43648289839 and run 43649328136
|
||||
were cancelled as the tree moved (the test of the last-input time; Qodana's notice); run 43650415247 at
|
||||
`d6e4685` passed, and `main` at `5764d21` is that tree (a delta of 3 112 641 bytes, the same file counts).
|
||||
**`./build.ps1 check` ran green on the developer PC at `6dadd05`**; the two commits after it were inspected
|
||||
(ReSharper's InspectCode, no problem of any severity) and the App's suite run again. The owner's
|
||||
`%LOCALAPPDATA%\FrameLedger\rules` hashed the same before and after.
|
||||
**SonarCloud analysed `5764d21`: the quality gate passed. Qodana's two reports, CodeQL and `check` are green
|
||||
on that commit.** On the way: Qodana's managed report on #470 was red with one notice when auto-merge merged
|
||||
it (fixed in #471, §Traps); SonarCloud passed #467 (81.4 % of new code covered) and #468 (83.6 %).
|
||||
**One date is two dates**: the changelog, the README and this file say 2026-11-15, the owner's day; GitHub
|
||||
shows the release on 2026-11-14 (UTC), and the legal texts in the installer are stamped 2026-11-14, the day
|
||||
`release.yml` reads from UTC. Nothing reads either; a train that ends before 07:00 in the owner's time zone
|
||||
will show it again.
|
||||
- **The reader's cost with a controller connected is not measured** (`20_OPEN_QUESTIONS` §M17 f). With none it is
|
||||
inside the noise.
|
||||
- **A game run as administrator under an Agent that is not** has not been tried: Windows may not report input
|
||||
into it. Item 48 (j).
|
||||
- **Only Steam is read for what a store lists.** GOG, Epic, the Xbox app and itch read N/A.
|
||||
- **The new block was looked at as pictures, in the dark and the light theme, not used by hand**; its rendering
|
||||
under a contrast theme was reasoned from the palette, not looked at.
|
||||
- **The Japanese strings are unreviewed**, as every `ja` string is; this train added about a hundred.
|
||||
- **A session that was read while its game was never in front shows its controllers and no share** — by design;
|
||||
whether that reads well is the owner's to say.
|
||||
- **Carried from beta.49, unchanged** (its history file has each in full): the two long install batches of
|
||||
beta.46; Valor Mortis's crash at 51 s and Black Myth: Wukong's fault at exit; what item 41 left unexercised;
|
||||
item 40 (d), items 36 (d) and 37; (c) and (h) of item 43; `docs/LIST_GAME_TESTED.md` is as of 2026-11-06;
|
||||
`LIMITATIONS.md` and the accuracy statement on the processor's, memory's and motherboard's sensors are the
|
||||
owner's to reword; the alpha line rests (D98).
|
||||
|
||||
**Owner-only:** item 47; one session each of Valor Mortis and Black Myth: Wukong with hooking off; what item 41
|
||||
**Owner-only:** item 48; one session each of Valor Mortis and Black Myth: Wukong with hooking off; what item 41
|
||||
left unexercised; item 40 (d).
|
||||
|
||||
## Owner-only — no PR can close these
|
||||
@@ -1011,6 +1032,65 @@ left unexercised; item 40 (d).
|
||||
Latency: On**, V-Sync off, borderless at 2560×1440, 378 FPS on the game's counter. So the driver's
|
||||
`bLowLatencyMode` on, at a multiplier of 1, is the game's menu, seen from both sides. **The owner's**: the wording of the two GPU labels — *idle time excluded /
|
||||
included* does not describe a game whose active time is the longer.
|
||||
48. **beta.50 — what a session was played with, read from real controllers** (D155–D163). **Everything this
|
||||
release shows of controllers was built and checked against data written by hand: the developer has no
|
||||
controller** (D157). This batch is the first time any of it meets one. **Not first on a game under the
|
||||
user-mode exception's trial** (D38). Then say *check*; a copy of the ledger and the Agent's log are read.
|
||||
(a) **The update shows the terms window once** (Privacy Policy 2.22, Disclaimer 2.18): accept it. If a game was
|
||||
recorded after the update and before FrameLedger was opened, its summary says *Not read in this session* —
|
||||
that is the terms being waited for (D156), not a fault.
|
||||
(b) **The Xbox controller**: one session on its cable, one on Bluetooth, one on the wireless adapter if there
|
||||
is one. Five minutes each, played with the controller.
|
||||
(c) **The DualSense**: one session on its cable, one on Bluetooth.
|
||||
(d) **Steam Input**: the DualSense in a Steam game with Steam Input on for it, and the same game with Steam
|
||||
Input off.
|
||||
(e) **One session, in this order, about two minutes each**: only the controller; only the keyboard and mouse;
|
||||
hands off both; then Alt+Tab to another window and type there for a minute; then back to the game.
|
||||
(f) **Unplug the controller and plug it back twice in one session** (or switch it off and on), noting roughly
|
||||
when.
|
||||
(g) **One session that starts on the Xbox controller, changes to the DualSense, and changes back.**
|
||||
(h) **A game played with the keyboard and mouse only, no controller connected.**
|
||||
(i) **A game that is not measured from inside** (hooking off, or refused) played with a controller.
|
||||
(j) **A game run as administrator** while FrameLedger's Agent is not — if one is at hand.
|
||||
(k) **One session with Settings ▸ Controllers and input off**; switch it back on afterwards.
|
||||
(l) **A Steam game's page and a page of a game from another store**: the three rows at the end of *Details*.
|
||||
(m) **How the games felt** — the reader looks ten times a second; a hitch at that rhythm, or when a controller
|
||||
connects, is what to listen for.
|
||||
**What each outcome means, written before the run.**
|
||||
*(e): the three stretches read near two minutes each in their own class, and the minute typed elsewhere is in
|
||||
no class — the time in front is a minute shorter than the time read* — the definitions hold on real input.
|
||||
*The minute typed elsewhere is counted as keyboard and mouse* — the test for "the game is in front" is wrong
|
||||
for that game (a window owned by another process, a launcher): say the game; `LIMITATIONS.md` names the case.
|
||||
*The controller-only stretch reads as "both"* — something makes keyboard or mouse input while the controller
|
||||
is used: Steam Input mapping it, the pad moving the pointer. Say which session; with Steam Input off (d) it
|
||||
should read "controller".
|
||||
*A controller was played with and is never "in use"* — look at the session's sources and the Agent's line
|
||||
`input: run ended`: no reports with the registration accepted means Windows did not deliver a background
|
||||
program that controller's reports on this PC; XInput silent means XInput answers only the program in front.
|
||||
Either is a route that failed, said with its counters — and the App said N/A or "not in use", never a made-up
|
||||
share.
|
||||
*The Xbox controller reads "wired" on its cable, and four levels or nothing on Bluetooth; the DualSense reads
|
||||
steps of ten per cent on its cable, and on Bluetooth a level only if something else had switched its full
|
||||
reports on* — as `LIMITATIONS.md` says. Anything else is recorded and that page reworded.
|
||||
*Steam Input on: one controller is listed, marked "also shown to games as an Xbox pad"* — the fold works. *Two
|
||||
are listed, the DualSense and an Xbox pad* — it missed: give both rows' times in use.
|
||||
*(f): the connections and drops equal the times it was done, and the marks sit where it was done* — the counts
|
||||
are right. *More* — the connection flaps, or a controller that sleeps is counted as dropped: say the counts.
|
||||
*(g): "By maker" shows both with two changes* — the owner's seventh point holds.
|
||||
*(h): "No controller was connected during this session", and the keyboard and mouse have nearly all the time
|
||||
in front.* *(i): the block is there in a session that was not hooked.*
|
||||
*(j): every share is "no input" though the game was played* — Windows does not tell a program that is not
|
||||
elevated about input into one that is: say so, and it goes into `LIMITATIONS.md` as measured.
|
||||
*(k): the summary says "Not recorded for this session" and the row has no input figures* — off means off.
|
||||
*(l): the Steam game says full, partial or "lists none"; the other says N/A; "Input libraries loaded" names a
|
||||
library after a measured session.*
|
||||
*The Agent's `input: run ended` lines*: the thread's processor time over the session's length. NFR-2 leaves
|
||||
0.46 % of a core; a session with a controller is the first measurement of this (`20_OPEN_QUESTIONS` §M17 f).
|
||||
Above that, say the number.
|
||||
**A hitch every tenth of a second, a stutter when a controller connects or drops, a game that loses the
|
||||
controller while FrameLedger records, or a fault**: switch *Controllers and input* off, say so, and send the
|
||||
Agent's log. FrameLedger opens no controller and sends nothing to one (D159) — a controller that misbehaves
|
||||
only while it records would contradict that and is the most important thing this batch could find.
|
||||
|
||||
**Answered 2026-08-05, do not re-ask:** remove `gameguard` and keep `guard` (approved
|
||||
over a red `Rules` gate, with the reasoning recorded in the merge commit); vendor NVAPI
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
<!-- Moved from CHANGELOG.md's [Unreleased] when 0.1.0-beta.50 was cut, 2026-11-15 (D66). CHANGELOG.md lists every release. -->
|
||||
|
||||
## [0.1.0-beta.50] - 2026-11-15
|
||||
|
||||
**The fiftieth pre-release: what a session was played with.** FrameLedger now notes, with every session, whether
|
||||
the game was played with a controller, with the keyboard and mouse, with both at once or with nothing — and which
|
||||
controllers were connected, for how long, how often they connected and dropped, and how their batteries did. It
|
||||
reads this from Windows, **outside the game**, so it is there for every game you record, measured from inside or
|
||||
not. The same unsigned installer: verify its hash against `SHA256SUMS.txt`, then *More info → Run anyway*.
|
||||
|
||||
**The terms window appears once: Privacy Policy 2.22 and Disclaimer 2.18.** Both used to say FrameLedger never
|
||||
reads input. It now reads that a controller, or the keyboard or mouse, **was in use** — never which button, stick
|
||||
or key, never text, never where the mouse is, never a serial number or a Bluetooth address — and it sends nothing
|
||||
to a controller. **Nothing of this is read until you have accepted the new terms**, and Settings ▸ Recording ▸
|
||||
*Controllers and input* switches it off altogether.
|
||||
|
||||
**Read this before you rely on it: none of it had been read from a real controller when this was released.** The
|
||||
developer has none. Every figure was checked against sessions written by hand, and each part of the reader says
|
||||
in the session what it could and could not do. The owner's Xbox controller and DualSense are the first real ones
|
||||
it meets, after this release; what they show goes into the next one. Until then, treat the controller figures as
|
||||
new and unproven — a share that looks wrong may be wrong.
|
||||
|
||||
**What you will see.**
|
||||
- **A session's summary has a section, *Played with***: a bar and a table of the time the game was in front by
|
||||
what it was played with; how often you changed between a controller and the keyboard and mouse; each controller
|
||||
with its connection, its time in use and connected, how often it connected and dropped, and its battery — the
|
||||
state it was in longest and for how long; each maker's share when you used two; a chart of the whole session
|
||||
second by second, and a chart of each battery. On a measured session's Frametime chart, *Controller marks* draws
|
||||
a controller's connections, drops and low batteries across the frames.
|
||||
- **A game's page ends its *Details* with three rows about controllers** — what Steam lists for the game (read
|
||||
from the Steam app's own file on your PC; nothing is looked up online), which of Windows' controller libraries
|
||||
the game had loaded, and how you have actually played it. Three pieces of evidence: FrameLedger does not decide
|
||||
whether a game "supports controllers".
|
||||
- **Trend** has *Controller share* and *Keyboard and mouse share*; **Compare** shows what each session was played
|
||||
with; a CSV or JSON export, and a bug report, carry the same figures and each controller's model name — say so
|
||||
before you share one.
|
||||
- **The user guide has a page for it**, *Controllers and input*, and `LIMITATIONS.md` lists what it cannot tell:
|
||||
it knows a controller was in use while the game was in front, not what the game did with it; the keyboard and
|
||||
the mouse are one class; Xbox-compatible controllers and the DualSense are read for use, others are only listed;
|
||||
a battery level is there only when the controller reports one to Windows.
|
||||
|
||||
**Also in this release**, from before the controller work: the two lines of the graphics card's time under
|
||||
*Latency* say what each figure is (D152), and Advanced metrics is closed — the ten Streamline readings that were
|
||||
"being studied" are "not read", with the reason (D154).
|
||||
|
||||
**A session that was not measured from inside** now has more than its length, its sensors and the reason: it has
|
||||
the game's memory and what it was played with — everything FrameLedger reads from outside the game (D161).
|
||||
|
||||
### Added
|
||||
|
||||
- **A session's summary says what it was played with** (owner decisions D155-D163): **Played with** — a bar and a table
|
||||
of the time the game was in front that was played with a controller, with the keyboard and mouse, with both at once
|
||||
and with no input; how often you changed between them; each controller of the session with its connection, the time
|
||||
in use and connected, how often it connected and dropped, and its battery — the state it was in longest and for how
|
||||
long, the first and last level, how fast it ran down; and each maker's share when two were used. Two charts follow:
|
||||
**Input over the session** and **Controller battery**. On a measured session's Frametime chart, **Controller marks**
|
||||
draws a controller's connections, drops and low batteries across the frames. For every session, measured from inside
|
||||
or not. **Trend** has *Controller share* and *Keyboard and mouse share*, **Compare** has *Played with* and
|
||||
*Controllers*, and a CSV export has an `# input:` line. The user guide has a page for it, *Controllers and input*.
|
||||
Checked against synthetic sessions only: no controller had been read when this was written.
|
||||
|
||||
- **A session records what it was played with — a controller, the keyboard and mouse, both, or neither** (D155–D163,
|
||||
the owner's decisions of 2026-11-14; *Settings ▸ Controllers and input*, on unless you switch it off). While a game
|
||||
is recorded, FrameLedger's agent notes — from Windows, never from the game — which game controllers are connected
|
||||
and in use, their battery level, and whether the keyboard or mouse is in use, and the session stores how the time
|
||||
the game was in front divides between them, how often each controller connected and dropped, and its battery. It
|
||||
works for a game FrameLedger does not measure too. **No button, stick, key or text is kept; nothing is sent to a
|
||||
controller; and nothing is read until you have accepted the Privacy Policy that describes it** — after this
|
||||
update, sessions recorded before FrameLedger has been opened once have no such figures. The screens that show the
|
||||
figures come with the same release. Xbox-compatible controllers and the DualSense are read for use; another
|
||||
controller is listed and never counted as in use. **None of this had been read from a real controller when it was
|
||||
written** — it was checked against data written by hand (`LIMITATIONS.md` §Controllers and input).
|
||||
- **A game's page says what is known about controller support — three things, and no verdict** (D163). *Controller
|
||||
support (store)*: what Steam lists for the game — full, partial, or none — read from the Steam app's own file on
|
||||
your PC when you open the page; nothing is asked of the store, and a game that is not Steam's reads N/A. *Input
|
||||
libraries loaded*: which of XInput, DirectInput, Windows.Gaming.Input, GameInput and SDL the game had loaded the
|
||||
last time it was measured from inside. *Usually played with*: the share of the time in front with a controller,
|
||||
the keyboard and mouse, both and neither, over the sessions that recorded it. English, Vietnamese, Japanese.
|
||||
- **The terms are shown once: Privacy Policy 2.22 and Disclaimer 2.18.** Both said FrameLedger never reads input.
|
||||
They now say what is read — that a controller, or the keyboard or mouse, is in use — what is kept, and what never
|
||||
is (`docs/legal-drift-history.md`).
|
||||
- **For developers: the arithmetic of controller statistics, with nothing reading a device yet** (D155–D163, the
|
||||
owner's decisions of 2026-11-14; `docs/21_INPUT_DEVICES.md`, `docs/03_METRICS.md` §Input). `FrameLedger.Domain.Input`
|
||||
says whether an XInput state or a DualSense report is a pad in use and what its battery is, adds a battery's readings
|
||||
up, counts switches, and decides when two entries are one pad seen twice; `Application.Input` holds one session's
|
||||
slices and turns them into a reading a second; `InputSessionBuilder` turns a session's readings into its totals, its
|
||||
controllers as JSON and its timeline. A telemetry sample can carry a reading; none does. **Every byte and reading
|
||||
under test was written by hand — no report from a real controller has passed through this code.**
|
||||
- **For developers: a session can store what it was played with — schema 0024** (D160; `docs/06_DATA_MODEL.md`). Nine
|
||||
columns on `sessions` (the time in front and its four classes, the switches of method, the sources that answered,
|
||||
the controllers as JSON) and three on `games` (what a store lists of controller support), ADD COLUMN only; the
|
||||
`.partial` file gains chunk 11, so a session recovered after the Agent died keeps its readings; the finalizer
|
||||
stores them for hooked and unhooked sessions alike; the input series are `sensor_blobs` rows named `input.*`, which
|
||||
the sensors' read leaves out. Nothing produces a reading yet. **A ledger this build has opened cannot be opened by
|
||||
0.1.0-beta.49 or earlier.**
|
||||
- **For developers: the input reader, which the Agent does not start yet** (D155, D158, D159; `docs/21_INPUT_DEVICES.md`
|
||||
§The reader). `Application.Input.InputReader` takes a slice about ten times a second from
|
||||
`Infrastructure.Input.Win32InputBackend` — raw input for joysticks and gamepads delivered to a window that is never
|
||||
shown, three of XInput's getters, the time of the last keyboard or mouse input, the window in front — on the thread
|
||||
of `InputDeviceHub`, which exists only while a session has a view of it. It opens no device, sends nothing to one,
|
||||
and registers for no keyboard or mouse. A new gate, `tools/input-readonly-check.ps1`, holds the reader's Windows
|
||||
calls to a committed list and refuses, on the list or off it, a call that sends to a device, injects input or reads
|
||||
a key; no other managed source and no native source may name an input function. **With no controller at hand, what
|
||||
the reader does with one connected is not established**: its tests use a Windows whose answers they write, and one
|
||||
suite runs it on the real Windows of the machine and asserts only that it opens, answers and closes.
|
||||
|
||||
### Changed
|
||||
|
||||
- **Advanced metrics is closed: the ten readings that were "being studied" are now "not read", with the reason**
|
||||
(D154, the owner's decision). What a game sets and asks through Streamline's own functions for a feature — DLSS
|
||||
frame generation's options and state, the video memory DLSS estimates for itself, the options of ray
|
||||
reconstruction, Image Scaling and Dynamic Vibrance, the PC-latency markers — is reached only by handing the game
|
||||
a function of FrameLedger's in place of Streamline's, which is refused. The *Sources* list says so, in English,
|
||||
Vietnamese and Japanese, and the guide no longer says a later release reads more. Nothing that was read stops
|
||||
being read.
|
||||
|
||||
- **The two lines of the graphics card's time say what each is, not which holds the other** (D152, the owner's
|
||||
decision). *GPU active render (idle time excluded)* and *GPU render, start to end (idle time included)* are now
|
||||
*GPU active render (the driver's own figure)* and *GPU render (between the driver's start and end marks)*, in
|
||||
English, Vietnamese and Japanese, and the guide says why: in Cyberpunk 2077 without frame generation the
|
||||
driver's active time is longer than its two marks are apart. The numbers are unchanged.
|
||||
|
||||
- **The guide's page on Advanced metrics says what two of the driver's switches mean** (`guide/12`): the latency
|
||||
report is there in a game that has Reflex built in, whether Reflex is on or off in its menu; `bUseGameSleep`
|
||||
says the game calls Reflex's sleep — NVIDIA asks for that even with Reflex off — and `bLowLatencyMode` is the
|
||||
one that says the mode is on; frame generation needs Reflex, not the reverse. From NVIDIA's Streamline guide
|
||||
for Reflex, and from the owner's ten sessions on 0.1.0-beta.49.
|
||||
|
||||
### Documentation
|
||||
|
||||
- **Owner-only item 47 was run and read** (`docs/HANDOFF.md`): in Cyberpunk 2077 without frame generation the
|
||||
driver's active GPU time is longer than its own two marks are apart on 4 917 of 5 394 frames (1 849 µs beside
|
||||
1 571 µs) and on none of 129 900 frames in five other games — the difference is the driver's; samples without a
|
||||
report are now confined to a game's start; a session with the option off has no latency line; and the stop of
|
||||
D141 fired in a real game for the first time (Kingdom Come: Deliverance II, one call of 5.3 ms while it
|
||||
started).
|
||||
- **Streamline's programming guides for Reflex and for DLSS Ray Reconstruction (2.14.16) read against the code**
|
||||
(`docs/spike-notes/30-reflex-latency.md`, *Added 2026-11-14*). Ray reconstruction was already measured the way
|
||||
the guide describes; two comments in the Overlay's source and one line of `17_HOOK_ENGINE` said super
|
||||
resolution and ray reconstruction run together, and they do not. `03_METRICS` and `05_DETECTION` no longer
|
||||
promise "PC latency as reported by Reflex" (D147). No code changed: comments only.
|
||||
@@ -0,0 +1,125 @@
|
||||
# HANDOFF history — 0.1.0-beta.49
|
||||
|
||||
*Moved verbatim from `docs/HANDOFF.md` when 0.1.0-beta.50 was cut, 2026-11-15 (owner decision D66); `docs/HANDOFF.md` §How this file is split lists every part. Nothing below was edited, so its "below" and "above" mean HANDOFF.md as it stood then, and a path is relative to `docs/`.*
|
||||
|
||||
## **START HERE** — 2026-11-14, 0.1.0-beta.49: item 46 read; the frames counted for the log, Reflex and frame generation together; a read a second on a grid; the Agent keeps the reading that waits
|
||||
|
||||
*Status is `docs/changelog/0.1.0-beta.49.md`; this is what no other file carries.* The owner ran item 46 on
|
||||
beta.48 the afternoon it was released — ten sessions, then eight more — and said: check (#455, and item 46's last
|
||||
paragraphs, below). The read works, the samples are a second apart, both games give both of the driver's own
|
||||
times, the multipliers are listed, off means off, **and the owner's word: no hitch**. Two things were left, the
|
||||
owner said *do both*, and four answers given while planning made the train (D148–D151): #456 (the Overlay counts
|
||||
each summed frame for its log), #457 (the watchdog's periodic tick on a grid), #458 (the Agent keeps the reading
|
||||
that waits; the guide on whose switches the table shows), and this release. **beta.48's own section, its traps
|
||||
and its release facts are [`handoff/history/0.1.0-beta.48.md`](handoff/history/0.1.0-beta.48.md).**
|
||||
|
||||
### What this release decided, beyond D148–D151
|
||||
|
||||
- **The counts are of each frame's own two numbers, with sums, and no threshold.** The draft counted spans of no
|
||||
length; a sample whose mean span is half a microsecond says spans of one or two microseconds exist, and a count
|
||||
of exact zeros would have read "the driver's" where it was "ours". So the frames that have both a span and an
|
||||
active time are kept in two heaps — active longer than the span, or not — each with its count and both sums.
|
||||
- **A batch's state is three things**: the driver's low-latency switch, its "the game sleeps" switch
|
||||
(`bUseGameSleep`: NVAPI's "is `NvAPI_D3D_Sleep()` being called") and its frame-generation multiplier. The second
|
||||
was added on the owner's word — Reflex goes with frame generation in the owner's games, and the low-latency
|
||||
switch can be the NVIDIA App's override — and Clair Obscur's two sessions read exactly that: `bUseGameSleep`
|
||||
off throughout without frame generation, on with ×3.
|
||||
- **Only the driver read and the publication are the periodic tick's.** The request is still followed on every
|
||||
tick, so the hooks a session asks for go in on the tick the loader woke — a game that has just loaded
|
||||
Streamline calls it at once. A draft that moved the whole block would have missed those calls.
|
||||
- **One read is armed at every periodic tick, and the grid is what keeps two apart**: half a second at the least,
|
||||
after a tick that ran that late. "At most once a second" is no longer said anywhere.
|
||||
- **A session's first publication may hold a moment's worth.** A request seen on a woken tick is published by the
|
||||
periodic tick that follows, however soon. One test read a single publication as complete and had to stop.
|
||||
- **The Agent keeps two sets, and an empty one does not wait.** A reading can stand at the sample after the one it
|
||||
would have ridden — a second later. With the sensor interval above a second the oldest is still pushed out.
|
||||
- **No legal text changed (D149)**, although a bug report carries the Overlay's logs and so these lines: the
|
||||
owner was told and chose it. The Privacy Policy names the logs of the component loaded into games.
|
||||
- **The plan was reviewed against the source by a second reader before the owner saw it, and sixteen things in
|
||||
the draft were wrong** — among them the three above, and the whole of the Agent's half, which the draft did not
|
||||
have.
|
||||
|
||||
### Traps this train left
|
||||
|
||||
- **A cause I offered and then counted away**: "the holes are the sensor library's fifth tick" — 25 of 134 fell on
|
||||
one. The pattern that was there (46 of 134 exactly five samples apart) was the Agent's own attach rule, found
|
||||
by reading `SessionRecorder`, not by looking harder at the Overlay.
|
||||
- **A fixture that proved nothing**: the case for a woken watchdog first churned `sl.common.dll`, which wakes
|
||||
nobody — it is in neither the inventory nor the census — and passed. It was caught only because the case
|
||||
asserts, from the log, that the watchdog *was* woken (0 early ticks). **A test of a mechanism asserts that the
|
||||
mechanism ran.** `opengl32.dll` is the wake that unloads nothing under a hook.
|
||||
- **Qodana's native report reads the tests**: `static_cast<unsigned long long>(a * b)` is
|
||||
`bugprone-implicit-widening-of-multiplication-result`. Widen an operand, not the product.
|
||||
- **A here-document with an apostrophe in it failed again.** Edit scripts are files.
|
||||
- **No edit while a gate runs still holds when CI asks for one**: the Qodana fix went into a second worktree of
|
||||
the lower branch, and reached the upper one by a merge.
|
||||
- **The item's own text said "nothing is lost by it" of the holes**, on a reading of the Overlay alone. A reading
|
||||
was lost at every return to step. Say what was looked at.
|
||||
|
||||
### NEXT
|
||||
|
||||
1. ~~**The owner runs item 47**~~ **Run and read 2026-11-14** (item 47, *Run 2026-11-14*): the difference in
|
||||
Cyberpunk 2077 is the driver's, the holes are gone from steady play, off means off, and the stop fired once.
|
||||
2. **The two GPU labels were reworded on the owner's word** (D152, 2026-11-14; strings in three languages, the
|
||||
guide — in `[Unreleased]`, not in a release yet). **D141's stop stays as it is, and nothing more of Reflex is read** (D153, the owner
|
||||
the same evening: "it only has to tell whether the game has it or not; Kingdom Come: Deliverance II has no
|
||||
Reflex in its settings" — so that session lost nothing to the stop). (f) and (g) are said: the App's *Low
|
||||
Latency Mode* is off, and no hitch.
|
||||
3. **`slAllocateResources`** keeps its patch (D135); looked at again when there are more sessions.
|
||||
4. ~~**Train D**~~ **Advanced metrics is closed (D154, 2026-11-14): train D is not built.** The owner was shown
|
||||
the catalog — 140 entries, 110 read — and what the ten entries of reach `Spike` hold (Streamline's own headers,
|
||||
2.14.16: DLSS frame generation's options and state, the video-memory estimates, ray reconstruction's, Image
|
||||
Scaling's and Dynamic Vibrance's options, the PCL markers), with what reading them takes: a function of ours
|
||||
handed to the game in place of Streamline's (rule 4), which a game that fetched its functions before the
|
||||
attach never calls. The owner: "Đóng luôn". The ten are `RefusedRoute` now, the guide no longer says a later
|
||||
release reads more, and §M15 is decided. **What is next is the controller feature**, planned in a session of
|
||||
its own.
|
||||
|
||||
### Left open by this session
|
||||
|
||||
- ~~**This release's own facts** — the tag's run, the digests, the delta — are not in any file yet: the release is cut
|
||||
after this text. Record them in the next pull request, with what SonarCloud and Qodana said.~~ **Recorded
|
||||
2026-11-14: 0.1.0-beta.49 was released 2026-11-14T11:12:44Z** (18:12 in the owner's time zone) from the signed
|
||||
tag on `afe4984` (#459), by run 43587336452 — green at the first attempt, one run for the one tag push. Eight
|
||||
assets; the seven digests of `SHA256SUMS.txt` equal the ones GitHub computed, and the portable package hashed
|
||||
here equals its line; the five native libraries in it carry `FL_BUILD_ID v0.1.0-beta.49`, none of them
|
||||
`-dirty`. The delta from beta.48 is 1 100 211 bytes beside a full package of 110 803 443 — "Delta processed
|
||||
0452 files. 0023 patched, 0429 unchanged". The wiki was published by run 43588972123. **Two rehearsals on the
|
||||
release branch**: run 43580081466 at `1ab2809`, and — after a test-only fix reached the branch — run
|
||||
43581734484 at `9f94356`, whose tree is the released one (a delta of 1 134 949 bytes, the same file counts).
|
||||
**SonarCloud analysed `afe4984`: the quality gate passed and no issue is open on `main`. Qodana's two reports,
|
||||
CodeQL and `check` are green on that commit.** On the way two advisory checks did find something, each in a
|
||||
test of this train and each fixed before its pull request merged: Qodana's native report on #456 (two
|
||||
products widened after the multiplication), SonarCloud on #457 (a line of the log handed to `printf`). **The
|
||||
train stopped once for the owner**: two signed merges timed out at the passphrase prompt after #457; it went on
|
||||
when the owner had unlocked the key. The tag's message reads `FrameLedger 0.1.0-beta.49` where the tags before
|
||||
it read the bare version — nothing reads it, and a pushed tag is not moved.
|
||||
- **Why Cyberpunk 2077's active render is longer than its span without frame generation** — item 47's to say. A
|
||||
third session that afternoon repeated it (233: 3.40 against 3.13 ms at 292 of 296 samples) and a session of
|
||||
menus did not (232: 0 of 126).
|
||||
- **The Agent's half of the holes is read from the code and fits the ledger; it is not measured.** And with both
|
||||
sides on a second a slip of phase can still leave a sample without a report: item 47 counts them.
|
||||
- **A game that exits by itself loses the batch of counts in hand** — under a minute. Not changed: nothing runs
|
||||
at a process's exit.
|
||||
- **Where the third of a second of a poll goes is not established** (the history file of beta.48 has what is
|
||||
known). Not looked at in this train.
|
||||
- **With the sensor interval above one second, some readings of the driver's report are not stored** — the oldest
|
||||
of the two that wait is pushed out. Said in the guide; not changed.
|
||||
- **No test runs the whole path through the real Agent**: the injected tests stop at the shared memory, the
|
||||
sampler's and the pending queue's start from it.
|
||||
- **Two install batches of beta.46 took 0.61 s and 1.26 s and nothing explains them.** Item 46's ten sessions had none
|
||||
above 191 ms.
|
||||
- **The Japanese strings are unreviewed**, as every `ja` string is; this release added none.
|
||||
- **(c) and (h) of item 43**, which only the owner sees, are still not exercised.
|
||||
- **Valor Mortis's crash at 51 s** (twice, beta.40 and beta.44) **and Black Myth: Wukong's fault in Steam's crash
|
||||
handler at every exit** are not explained. One session of each with hooking off is the comparison that is missing.
|
||||
- **What item 41 left unexercised**: a configure through the FidelityFX 2.3 loader (Cyberpunk 2077 with FSR frame
|
||||
generation), a game with neither library.
|
||||
- **A fault while a game is closing is not seen by a hooked session** (D127: written down, not changed).
|
||||
- **`docs/LIST_GAME_TESTED.md` is as of 2026-11-06**: refreshing it is a new copy of the ledger and the owner's review.
|
||||
- **Item 40 (d)** was not exercised and the owner has not said item 40 passed. **Items 36 (d) and 37 are still open.**
|
||||
- **`LIMITATIONS.md` and the accuracy statement still say the processor's, the memory's and the motherboard's
|
||||
sensors "have never been read on real hardware"** — the owner's to reword. The alpha line still rests (D98).
|
||||
|
||||
**Owner-only:** item 47; one session each of Valor Mortis and Black Myth: Wukong with hooking off; what item 41
|
||||
left unexercised; item 40 (d).
|
||||
@@ -74,7 +74,9 @@ stores of controllers and input and what it never does — which button, stick,
|
||||
position, a serial number, a Bluetooth address; to §3A that these numbers, unlike Advanced metrics', **are** in an
|
||||
export and in a bug report (D160); to §4 what is observed — the controllers' reports, looked at and not kept,
|
||||
XInput's state and battery, the time of the last keyboard or mouse input, the window in front — and that nothing is
|
||||
opened or sent; and narrows the sentence after it to what is still true. It also says, in §1 and §4, that nothing
|
||||
opened or sent — and that the Steam app's own file of store records is read, on the disk, when a game's page is
|
||||
opened, for whether the game is listed with controller support; and narrows the sentence after it to what is still
|
||||
true. It also says, in §1 and §4, that nothing
|
||||
of this is read until that version has been accepted on the PC (D156): the option is on unless switched off, and an
|
||||
Agent that started before the App showed the document records without it. The **Disclaimer** (2.18) gains a
|
||||
paragraph in §1 for what is read from outside the game about controllers, the keyboard and the mouse, and its "what
|
||||
|
||||
@@ -66,6 +66,8 @@ correct it by hand — your correction is labelled as yours.
|
||||
upscaling), and when it changed.
|
||||
- **Sensors** — temperatures, load and power; video memory; memory; and the card's clocks and fan, with the moments it
|
||||
was held back shaded. The game's own line and the whole card's or the whole PC's are drawn separately.
|
||||
- **Input over the session** and **Controller battery** — what each second was played with, and each controller's
|
||||
battery level ([Controllers and input](13-controllers.md)).
|
||||
- **Trend** (on the game's page) — one point per session over time, for example before and after a driver update.
|
||||
Each day your graphics driver, graphics card, processor, display or Windows changed is a dashed line with a number
|
||||
above the chart, 1 for the oldest; the list under the chart says what changed that day, and pointing at the line
|
||||
|
||||
@@ -42,6 +42,9 @@ An exported **CSV** or **JSON** file, and a bug report, can contain:
|
||||
- your games' names and **the paths to their files**, which include your **Windows user name** when a game is installed
|
||||
in your user folder;
|
||||
- your PC's processor, graphics card, driver and Windows version;
|
||||
- what each session was played with: the time with a controller and with the keyboard and mouse, and each
|
||||
controller's model name, how it was connected, its battery levels and how often it connected and dropped — never a
|
||||
button, a key, a serial number or an address ([Controllers and input](13-controllers.md));
|
||||
- your tags and notes.
|
||||
|
||||
Look at a file before you share it. **Help ▸ Report a bug…** builds the report on your PC, shows you every file in it,
|
||||
|
||||
+7
-1
@@ -90,7 +90,9 @@ stopped, hooking turned off — each with one button that only says you have rea
|
||||
Read [Anti-cheat and safety](04-anti-cheat-and-safety.md) before you do.
|
||||
- **Anti-cheat** — shown in its place when anti-cheat was found: what was found, and where. **User-mode exception**
|
||||
appears when the game qualifies for the one exception.
|
||||
- **Supports** and **Details** — what the game's own files contain, as far as FrameLedger can tell.
|
||||
- **Supports** and **Details** — what the game's own files contain, as far as FrameLedger can tell. **Details** ends
|
||||
with three rows about controllers — what the store lists, which input libraries the game loaded, and how you have
|
||||
played it ([Controllers and input](13-controllers.md)).
|
||||
- **Tabs:** **Sessions** (every session: double-click a row or press **Open**; **Delete all sessions…** at the top),
|
||||
**Frametime**, **Distribution**, **Trend** (one point per session for a figure you choose; each day your hardware,
|
||||
driver, display or Windows changed is numbered on the chart and listed under it), **Sensors**, and **Latency** when
|
||||
@@ -106,6 +108,10 @@ It opens from a session row, from the Dashboard, and from the notice when a sess
|
||||
- The figures, the charts and **Statistics per series** — [Read your results](03-read-your-results.md) explains each.
|
||||
- **Frame generation in this session** — a bar and a table of every frame-generation state the session held, when it
|
||||
held more than one, with how frame generation was set.
|
||||
- **Played with** — what the session was played with: a bar and a table of the time with a controller, with the
|
||||
keyboard and mouse, with both and with no input; the session's controllers with their connections and batteries;
|
||||
and two charts over the session ([Controllers and input](13-controllers.md)). Above the Frametime chart,
|
||||
**Controller marks** draws a controller's connections, drops and low batteries across the frames.
|
||||
- **Tags and notes** with **Save**, and **Export CSV**, **Export JSON**, **Export PNG**.
|
||||
- **Advanced metrics…**, for a session recorded with Advanced metrics on: it opens that session on the Advanced page.
|
||||
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
# Controllers and input
|
||||
|
||||
With each session FrameLedger notes **what the game was played with**: a controller, the keyboard and mouse, both at
|
||||
once, or nothing at all — and which controllers were connected, for how long, and how their batteries did.
|
||||
|
||||
It reads this **from Windows, outside the game**, so it works for every game you record, measured from inside or
|
||||
not. It never reads which button, stick or key you pressed, never text, never where the mouse is, and it never sends
|
||||
anything to a controller.
|
||||
|
||||
## Switch it off, and when it starts
|
||||
|
||||
Settings ▸ Recording ▸ **Controllers and input** is on unless you switch it off. Nothing is read until you have
|
||||
accepted the Privacy Policy that describes it: after an update, open FrameLedger once and accept the new terms. A
|
||||
session recorded before that says *Not read in this session* and is not filled in later.
|
||||
|
||||
## In a session's summary: Played with
|
||||
|
||||
- **The bar and the table** — the share of the time **the game's window was in front** that was played with a
|
||||
controller, with the keyboard and mouse, with both at once, and with no input. Time when another window was in
|
||||
front is left out: typing in a chat window is not playing with the keyboard.
|
||||
- **Changes between a controller and the keyboard and mouse** — how many times you went from one to the other.
|
||||
- **Controllers** — each controller of the session: its name, how it was connected (USB, Bluetooth, a wireless
|
||||
adapter), how long it was in use and how long connected, how many times it connected and dropped, and its battery:
|
||||
the state it was in longest and for how long, its first and last level, and how fast it ran down when that could
|
||||
be worked out.
|
||||
- **By maker** — when controllers of two makers were used: each maker's share of the time, and how often you changed.
|
||||
- **Input over the session** — a chart with one row for each way of playing and a mark for every second; dashed and
|
||||
dotted lines show when a controller connected, dropped, or its battery fell to low.
|
||||
- **Controller battery** — each controller's level over the session. An Xbox controller reports four levels (empty,
|
||||
low, medium, full), drawn as steps; a DualSense reports steps of ten per cent.
|
||||
- On the **Frametime** chart of a measured session, **Controller marks** draws the same connections, drops and low
|
||||
batteries across the frames — so a stutter at the moment a controller dropped can be seen as one.
|
||||
|
||||
## On a game's page
|
||||
|
||||
**Details** ends with three rows. They are evidence, not a verdict — FrameLedger does not decide whether a game
|
||||
"supports controllers":
|
||||
|
||||
- **Controller support (store)** — what Steam lists for the game: full, partial, or nothing. Read from the Steam
|
||||
app's own file on your PC; nothing is looked up online. A game from another store reads N/A.
|
||||
- **Input libraries loaded** — which of Windows' controller libraries the game had loaded the last time it was
|
||||
measured from inside. Many games load one whether they use a controller or not.
|
||||
- **Usually played with** — the shares over every session of the game that recorded them.
|
||||
|
||||
**Trend** has two more figures, **Controller share** and **Keyboard and mouse share**, and **Compare** shows what each
|
||||
session was played with.
|
||||
|
||||
## What it cannot tell
|
||||
|
||||
- It knows a controller was **in use while the game was in front** — not what the game did with it.
|
||||
- The keyboard and the mouse are **one** class; FrameLedger reads only the time of the last input, never a key.
|
||||
- Input a program makes — Steam Input mapping a controller to keys, a macro tool — counts as keyboard and mouse.
|
||||
- **Xbox-compatible controllers and the DualSense** are read for use. Other controllers are listed with their
|
||||
connections and are not counted as in use.
|
||||
- A battery level is there only when the controller reports one to Windows: an Xbox controller on a cable reads
|
||||
*wired*, and a DualSense on Bluetooth may report none.
|
||||
- When Steam Input stands in front of a controller, Windows shows it twice; FrameLedger counts it once and says so.
|
||||
|
||||
The full list is on [Limitations](../LIMITATIONS.md#controllers-and-input). What is read and kept is in the Privacy
|
||||
Policy (Help ▸ Legal), and [Your data](05-your-data.md) says what an export carries.
|
||||
+3
-2
@@ -4,7 +4,7 @@ FrameLedger records how your games run on this PC — frame rate, frame times, t
|
||||
with, temperatures, and how much memory the game uses — and keeps every session so you can compare them later.
|
||||
Everything stays on your PC.
|
||||
|
||||
Each page below takes a minute or two to read. The first six are the guide; the next six are there to look things up.
|
||||
Each page below takes a minute or two to read. The first six are the guide; the next seven are there to look things up.
|
||||
|
||||
1. [Install and first start](01-install.md)
|
||||
2. [Record a game](02-record-a-game.md)
|
||||
@@ -18,7 +18,8 @@ Each page below takes a minute or two to read. The first six are the guide; the
|
||||
10. [Words FrameLedger uses](10-glossary.md)
|
||||
11. [Alpha builds](11-alpha-builds.md) — the experimental builds on a new .NET, and how to go back
|
||||
12. [Advanced metrics](12-advanced-metrics.md) — everything the driver and the sensors say, if you switch it on
|
||||
13. [The terms, in plain words](terms-in-plain-words.md)
|
||||
13. [Controllers and input](13-controllers.md) — what a session was played with, and each controller's battery
|
||||
14. [The terms, in plain words](terms-in-plain-words.md)
|
||||
|
||||
What FrameLedger cannot do is listed on its own page: [Limitations](../LIMITATIONS.md) (in the app: Help ▸
|
||||
Limitations). How it works with the keyboard alone, a screen reader or a contrast theme, and how to report a problem:
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
HTML comments are not part of the block.
|
||||
-->
|
||||
> ⚠ **What FrameLedger actually measures today — 2026-11-11.** The software is a beta; its latest
|
||||
> **beta is `0.1.0-beta.49`** (2026-11-14), an unsigned installer built from that tag with its
|
||||
> **beta is `0.1.0-beta.50`** (2026-11-15), an unsigned installer built from that tag with its
|
||||
> checksums published beside it (alphas — experimental builds that try a newer .NET — are published apart). The source holds the desktop app
|
||||
> (library, store import, charts, settings) and the background Agent, which records a session when a
|
||||
> game in the library runs (unless you switched its recording off), injects only into games you enabled
|
||||
|
||||
+1
-1
@@ -127,7 +127,7 @@ Frame timing is derived from high-resolution timestamps taken at the moment the
|
||||
|
||||
<!-- accuracy-block:begin -->
|
||||
> ⚠ **What FrameLedger actually measures today — 2026-11-11.** The software is a beta; its latest
|
||||
> **beta is `0.1.0-beta.49`** (2026-11-14), an unsigned installer built from that tag with its
|
||||
> **beta is `0.1.0-beta.50`** (2026-11-15), an unsigned installer built from that tag with its
|
||||
> checksums published beside it (alphas — experimental builds that try a newer .NET — are published apart). The source holds the desktop app
|
||||
> (library, store import, charts, settings) and the background Agent, which records a session when a
|
||||
> game in the library runs (unless you switched its recording off), injects only into games you enabled
|
||||
|
||||
@@ -44,7 +44,7 @@ An exported session (CSV or JSON) and a bug report can contain your games' names
|
||||
|
||||
## 4. What the app can technically observe
|
||||
|
||||
To do its job, FrameLedger observes: which of *your tracked* executables — the entries in your library whose recording is on — are running, and their process trees; whether a game you enabled hooking for runs in an app container, and which of Windows' code-protection settings it runs under (for example, accepting only Microsoft-signed code), read from Windows before any injection; the parameters your games pass to the graphics APIs it intercepts (presentation, upscaling, ray tracing, pipeline creation) — and, only while Advanced metrics is on, more of the parameters of the upscaling calls, and the parameters of ten further calls it begins to intercept in a game only once a session with that option on has started there (the constants the game gives NVIDIA Streamline for each frame, the game's configuration of FSR frame generation, Streamline's answers to the game's four questions about a feature — which version it is, what it requires, whether it is supported and whether it is loaded — and the game switching a feature on or off, allocating and freeing its resources, and shutting Streamline down), which are then stored with the session (sizes, presets, exposure, sharpening, the jitter's size, the motion-vector scale, the depth range, the range of the field of view, flags, the reported frame time, the upscaler's own memory, how frame generation is configured, the versions and requirements of Streamline's features, whether each is supported and loaded, and how often the game switched it, allocated and freed its resources and shut Streamline down), never the camera's position, direction or matrices, and never what identifies the graphics card; and — only while Advanced metrics is on, only in a Direct3D 12 game that had itself loaded NVIDIA's driver library — the graphics driver's own report of the game's last frames and its low-latency state, which the component asks that driver for itself about once a second (it makes that call; the game does not), keeping only how long each stage took; the memory use of a tracked game's process — its dedicated and shared video memory, from Windows' GPU performance counters, and its working sets and commit, from Windows' process-memory information, for which a game it does not inject into is opened with the least access Windows offers and closed again (never its memory's content); loaded module names of a game being captured, the version information of its upscaling, frame-generation and neural-rendering libraries, and whether each was loaded from the game's folder or from the graphics driver's own copy (for detection and for the anti-cheat safety check); the names of the files in each library game's install folder, the version information of its executable and of the upscaling and neural-rendering libraries it ships, the content of its executable file (the markers of the engine and of the graphics libraries it carries, the libraries it imports, and the engine build name an Unreal Engine game carries), the version marks an engine keeps in its own files (Unity's player library and the header of its data file, the header of a Godot data pack, an RPG Maker game's title, core script and Game.ini, the library Game.ini names, and the version file of a Ren'Py game's engine), and the store files that name it (Steam's and GOG's, on your disk) and, for a game the Xbox app or the Microsoft Store installed, the package files in its install folder that describe it (`MicrosoftGame.config` and `appxmanifest.xml`) — to detect its engine, its engine version and its features and to check it for anti-cheat before any injection is possible; the lists of installed games that the Steam, GOG GALAXY, Epic Games and itch apps keep on your disk, and where GOG GALAXY is installed, the folders the Xbox app installs games into on each drive (named by the `.GamingRoot` file at the drive's root) with each game's package files, and Windows' answer to whether that game's package is installed for you — read when you import your library and when you press Play, to find the store that installed a game and hand the game to that store's app — Steam's and GOG GALAXY's also when you open a game's page, to find the artwork their apps keep for it; the cover and banner images that the Steam and GOG GALAXY apps keep on your disk for a game in your library and the logo and splash-screen images a game from the Xbox app ships in its own folder — read to show them on its page, never copied or sent anywhere; the size, position and state of a tracked game's window and the monitor it is on, read from Windows and not from the game, and — for a game FrameLedger injects into — whether the game asked for exclusive full-screen; the NVIDIA driver's settings for your tracked executables (read only: the DLSS and frame-generation overrides the NVIDIA App set); hardware sensor values from your graphics driver's own libraries; and — only while Advanced metrics is on — that driver's description of the graphLine truncated
|
||||
To do its job, FrameLedger observes: which of *your tracked* executables — the entries in your library whose recording is on — are running, and their process trees; whether a game you enabled hooking for runs in an app container, and which of Windows' code-protection settings it runs under (for example, accepting only Microsoft-signed code), read from Windows before any injection; the parameters your games pass to the graphics APIs it intercepts (presentation, upscaling, ray tracing, pipeline creation) — and, only while Advanced metrics is on, more of the parameters of the upscaling calls, and the parameters of ten further calls it begins to intercept in a game only once a session with that option on has started there (the constants the game gives NVIDIA Streamline for each frame, the game's configuration of FSR frame generation, Streamline's answers to the game's four questions about a feature — which version it is, what it requires, whether it is supported and whether it is loaded — and the game switching a feature on or off, allocating and freeing its resources, and shutting Streamline down), which are then stored with the session (sizes, presets, exposure, sharpening, the jitter's size, the motion-vector scale, the depth range, the range of the field of view, flags, the reported frame time, the upscaler's own memory, how frame generation is configured, the versions and requirements of Streamline's features, whether each is supported and loaded, and how often the game switched it, allocated and freed its resources and shut Streamline down), never the camera's position, direction or matrices, and never what identifies the graphics card; and — only while Advanced metrics is on, only in a Direct3D 12 game that had itself loaded NVIDIA's driver library — the graphics driver's own report of the game's last frames and its low-latency state, which the component asks that driver for itself about once a second (it makes that call; the game does not), keeping only how long each stage took; the memory use of a tracked game's process — its dedicated and shared video memory, from Windows' GPU performance counters, and its working sets and commit, from Windows' process-memory information, for which a game it does not inject into is opened with the least access Windows offers and closed again (never its memory's content); loaded module names of a game being captured, the version information of its upscaling, frame-generation and neural-rendering libraries, and whether each was loaded from the game's folder or from the graphics driver's own copy (for detection and for the anti-cheat safety check); the names of the files in each library game's install folder, the version information of its executable and of the upscaling and neural-rendering libraries it ships, the content of its executable file (the markers of the engine and of the graphics libraries it carries, the libraries it imports, and the engine build name an Unreal Engine game carries), the version marks an engine keeps in its own files (Unity's player library and the header of its data file, the header of a Godot data pack, an RPG Maker game's title, core script and Game.ini, the library Game.ini names, and the version file of a Ren'Py game's engine), and the store files that name it (Steam's and GOG's, on your disk) and, for a game the Xbox app or the Microsoft Store installed, the package files in its install folder that describe it (`MicrosoftGame.config` and `appxmanifest.xml`) — to detect its engine, its engine version and its features and to check it for anti-cheat before any injection is possible; the lists of installed games that the Steam, GOG GALAXY, Epic Games and itch apps keep on your disk, and where GOG GALAXY is installed, the folders the Xbox app installs games into on each drive (named by the `.GamingRoot` file at the drive's root) with each game's package files, and Windows' answer to whether that game's package is installed for you — read when you import your library and when you press Play, to find the store that installed a game and hand the game to that store's app — Steam's and GOG GALAXY's also when you open a game's page, to find the artwork their apps keep for it; the cover and banner images that the Steam and GOG GALAXY apps keep on your disk for a game in your library and the logo and splash-screen images a game from the Xbox app ships in its own folder — read to show them on its page, never copied or sent anywhere; the size, position and state of a tracked game's window and the monitor it is on, read from Windows and not from the game, and — for a game FrameLedger injects into — whether the game asked for exclusive full-screen; the NVIDIA driver's settings for your tracked executables (read only: the DLSS and frame-generation overrides the NVIDIA App set); hardware sensor values from your graphics driver's own libraries; and — only while Advanced metrics is on — that driver's description of the graphLine truncated
|
||||
|
||||
It does **not** read game memory outside those API parameters, and does not read game saves, chat, what you type or which buttons you press — only that a controller, or the keyboard or mouse, was in use (§1) — network traffic, or anything unrelated to performance measurement. It records only for programs you added to your library and did not switch recording off for — a program whose recording is off is not watched at all — and injects only into games you individually enabled.
|
||||
|
||||
|
||||
@@ -97,7 +97,9 @@ internal static class AgentServices
|
||||
sp.GetRequiredService<LatestProcessSnapshot>()));
|
||||
services.AddSingleton<ITargetLivenessSource, HeldProcessLivenessSource>();
|
||||
services.AddSingleton<IRingAttacher>(static _ => new ShmRingAttacher(NativeAntiCheatGuard.BuildId()));
|
||||
services.AddSingleton<IRuntimeModuleSnapshot>(static _ => new RuntimeModuleSnapshot(CensusNames.ModuleFileNames));
|
||||
// The input libraries ride the same snapshot (D163): which of them a hooked game had loaded is one of the three
|
||||
// pieces of evidence for "supports controllers". The App leaves them out of the Libraries line.
|
||||
services.AddSingleton<IRuntimeModuleSnapshot>(static _ => new RuntimeModuleSnapshot([.. CensusNames.ModuleFileNames, .. Domain.Input.InputLibraries.FileNames]));
|
||||
AddNvidia(services);
|
||||
|
||||
AddRecording(services, paths);
|
||||
|
||||
@@ -512,6 +512,11 @@ public partial class App : System.Windows.Application
|
||||
services.AddSingleton<Application.Art.IStoreArtCache>(static _ => new GogArtCache());
|
||||
services.AddSingleton<Application.Art.IStoreArtCache>(static _ => new XboxArtCache());
|
||||
services.AddSingleton(static sp => new StoreRecordsReader(sp.GetServices<IStoreLibrarySource>()));
|
||||
// D163: what the Steam app's own file on this PC lists of controller support, read when a game's page opens.
|
||||
services.AddSingleton(static sp => new StoreControllerSupport(
|
||||
sp.GetRequiredService<StoreRecordsReader>(),
|
||||
sp.GetRequiredService<IGameRepository>(),
|
||||
sp.GetRequiredService<UiMode>()));
|
||||
services.AddSingleton(static sp => new GameArt(
|
||||
sp.GetRequiredService<RegisteredSettings>(),
|
||||
sp.GetRequiredService<StoreRecordsReader>(),
|
||||
|
||||
@@ -113,6 +113,21 @@ public sealed record ChartPalette(
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(key), key, "not a chart palette key"),
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// The colour of what a session was played with (0.1.0-beta.50): a controller the first series colour, the keyboard or
|
||||
/// mouse the second, both at once the sensors' green, no input the mix's grey - roles the palette already has, so the
|
||||
/// contrast table of <c>08_UI</c> §Accessibility covers them. Under a Windows contrast theme two of the four share a
|
||||
/// colour (the theme has few): the bar draws them apart with a gap and never next to each other, the charts give each
|
||||
/// its own row or marker, and every number is in the table in text.
|
||||
/// </summary>
|
||||
public Color InputFill(Domain.Input.InputClass input) => input switch
|
||||
{
|
||||
Domain.Input.InputClass.Controller => Native,
|
||||
Domain.Input.InputClass.KeyboardMouse => Displayed,
|
||||
Domain.Input.InputClass.Both => Sensor,
|
||||
_ => MixNone,
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// The fill of a frame-generation mix segment (beta.24, D62): a state by its multiplier, so ×4 reads the same colour in
|
||||
/// every session — the series colours, never the stutter reds —, and no frame generation and the time no state claims
|
||||
|
||||
@@ -24,6 +24,8 @@ public partial class FrametimeChart : UserControl
|
||||
private SessionSeries? _series;
|
||||
private bool _displayed;
|
||||
private bool _sensors;
|
||||
private IReadOnlyList<InputEvent> _inputEvents = [];
|
||||
private bool _showInputEvents;
|
||||
|
||||
public FrametimeChart()
|
||||
{
|
||||
@@ -60,12 +62,32 @@ public partial class FrametimeChart : UserControl
|
||||
Redraw();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The session's controller marks (0.1.0-beta.50): a connection, a drop, a battery that fell to low, as lines across
|
||||
/// the frames - drawn only where the frames' place on the sensors' clock is known, as the sensor overlay is.
|
||||
/// </summary>
|
||||
public void SetInputEvents(IReadOnlyList<InputEvent> events, bool show)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(events);
|
||||
if (ReferenceEquals(_inputEvents, events) && _showInputEvents == show)
|
||||
{
|
||||
return; // the same marks, shown the same way: a second draw of every frame would say nothing new
|
||||
}
|
||||
|
||||
_inputEvents = events;
|
||||
_showInputEvents = show;
|
||||
Redraw();
|
||||
}
|
||||
|
||||
/// <summary>The controller marks the last draw put on the axes.</summary>
|
||||
public int DrawnInputEvents { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// What the lines are not, when that is not obvious (beta.8): a session whose presents were all generated is charted as
|
||||
/// presents; every present is timed at submission, which is not the display's cadence; and the overlay's sensors run ahead
|
||||
/// of the frames past every gap the time axis closes up.
|
||||
/// </summary>
|
||||
internal static string NoteFor(SessionSeries? series, bool displayed, bool sensors)
|
||||
internal static string NoteFor(SessionSeries? series, bool displayed, bool sensors, bool marks = false)
|
||||
{
|
||||
if (series is null || series.Presents == 0)
|
||||
{
|
||||
@@ -87,6 +109,11 @@ public partial class FrametimeChart : UserControl
|
||||
{
|
||||
lines.Add(string.Format(CultureInfo.CurrentCulture, Strings.Chart_Note_GapsClosed_Format, gaps));
|
||||
}
|
||||
else if (marks && series.SensorsAligned && gaps > 0)
|
||||
{
|
||||
// The marks are on the same clock as the sensors: past a gap the axis closed up, they run ahead of the frames too.
|
||||
lines.Add(string.Format(CultureInfo.CurrentCulture, Strings.Chart_Note_GapsClosed_Marks_Format, gaps));
|
||||
}
|
||||
|
||||
return string.Join(Environment.NewLine, lines);
|
||||
}
|
||||
@@ -96,10 +123,12 @@ public partial class FrametimeChart : UserControl
|
||||
Plot plot = Plot.Plot;
|
||||
plot.Clear();
|
||||
DrawnPoints = 0;
|
||||
DrawnInputEvents = 0;
|
||||
ChartTheme.Apply(plot);
|
||||
plot.XLabel(Strings.Chart_Axis_Time);
|
||||
plot.YLabel(Strings.Chart_Axis_Frametime);
|
||||
Note.Text = NoteFor(_series, _displayed, _sensors);
|
||||
bool marks = _showInputEvents && _series?.SensorOffsetS is { } first && _inputEvents.Any(e => e.TimeS >= first && e.TimeS - first <= _series.DurationS);
|
||||
Note.Text = NoteFor(_series, _displayed, _sensors, marks);
|
||||
Note.Visibility = Note.Text.Length > 0 ? Visibility.Visible : Visibility.Collapsed;
|
||||
if (_series is null || _series.Presents == 0)
|
||||
{
|
||||
@@ -123,6 +152,12 @@ public partial class FrametimeChart : UserControl
|
||||
}
|
||||
|
||||
plot.Axes.AutoScale();
|
||||
if (marks)
|
||||
{
|
||||
// After the scale: a line across the whole height must not be what the axes are fitted to.
|
||||
DrawnInputEvents = InputEventLines.Draw(plot, _inputEvents, p, _series.SensorOffsetS!.Value, _series.DurationS);
|
||||
}
|
||||
|
||||
LabelSegments(plot, p);
|
||||
plot.ShowLegend(Alignment.UpperRight);
|
||||
Plot.Refresh();
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
<!-- SPDX-License-Identifier: GPL-3.0-only -->
|
||||
<!-- Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE -->
|
||||
|
||||
<UserControl x:Class="FrameLedger.App.Charts.InputBatteryChart"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
xmlns:res="clr-namespace:FrameLedger.App"
|
||||
xmlns:charts="clr-namespace:FrameLedger.App.Charts">
|
||||
<!-- 08_UI §Session summary (0.1.0-beta.50): each controller's battery over the session, as steps; a line saying none was
|
||||
read where no controller reported one. -->
|
||||
<Grid>
|
||||
<charts:ChartPlot x:Name="Plot" AutomationProperties.Name="{x:Static res:Strings.A11y_Chart_InputBattery}" AutomationProperties.HelpText="{x:Static res:Strings.A11y_ChartData_Input}" />
|
||||
<ui:TextBlock x:Name="NotRead" Style="{StaticResource SecondaryText}" TextWrapping="Wrap" VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
Text="{x:Static res:Strings.Chart_InputBattery_NotRead}" Visibility="Collapsed" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,83 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using FrameLedger.Application.Input;
|
||||
using FrameLedger.Application.Recording;
|
||||
using FrameLedger.Domain.Input;
|
||||
using ScottPlot;
|
||||
using ScottPlot.Plottables;
|
||||
|
||||
namespace FrameLedger.App.Charts;
|
||||
|
||||
/// <summary>
|
||||
/// Each controller's battery over a session (0.1.0-beta.50; <see cref="InputSeries"/>): a step line a controller - a
|
||||
/// level holds until the next reading - on one axis of per cent. A controller that reports four levels (XInput's empty,
|
||||
/// low, medium, full) is drawn at thirds and its legend says so: it is a coarser scale, not a measured percentage.
|
||||
/// </summary>
|
||||
public partial class InputBatteryChart : UserControl
|
||||
{
|
||||
public InputBatteryChart()
|
||||
{
|
||||
InitializeComponent();
|
||||
ChartTheme.Attach(Plot);
|
||||
}
|
||||
|
||||
/// <summary>The lines drawn by the last <see cref="Show"/>; 0 when no controller reported a battery.</summary>
|
||||
public int DrawnLines { get; private set; }
|
||||
|
||||
public void Show(InputSeries? series, InputDevicesRecord? record)
|
||||
{
|
||||
Plot plot = Plot.Plot;
|
||||
plot.Clear();
|
||||
ChartTheme.Apply(plot);
|
||||
plot.XLabel(Strings.Chart_Axis_TimeFromStart);
|
||||
plot.YLabel(Strings.Chart_Axis_Battery);
|
||||
DrawnLines = 0;
|
||||
if (series is not null)
|
||||
{
|
||||
ChartPalette p = ChartTheme.Current;
|
||||
Color[] colours = [p.Native, p.Displayed, p.Sensor, p.SensorSecondary, p.Percentile, p.SensorTertiary];
|
||||
foreach (InputDeviceSeries device in series.Devices.Where(static d => d.Battery is not null))
|
||||
{
|
||||
BatteryScale scale = InputNames.ScaleOf(record?.Devices.FirstOrDefault(d => d.Index == device.Index)?.Battery?.Scale);
|
||||
DrawDevice(plot, series, device, scale, colours[DrawnLines % colours.Length]);
|
||||
}
|
||||
|
||||
if (DrawnLines > 0)
|
||||
{
|
||||
// The axis runs past 100 so the legend has a place no level can be drawn under.
|
||||
plot.Axes.Left.SetTicks([0, 25, 50, 75, 100], ["0", "25", "50", "75", "100"]);
|
||||
plot.Axes.SetLimits(0, Math.Max(series.TimesS[^1], 1), 0, 135);
|
||||
plot.ShowLegend(Alignment.UpperRight);
|
||||
}
|
||||
}
|
||||
|
||||
NotRead.Visibility = DrawnLines > 0 ? Visibility.Collapsed : Visibility.Visible;
|
||||
Plot.Visibility = DrawnLines > 0 ? Visibility.Visible : Visibility.Hidden;
|
||||
Plot.Refresh();
|
||||
}
|
||||
|
||||
private void DrawDevice(Plot plot, InputSeries series, InputDeviceSeries device, BatteryScale scale, Color colour)
|
||||
{
|
||||
float[] battery = device.Battery!;
|
||||
int[] read = [.. Enumerable.Range(0, battery.Length).Where(i => !float.IsNaN(battery[i]))];
|
||||
if (read.Length == 0 || scale == BatteryScale.None)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
double[] xs = [.. read.Select(i => series.TimesS[i])];
|
||||
double[] ys = [.. read.Select(i => InputSeries.ToPercent(battery[i], scale))];
|
||||
Scatter line = plot.Add.Scatter(xs, ys, colour);
|
||||
line.ConnectStyle = ConnectStyle.StepHorizontal;
|
||||
line.MarkerSize = 0;
|
||||
line.LineWidth = 2;
|
||||
line.LegendText = scale == BatteryScale.FourLevels
|
||||
? InputSeries.DeviceLabel(device.Index) + " " + Strings.Chart_Input_FourLevels
|
||||
: InputSeries.DeviceLabel(device.Index);
|
||||
ChartPatterns.Line(line, DrawnLines);
|
||||
DrawnLines++;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
namespace FrameLedger.App.Charts;
|
||||
|
||||
/// <summary>One controller's series of a session (<c>input.dev.N.active</c>, <c>input.dev.N.battery</c>), a value a tick.</summary>
|
||||
/// <param name="Index">The controller's number in the session, from 1 - <c>sessions.input_devices</c> names it the same.</param>
|
||||
/// <param name="Active">The part of each tick's time in front the controller was in use (0..1); NaN while it was not connected.</param>
|
||||
/// <param name="Battery">The battery's level on each tick, in its own scale; NaN where there was none. Null for a controller with no battery series.</param>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1819:Properties should not return arrays", Justification = "a data carrier for the charts, as SensorSeries is")]
|
||||
public sealed record InputDeviceSeries(int Index, float[] Active, float[]? Battery);
|
||||
@@ -0,0 +1,10 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
namespace FrameLedger.App.Charts;
|
||||
|
||||
/// <summary>One mark on a session's charts: what happened to which controller, and when.</summary>
|
||||
/// <param name="TimeS">Seconds from the session's start (the sensors' clock).</param>
|
||||
/// <param name="Kind">What happened.</param>
|
||||
/// <param name="Device">The controller's number in the session, from 1.</param>
|
||||
public sealed record InputEvent(double TimeS, InputEventKind Kind, int Device);
|
||||
@@ -0,0 +1,17 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
namespace FrameLedger.App.Charts;
|
||||
|
||||
/// <summary>What happened to a controller at a moment of a session (0.1.0-beta.50): the marks on the session's charts.</summary>
|
||||
public enum InputEventKind
|
||||
{
|
||||
/// <summary>A controller connected after the session's first reading.</summary>
|
||||
Connected,
|
||||
|
||||
/// <summary>A controller dropped.</summary>
|
||||
Disconnected,
|
||||
|
||||
/// <summary>A controller's battery fell to low: XInput's "low" or "empty", or 10 % and under.</summary>
|
||||
BatteryLow,
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using ScottPlot;
|
||||
using ScottPlot.Plottables;
|
||||
|
||||
namespace FrameLedger.App.Charts;
|
||||
|
||||
/// <summary>
|
||||
/// A session's controller marks as vertical lines on a chart (0.1.0-beta.50): a connection, a drop, a battery that fell
|
||||
/// to low. Each kind has a line pattern of its own as well as a colour, and one legend entry - nothing is told by colour
|
||||
/// alone (<c>08_UI</c> §Accessibility).
|
||||
/// </summary>
|
||||
public static class InputEventLines
|
||||
{
|
||||
/// <summary>
|
||||
/// Draws the marks that fall on the chart's axis and returns how many it drew.
|
||||
/// </summary>
|
||||
/// <param name="plot">The chart.</param>
|
||||
/// <param name="events">The session's marks, on the sensors' clock.</param>
|
||||
/// <param name="palette">The theme's colours.</param>
|
||||
/// <param name="offsetS">Where the chart's zero is on that clock: 0 for a chart from the session's start, the first present's time for one over the frames.</param>
|
||||
/// <param name="endS">The end of the chart's axis; a mark after it, or before zero, is left out.</param>
|
||||
public static int Draw(Plot plot, IReadOnlyList<InputEvent> events, ChartPalette palette, double offsetS, double endS)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(plot);
|
||||
ArgumentNullException.ThrowIfNull(events);
|
||||
ArgumentNullException.ThrowIfNull(palette);
|
||||
var named = new HashSet<InputEventKind>();
|
||||
int drawn = 0;
|
||||
foreach (InputEvent mark in events)
|
||||
{
|
||||
double x = mark.TimeS - offsetS;
|
||||
if (x < 0 || x > endS)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
VerticalLine line = plot.Add.VerticalLine(x);
|
||||
line.LineWidth = 1;
|
||||
line.Color = ColorOf(mark.Kind, palette);
|
||||
line.LinePattern = PatternOf(mark.Kind);
|
||||
|
||||
// One legend entry a kind: the first line of each carries it.
|
||||
line.LegendText = named.Add(mark.Kind) ? InputSeries.Describe(mark.Kind) : string.Empty;
|
||||
drawn++;
|
||||
}
|
||||
|
||||
return drawn;
|
||||
}
|
||||
|
||||
/// <summary>A kind's colour: series colours, never the stutter reds - a mark is a fact, not a fault.</summary>
|
||||
public static Color ColorOf(InputEventKind kind, ChartPalette palette)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(palette);
|
||||
return kind switch
|
||||
{
|
||||
InputEventKind.Connected => palette.Sensor,
|
||||
InputEventKind.Disconnected => palette.SensorSecondary,
|
||||
_ => palette.Percentile,
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>A kind's line pattern: dashed, dotted, densely dashed - solid is the frames'.</summary>
|
||||
public static LinePattern PatternOf(InputEventKind kind) => kind switch
|
||||
{
|
||||
InputEventKind.Connected => LinePattern.Dashed,
|
||||
InputEventKind.Disconnected => LinePattern.Dotted,
|
||||
_ => LinePattern.DenselyDashed,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Globalization;
|
||||
using FrameLedger.Application.Input;
|
||||
using FrameLedger.Application.Persistence;
|
||||
using FrameLedger.Application.Recording;
|
||||
using FrameLedger.Domain.Input;
|
||||
using FrameLedger.Infrastructure.Blobs;
|
||||
|
||||
namespace FrameLedger.App.Charts;
|
||||
|
||||
/// <summary>
|
||||
/// A session's input series decoded (0.1.0-beta.50, <c>06_DATA_MODEL</c> §sensor_blobs): what each tick was mostly
|
||||
/// played with and each controller's activity and battery, on the sensors' clock. Unlike the advanced series a gap is
|
||||
/// kept - NaN is "not connected" for a controller and "not in front" for the class, and where one starts and ends is
|
||||
/// exactly what the marks are made of.
|
||||
/// </summary>
|
||||
/// <param name="TimesS">Seconds from the session's start, a value a tick.</param>
|
||||
/// <param name="Class"><see cref="InputClass"/>'s number on each tick; NaN with no reading or with the game not in front.</param>
|
||||
/// <param name="Devices">The controllers that have series, by their number.</param>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1819:Properties should not return arrays", Justification = "a data carrier for the charts, as SensorSeries is")]
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1863:Use 'CompositeFormat'", Justification = "the format string is a resource that follows the UI culture, which changes at runtime")]
|
||||
public sealed record InputSeries(double[] TimesS, float[] Class, IReadOnlyList<InputDeviceSeries> Devices)
|
||||
{
|
||||
/// <summary>The most marks one chart draws: a connection that flaps would otherwise bury the chart under its own lines. The table has the counts.</summary>
|
||||
public const int MaxEvents = 60;
|
||||
|
||||
/// <summary>The blobs of <c>FindInputSensorsAsync</c> decoded; null when the session stored no input series.</summary>
|
||||
public static InputSeries? Decode(IReadOnlyList<SensorBlob> blobs)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(blobs);
|
||||
float[]? @class = Values(blobs, InputSessionBuilder.ClassSeries);
|
||||
if (@class is null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
float[]? tMs = Values(blobs, "t_ms");
|
||||
double hz = blobs.First(static b => string.Equals(b.Series, InputSessionBuilder.ClassSeries, StringComparison.Ordinal)).Hz;
|
||||
double[] times = new double[@class.Length];
|
||||
for (int i = 0; i < times.Length; i++)
|
||||
{
|
||||
times[i] = tMs is not null && i < tMs.Length ? tMs[i] / 1000.0 : i / Math.Max(hz, 0.001);
|
||||
}
|
||||
|
||||
var devices = new List<InputDeviceSeries>();
|
||||
for (int index = 1; index <= InputSessionBuilder.MaxDevices; index++)
|
||||
{
|
||||
if (Values(blobs, InputSessionBuilder.ActiveSeries(index)) is { } active && active.Length == @class.Length)
|
||||
{
|
||||
float[]? battery = Values(blobs, InputSessionBuilder.BatterySeries(index));
|
||||
devices.Add(new InputDeviceSeries(index, active, battery?.Length == @class.Length ? battery : null));
|
||||
}
|
||||
}
|
||||
|
||||
return new InputSeries(times, @class, devices);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The marks: each controller's connections and drops after the session's first reading, and each fall of a battery to
|
||||
/// low - in time order, <see cref="MaxEvents"/> at most. A controller that was there from the start did not
|
||||
/// "connect": where a series has one rising edge more than the row counted connects, the first is the start.
|
||||
/// </summary>
|
||||
public IReadOnlyList<InputEvent> Events(InputDevicesRecord? record)
|
||||
{
|
||||
var events = new List<InputEvent>();
|
||||
foreach (InputDeviceSeries device in Devices)
|
||||
{
|
||||
InputDeviceRecord? stored = record?.Devices.FirstOrDefault(d => d.Index == device.Index);
|
||||
AddConnections(events, device, stored?.Connects);
|
||||
if (device.Battery is { } battery && stored?.Battery is { } facts)
|
||||
{
|
||||
AddBatteryLow(events, device.Index, battery, InputNames.ScaleOf(facts.Scale));
|
||||
}
|
||||
}
|
||||
|
||||
return [.. events.OrderBy(static e => e.TimeS).Take(MaxEvents)];
|
||||
}
|
||||
|
||||
/// <summary>A kind of mark in a few words - a chart's legend entry.</summary>
|
||||
public static string Describe(InputEventKind kind) => kind switch
|
||||
{
|
||||
InputEventKind.Connected => Strings.Chart_Input_Event_Connected,
|
||||
InputEventKind.Disconnected => Strings.Chart_Input_Event_Disconnected,
|
||||
_ => Strings.Chart_Input_Event_BatteryLow,
|
||||
};
|
||||
|
||||
private static float[]? Values(IReadOnlyList<SensorBlob> blobs, string series)
|
||||
{
|
||||
SensorBlob? blob = blobs.FirstOrDefault(b => string.Equals(b.Series, series, StringComparison.Ordinal));
|
||||
return blob is null || !string.Equals(blob.Codec, SeriesCodec.Tag, StringComparison.Ordinal) ? null : SeriesCodec.DecodeFloat32(blob.Data.ToArray());
|
||||
}
|
||||
|
||||
private void AddConnections(List<InputEvent> events, InputDeviceSeries device, int? countedConnects)
|
||||
{
|
||||
var rising = new List<int>();
|
||||
bool connected = false;
|
||||
for (int i = 0; i < device.Active.Length; i++)
|
||||
{
|
||||
bool now = !float.IsNaN(device.Active[i]);
|
||||
if (now && !connected)
|
||||
{
|
||||
rising.Add(i);
|
||||
}
|
||||
else if (!now && connected)
|
||||
{
|
||||
events.Add(new InputEvent(TimesS[i], InputEventKind.Disconnected, device.Index));
|
||||
}
|
||||
|
||||
connected = now;
|
||||
}
|
||||
|
||||
// The row's count is the builder's, taken after the session's first reading: one edge more is the controller
|
||||
// that was already there. With no stored count, an edge on the very first tick is read the same way.
|
||||
int skip = countedConnects is { } counted ? Math.Max(0, rising.Count - counted) : rising is [0, ..] ? 1 : 0;
|
||||
events.AddRange(rising.Skip(skip).Select(i => new InputEvent(TimesS[i], InputEventKind.Connected, device.Index)));
|
||||
}
|
||||
|
||||
private void AddBatteryLow(List<InputEvent> events, int index, float[] battery, BatteryScale scale)
|
||||
{
|
||||
// A falling level is a battery running down: the state is not in the series, and a level that falls is not charging.
|
||||
float? previous = null;
|
||||
for (int i = 0; i < battery.Length; i++)
|
||||
{
|
||||
if (float.IsNaN(battery[i]))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (previous is { } before && !IsLow(before, scale) && IsLow(battery[i], scale))
|
||||
{
|
||||
events.Add(new InputEvent(TimesS[i], InputEventKind.BatteryLow, index));
|
||||
}
|
||||
|
||||
previous = battery[i];
|
||||
}
|
||||
}
|
||||
|
||||
private static bool IsLow(float level, BatteryScale scale) =>
|
||||
new BatteryReading(BatteryState.Discharging, scale, (int)Math.Round(level, MidpointRounding.AwayFromZero)).IsLow;
|
||||
|
||||
/// <summary>The battery series as a percentage to draw: a percentage as it is, XInput's four levels as thirds (empty 0, low 33, medium 67, full 100).</summary>
|
||||
public static double ToPercent(float level, BatteryScale scale) => scale == BatteryScale.FourLevels
|
||||
? Math.Round(Math.Clamp(level, 0f, 3f) * 100.0 / 3.0, MidpointRounding.AwayFromZero)
|
||||
: Math.Clamp(level, 0f, 100f);
|
||||
|
||||
/// <summary>The label of a controller's line: its number, as the table's order has it.</summary>
|
||||
public static string DeviceLabel(int index) => string.Format(CultureInfo.CurrentCulture, Strings.Chart_Input_Device_Format, index);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<!-- SPDX-License-Identifier: GPL-3.0-only -->
|
||||
<!-- Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE -->
|
||||
|
||||
<UserControl x:Class="FrameLedger.App.Charts.InputTimelineChart"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
xmlns:res="clr-namespace:FrameLedger.App"
|
||||
xmlns:charts="clr-namespace:FrameLedger.App.Charts">
|
||||
<!-- 08_UI §Session summary (0.1.0-beta.50): what each second of the session was played with, one row a class - the row
|
||||
names the class, the marker's shape differs too - and the controllers' connections, drops and low batteries as lines. -->
|
||||
<Grid>
|
||||
<charts:ChartPlot x:Name="Plot" AutomationProperties.Name="{x:Static res:Strings.A11y_Chart_InputTimeline}" AutomationProperties.HelpText="{x:Static res:Strings.A11y_ChartData_Input}" />
|
||||
<ui:TextBlock x:Name="NotRead" Style="{StaticResource SecondaryText}" TextWrapping="Wrap" VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
Text="{x:Static res:Strings.Chart_Input_NotStored}" Visibility="Collapsed" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,90 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using FrameLedger.App.Services;
|
||||
using FrameLedger.Domain.Input;
|
||||
using ScottPlot;
|
||||
using ScottPlot.Plottables;
|
||||
|
||||
namespace FrameLedger.App.Charts;
|
||||
|
||||
/// <summary>
|
||||
/// What each second of a session was played with (0.1.0-beta.50; <see cref="InputSeries"/>): four rows - no input, a
|
||||
/// controller, the keyboard and mouse, both at once - a mark on a row for every second the game was in front and mostly
|
||||
/// played that way, and the controllers' connections, drops and low batteries as lines across them. A second with the
|
||||
/// game not in front has no mark on any row.
|
||||
/// </summary>
|
||||
public partial class InputTimelineChart : UserControl
|
||||
{
|
||||
/// <summary>The rows from the bottom: the value a class is stored as is the row it is drawn on.</summary>
|
||||
private static readonly InputClass[] _rows = [InputClass.None, InputClass.Controller, InputClass.KeyboardMouse, InputClass.Both];
|
||||
|
||||
public InputTimelineChart()
|
||||
{
|
||||
InitializeComponent();
|
||||
ChartTheme.Attach(Plot);
|
||||
}
|
||||
|
||||
/// <summary>The marks on the rows drawn by the last <see cref="Show"/>; 0 when the session stored no input series.</summary>
|
||||
public int DrawnPoints { get; private set; }
|
||||
|
||||
/// <summary>The connection, drop and battery lines drawn by the last <see cref="Show"/>.</summary>
|
||||
public int DrawnEvents { get; private set; }
|
||||
|
||||
public void Show(InputSeries? series, IReadOnlyList<InputEvent> events)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(events);
|
||||
Plot plot = Plot.Plot;
|
||||
plot.Clear();
|
||||
ChartTheme.Apply(plot);
|
||||
plot.XLabel(Strings.Chart_Axis_TimeFromStart);
|
||||
DrawnPoints = 0;
|
||||
DrawnEvents = 0;
|
||||
if (series is { TimesS.Length: > 0 })
|
||||
{
|
||||
ChartPalette p = ChartTheme.Current;
|
||||
for (int r = 0; r < _rows.Length; r++)
|
||||
{
|
||||
DrawRow(plot, series, _rows[r], p, r);
|
||||
}
|
||||
|
||||
double end = series.TimesS[^1];
|
||||
DrawnEvents = InputEventLines.Draw(plot, events, p, 0, end);
|
||||
plot.Axes.Left.SetTicks([.. _rows.Select(static c => (double)(int)c)], [.. _rows.Select(InputPresentation.ClassLabel)]);
|
||||
|
||||
// A little room on both sides, so the first and the last second are whole marks and not halves on the frame.
|
||||
double pad = Math.Max(end * 0.01, 0.25);
|
||||
plot.Axes.SetLimits(-pad, Math.Max(end, 1) + pad, -0.5, _rows.Length - 0.5);
|
||||
if (DrawnEvents > 0)
|
||||
{
|
||||
plot.ShowLegend(Alignment.UpperRight); // the lines' kinds only: the rows are named on the axis
|
||||
}
|
||||
}
|
||||
|
||||
bool any = DrawnPoints > 0;
|
||||
NotRead.Visibility = any ? Visibility.Collapsed : Visibility.Visible;
|
||||
Plot.Visibility = any ? Visibility.Visible : Visibility.Hidden;
|
||||
Plot.Refresh();
|
||||
}
|
||||
|
||||
private void DrawRow(Plot plot, InputSeries series, InputClass input, ChartPalette palette, int index)
|
||||
{
|
||||
int[] ticks = [.. Enumerable.Range(0, series.Class.Length).Where(i => !float.IsNaN(series.Class[i]) && (int)series.Class[i] == (int)input)];
|
||||
if (ticks.Length == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
DrawnPoints += ticks.Length;
|
||||
double[] xs = [.. ticks.Select(i => series.TimesS[i])];
|
||||
double[] ys = [.. ticks.Select(_ => (double)(int)input)];
|
||||
Scatter row = plot.Add.Scatter(xs, ys, palette.InputFill(input));
|
||||
row.LineWidth = 0;
|
||||
row.MarkerSize = 5;
|
||||
|
||||
// No legend entry: the axis names the row, and a legend of seven would cover a chart this low.
|
||||
ChartPatterns.Points(row, index);
|
||||
}
|
||||
}
|
||||
@@ -81,6 +81,12 @@ public sealed record SessionSeries
|
||||
/// </summary>
|
||||
public bool SensorsAligned { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Where the first present sits on the sensors' clock, in seconds (schema 0013): what turns a time from the session's
|
||||
/// start - a controller's connection (0.1.0-beta.50) - into a place on the frames' axis. Null where the blob did not say.
|
||||
/// </summary>
|
||||
public double? SensorOffsetS { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// What the charts derive from the whole session, worked out where it was decoded (beta.23); null on a series built by
|
||||
/// hand, whose charts compute it themselves.
|
||||
|
||||
@@ -46,6 +46,14 @@ public sealed class SessionSeriesLoader
|
||||
public Task<IReadOnlyList<SensorSeries>> LoadAdvancedAsync(long sessionId, CancellationToken ct = default) =>
|
||||
Task.Run(async () => DecodeAdvanced(await _sessions.FindAdvancedSensorsAsync(sessionId, ct).ConfigureAwait(false)), ct);
|
||||
|
||||
/// <summary>
|
||||
/// The session's input series (0.1.0-beta.50): what each tick was played with and each controller's activity and
|
||||
/// battery, timed from the session's start, gaps kept. Null for a session that stored none. On the thread pool, as
|
||||
/// <see cref="LoadAsync"/>.
|
||||
/// </summary>
|
||||
public Task<InputSeries?> LoadInputAsync(long sessionId, CancellationToken ct = default) =>
|
||||
Task.Run(async () => InputSeries.Decode(await _sessions.FindInputSensorsAsync(sessionId, ct).ConfigureAwait(false)), ct);
|
||||
|
||||
/// <summary>The advanced blobs decoded: <c>t_ms</c> is their clock, NaN is "no reading".</summary>
|
||||
public static IReadOnlyList<SensorSeries> DecodeAdvanced(IReadOnlyList<SensorBlob> blobs)
|
||||
{
|
||||
@@ -145,6 +153,7 @@ public sealed class SessionSeriesLoader
|
||||
Segments = MapSegments([.. segments.Where(s => swapchain is null || s.SwapchainId == swapchain.Value)], times, frameIndex),
|
||||
Sensors = DecodeSensors(sensors, offsetS ?? 0),
|
||||
SensorsAligned = offsetS is not null,
|
||||
SensorOffsetS = offsetS,
|
||||
Digest = SeriesDigest.Of(appFrameTimesMs, times, frametimes, generated, gap, noApplicationFrames),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -93,4 +93,13 @@ public enum TrendMetric
|
||||
|
||||
/// <summary>Application frames per watt of the card's power — never displayed frames (rule 6).</summary>
|
||||
Efficiency,
|
||||
|
||||
/// <summary>
|
||||
/// The two below are 0.1.0-beta.50's (<c>03_METRICS</c> §Input): the share of the time the game was in front that a
|
||||
/// controller alone, or the keyboard and mouse alone, was in use - every session whatever its tier, read from outside
|
||||
/// the game. A session that recorded nothing, or whose game was never in front, has no point.
|
||||
/// </summary>
|
||||
ControllerShare,
|
||||
|
||||
KeyboardMouseShare,
|
||||
}
|
||||
@@ -96,9 +96,12 @@ public static class TrendSeriesBuilder
|
||||
public static bool Counts(SessionRow row, TrendMetric metric)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(row);
|
||||
return row.Tier == CaptureTier.Hooked || IsMachineMetric(metric) || IsDisplayMetric(metric);
|
||||
return row.Tier == CaptureTier.Hooked || IsMachineMetric(metric) || IsDisplayMetric(metric) || IsInputMetric(metric);
|
||||
}
|
||||
|
||||
/// <summary>The input shares (0.1.0-beta.50): read from outside the game, so every session has them whatever its tier.</summary>
|
||||
public static bool IsInputMetric(TrendMetric metric) => metric is TrendMetric.ControllerShare or TrendMetric.KeyboardMouseShare;
|
||||
|
||||
/// <summary>The display-mode shares (beta.10).</summary>
|
||||
public static bool IsDisplayMetric(TrendMetric metric) =>
|
||||
metric is TrendMetric.DisplayExclusiveShare or TrendMetric.DisplayBorderlessShare or TrendMetric.DisplayWindowedShare;
|
||||
@@ -127,7 +130,8 @@ public static class TrendSeriesBuilder
|
||||
ArgumentNullException.ThrowIfNull(row);
|
||||
// A display share is the whole session's by construction (beta.10): switching between fullscreen and a window resizes
|
||||
// the swap chain, which is exactly what marks a session "settings changed" — the share is what that change was.
|
||||
if (IsDisplayMetric(metric))
|
||||
// An input share is the whole session's too (0.1.0-beta.50): what it was played with does not depend on its settings.
|
||||
if (IsDisplayMetric(metric) || IsInputMetric(metric))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -190,6 +194,8 @@ public static class TrendSeriesBuilder
|
||||
TrendMetric.MaxGpuMemTemp => row.MaxGpuMemTemp,
|
||||
TrendMetric.PowerLimitShare => row.PowerLimitPct,
|
||||
TrendMetric.Efficiency => row.AppFramesPerJoule,
|
||||
TrendMetric.ControllerShare => row.InputSharePercent(row.InputControllerMs),
|
||||
TrendMetric.KeyboardMouseShare => row.InputSharePercent(row.InputKeyboardMouseMs),
|
||||
_ => null,
|
||||
};
|
||||
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Windows;
|
||||
using System.Windows.Automation.Peers;
|
||||
using System.Windows.Media;
|
||||
using FrameLedger.App.Charts;
|
||||
|
||||
namespace FrameLedger.App.Controls;
|
||||
@@ -11,96 +9,34 @@ namespace FrameLedger.App.Controls;
|
||||
/// <summary>
|
||||
/// The frame-generation mix as one bar (beta.24, owner decision D62): each segment a row's share of the session's presenting
|
||||
/// time, in the chart palette's colours (<see cref="ChartPalette.MixFill"/>). It says nothing the table beside it does not —
|
||||
/// every number is there, in text — and is announced by its <c>AutomationProperties.Name</c>.
|
||||
/// every number is there, in text — and is announced by its <c>AutomationProperties.Name</c>. The drawing is
|
||||
/// <see cref="ShareBar"/>'s.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// It follows a theme switch the way <see cref="ArtTint"/> does: a resource reference to <c>ApplicationBackgroundColor</c>, whose
|
||||
/// change redraws it and whose luminance picks the palette — never <c>ApplicationThemeManager.Changed</c>, which only
|
||||
/// <c>ApplicationThemeManager.Apply</c> raises. No colour is written in XAML (<c>08_UI</c> §Accessibility).
|
||||
/// </remarks>
|
||||
public sealed class FgMixBar : FrameworkElement
|
||||
public sealed class FgMixBar : ShareBar
|
||||
{
|
||||
public static readonly DependencyProperty SegmentsProperty = DependencyProperty.Register(
|
||||
nameof(Segments), typeof(IReadOnlyList<FgMixSegment>), typeof(FgMixBar),
|
||||
new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender));
|
||||
|
||||
/// <summary>The space between two segments, so neighbours of near colours — or any two in high contrast — still read as two.</summary>
|
||||
internal const double Gap = 2;
|
||||
|
||||
// The theme, heard through a resource reference (ArtTint's way).
|
||||
private static readonly DependencyProperty _themeProperty = DependencyProperty.Register(
|
||||
"Theme", typeof(object), typeof(FgMixBar), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender));
|
||||
|
||||
public FgMixBar()
|
||||
{
|
||||
SetResourceReference(_themeProperty, "ApplicationBackgroundColor");
|
||||
SnapsToDevicePixels = true;
|
||||
}
|
||||
|
||||
public IReadOnlyList<FgMixSegment>? Segments
|
||||
{
|
||||
get => (IReadOnlyList<FgMixSegment>?)GetValue(SegmentsProperty);
|
||||
set => SetValue(SegmentsProperty, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Each segment's rectangle in a bar <paramref name="width"/> by <paramref name="height"/>: widths in proportion to the
|
||||
/// shares, a <see cref="Gap"/> between two drawn segments; an empty rectangle (zero width) for a share of nothing.
|
||||
/// </summary>
|
||||
protected override IReadOnlyList<double> Shares => Segments is { Count: > 0 } segments ? [.. segments.Select(static s => s.Share)] : [];
|
||||
|
||||
/// <summary>Each segment's rectangle in a bar <paramref name="width"/> by <paramref name="height"/> (<see cref="ShareBar.Layout"/>).</summary>
|
||||
internal static IReadOnlyList<Rect> Layout(IReadOnlyList<FgMixSegment> segments, double width, double height)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(segments);
|
||||
var rects = new Rect[segments.Count];
|
||||
double total = segments.Sum(static s => Math.Max(0, s.Share));
|
||||
if (total <= 0 || width <= 0 || height <= 0)
|
||||
{
|
||||
return rects;
|
||||
}
|
||||
|
||||
int drawn = segments.Count(static s => s.Share > 0);
|
||||
double usable = Math.Max(0, width - (Gap * (drawn - 1)));
|
||||
double x = 0;
|
||||
for (int i = 0; i < segments.Count; i++)
|
||||
{
|
||||
double w = usable * Math.Max(0, segments[i].Share) / total;
|
||||
if (w <= 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
rects[i] = new Rect(x, 0, w, height);
|
||||
x += w + Gap;
|
||||
}
|
||||
|
||||
return rects;
|
||||
return Layout([.. segments.Select(static s => s.Share)], width, height);
|
||||
}
|
||||
|
||||
/// <summary>The palette for the theme the element's resources hold now; the applied theme's when none is reachable.</summary>
|
||||
internal ChartPalette Palette() => GetValue(_themeProperty) is Color background ? ChartPalette.ForBackground(background) : ChartTheme.Current;
|
||||
|
||||
protected override void OnRender(DrawingContext drawingContext)
|
||||
protected override ScottPlot.Color Fill(ChartPalette palette, int index)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(drawingContext);
|
||||
if (Segments is not { Count: > 0 } segments)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ChartPalette palette = Palette();
|
||||
IReadOnlyList<Rect> rects = Layout(segments, ActualWidth, ActualHeight);
|
||||
for (int i = 0; i < rects.Count; i++)
|
||||
{
|
||||
if (rects[i].Width <= 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
ScottPlot.Color fill = palette.MixFill(segments[i].Kind, segments[i].Factor);
|
||||
var brush = new SolidColorBrush(Color.FromArgb(fill.A, fill.R, fill.G, fill.B));
|
||||
brush.Freeze();
|
||||
drawingContext.DrawRoundedRectangle(brush, null, rects[i], 2, 2);
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(palette);
|
||||
FgMixSegment segment = Segments![index];
|
||||
return palette.MixFill(segment.Kind, segment.Factor);
|
||||
}
|
||||
|
||||
protected override AutomationPeer OnCreateAutomationPeer() => new FrameworkElementAutomationPeer(this);
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Windows;
|
||||
using FrameLedger.App.Charts;
|
||||
|
||||
namespace FrameLedger.App.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// What a session was played with as one bar (0.1.0-beta.50, <c>08_UI</c> §Session summary): each segment a class's
|
||||
/// share of the time the game was in front, in the chart palette's colours (<see cref="ChartPalette.InputFill"/>). The
|
||||
/// table beside it carries every number in text; the drawing is <see cref="ShareBar"/>'s.
|
||||
/// </summary>
|
||||
public sealed class InputShareBar : ShareBar
|
||||
{
|
||||
public static readonly DependencyProperty SegmentsProperty = DependencyProperty.Register(
|
||||
nameof(Segments), typeof(IReadOnlyList<InputShareSegment>), typeof(InputShareBar),
|
||||
new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender));
|
||||
|
||||
public IReadOnlyList<InputShareSegment>? Segments
|
||||
{
|
||||
get => (IReadOnlyList<InputShareSegment>?)GetValue(SegmentsProperty);
|
||||
set => SetValue(SegmentsProperty, value);
|
||||
}
|
||||
|
||||
protected override IReadOnlyList<double> Shares => Segments is { Count: > 0 } segments ? [.. segments.Select(static s => s.Share)] : [];
|
||||
|
||||
protected override ScottPlot.Color Fill(ChartPalette palette, int index)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(palette);
|
||||
return palette.InputFill(Segments![index].Class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using FrameLedger.Domain.Input;
|
||||
|
||||
namespace FrameLedger.App.Controls;
|
||||
|
||||
/// <summary>One segment of <see cref="InputShareBar"/> (0.1.0-beta.50): what the time was played with, and its share.</summary>
|
||||
/// <param name="Class">A controller, the keyboard or mouse, both at once, or no input.</param>
|
||||
/// <param name="Share">Its share of the time the game was in front (0..1); the bar draws the segments in proportion.</param>
|
||||
public sealed record InputShareSegment(InputClass Class, double Share);
|
||||
@@ -0,0 +1,104 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Windows;
|
||||
using System.Windows.Automation.Peers;
|
||||
using System.Windows.Media;
|
||||
using FrameLedger.App.Charts;
|
||||
|
||||
namespace FrameLedger.App.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// Shares of one whole as one bar: each segment as wide as its share, in the chart palette's colours. What
|
||||
/// <see cref="FgMixBar"/> (beta.24, D62) and <see cref="InputShareBar"/> (0.1.0-beta.50) have in common. A bar says
|
||||
/// nothing the table beside it does not - every number is there, in text - and is announced by its
|
||||
/// <c>AutomationProperties.Name</c>.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// It follows a theme switch the way <see cref="ArtTint"/> does: a resource reference to <c>ApplicationBackgroundColor</c>, whose
|
||||
/// change redraws it and whose luminance picks the palette — never <c>ApplicationThemeManager.Changed</c>, which only
|
||||
/// <c>ApplicationThemeManager.Apply</c> raises. No colour is written in XAML (<c>08_UI</c> §Accessibility).
|
||||
/// </remarks>
|
||||
public abstract class ShareBar : FrameworkElement
|
||||
{
|
||||
/// <summary>The space between two segments, so neighbours of near colours — or any two in high contrast — still read as two.</summary>
|
||||
internal const double Gap = 2;
|
||||
|
||||
// The theme, heard through a resource reference (ArtTint's way).
|
||||
private static readonly DependencyProperty _themeProperty = DependencyProperty.Register(
|
||||
"Theme", typeof(object), typeof(ShareBar), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender));
|
||||
|
||||
protected ShareBar()
|
||||
{
|
||||
SetResourceReference(_themeProperty, "ApplicationBackgroundColor");
|
||||
SnapsToDevicePixels = true;
|
||||
}
|
||||
|
||||
/// <summary>The shares to draw, in order; empty when there is nothing to draw.</summary>
|
||||
protected abstract IReadOnlyList<double> Shares { get; }
|
||||
|
||||
/// <summary>The colour of the segment at <paramref name="index"/>.</summary>
|
||||
protected abstract ScottPlot.Color Fill(ChartPalette palette, int index);
|
||||
|
||||
/// <summary>
|
||||
/// Each share's rectangle in a bar <paramref name="width"/> by <paramref name="height"/>: widths in proportion to the
|
||||
/// shares, a <see cref="Gap"/> between two drawn segments; an empty rectangle (zero width) for a share of nothing.
|
||||
/// </summary>
|
||||
internal static IReadOnlyList<Rect> Layout(IReadOnlyList<double> shares, double width, double height)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(shares);
|
||||
var rects = new Rect[shares.Count];
|
||||
double total = shares.Sum(static s => Math.Max(0, s));
|
||||
if (total <= 0 || width <= 0 || height <= 0)
|
||||
{
|
||||
return rects;
|
||||
}
|
||||
|
||||
int drawn = shares.Count(static s => s > 0);
|
||||
double usable = Math.Max(0, width - (Gap * (drawn - 1)));
|
||||
double x = 0;
|
||||
for (int i = 0; i < shares.Count; i++)
|
||||
{
|
||||
double w = usable * Math.Max(0, shares[i]) / total;
|
||||
if (w <= 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
rects[i] = new Rect(x, 0, w, height);
|
||||
x += w + Gap;
|
||||
}
|
||||
|
||||
return rects;
|
||||
}
|
||||
|
||||
/// <summary>The palette for the theme the element's resources hold now; the applied theme's when none is reachable.</summary>
|
||||
internal ChartPalette Palette() => GetValue(_themeProperty) is Color background ? ChartPalette.ForBackground(background) : ChartTheme.Current;
|
||||
|
||||
protected override void OnRender(DrawingContext drawingContext)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(drawingContext);
|
||||
IReadOnlyList<double> shares = Shares;
|
||||
if (shares.Count == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ChartPalette palette = Palette();
|
||||
IReadOnlyList<Rect> rects = Layout(shares, ActualWidth, ActualHeight);
|
||||
for (int i = 0; i < rects.Count; i++)
|
||||
{
|
||||
if (rects[i].Width <= 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
ScottPlot.Color fill = Fill(palette, i);
|
||||
var brush = new SolidColorBrush(Color.FromArgb(fill.A, fill.R, fill.G, fill.B));
|
||||
brush.Freeze();
|
||||
drawingContext.DrawRoundedRectangle(brush, null, rects[i], 2, 2);
|
||||
}
|
||||
}
|
||||
|
||||
protected override AutomationPeer OnCreateAutomationPeer() => new FrameworkElementAutomationPeer(this);
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Globalization;
|
||||
using System.Text.Json;
|
||||
using FrameLedger.Application.Persistence;
|
||||
using FrameLedger.Domain.Input;
|
||||
using FrameLedger.Domain.Sessions;
|
||||
|
||||
namespace FrameLedger.App.Services;
|
||||
|
||||
/// <summary>
|
||||
/// "Does this game support controllers?" as the game's page answers it (owner decision D163): three pieces of
|
||||
/// evidence, each with where it comes from, and no verdict. What the store's own file lists; which input libraries the
|
||||
/// game had loaded when it was last measured from inside; how it has actually been played. From outside a game one
|
||||
/// can know a controller was in use while the game was in front - not what the game did with it - so none of the
|
||||
/// three is turned into a Yes or a No of FrameLedger's.
|
||||
/// </summary>
|
||||
public static class ControllerEvidence
|
||||
{
|
||||
/// <summary>What the store lists: Steam's word, or that no store file on this PC describes the game.</summary>
|
||||
public static string StoreText(GameRow game)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(game);
|
||||
return game.ControllerSupport switch
|
||||
{
|
||||
"full" => Strings.GameDetail_Controller_Store_Full,
|
||||
"partial" => Strings.GameDetail_Controller_Store_Partial,
|
||||
"none" => Strings.GameDetail_Controller_Store_None,
|
||||
_ => Strings.GameDetail_Controller_Store_Unknown,
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The input libraries the game had loaded in its newest session measured from inside that looked for them, each
|
||||
/// interface with its files; that none was seen; or that no such session exists - a session that was not hooked
|
||||
/// takes no module snapshot, and one recorded before 0.1.0-beta.50 did not look for these.
|
||||
/// </summary>
|
||||
public static string LibrariesText(IReadOnlyList<SessionRow> sessions)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(sessions);
|
||||
foreach (SessionRow session in sessions)
|
||||
{
|
||||
if (session.Tier != CaptureTier.Hooked || Modules(session.RuntimeModulesJson) is not { } modules)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Whether the session looked cannot be read from one that found none of them: a session recorded before the
|
||||
// names were added has none either. The newest hooked session with modules is the one asked.
|
||||
string[] found = [.. modules.Keys
|
||||
.Where(static m => InputLibraries.Is(m))
|
||||
.GroupBy(static m => InputLibraries.ApiOf(m)!, StringComparer.Ordinal)
|
||||
.OrderBy(static g => g.Key, StringComparer.Ordinal)
|
||||
.Select(static g => g.Key + " (" + string.Join(", ", g.OrderBy(static f => f, StringComparer.OrdinalIgnoreCase)) + ")")];
|
||||
return found.Length > 0 ? string.Join(Environment.NewLine, found) : Strings.GameDetail_Controller_Libraries_NoneSeen;
|
||||
}
|
||||
|
||||
return Strings.GameDetail_Controller_Libraries_Unknown;
|
||||
}
|
||||
|
||||
/// <summary>How the game has been played, over every session that recorded it: each class's share of the time in front, and how many sessions that is.</summary>
|
||||
public static string PlayedWithText(IReadOnlyList<SessionRow> sessions)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(sessions);
|
||||
SessionRow[] recorded = [.. sessions.Where(static s => s.InputForegroundMs is > 0)];
|
||||
long front = recorded.Sum(static s => s.InputForegroundMs ?? 0);
|
||||
if (front <= 0)
|
||||
{
|
||||
return Strings.GameDetail_Controller_Played_Unknown;
|
||||
}
|
||||
|
||||
return string.Format(
|
||||
CultureInfo.CurrentCulture,
|
||||
recorded.Length == 1 ? Strings.GameDetail_Controller_Played_One_Format : Strings.GameDetail_Controller_Played_Many_Format,
|
||||
Formats.Share(100d * recorded.Sum(static s => s.InputControllerMs ?? 0) / front),
|
||||
Formats.Share(100d * recorded.Sum(static s => s.InputKeyboardMouseMs ?? 0) / front),
|
||||
Formats.Share(100d * recorded.Sum(static s => s.InputBothMs ?? 0) / front),
|
||||
Formats.Share(100d * recorded.Sum(static s => s.InputIdleMs ?? 0) / front),
|
||||
recorded.Length);
|
||||
}
|
||||
|
||||
/// <summary>Whether a module is one of the input libraries - the session's Libraries line leaves those to this page.</summary>
|
||||
public static bool IsInputLibrary(string moduleFileName) => InputLibraries.Is(moduleFileName);
|
||||
|
||||
private static Dictionary<string, string?>? Modules(string? json)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(json))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
return JsonSerializer.Deserialize(json, AppJsonContext.Default.DictionaryStringString) is { Count: > 0 } modules
|
||||
? modules.ToDictionary(static m => m.Key, static m => (string?)m.Value, StringComparer.OrdinalIgnoreCase)
|
||||
: null;
|
||||
}
|
||||
catch (JsonException)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -42,6 +42,7 @@ public static class EmbeddedDocuments
|
||||
"guide/10-glossary.md",
|
||||
"guide/11-alpha-builds.md",
|
||||
"guide/12-advanced-metrics.md",
|
||||
"guide/13-controllers.md",
|
||||
"guide/terms-in-plain-words.md",
|
||||
];
|
||||
|
||||
|
||||
@@ -21,9 +21,12 @@ public sealed class GameLibrary
|
||||
private readonly ISessionRepository _sessions;
|
||||
private readonly ISessionAnnotationRepository _annotations;
|
||||
private readonly TimeProvider _clock;
|
||||
private readonly StoreControllerSupport? _controllers;
|
||||
|
||||
public GameLibrary(IGameRepository games, ISessionRepository sessions, ISessionAnnotationRepository annotations, TimeProvider? clock = null)
|
||||
public GameLibrary(IGameRepository games, ISessionRepository sessions, ISessionAnnotationRepository annotations, TimeProvider? clock = null,
|
||||
StoreControllerSupport? controllers = null)
|
||||
{
|
||||
_controllers = controllers;
|
||||
_games = games ?? throw new ArgumentNullException(nameof(games));
|
||||
_sessions = sessions ?? throw new ArgumentNullException(nameof(sessions));
|
||||
_annotations = annotations ?? throw new ArgumentNullException(nameof(annotations));
|
||||
@@ -47,6 +50,12 @@ public sealed class GameLibrary
|
||||
return null;
|
||||
}
|
||||
|
||||
// D163: what the store's own file on this PC lists of controller support, read as the page opens.
|
||||
if (_controllers is not null)
|
||||
{
|
||||
row = await _controllers.RefreshAsync(row, ct).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
IReadOnlyList<SessionRow> sessions = await _sessions.ListByGameAsync(gameId, sessionLimit, ct).ConfigureAwait(false);
|
||||
IReadOnlyList<SessionAnnotation> annotations = await _annotations.ListByGameAsync(gameId, ct).ConfigureAwait(false);
|
||||
return new GameDetail(row, sessions, annotations.ToDictionary(static a => a.SessionId));
|
||||
|
||||
@@ -0,0 +1,342 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Globalization;
|
||||
using FrameLedger.App.Controls;
|
||||
using FrameLedger.App.ViewModels;
|
||||
using FrameLedger.Application.Input;
|
||||
using FrameLedger.Application.Persistence;
|
||||
using FrameLedger.Application.Recording;
|
||||
using FrameLedger.Domain.Input;
|
||||
|
||||
namespace FrameLedger.App.Services;
|
||||
|
||||
/// <summary>
|
||||
/// The session summary's "Played with" block (0.1.0-beta.50, owner decisions D155-D163; <c>08_UI</c> §Session summary):
|
||||
/// the row's stored input totals as a bar and a table, the session's controllers from <c>sessions.input_devices</c>, each
|
||||
/// maker's share, and why a session has none. Every figure is read from the row - nothing is recomputed from the series.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// What it can say is what was read from outside the game: a device was in use while the game was in front. Never what
|
||||
/// the game did with it, never a button, a stick or a key (<c>docs/21_INPUT_DEVICES.md</c>).
|
||||
/// </remarks>
|
||||
[SuppressMessage("Performance", "CA1863:Use 'CompositeFormat'", Justification = "the format strings are resources that follow the UI culture, which changes at runtime")]
|
||||
public static class InputPresentation
|
||||
{
|
||||
private static readonly CultureInfo _inv = CultureInfo.InvariantCulture;
|
||||
|
||||
/// <summary>The order of the bar and the table: a controller, the keyboard and mouse, both at once, no input.</summary>
|
||||
private static readonly InputClass[] _order = [InputClass.Controller, InputClass.KeyboardMouse, InputClass.Both, InputClass.None];
|
||||
|
||||
/// <summary>Whether the session has shares to show: something was read while the game was in front.</summary>
|
||||
public static bool HasShares(SessionRow row)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(row);
|
||||
return row.InputForegroundMs is > 0;
|
||||
}
|
||||
|
||||
/// <summary>The table's four rows, in the bar's order; empty when the session has no share to show.</summary>
|
||||
public static IReadOnlyList<InputClassRowModel> Rows(SessionRow row)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(row);
|
||||
if (row.InputForegroundMs is not { } front || front <= 0)
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
return [.. _order.Select(c =>
|
||||
{
|
||||
long ms = Milliseconds(row, c);
|
||||
return new InputClassRowModel(ClassLabel(c), Formats.Share(100d * ms / front), Formats.Duration(ms / 1000d), new InputShareSegment(c, (double)ms / front));
|
||||
})];
|
||||
}
|
||||
|
||||
/// <summary>A class in the user's words.</summary>
|
||||
public static string ClassLabel(InputClass input) => input switch
|
||||
{
|
||||
InputClass.Controller => Strings.Input_Class_Controller,
|
||||
InputClass.KeyboardMouse => Strings.Input_Class_KeyboardMouse,
|
||||
InputClass.Both => Strings.Input_Class_Both,
|
||||
_ => Strings.Input_Class_None,
|
||||
};
|
||||
|
||||
/// <summary>How long the session was read and how long the game was in front - what the shares are shares of.</summary>
|
||||
public static string? Context(SessionRow row)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(row);
|
||||
return row is { InputObservedMs: { } observed, InputForegroundMs: { } front }
|
||||
? string.Format(CultureInfo.CurrentCulture, Strings.Input_Context_Format, Formats.Duration(observed / 1000d), Formats.Duration(front / 1000d))
|
||||
: null;
|
||||
}
|
||||
|
||||
/// <summary>The bar's spoken name: every row with its share, in the table's order.</summary>
|
||||
public static string AccessibleName(IReadOnlyList<InputClassRowModel> rows)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(rows);
|
||||
return string.Format(CultureInfo.CurrentCulture, Strings.Input_Bar_Name_Format, string.Join(", ", rows.Select(static r => r.Label + " " + r.Share)));
|
||||
}
|
||||
|
||||
/// <summary>How often the session went from a controller to the keyboard and mouse or back; null when nothing was read.</summary>
|
||||
public static string? Switches(SessionRow row)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(row);
|
||||
return HasShares(row) && row.InputMethodSwitches is { } switches
|
||||
? string.Format(CultureInfo.CurrentCulture, Strings.Input_Switches_Format, switches)
|
||||
: null;
|
||||
}
|
||||
|
||||
/// <summary>The session's controllers, in the order they were first seen; empty when none was.</summary>
|
||||
public static IReadOnlyList<InputControllerRowModel> Controllers(InputDevicesRecord? record) =>
|
||||
record is null ? [] : [.. record.Devices.Select(Controller)];
|
||||
|
||||
/// <summary>One controller as its row.</summary>
|
||||
public static InputControllerRowModel Controller(InputDeviceRecord device)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(device);
|
||||
return new InputControllerRowModel(
|
||||
ControllerName(device),
|
||||
ConnectionLabel(InputNames.ConnectionOf(device.Connection)),
|
||||
Formats.Duration(device.ActiveMs / 1000d),
|
||||
Formats.Duration(device.ConnectedMs / 1000d),
|
||||
string.Format(CultureInfo.CurrentCulture, Strings.Input_Events_Format, device.Connects, device.Disconnects),
|
||||
BatteryText(device.Battery));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The model's name where the ledger has one, the maker's otherwise; a pad a program presents, and one a remapper
|
||||
/// stood in front of, say so - they are what Windows showed, not a second controller in the player's hands.
|
||||
/// </summary>
|
||||
public static string ControllerName(InputDeviceRecord device)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(device);
|
||||
string name = device.Model is { Length: > 0 } model
|
||||
? model
|
||||
: string.Format(CultureInfo.CurrentCulture, Strings.Input_Controller_Unnamed_Format, FamilyLabel(InputNames.FamilyOf(device.Family)));
|
||||
return device.Virtual
|
||||
? string.Format(CultureInfo.CurrentCulture, Strings.Input_Controller_Virtual_Format, name)
|
||||
: device.Remapped ? string.Format(CultureInfo.CurrentCulture, Strings.Input_Controller_Remapped_Format, name) : name;
|
||||
}
|
||||
|
||||
/// <summary>A maker in the user's words.</summary>
|
||||
public static string FamilyLabel(ControllerFamily family) => family switch
|
||||
{
|
||||
ControllerFamily.Xbox => Strings.Input_Family_Xbox,
|
||||
ControllerFamily.PlayStation => Strings.Input_Family_PlayStation,
|
||||
ControllerFamily.Nintendo => Strings.Input_Family_Nintendo,
|
||||
_ => Strings.Input_Family_Other,
|
||||
};
|
||||
|
||||
/// <summary>A connection in the user's words.</summary>
|
||||
public static string ConnectionLabel(ControllerConnection connection) => connection switch
|
||||
{
|
||||
ControllerConnection.Usb => Strings.Input_Connection_Usb,
|
||||
ControllerConnection.Bluetooth => Strings.Input_Connection_Bluetooth,
|
||||
ControllerConnection.Wireless => Strings.Input_Connection_Wireless,
|
||||
_ => Strings.Input_Connection_Unknown,
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// A controller's battery over the session: the state it was read in longest and for how long (the owner's fifth
|
||||
/// point), then the first and last level and how fast it ran down where those are known. <c>N/A</c> with the reason
|
||||
/// where no battery was read.
|
||||
/// </summary>
|
||||
public static string BatteryText(InputBatteryRecord? battery)
|
||||
{
|
||||
if (battery is null || battery.States.Count == 0)
|
||||
{
|
||||
return Strings.Input_Battery_NotRead;
|
||||
}
|
||||
|
||||
BatteryScale scale = InputNames.ScaleOf(battery.Scale);
|
||||
InputBatteryStateRecord longest = battery.States[0];
|
||||
var parts = new List<string>(3)
|
||||
{
|
||||
string.Format(CultureInfo.CurrentCulture, Strings.Input_Battery_Longest_Format, StateText(InputNames.StateOf(longest.State), scale, longest.Level), Formats.Duration(longest.Ms / 1000d)),
|
||||
};
|
||||
if (scale != BatteryScale.None && battery is { First: { } first, Last: { } last })
|
||||
{
|
||||
parts.Add(string.Format(CultureInfo.CurrentCulture, Strings.Input_Battery_Span_Format, LevelText(scale, first), LevelText(scale, last)));
|
||||
}
|
||||
|
||||
if (battery.DrainPercentPerHour is { } drain)
|
||||
{
|
||||
parts.Add(string.Format(CultureInfo.CurrentCulture, Strings.Input_Battery_Drain_Format, drain));
|
||||
}
|
||||
|
||||
return string.Join(" · ", parts);
|
||||
}
|
||||
|
||||
/// <summary>What a battery was doing, with its level where it has one.</summary>
|
||||
public static string StateText(BatteryState state, BatteryScale scale, int level) => state switch
|
||||
{
|
||||
BatteryState.Wired => Strings.Input_Battery_State_Wired,
|
||||
BatteryState.Full => Strings.Input_Battery_State_Full,
|
||||
BatteryState.Charging => scale == BatteryScale.None ? Strings.Input_Battery_State_Charging : string.Format(CultureInfo.CurrentCulture, Strings.Input_Battery_State_Charging_Format, LevelText(scale, level)),
|
||||
BatteryState.Discharging => scale == BatteryScale.None ? Strings.Input_Battery_State_Discharging : string.Format(CultureInfo.CurrentCulture, Strings.Input_Battery_State_Discharging_Format, LevelText(scale, level)),
|
||||
_ => scale == BatteryScale.None ? Strings.Input_Battery_State_Unknown : LevelText(scale, level),
|
||||
};
|
||||
|
||||
/// <summary>A level in its own scale: a percentage, or XInput's four words.</summary>
|
||||
public static string LevelText(BatteryScale scale, int level) => scale switch
|
||||
{
|
||||
BatteryScale.Percent => level.ToString("0", CultureInfo.CurrentCulture) + "%",
|
||||
BatteryScale.FourLevels => level switch
|
||||
{
|
||||
<= 0 => Strings.Input_Battery_Level_Empty,
|
||||
1 => Strings.Input_Battery_Level_Low,
|
||||
2 => Strings.Input_Battery_Level_Medium,
|
||||
_ => Strings.Input_Battery_Level_Full,
|
||||
},
|
||||
_ => Strings.Common_NotAvailable,
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Each maker's share of the time controllers were in use and how often the maker in use changed (the owner's seventh
|
||||
/// point); null with fewer than two makers - one maker's share of itself says nothing.
|
||||
/// </summary>
|
||||
public static string? Makers(InputDevicesRecord? record)
|
||||
{
|
||||
if (record is null || record.Families.Count < 2)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
string shares = string.Join(" · ", record.Families.Select(static f => FamilyLabel(InputNames.FamilyOf(f.Family)) + " " + Formats.Share(f.Share * 100)));
|
||||
return string.Format(CultureInfo.CurrentCulture, Strings.Input_Makers_Format, shares, record.FamilySwitches);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// What the reader could not do in this session and what Windows showed twice, one sentence each: nothing that would
|
||||
/// leave a figure looking more complete than it is goes unsaid. Empty for a session with nothing to add.
|
||||
/// </summary>
|
||||
public static IReadOnlyList<string> Notes(InputDevicesRecord? record)
|
||||
{
|
||||
var notes = new List<string>();
|
||||
if (record is null)
|
||||
{
|
||||
return notes;
|
||||
}
|
||||
|
||||
if (record.VirtualPad || record.Devices.Any(static d => d.Remapped))
|
||||
{
|
||||
notes.Add(Strings.Input_Note_VirtualPad);
|
||||
}
|
||||
|
||||
InputHealth health = record.Health;
|
||||
if (!health.RawInputRegistered)
|
||||
{
|
||||
notes.Add(Strings.Input_Note_NoRawInput);
|
||||
}
|
||||
|
||||
if (!health.XInputAvailable)
|
||||
{
|
||||
notes.Add(Strings.Input_Note_NoXInput);
|
||||
}
|
||||
|
||||
if (!health.LastInputAvailable)
|
||||
{
|
||||
notes.Add(Strings.Input_Note_NoLastInput);
|
||||
}
|
||||
|
||||
if (health.Faults > 0)
|
||||
{
|
||||
notes.Add(string.Format(CultureInfo.CurrentCulture, Strings.Input_Note_Faults_Format, health.Faults));
|
||||
}
|
||||
|
||||
return notes;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Why a session shows no "Played with": the terms that describe the reading were not accepted yet, the game was
|
||||
/// never in front, or nothing was recorded - the option was off, or the session is older than it. Null when the
|
||||
/// block is shown.
|
||||
/// </summary>
|
||||
public static string? Missing(SessionRow row)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(row);
|
||||
if (HasShares(row))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (CaptureNotes.Parse(row.CaptureNotes).InputHeldForTerms)
|
||||
{
|
||||
return Strings.Input_Missing_Terms;
|
||||
}
|
||||
|
||||
return row.InputObservedMs is > 0 ? Strings.Input_Missing_NeverInFront : Strings.Input_Missing_NotRecorded;
|
||||
}
|
||||
|
||||
/// <summary>The four shares in one line - Compare's cell; <c>N/A</c> for a session with none.</summary>
|
||||
public static string SharesText(SessionRow row)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(row);
|
||||
return HasShares(row)
|
||||
? string.Format(
|
||||
CultureInfo.CurrentCulture,
|
||||
Strings.Input_Shares_Format,
|
||||
Formats.Share(row.InputSharePercent(row.InputControllerMs)),
|
||||
Formats.Share(row.InputSharePercent(row.InputKeyboardMouseMs)),
|
||||
Formats.Share(row.InputSharePercent(row.InputBothMs)),
|
||||
Formats.Share(row.InputSharePercent(row.InputIdleMs)))
|
||||
: Strings.Common_NotAvailable;
|
||||
}
|
||||
|
||||
/// <summary>The session's controllers by name in one line - Compare's cell; <c>N/A</c> where nothing was read, "none" where none was seen.</summary>
|
||||
public static string ControllersText(SessionRow row)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(row);
|
||||
if (row.InputObservedMs is not > 0)
|
||||
{
|
||||
return Strings.Common_NotAvailable;
|
||||
}
|
||||
|
||||
InputDevicesRecord? record = InputDevicesRecord.Parse(row.InputDevicesJson);
|
||||
return record is { Devices.Count: > 0 }
|
||||
? string.Join(" · ", record.Devices.Select(static d => ControllerName(d) + " (" + ConnectionLabel(InputNames.ConnectionOf(d.Connection)) + ")"))
|
||||
: Strings.Input_Controllers_None;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The CSV header's line (<c>03_METRICS</c> §Export schema), InvariantCulture: the milliseconds read, in front and in
|
||||
/// each class, the method switches, the sources, then each controller - its maker, model, connection, the time in
|
||||
/// use and connected, its connects and disconnects. <c>N/A</c> for a session with nothing read. What the export
|
||||
/// carries is what Privacy Policy §3A says it carries.
|
||||
/// </summary>
|
||||
public static string ExportLine(SessionRow row)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(row);
|
||||
if (row.InputObservedMs is not { } observed)
|
||||
{
|
||||
return "N/A";
|
||||
}
|
||||
|
||||
string totals = "observed_ms " + observed.ToString(_inv)
|
||||
+ "; foreground_ms " + (row.InputForegroundMs ?? 0).ToString(_inv)
|
||||
+ "; controller_ms " + (row.InputControllerMs ?? 0).ToString(_inv)
|
||||
+ "; keyboard_mouse_ms " + (row.InputKeyboardMouseMs ?? 0).ToString(_inv)
|
||||
+ "; both_ms " + (row.InputBothMs ?? 0).ToString(_inv)
|
||||
+ "; idle_ms " + (row.InputIdleMs ?? 0).ToString(_inv)
|
||||
+ "; method_switches " + (row.InputMethodSwitches ?? 0).ToString(_inv)
|
||||
+ "; source " + (row.InputSource ?? "n/a");
|
||||
InputDevicesRecord? record = InputDevicesRecord.Parse(row.InputDevicesJson);
|
||||
if (record is null || record.Devices.Count == 0)
|
||||
{
|
||||
return totals + "; controllers none";
|
||||
}
|
||||
|
||||
return totals + "; " + string.Join("; ", record.Devices.Select(static d =>
|
||||
"controller " + d.Index.ToString(_inv) + " " + d.Family + " " + (d.Model ?? "unnamed") + " " + d.Connection
|
||||
+ " active_ms " + d.ActiveMs.ToString(_inv) + " connected_ms " + d.ConnectedMs.ToString(_inv)
|
||||
+ " connects " + d.Connects.ToString(_inv) + " disconnects " + d.Disconnects.ToString(_inv)));
|
||||
}
|
||||
|
||||
private static long Milliseconds(SessionRow row, InputClass input) => input switch
|
||||
{
|
||||
InputClass.Controller => row.InputControllerMs ?? 0,
|
||||
InputClass.KeyboardMouse => row.InputKeyboardMouseMs ?? 0,
|
||||
InputClass.Both => row.InputBothMs ?? 0,
|
||||
_ => row.InputIdleMs ?? 0,
|
||||
};
|
||||
}
|
||||
@@ -117,6 +117,10 @@ public sealed class SessionExporter
|
||||
// beta.12 (D43, 03_METRICS §Game process memory): the game's own memory, both tiers, MiB — a header line for the same
|
||||
// reason as the display: it is the session's, read once a second, not a frame's.
|
||||
w.WriteLine("# game_memory: " + GameMemoryText.ExportLine(row));
|
||||
|
||||
// 0.1.0-beta.50 (D160, 03_METRICS §Input): what the session was played with and its controllers, both tiers - what
|
||||
// Privacy Policy §3A says an export carries. Never a button, a key, a serial number or an address: the row has none.
|
||||
w.WriteLine("# input: " + InputPresentation.ExportLine(row));
|
||||
w.WriteLine("# hardware: " + (hardware is null ? "N/A" : string.Join("; ", new[] { hardware.CpuName, hardware.GpuName, hardware.GpuDriver, hardware.OsBuild, hardware.DisplayRes }.Where(static s => !string.IsNullOrEmpty(s)))));
|
||||
w.WriteLine("# rt: " + row.RtFlag + " (" + (row.RtSource ?? "n/a") + "); pt: " + row.PtFlag + " (" + (row.PtSource ?? "n/a") + "); rr: " + row.RrFlag + " (" + (row.RrSource ?? "n/a") + ")");
|
||||
// beta.24 (D63): the session's quality mode and whose it is: the NVIDIA App's override the driver reported applied
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Globalization;
|
||||
using FrameLedger.Application.Import;
|
||||
using FrameLedger.Application.Persistence;
|
||||
using FrameLedger.Application.Play;
|
||||
using FrameLedger.Infrastructure.Import;
|
||||
using Serilog;
|
||||
|
||||
namespace FrameLedger.App.Services;
|
||||
|
||||
/// <summary>
|
||||
/// What the store that installed a game lists of controller support (owner decision D163): read from the Steam app's
|
||||
/// own file on this PC when a game's page is opened, and written to the game's row when it differs. No request is
|
||||
/// made to any store (CLAUDE.md rule 8) - a game no store file on this PC describes keeps what it had, which for most
|
||||
/// is nothing.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// It is the store's word and one of three pieces of evidence the page shows; it is never FrameLedger's verdict.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <b>A viewer reads nothing of this PC</b> (D52): the copy it shows came from another PC, whose stores are not here.
|
||||
/// It shows what the copy's rows hold.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public sealed class StoreControllerSupport
|
||||
{
|
||||
private const string _steam = "steam";
|
||||
|
||||
private readonly StoreRecordsReader _stores;
|
||||
private readonly IGameRepository _games;
|
||||
private readonly UiMode _mode;
|
||||
private readonly Func<string?> _appInfoFile;
|
||||
private readonly TimeProvider _clock;
|
||||
|
||||
/// <summary>A reader over the stores' records and the Steam app's own file.</summary>
|
||||
/// <param name="stores">The stores' records of what they installed.</param>
|
||||
/// <param name="games">Where the fact is written.</param>
|
||||
/// <param name="mode">A viewer reads nothing of this PC.</param>
|
||||
/// <param name="appInfoFile">Where Steam's file is; null is where the Steam app on this PC keeps it.</param>
|
||||
/// <param name="clock">When the fact was read.</param>
|
||||
public StoreControllerSupport(StoreRecordsReader stores, IGameRepository games, UiMode mode, Func<string?>? appInfoFile = null, TimeProvider? clock = null)
|
||||
{
|
||||
_stores = stores ?? throw new ArgumentNullException(nameof(stores));
|
||||
_games = games ?? throw new ArgumentNullException(nameof(games));
|
||||
_mode = mode ?? throw new ArgumentNullException(nameof(mode));
|
||||
_appInfoFile = appInfoFile ?? SteamAppInfo.InstalledFile;
|
||||
_clock = clock ?? TimeProvider.System;
|
||||
}
|
||||
|
||||
/// <summary>The game's row with the store's word as it stands now: the row given when nothing could be read or nothing changed.</summary>
|
||||
public async Task<GameRow> RefreshAsync(GameRow game, CancellationToken ct = default)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(game);
|
||||
if (_mode.IsViewer)
|
||||
{
|
||||
return game;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
IReadOnlyList<StoreGame> records = await _stores.ReadAsync("controller support", [_steam], ct).ConfigureAwait(false);
|
||||
if (StoreRecords.Owning(game.Fingerprint.ExePath, game.StoreId, records) is not { Platform: _steam } record
|
||||
|| !uint.TryParse(record.StoreId, NumberStyles.None, CultureInfo.InvariantCulture, out uint appId)
|
||||
|| _appInfoFile() is not { } file)
|
||||
{
|
||||
return game;
|
||||
}
|
||||
|
||||
SteamAppInfoResult read = await Task.Run(() => SteamAppInfo.ReadControllerSupport(file, [appId]), ct).ConfigureAwait(false);
|
||||
if (read.Problem is { } problem)
|
||||
{
|
||||
Log.Information("controller support: Steam's file was not read ({Problem})", problem);
|
||||
return game;
|
||||
}
|
||||
|
||||
if (!read.Support.TryGetValue(appId, out string? support) || string.Equals(support, game.ControllerSupport, StringComparison.Ordinal))
|
||||
{
|
||||
return game;
|
||||
}
|
||||
|
||||
DateTimeOffset now = _clock.GetUtcNow();
|
||||
return await _games.SetControllerSupportAsync(game.Id, support, SteamAppInfo.Source, now, ct).ConfigureAwait(false)
|
||||
? game with { ControllerSupport = support, ControllerSupportSource = SteamAppInfo.Source, ControllerSupportAt = now }
|
||||
: game;
|
||||
}
|
||||
catch (Exception e) when (e is not OperationCanceledException and not OutOfMemoryException)
|
||||
{
|
||||
// The page opens without it: a store's file is never a reason for a game's page to fail.
|
||||
Log.Warning("controller support: {Message}", e.Message);
|
||||
return game;
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+261
@@ -40,6 +40,8 @@ public static class Strings
|
||||
nameof(A11y_Chart_ControlType),
|
||||
nameof(A11y_Chart_Frametime),
|
||||
nameof(A11y_Chart_Histogram),
|
||||
nameof(A11y_Chart_InputBattery),
|
||||
nameof(A11y_Chart_InputTimeline),
|
||||
nameof(A11y_Chart_Keys),
|
||||
nameof(A11y_Chart_Latency),
|
||||
nameof(A11y_Chart_Percentiles),
|
||||
@@ -50,6 +52,7 @@ public static class Strings
|
||||
nameof(A11y_Chart_Vram),
|
||||
nameof(A11y_ChartData_Advanced),
|
||||
nameof(A11y_ChartData_Compare),
|
||||
nameof(A11y_ChartData_Input),
|
||||
nameof(A11y_ChartData_Latency),
|
||||
nameof(A11y_ChartData_Sessions),
|
||||
nameof(A11y_ChartData_Summary),
|
||||
@@ -457,6 +460,7 @@ public static class Strings
|
||||
nameof(ChangeExe_Done_Format),
|
||||
nameof(ChangeExe_Taken_Format),
|
||||
nameof(ChangeExe_Unreadable_Format),
|
||||
nameof(Chart_Axis_Battery),
|
||||
nameof(Chart_Axis_Count),
|
||||
nameof(Chart_Axis_Fps),
|
||||
nameof(Chart_Axis_Frametime),
|
||||
@@ -467,7 +471,15 @@ public static class Strings
|
||||
nameof(Chart_Axis_TimeFromFirstFrame),
|
||||
nameof(Chart_Axis_TimeFromStart),
|
||||
nameof(Chart_Decimated_Format),
|
||||
nameof(Chart_Input_Device_Format),
|
||||
nameof(Chart_Input_Event_BatteryLow),
|
||||
nameof(Chart_Input_Event_Connected),
|
||||
nameof(Chart_Input_Event_Disconnected),
|
||||
nameof(Chart_Input_FourLevels),
|
||||
nameof(Chart_Input_NotStored),
|
||||
nameof(Chart_InputBattery_NotRead),
|
||||
nameof(Chart_Note_GapsClosed_Format),
|
||||
nameof(Chart_Note_GapsClosed_Marks_Format),
|
||||
nameof(Chart_Note_NoApplicationFrames),
|
||||
nameof(Chart_Note_OutsideRange_Format),
|
||||
nameof(Chart_Note_PresentsTiming),
|
||||
@@ -520,6 +532,7 @@ public static class Strings
|
||||
nameof(Compare_Legend_Format),
|
||||
nameof(Compare_Metric_AvgCpuLoad),
|
||||
nameof(Compare_Metric_AvgGpuLoad),
|
||||
nameof(Compare_Metric_Controllers),
|
||||
nameof(Compare_Metric_Display),
|
||||
nameof(Compare_Metric_Displayed),
|
||||
nameof(Compare_Metric_Duration),
|
||||
@@ -538,6 +551,7 @@ public static class Strings
|
||||
nameof(Compare_Metric_Native),
|
||||
nameof(Compare_Metric_P01Low),
|
||||
nameof(Compare_Metric_P1Low),
|
||||
nameof(Compare_Metric_PlayedWith),
|
||||
nameof(Compare_Metric_PowerLimit),
|
||||
nameof(Compare_Metric_Presented),
|
||||
nameof(Compare_Metric_RenderScale),
|
||||
@@ -851,6 +865,18 @@ public static class Strings
|
||||
nameof(GameDetail_AntiCheat_Header),
|
||||
nameof(GameDetail_Back),
|
||||
nameof(GameDetail_ChangeExe),
|
||||
nameof(GameDetail_Controller_Libraries_Label),
|
||||
nameof(GameDetail_Controller_Libraries_NoneSeen),
|
||||
nameof(GameDetail_Controller_Libraries_Unknown),
|
||||
nameof(GameDetail_Controller_Played_Label),
|
||||
nameof(GameDetail_Controller_Played_Many_Format),
|
||||
nameof(GameDetail_Controller_Played_One_Format),
|
||||
nameof(GameDetail_Controller_Played_Unknown),
|
||||
nameof(GameDetail_Controller_Store_Full),
|
||||
nameof(GameDetail_Controller_Store_Label),
|
||||
nameof(GameDetail_Controller_Store_None),
|
||||
nameof(GameDetail_Controller_Store_Partial),
|
||||
nameof(GameDetail_Controller_Store_Unknown),
|
||||
nameof(GameDetail_DeleteSessions),
|
||||
nameof(GameDetail_Details_Architecture),
|
||||
nameof(GameDetail_Details_Engine),
|
||||
@@ -1010,6 +1036,64 @@ public static class Strings
|
||||
nameof(Import_SelectNone),
|
||||
nameof(Import_ShowExisting_Format),
|
||||
nameof(Import_Title),
|
||||
nameof(Input_Bar_Name_Format),
|
||||
nameof(Input_Battery_Drain_Format),
|
||||
nameof(Input_Battery_Header),
|
||||
nameof(Input_Battery_Level_Empty),
|
||||
nameof(Input_Battery_Level_Full),
|
||||
nameof(Input_Battery_Level_Low),
|
||||
nameof(Input_Battery_Level_Medium),
|
||||
nameof(Input_Battery_Longest_Format),
|
||||
nameof(Input_Battery_NotRead),
|
||||
nameof(Input_Battery_Span_Format),
|
||||
nameof(Input_Battery_State_Charging),
|
||||
nameof(Input_Battery_State_Charging_Format),
|
||||
nameof(Input_Battery_State_Discharging),
|
||||
nameof(Input_Battery_State_Discharging_Format),
|
||||
nameof(Input_Battery_State_Full),
|
||||
nameof(Input_Battery_State_Unknown),
|
||||
nameof(Input_Battery_State_Wired),
|
||||
nameof(Input_Class_Both),
|
||||
nameof(Input_Class_Controller),
|
||||
nameof(Input_Class_KeyboardMouse),
|
||||
nameof(Input_Class_None),
|
||||
nameof(Input_Col_Battery),
|
||||
nameof(Input_Col_Connected),
|
||||
nameof(Input_Col_Connection),
|
||||
nameof(Input_Col_Controller),
|
||||
nameof(Input_Col_Events),
|
||||
nameof(Input_Col_InUse),
|
||||
nameof(Input_Col_Method),
|
||||
nameof(Input_Connection_Bluetooth),
|
||||
nameof(Input_Connection_Unknown),
|
||||
nameof(Input_Connection_Usb),
|
||||
nameof(Input_Connection_Wireless),
|
||||
nameof(Input_Context_Format),
|
||||
nameof(Input_Controller_Remapped_Format),
|
||||
nameof(Input_Controller_Unnamed_Format),
|
||||
nameof(Input_Controller_Virtual_Format),
|
||||
nameof(Input_Controllers_Header),
|
||||
nameof(Input_Controllers_None),
|
||||
nameof(Input_Controllers_NoneSeen),
|
||||
nameof(Input_Events_Format),
|
||||
nameof(Input_Family_Nintendo),
|
||||
nameof(Input_Family_Other),
|
||||
nameof(Input_Family_PlayStation),
|
||||
nameof(Input_Family_Xbox),
|
||||
nameof(Input_Header),
|
||||
nameof(Input_Limits_Note),
|
||||
nameof(Input_Makers_Format),
|
||||
nameof(Input_Missing_NeverInFront),
|
||||
nameof(Input_Missing_NotRecorded),
|
||||
nameof(Input_Missing_Terms),
|
||||
nameof(Input_Note_Faults_Format),
|
||||
nameof(Input_Note_NoLastInput),
|
||||
nameof(Input_Note_NoRawInput),
|
||||
nameof(Input_Note_NoXInput),
|
||||
nameof(Input_Note_VirtualPad),
|
||||
nameof(Input_Shares_Format),
|
||||
nameof(Input_Switches_Format),
|
||||
nameof(Input_Timeline_Header),
|
||||
nameof(Latency_Avg),
|
||||
nameof(Latency_Axis),
|
||||
nameof(Latency_Empty),
|
||||
@@ -1383,6 +1467,7 @@ public static class Strings
|
||||
nameof(Summary_Save),
|
||||
nameof(Summary_Saved),
|
||||
nameof(Summary_Show_Displayed),
|
||||
nameof(Summary_Show_InputEvents),
|
||||
nameof(Summary_Show_Sensors),
|
||||
nameof(Summary_Stat_Avg),
|
||||
nameof(Summary_Stat_Below30_Format),
|
||||
@@ -1488,6 +1573,7 @@ public static class Strings
|
||||
nameof(Trend_Metric_AvgGpuLoad),
|
||||
nameof(Trend_Metric_AvgGpuPower),
|
||||
nameof(Trend_Metric_AvgRam),
|
||||
nameof(Trend_Metric_ControllerShare),
|
||||
nameof(Trend_Metric_DisplayBorderless),
|
||||
nameof(Trend_Metric_Displayed),
|
||||
nameof(Trend_Metric_DisplayExclusive),
|
||||
@@ -1500,6 +1586,7 @@ public static class Strings
|
||||
nameof(Trend_Metric_GameVramMedian),
|
||||
nameof(Trend_Metric_GameVramPeak),
|
||||
nameof(Trend_Metric_GpuCoreClock),
|
||||
nameof(Trend_Metric_KeyboardMouseShare),
|
||||
nameof(Trend_Metric_Label),
|
||||
nameof(Trend_Metric_MaxCpuTemp),
|
||||
nameof(Trend_Metric_MaxGpuMemTemp),
|
||||
@@ -1586,6 +1673,10 @@ public static class Strings
|
||||
|
||||
public static string A11y_Chart_Histogram => ResourceManager.GetString(nameof(A11y_Chart_Histogram), Culture) ?? nameof(A11y_Chart_Histogram);
|
||||
|
||||
public static string A11y_Chart_InputBattery => ResourceManager.GetString(nameof(A11y_Chart_InputBattery), Culture) ?? nameof(A11y_Chart_InputBattery);
|
||||
|
||||
public static string A11y_Chart_InputTimeline => ResourceManager.GetString(nameof(A11y_Chart_InputTimeline), Culture) ?? nameof(A11y_Chart_InputTimeline);
|
||||
|
||||
public static string A11y_Chart_Keys => ResourceManager.GetString(nameof(A11y_Chart_Keys), Culture) ?? nameof(A11y_Chart_Keys);
|
||||
|
||||
public static string A11y_Chart_Latency => ResourceManager.GetString(nameof(A11y_Chart_Latency), Culture) ?? nameof(A11y_Chart_Latency);
|
||||
@@ -1606,6 +1697,8 @@ public static class Strings
|
||||
|
||||
public static string A11y_ChartData_Compare => ResourceManager.GetString(nameof(A11y_ChartData_Compare), Culture) ?? nameof(A11y_ChartData_Compare);
|
||||
|
||||
public static string A11y_ChartData_Input => ResourceManager.GetString(nameof(A11y_ChartData_Input), Culture) ?? nameof(A11y_ChartData_Input);
|
||||
|
||||
public static string A11y_ChartData_Latency => ResourceManager.GetString(nameof(A11y_ChartData_Latency), Culture) ?? nameof(A11y_ChartData_Latency);
|
||||
|
||||
public static string A11y_ChartData_Sessions => ResourceManager.GetString(nameof(A11y_ChartData_Sessions), Culture) ?? nameof(A11y_ChartData_Sessions);
|
||||
@@ -2420,6 +2513,8 @@ public static class Strings
|
||||
|
||||
public static string ChangeExe_Unreadable_Format => ResourceManager.GetString(nameof(ChangeExe_Unreadable_Format), Culture) ?? nameof(ChangeExe_Unreadable_Format);
|
||||
|
||||
public static string Chart_Axis_Battery => ResourceManager.GetString(nameof(Chart_Axis_Battery), Culture) ?? nameof(Chart_Axis_Battery);
|
||||
|
||||
public static string Chart_Axis_Count => ResourceManager.GetString(nameof(Chart_Axis_Count), Culture) ?? nameof(Chart_Axis_Count);
|
||||
|
||||
public static string Chart_Axis_Fps => ResourceManager.GetString(nameof(Chart_Axis_Fps), Culture) ?? nameof(Chart_Axis_Fps);
|
||||
@@ -2440,8 +2535,24 @@ public static class Strings
|
||||
|
||||
public static string Chart_Decimated_Format => ResourceManager.GetString(nameof(Chart_Decimated_Format), Culture) ?? nameof(Chart_Decimated_Format);
|
||||
|
||||
public static string Chart_Input_Device_Format => ResourceManager.GetString(nameof(Chart_Input_Device_Format), Culture) ?? nameof(Chart_Input_Device_Format);
|
||||
|
||||
public static string Chart_Input_Event_BatteryLow => ResourceManager.GetString(nameof(Chart_Input_Event_BatteryLow), Culture) ?? nameof(Chart_Input_Event_BatteryLow);
|
||||
|
||||
public static string Chart_Input_Event_Connected => ResourceManager.GetString(nameof(Chart_Input_Event_Connected), Culture) ?? nameof(Chart_Input_Event_Connected);
|
||||
|
||||
public static string Chart_Input_Event_Disconnected => ResourceManager.GetString(nameof(Chart_Input_Event_Disconnected), Culture) ?? nameof(Chart_Input_Event_Disconnected);
|
||||
|
||||
public static string Chart_Input_FourLevels => ResourceManager.GetString(nameof(Chart_Input_FourLevels), Culture) ?? nameof(Chart_Input_FourLevels);
|
||||
|
||||
public static string Chart_Input_NotStored => ResourceManager.GetString(nameof(Chart_Input_NotStored), Culture) ?? nameof(Chart_Input_NotStored);
|
||||
|
||||
public static string Chart_InputBattery_NotRead => ResourceManager.GetString(nameof(Chart_InputBattery_NotRead), Culture) ?? nameof(Chart_InputBattery_NotRead);
|
||||
|
||||
public static string Chart_Note_GapsClosed_Format => ResourceManager.GetString(nameof(Chart_Note_GapsClosed_Format), Culture) ?? nameof(Chart_Note_GapsClosed_Format);
|
||||
|
||||
public static string Chart_Note_GapsClosed_Marks_Format => ResourceManager.GetString(nameof(Chart_Note_GapsClosed_Marks_Format), Culture) ?? nameof(Chart_Note_GapsClosed_Marks_Format);
|
||||
|
||||
public static string Chart_Note_NoApplicationFrames => ResourceManager.GetString(nameof(Chart_Note_NoApplicationFrames), Culture) ?? nameof(Chart_Note_NoApplicationFrames);
|
||||
|
||||
public static string Chart_Note_OutsideRange_Format => ResourceManager.GetString(nameof(Chart_Note_OutsideRange_Format), Culture) ?? nameof(Chart_Note_OutsideRange_Format);
|
||||
@@ -2546,6 +2657,8 @@ public static class Strings
|
||||
|
||||
public static string Compare_Metric_AvgGpuLoad => ResourceManager.GetString(nameof(Compare_Metric_AvgGpuLoad), Culture) ?? nameof(Compare_Metric_AvgGpuLoad);
|
||||
|
||||
public static string Compare_Metric_Controllers => ResourceManager.GetString(nameof(Compare_Metric_Controllers), Culture) ?? nameof(Compare_Metric_Controllers);
|
||||
|
||||
public static string Compare_Metric_Display => ResourceManager.GetString(nameof(Compare_Metric_Display), Culture) ?? nameof(Compare_Metric_Display);
|
||||
|
||||
public static string Compare_Metric_Displayed => ResourceManager.GetString(nameof(Compare_Metric_Displayed), Culture) ?? nameof(Compare_Metric_Displayed);
|
||||
@@ -2582,6 +2695,8 @@ public static class Strings
|
||||
|
||||
public static string Compare_Metric_P1Low => ResourceManager.GetString(nameof(Compare_Metric_P1Low), Culture) ?? nameof(Compare_Metric_P1Low);
|
||||
|
||||
public static string Compare_Metric_PlayedWith => ResourceManager.GetString(nameof(Compare_Metric_PlayedWith), Culture) ?? nameof(Compare_Metric_PlayedWith);
|
||||
|
||||
public static string Compare_Metric_PowerLimit => ResourceManager.GetString(nameof(Compare_Metric_PowerLimit), Culture) ?? nameof(Compare_Metric_PowerLimit);
|
||||
|
||||
public static string Compare_Metric_Presented => ResourceManager.GetString(nameof(Compare_Metric_Presented), Culture) ?? nameof(Compare_Metric_Presented);
|
||||
@@ -3208,6 +3323,30 @@ public static class Strings
|
||||
|
||||
public static string GameDetail_ChangeExe => ResourceManager.GetString(nameof(GameDetail_ChangeExe), Culture) ?? nameof(GameDetail_ChangeExe);
|
||||
|
||||
public static string GameDetail_Controller_Libraries_Label => ResourceManager.GetString(nameof(GameDetail_Controller_Libraries_Label), Culture) ?? nameof(GameDetail_Controller_Libraries_Label);
|
||||
|
||||
public static string GameDetail_Controller_Libraries_NoneSeen => ResourceManager.GetString(nameof(GameDetail_Controller_Libraries_NoneSeen), Culture) ?? nameof(GameDetail_Controller_Libraries_NoneSeen);
|
||||
|
||||
public static string GameDetail_Controller_Libraries_Unknown => ResourceManager.GetString(nameof(GameDetail_Controller_Libraries_Unknown), Culture) ?? nameof(GameDetail_Controller_Libraries_Unknown);
|
||||
|
||||
public static string GameDetail_Controller_Played_Label => ResourceManager.GetString(nameof(GameDetail_Controller_Played_Label), Culture) ?? nameof(GameDetail_Controller_Played_Label);
|
||||
|
||||
public static string GameDetail_Controller_Played_Many_Format => ResourceManager.GetString(nameof(GameDetail_Controller_Played_Many_Format), Culture) ?? nameof(GameDetail_Controller_Played_Many_Format);
|
||||
|
||||
public static string GameDetail_Controller_Played_One_Format => ResourceManager.GetString(nameof(GameDetail_Controller_Played_One_Format), Culture) ?? nameof(GameDetail_Controller_Played_One_Format);
|
||||
|
||||
public static string GameDetail_Controller_Played_Unknown => ResourceManager.GetString(nameof(GameDetail_Controller_Played_Unknown), Culture) ?? nameof(GameDetail_Controller_Played_Unknown);
|
||||
|
||||
public static string GameDetail_Controller_Store_Full => ResourceManager.GetString(nameof(GameDetail_Controller_Store_Full), Culture) ?? nameof(GameDetail_Controller_Store_Full);
|
||||
|
||||
public static string GameDetail_Controller_Store_Label => ResourceManager.GetString(nameof(GameDetail_Controller_Store_Label), Culture) ?? nameof(GameDetail_Controller_Store_Label);
|
||||
|
||||
public static string GameDetail_Controller_Store_None => ResourceManager.GetString(nameof(GameDetail_Controller_Store_None), Culture) ?? nameof(GameDetail_Controller_Store_None);
|
||||
|
||||
public static string GameDetail_Controller_Store_Partial => ResourceManager.GetString(nameof(GameDetail_Controller_Store_Partial), Culture) ?? nameof(GameDetail_Controller_Store_Partial);
|
||||
|
||||
public static string GameDetail_Controller_Store_Unknown => ResourceManager.GetString(nameof(GameDetail_Controller_Store_Unknown), Culture) ?? nameof(GameDetail_Controller_Store_Unknown);
|
||||
|
||||
public static string GameDetail_DeleteSessions => ResourceManager.GetString(nameof(GameDetail_DeleteSessions), Culture) ?? nameof(GameDetail_DeleteSessions);
|
||||
|
||||
public static string GameDetail_Details_Architecture => ResourceManager.GetString(nameof(GameDetail_Details_Architecture), Culture) ?? nameof(GameDetail_Details_Architecture);
|
||||
@@ -3526,6 +3665,122 @@ public static class Strings
|
||||
|
||||
public static string Import_Title => ResourceManager.GetString(nameof(Import_Title), Culture) ?? nameof(Import_Title);
|
||||
|
||||
public static string Input_Bar_Name_Format => ResourceManager.GetString(nameof(Input_Bar_Name_Format), Culture) ?? nameof(Input_Bar_Name_Format);
|
||||
|
||||
public static string Input_Battery_Drain_Format => ResourceManager.GetString(nameof(Input_Battery_Drain_Format), Culture) ?? nameof(Input_Battery_Drain_Format);
|
||||
|
||||
public static string Input_Battery_Header => ResourceManager.GetString(nameof(Input_Battery_Header), Culture) ?? nameof(Input_Battery_Header);
|
||||
|
||||
public static string Input_Battery_Level_Empty => ResourceManager.GetString(nameof(Input_Battery_Level_Empty), Culture) ?? nameof(Input_Battery_Level_Empty);
|
||||
|
||||
public static string Input_Battery_Level_Full => ResourceManager.GetString(nameof(Input_Battery_Level_Full), Culture) ?? nameof(Input_Battery_Level_Full);
|
||||
|
||||
public static string Input_Battery_Level_Low => ResourceManager.GetString(nameof(Input_Battery_Level_Low), Culture) ?? nameof(Input_Battery_Level_Low);
|
||||
|
||||
public static string Input_Battery_Level_Medium => ResourceManager.GetString(nameof(Input_Battery_Level_Medium), Culture) ?? nameof(Input_Battery_Level_Medium);
|
||||
|
||||
public static string Input_Battery_Longest_Format => ResourceManager.GetString(nameof(Input_Battery_Longest_Format), Culture) ?? nameof(Input_Battery_Longest_Format);
|
||||
|
||||
public static string Input_Battery_NotRead => ResourceManager.GetString(nameof(Input_Battery_NotRead), Culture) ?? nameof(Input_Battery_NotRead);
|
||||
|
||||
public static string Input_Battery_Span_Format => ResourceManager.GetString(nameof(Input_Battery_Span_Format), Culture) ?? nameof(Input_Battery_Span_Format);
|
||||
|
||||
public static string Input_Battery_State_Charging => ResourceManager.GetString(nameof(Input_Battery_State_Charging), Culture) ?? nameof(Input_Battery_State_Charging);
|
||||
|
||||
public static string Input_Battery_State_Charging_Format => ResourceManager.GetString(nameof(Input_Battery_State_Charging_Format), Culture) ?? nameof(Input_Battery_State_Charging_Format);
|
||||
|
||||
public static string Input_Battery_State_Discharging => ResourceManager.GetString(nameof(Input_Battery_State_Discharging), Culture) ?? nameof(Input_Battery_State_Discharging);
|
||||
|
||||
public static string Input_Battery_State_Discharging_Format => ResourceManager.GetString(nameof(Input_Battery_State_Discharging_Format), Culture) ?? nameof(Input_Battery_State_Discharging_Format);
|
||||
|
||||
public static string Input_Battery_State_Full => ResourceManager.GetString(nameof(Input_Battery_State_Full), Culture) ?? nameof(Input_Battery_State_Full);
|
||||
|
||||
public static string Input_Battery_State_Unknown => ResourceManager.GetString(nameof(Input_Battery_State_Unknown), Culture) ?? nameof(Input_Battery_State_Unknown);
|
||||
|
||||
public static string Input_Battery_State_Wired => ResourceManager.GetString(nameof(Input_Battery_State_Wired), Culture) ?? nameof(Input_Battery_State_Wired);
|
||||
|
||||
public static string Input_Class_Both => ResourceManager.GetString(nameof(Input_Class_Both), Culture) ?? nameof(Input_Class_Both);
|
||||
|
||||
public static string Input_Class_Controller => ResourceManager.GetString(nameof(Input_Class_Controller), Culture) ?? nameof(Input_Class_Controller);
|
||||
|
||||
public static string Input_Class_KeyboardMouse => ResourceManager.GetString(nameof(Input_Class_KeyboardMouse), Culture) ?? nameof(Input_Class_KeyboardMouse);
|
||||
|
||||
public static string Input_Class_None => ResourceManager.GetString(nameof(Input_Class_None), Culture) ?? nameof(Input_Class_None);
|
||||
|
||||
public static string Input_Col_Battery => ResourceManager.GetString(nameof(Input_Col_Battery), Culture) ?? nameof(Input_Col_Battery);
|
||||
|
||||
public static string Input_Col_Connected => ResourceManager.GetString(nameof(Input_Col_Connected), Culture) ?? nameof(Input_Col_Connected);
|
||||
|
||||
public static string Input_Col_Connection => ResourceManager.GetString(nameof(Input_Col_Connection), Culture) ?? nameof(Input_Col_Connection);
|
||||
|
||||
public static string Input_Col_Controller => ResourceManager.GetString(nameof(Input_Col_Controller), Culture) ?? nameof(Input_Col_Controller);
|
||||
|
||||
public static string Input_Col_Events => ResourceManager.GetString(nameof(Input_Col_Events), Culture) ?? nameof(Input_Col_Events);
|
||||
|
||||
public static string Input_Col_InUse => ResourceManager.GetString(nameof(Input_Col_InUse), Culture) ?? nameof(Input_Col_InUse);
|
||||
|
||||
public static string Input_Col_Method => ResourceManager.GetString(nameof(Input_Col_Method), Culture) ?? nameof(Input_Col_Method);
|
||||
|
||||
public static string Input_Connection_Bluetooth => ResourceManager.GetString(nameof(Input_Connection_Bluetooth), Culture) ?? nameof(Input_Connection_Bluetooth);
|
||||
|
||||
public static string Input_Connection_Unknown => ResourceManager.GetString(nameof(Input_Connection_Unknown), Culture) ?? nameof(Input_Connection_Unknown);
|
||||
|
||||
public static string Input_Connection_Usb => ResourceManager.GetString(nameof(Input_Connection_Usb), Culture) ?? nameof(Input_Connection_Usb);
|
||||
|
||||
public static string Input_Connection_Wireless => ResourceManager.GetString(nameof(Input_Connection_Wireless), Culture) ?? nameof(Input_Connection_Wireless);
|
||||
|
||||
public static string Input_Context_Format => ResourceManager.GetString(nameof(Input_Context_Format), Culture) ?? nameof(Input_Context_Format);
|
||||
|
||||
public static string Input_Controller_Remapped_Format => ResourceManager.GetString(nameof(Input_Controller_Remapped_Format), Culture) ?? nameof(Input_Controller_Remapped_Format);
|
||||
|
||||
public static string Input_Controller_Unnamed_Format => ResourceManager.GetString(nameof(Input_Controller_Unnamed_Format), Culture) ?? nameof(Input_Controller_Unnamed_Format);
|
||||
|
||||
public static string Input_Controller_Virtual_Format => ResourceManager.GetString(nameof(Input_Controller_Virtual_Format), Culture) ?? nameof(Input_Controller_Virtual_Format);
|
||||
|
||||
public static string Input_Controllers_Header => ResourceManager.GetString(nameof(Input_Controllers_Header), Culture) ?? nameof(Input_Controllers_Header);
|
||||
|
||||
public static string Input_Controllers_None => ResourceManager.GetString(nameof(Input_Controllers_None), Culture) ?? nameof(Input_Controllers_None);
|
||||
|
||||
public static string Input_Controllers_NoneSeen => ResourceManager.GetString(nameof(Input_Controllers_NoneSeen), Culture) ?? nameof(Input_Controllers_NoneSeen);
|
||||
|
||||
public static string Input_Events_Format => ResourceManager.GetString(nameof(Input_Events_Format), Culture) ?? nameof(Input_Events_Format);
|
||||
|
||||
public static string Input_Family_Nintendo => ResourceManager.GetString(nameof(Input_Family_Nintendo), Culture) ?? nameof(Input_Family_Nintendo);
|
||||
|
||||
public static string Input_Family_Other => ResourceManager.GetString(nameof(Input_Family_Other), Culture) ?? nameof(Input_Family_Other);
|
||||
|
||||
public static string Input_Family_PlayStation => ResourceManager.GetString(nameof(Input_Family_PlayStation), Culture) ?? nameof(Input_Family_PlayStation);
|
||||
|
||||
public static string Input_Family_Xbox => ResourceManager.GetString(nameof(Input_Family_Xbox), Culture) ?? nameof(Input_Family_Xbox);
|
||||
|
||||
public static string Input_Header => ResourceManager.GetString(nameof(Input_Header), Culture) ?? nameof(Input_Header);
|
||||
|
||||
public static string Input_Limits_Note => ResourceManager.GetString(nameof(Input_Limits_Note), Culture) ?? nameof(Input_Limits_Note);
|
||||
|
||||
public static string Input_Makers_Format => ResourceManager.GetString(nameof(Input_Makers_Format), Culture) ?? nameof(Input_Makers_Format);
|
||||
|
||||
public static string Input_Missing_NeverInFront => ResourceManager.GetString(nameof(Input_Missing_NeverInFront), Culture) ?? nameof(Input_Missing_NeverInFront);
|
||||
|
||||
public static string Input_Missing_NotRecorded => ResourceManager.GetString(nameof(Input_Missing_NotRecorded), Culture) ?? nameof(Input_Missing_NotRecorded);
|
||||
|
||||
public static string Input_Missing_Terms => ResourceManager.GetString(nameof(Input_Missing_Terms), Culture) ?? nameof(Input_Missing_Terms);
|
||||
|
||||
public static string Input_Note_Faults_Format => ResourceManager.GetString(nameof(Input_Note_Faults_Format), Culture) ?? nameof(Input_Note_Faults_Format);
|
||||
|
||||
public static string Input_Note_NoLastInput => ResourceManager.GetString(nameof(Input_Note_NoLastInput), Culture) ?? nameof(Input_Note_NoLastInput);
|
||||
|
||||
public static string Input_Note_NoRawInput => ResourceManager.GetString(nameof(Input_Note_NoRawInput), Culture) ?? nameof(Input_Note_NoRawInput);
|
||||
|
||||
public static string Input_Note_NoXInput => ResourceManager.GetString(nameof(Input_Note_NoXInput), Culture) ?? nameof(Input_Note_NoXInput);
|
||||
|
||||
public static string Input_Note_VirtualPad => ResourceManager.GetString(nameof(Input_Note_VirtualPad), Culture) ?? nameof(Input_Note_VirtualPad);
|
||||
|
||||
public static string Input_Shares_Format => ResourceManager.GetString(nameof(Input_Shares_Format), Culture) ?? nameof(Input_Shares_Format);
|
||||
|
||||
public static string Input_Switches_Format => ResourceManager.GetString(nameof(Input_Switches_Format), Culture) ?? nameof(Input_Switches_Format);
|
||||
|
||||
public static string Input_Timeline_Header => ResourceManager.GetString(nameof(Input_Timeline_Header), Culture) ?? nameof(Input_Timeline_Header);
|
||||
|
||||
public static string Latency_Avg => ResourceManager.GetString(nameof(Latency_Avg), Culture) ?? nameof(Latency_Avg);
|
||||
|
||||
public static string Latency_Axis => ResourceManager.GetString(nameof(Latency_Axis), Culture) ?? nameof(Latency_Axis);
|
||||
@@ -4272,6 +4527,8 @@ public static class Strings
|
||||
|
||||
public static string Summary_Show_Displayed => ResourceManager.GetString(nameof(Summary_Show_Displayed), Culture) ?? nameof(Summary_Show_Displayed);
|
||||
|
||||
public static string Summary_Show_InputEvents => ResourceManager.GetString(nameof(Summary_Show_InputEvents), Culture) ?? nameof(Summary_Show_InputEvents);
|
||||
|
||||
public static string Summary_Show_Sensors => ResourceManager.GetString(nameof(Summary_Show_Sensors), Culture) ?? nameof(Summary_Show_Sensors);
|
||||
|
||||
public static string Summary_Stat_Avg => ResourceManager.GetString(nameof(Summary_Stat_Avg), Culture) ?? nameof(Summary_Stat_Avg);
|
||||
@@ -4482,6 +4739,8 @@ public static class Strings
|
||||
|
||||
public static string Trend_Metric_AvgRam => ResourceManager.GetString(nameof(Trend_Metric_AvgRam), Culture) ?? nameof(Trend_Metric_AvgRam);
|
||||
|
||||
public static string Trend_Metric_ControllerShare => ResourceManager.GetString(nameof(Trend_Metric_ControllerShare), Culture) ?? nameof(Trend_Metric_ControllerShare);
|
||||
|
||||
public static string Trend_Metric_DisplayBorderless => ResourceManager.GetString(nameof(Trend_Metric_DisplayBorderless), Culture) ?? nameof(Trend_Metric_DisplayBorderless);
|
||||
|
||||
public static string Trend_Metric_Displayed => ResourceManager.GetString(nameof(Trend_Metric_Displayed), Culture) ?? nameof(Trend_Metric_Displayed);
|
||||
@@ -4506,6 +4765,8 @@ public static class Strings
|
||||
|
||||
public static string Trend_Metric_GpuCoreClock => ResourceManager.GetString(nameof(Trend_Metric_GpuCoreClock), Culture) ?? nameof(Trend_Metric_GpuCoreClock);
|
||||
|
||||
public static string Trend_Metric_KeyboardMouseShare => ResourceManager.GetString(nameof(Trend_Metric_KeyboardMouseShare), Culture) ?? nameof(Trend_Metric_KeyboardMouseShare);
|
||||
|
||||
public static string Trend_Metric_Label => ResourceManager.GetString(nameof(Trend_Metric_Label), Culture) ?? nameof(Trend_Metric_Label);
|
||||
|
||||
public static string Trend_Metric_MaxCpuTemp => ResourceManager.GetString(nameof(Trend_Metric_MaxCpuTemp), Culture) ?? nameof(Trend_Metric_MaxCpuTemp);
|
||||
|
||||
@@ -4485,6 +4485,354 @@
|
||||
<value>NVIDIA App の上書き</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="GameDetail_Controller_Libraries_Label" xml:space="preserve">
|
||||
<value>読み込まれた入力ライブラリ</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="GameDetail_Controller_Libraries_NoneSeen" xml:space="preserve">
|
||||
<value>内部から計測した直近のセッションでは見つかりませんでした</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="GameDetail_Controller_Libraries_Unknown" xml:space="preserve">
|
||||
<value>N/A - ゲーム内部から計測したセッションでのみ分かります</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="GameDetail_Controller_Played_Label" xml:space="preserve">
|
||||
<value>ふだんのプレイ方法</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="GameDetail_Controller_Played_Many_Format" xml:space="preserve">
|
||||
<value>コントローラー {0} · キーボードとマウス {1} · 両方 {2} · 入力なし {3} - ゲームが前面にあった時間に対する割合、{4} セッション</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="GameDetail_Controller_Played_One_Format" xml:space="preserve">
|
||||
<value>コントローラー {0} · キーボードとマウス {1} · 両方 {2} · 入力なし {3} - ゲームが前面にあった時間に対する割合、{4} セッション</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="GameDetail_Controller_Played_Unknown" xml:space="preserve">
|
||||
<value>N/A - まだ記録したセッションがありません</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Header" xml:space="preserve">
|
||||
<value>プレイ方法</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Limits_Note" xml:space="preserve">
|
||||
<value>ゲームの外側で Windows から読み取ります。ゲームが前面にある間にコントローラー、またはキーボードかマウスが使われていたことだけを示し、どのボタンやキーかは決して記録せず、ゲームがそれをどう扱ったかも示しません。キーボードとマウスは一つの区分です。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Context_Format" xml:space="preserve">
|
||||
<value>読み取り時間 {0}、ゲームが前面にあった時間 {1}。割合は前面にあった時間に対するものです。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Class_Controller" xml:space="preserve">
|
||||
<value>コントローラー</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Class_KeyboardMouse" xml:space="preserve">
|
||||
<value>キーボードとマウス</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Class_Both" xml:space="preserve">
|
||||
<value>両方同時</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Class_None" xml:space="preserve">
|
||||
<value>入力なし</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Col_Method" xml:space="preserve">
|
||||
<value>入力</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Bar_Name_Format" xml:space="preserve">
|
||||
<value>前面にあった時間に占める割合(プレイ方法別): {0}</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Switches_Format" xml:space="preserve">
|
||||
<value>コントローラーとキーボード・マウスの切り替え回数: {0}</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Controllers_Header" xml:space="preserve">
|
||||
<value>コントローラー</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Controllers_NoneSeen" xml:space="preserve">
|
||||
<value>このセッション中に接続されたコントローラーはありません。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Controllers_None" xml:space="preserve">
|
||||
<value>なし</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Col_Controller" xml:space="preserve">
|
||||
<value>コントローラー</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Col_Connection" xml:space="preserve">
|
||||
<value>接続</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Col_InUse" xml:space="preserve">
|
||||
<value>使用時間</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Col_Connected" xml:space="preserve">
|
||||
<value>接続時間</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Col_Events" xml:space="preserve">
|
||||
<value>接続 / 切断</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Col_Battery" xml:space="preserve">
|
||||
<value>バッテリー</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Events_Format" xml:space="preserve">
|
||||
<value>{0} / {1}</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Controller_Unnamed_Format" xml:space="preserve">
|
||||
<value>{0} コントローラー</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Controller_Virtual_Format" xml:space="preserve">
|
||||
<value>{0}(プログラムが提示する仮想パッド)</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Controller_Remapped_Format" xml:space="preserve">
|
||||
<value>{0}(ゲームには Xbox パッドとしても提示)</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Family_Xbox" xml:space="preserve">
|
||||
<value>Xbox</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Family_PlayStation" xml:space="preserve">
|
||||
<value>PlayStation</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Family_Nintendo" xml:space="preserve">
|
||||
<value>Nintendo</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Family_Other" xml:space="preserve">
|
||||
<value>その他</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Connection_Usb" xml:space="preserve">
|
||||
<value>USB</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Connection_Bluetooth" xml:space="preserve">
|
||||
<value>Bluetooth</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Connection_Wireless" xml:space="preserve">
|
||||
<value>ワイヤレスアダプター</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Connection_Unknown" xml:space="preserve">
|
||||
<value>不明</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Battery_NotRead" xml:space="preserve">
|
||||
<value>N/A - バッテリー残量は読み取れませんでした</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Battery_Longest_Format" xml:space="preserve">
|
||||
<value>最長: {0}({1})</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Battery_Span_Format" xml:space="preserve">
|
||||
<value>{0} → {1}</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Battery_Drain_Format" xml:space="preserve">
|
||||
<value>1 時間あたり {0:0.0}%</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Battery_State_Wired" xml:space="preserve">
|
||||
<value>有線</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Battery_State_Full" xml:space="preserve">
|
||||
<value>満充電</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Battery_State_Charging" xml:space="preserve">
|
||||
<value>充電中</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Battery_State_Charging_Format" xml:space="preserve">
|
||||
<value>充電中({0})</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Battery_State_Discharging" xml:space="preserve">
|
||||
<value>バッテリー駆動</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Battery_State_Discharging_Format" xml:space="preserve">
|
||||
<value>バッテリー駆動({0})</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Battery_State_Unknown" xml:space="preserve">
|
||||
<value>状態不明</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Battery_Level_Empty" xml:space="preserve">
|
||||
<value>空</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Battery_Level_Low" xml:space="preserve">
|
||||
<value>低</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Battery_Level_Medium" xml:space="preserve">
|
||||
<value>中</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Battery_Level_Full" xml:space="preserve">
|
||||
<value>満</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Makers_Format" xml:space="preserve">
|
||||
<value>メーカー別(コントローラー使用時間に対して): {0}。メーカーの切り替え回数: {1}。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Note_VirtualPad" xml:space="preserve">
|
||||
<value>このセッションでは Steam Input または別のリマップソフトが、コントローラーを仮想 Xbox パッドとしてゲームに提示しました。コントローラーとその代わりのパッドは一つとして数えています。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Note_NoRawInput" xml:space="preserve">
|
||||
<value>このセッションでは Windows がコントローラーのレポートの登録を受け付けなかったため、Xbox 互換のコントローラーしか確認できませんでした。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Note_NoXInput" xml:space="preserve">
|
||||
<value>このセッションでは XInput を読み取れなかったため、Xbox 互換のコントローラーはレポートを通じてのみ確認され、バッテリー残量はありません。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Note_NoLastInput" xml:space="preserve">
|
||||
<value>このセッションでは Windows が最後のキーボードまたはマウス入力の時刻を報告しなかったため、キーボードとマウスの使用は確認できませんでした。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Note_Faults_Format" xml:space="preserve">
|
||||
<value>このセッションで読み取りが {0} 回失敗しました。数値は読み取れた分のみです。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Missing_Terms" xml:space="preserve">
|
||||
<value>このセッションでは読み取っていません。この読み取りを説明するプライバシーポリシーが、この PC でまだ承諾されていませんでした。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Missing_NeverInFront" xml:space="preserve">
|
||||
<value>読み取りましたが、その間ゲームのウィンドウが前面になかったため、表示できる割合がありません。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Missing_NotRecorded" xml:space="preserve">
|
||||
<value>このセッションでは記録されていません。設定 ▸ コントローラーと入力がオフだったか、0.1.0-beta.50 より前のセッションです。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Shares_Format" xml:space="preserve">
|
||||
<value>コントローラー {0} · キーボードとマウス {1} · 両方 {2} · 入力なし {3}</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Timeline_Header" xml:space="preserve">
|
||||
<value>セッション中の入力</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Input_Battery_Header" xml:space="preserve">
|
||||
<value>コントローラーのバッテリー</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Summary_Show_InputEvents" xml:space="preserve">
|
||||
<value>コントローラーのマーク</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Chart_Axis_Battery" xml:space="preserve">
|
||||
<value>バッテリー (%)</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Chart_Input_Event_Connected" xml:space="preserve">
|
||||
<value>コントローラー接続</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Chart_Input_Event_Disconnected" xml:space="preserve">
|
||||
<value>コントローラー切断</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Chart_Input_Event_BatteryLow" xml:space="preserve">
|
||||
<value>コントローラーのバッテリー低下</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Chart_Input_Device_Format" xml:space="preserve">
|
||||
<value>コントローラー {0}</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Chart_Input_FourLevels" xml:space="preserve">
|
||||
<value>(4 段階)</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Chart_Input_NotStored" xml:space="preserve">
|
||||
<value>このセッションには入力の系列が保存されていません。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Chart_InputBattery_NotRead" xml:space="preserve">
|
||||
<value>このセッションでバッテリー残量を報告したコントローラーはありません。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Chart_Note_GapsClosed_Marks_Format" xml:space="preserve">
|
||||
<value>時間軸は {0} 個の空白(一時停止、または失われた記録)を詰めているため、それ以降はコントローラーのマークがフレームより先に進みます。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="A11y_Chart_InputTimeline" xml:space="preserve">
|
||||
<value>セッション中の入力のグラフ</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="A11y_Chart_InputBattery" xml:space="preserve">
|
||||
<value>コントローラーのバッテリーのグラフ</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="A11y_ChartData_Input" xml:space="preserve">
|
||||
<value>これらの数値は「プレイ方法」の表に記載されています。セッションの CSV と JSON のエクスポートに合計が含まれます。</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Trend_Metric_ControllerShare" xml:space="preserve">
|
||||
<value>コントローラーの割合</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Trend_Metric_KeyboardMouseShare" xml:space="preserve">
|
||||
<value>キーボードとマウスの割合</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Compare_Metric_PlayedWith" xml:space="preserve">
|
||||
<value>プレイ方法</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="Compare_Metric_Controllers" xml:space="preserve">
|
||||
<value>コントローラー</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="GameDetail_Controller_Store_Full" xml:space="preserve">
|
||||
<value>フル対応 - Steam の記載</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="GameDetail_Controller_Store_Label" xml:space="preserve">
|
||||
<value>コントローラー対応 (ストア)</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="GameDetail_Controller_Store_None" xml:space="preserve">
|
||||
<value>Steam に対応の記載なし</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="GameDetail_Controller_Store_Partial" xml:space="preserve">
|
||||
<value>一部対応 - Steam の記載</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="GameDetail_Controller_Store_Unknown" xml:space="preserve">
|
||||
<value>N/A - この PC にはこのゲームを記載したストアのファイルがありません</value>
|
||||
<comment>review</comment>
|
||||
</data>
|
||||
<data name="End_Running" xml:space="preserve">
|
||||
<value>キャプチャは時間指定で、ゲームの実行中に終了しました。</value>
|
||||
<comment>review</comment>
|
||||
|
||||
@@ -3374,6 +3374,267 @@ The documents below are the full terms; this summary does not replace them.</val
|
||||
<data name="GameDetail_Details_NvidiaOverride" xml:space="preserve">
|
||||
<value>NVIDIA App override</value>
|
||||
</data>
|
||||
<data name="GameDetail_Controller_Libraries_Label" xml:space="preserve">
|
||||
<value>Input libraries loaded</value>
|
||||
</data>
|
||||
<data name="GameDetail_Controller_Libraries_NoneSeen" xml:space="preserve">
|
||||
<value>None seen in the last session measured from inside</value>
|
||||
</data>
|
||||
<data name="GameDetail_Controller_Libraries_Unknown" xml:space="preserve">
|
||||
<value>N/A - known only from a session measured from inside the game</value>
|
||||
</data>
|
||||
<data name="GameDetail_Controller_Played_Label" xml:space="preserve">
|
||||
<value>Usually played with</value>
|
||||
</data>
|
||||
<data name="GameDetail_Controller_Played_Many_Format" xml:space="preserve">
|
||||
<value>Controller {0} · keyboard and mouse {1} · both {2} · no input {3} - of the time in front, over {4} sessions</value>
|
||||
</data>
|
||||
<data name="GameDetail_Controller_Played_One_Format" xml:space="preserve">
|
||||
<value>Controller {0} · keyboard and mouse {1} · both {2} · no input {3} - of the time in front, over {4} session</value>
|
||||
</data>
|
||||
<data name="GameDetail_Controller_Played_Unknown" xml:space="preserve">
|
||||
<value>N/A - no session has recorded it yet</value>
|
||||
</data>
|
||||
<data name="Input_Header" xml:space="preserve">
|
||||
<value>Played with</value>
|
||||
</data>
|
||||
<data name="Input_Limits_Note" xml:space="preserve">
|
||||
<value>Read from Windows, outside the game: it says a controller, or the keyboard or mouse, was in use while the game was in front - never which button or key, and not what the game did with it. Keyboard and mouse are one class.</value>
|
||||
</data>
|
||||
<data name="Input_Context_Format" xml:space="preserve">
|
||||
<value>Read for {0}; the game was in front for {1}. The shares are of the time in front.</value>
|
||||
</data>
|
||||
<data name="Input_Class_Controller" xml:space="preserve">
|
||||
<value>Controller</value>
|
||||
</data>
|
||||
<data name="Input_Class_KeyboardMouse" xml:space="preserve">
|
||||
<value>Keyboard and mouse</value>
|
||||
</data>
|
||||
<data name="Input_Class_Both" xml:space="preserve">
|
||||
<value>Both at once</value>
|
||||
</data>
|
||||
<data name="Input_Class_None" xml:space="preserve">
|
||||
<value>No input</value>
|
||||
</data>
|
||||
<data name="Input_Col_Method" xml:space="preserve">
|
||||
<value>Input</value>
|
||||
</data>
|
||||
<data name="Input_Bar_Name_Format" xml:space="preserve">
|
||||
<value>Share of the time in front by what the game was played with: {0}</value>
|
||||
</data>
|
||||
<data name="Input_Switches_Format" xml:space="preserve">
|
||||
<value>Changes between a controller and the keyboard and mouse: {0}</value>
|
||||
</data>
|
||||
<data name="Input_Controllers_Header" xml:space="preserve">
|
||||
<value>Controllers</value>
|
||||
</data>
|
||||
<data name="Input_Controllers_NoneSeen" xml:space="preserve">
|
||||
<value>No controller was connected during this session.</value>
|
||||
</data>
|
||||
<data name="Input_Controllers_None" xml:space="preserve">
|
||||
<value>none</value>
|
||||
</data>
|
||||
<data name="Input_Col_Controller" xml:space="preserve">
|
||||
<value>Controller</value>
|
||||
</data>
|
||||
<data name="Input_Col_Connection" xml:space="preserve">
|
||||
<value>Connection</value>
|
||||
</data>
|
||||
<data name="Input_Col_InUse" xml:space="preserve">
|
||||
<value>In use</value>
|
||||
</data>
|
||||
<data name="Input_Col_Connected" xml:space="preserve">
|
||||
<value>Connected</value>
|
||||
</data>
|
||||
<data name="Input_Col_Events" xml:space="preserve">
|
||||
<value>Connected / dropped</value>
|
||||
</data>
|
||||
<data name="Input_Col_Battery" xml:space="preserve">
|
||||
<value>Battery</value>
|
||||
</data>
|
||||
<data name="Input_Events_Format" xml:space="preserve">
|
||||
<value>{0} / {1}</value>
|
||||
</data>
|
||||
<data name="Input_Controller_Unnamed_Format" xml:space="preserve">
|
||||
<value>{0} controller</value>
|
||||
</data>
|
||||
<data name="Input_Controller_Virtual_Format" xml:space="preserve">
|
||||
<value>{0} (a virtual pad a program presents)</value>
|
||||
</data>
|
||||
<data name="Input_Controller_Remapped_Format" xml:space="preserve">
|
||||
<value>{0} (also shown to games as an Xbox pad)</value>
|
||||
</data>
|
||||
<data name="Input_Family_Xbox" xml:space="preserve">
|
||||
<value>Xbox</value>
|
||||
</data>
|
||||
<data name="Input_Family_PlayStation" xml:space="preserve">
|
||||
<value>PlayStation</value>
|
||||
</data>
|
||||
<data name="Input_Family_Nintendo" xml:space="preserve">
|
||||
<value>Nintendo</value>
|
||||
</data>
|
||||
<data name="Input_Family_Other" xml:space="preserve">
|
||||
<value>Other</value>
|
||||
</data>
|
||||
<data name="Input_Connection_Usb" xml:space="preserve">
|
||||
<value>USB</value>
|
||||
</data>
|
||||
<data name="Input_Connection_Bluetooth" xml:space="preserve">
|
||||
<value>Bluetooth</value>
|
||||
</data>
|
||||
<data name="Input_Connection_Wireless" xml:space="preserve">
|
||||
<value>Wireless adapter</value>
|
||||
</data>
|
||||
<data name="Input_Connection_Unknown" xml:space="preserve">
|
||||
<value>Unknown</value>
|
||||
</data>
|
||||
<data name="Input_Battery_NotRead" xml:space="preserve">
|
||||
<value>N/A - no battery level was read</value>
|
||||
</data>
|
||||
<data name="Input_Battery_Longest_Format" xml:space="preserve">
|
||||
<value>Longest: {0} for {1}</value>
|
||||
</data>
|
||||
<data name="Input_Battery_Span_Format" xml:space="preserve">
|
||||
<value>{0} → {1}</value>
|
||||
</data>
|
||||
<data name="Input_Battery_Drain_Format" xml:space="preserve">
|
||||
<value>{0:0.0}% an hour</value>
|
||||
</data>
|
||||
<data name="Input_Battery_State_Wired" xml:space="preserve">
|
||||
<value>wired</value>
|
||||
</data>
|
||||
<data name="Input_Battery_State_Full" xml:space="preserve">
|
||||
<value>full</value>
|
||||
</data>
|
||||
<data name="Input_Battery_State_Charging" xml:space="preserve">
|
||||
<value>charging</value>
|
||||
</data>
|
||||
<data name="Input_Battery_State_Charging_Format" xml:space="preserve">
|
||||
<value>charging at {0}</value>
|
||||
</data>
|
||||
<data name="Input_Battery_State_Discharging" xml:space="preserve">
|
||||
<value>on battery</value>
|
||||
</data>
|
||||
<data name="Input_Battery_State_Discharging_Format" xml:space="preserve">
|
||||
<value>on battery at {0}</value>
|
||||
</data>
|
||||
<data name="Input_Battery_State_Unknown" xml:space="preserve">
|
||||
<value>state unknown</value>
|
||||
</data>
|
||||
<data name="Input_Battery_Level_Empty" xml:space="preserve">
|
||||
<value>empty</value>
|
||||
</data>
|
||||
<data name="Input_Battery_Level_Low" xml:space="preserve">
|
||||
<value>low</value>
|
||||
</data>
|
||||
<data name="Input_Battery_Level_Medium" xml:space="preserve">
|
||||
<value>medium</value>
|
||||
</data>
|
||||
<data name="Input_Battery_Level_Full" xml:space="preserve">
|
||||
<value>full</value>
|
||||
</data>
|
||||
<data name="Input_Makers_Format" xml:space="preserve">
|
||||
<value>By maker, of the time controllers were in use: {0}. Changes of maker: {1}.</value>
|
||||
</data>
|
||||
<data name="Input_Note_VirtualPad" xml:space="preserve">
|
||||
<value>Steam Input, or another remapper, presented a controller to games as a virtual Xbox pad in this session; a controller and the pad that stood for it are counted once.</value>
|
||||
</data>
|
||||
<data name="Input_Note_NoRawInput" xml:space="preserve">
|
||||
<value>Windows did not accept the registration for controller reports in this session, so only Xbox-compatible controllers were seen.</value>
|
||||
</data>
|
||||
<data name="Input_Note_NoXInput" xml:space="preserve">
|
||||
<value>XInput could not be read in this session, so Xbox-compatible controllers were seen only through their reports and have no battery level.</value>
|
||||
</data>
|
||||
<data name="Input_Note_NoLastInput" xml:space="preserve">
|
||||
<value>Windows did not report the time of the last keyboard or mouse input in this session, so keyboard and mouse use was not seen.</value>
|
||||
</data>
|
||||
<data name="Input_Note_Faults_Format" xml:space="preserve">
|
||||
<value>The reader faulted {0} time(s) in this session; the figures cover what it read.</value>
|
||||
</data>
|
||||
<data name="Input_Missing_Terms" xml:space="preserve">
|
||||
<value>Not read in this session: the Privacy Policy that describes this reading had not been accepted on this PC yet.</value>
|
||||
</data>
|
||||
<data name="Input_Missing_NeverInFront" xml:space="preserve">
|
||||
<value>Read, but the game's window was never in front while it was, so there is no share to show.</value>
|
||||
</data>
|
||||
<data name="Input_Missing_NotRecorded" xml:space="preserve">
|
||||
<value>Not recorded for this session: Settings ▸ Controllers and input was off, or the session is from before 0.1.0-beta.50.</value>
|
||||
</data>
|
||||
<data name="Input_Shares_Format" xml:space="preserve">
|
||||
<value>Controller {0} · keyboard and mouse {1} · both {2} · no input {3}</value>
|
||||
</data>
|
||||
<data name="Input_Timeline_Header" xml:space="preserve">
|
||||
<value>Input over the session</value>
|
||||
</data>
|
||||
<data name="Input_Battery_Header" xml:space="preserve">
|
||||
<value>Controller battery</value>
|
||||
</data>
|
||||
<data name="Summary_Show_InputEvents" xml:space="preserve">
|
||||
<value>Controller marks</value>
|
||||
</data>
|
||||
<data name="Chart_Axis_Battery" xml:space="preserve">
|
||||
<value>Battery (%)</value>
|
||||
</data>
|
||||
<data name="Chart_Input_Event_Connected" xml:space="preserve">
|
||||
<value>Controller connected</value>
|
||||
</data>
|
||||
<data name="Chart_Input_Event_Disconnected" xml:space="preserve">
|
||||
<value>Controller disconnected</value>
|
||||
</data>
|
||||
<data name="Chart_Input_Event_BatteryLow" xml:space="preserve">
|
||||
<value>Controller battery low</value>
|
||||
</data>
|
||||
<data name="Chart_Input_Device_Format" xml:space="preserve">
|
||||
<value>Controller {0}</value>
|
||||
</data>
|
||||
<data name="Chart_Input_FourLevels" xml:space="preserve">
|
||||
<value>(four levels)</value>
|
||||
</data>
|
||||
<data name="Chart_Input_NotStored" xml:space="preserve">
|
||||
<value>This session stored no input series.</value>
|
||||
</data>
|
||||
<data name="Chart_InputBattery_NotRead" xml:space="preserve">
|
||||
<value>No controller reported a battery level in this session.</value>
|
||||
</data>
|
||||
<data name="Chart_Note_GapsClosed_Marks_Format" xml:space="preserve">
|
||||
<value>The time axis closes up {0} gap(s) — a pause, or records that were lost — so the controller marks run ahead of the frames after each.</value>
|
||||
</data>
|
||||
<data name="A11y_Chart_InputTimeline" xml:space="preserve">
|
||||
<value>Input over the session chart</value>
|
||||
</data>
|
||||
<data name="A11y_Chart_InputBattery" xml:space="preserve">
|
||||
<value>Controller battery chart</value>
|
||||
</data>
|
||||
<data name="A11y_ChartData_Input" xml:space="preserve">
|
||||
<value>The Played with tables write these numbers out; the session's CSV and JSON exports carry the totals.</value>
|
||||
</data>
|
||||
<data name="Trend_Metric_ControllerShare" xml:space="preserve">
|
||||
<value>Controller share</value>
|
||||
</data>
|
||||
<data name="Trend_Metric_KeyboardMouseShare" xml:space="preserve">
|
||||
<value>Keyboard and mouse share</value>
|
||||
</data>
|
||||
<data name="Compare_Metric_PlayedWith" xml:space="preserve">
|
||||
<value>Played with</value>
|
||||
</data>
|
||||
<data name="Compare_Metric_Controllers" xml:space="preserve">
|
||||
<value>Controllers</value>
|
||||
</data>
|
||||
<data name="GameDetail_Controller_Store_Full" xml:space="preserve">
|
||||
<value>Full - as Steam lists it</value>
|
||||
</data>
|
||||
<data name="GameDetail_Controller_Store_Label" xml:space="preserve">
|
||||
<value>Controller support (store)</value>
|
||||
</data>
|
||||
<data name="GameDetail_Controller_Store_None" xml:space="preserve">
|
||||
<value>Steam lists none</value>
|
||||
</data>
|
||||
<data name="GameDetail_Controller_Store_Partial" xml:space="preserve">
|
||||
<value>Partial - as Steam lists it</value>
|
||||
</data>
|
||||
<data name="GameDetail_Controller_Store_Unknown" xml:space="preserve">
|
||||
<value>N/A - no store file on this PC describes this game</value>
|
||||
</data>
|
||||
<data name="End_Running" xml:space="preserve">
|
||||
<value>The capture was bounded and ended while the game still ran.</value>
|
||||
</data>
|
||||
|
||||
@@ -3369,6 +3369,267 @@ Các văn bản bên dưới là điều khoản đầy đủ; bản tóm tắt
|
||||
<data name="GameDetail_Details_NvidiaOverride" xml:space="preserve">
|
||||
<value>Ghi đè của NVIDIA App</value>
|
||||
</data>
|
||||
<data name="GameDetail_Controller_Libraries_Label" xml:space="preserve">
|
||||
<value>Thư viện nhập đã nạp</value>
|
||||
</data>
|
||||
<data name="GameDetail_Controller_Libraries_NoneSeen" xml:space="preserve">
|
||||
<value>Không thấy thư viện nào trong phiên gần nhất được đo từ bên trong</value>
|
||||
</data>
|
||||
<data name="GameDetail_Controller_Libraries_Unknown" xml:space="preserve">
|
||||
<value>N/A - chỉ biết được từ một phiên được đo từ bên trong game</value>
|
||||
</data>
|
||||
<data name="GameDetail_Controller_Played_Label" xml:space="preserve">
|
||||
<value>Thường chơi bằng</value>
|
||||
</data>
|
||||
<data name="GameDetail_Controller_Played_Many_Format" xml:space="preserve">
|
||||
<value>Tay cầm {0} · bàn phím và chuột {1} · cả hai {2} · không thao tác {3} - trên thời gian game ở phía trước, qua {4} phiên</value>
|
||||
</data>
|
||||
<data name="GameDetail_Controller_Played_One_Format" xml:space="preserve">
|
||||
<value>Tay cầm {0} · bàn phím và chuột {1} · cả hai {2} · không thao tác {3} - trên thời gian game ở phía trước, qua {4} phiên</value>
|
||||
</data>
|
||||
<data name="GameDetail_Controller_Played_Unknown" xml:space="preserve">
|
||||
<value>N/A - chưa có phiên nào ghi lại</value>
|
||||
</data>
|
||||
<data name="Input_Header" xml:space="preserve">
|
||||
<value>Chơi bằng</value>
|
||||
</data>
|
||||
<data name="Input_Limits_Note" xml:space="preserve">
|
||||
<value>Đọc từ Windows, bên ngoài game: chỉ cho biết tay cầm, hoặc bàn phím hay chuột, đang được dùng khi game ở phía trước - không bao giờ là nút hay phím nào, và không phải game đã làm gì với nó. Bàn phím và chuột là một loại.</value>
|
||||
</data>
|
||||
<data name="Input_Context_Format" xml:space="preserve">
|
||||
<value>Đã đọc trong {0}; game ở phía trước trong {1}. Tỉ lệ tính trên thời gian game ở phía trước.</value>
|
||||
</data>
|
||||
<data name="Input_Class_Controller" xml:space="preserve">
|
||||
<value>Tay cầm</value>
|
||||
</data>
|
||||
<data name="Input_Class_KeyboardMouse" xml:space="preserve">
|
||||
<value>Bàn phím và chuột</value>
|
||||
</data>
|
||||
<data name="Input_Class_Both" xml:space="preserve">
|
||||
<value>Cả hai cùng lúc</value>
|
||||
</data>
|
||||
<data name="Input_Class_None" xml:space="preserve">
|
||||
<value>Không thao tác</value>
|
||||
</data>
|
||||
<data name="Input_Col_Method" xml:space="preserve">
|
||||
<value>Thiết bị nhập</value>
|
||||
</data>
|
||||
<data name="Input_Bar_Name_Format" xml:space="preserve">
|
||||
<value>Tỉ lệ thời gian game ở phía trước theo thiết bị dùng để chơi: {0}</value>
|
||||
</data>
|
||||
<data name="Input_Switches_Format" xml:space="preserve">
|
||||
<value>Số lần đổi giữa tay cầm và bàn phím-chuột: {0}</value>
|
||||
</data>
|
||||
<data name="Input_Controllers_Header" xml:space="preserve">
|
||||
<value>Tay cầm</value>
|
||||
</data>
|
||||
<data name="Input_Controllers_NoneSeen" xml:space="preserve">
|
||||
<value>Không có tay cầm nào được kết nối trong phiên này.</value>
|
||||
</data>
|
||||
<data name="Input_Controllers_None" xml:space="preserve">
|
||||
<value>không có</value>
|
||||
</data>
|
||||
<data name="Input_Col_Controller" xml:space="preserve">
|
||||
<value>Tay cầm</value>
|
||||
</data>
|
||||
<data name="Input_Col_Connection" xml:space="preserve">
|
||||
<value>Kết nối</value>
|
||||
</data>
|
||||
<data name="Input_Col_InUse" xml:space="preserve">
|
||||
<value>Đang dùng</value>
|
||||
</data>
|
||||
<data name="Input_Col_Connected" xml:space="preserve">
|
||||
<value>Đã kết nối</value>
|
||||
</data>
|
||||
<data name="Input_Col_Events" xml:space="preserve">
|
||||
<value>Kết nối / ngắt</value>
|
||||
</data>
|
||||
<data name="Input_Col_Battery" xml:space="preserve">
|
||||
<value>Pin</value>
|
||||
</data>
|
||||
<data name="Input_Events_Format" xml:space="preserve">
|
||||
<value>{0} / {1}</value>
|
||||
</data>
|
||||
<data name="Input_Controller_Unnamed_Format" xml:space="preserve">
|
||||
<value>Tay cầm {0}</value>
|
||||
</data>
|
||||
<data name="Input_Controller_Virtual_Format" xml:space="preserve">
|
||||
<value>{0} (tay cầm ảo do một chương trình tạo ra)</value>
|
||||
</data>
|
||||
<data name="Input_Controller_Remapped_Format" xml:space="preserve">
|
||||
<value>{0} (cũng được trình cho game như một tay cầm Xbox)</value>
|
||||
</data>
|
||||
<data name="Input_Family_Xbox" xml:space="preserve">
|
||||
<value>Xbox</value>
|
||||
</data>
|
||||
<data name="Input_Family_PlayStation" xml:space="preserve">
|
||||
<value>PlayStation</value>
|
||||
</data>
|
||||
<data name="Input_Family_Nintendo" xml:space="preserve">
|
||||
<value>Nintendo</value>
|
||||
</data>
|
||||
<data name="Input_Family_Other" xml:space="preserve">
|
||||
<value>Khác</value>
|
||||
</data>
|
||||
<data name="Input_Connection_Usb" xml:space="preserve">
|
||||
<value>USB</value>
|
||||
</data>
|
||||
<data name="Input_Connection_Bluetooth" xml:space="preserve">
|
||||
<value>Bluetooth</value>
|
||||
</data>
|
||||
<data name="Input_Connection_Wireless" xml:space="preserve">
|
||||
<value>Bộ thu không dây</value>
|
||||
</data>
|
||||
<data name="Input_Connection_Unknown" xml:space="preserve">
|
||||
<value>Không rõ</value>
|
||||
</data>
|
||||
<data name="Input_Battery_NotRead" xml:space="preserve">
|
||||
<value>N/A - không đọc được mức pin</value>
|
||||
</data>
|
||||
<data name="Input_Battery_Longest_Format" xml:space="preserve">
|
||||
<value>Lâu nhất: {0} trong {1}</value>
|
||||
</data>
|
||||
<data name="Input_Battery_Span_Format" xml:space="preserve">
|
||||
<value>{0} → {1}</value>
|
||||
</data>
|
||||
<data name="Input_Battery_Drain_Format" xml:space="preserve">
|
||||
<value>{0:0.0}% mỗi giờ</value>
|
||||
</data>
|
||||
<data name="Input_Battery_State_Wired" xml:space="preserve">
|
||||
<value>có dây</value>
|
||||
</data>
|
||||
<data name="Input_Battery_State_Full" xml:space="preserve">
|
||||
<value>đầy</value>
|
||||
</data>
|
||||
<data name="Input_Battery_State_Charging" xml:space="preserve">
|
||||
<value>đang sạc</value>
|
||||
</data>
|
||||
<data name="Input_Battery_State_Charging_Format" xml:space="preserve">
|
||||
<value>đang sạc ở mức {0}</value>
|
||||
</data>
|
||||
<data name="Input_Battery_State_Discharging" xml:space="preserve">
|
||||
<value>dùng pin</value>
|
||||
</data>
|
||||
<data name="Input_Battery_State_Discharging_Format" xml:space="preserve">
|
||||
<value>dùng pin ở mức {0}</value>
|
||||
</data>
|
||||
<data name="Input_Battery_State_Unknown" xml:space="preserve">
|
||||
<value>không rõ trạng thái</value>
|
||||
</data>
|
||||
<data name="Input_Battery_Level_Empty" xml:space="preserve">
|
||||
<value>cạn</value>
|
||||
</data>
|
||||
<data name="Input_Battery_Level_Low" xml:space="preserve">
|
||||
<value>thấp</value>
|
||||
</data>
|
||||
<data name="Input_Battery_Level_Medium" xml:space="preserve">
|
||||
<value>vừa</value>
|
||||
</data>
|
||||
<data name="Input_Battery_Level_Full" xml:space="preserve">
|
||||
<value>đầy</value>
|
||||
</data>
|
||||
<data name="Input_Makers_Format" xml:space="preserve">
|
||||
<value>Theo hãng, trên thời gian tay cầm được dùng: {0}. Số lần đổi hãng: {1}.</value>
|
||||
</data>
|
||||
<data name="Input_Note_VirtualPad" xml:space="preserve">
|
||||
<value>Trong phiên này Steam Input, hoặc một phần mềm ánh xạ khác, đã trình một tay cầm cho game dưới dạng tay cầm Xbox ảo; tay cầm thật và tay cầm ảo thay cho nó chỉ được tính một lần.</value>
|
||||
</data>
|
||||
<data name="Input_Note_NoRawInput" xml:space="preserve">
|
||||
<value>Windows không chấp nhận việc đăng ký nhận báo cáo của tay cầm trong phiên này, nên chỉ thấy được các tay cầm tương thích Xbox.</value>
|
||||
</data>
|
||||
<data name="Input_Note_NoXInput" xml:space="preserve">
|
||||
<value>Không đọc được XInput trong phiên này, nên tay cầm tương thích Xbox chỉ được thấy qua báo cáo của chúng và không có mức pin.</value>
|
||||
</data>
|
||||
<data name="Input_Note_NoLastInput" xml:space="preserve">
|
||||
<value>Windows không báo thời điểm thao tác bàn phím hay chuột gần nhất trong phiên này, nên không thấy được việc dùng bàn phím và chuột.</value>
|
||||
</data>
|
||||
<data name="Input_Note_Faults_Format" xml:space="preserve">
|
||||
<value>Bộ đọc gặp lỗi {0} lần trong phiên này; các con số chỉ gồm những gì nó đọc được.</value>
|
||||
</data>
|
||||
<data name="Input_Missing_Terms" xml:space="preserve">
|
||||
<value>Không đọc trong phiên này: Chính sách quyền riêng tư mô tả việc đọc này chưa được chấp nhận trên máy này.</value>
|
||||
</data>
|
||||
<data name="Input_Missing_NeverInFront" xml:space="preserve">
|
||||
<value>Đã đọc, nhưng cửa sổ game chưa lần nào ở phía trước trong lúc đó, nên không có tỉ lệ để hiển thị.</value>
|
||||
</data>
|
||||
<data name="Input_Missing_NotRecorded" xml:space="preserve">
|
||||
<value>Không được ghi cho phiên này: mục Cài đặt ▸ Tay cầm và thiết bị nhập đang tắt, hoặc phiên có từ trước bản 0.1.0-beta.50.</value>
|
||||
</data>
|
||||
<data name="Input_Shares_Format" xml:space="preserve">
|
||||
<value>Tay cầm {0} · bàn phím và chuột {1} · cả hai {2} · không thao tác {3}</value>
|
||||
</data>
|
||||
<data name="Input_Timeline_Header" xml:space="preserve">
|
||||
<value>Thiết bị nhập theo thời gian</value>
|
||||
</data>
|
||||
<data name="Input_Battery_Header" xml:space="preserve">
|
||||
<value>Pin tay cầm</value>
|
||||
</data>
|
||||
<data name="Summary_Show_InputEvents" xml:space="preserve">
|
||||
<value>Mốc tay cầm</value>
|
||||
</data>
|
||||
<data name="Chart_Axis_Battery" xml:space="preserve">
|
||||
<value>Pin (%)</value>
|
||||
</data>
|
||||
<data name="Chart_Input_Event_Connected" xml:space="preserve">
|
||||
<value>Tay cầm kết nối</value>
|
||||
</data>
|
||||
<data name="Chart_Input_Event_Disconnected" xml:space="preserve">
|
||||
<value>Tay cầm ngắt kết nối</value>
|
||||
</data>
|
||||
<data name="Chart_Input_Event_BatteryLow" xml:space="preserve">
|
||||
<value>Pin tay cầm thấp</value>
|
||||
</data>
|
||||
<data name="Chart_Input_Device_Format" xml:space="preserve">
|
||||
<value>Tay cầm {0}</value>
|
||||
</data>
|
||||
<data name="Chart_Input_FourLevels" xml:space="preserve">
|
||||
<value>(bốn mức)</value>
|
||||
</data>
|
||||
<data name="Chart_Input_NotStored" xml:space="preserve">
|
||||
<value>Phiên này không lưu chuỗi dữ liệu thiết bị nhập nào.</value>
|
||||
</data>
|
||||
<data name="Chart_InputBattery_NotRead" xml:space="preserve">
|
||||
<value>Không tay cầm nào báo mức pin trong phiên này.</value>
|
||||
</data>
|
||||
<data name="Chart_Note_GapsClosed_Marks_Format" xml:space="preserve">
|
||||
<value>Trục thời gian khép lại {0} khoảng trống — một lần tạm dừng, hoặc bản ghi bị mất — nên các mốc tay cầm chạy trước các khung hình sau mỗi khoảng.</value>
|
||||
</data>
|
||||
<data name="A11y_Chart_InputTimeline" xml:space="preserve">
|
||||
<value>Biểu đồ thiết bị nhập theo thời gian</value>
|
||||
</data>
|
||||
<data name="A11y_Chart_InputBattery" xml:space="preserve">
|
||||
<value>Biểu đồ pin tay cầm</value>
|
||||
</data>
|
||||
<data name="A11y_ChartData_Input" xml:space="preserve">
|
||||
<value>Các bảng trong mục Chơi bằng ghi rõ những con số này; file xuất CSV và JSON của phiên chứa các tổng.</value>
|
||||
</data>
|
||||
<data name="Trend_Metric_ControllerShare" xml:space="preserve">
|
||||
<value>Tỉ lệ dùng tay cầm</value>
|
||||
</data>
|
||||
<data name="Trend_Metric_KeyboardMouseShare" xml:space="preserve">
|
||||
<value>Tỉ lệ dùng bàn phím và chuột</value>
|
||||
</data>
|
||||
<data name="Compare_Metric_PlayedWith" xml:space="preserve">
|
||||
<value>Chơi bằng</value>
|
||||
</data>
|
||||
<data name="Compare_Metric_Controllers" xml:space="preserve">
|
||||
<value>Tay cầm</value>
|
||||
</data>
|
||||
<data name="GameDetail_Controller_Store_Full" xml:space="preserve">
|
||||
<value>Đầy đủ - theo Steam ghi</value>
|
||||
</data>
|
||||
<data name="GameDetail_Controller_Store_Label" xml:space="preserve">
|
||||
<value>Hỗ trợ tay cầm (cửa hàng)</value>
|
||||
</data>
|
||||
<data name="GameDetail_Controller_Store_None" xml:space="preserve">
|
||||
<value>Steam không ghi hỗ trợ</value>
|
||||
</data>
|
||||
<data name="GameDetail_Controller_Store_Partial" xml:space="preserve">
|
||||
<value>Một phần - theo Steam ghi</value>
|
||||
</data>
|
||||
<data name="GameDetail_Controller_Store_Unknown" xml:space="preserve">
|
||||
<value>N/A - không có file cửa hàng nào trên máy này mô tả game này</value>
|
||||
</data>
|
||||
<data name="End_Running" xml:space="preserve">
|
||||
<value>Phiên ghi có giới hạn thời gian và đã kết thúc khi game vẫn đang chạy.</value>
|
||||
</data>
|
||||
|
||||
@@ -297,6 +297,10 @@ public sealed partial class CompareViewModel : ObservableObject
|
||||
Rows.Add(new CompareRowViewModel(Strings.Compare_Metric_Display, [.. rows.Select(static r => new CompareCell(DisplayText.Shares(DisplayText.Of(r)), false))]));
|
||||
Rows.Add(new CompareRowViewModel(Strings.Compare_Metric_Window, [.. rows.Select(static r => new CompareCell(DisplayText.Window(DisplayText.Of(r)), false))]));
|
||||
Rows.Add(new CompareRowViewModel(Strings.Compare_Metric_Monitor, [.. rows.Select(static r => new CompareCell(DisplayText.Monitor(DisplayText.Of(r)), false))]));
|
||||
|
||||
// 0.1.0-beta.50: what each session was played with, both tiers. Facts again: no way of playing is the better one.
|
||||
Rows.Add(new CompareRowViewModel(Strings.Compare_Metric_PlayedWith, [.. rows.Select(static r => new CompareCell(InputPresentation.SharesText(r), false))]));
|
||||
Rows.Add(new CompareRowViewModel(Strings.Compare_Metric_Controllers, [.. rows.Select(static r => new CompareCell(InputPresentation.ControllersText(r), false))]));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -437,6 +437,8 @@ public sealed partial class GameDetailViewModel : ObservableObject
|
||||
new(TrendMetric.DisplayExclusiveShare, Strings.Trend_Metric_DisplayExclusive),
|
||||
new(TrendMetric.DisplayBorderlessShare, Strings.Trend_Metric_DisplayBorderless),
|
||||
new(TrendMetric.DisplayWindowedShare, Strings.Trend_Metric_DisplayWindowed),
|
||||
new(TrendMetric.ControllerShare, Strings.Trend_Metric_ControllerShare),
|
||||
new(TrendMetric.KeyboardMouseShare, Strings.Trend_Metric_KeyboardMouseShare),
|
||||
new(TrendMetric.TimeBelow60, Strings.Trend_Metric_TimeBelow60),
|
||||
new(TrendMetric.TimeBelowRefresh, Strings.Trend_Metric_TimeBelowRefresh),
|
||||
new(TrendMetric.FrameToFrame, Strings.Trend_Metric_FrameToFrame),
|
||||
@@ -1278,6 +1280,12 @@ public sealed partial class GameDetailViewModel : ObservableObject
|
||||
{
|
||||
Details.Add(new GameDetailRow(Strings.GameDetail_Details_NvidiaOverride, NvidiaOverrides.OverridesText(profile)));
|
||||
}
|
||||
|
||||
// 0.1.0-beta.50 (D163): "does it support controllers?" as three pieces of evidence, each with its source, and no
|
||||
// verdict - what the store's own file lists, which input libraries the game loaded, how it has been played.
|
||||
Details.Add(new GameDetailRow(Strings.GameDetail_Controller_Store_Label, ControllerEvidence.StoreText(row)));
|
||||
Details.Add(new GameDetailRow(Strings.GameDetail_Controller_Libraries_Label, ControllerEvidence.LibrariesText(detail.Sessions)));
|
||||
Details.Add(new GameDetailRow(Strings.GameDetail_Controller_Played_Label, ControllerEvidence.PlayedWithText(detail.Sessions)));
|
||||
}
|
||||
|
||||
private void AddDetail(string label, string? value)
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using FrameLedger.App.Controls;
|
||||
|
||||
namespace FrameLedger.App.ViewModels;
|
||||
|
||||
/// <summary>
|
||||
/// One row of the summary's "Played with" table (0.1.0-beta.50): a class of input, its share of the time the game was
|
||||
/// in front and how long that was - from the row's stored totals, never recomputed from the series.
|
||||
/// </summary>
|
||||
/// <param name="Label"><c>Controller</c>, <c>Keyboard and mouse</c>, <c>Both at once</c> or <c>No input</c>.</param>
|
||||
/// <param name="Share">One decimal (<c>83.2%</c>).</param>
|
||||
/// <param name="Duration">The time the class covers.</param>
|
||||
/// <param name="Segment">The row as the bar draws it.</param>
|
||||
public sealed record InputClassRowModel(string Label, string Share, string Duration, InputShareSegment Segment)
|
||||
{
|
||||
/// <summary>The row's colour, as a one-segment bar beside its label.</summary>
|
||||
public IReadOnlyList<InputShareSegment> Swatch { get; } = [Segment with { Share = 1 }];
|
||||
|
||||
/// <summary>The row in one line, as a screen reader reads it.</summary>
|
||||
public override string ToString() => Services.SpokenText.Pair(Label, Services.SpokenText.List(Share, Duration));
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
namespace FrameLedger.App.ViewModels;
|
||||
|
||||
/// <summary>
|
||||
/// One controller of a session in the summary's table (0.1.0-beta.50), from <c>sessions.input_devices</c>: what it was,
|
||||
/// how it was connected, how long it was in use and connected, how often it connected and dropped, and its battery.
|
||||
/// Never a serial number, an address or a device path - the ledger has none to show.
|
||||
/// </summary>
|
||||
/// <param name="Name">The model's name, or the maker's with "controller"; a pad a program presents says so.</param>
|
||||
/// <param name="Connection">USB, Bluetooth, a wireless adapter, or unknown.</param>
|
||||
/// <param name="InUse">The time it was in use while the game was in front.</param>
|
||||
/// <param name="Connected">The time it was connected.</param>
|
||||
/// <param name="Events">How many times it connected and dropped after the session's first reading.</param>
|
||||
/// <param name="Battery">The state held longest and for how long, the first and last level, the drain - or why there is none.</param>
|
||||
public sealed record InputControllerRowModel(string Name, string Connection, string InUse, string Connected, string Events, string Battery)
|
||||
{
|
||||
/// <summary>The row in one line, as a screen reader reads it: each figure with the heading of its column.</summary>
|
||||
public override string ToString() => Services.SpokenText.Pair(Name, Services.SpokenText.List(
|
||||
Connection,
|
||||
Services.SpokenText.Pair(Strings.Input_Col_InUse, InUse),
|
||||
Services.SpokenText.Pair(Strings.Input_Col_Connected, Connected),
|
||||
Services.SpokenText.Pair(Strings.Input_Col_Events, Events),
|
||||
Services.SpokenText.Pair(Strings.Input_Col_Battery, Battery)));
|
||||
}
|
||||
@@ -166,6 +166,61 @@ public sealed partial class SessionSummaryViewModel : ObservableObject
|
||||
[ObservableProperty]
|
||||
private string? _fgMixMissing;
|
||||
|
||||
/// <summary>0.1.0-beta.50: the session stored what it was played with and the game was in front, so the block is shown.</summary>
|
||||
[ObservableProperty]
|
||||
private bool _hasInput;
|
||||
|
||||
/// <summary>The four classes as the bar draws them, in the table's order.</summary>
|
||||
[ObservableProperty]
|
||||
private IReadOnlyList<InputShareSegment> _inputSegments = [];
|
||||
|
||||
/// <summary>The bar's spoken name: every class with its share.</summary>
|
||||
[ObservableProperty]
|
||||
private string _inputName = string.Empty;
|
||||
|
||||
/// <summary>How long the session was read and how long the game was in front - what the shares are shares of.</summary>
|
||||
[ObservableProperty]
|
||||
private string? _inputContext;
|
||||
|
||||
/// <summary>How often the session went from a controller to the keyboard and mouse or back.</summary>
|
||||
[ObservableProperty]
|
||||
private string? _inputSwitches;
|
||||
|
||||
/// <summary>The session had a controller, so their table is shown.</summary>
|
||||
[ObservableProperty]
|
||||
private bool _hasInputControllers;
|
||||
|
||||
/// <summary>That no controller was connected, for a session that was read and saw none; null otherwise.</summary>
|
||||
[ObservableProperty]
|
||||
private string? _inputNoControllers;
|
||||
|
||||
/// <summary>Each maker's share of the controllers' time and how often the maker changed; null with fewer than two makers.</summary>
|
||||
[ObservableProperty]
|
||||
private string? _inputMakers;
|
||||
|
||||
/// <summary>What the reader could not do in this session and what Windows showed twice, a sentence a line; null with nothing to add.</summary>
|
||||
[ObservableProperty]
|
||||
private string? _inputNotes;
|
||||
|
||||
/// <summary>Why the session shows no "Played with" (<see cref="InputPresentation.Missing"/>); null when it does.</summary>
|
||||
[ObservableProperty]
|
||||
private string? _inputMissing;
|
||||
|
||||
/// <summary>The session stored its input series, so the timeline is drawn.</summary>
|
||||
[ObservableProperty]
|
||||
private bool _hasInputCharts;
|
||||
|
||||
/// <summary>A controller of the session reported a battery, so its chart is drawn.</summary>
|
||||
[ObservableProperty]
|
||||
private bool _hasInputBattery;
|
||||
|
||||
/// <summary>The frame-time chart can carry the controller marks: there are some, and the frames' place on the sensors' clock is known.</summary>
|
||||
[ObservableProperty]
|
||||
private bool _hasInputEvents;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _showInputEvents = true;
|
||||
|
||||
[ObservableProperty]
|
||||
private string _tags = string.Empty;
|
||||
|
||||
@@ -238,6 +293,32 @@ public sealed partial class SessionSummaryViewModel : ObservableObject
|
||||
|
||||
public static string FgMixTimeHeader => Strings.FgMix_Col_Time;
|
||||
|
||||
public static string InputHeader => Strings.Input_Header;
|
||||
|
||||
public static string InputLimitsNote => Strings.Input_Limits_Note;
|
||||
|
||||
public static string InputMethodHeader => Strings.Input_Col_Method;
|
||||
|
||||
public static string InputControllersHeader => Strings.Input_Controllers_Header;
|
||||
|
||||
public static string InputControllerHeader => Strings.Input_Col_Controller;
|
||||
|
||||
public static string InputConnectionHeader => Strings.Input_Col_Connection;
|
||||
|
||||
public static string InputInUseHeader => Strings.Input_Col_InUse;
|
||||
|
||||
public static string InputConnectedHeader => Strings.Input_Col_Connected;
|
||||
|
||||
public static string InputEventsHeader => Strings.Input_Col_Events;
|
||||
|
||||
public static string InputBatteryColumnHeader => Strings.Input_Col_Battery;
|
||||
|
||||
public static string InputTimelineHeader => Strings.Input_Timeline_Header;
|
||||
|
||||
public static string InputBatteryHeader => Strings.Input_Battery_Header;
|
||||
|
||||
public static string ShowInputEventsText => Strings.Summary_Show_InputEvents;
|
||||
|
||||
public static string AnnotationsHeader => Strings.Summary_Annotations_Header;
|
||||
|
||||
public static string TagsPlaceholder => Strings.Summary_Tags_Placeholder;
|
||||
@@ -269,6 +350,21 @@ public sealed partial class SessionSummaryViewModel : ObservableObject
|
||||
/// <summary>What the Sensors section draws: <see cref="Series"/> for a hooked session, the sensors alone for one that was not.</summary>
|
||||
public SessionSeries? SensorSeries { get; private set; }
|
||||
|
||||
/// <summary>The session's input series (0.1.0-beta.50) for the two charts; null for a session that stored none.</summary>
|
||||
public InputSeries? InputSeries { get; private set; }
|
||||
|
||||
/// <summary>The session's controllers as stored (<c>sessions.input_devices</c>); null for a session with none.</summary>
|
||||
public Application.Recording.InputDevicesRecord? InputDevices { get; private set; }
|
||||
|
||||
/// <summary>The controllers' connections, drops and low batteries, on the sensors' clock - the charts' marks.</summary>
|
||||
public IReadOnlyList<InputEvent> InputEvents { get; private set; } = [];
|
||||
|
||||
/// <summary>What the session was played with, a row a class.</summary>
|
||||
public ObservableCollection<InputClassRowModel> InputRows { get; } = [];
|
||||
|
||||
/// <summary>The session's controllers, a row each.</summary>
|
||||
public ObservableCollection<InputControllerRowModel> InputControllers { get; } = [];
|
||||
|
||||
public ObservableCollection<StatCardModel> Stats { get; } = [];
|
||||
|
||||
/// <summary>beta.12: every series' stored mean, median, minimum and peak (<see cref="SensorStatsTable"/>).</summary>
|
||||
@@ -303,6 +399,9 @@ public sealed partial class SessionSummaryViewModel : ObservableObject
|
||||
_snapshot = await _hardware.FindAsync(Row.SnapshotId, ct).ConfigureAwait(true);
|
||||
Series = Row.Tier == CaptureTier.Hooked ? await _loader.LoadAsync(sessionId, ct).ConfigureAwait(true) : null;
|
||||
SensorSeries = Series ?? (await _loader.LoadSensorsAsync(sessionId, ct).ConfigureAwait(true) is { Count: > 0 } sensors ? SessionSeries.SensorsOnly(sensors) : null);
|
||||
|
||||
// Both tiers (0.1.0-beta.50): what it was played with is read from outside the game.
|
||||
InputSeries = Row.InputObservedMs is > 0 ? await _loader.LoadInputAsync(sessionId, ct).ConfigureAwait(true) : null;
|
||||
Present();
|
||||
}
|
||||
|
||||
@@ -458,10 +557,51 @@ public sealed partial class SessionSummaryViewModel : ObservableObject
|
||||
DecimationNote = Series is null ? string.Empty : string.Format(CultureInfo.CurrentCulture, Strings.Chart_Decimated_Format, Series.Presents, Math.Min(Series.Presents, Decimator.DefaultBuckets * 2));
|
||||
PresentStats(row);
|
||||
PresentFgMix(row);
|
||||
PresentInput(row);
|
||||
PresentChips();
|
||||
Presented?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 0.1.0-beta.50 (D155-D163): what the session was played with - the stored totals as a bar and a table, the controllers,
|
||||
/// the makers, what the reader could not do - and why a session has none. Read from the row, never recomputed.
|
||||
/// </summary>
|
||||
private void PresentInput(SessionRow row)
|
||||
{
|
||||
IReadOnlyList<InputClassRowModel> rows = InputPresentation.Rows(row);
|
||||
InputRows.Clear();
|
||||
foreach (InputClassRowModel line in rows)
|
||||
{
|
||||
InputRows.Add(line);
|
||||
}
|
||||
|
||||
HasInput = rows.Count > 0;
|
||||
InputSegments = [.. rows.Select(static r => r.Segment)];
|
||||
InputName = HasInput ? InputPresentation.AccessibleName(rows) : string.Empty;
|
||||
InputContext = HasInput ? InputPresentation.Context(row) : null;
|
||||
InputSwitches = InputPresentation.Switches(row);
|
||||
InputMissing = InputPresentation.Missing(row);
|
||||
|
||||
// The controllers are shown for any session that was read, in front or not: a pad that sat connected is a fact too.
|
||||
InputDevices = row.InputObservedMs is > 0 ? Application.Recording.InputDevicesRecord.Parse(row.InputDevicesJson) : null;
|
||||
InputControllers.Clear();
|
||||
foreach (InputControllerRowModel line in InputPresentation.Controllers(InputDevices))
|
||||
{
|
||||
InputControllers.Add(line);
|
||||
}
|
||||
|
||||
HasInputControllers = InputControllers.Count > 0;
|
||||
InputNoControllers = row.InputObservedMs is > 0 && !HasInputControllers ? Strings.Input_Controllers_NoneSeen : null;
|
||||
InputMakers = InputPresentation.Makers(InputDevices);
|
||||
IReadOnlyList<string> notes = InputPresentation.Notes(InputDevices);
|
||||
InputNotes = notes.Count > 0 ? string.Join(Environment.NewLine, notes) : null;
|
||||
|
||||
InputEvents = InputSeries?.Events(InputDevices) ?? [];
|
||||
HasInputCharts = InputSeries is { TimesS.Length: > 0 };
|
||||
HasInputBattery = InputSeries is { } series && series.Devices.Any(static d => d.Battery is not null);
|
||||
HasInputEvents = IsHooked && InputEvents.Count > 0 && Series?.SensorOffsetS is not null;
|
||||
}
|
||||
|
||||
/// <summary>beta.24 (D62): the stored mix as rows and a bar, the setting that framed it, and why a session has none.</summary>
|
||||
private void PresentFgMix(SessionRow row)
|
||||
{
|
||||
@@ -615,6 +755,9 @@ public sealed partial class SessionSummaryViewModel : ObservableObject
|
||||
return null;
|
||||
}
|
||||
|
||||
// The input libraries ride the same snapshot since 0.1.0-beta.50 (D163) and are the game page's to show, as
|
||||
// evidence of controller support: this line stays the upscaling and frame-generation libraries'.
|
||||
modules = modules?.Where(static m => !ControllerEvidence.IsInputLibrary(m.Key)).ToDictionary(static m => m.Key, static m => m.Value, StringComparer.OrdinalIgnoreCase);
|
||||
if (modules is null || modules.Count == 0)
|
||||
{
|
||||
return null;
|
||||
|
||||
@@ -157,12 +157,17 @@
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:TextBlock Grid.Column="0" FontTypography="Subtitle" AutomationProperties.HeadingLevel="Level2" Text="{x:Static vm:SessionSummaryViewModel.FrametimeHeader}" />
|
||||
<CheckBox Grid.Column="1" Margin="0,0,16,0" Content="{x:Static vm:SessionSummaryViewModel.ShowDisplayedText}"
|
||||
IsChecked="{Binding ViewModel.ShowDisplayed}" IsEnabled="{Binding ViewModel.HasDisplayed}"
|
||||
Visibility="{Binding ViewModel.HasDisplayed, Converter={StaticResource BoolToVis}}" />
|
||||
<CheckBox Grid.Column="2" Content="{x:Static vm:SessionSummaryViewModel.ShowSensorsText}"
|
||||
<!-- 0.1.0-beta.50: the controllers' connections, drops and low batteries as lines across the frames -->
|
||||
<CheckBox Grid.Column="2" Margin="0,0,16,0" Content="{x:Static vm:SessionSummaryViewModel.ShowInputEventsText}"
|
||||
IsChecked="{Binding ViewModel.ShowInputEvents}"
|
||||
Visibility="{Binding ViewModel.HasInputEvents, Converter={StaticResource BoolToVis}}" />
|
||||
<CheckBox Grid.Column="3" Content="{x:Static vm:SessionSummaryViewModel.ShowSensorsText}"
|
||||
IsChecked="{Binding ViewModel.ShowSensors}" IsEnabled="{Binding ViewModel.HasSensors}" />
|
||||
</Grid>
|
||||
<ui:TextBlock Style="{StaticResource TertiaryText}" Text="{Binding ViewModel.DecimationNote}" />
|
||||
@@ -230,6 +235,113 @@
|
||||
<ui:TextBlock Margin="0,8,0,0" Style="{StaticResource TertiaryText}" TextWrapping="Wrap" Text="{Binding ViewModel.SensorStatsMissing}"
|
||||
Visibility="{Binding ViewModel.SensorStatsMissing, Converter={StaticResource NullToCollapsed}}" />
|
||||
|
||||
<!-- 0.1.0-beta.50 (D155-D163): what the session was played with, both tiers - read from outside the game. The bar
|
||||
draws in the chart palette's colours from code (InputShareBar); the tables carry every number in text. -->
|
||||
<ui:TextBlock Margin="0,16,0,0" FontTypography="Subtitle" AutomationProperties.HeadingLevel="Level2" Text="{x:Static vm:SessionSummaryViewModel.InputHeader}" />
|
||||
<ui:TextBlock Style="{StaticResource TertiaryText}" TextWrapping="Wrap" Text="{x:Static vm:SessionSummaryViewModel.InputLimitsNote}" />
|
||||
<ui:TextBlock Margin="0,4,0,0" Style="{StaticResource SecondaryText}" TextWrapping="Wrap" Text="{Binding ViewModel.InputMissing}"
|
||||
Visibility="{Binding ViewModel.InputMissing, Converter={StaticResource NullToCollapsed}}" />
|
||||
<StackPanel Visibility="{Binding ViewModel.HasInput, Converter={StaticResource BoolToVis}}">
|
||||
<ui:TextBlock Margin="0,4,0,0" Style="{StaticResource TertiaryText}" TextWrapping="Wrap" Text="{Binding ViewModel.InputContext}"
|
||||
Visibility="{Binding ViewModel.InputContext, Converter={StaticResource NullToCollapsed}}" />
|
||||
<controls:InputShareBar Margin="0,6,0,0" Height="14" Segments="{Binding ViewModel.InputSegments}"
|
||||
AutomationProperties.Name="{Binding ViewModel.InputName}" />
|
||||
<StackPanel Margin="0,8,0,0" Grid.IsSharedSizeScope="True">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="InputSwatch" />
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="InputMethod" />
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="InputShare" />
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="InputTime" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:TextBlock Grid.Column="1" Margin="0,0,24,4" FontTypography="BodyStrong" Text="{x:Static vm:SessionSummaryViewModel.InputMethodHeader}" />
|
||||
<ui:TextBlock Grid.Column="2" Margin="0,0,24,4" FontTypography="BodyStrong" TextAlignment="Right" Text="{x:Static vm:SessionSummaryViewModel.FgMixShareHeader}" />
|
||||
<ui:TextBlock Grid.Column="3" Margin="0,0,0,4" FontTypography="BodyStrong" TextAlignment="Right" Text="{x:Static vm:SessionSummaryViewModel.FgMixTimeHeader}" />
|
||||
</Grid>
|
||||
<ItemsControl ItemsSource="{Binding ViewModel.InputRows}" Focusable="False">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type vm:InputClassRowModel}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="InputSwatch" />
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="InputMethod" />
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="InputShare" />
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="InputTime" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<controls:InputShareBar Grid.Column="0" Width="12" Height="12" Margin="0,0,8,0" VerticalAlignment="Center" Segments="{Binding Swatch}" />
|
||||
<ui:TextBlock Grid.Column="1" Margin="0,2,24,2" Text="{Binding Label}" />
|
||||
<ui:TextBlock Grid.Column="2" Margin="0,2,24,2" TextAlignment="Right" Text="{Binding Share}" />
|
||||
<ui:TextBlock Grid.Column="3" Margin="0,2,0,2" Style="{StaticResource SecondaryText}" TextAlignment="Right" Text="{Binding Duration}" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</StackPanel>
|
||||
<ui:TextBlock Margin="0,4,0,0" Style="{StaticResource SecondaryText}" TextWrapping="Wrap" Text="{Binding ViewModel.InputSwitches}"
|
||||
Visibility="{Binding ViewModel.InputSwitches, Converter={StaticResource NullToCollapsed}}" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- the session's controllers: shown for any session that was read, in front or not -->
|
||||
<ui:TextBlock Margin="0,8,0,0" Style="{StaticResource SecondaryText}" TextWrapping="Wrap" Text="{Binding ViewModel.InputNoControllers}"
|
||||
Visibility="{Binding ViewModel.InputNoControllers, Converter={StaticResource NullToCollapsed}}" />
|
||||
<StackPanel Visibility="{Binding ViewModel.HasInputControllers, Converter={StaticResource BoolToVis}}">
|
||||
<ui:TextBlock Margin="0,12,0,0" FontTypography="BodyStrong" AutomationProperties.HeadingLevel="Level3" Text="{x:Static vm:SessionSummaryViewModel.InputControllersHeader}" />
|
||||
<StackPanel Margin="0,6,0,0" Grid.IsSharedSizeScope="True">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="PadName" />
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="PadConnection" />
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="PadInUse" />
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="PadConnected" />
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="PadEvents" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:TextBlock Grid.Column="0" Margin="0,0,24,4" FontTypography="BodyStrong" Text="{x:Static vm:SessionSummaryViewModel.InputControllerHeader}" />
|
||||
<ui:TextBlock Grid.Column="1" Margin="0,0,24,4" FontTypography="BodyStrong" Text="{x:Static vm:SessionSummaryViewModel.InputConnectionHeader}" />
|
||||
<ui:TextBlock Grid.Column="2" Margin="0,0,24,4" FontTypography="BodyStrong" TextAlignment="Right" Text="{x:Static vm:SessionSummaryViewModel.InputInUseHeader}" />
|
||||
<ui:TextBlock Grid.Column="3" Margin="0,0,24,4" FontTypography="BodyStrong" TextAlignment="Right" Text="{x:Static vm:SessionSummaryViewModel.InputConnectedHeader}" />
|
||||
<ui:TextBlock Grid.Column="4" Margin="0,0,24,4" FontTypography="BodyStrong" TextAlignment="Right" Text="{x:Static vm:SessionSummaryViewModel.InputEventsHeader}" />
|
||||
<ui:TextBlock Grid.Column="5" Margin="0,0,0,4" FontTypography="BodyStrong" Text="{x:Static vm:SessionSummaryViewModel.InputBatteryColumnHeader}" />
|
||||
</Grid>
|
||||
<ItemsControl ItemsSource="{Binding ViewModel.InputControllers}" Focusable="False">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type vm:InputControllerRowModel}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="PadName" />
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="PadConnection" />
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="PadInUse" />
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="PadConnected" />
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="PadEvents" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:TextBlock Grid.Column="0" Margin="0,2,24,2" Text="{Binding Name}" />
|
||||
<ui:TextBlock Grid.Column="1" Margin="0,2,24,2" Text="{Binding Connection}" />
|
||||
<ui:TextBlock Grid.Column="2" Margin="0,2,24,2" TextAlignment="Right" Text="{Binding InUse}" />
|
||||
<ui:TextBlock Grid.Column="3" Margin="0,2,24,2" TextAlignment="Right" Text="{Binding Connected}" />
|
||||
<ui:TextBlock Grid.Column="4" Margin="0,2,24,2" TextAlignment="Right" Text="{Binding Events}" />
|
||||
<ui:TextBlock Grid.Column="5" Margin="0,2,0,2" Style="{StaticResource SecondaryText}" TextWrapping="Wrap" Text="{Binding Battery}" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</StackPanel>
|
||||
<ui:TextBlock Margin="0,4,0,0" Style="{StaticResource SecondaryText}" TextWrapping="Wrap" Text="{Binding ViewModel.InputMakers}"
|
||||
Visibility="{Binding ViewModel.InputMakers, Converter={StaticResource NullToCollapsed}}" />
|
||||
</StackPanel>
|
||||
<ui:TextBlock Margin="0,4,0,0" Style="{StaticResource TertiaryText}" TextWrapping="Wrap" Text="{Binding ViewModel.InputNotes}"
|
||||
Visibility="{Binding ViewModel.InputNotes, Converter={StaticResource NullToCollapsed}}" />
|
||||
|
||||
<!-- the input series over the session, from its start: what each second was played with, then each battery -->
|
||||
<StackPanel Visibility="{Binding ViewModel.HasInputCharts, Converter={StaticResource BoolToVis}}">
|
||||
<ui:TextBlock Margin="0,12,0,0" FontTypography="BodyStrong" AutomationProperties.HeadingLevel="Level3" Text="{x:Static vm:SessionSummaryViewModel.InputTimelineHeader}" />
|
||||
<charts:InputTimelineChart x:Name="InputTimeline" Margin="0,6,0,0" Height="200" />
|
||||
</StackPanel>
|
||||
<StackPanel Visibility="{Binding ViewModel.HasInputBattery, Converter={StaticResource BoolToVis}}">
|
||||
<ui:TextBlock Margin="0,12,0,0" FontTypography="BodyStrong" AutomationProperties.HeadingLevel="Level3" Text="{x:Static vm:SessionSummaryViewModel.InputBatteryHeader}" />
|
||||
<charts:InputBatteryChart x:Name="InputBattery" Margin="0,6,0,0" Height="200" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- annotations -->
|
||||
<ui:TextBlock Margin="0,16,0,0" FontTypography="Subtitle" AutomationProperties.HeadingLevel="Level2" Text="{x:Static vm:SessionSummaryViewModel.AnnotationsHeader}" />
|
||||
<ui:TextBox Margin="0,6,0,0" AutomationProperties.Name="{x:Static vm:SessionSummaryViewModel.TagsPlaceholder}" PlaceholderText="{x:Static vm:SessionSummaryViewModel.TagsPlaceholder}" Text="{Binding ViewModel.Tags, UpdateSourceTrigger=PropertyChanged}" />
|
||||
|
||||
@@ -54,6 +54,9 @@ public partial class SessionSummaryWindow : FluentWindow
|
||||
case nameof(SessionSummaryViewModel.ShowSensors):
|
||||
Frametime.SetSensors(ViewModel.ShowSensors);
|
||||
break;
|
||||
case nameof(SessionSummaryViewModel.ShowInputEvents):
|
||||
Frametime.SetInputEvents(ViewModel.InputEvents, ViewModel.ShowInputEvents);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -61,10 +64,14 @@ public partial class SessionSummaryWindow : FluentWindow
|
||||
|
||||
private void Redraw()
|
||||
{
|
||||
// The marks first: set before the frames are drawn, they cost no second draw of them.
|
||||
Frametime.SetInputEvents(ViewModel.InputEvents, ViewModel.ShowInputEvents);
|
||||
Frametime.Show(ViewModel.Series, ViewModel.ShowDisplayed, ViewModel.ShowSensors);
|
||||
Distribution.Show(ViewModel.Series);
|
||||
RenderScale.Show(ViewModel.Series, ViewModel.Row);
|
||||
Sensors.Show(ViewModel.SensorSeries);
|
||||
InputTimeline.Show(ViewModel.InputSeries, ViewModel.InputEvents);
|
||||
InputBattery.Show(ViewModel.InputSeries, ViewModel.InputDevices);
|
||||
}
|
||||
|
||||
private void OnExportPng(object sender, RoutedEventArgs e) => _ = ViewModel.ExportPngAsync(Frametime.ScottPlot);
|
||||
|
||||
@@ -87,4 +87,12 @@ public interface IGameRepository
|
||||
/// does not exist.
|
||||
/// </summary>
|
||||
ValueTask<bool> ApplyStoreMetadataAsync(long gameId, StoreMetadata store, CancellationToken ct = default);
|
||||
|
||||
/// <summary>
|
||||
/// What the store's own file on the disk says of controller support (schema 0024, owner decision D163):
|
||||
/// <c>full</c>, <c>partial</c> or <c>none</c>, the file it was read from and when. The UI's write - it reads the
|
||||
/// store's file when a game's page is opened; never a hook column, and never a verdict of FrameLedger's. False when
|
||||
/// no row has that id.
|
||||
/// </summary>
|
||||
ValueTask<bool> SetControllerSupportAsync(long gameId, string support, string source, DateTimeOffset at, CancellationToken ct = default);
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
namespace FrameLedger.Domain.Input;
|
||||
|
||||
/// <summary>
|
||||
/// The libraries through which a Windows game reads controllers, by file name (owner decision D163,
|
||||
/// <c>05_DETECTION</c> §Input libraries): the second of the three pieces of evidence for "supports controllers". A
|
||||
/// hooked session's module snapshot notes which of them the game had loaded.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <b>Loaded is not used.</b> Several engines load XInput whether the game reads a pad or not, so a library here says
|
||||
/// how a game COULD read a controller - which is why it is shown as evidence, beside what the store lists and how the
|
||||
/// game was played, and never as a verdict.
|
||||
/// </remarks>
|
||||
public static class InputLibraries
|
||||
{
|
||||
private static readonly (string File, string Api)[] _known =
|
||||
[
|
||||
("xinput1_4.dll", "XInput"),
|
||||
("xinput1_3.dll", "XInput"),
|
||||
("xinput9_1_0.dll", "XInput"),
|
||||
("xinputuap.dll", "XInput"),
|
||||
("dinput8.dll", "DirectInput"),
|
||||
("dinput.dll", "DirectInput"),
|
||||
("windows.gaming.input.dll", "Windows.Gaming.Input"),
|
||||
("gameinput.dll", "GameInput"),
|
||||
("sdl2.dll", "SDL"),
|
||||
("sdl3.dll", "SDL"),
|
||||
];
|
||||
|
||||
/// <summary>The file names a module snapshot looks for, lower case.</summary>
|
||||
public static IReadOnlyList<string> FileNames { get; } = [.. _known.Select(static k => k.File)];
|
||||
|
||||
/// <summary>The interface a file is - <c>XInput</c>, <c>DirectInput</c>, <c>Windows.Gaming.Input</c>, <c>GameInput</c>, <c>SDL</c> - or null when it is not an input library.</summary>
|
||||
public static string? ApiOf(string? fileName)
|
||||
{
|
||||
foreach ((string file, string api) in _known)
|
||||
{
|
||||
if (string.Equals(file, fileName, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return api;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>Whether a file is an input library.</summary>
|
||||
public static bool Is(string? fileName) => ApiOf(fileName) is not null;
|
||||
}
|
||||
@@ -0,0 +1,292 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Buffers.Binary;
|
||||
using System.Text;
|
||||
|
||||
namespace FrameLedger.Infrastructure.Import;
|
||||
|
||||
/// <summary>
|
||||
/// What the Steam app's own file on this PC says of controller support for a game (owner decision D163,
|
||||
/// <c>05_DETECTION</c> §What a store lists): <c>appcache\appinfo.vdf</c>, the copy of the store's application records
|
||||
/// the Steam client keeps on the disk. <b>A local file: no request is made to any store</b> (CLAUDE.md rule 8).
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// <b>One fact is read.</b> Each record's <c>common</c> section may hold <c>controller_support</c> = <c>full</c> or
|
||||
/// <c>partial</c>; a record without it lists none. Nothing else of a record is kept, and nothing is written.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <b>The format, version 41</b> (magic <c>0x07564429</c>) - the one the Steam client has written since mid-2024, and
|
||||
/// the only one read; another magic is refused with the reason, and the fact then reads N/A. A header: the magic, a
|
||||
/// universe, and the offset of a table of strings. Then one record per application until an id of zero: the id, the
|
||||
/// size of what follows, sixty bytes of state and hashes, and a tree in Valve's binary key-value form whose keys are
|
||||
/// numbers into that table. The layout was checked on the developer's own Steam folder on 2026-11-14 (3 581 records,
|
||||
/// every tree read to its last byte); the tests' files are written by hand to the same layout.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <b>It trusts no length in the file.</b> A record or a string that claims more than the file holds ends the read
|
||||
/// with a reason; what was found before it is not returned either - a file that cannot be read whole says nothing.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public static class SteamAppInfo
|
||||
{
|
||||
/// <summary><c>games.controller_support_source</c> for a fact read here.</summary>
|
||||
public const string Source = "steam-appinfo";
|
||||
|
||||
public const string Full = "full";
|
||||
|
||||
public const string Partial = "partial";
|
||||
|
||||
/// <summary>The store's record is there and lists no controller support.</summary>
|
||||
public const string None = "none";
|
||||
|
||||
private const uint _magic41 = 0x07564429;
|
||||
private const int _headerBytes = 16;
|
||||
private const int _recordStateBytes = 60;
|
||||
private const int _maxDepth = 32;
|
||||
|
||||
private const byte _map = 0x00;
|
||||
private const byte _string = 0x01;
|
||||
private const byte _wideString = 0x05;
|
||||
private const byte _end = 0x08;
|
||||
private const byte _endAlternate = 0x0B;
|
||||
|
||||
/// <summary>Where the Steam app on this PC keeps the file, or null when Steam is not installed for this user.</summary>
|
||||
public static string? InstalledFile() => SteamLibrarySource.InstalledRoot() is { } root ? Path.Combine(root, "appcache", "appinfo.vdf") : null;
|
||||
|
||||
/// <summary>Reads the file at <paramref name="path"/>; a file that is not there, cannot be opened or cannot be read is a result with a <see cref="SteamAppInfoResult.Problem"/>.</summary>
|
||||
public static SteamAppInfoResult ReadControllerSupport(string path, IReadOnlyCollection<uint> appIds)
|
||||
{
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(path);
|
||||
ArgumentNullException.ThrowIfNull(appIds);
|
||||
byte[] file;
|
||||
try
|
||||
{
|
||||
// Steam rewrites the file while it runs: shared with every other reader and writer, and never locked.
|
||||
using var stream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite | FileShare.Delete);
|
||||
if (stream.Length is 0 or > int.MaxValue)
|
||||
{
|
||||
return SteamAppInfoResult.Failed("the file is empty or too large");
|
||||
}
|
||||
|
||||
file = new byte[stream.Length];
|
||||
stream.ReadExactly(file);
|
||||
}
|
||||
catch (Exception e) when (e is IOException or UnauthorizedAccessException)
|
||||
{
|
||||
return SteamAppInfoResult.Failed(e.GetType().Name);
|
||||
}
|
||||
|
||||
return ReadControllerSupport(file, appIds);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// For each of <paramref name="appIds"/> that has a record in <paramref name="file"/>: <see cref="Full"/>,
|
||||
/// <see cref="Partial"/> or <see cref="None"/>. An id with no record is not in the answer: the store's file does
|
||||
/// not describe it.
|
||||
/// </summary>
|
||||
public static SteamAppInfoResult ReadControllerSupport(ReadOnlySpan<byte> file, IReadOnlyCollection<uint> appIds)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(appIds);
|
||||
if (file.Length < _headerBytes)
|
||||
{
|
||||
return SteamAppInfoResult.Failed("shorter than a header");
|
||||
}
|
||||
|
||||
uint magic = BinaryPrimitives.ReadUInt32LittleEndian(file);
|
||||
if (magic != _magic41)
|
||||
{
|
||||
return SteamAppInfoResult.Failed($"format 0x{magic:X8} is not the one this build reads (0x{_magic41:X8})");
|
||||
}
|
||||
|
||||
long tableAt = BinaryPrimitives.ReadInt64LittleEndian(file[8..]);
|
||||
if (tableAt < _headerBytes || tableAt > file.Length - 4 || !TryFindKeys(file[(int)tableAt..], out int common, out int support))
|
||||
{
|
||||
return SteamAppInfoResult.Failed("the table of strings cannot be read");
|
||||
}
|
||||
|
||||
var found = new Dictionary<uint, string>();
|
||||
return ReadRecords(file[..(int)tableAt], [.. appIds], common, support, found) is { } problem
|
||||
? SteamAppInfoResult.Failed(problem)
|
||||
: new SteamAppInfoResult(found, Problem: null);
|
||||
}
|
||||
|
||||
/// <summary>Walks the records, which end where the table of strings begins; returns what is wrong with them, or null.</summary>
|
||||
private static string? ReadRecords(ReadOnlySpan<byte> records, HashSet<uint> wanted, int common, int support, Dictionary<uint, string> found)
|
||||
{
|
||||
int tableAt = records.Length;
|
||||
int at = _headerBytes;
|
||||
while (true)
|
||||
{
|
||||
if (at > tableAt - 4)
|
||||
{
|
||||
return "a record runs into the table of strings";
|
||||
}
|
||||
|
||||
uint appId = BinaryPrimitives.ReadUInt32LittleEndian(records[at..]);
|
||||
if (appId == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (at > tableAt - 8)
|
||||
{
|
||||
return "a record has no size";
|
||||
}
|
||||
|
||||
uint size = BinaryPrimitives.ReadUInt32LittleEndian(records[(at + 4)..]);
|
||||
if (size < _recordStateBytes || size > tableAt - at - 8)
|
||||
{
|
||||
return "a record claims more than the file holds";
|
||||
}
|
||||
|
||||
if (wanted.Contains(appId))
|
||||
{
|
||||
ReadOnlySpan<byte> tree = records.Slice(at + 8 + _recordStateBytes, (int)size - _recordStateBytes);
|
||||
if (!TryReadSupport(tree, common, support, out string? value))
|
||||
{
|
||||
return "a record's tree cannot be read";
|
||||
}
|
||||
|
||||
found[appId] = string.Equals(value, Full, StringComparison.OrdinalIgnoreCase) ? Full
|
||||
: string.Equals(value, Partial, StringComparison.OrdinalIgnoreCase) ? Partial
|
||||
: None;
|
||||
}
|
||||
|
||||
at += 8 + (int)size;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>The numbers of the two keys in the table: <c>u32 count</c>, then that many strings, each ended by a zero.</summary>
|
||||
private static bool TryFindKeys(ReadOnlySpan<byte> table, out int common, out int support)
|
||||
{
|
||||
common = -1;
|
||||
support = -1;
|
||||
uint count = BinaryPrimitives.ReadUInt32LittleEndian(table);
|
||||
ReadOnlySpan<byte> rest = table[4..];
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
int end = rest.IndexOf((byte)0);
|
||||
if (end < 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ReadOnlySpan<byte> name = rest[..end];
|
||||
if (name.SequenceEqual("common"u8))
|
||||
{
|
||||
common = i;
|
||||
}
|
||||
else if (name.SequenceEqual("controller_support"u8))
|
||||
{
|
||||
support = i;
|
||||
}
|
||||
|
||||
rest = rest[(end + 1)..];
|
||||
}
|
||||
|
||||
// A table without one of the two is a file in which no record can say anything of controllers: still a file read.
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>The value of <c><root>/common/controller_support</c>; false when the tree is not well formed.</summary>
|
||||
private static bool TryReadSupport(ReadOnlySpan<byte> tree, int common, int support, out string? value)
|
||||
{
|
||||
value = null;
|
||||
int at = 0;
|
||||
return TryWalk(tree, ref at, depth: 0, inCommon: false, common, support, ref value);
|
||||
}
|
||||
|
||||
private static bool TryWalk(ReadOnlySpan<byte> tree, ref int at, int depth, bool inCommon, int common, int support, ref string? value)
|
||||
{
|
||||
if (depth > _maxDepth)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (at >= tree.Length)
|
||||
{
|
||||
// The root has no end mark of its own when the record's size ends it; a nested map must have one.
|
||||
return depth == 0;
|
||||
}
|
||||
|
||||
byte kind = tree[at++];
|
||||
if (kind is _end or _endAlternate)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (tree.Length - at < 4)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int key = BinaryPrimitives.ReadInt32LittleEndian(tree[at..]);
|
||||
at += 4;
|
||||
if (kind == _map)
|
||||
{
|
||||
// depth 0 is the root's own map ("appinfo"); its child "common" is at depth 1.
|
||||
if (!TryWalk(tree, ref at, depth + 1, inCommon: depth == 1 && key == common, common, support, ref value))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
int start = at;
|
||||
if (!TrySkipValue(tree, ref at, kind))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (kind == _string && inCommon && key == support)
|
||||
{
|
||||
value = Encoding.UTF8.GetString(tree[start..(at - 1)]).Trim();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static bool TrySkipValue(ReadOnlySpan<byte> tree, ref int at, byte kind)
|
||||
{
|
||||
switch (kind)
|
||||
{
|
||||
case _string:
|
||||
int end = tree[at..].IndexOf((byte)0);
|
||||
if (end < 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
at += end + 1;
|
||||
return true;
|
||||
case _wideString:
|
||||
while (true)
|
||||
{
|
||||
if (tree.Length - at < 2)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool last = tree[at] == 0 && tree[at + 1] == 0;
|
||||
at += 2;
|
||||
if (last)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
case 0x02 or 0x03 or 0x04 or 0x06:
|
||||
at += 4;
|
||||
return at <= tree.Length;
|
||||
case 0x07 or 0x0A:
|
||||
at += 8;
|
||||
return at <= tree.Length;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
namespace FrameLedger.Infrastructure.Import;
|
||||
|
||||
/// <summary>What <see cref="SteamAppInfo"/> read.</summary>
|
||||
/// <param name="Support">For each application asked about that has a record: <c>full</c>, <c>partial</c> or <c>none</c>. An id that is not here has no record in the file.</param>
|
||||
/// <param name="Problem">Why the file could not be read, in a few words; null when it was. With a problem, <paramref name="Support"/> is empty.</param>
|
||||
public sealed record SteamAppInfoResult(IReadOnlyDictionary<uint, string> Support, string? Problem)
|
||||
{
|
||||
public static SteamAppInfoResult Failed(string problem) => new(new Dictionary<uint, string>(), problem);
|
||||
}
|
||||
@@ -36,6 +36,11 @@ public sealed class SqliteGameRepository : IGameRepository
|
||||
+ "ac_exception_lapsed_at, ac_exception_lapsed_reason, engine_version_source, ac_exception_trial_failed_at, "
|
||||
+ "controller_support, controller_support_source, controller_support_at";
|
||||
|
||||
// Schema 0024 (D163): the store's word, read from its file on the disk. updated_at is not moved: nothing the user
|
||||
// or the detection did changed.
|
||||
private const string _setControllerSupport =
|
||||
"UPDATE games SET controller_support = @support, controller_support_source = @source, controller_support_at = @at WHERE id = @id";
|
||||
|
||||
private const string _selectByPath = $"SELECT {_columns} FROM games WHERE exe_path = @path";
|
||||
|
||||
private const string _selectById = $"SELECT {_columns} FROM games WHERE id = @id";
|
||||
@@ -234,6 +239,14 @@ public sealed class SqliteGameRepository : IGameRepository
|
||||
_db.WriteAsync(async (c, tx, token) => await c.ExecuteAsync(new CommandDefinition(
|
||||
_setRecording, new { id = gameId, record = record ? 1 : 0, now = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() }, tx, cancellationToken: token)).ConfigureAwait(false) == 1, ct);
|
||||
|
||||
public ValueTask<bool> SetControllerSupportAsync(long gameId, string support, string source, DateTimeOffset at, CancellationToken ct = default)
|
||||
{
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(support);
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(source);
|
||||
return _db.WriteAsync(async (c, tx, token) => await c.ExecuteAsync(new CommandDefinition(
|
||||
_setControllerSupport, new { id = gameId, support, source, at = at.ToUnixTimeMilliseconds() }, tx, cancellationToken: token)).ConfigureAwait(false) == 1, ct);
|
||||
}
|
||||
|
||||
public ValueTask<bool> RemoveAsync(long gameId, bool keepSessions, CancellationToken ct = default) =>
|
||||
_db.WriteAsync(async (c, tx, token) =>
|
||||
{
|
||||
|
||||
@@ -0,0 +1,255 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Buffers.Binary;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using FluentAssertions;
|
||||
using FrameLedger.App.Services;
|
||||
using FrameLedger.App.ViewModels;
|
||||
using FrameLedger.Application.Import;
|
||||
using FrameLedger.Application.Persistence;
|
||||
using FrameLedger.Domain.Sessions;
|
||||
using FrameLedger.Infrastructure.Import;
|
||||
|
||||
namespace FrameLedger.App.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// "Does this game support controllers?" on the game's page (owner decision D163): three pieces of evidence, each with
|
||||
/// where it comes from, and never a verdict - what the store's own file lists, which input libraries the game had
|
||||
/// loaded, how it has been played. And where the store's word comes from: the Steam app's file on this PC, read when
|
||||
/// the page opens, never in a viewer, never over the network.
|
||||
/// </summary>
|
||||
[Collection(StringsCultureCollection.Name)]
|
||||
public sealed class ControllerEvidenceTests
|
||||
{
|
||||
private static readonly DateTimeOffset _t0 = new(2026, 11, 14, 12, 0, 0, TimeSpan.Zero);
|
||||
private static CancellationToken Ct => TestContext.Current.CancellationToken;
|
||||
|
||||
private static SessionRow Session(long front = 0, long controller = 0, long keyboardMouse = 0, long both = 0, long idle = 0, bool hooked = true, string? modules = null) => new()
|
||||
{
|
||||
SessionGuid = Guid.NewGuid(),
|
||||
GameId = 1,
|
||||
SnapshotId = 1,
|
||||
QpcEpoch = 0,
|
||||
QpcFrequency = 10_000_000,
|
||||
Mode = CaptureMode.Attach,
|
||||
ExitStatus = ExitStatus.Normal,
|
||||
StartedAt = _t0,
|
||||
EndedAt = _t0.AddMinutes(10),
|
||||
Tier = hooked ? CaptureTier.Hooked : CaptureTier.NotHooked,
|
||||
RuntimeModulesJson = modules,
|
||||
InputForegroundMs = front == 0 ? null : front,
|
||||
InputControllerMs = front == 0 ? null : controller,
|
||||
InputKeyboardMouseMs = front == 0 ? null : keyboardMouse,
|
||||
InputBothMs = front == 0 ? null : both,
|
||||
InputIdleMs = front == 0 ? null : idle,
|
||||
};
|
||||
|
||||
private static GameRow Game(string? support) => new()
|
||||
{
|
||||
Id = 1,
|
||||
Name = "A Game",
|
||||
Fingerprint = new() { ExePath = @"C:\Games\A\a.exe", SizeBytes = 1, MtimeUnixMs = 1 },
|
||||
HookEnabled = false,
|
||||
HookCrashCount = 0,
|
||||
AddedAt = _t0,
|
||||
UpdatedAt = _t0,
|
||||
ControllerSupport = support,
|
||||
};
|
||||
|
||||
[Theory]
|
||||
[InlineData("full", "Full - as Steam lists it")]
|
||||
[InlineData("partial", "Partial - as Steam lists it")]
|
||||
[InlineData("none", "Steam lists none")]
|
||||
[InlineData(null, "N/A - no store file on this PC describes this game")]
|
||||
[InlineData("a word a later release wrote", "N/A - no store file on this PC describes this game")]
|
||||
public void TheStoresWordIsShownAsTheStoresAndItsAbsenceAsNotKnown(string? stored, string shown)
|
||||
{
|
||||
using var culture = new CultureScope("en");
|
||||
|
||||
ControllerEvidence.StoreText(Game(stored)).Should().Be(shown);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TheInputLibrariesAreThoseOfTheNewestSessionMeasuredFromInside()
|
||||
{
|
||||
using var culture = new CultureScope("en");
|
||||
SessionRow[] sessions =
|
||||
[
|
||||
Session(hooked: false),
|
||||
Session(modules: """{"nvngx_dlss.dll":"3.7.10.0","XINPUT1_4.dll":"10.0.26100.1","xinput9_1_0.dll":null,"SDL2.dll":"2.30.0.0"}"""),
|
||||
Session(modules: """{"dinput8.dll":"10.0"}"""),
|
||||
];
|
||||
|
||||
ControllerEvidence.LibrariesText(sessions).Should().Be("SDL (SDL2.dll)" + Environment.NewLine + "XInput (XINPUT1_4.dll, xinput9_1_0.dll)");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ASessionThatLoadedNoneSaysSoAndAGameNeverMeasuredFromInsideIsNotKnown()
|
||||
{
|
||||
using var culture = new CultureScope("en");
|
||||
|
||||
ControllerEvidence.LibrariesText([Session(modules: """{"nvngx_dlss.dll":"3.7.10.0"}""")]).Should().Be("None seen in the last session measured from inside");
|
||||
ControllerEvidence.LibrariesText([Session(hooked: false, modules: """{"xinput1_4.dll":"1"}"""), Session(modules: null), Session(modules: "{ not json")])
|
||||
.Should().Be("N/A - known only from a session measured from inside the game", "a session that was not hooked takes no snapshot, and one with none stored says nothing");
|
||||
ControllerEvidence.LibrariesText([]).Should().Be("N/A - known only from a session measured from inside the game");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void HowAGameWasPlayedIsTheSharesOfTheTimeInFrontOverEverySessionThatRecordedIt()
|
||||
{
|
||||
using var culture = new CultureScope("en");
|
||||
SessionRow[] sessions =
|
||||
[
|
||||
Session(front: 600_000, controller: 500_000, keyboardMouse: 40_000, both: 10_000, idle: 50_000),
|
||||
Session(),
|
||||
Session(front: 400_000, controller: 330_000, keyboardMouse: 20_000, both: 0, idle: 50_000, hooked: false),
|
||||
];
|
||||
|
||||
ControllerEvidence.PlayedWithText(sessions).Should().Be("Controller 83.0% · keyboard and mouse 6.0% · both 1.0% · no input 10.0% - of the time in front, over 2 sessions");
|
||||
ControllerEvidence.PlayedWithText([sessions[0]]).Should().EndWith("over 1 session");
|
||||
ControllerEvidence.PlayedWithText([Session(), Session(hooked: false)]).Should().Be("N/A - no session has recorded it yet");
|
||||
ControllerEvidence.PlayedWithText([]).Should().Be("N/A - no session has recorded it yet");
|
||||
}
|
||||
|
||||
/// <summary>The input libraries ride the session's module snapshot and are this page's to show: the summary's Libraries line stays what it was.</summary>
|
||||
[Fact]
|
||||
public void TheSessionsLibrariesLineLeavesTheInputLibrariesOut()
|
||||
{
|
||||
using var culture = new CultureScope("en");
|
||||
|
||||
SessionSummaryViewModel.LoadedLibraries("""{"nvngx_dlss.dll":"3.7.10.0","xinput1_4.dll":"10.0","SDL3.dll":"3.2"}""", [])
|
||||
.Should().Contain("nvngx_dlss.dll").And.NotContain("xinput").And.NotContain("SDL3");
|
||||
SessionSummaryViewModel.LoadedLibraries("""{"xinput1_4.dll":"10.0"}""", []).Should().BeNull("a session that loaded only input libraries has no Libraries line");
|
||||
}
|
||||
|
||||
/// <summary>A file in Steam's format 41 with one record, for application 730, that lists <paramref name="support"/>.</summary>
|
||||
private static string AppInfoFile(string directory, string? support)
|
||||
{
|
||||
string[] keys = ["appinfo", "common", "controller_support"];
|
||||
byte[] Key(string name) => BitConverter.GetBytes(Array.IndexOf(keys, name));
|
||||
byte[] value = support is null ? [] : [0x01, .. Key("controller_support"), .. Encoding.UTF8.GetBytes(support), 0];
|
||||
byte[] tree = [0x00, .. Key("appinfo"), 0x00, .. Key("common"), .. value, 0x08, 0x08, 0x08];
|
||||
byte[] records = [.. BitConverter.GetBytes(0x07564429u), .. BitConverter.GetBytes(1u), .. new byte[8],
|
||||
.. BitConverter.GetBytes(730u), .. BitConverter.GetBytes((uint)(60 + tree.Length)), .. new byte[60], .. tree, .. BitConverter.GetBytes(0u)];
|
||||
BinaryPrimitives.WriteInt64LittleEndian(records.AsSpan(8), records.Length);
|
||||
string path = Path.Combine(directory, "appinfo.vdf");
|
||||
File.WriteAllBytes(path, [.. records, .. BitConverter.GetBytes((uint)keys.Length), .. keys.SelectMany(static k => Encoding.UTF8.GetBytes(k).Append((byte)0))]);
|
||||
return path;
|
||||
}
|
||||
|
||||
private static StoreControllerSupport Reader(ScratchLedger s, string? file, bool viewer = false, params StoreGame[] installed) => new(
|
||||
new StoreRecordsReader([new TestImages.Store("steam", [.. installed.Where(static g => string.Equals(g.Platform, "steam", StringComparison.Ordinal))]),
|
||||
new TestImages.Store("gog", [.. installed.Where(static g => string.Equals(g.Platform, "gog", StringComparison.Ordinal))])]),
|
||||
s.Games,
|
||||
viewer ? new UiMode(IsViewer: true, Path.GetTempPath()) : UiMode.Profile,
|
||||
() => file,
|
||||
new FixedClock(_t0));
|
||||
|
||||
[Fact]
|
||||
public async Task OpeningASteamGamesPageReadsWhatSteamsFileListsAndStoresIt()
|
||||
{
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
string folder = Directory.CreateTempSubdirectory("fl-steam-").FullName;
|
||||
try
|
||||
{
|
||||
GameRow game = await s.GameAsync("Counter", Path.Combine(folder, "common", "Counter", "game.exe"));
|
||||
var steam = new StoreGame("steam", "730", "Counter", Path.Combine(folder, "common", "Counter"), ExePath: null, Version: null);
|
||||
StoreControllerSupport reader = Reader(s, AppInfoFile(folder, "partial"), viewer: false, steam);
|
||||
|
||||
GameRow read = await reader.RefreshAsync(game, Ct);
|
||||
|
||||
read.ControllerSupport.Should().Be("partial");
|
||||
read.ControllerSupportSource.Should().Be(SteamAppInfo.Source);
|
||||
read.ControllerSupportAt.Should().Be(_t0);
|
||||
GameRow stored = (await s.Games.FindByIdAsync(game.Id, Ct))!;
|
||||
stored.ControllerSupport.Should().Be("partial");
|
||||
stored.ControllerSupportAt.Should().Be(_t0);
|
||||
stored.UpdatedAt.Should().Be(game.UpdatedAt, "nothing the user or the detection did changed");
|
||||
|
||||
// Steam's record changes: the page follows it. The same answer again writes nothing.
|
||||
GameRow again = await Reader(s, AppInfoFile(folder, null), viewer: false, steam).RefreshAsync(stored, Ct);
|
||||
again.ControllerSupport.Should().Be("none", "Steam knows the game and lists no support");
|
||||
(await Reader(s, AppInfoFile(folder, null), viewer: false, steam).RefreshAsync(again, Ct)).Should().BeSameAs(again);
|
||||
}
|
||||
finally
|
||||
{
|
||||
Directory.Delete(folder, recursive: true);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task AGameNoSteamRecordOwnsAViewerAndAFileThatCannotBeReadLeaveTheRowAsItWas()
|
||||
{
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
string folder = Directory.CreateTempSubdirectory("fl-steam-").FullName;
|
||||
try
|
||||
{
|
||||
string file = AppInfoFile(folder, "full");
|
||||
GameRow game = await s.GameAsync("Counter", Path.Combine(folder, "common", "Counter", "game.exe"));
|
||||
var steam = new StoreGame("steam", "730", "Counter", Path.Combine(folder, "common", "Counter"), ExePath: null, Version: null);
|
||||
var gog = new StoreGame("gog", "730", "Counter", Path.Combine(folder, "common", "Counter"), ExePath: null, Version: null);
|
||||
var other = new StoreGame("steam", "999", "Other", Path.Combine(folder, "common", "Counter"), ExePath: null, Version: null);
|
||||
var named = new StoreGame("steam", "not-a-number", "Counter", Path.Combine(folder, "common", "Counter"), ExePath: null, Version: null);
|
||||
|
||||
(await Reader(s, file).RefreshAsync(game, Ct)).Should().BeSameAs(game, "no store installed it");
|
||||
(await Reader(s, file, viewer: false, gog).RefreshAsync(game, Ct)).Should().BeSameAs(game, "another store's game: Steam's file is not asked about it");
|
||||
(await Reader(s, file, viewer: false, other).RefreshAsync(game, Ct)).Should().BeSameAs(game, "Steam's file has no record of that application");
|
||||
(await Reader(s, file, viewer: false, named).RefreshAsync(game, Ct)).Should().BeSameAs(game);
|
||||
(await Reader(s, file, viewer: true, steam).RefreshAsync(game, Ct)).Should().BeSameAs(game, "a viewer reads nothing of this PC (D52)");
|
||||
(await Reader(s, file: null, viewer: false, steam).RefreshAsync(game, Ct)).Should().BeSameAs(game, "Steam is not installed");
|
||||
(await Reader(s, Path.Combine(folder, "absent.vdf"), viewer: false, steam).RefreshAsync(game, Ct)).Should().BeSameAs(game, "a file that cannot be read says nothing");
|
||||
(await s.Games.FindByIdAsync(game.Id, Ct))!.ControllerSupport.Should().BeNull();
|
||||
}
|
||||
finally
|
||||
{
|
||||
Directory.Delete(folder, recursive: true);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task TheGamesPageLoadsWithTheStoresWordAndWithoutAReaderAsBefore()
|
||||
{
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
string folder = Directory.CreateTempSubdirectory("fl-steam-").FullName;
|
||||
try
|
||||
{
|
||||
GameRow game = await s.GameAsync("Counter", Path.Combine(folder, "common", "Counter", "game.exe"));
|
||||
var steam = new StoreGame("steam", "730", "Counter", Path.Combine(folder, "common", "Counter"), ExePath: null, Version: null);
|
||||
var library = new GameLibrary(s.Games, s.Sessions, s.Annotations, clock: null, Reader(s, AppInfoFile(folder, "full"), viewer: false, steam));
|
||||
|
||||
(await library.LoadAsync(game.Id, ct: Ct))!.Row.ControllerSupport.Should().Be("full");
|
||||
(await s.Library.LoadAsync(game.Id, ct: Ct))!.Row.ControllerSupport.Should().Be("full", "it was stored, and a library with no reader shows what the row holds");
|
||||
}
|
||||
finally
|
||||
{
|
||||
Directory.Delete(folder, recursive: true);
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class FixedClock(DateTimeOffset now) : TimeProvider
|
||||
{
|
||||
public override DateTimeOffset GetUtcNow() => now;
|
||||
}
|
||||
|
||||
/// <summary>The strings' language and the numbers' culture, for the length of one test.</summary>
|
||||
private sealed class CultureScope : IDisposable
|
||||
{
|
||||
private readonly CultureInfo? _strings = Strings.Culture;
|
||||
private readonly CultureInfo _numbers = CultureInfo.CurrentCulture;
|
||||
|
||||
public CultureScope(string culture)
|
||||
{
|
||||
Strings.Culture = CultureInfo.GetCultureInfo(culture);
|
||||
CultureInfo.CurrentCulture = CultureInfo.GetCultureInfo(culture);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Strings.Culture = _strings;
|
||||
CultureInfo.CurrentCulture = _numbers;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -158,11 +158,11 @@ public sealed class FgMixPresentationTests
|
||||
public void TheBarDrawsEachShareInProportionWithAGapBetweenTwoSegments()
|
||||
{
|
||||
FgMixSegment[] segments = [new(FgMixKind.Generated, 2.0, 0.25), new(FgMixKind.None, null, 0), new(FgMixKind.Generated, 4.0, 0.75)];
|
||||
IReadOnlyList<Rect> rects = FgMixBar.Layout(segments, 400 + FgMixBar.Gap, 14);
|
||||
IReadOnlyList<Rect> rects = FgMixBar.Layout(segments, 400 + ShareBar.Gap, 14);
|
||||
|
||||
rects[0].Should().Be(new Rect(0, 0, 100, 14));
|
||||
rects[1].Width.Should().Be(0, "a share of nothing draws nothing and takes no gap");
|
||||
rects[2].Should().Be(new Rect(100 + FgMixBar.Gap, 0, 300, 14));
|
||||
rects[2].Should().Be(new Rect(100 + ShareBar.Gap, 0, 300, 14));
|
||||
FgMixBar.Layout([new(FgMixKind.None, null, 1)], 12, 12).Should().Equal(new Rect(0, 0, 12, 12));
|
||||
FgMixBar.Layout([new(FgMixKind.None, null, 0)], 100, 14).Should().OnlyContain(static r => r.Width == 0);
|
||||
FgMixBar.Layout(segments, 0, 14).Should().OnlyContain(static r => r.Width == 0, "a bar not yet laid out");
|
||||
|
||||
@@ -787,7 +787,12 @@ public sealed class GameDetailViewModelTests
|
||||
new GameDetailRow("Product version", "1.0.2"),
|
||||
new GameDetailRow("Store", "Steam build 20374416"),
|
||||
new GameDetailRow("Engine", "Unreal Engine 5.3"),
|
||||
new GameDetailRow("Ships with", "DLSS: nvngx_dlss.dll 3.7.10.0" + Environment.NewLine + "XeSS: libxess.dll (no version)"));
|
||||
new GameDetailRow("Ships with", "DLSS: nvngx_dlss.dll 3.7.10.0" + Environment.NewLine + "XeSS: libxess.dll (no version)"),
|
||||
// 0.1.0-beta.50 (D163): the three pieces of evidence for "supports controllers" are always there, each
|
||||
// saying what it knows - here, nothing yet.
|
||||
new GameDetailRow("Controller support (store)", "N/A - no store file on this PC describes this game"),
|
||||
new GameDetailRow("Input libraries loaded", "N/A - known only from a session measured from inside the game"),
|
||||
new GameDetailRow("Usually played with", "N/A - no session has recorded it yet"));
|
||||
vm.HookToggleEnabled.Should().BeFalse("turning hooking on could only be refused");
|
||||
vm.NotX64Text.Should().Contain("32-bit (x86)");
|
||||
|
||||
@@ -797,7 +802,9 @@ public sealed class GameDetailViewModelTests
|
||||
vm.HookToggleEnabled.Should().BeTrue("a switch that is on can be turned off whatever the file is");
|
||||
|
||||
(GameDetailViewModel unread, _, _, _, _) = await BuildAsync(s, fresh.Id);
|
||||
unread.Details.Should().ContainSingle().Which.Should().Be(new GameDetailRow("Runs as", Strings.GameDetail_Details_NotRead));
|
||||
// The file facts are one row; the three controller rows are there whether the files were read or not.
|
||||
unread.Details.Should().HaveCount(4);
|
||||
unread.Details[0].Should().Be(new GameDetailRow("Runs as", Strings.GameDetail_Details_NotRead));
|
||||
unread.NotX64Text.Should().BeNull("not read is not known 32-bit");
|
||||
unread.HookToggleEnabled.Should().BeTrue();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,367 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using FluentAssertions;
|
||||
using FrameLedger.App.Charts;
|
||||
using FrameLedger.App.Services;
|
||||
using FrameLedger.App.ViewModels;
|
||||
using FrameLedger.Application.Persistence;
|
||||
using FrameLedger.Application.Recording;
|
||||
using FrameLedger.Domain.Input;
|
||||
using FrameLedger.Infrastructure.Persistence;
|
||||
|
||||
namespace FrameLedger.App.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// A session's input series as the charts read them (0.1.0-beta.50): the series decoded with their gaps, the marks made
|
||||
/// of them, the two charts, the marks on the frame-time chart, the summary's view model over a stored session, the two
|
||||
/// trend metrics and the export's line. Over <see cref="InputFixtures"/> - synthetic; no controller was read.
|
||||
/// </summary>
|
||||
[Collection(StringsCultureCollection.Name)]
|
||||
public sealed class InputChartsTests
|
||||
{
|
||||
private static CancellationToken Ct => TestContext.Current.CancellationToken;
|
||||
|
||||
private sealed class NoOverride : ITriStateOverridePrompt
|
||||
{
|
||||
public Task<TriStateOverrideChoice?> AskAsync(TriStateChipModel chip, CancellationToken ct = default) =>
|
||||
Task.FromResult<TriStateOverrideChoice?>(null);
|
||||
}
|
||||
|
||||
private sealed class NoSaver : IFileSaver
|
||||
{
|
||||
public string? PickSavePath(string filter, string suggestedName) => null;
|
||||
}
|
||||
|
||||
private sealed class NoStrip : IMessageStrip
|
||||
{
|
||||
public void Info(string title, string body)
|
||||
{
|
||||
}
|
||||
|
||||
public void Success(string title, string body)
|
||||
{
|
||||
}
|
||||
|
||||
public void Warn(string title, string body)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private static SessionSummaryViewModel Summary(ScratchLedger s) =>
|
||||
new(s.Sessions, s.Games, s.Annotations, new SqliteHardwareSnapshotRepository(s.Db), new SessionSeriesLoader(s.Sessions), new NoOverride(), new NoSaver(), new NoStrip());
|
||||
|
||||
[Fact]
|
||||
public void TheSeriesAreDecodedOnTheSensorsClockWithTheirGapsKept()
|
||||
{
|
||||
InputSeries series = InputSeries.Decode(InputFixtures.Blobs())!;
|
||||
|
||||
series.TimesS.Should().Equal(0, 1, 2, 3, 4, 5, 6, 7);
|
||||
series.Class.Take(6).Should().Equal(1f, 1f, 3f, 2f, 2f, 0f);
|
||||
float.IsNaN(series.Class[6]).Should().BeTrue("the game was not in front in the seventh second, and that is kept");
|
||||
series.Devices.Select(static d => d.Index).Should().Equal(1, 2);
|
||||
series.Devices[0].Battery.Should().NotBeNull();
|
||||
float.IsNaN(series.Devices[1].Active[0]).Should().BeTrue("the second controller was not connected yet");
|
||||
|
||||
InputSeries.Decode([]).Should().BeNull("a session that stored no input series has none to draw");
|
||||
InputSeries.Decode([.. InputFixtures.Blobs().Where(static b => !string.Equals(b.Series, InputSessionBuilder.ClassSeries, StringComparison.Ordinal))])
|
||||
.Should().BeNull();
|
||||
|
||||
// With no clock the stored rate is the fallback, as for every other series.
|
||||
InputSeries.Decode([.. InputFixtures.Blobs().Skip(1)])!.TimesS.Should().Equal(0, 1, 2, 3, 4, 5, 6, 7);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TheMarksAreTheConnectionsTheDropsAndTheBatteriesThatFellToLow()
|
||||
{
|
||||
InputSeries series = InputSeries.Decode(InputFixtures.Blobs())!;
|
||||
|
||||
series.Events(InputFixtures.Record()).Should().Equal(
|
||||
new InputEvent(2, InputEventKind.Connected, 2),
|
||||
new InputEvent(4, InputEventKind.Disconnected, 2),
|
||||
new InputEvent(5, InputEventKind.BatteryLow, 1),
|
||||
new InputEvent(6, InputEventKind.Connected, 2),
|
||||
new InputEvent(6, InputEventKind.BatteryLow, 2));
|
||||
|
||||
// The row counted one connection for a controller whose series rises twice: the first rise is the session's start.
|
||||
InputDevicesRecord oneConnect = InputFixtures.Record() with { Devices = [.. InputFixtures.Record().Devices.Select(static d => d.Index == 2 ? d with { Connects = 1 } : d)] };
|
||||
series.Events(oneConnect).Where(static e => e.Kind == InputEventKind.Connected).Should().Equal(new InputEvent(6, InputEventKind.Connected, 2));
|
||||
|
||||
// With no stored row: a controller there on the first tick did not connect, and no battery scale means no low mark.
|
||||
series.Events(null).Select(static e => (e.TimeS, e.Kind, e.Device)).Should().Equal(
|
||||
(2d, InputEventKind.Connected, 2), (4d, InputEventKind.Disconnected, 2), (6d, InputEventKind.Connected, 2));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AFlappingConnectionIsCappedAndAFourLevelBatteryIsDrawnAtThirds()
|
||||
{
|
||||
float[] flapping = [.. Enumerable.Range(0, 400).Select(static i => i % 2 == 0 ? float.NaN : 0f)];
|
||||
var series = new InputSeries([.. Enumerable.Range(0, 400).Select(static i => (double)i)], new float[400], [new InputDeviceSeries(1, flapping, null)]);
|
||||
|
||||
series.Events(null).Should().HaveCount(InputSeries.MaxEvents, "a chart is not buried under its own marks; the table has the counts");
|
||||
Enumerable.Range(0, 4).Select(static l => InputSeries.ToPercent(l, BatteryScale.FourLevels)).Should().Equal(0, 33, 67, 100);
|
||||
InputSeries.ToPercent(57f, BatteryScale.Percent).Should().Be(57);
|
||||
InputSeries.ToPercent(140f, BatteryScale.Percent).Should().Be(100);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task TheTwoChartsDrawWhatTheSessionStoredAndSayWhenItStoredNothing()
|
||||
{
|
||||
InputSeries series = InputSeries.Decode(InputFixtures.Blobs())!;
|
||||
IReadOnlyList<InputEvent> events = series.Events(InputFixtures.Record());
|
||||
|
||||
(int points, int marks, int empty, int lines, int noBattery) = await PagesLoadTests.OnStaAsync(() =>
|
||||
{
|
||||
var timeline = new InputTimelineChart();
|
||||
timeline.Show(series, events);
|
||||
int drawn = timeline.DrawnPoints;
|
||||
int drawnMarks = timeline.DrawnEvents;
|
||||
timeline.Show(null, []);
|
||||
var battery = new InputBatteryChart();
|
||||
battery.Show(series, InputFixtures.Record());
|
||||
int drawnLines = battery.DrawnLines;
|
||||
battery.Show(series, null);
|
||||
return (drawn, drawnMarks, timeline.DrawnPoints, drawnLines, battery.DrawnLines);
|
||||
});
|
||||
|
||||
points.Should().Be(7, "seven of the eight seconds had the game in front");
|
||||
marks.Should().Be(5);
|
||||
empty.Should().Be(0);
|
||||
lines.Should().Be(2, "both controllers reported a battery");
|
||||
noBattery.Should().Be(0, "without the stored scale a level cannot be put on the axis, so nothing is");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task TheFrameTimeChartCarriesTheMarksOnlyWhereTheFramesPlaceOnTheClockIsKnown()
|
||||
{
|
||||
InputSeries input = InputSeries.Decode(InputFixtures.Blobs())!;
|
||||
IReadOnlyList<InputEvent> events = input.Events(InputFixtures.Record());
|
||||
SessionSeries Frames(double? offset) => new()
|
||||
{
|
||||
TimesS = [.. Enumerable.Range(0, 60).Select(static i => i * 0.1)],
|
||||
FrameTimesMs = [.. Enumerable.Repeat(16.7f, 60)],
|
||||
Generated = new bool[60],
|
||||
Gap = new bool[60],
|
||||
AppTimesS = [.. Enumerable.Range(0, 60).Select(static i => i * 0.1)],
|
||||
AppFrameTimesMs = [.. Enumerable.Repeat(16.7, 60)],
|
||||
AppPresentIndex = [.. Enumerable.Range(0, 60)],
|
||||
Segments = [],
|
||||
Sensors = [],
|
||||
SensorsAligned = offset is not null,
|
||||
SensorOffsetS = offset,
|
||||
};
|
||||
|
||||
(int aligned, int shifted, int hidden, int unaligned) = await PagesLoadTests.OnStaAsync(() =>
|
||||
{
|
||||
var chart = new FrametimeChart();
|
||||
chart.SetInputEvents(events, show: true);
|
||||
chart.Show(Frames(0), displayed: false, sensors: false);
|
||||
int atZero = chart.DrawnInputEvents;
|
||||
chart.Show(Frames(3), displayed: false, sensors: false);
|
||||
int fromThree = chart.DrawnInputEvents;
|
||||
chart.SetInputEvents(events, show: false);
|
||||
int off = chart.DrawnInputEvents;
|
||||
chart.SetInputEvents(events, show: true);
|
||||
chart.Show(Frames(null), displayed: false, sensors: false);
|
||||
return (atZero, fromThree, off, chart.DrawnInputEvents);
|
||||
});
|
||||
|
||||
aligned.Should().Be(3, "the frames last 5.9 s: the marks at 2 s, 4 s and 5 s are on the axis, the two at 6 s are past its end");
|
||||
shifted.Should().Be(4, "with the first present three seconds in, the marks at 4, 5, 6 and 6 s are");
|
||||
hidden.Should().Be(0);
|
||||
unaligned.Should().Be(0, "a session that does not say where its frames sit on the sensors' clock draws no mark out of step");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TheGapNoteSpeaksOfTheMarksWhenTheyAreWhatRunsAhead()
|
||||
{
|
||||
CultureInfo? previous = Strings.Culture;
|
||||
Strings.Culture = CultureInfo.GetCultureInfo("en");
|
||||
try
|
||||
{
|
||||
var series = new SessionSeries
|
||||
{
|
||||
TimesS = [0, 0.1, 0.2],
|
||||
FrameTimesMs = [0, 16.7f, 0],
|
||||
Generated = new bool[3],
|
||||
Gap = [true, false, true],
|
||||
AppTimesS = [0.1],
|
||||
AppFrameTimesMs = [16.7],
|
||||
AppPresentIndex = [1],
|
||||
Segments = [],
|
||||
Sensors = [],
|
||||
SensorsAligned = true,
|
||||
SensorOffsetS = 0,
|
||||
};
|
||||
|
||||
FrametimeChart.NoteFor(series, displayed: false, sensors: false).Should().BeEmpty();
|
||||
FrametimeChart.NoteFor(series, displayed: false, sensors: false, marks: true).Should().Contain("the controller marks run ahead");
|
||||
FrametimeChart.NoteFor(series, displayed: false, sensors: true, marks: true).Should().Contain("the sensor lines run ahead").And.NotContain("controller marks");
|
||||
}
|
||||
finally
|
||||
{
|
||||
Strings.Culture = previous;
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task TheSummaryShowsTheBlockInBothTiersAndSaysWhyASessionHasNone()
|
||||
{
|
||||
CultureInfo? previous = Strings.Culture;
|
||||
Strings.Culture = CultureInfo.GetCultureInfo("en");
|
||||
try
|
||||
{
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
GameRow game = await s.GameAsync("Alpha");
|
||||
long hooked = await s.SessionWithFramesAsync(game.Id, DateTimeOffset.UtcNow, frames: 600, spikeEvery: 0, shape: InputFixtures.With, sensors: InputFixtures.BlobsWithSensors());
|
||||
long tier2 = await s.SessionAsync(game.Id, DateTimeOffset.UtcNow.AddHours(-1), hooked: false, sensors: InputFixtures.Blobs(), shape: InputFixtures.With);
|
||||
long older = await s.SessionAsync(game.Id, DateTimeOffset.UtcNow.AddHours(-2));
|
||||
|
||||
SessionSummaryViewModel vm = Summary(s);
|
||||
await vm.LoadAsync(hooked, Ct);
|
||||
vm.HasInput.Should().BeTrue();
|
||||
vm.InputRows.Select(static r => r.Label).Should().Equal("Controller", "Keyboard and mouse", "Both at once", "No input");
|
||||
vm.InputSegments.Should().HaveCount(4);
|
||||
vm.InputName.Should().StartWith("Share of the time in front");
|
||||
vm.InputControllers.Should().HaveCount(2);
|
||||
vm.HasInputControllers.Should().BeTrue();
|
||||
vm.InputNoControllers.Should().BeNull();
|
||||
vm.InputMakers.Should().Contain("PlayStation 80.0%");
|
||||
vm.InputNotes.Should().BeNull();
|
||||
vm.InputMissing.Should().BeNull();
|
||||
vm.HasInputCharts.Should().BeTrue();
|
||||
vm.HasInputBattery.Should().BeTrue();
|
||||
vm.InputEvents.Should().HaveCount(5);
|
||||
vm.HasInputEvents.Should().BeTrue("the session has frames and says where they sit on the sensors' clock");
|
||||
vm.ShowInputEvents.Should().BeTrue();
|
||||
|
||||
await vm.LoadAsync(tier2, Ct);
|
||||
vm.HasInput.Should().BeTrue("what a session was played with is read from outside the game (D155): a session that was not hooked has it");
|
||||
vm.InputControllers.Should().HaveCount(2);
|
||||
vm.HasInputCharts.Should().BeTrue();
|
||||
vm.HasInputEvents.Should().BeFalse("there is no frame-time chart to carry the marks; the input timeline has them");
|
||||
|
||||
await vm.LoadAsync(older, Ct);
|
||||
vm.HasInput.Should().BeFalse();
|
||||
vm.InputRows.Should().BeEmpty();
|
||||
vm.HasInputControllers.Should().BeFalse();
|
||||
vm.InputNoControllers.Should().BeNull("nothing was read, so nothing is said about controllers");
|
||||
vm.HasInputCharts.Should().BeFalse();
|
||||
vm.InputSeries.Should().BeNull();
|
||||
vm.InputMissing.Should().StartWith("Not recorded for this session");
|
||||
}
|
||||
finally
|
||||
{
|
||||
Strings.Culture = previous;
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ASessionReadWithNoControllerSaysNoneWasConnected()
|
||||
{
|
||||
CultureInfo? previous = Strings.Culture;
|
||||
Strings.Culture = CultureInfo.GetCultureInfo("en");
|
||||
try
|
||||
{
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
GameRow game = await s.GameAsync("Alpha");
|
||||
long id = await s.SessionAsync(game.Id, DateTimeOffset.UtcNow, shape: static r => r with
|
||||
{
|
||||
InputObservedMs = 60_000,
|
||||
InputForegroundMs = 60_000,
|
||||
InputKeyboardMouseMs = 50_000,
|
||||
InputIdleMs = 10_000,
|
||||
InputControllerMs = 0,
|
||||
InputBothMs = 0,
|
||||
InputMethodSwitches = 0,
|
||||
InputDevicesJson = InputDevicesRecord.ToJson(new InputDevicesRecord { Health = new Application.Input.InputHealth { RawInputRegistered = true, XInputAvailable = true, LastInputAvailable = true } }),
|
||||
});
|
||||
|
||||
SessionSummaryViewModel vm = Summary(s);
|
||||
await vm.LoadAsync(id, Ct);
|
||||
|
||||
vm.HasInput.Should().BeTrue();
|
||||
vm.InputRows[1].Share.Should().Be("83.3%");
|
||||
vm.HasInputControllers.Should().BeFalse();
|
||||
vm.InputNoControllers.Should().Be("No controller was connected during this session.");
|
||||
vm.InputMakers.Should().BeNull();
|
||||
vm.HasInputCharts.Should().BeFalse("this row was written without its series");
|
||||
}
|
||||
finally
|
||||
{
|
||||
Strings.Culture = previous;
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TheTwoTrendMetricsAreSharesOfTheTimeInFrontInEitherTier()
|
||||
{
|
||||
SessionRow hooked = InputFixtures.With(Row(Domain.Sessions.CaptureTier.Hooked));
|
||||
SessionRow tier2 = InputFixtures.With(Row(Domain.Sessions.CaptureTier.NotHooked));
|
||||
|
||||
TrendSeriesBuilder.ValueOf(hooked, TrendMetric.ControllerShare).Should().BeApproximately(42.857, 0.001);
|
||||
TrendSeriesBuilder.ValueOf(tier2, TrendMetric.KeyboardMouseShare).Should().BeApproximately(28.571, 0.001);
|
||||
TrendSeriesBuilder.ValueOf(Row(Domain.Sessions.CaptureTier.Hooked), TrendMetric.ControllerShare).Should().BeNull("a session that recorded nothing has no point (FR-4.9)");
|
||||
TrendSeriesBuilder.ValueOf(hooked with { InputForegroundMs = 0 }, TrendMetric.ControllerShare).Should().BeNull("the game was never in front");
|
||||
TrendSeriesBuilder.Counts(tier2, TrendMetric.ControllerShare).Should().BeTrue();
|
||||
TrendSeriesBuilder.IsInputMetric(TrendMetric.KeyboardMouseShare).Should().BeTrue();
|
||||
TrendSeriesBuilder.IsInputMetric(TrendMetric.DisplayWindowedShare).Should().BeFalse();
|
||||
TrendSeriesBuilder.IsPartial(hooked with { SettingsChangedMidSession = true }, TrendMetric.ControllerShare).Should().BeFalse("what a session was played with is the whole session's");
|
||||
TrendSeriesBuilder.UnitOf(TrendMetric.ControllerShare).Should().StartWith("%");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task TheCsvHeaderCarriesTheInputLineAndCompareHasTheTwoRows()
|
||||
{
|
||||
CultureInfo? previous = Strings.Culture;
|
||||
CultureInfo previousCulture = CultureInfo.CurrentCulture;
|
||||
Strings.Culture = CultureInfo.GetCultureInfo("en");
|
||||
CultureInfo.CurrentCulture = CultureInfo.GetCultureInfo("en");
|
||||
try
|
||||
{
|
||||
await using ScratchLedger s = await ScratchLedger.OpenAsync();
|
||||
GameRow game = await s.GameAsync("Alpha");
|
||||
long with = await s.SessionAsync(game.Id, DateTimeOffset.UtcNow, hooked: false, shape: InputFixtures.With);
|
||||
long without = await s.SessionAsync(game.Id, DateTimeOffset.UtcNow.AddHours(-1), hooked: false);
|
||||
SessionRow played = (await s.Sessions.FindByIdAsync(with, Ct))!;
|
||||
SessionRow bare = (await s.Sessions.FindByIdAsync(without, Ct))!;
|
||||
|
||||
using var writer = new StringWriter();
|
||||
SessionExporter.WriteCsv(writer, played, game, null, [], null);
|
||||
writer.ToString().Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries)
|
||||
.Should().Contain(static l => l.StartsWith("# input: observed_ms 8000; foreground_ms 7000; controller_ms 3000;", StringComparison.Ordinal));
|
||||
using var none = new StringWriter();
|
||||
SessionExporter.WriteCsv(none, bare, game, null, [], null);
|
||||
none.ToString().Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries).Should().Contain("# input: N/A");
|
||||
|
||||
// The JSON export is the stored row (Privacy Policy 3A): the totals and the controllers ride it as they are.
|
||||
played.InputDevicesJson.Should().Contain("DualSense Wireless Controller").And.NotContainAny("serial", "address", "path");
|
||||
|
||||
InputPresentation.SharesText(played).Should().Be("Controller 42.9% · keyboard and mouse 28.6% · both 14.3% · no input 14.3%");
|
||||
InputPresentation.SharesText(bare).Should().Be("N/A");
|
||||
}
|
||||
finally
|
||||
{
|
||||
Strings.Culture = previous;
|
||||
CultureInfo.CurrentCulture = previousCulture;
|
||||
}
|
||||
}
|
||||
|
||||
private static SessionRow Row(Domain.Sessions.CaptureTier tier) => new()
|
||||
{
|
||||
SessionGuid = Guid.NewGuid(),
|
||||
GameId = 1,
|
||||
SnapshotId = 1,
|
||||
StartedAt = DateTimeOffset.UnixEpoch,
|
||||
EndedAt = DateTimeOffset.UnixEpoch.AddMinutes(10),
|
||||
QpcEpoch = 0,
|
||||
QpcFrequency = 1,
|
||||
Tier = tier,
|
||||
Mode = Domain.Sessions.CaptureMode.Launch,
|
||||
ExitStatus = Domain.Sessions.ExitStatus.Normal,
|
||||
FrameCount = 0,
|
||||
FgMode = "na",
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using FrameLedger.Application.Input;
|
||||
using FrameLedger.Application.Persistence;
|
||||
using FrameLedger.Application.Recording;
|
||||
using FrameLedger.Infrastructure.Blobs;
|
||||
|
||||
namespace FrameLedger.App.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// Eight seconds of a session played with two controllers (0.1.0-beta.50), written as the recorder writes them: the
|
||||
/// row's totals, <c>sessions.input_devices</c> and the <c>input.*</c> series. Synthetic - no controller was read to
|
||||
/// make it, which is what every test over it can and cannot show.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Second by second: a controller, a controller, both, keyboard and mouse twice, no input, the game not in front, a
|
||||
/// controller. Controller 1 (a DualSense over Bluetooth) is there throughout and its battery falls from 40 % to 10 %
|
||||
/// at the sixth second. Controller 2 (an Xbox pad on a wireless adapter) connects at the third second, drops at the
|
||||
/// fifth, comes back at the seventh with its battery fallen from medium to low.
|
||||
/// </remarks>
|
||||
internal static class InputFixtures
|
||||
{
|
||||
private const float _n = float.NaN;
|
||||
|
||||
public static SensorBlob[] Blobs() =>
|
||||
[
|
||||
Blob("t_ms", SeriesCodec.EncodeFloat32([0f, 1000f, 2000f, 3000f, 4000f, 5000f, 6000f, 7000f])),
|
||||
Blob(InputSessionBuilder.ClassSeries, SeriesCodec.EncodeSparseFloat32([1f, 1f, 3f, 2f, 2f, 0f, _n, 1f])),
|
||||
Blob(InputSessionBuilder.ActiveSeries(1), SeriesCodec.EncodeSparseFloat32([1f, 1f, 1f, 0f, 0f, 0f, 0f, 1f])),
|
||||
Blob(InputSessionBuilder.BatterySeries(1), SeriesCodec.EncodeSparseFloat32([40f, 40f, 40f, 30f, 20f, 10f, 10f, 10f])),
|
||||
Blob(InputSessionBuilder.ActiveSeries(2), SeriesCodec.EncodeSparseFloat32([_n, _n, 0.5f, 0f, _n, _n, 0f, 0f])),
|
||||
Blob(InputSessionBuilder.BatterySeries(2), SeriesCodec.EncodeSparseFloat32([_n, _n, 2f, 2f, _n, _n, 1f, 1f])),
|
||||
];
|
||||
|
||||
/// <summary>The same with eight ticks of <c>gpu_temp</c>, for a session that has frames to draw them over.</summary>
|
||||
public static SensorBlob[] BlobsWithSensors() =>
|
||||
[.. Blobs(), Blob("gpu_temp", SeriesCodec.EncodeFloat32([60f, 61f, 62f, 63f, 64f, 65f, 66f, 67f]))];
|
||||
|
||||
public static InputDevicesRecord Record() => new()
|
||||
{
|
||||
Devices =
|
||||
[
|
||||
new InputDeviceRecord
|
||||
{
|
||||
Index = 1,
|
||||
Family = "playstation",
|
||||
VendorId = 0x054C,
|
||||
ProductId = 0x0CE6,
|
||||
Model = "DualSense Wireless Controller",
|
||||
Connection = "bluetooth",
|
||||
ConnectedMs = 8000,
|
||||
ActiveMs = 4000,
|
||||
Battery = new InputBatteryRecord
|
||||
{
|
||||
Scale = "percent",
|
||||
States = [new InputBatteryStateRecord("discharging", 40, 3000), new InputBatteryStateRecord("discharging", 10, 3000)],
|
||||
First = 40,
|
||||
Last = 10,
|
||||
DrainPercentPerHour = 13.5,
|
||||
},
|
||||
},
|
||||
new InputDeviceRecord
|
||||
{
|
||||
Index = 2,
|
||||
Family = "xbox",
|
||||
VendorId = 0x045E,
|
||||
ProductId = 0x0B12,
|
||||
Model = "Xbox Wireless Controller",
|
||||
Connection = "wireless",
|
||||
XInputSlot = 0,
|
||||
ConnectedMs = 4000,
|
||||
ActiveMs = 500,
|
||||
Connects = 2,
|
||||
Disconnects = 1,
|
||||
Battery = new InputBatteryRecord
|
||||
{
|
||||
Scale = "levels",
|
||||
States = [new InputBatteryStateRecord("discharging", 2, 2000), new InputBatteryStateRecord("discharging", 1, 2000)],
|
||||
First = 2,
|
||||
Last = 1,
|
||||
},
|
||||
},
|
||||
],
|
||||
Families = [new InputFamilyRecord("playstation", 4000, 0.8), new InputFamilyRecord("xbox", 1000, 0.2)],
|
||||
FamilySwitches = 2,
|
||||
Health = new InputHealth { RawInputRegistered = true, XInputAvailable = true, LastInputAvailable = true, RawReports = 480, XInputReads = 60, Slices = 80 },
|
||||
};
|
||||
|
||||
/// <summary>A row with the fixture's totals: read for 8 s, in front for 7 s - 3 s a controller, 2 s keyboard and mouse, 1 s both, 1 s nothing.</summary>
|
||||
public static SessionRow With(SessionRow row) => row with
|
||||
{
|
||||
InputObservedMs = 8000,
|
||||
InputForegroundMs = 7000,
|
||||
InputControllerMs = 3000,
|
||||
InputKeyboardMouseMs = 2000,
|
||||
InputBothMs = 1000,
|
||||
InputIdleMs = 1000,
|
||||
InputMethodSwitches = 2,
|
||||
InputSource = "rawinput+xinput+lastinput",
|
||||
InputDevicesJson = InputDevicesRecord.ToJson(Record()),
|
||||
};
|
||||
|
||||
private static SensorBlob Blob(string series, byte[] data) => new() { Series = series, Hz = 1, Codec = SeriesCodec.Tag, Data = data };
|
||||
}
|
||||
@@ -0,0 +1,257 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Globalization;
|
||||
using FluentAssertions;
|
||||
using FrameLedger.App.Charts;
|
||||
using FrameLedger.App.Controls;
|
||||
using FrameLedger.App.Services;
|
||||
using FrameLedger.App.ViewModels;
|
||||
using FrameLedger.Application.Input;
|
||||
using FrameLedger.Application.Persistence;
|
||||
using FrameLedger.Application.Recording;
|
||||
using FrameLedger.Domain.Input;
|
||||
using FrameLedger.Domain.Sessions;
|
||||
|
||||
namespace FrameLedger.App.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// The summary's "Played with" block (0.1.0-beta.50, D155-D163): the row's stored totals as four rows and a bar, the
|
||||
/// session's controllers with the battery state held longest, each maker's share, what the reader could not do, and why
|
||||
/// a session has none - all over a synthetic session; no controller was read to make it.
|
||||
/// </summary>
|
||||
[Collection(StringsCultureCollection.Name)]
|
||||
public sealed class InputPresentationTests
|
||||
{
|
||||
private static T In<T>(string culture, Func<T> f)
|
||||
{
|
||||
CultureInfo? previous = Strings.Culture;
|
||||
CultureInfo previousCulture = CultureInfo.CurrentCulture;
|
||||
try
|
||||
{
|
||||
Strings.Culture = CultureInfo.GetCultureInfo(culture);
|
||||
CultureInfo.CurrentCulture = CultureInfo.GetCultureInfo(culture);
|
||||
return f();
|
||||
}
|
||||
finally
|
||||
{
|
||||
Strings.Culture = previous;
|
||||
CultureInfo.CurrentCulture = previousCulture;
|
||||
}
|
||||
}
|
||||
|
||||
private static SessionRow Bare(CaptureTier tier = CaptureTier.Hooked, string? notes = null) => new()
|
||||
{
|
||||
SessionGuid = Guid.NewGuid(),
|
||||
GameId = 1,
|
||||
SnapshotId = 1,
|
||||
StartedAt = DateTimeOffset.UnixEpoch,
|
||||
EndedAt = DateTimeOffset.UnixEpoch.AddMinutes(10),
|
||||
QpcEpoch = 0,
|
||||
QpcFrequency = 1,
|
||||
Tier = tier,
|
||||
Mode = CaptureMode.Launch,
|
||||
ExitStatus = ExitStatus.Normal,
|
||||
FrameCount = tier == CaptureTier.Hooked ? 1000 : 0,
|
||||
FgMode = "none",
|
||||
CaptureNotes = notes,
|
||||
};
|
||||
|
||||
private static SessionRow Played(CaptureTier tier = CaptureTier.Hooked) => InputFixtures.With(Bare(tier));
|
||||
|
||||
[Fact]
|
||||
public void TheFourClassesAreRowsInTheBarsOrderEachWithItsShareOfTheTimeInFront() => In("en", () =>
|
||||
{
|
||||
IReadOnlyList<InputClassRowModel> rows = InputPresentation.Rows(Played());
|
||||
|
||||
rows.Select(static r => r.Label).Should().Equal("Controller", "Keyboard and mouse", "Both at once", "No input");
|
||||
rows.Select(static r => r.Share).Should().Equal("42.9%", "28.6%", "14.3%", "14.3%");
|
||||
rows.Select(static r => r.Duration).Should().Equal("0m 03s", "0m 02s", "0m 01s", "0m 01s");
|
||||
rows.Select(static r => r.Segment.Class).Should().Equal(InputClass.Controller, InputClass.KeyboardMouse, InputClass.Both, InputClass.None);
|
||||
rows.Sum(static r => r.Segment.Share).Should().BeApproximately(1, 1e-9, "the four classes are the whole time in front");
|
||||
rows[0].Swatch.Should().Equal(new InputShareSegment(InputClass.Controller, 1));
|
||||
rows[0].ToString().Should().Be("Controller: 42.9%, 0m 03s");
|
||||
InputPresentation.AccessibleName(rows).Should().Be(
|
||||
"Share of the time in front by what the game was played with: Controller 42.9%, Keyboard and mouse 28.6%, Both at once 14.3%, No input 14.3%");
|
||||
InputPresentation.Context(Played()).Should().Be("Read for 0m 08s; the game was in front for 0m 07s. The shares are of the time in front.");
|
||||
InputPresentation.Switches(Played()).Should().Be("Changes between a controller and the keyboard and mouse: 2");
|
||||
InputPresentation.Missing(Played()).Should().BeNull();
|
||||
return 0;
|
||||
});
|
||||
|
||||
[Fact]
|
||||
public void ATierTwoSessionHasTheSameBlock() => In("en", () =>
|
||||
{
|
||||
// Read from outside the game (D155): a session that was not hooked is played with something too.
|
||||
InputPresentation.Rows(Played(CaptureTier.NotHooked)).Should().HaveCount(4);
|
||||
InputPresentation.SharesText(Played(CaptureTier.NotHooked)).Should().Be("Controller 42.9% · keyboard and mouse 28.6% · both 14.3% · no input 14.3%");
|
||||
return 0;
|
||||
});
|
||||
|
||||
[Fact]
|
||||
public void ASessionWithNoShareSaysWhy() => In("en", () =>
|
||||
{
|
||||
InputPresentation.Rows(Bare()).Should().BeEmpty();
|
||||
InputPresentation.Context(Bare()).Should().BeNull();
|
||||
InputPresentation.Switches(Bare()).Should().BeNull();
|
||||
InputPresentation.SharesText(Bare()).Should().Be("N/A");
|
||||
InputPresentation.ControllersText(Bare()).Should().Be("N/A");
|
||||
InputPresentation.Missing(Bare()).Should().Be("Not recorded for this session: Settings ▸ Controllers and input was off, or the session is from before 0.1.0-beta.50.");
|
||||
|
||||
// Held because the Privacy Policy that describes the reading was not accepted yet (D156): the row says so.
|
||||
InputPresentation.Missing(Bare(notes: "reason=x;" + CaptureNotes.InputHeldSlot))
|
||||
.Should().Be("Not read in this session: the Privacy Policy that describes this reading had not been accepted on this PC yet.");
|
||||
|
||||
// Read, and the game never in front: no share is made up out of nothing.
|
||||
SessionRow background = Bare() with { InputObservedMs = 5000, InputForegroundMs = 0, InputDevicesJson = InputDevicesRecord.ToJson(new InputDevicesRecord()) };
|
||||
InputPresentation.Rows(background).Should().BeEmpty();
|
||||
InputPresentation.Missing(background).Should().Be("Read, but the game's window was never in front while it was, so there is no share to show.");
|
||||
InputPresentation.ControllersText(background).Should().Be("none");
|
||||
return 0;
|
||||
});
|
||||
|
||||
[Fact]
|
||||
public void AControllerIsARowWithItsConnectionItsTimesItsEventsAndItsBattery() => In("en", () =>
|
||||
{
|
||||
IReadOnlyList<InputControllerRowModel> rows = InputPresentation.Controllers(InputFixtures.Record());
|
||||
|
||||
rows.Should().HaveCount(2);
|
||||
rows[0].Should().Be(new InputControllerRowModel("DualSense Wireless Controller", "Bluetooth", "0m 04s", "0m 08s", "0 / 0",
|
||||
"Longest: on battery at 40% for 0m 03s · 40% → 10% · 13.5% an hour"));
|
||||
rows[1].Should().Be(new InputControllerRowModel("Xbox Wireless Controller", "Wireless adapter", "0m 00s", "0m 04s", "2 / 1",
|
||||
"Longest: on battery at medium for 0m 02s · medium → low"));
|
||||
rows[1].ToString().Should().Be("Xbox Wireless Controller: Wireless adapter, In use: 0m 00s, Connected: 0m 04s, Connected / dropped: 2 / 1, Battery: Longest: on battery at medium for 0m 02s · medium → low");
|
||||
InputPresentation.Controllers(null).Should().BeEmpty();
|
||||
InputPresentation.ControllersText(Played()).Should().Be("DualSense Wireless Controller (Bluetooth) · Xbox Wireless Controller (Wireless adapter)");
|
||||
return 0;
|
||||
});
|
||||
|
||||
[Fact]
|
||||
public void AControllerWithNoModelIsNamedByItsMakerAndAPadAProgramPresentsSaysSo() => In("en", () =>
|
||||
{
|
||||
InputPresentation.ControllerName(new InputDeviceRecord { Family = "nintendo" }).Should().Be("Nintendo controller");
|
||||
InputPresentation.ControllerName(new InputDeviceRecord { Family = "something-new" }).Should().Be("Other controller");
|
||||
InputPresentation.ControllerName(new InputDeviceRecord { Family = "xbox", Model = "Steam Virtual Gamepad", Virtual = true })
|
||||
.Should().Be("Steam Virtual Gamepad (a virtual pad a program presents)");
|
||||
InputPresentation.ControllerName(new InputDeviceRecord { Family = "playstation", Model = "DualSense Wireless Controller", Remapped = true })
|
||||
.Should().Be("DualSense Wireless Controller (also shown to games as an Xbox pad)");
|
||||
InputPresentation.ConnectionLabel(ControllerConnection.Usb).Should().Be("USB");
|
||||
InputPresentation.ConnectionLabel(ControllerConnection.Unknown).Should().Be("Unknown");
|
||||
return 0;
|
||||
});
|
||||
|
||||
[Fact]
|
||||
public void ABatteryIsSaidInItsOwnScaleAndAWiredPadHasNone() => In("en", () =>
|
||||
{
|
||||
InputPresentation.BatteryText(null).Should().Be("N/A - no battery level was read");
|
||||
InputPresentation.BatteryText(new InputBatteryRecord()).Should().Be("N/A - no battery level was read");
|
||||
InputPresentation.BatteryText(new InputBatteryRecord { Scale = "none", States = [new InputBatteryStateRecord("wired", 0, 60_000)] })
|
||||
.Should().Be("Longest: wired for 1m 00s", "a pad on its cable has no level: no span and no drain are made up for it");
|
||||
InputPresentation.BatteryText(new InputBatteryRecord { Scale = "percent", States = [new InputBatteryStateRecord("charging", 85, 5000)], First = 80, Last = 90 })
|
||||
.Should().Be("Longest: charging at 85% for 0m 05s · 80% → 90%");
|
||||
InputPresentation.StateText(BatteryState.Full, BatteryScale.Percent, 100).Should().Be("full");
|
||||
InputPresentation.StateText(BatteryState.Unknown, BatteryScale.None, 0).Should().Be("state unknown");
|
||||
InputPresentation.StateText(BatteryState.Unknown, BatteryScale.FourLevels, 3).Should().Be("full");
|
||||
Enumerable.Range(0, 4).Select(static l => InputPresentation.LevelText(BatteryScale.FourLevels, l)).Should().Equal("empty", "low", "medium", "full");
|
||||
InputPresentation.LevelText(BatteryScale.None, 0).Should().Be("N/A");
|
||||
return 0;
|
||||
});
|
||||
|
||||
[Fact]
|
||||
public void TwoMakersHaveSharesAndOneHasNothingToCompare() => In("en", () =>
|
||||
{
|
||||
InputPresentation.Makers(InputFixtures.Record()).Should().Be("By maker, of the time controllers were in use: PlayStation 80.0% · Xbox 20.0%. Changes of maker: 2.");
|
||||
InputPresentation.Makers(InputFixtures.Record() with { Families = [new InputFamilyRecord("xbox", 1000, 1)] }).Should().BeNull();
|
||||
InputPresentation.Makers(null).Should().BeNull();
|
||||
return 0;
|
||||
});
|
||||
|
||||
[Fact]
|
||||
public void WhatTheReaderCouldNotDoIsSaid() => In("en", () =>
|
||||
{
|
||||
InputPresentation.Notes(InputFixtures.Record()).Should().BeEmpty("every source worked and Windows showed no pad twice");
|
||||
InputPresentation.Notes(null).Should().BeEmpty();
|
||||
|
||||
InputDevicesRecord broken = InputFixtures.Record() with
|
||||
{
|
||||
VirtualPad = true,
|
||||
Health = new InputHealth { RawInputRegistered = false, XInputAvailable = false, LastInputAvailable = false, Faults = 3 },
|
||||
};
|
||||
IReadOnlyList<string> notes = InputPresentation.Notes(broken);
|
||||
notes.Should().HaveCount(5);
|
||||
notes[0].Should().StartWith("Steam Input, or another remapper,");
|
||||
notes[1].Should().StartWith("Windows did not accept the registration");
|
||||
notes[2].Should().StartWith("XInput could not be read");
|
||||
notes[3].Should().StartWith("Windows did not report the time of the last keyboard or mouse input");
|
||||
notes[4].Should().Be("The reader faulted 3 time(s) in this session; the figures cover what it read.");
|
||||
return 0;
|
||||
});
|
||||
|
||||
[Theory]
|
||||
[InlineData("en")]
|
||||
[InlineData("vi")]
|
||||
[InlineData("ja")]
|
||||
public void TheExportLineIsTheSameInEveryLanguage(string culture) => In(culture, () =>
|
||||
{
|
||||
InputPresentation.ExportLine(Played()).Should().Be(
|
||||
"observed_ms 8000; foreground_ms 7000; controller_ms 3000; keyboard_mouse_ms 2000; both_ms 1000; idle_ms 1000; method_switches 2; source rawinput+xinput+lastinput; "
|
||||
+ "controller 1 playstation DualSense Wireless Controller bluetooth active_ms 4000 connected_ms 8000 connects 0 disconnects 0; "
|
||||
+ "controller 2 xbox Xbox Wireless Controller wireless active_ms 500 connected_ms 4000 connects 2 disconnects 1");
|
||||
InputPresentation.ExportLine(Bare()).Should().Be("N/A");
|
||||
InputPresentation.ExportLine(Bare() with { InputObservedMs = 5000, InputForegroundMs = 0 })
|
||||
.Should().Be("observed_ms 5000; foreground_ms 0; controller_ms 0; keyboard_mouse_ms 0; both_ms 0; idle_ms 0; method_switches 0; source n/a; controllers none");
|
||||
return 0;
|
||||
});
|
||||
|
||||
[Fact]
|
||||
public void NoFigureOfTheBlockCanCarryAnIdentifier()
|
||||
{
|
||||
// What the ledger keeps of a controller is its maker, model, connection, times, counts and battery (21_INPUT_DEVICES):
|
||||
// the row model has a column for each and for nothing else.
|
||||
typeof(InputControllerRowModel).GetProperties().Select(static p => p.Name)
|
||||
.Should().BeEquivalentTo("Name", "Connection", "InUse", "Connected", "Events", "Battery");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("ChartPalette.Dark.xaml")]
|
||||
[InlineData("ChartPalette.Light.xaml")]
|
||||
public void TheFourClassesTakeFourRolesThatReadApartInEachTheme(string file)
|
||||
{
|
||||
ScottPlot.Color[] c = [.. Enumerable.Range(1, 16).Select(static i => ScottPlot.Color.FromARGB((uint)(0xFF000000 | i)))];
|
||||
var p = new ChartPalette(c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7], c[8], c[9], c[10], c[11], c[12], c[13], c[14], c[15]);
|
||||
p.InputFill(InputClass.Controller).Should().Be(p.Native);
|
||||
p.InputFill(InputClass.KeyboardMouse).Should().Be(p.Displayed);
|
||||
p.InputFill(InputClass.Both).Should().Be(p.Sensor);
|
||||
p.InputFill(InputClass.None).Should().Be(p.MixNone);
|
||||
|
||||
// The same bar the sensors' lines clear (beta.8): every pair of the four at least 60 apart in RGB.
|
||||
Dictionary<string, (int R, int G, int B)> colours = Colours(file);
|
||||
string[] roles = ["Chart_Native", "Chart_Displayed", "Chart_Sensor", "Chart_MixNone"];
|
||||
foreach (string a in roles)
|
||||
{
|
||||
foreach (string b in roles.Where(r => string.CompareOrdinal(r, a) > 0))
|
||||
{
|
||||
(int R, int G, int B) m = colours[a];
|
||||
(int R, int G, int B) n = colours[b];
|
||||
Math.Sqrt(((m.R - n.R) * (m.R - n.R)) + ((m.G - n.G) * (m.G - n.G)) + ((m.B - n.B) * (m.B - n.B)))
|
||||
.Should().BeGreaterThanOrEqualTo(60, $"{a} and {b} are two segments of one bar under {file}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static Dictionary<string, (int R, int G, int B)> Colours(string file)
|
||||
{
|
||||
string dir = AppContext.BaseDirectory;
|
||||
while (!System.IO.File.Exists(System.IO.Path.Combine(dir, "FrameLedger.slnx")))
|
||||
{
|
||||
dir = System.IO.Path.GetDirectoryName(dir) ?? throw new InvalidOperationException("FrameLedger.slnx not found above the test binary");
|
||||
}
|
||||
|
||||
System.Xml.Linq.XNamespace x = "http://schemas.microsoft.com/winfx/2006/xaml";
|
||||
return System.Xml.Linq.XDocument.Load(System.IO.Path.Combine(dir, "src", "FrameLedger.App", "Styles", file))
|
||||
.Root!.Elements().Where(e => e.Attribute(x + "Key") is not null).ToDictionary(
|
||||
e => (string)e.Attribute(x + "Key")!,
|
||||
static e => (Convert.ToInt32(e.Value.Substring(3, 2), 16), Convert.ToInt32(e.Value.Substring(5, 2), 16), Convert.ToInt32(e.Value.Substring(7, 2), 16)),
|
||||
StringComparer.Ordinal);
|
||||
}
|
||||
}
|
||||
@@ -156,7 +156,7 @@ public sealed partial class MarkdownRendererTests
|
||||
return problems;
|
||||
});
|
||||
|
||||
documents.Should().HaveCount(25, "eleven documents and the guide's fourteen pages");
|
||||
documents.Should().HaveCount(26, "eleven documents and the guide's fifteen pages");
|
||||
missing.Should().BeEmpty("the renderer must never shorten a document a user reads or accepts");
|
||||
}
|
||||
|
||||
|
||||
@@ -86,7 +86,10 @@ public sealed partial class PagesLoadTests
|
||||
]))!;
|
||||
// Advanced metrics (D101): a session recorded with the option on, so the page's Session tab has facts, statistics and a chart.
|
||||
await s.SessionAsync(game.Id, DateTimeOffset.UtcNow.AddHours(-2), sensors: AdvancedFixtures.Blobs(), advanced: AdvancedFixtures.Row()).ConfigureAwait(false);
|
||||
long withFrames = await s.SessionWithFramesAsync(game.Id, DateTimeOffset.UtcNow.AddHours(-5), frames: 600, spikeEvery: 200, shape: r => r with { FgMixJson = mix }).ConfigureAwait(false);
|
||||
long withFrames = await s.SessionWithFramesAsync(game.Id, DateTimeOffset.UtcNow.AddHours(-5), frames: 600, spikeEvery: 200,
|
||||
// 0.1.0-beta.50: and what it was played with - two controllers, their batteries - so the "Played with" block, its bar and its
|
||||
// two charts are drawn and read in both themes too.
|
||||
shape: r => InputFixtures.With(r with { FgMixJson = mix }), sensors: InputFixtures.BlobsWithSensors()).ConfigureAwait(false);
|
||||
var surfaces = new Surfaces(s);
|
||||
await surfaces.LoadPagesAsync(game.Id).ConfigureAwait(false);
|
||||
surfaces.Summary = new SessionSummaryViewModel(s.Sessions, s.Games, s.Annotations, new SqliteHardwareSnapshotRepository(s.Db),
|
||||
|
||||
@@ -92,8 +92,9 @@ internal sealed class ScratchLedger : IAsyncDisposable
|
||||
new SensorBlob { Series = "gpu_power", Hz = 1, Codec = Infrastructure.Blobs.SeriesCodec.Tag, Data = Infrastructure.Blobs.SeriesCodec.EncodeFloat32([150, 160, 170]) },
|
||||
]);
|
||||
|
||||
/// <summary>A hooked session WITH blobs: <paramref name="frames"/> presents at 60 fps, a 4× spike every <paramref name="spikeEvery"/> frames, one segment, a gpu_temp series.</summary>
|
||||
public async Task<long> SessionWithFramesAsync(long gameId, DateTimeOffset startedAt, int frames, int spikeEvery, Func<SessionRow, SessionRow>? shape = null)
|
||||
/// <summary>A hooked session WITH blobs: <paramref name="frames"/> presents at 60 fps, a 4× spike every <paramref name="spikeEvery"/> frames, one segment, a gpu_temp series - or <paramref name="sensors"/>, the session's own sensor blobs with their own <c>t_ms</c>, in place of those three ticks.</summary>
|
||||
public async Task<long> SessionWithFramesAsync(long gameId, DateTimeOffset startedAt, int frames, int spikeEvery, Func<SessionRow, SessionRow>? shape = null,
|
||||
IReadOnlyList<SensorBlob>? sensors = null)
|
||||
{
|
||||
long snapshotId = await new SqliteHardwareSnapshotRepository(Db).EnsureAsync(new HardwareSnapshot { GpuName = "G" }, startedAt, TestContext.Current.CancellationToken).ConfigureAwait(false);
|
||||
float[] frametimes = new float[frames];
|
||||
@@ -122,7 +123,7 @@ internal sealed class ScratchLedger : IAsyncDisposable
|
||||
FrameIndex = Infrastructure.Blobs.SeriesCodec.EncodeUInt32(index),
|
||||
FirstPresentMs = 0, // schema 0013: the frames and the sensors share a zero, so the overlay is drawn
|
||||
},
|
||||
Sensors =
|
||||
Sensors = sensors ??
|
||||
[
|
||||
new SensorBlob { Series = "t_ms", Hz = 1, Codec = Infrastructure.Blobs.SeriesCodec.Tag, Data = Infrastructure.Blobs.SeriesCodec.EncodeFloat32([0, 1000, 2000]) },
|
||||
new SensorBlob { Series = "gpu_temp", Hz = 1, Codec = Infrastructure.Blobs.SeriesCodec.Tag, Data = Infrastructure.Blobs.SeriesCodec.EncodeFloat32([60, 61, 62]) },
|
||||
|
||||
@@ -127,6 +127,20 @@ internal sealed class FakeGameRepository : IGameRepository
|
||||
public ValueTask<bool> RemoveAsync(long gameId, bool keepSessions, CancellationToken ct = default) => throw new NotSupportedException();
|
||||
|
||||
/// <summary>The UI's recording switch (2026-09-23), applied to the row so the watcher tests see it.</summary>
|
||||
public ValueTask<bool> SetControllerSupportAsync(long gameId, string support, string source, DateTimeOffset at, CancellationToken ct = default)
|
||||
{
|
||||
foreach ((string key, GameRow row) in Rows)
|
||||
{
|
||||
if (row.Id == gameId)
|
||||
{
|
||||
Rows[key] = row with { ControllerSupport = support, ControllerSupportSource = source, ControllerSupportAt = at };
|
||||
return ValueTask.FromResult(true);
|
||||
}
|
||||
}
|
||||
|
||||
return ValueTask.FromResult(false);
|
||||
}
|
||||
|
||||
public ValueTask<bool> SetRecordingAsync(long gameId, bool record, CancellationToken ct = default)
|
||||
{
|
||||
foreach ((string key, GameRow row) in Rows)
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using FluentAssertions;
|
||||
using FrameLedger.Domain.Input;
|
||||
|
||||
namespace FrameLedger.Domain.Tests.Input;
|
||||
|
||||
/// <summary>The libraries through which a Windows game reads controllers, by file name (owner decision D163).</summary>
|
||||
public sealed class InputLibrariesTests
|
||||
{
|
||||
[Theory]
|
||||
[InlineData("xinput1_4.dll", "XInput")]
|
||||
[InlineData("XINPUT1_3.DLL", "XInput")]
|
||||
[InlineData("xinput9_1_0.dll", "XInput")]
|
||||
[InlineData("xinputuap.dll", "XInput")]
|
||||
[InlineData("dinput8.dll", "DirectInput")]
|
||||
[InlineData("DINPUT.dll", "DirectInput")]
|
||||
[InlineData("Windows.Gaming.Input.dll", "Windows.Gaming.Input")]
|
||||
[InlineData("GameInput.dll", "GameInput")]
|
||||
[InlineData("SDL2.dll", "SDL")]
|
||||
[InlineData("SDL3.dll", "SDL")]
|
||||
public void AnInputLibraryIsNamedByTheInterfaceItIs(string file, string api)
|
||||
{
|
||||
InputLibraries.ApiOf(file).Should().Be(api);
|
||||
InputLibraries.Is(file).Should().BeTrue();
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("nvngx_dlss.dll")]
|
||||
[InlineData("xinput.dll")]
|
||||
[InlineData("hid.dll")] // loaded by half of Windows: it says nothing of controllers
|
||||
[InlineData("steam_api64.dll")]
|
||||
[InlineData("")]
|
||||
[InlineData(null)]
|
||||
public void AnythingElseIsNotOne(string? file)
|
||||
{
|
||||
InputLibraries.ApiOf(file).Should().BeNull();
|
||||
InputLibraries.Is(file).Should().BeFalse();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TheNamesASnapshotLooksForAreLowerCaseAndEachIsAnInputLibrary()
|
||||
{
|
||||
InputLibraries.FileNames.Should().HaveCount(10).And.OnlyHaveUniqueItems();
|
||||
InputLibraries.FileNames.Should().OnlyContain(static f => InputLibraries.Is(f) && !f.Any(char.IsUpper));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,265 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
|
||||
|
||||
using System.Buffers.Binary;
|
||||
using System.Text;
|
||||
using FluentAssertions;
|
||||
using FrameLedger.Infrastructure.Import;
|
||||
|
||||
namespace FrameLedger.Infrastructure.Tests.Import;
|
||||
|
||||
/// <summary>
|
||||
/// What the Steam app's own file says of controller support (owner decision D163): read from files written here to
|
||||
/// the layout of format 41 - which was checked against the developer's own Steam folder on 2026-11-14 - and, where a
|
||||
/// Steam app is installed on the machine that runs the tests, from the real one.
|
||||
/// </summary>
|
||||
public sealed class SteamAppInfoTests
|
||||
{
|
||||
private const uint _magic41 = 0x07564429;
|
||||
|
||||
// The table of strings: a tree names its keys by their number here.
|
||||
private static readonly string[] _keys = ["appinfo", "appid", "common", "name", "controller_support", "extended", "depots"];
|
||||
|
||||
private static byte[] Key(string name) => BitConverter.GetBytes(Array.IndexOf(_keys, name));
|
||||
|
||||
private static byte[] Map(string key, params byte[][] children) => [0x00, .. Key(key), .. children.SelectMany(static c => c), 0x08];
|
||||
|
||||
private static byte[] Text(string key, string value) => [0x01, .. Key(key), .. Encoding.UTF8.GetBytes(value), 0];
|
||||
|
||||
private static byte[] Number(string key, int value) => [0x02, .. Key(key), .. BitConverter.GetBytes(value)];
|
||||
|
||||
private static byte[] Wide(string key, string value) => [0x05, .. Key(key), .. Encoding.Unicode.GetBytes(value), 0, 0];
|
||||
|
||||
private static byte[] Long(string key, byte kind, long value) => [kind, .. Key(key), .. BitConverter.GetBytes(value)];
|
||||
|
||||
/// <summary>A record's tree as Steam writes one: the root map, and the end mark after it.</summary>
|
||||
private static byte[] Tree(uint appId, string? support, params byte[][] more)
|
||||
{
|
||||
byte[][] common = support is null ? [Text("name", "A Game")] : [Text("name", "A Game"), Text("controller_support", support)];
|
||||
byte[][] children = [Number("appid", (int)appId), Map("common", common), .. more];
|
||||
return [.. Map("appinfo", children), 0x08];
|
||||
}
|
||||
|
||||
/// <summary>A whole file: the header, each record with its sixty bytes of state, the zero id, the table of strings.</summary>
|
||||
private static byte[] File(uint magic, IReadOnlyList<(uint AppId, byte[] Tree)> records, string[]? keys = null)
|
||||
{
|
||||
var bytes = new List<byte>();
|
||||
bytes.AddRange(BitConverter.GetBytes(magic));
|
||||
bytes.AddRange(BitConverter.GetBytes(1u));
|
||||
bytes.AddRange(new byte[8]);
|
||||
foreach ((uint appId, byte[] tree) in records)
|
||||
{
|
||||
bytes.AddRange(BitConverter.GetBytes(appId));
|
||||
bytes.AddRange(BitConverter.GetBytes((uint)(60 + tree.Length)));
|
||||
bytes.AddRange(Enumerable.Repeat((byte)0xAB, 60));
|
||||
bytes.AddRange(tree);
|
||||
}
|
||||
|
||||
bytes.AddRange(BitConverter.GetBytes(0u));
|
||||
byte[] file = [.. bytes];
|
||||
BinaryPrimitives.WriteInt64LittleEndian(file.AsSpan(8), file.Length);
|
||||
string[] table = keys ?? _keys;
|
||||
return [.. file, .. BitConverter.GetBytes((uint)table.Length), .. table.SelectMany(static k => Encoding.UTF8.GetBytes(k).Append((byte)0))];
|
||||
}
|
||||
|
||||
private static byte[] Library() => File(_magic41,
|
||||
[
|
||||
(10, Tree(10, "full")),
|
||||
(20, Tree(20, "partial", Map("extended", Text("name", "x"), Number("appid", 7)))),
|
||||
(30, Tree(30, null)),
|
||||
(40, Tree(40, "Full ")),
|
||||
(50, Tree(50, "something a later Steam writes")),
|
||||
]);
|
||||
|
||||
[Fact]
|
||||
public void ARecordSaysFullPartialOrNothingAndAnIdWithNoRecordIsNotAnswered()
|
||||
{
|
||||
SteamAppInfoResult read = SteamAppInfo.ReadControllerSupport(Library(), [10, 20, 30, 40, 50, 999]);
|
||||
|
||||
read.Problem.Should().BeNull();
|
||||
read.Support.Should().BeEquivalentTo(new Dictionary<uint, string>
|
||||
{
|
||||
[10] = SteamAppInfo.Full,
|
||||
[20] = SteamAppInfo.Partial,
|
||||
[30] = SteamAppInfo.None,
|
||||
[40] = SteamAppInfo.Full,
|
||||
[50] = SteamAppInfo.None,
|
||||
});
|
||||
read.Support.Should().NotContainKey(999u, "the store's file does not describe it: that is not 'none'");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void OnlyTheApplicationsAskedAboutAreAnswered()
|
||||
{
|
||||
SteamAppInfo.ReadControllerSupport(Library(), [20]).Support.Should().ContainSingle().Which.Should().Be(new KeyValuePair<uint, string>(20, SteamAppInfo.Partial));
|
||||
SteamAppInfo.ReadControllerSupport(Library(), []).Support.Should().BeEmpty();
|
||||
}
|
||||
|
||||
/// <summary>The key is only the store's word under the record's own "common" section: the same key anywhere else in the tree says nothing.</summary>
|
||||
[Fact]
|
||||
public void TheKeyCountsOnlyInTheRecordsCommonSection()
|
||||
{
|
||||
byte[] elsewhere = [.. Map("appinfo", Number("appid", 1), Map("common", Text("name", "A")), Map("extended", Text("controller_support", "full"), Map("common", Text("controller_support", "full")))), 0x08];
|
||||
byte[] atTheRoot = [.. Map("appinfo", Text("controller_support", "full"), Map("common", Text("name", "A"))), 0x08];
|
||||
|
||||
SteamAppInfoResult read = SteamAppInfo.ReadControllerSupport(File(_magic41, [(1, elsewhere), (2, atTheRoot)]), [1, 2]);
|
||||
|
||||
read.Problem.Should().BeNull();
|
||||
read.Support.Should().BeEquivalentTo(new Dictionary<uint, string> { [1] = SteamAppInfo.None, [2] = SteamAppInfo.None });
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void EveryKindOfValueATreeCanHoldIsPassedOver()
|
||||
{
|
||||
byte[] tree =
|
||||
[
|
||||
.. Map("appinfo",
|
||||
Number("appid", 1),
|
||||
[0x03, .. Key("depots"), 0, 0, 128, 63],
|
||||
[0x04, .. Key("depots"), 1, 2, 3, 4],
|
||||
[0x06, .. Key("depots"), 255, 0, 0, 255],
|
||||
Long("depots", 0x07, 123456789012345),
|
||||
Long("depots", 0x0A, -5),
|
||||
Wide("depots", "wide"),
|
||||
Map("depots", Map("extended", Map("depots"))),
|
||||
Map("common", Text("controller_support", "partial"))),
|
||||
0x0B,
|
||||
];
|
||||
|
||||
SteamAppInfo.ReadControllerSupport(File(_magic41, [(1, tree)]), [1]).Support[1].Should().Be(SteamAppInfo.Partial);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AFileOfAnotherFormatIsRefusedWithTheReason()
|
||||
{
|
||||
SteamAppInfoResult read = SteamAppInfo.ReadControllerSupport(File(0x07564428, [(10, Tree(10, "full"))]), [10]);
|
||||
|
||||
read.Support.Should().BeEmpty();
|
||||
read.Problem.Should().Be("format 0x07564428 is not the one this build reads (0x07564429)");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AFileWhoseTableHasNeitherKeyIsReadAndEveryRecordListsNone()
|
||||
{
|
||||
byte[] file = File(_magic41, [(10, Tree(10, "full"))], keys: ["a", "b", "c", "d", "e", "f", "g"]);
|
||||
|
||||
SteamAppInfoResult read = SteamAppInfo.ReadControllerSupport(file, [10]);
|
||||
|
||||
read.Problem.Should().BeNull();
|
||||
read.Support[10].Should().Be(SteamAppInfo.None);
|
||||
}
|
||||
|
||||
/// <summary>No length in the file is trusted: cut anywhere, it is a problem and never a read past the end - and never half an answer.</summary>
|
||||
[Fact]
|
||||
public void AFileCutAtAnyByteIsAProblemOrAWholeAnswerAndNeverThrows()
|
||||
{
|
||||
byte[] whole = Library();
|
||||
SteamAppInfo.ReadControllerSupport(whole, [10, 20, 30]).Support.Should().HaveCount(3);
|
||||
|
||||
for (int cut = 0; cut < whole.Length; cut++)
|
||||
{
|
||||
SteamAppInfoResult read = SteamAppInfo.ReadControllerSupport(whole.AsSpan(0, cut), [10, 20, 30]);
|
||||
|
||||
(read.Problem is not null || read.Support.Count == 3).Should().BeTrue($"cut at {cut}: a problem, or the whole answer");
|
||||
if (read.Problem is not null)
|
||||
{
|
||||
read.Support.Should().BeEmpty($"cut at {cut}: a file that cannot be read whole says nothing");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(4u)] // smaller than its own state
|
||||
[InlineData(0xFFFFFFFFu)] // larger than the file
|
||||
public void ARecordWhoseSizeIsNotPossibleIsAProblem(uint size)
|
||||
{
|
||||
byte[] file = Library();
|
||||
BinaryPrimitives.WriteUInt32LittleEndian(file.AsSpan(16 + 4), size);
|
||||
|
||||
SteamAppInfoResult read = SteamAppInfo.ReadControllerSupport(file, [10]);
|
||||
|
||||
read.Problem.Should().Be("a record claims more than the file holds");
|
||||
read.Support.Should().BeEmpty();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ATreeThatIsNotWellFormedIsAProblemOnlyForARecordThatIsAskedAbout()
|
||||
{
|
||||
byte[] unknownKind = [0x00, .. Key("appinfo"), 0x7F, .. Key("appid"), 1, 2, 3, 4, 0x08, 0x08];
|
||||
byte[] unendedString = [0x00, .. Key("appinfo"), 0x01, .. Key("name"), (byte)'x'];
|
||||
byte[] unendedMap = [0x00, .. Key("appinfo"), 0x00, .. Key("common")];
|
||||
byte[] file = File(_magic41, [(1, unknownKind), (2, unendedString), (3, unendedMap), (4, Tree(4, "full"))]);
|
||||
|
||||
SteamAppInfo.ReadControllerSupport(file, [4]).Support[4].Should().Be(SteamAppInfo.Full, "the records before it are stepped over by their size");
|
||||
foreach (uint bad in new uint[] { 1, 2, 3 })
|
||||
{
|
||||
SteamAppInfo.ReadControllerSupport(file, [bad, 4]).Problem.Should().Be("a record's tree cannot be read", $"record {bad}");
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ATreeNestedDeeperThanAnyRecordIsRefusedRatherThanFollowed()
|
||||
{
|
||||
byte[] deep = Map("common");
|
||||
for (int i = 0; i < 40; i++)
|
||||
{
|
||||
deep = Map("extended", deep);
|
||||
}
|
||||
|
||||
SteamAppInfo.ReadControllerSupport(File(_magic41, [(1, [.. deep, 0x08])]), [1]).Problem.Should().Be("a record's tree cannot be read");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AFileThatIsNotThereOrIsEmptyIsAProblemAndNotAnException()
|
||||
{
|
||||
string dir = Path.Combine(Path.GetTempPath(), "fl-appinfo-" + Guid.NewGuid().ToString("N"));
|
||||
Directory.CreateDirectory(dir);
|
||||
try
|
||||
{
|
||||
SteamAppInfo.ReadControllerSupport(Path.Combine(dir, "absent.vdf"), [10]).Problem.Should().Be(nameof(FileNotFoundException));
|
||||
string empty = Path.Combine(dir, "empty.vdf");
|
||||
System.IO.File.WriteAllBytes(empty, []);
|
||||
SteamAppInfo.ReadControllerSupport(empty, [10]).Problem.Should().Be("the file is empty or too large");
|
||||
string good = Path.Combine(dir, "appinfo.vdf");
|
||||
System.IO.File.WriteAllBytes(good, Library());
|
||||
SteamAppInfo.ReadControllerSupport(good, [10]).Support[10].Should().Be(SteamAppInfo.Full);
|
||||
SteamAppInfo.ReadControllerSupport(new byte[8], [10]).Problem.Should().Be("shorter than a header");
|
||||
}
|
||||
finally
|
||||
{
|
||||
Directory.Delete(dir, recursive: true);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The real file, where a Steam app is installed for the user running the tests - CI's runner has none, and then
|
||||
/// there is nothing to assert. It asserts the CONTRACT: the file this build's Steam client wrote is read without a
|
||||
/// problem, and every answer is one of the three words.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
[Trait("Category", "Integration")]
|
||||
public async Task TheSteamAppsOwnFileOnThisMachineIsReadWhereThereIsOne()
|
||||
{
|
||||
if (SteamAppInfo.InstalledFile() is not { } path || !System.IO.File.Exists(path))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
uint[] installed = [.. (await new SteamLibrarySource().ListAsync(TestContext.Current.CancellationToken))
|
||||
.Select(static g => uint.TryParse(g.StoreId, out uint id) ? id : 0).Where(static id => id != 0)];
|
||||
|
||||
SteamAppInfoResult read = SteamAppInfo.ReadControllerSupport(path, installed);
|
||||
|
||||
if (read.Problem is { } problem && problem.StartsWith("format ", StringComparison.Ordinal))
|
||||
{
|
||||
// A Steam client that writes another format: the reader says so and the fact reads N/A. Not this test's to fail on.
|
||||
return;
|
||||
}
|
||||
|
||||
read.Problem.Should().BeNull();
|
||||
read.Support.Values.Should().BeSubsetOf([SteamAppInfo.Full, SteamAppInfo.Partial, SteamAppInfo.None]);
|
||||
ILookup<string, uint> by = read.Support.ToLookup(static p => p.Value, static p => p.Key, StringComparer.Ordinal);
|
||||
TestContext.Current.SendDiagnosticMessage($"Steam's appinfo.vdf: {read.Support.Count} of {installed.Length} installed applications have a record; "
|
||||
+ $"full {by[SteamAppInfo.Full].Count()}, partial {by[SteamAppInfo.Partial].Count()}, none {by[SteamAppInfo.None].Count()}");
|
||||
}
|
||||
}
|
||||
@@ -40,8 +40,12 @@ public sealed class Win32InputBackendTests
|
||||
|
||||
if (backend.TryReadLastInputTick(out uint tick))
|
||||
{
|
||||
// The same clock as Environment.TickCount, and never ahead of it by more than a moment.
|
||||
unchecked((int)((uint)Environment.TickCount - tick)).Should().BeGreaterThan(-60_000);
|
||||
// What the reader relies on: asked again, the time has not gone back. It is NOT compared with
|
||||
// Environment.TickCount, and nothing may be: measured 2026-11-15 on a PC that had slept for five hours,
|
||||
// the two were five hours apart - Windows' tick counts the sleep and .NET's does not. The reader only ever
|
||||
// asks whether the time changed since its last slice (InputReader), which no sleep can spoil.
|
||||
backend.TryReadLastInputTick(out uint again).Should().BeTrue();
|
||||
unchecked((int)(again - tick)).Should().BeGreaterThanOrEqualTo(0);
|
||||
}
|
||||
|
||||
uint front = backend.ForegroundProcessId();
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
- [Words FrameLedger uses](../guide/10-glossary.md)
|
||||
- [Alpha builds](../guide/11-alpha-builds.md)
|
||||
- [Advanced metrics](../guide/12-advanced-metrics.md)
|
||||
- [Controllers and input](../guide/13-controllers.md)
|
||||
- [The terms, in plain words](../guide/terms-in-plain-words.md)
|
||||
- [Limitations](../LIMITATIONS.md)
|
||||
- [Accessibility](../ACCESSIBILITY.md)
|
||||
|
||||
Reference in new issue
Block a user