diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-16 23:31:18 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-17 12:15:01 -0300 |
| commit | b2f7c605c279b2dea0c25180730c3d2e7b4b7d45 (patch) | |
| tree | 142f0258cefd71ed210c64ae73f852e386f71991 /src/host/root.zig | |
| parent | 57e254470e11ab40b6bae31b2cbf62aebca27ce4 (diff) | |
| download | sketchbook-b2f7c605c279b2dea0c25180730c3d2e7b4b7d45.tar.gz sketchbook-b2f7c605c279b2dea0c25180730c3d2e7b4b7d45.zip | |
Make snapshots named marks and recordings named clips of sessions
The state file keeps live state only (SKETCH03, one slot). save NAME is a
keyframe and a mark in the sessions database, synced to disk; load, diff,
snapshot and expect-snapshot take mark names, through the keyframe's own
layout migrated to today's, compared over the leaves migration kept. A
file from before (SKETCH01/02) has its used snapshot slots imported as
marks "1".."7" at open, then drops them; a run that records nothing
leaves them alone.
record NAME, stop and play NAME make and play clips: a frame range of a
session and its start keyframe, nothing overwritten, nothing invalidated
by a later save, no capacity. The 64 MiB .inputs file, its --fresh memset
and Timeline's Bank are gone; numbers still work as names, so every
existing script runs unchanged. Event times in a clip are the session's,
not restarted at record. reload.script also checks that a field a reload
drops is still in the keyframe taken before it (expect-key).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'src/host/root.zig')
| -rw-r--r-- | src/host/root.zig | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/host/root.zig b/src/host/root.zig index 7d4b967..618512b 100644 --- a/src/host/root.zig +++ b/src/host/root.zig @@ -5,7 +5,7 @@ //! --state FILE persistent state (default: <name>.state) //! --headless offscreen video, silent audio //! --script FILE play a script instead of reading devices -//! --fresh start from default state: no snapshots or recordings +//! --fresh start from default state (sessions, marks and clips are kept) //! --timing-marker encode frame ID and draw sample time for video analysis //! --profile-gpu time each GPU command alone, print the times at exit //! --console LINE run a console line once the sketch is loaded (repeatable) @@ -94,15 +94,15 @@ pub fn main(init: std.process.Init, linked: ?abi.Sketch) !void { // A scripted run from fresh state works on files of its own, moved to // the given path at exit: two runs of one build step (two `zig build`s - // at once share its output path) never share a state, store or - // recordings file, nor fail on the store's lock. An export's are + // at once share its output path) never share a state or store file, + // nor fail on the store's lock (its sessions are in memory). An export's are // removed instead: nothing reads them, and a player may have the given // ones open. var private_buf: [std.fs.max_path_bytes]u8 = undefined; const given = options.state; const private = (script_path != null or options.export_to != null) and options.fresh; if (private) options.state = std.mem.print(&private_buf, "{s}.{d}", .{ given, std.os.linux.getpid() }) catch fatal("--state path too long"); - defer if (private) for ([_][]const u8{ "", ".inputs", ".store" }) |suffix| { + defer if (private) for ([_][]const u8{ "", ".store" }) |suffix| { var from: [std.fs.max_path_bytes + 16]u8 = undefined; var to: [std.fs.max_path_bytes + 16]u8 = undefined; const a = std.mem.printSentinel(&from, "{s}{s}", .{ options.state, suffix }, 0) catch continue; @@ -131,7 +131,7 @@ const usage = \\ --state FILE persistent state (default: sketch.state) \\ --headless offscreen video, silent audio, no vsync \\ --script FILE play a script instead of reading devices - \\ --fresh start from default state: no snapshots or recordings + \\ --fresh start from default state (sessions, marks and clips are kept) \\ --timing-marker encode frame ID and draw sample time for video analysis \\ --profile-gpu time each GPU command alone, print the times at exit \\ --console LINE run a console line once the sketch is loaded (repeatable) |
