Compare commits

...
32 Commits
Author SHA1 Message Date
gramps 9b337ad91b feat(blur): the brand logo cannot be blurred
The blur is universal, so it would swallow the logo along with everything else. The compositor
now defers every visible brand logo: skipped in both element loops, blitted immediately AFTER
the blur group, before the flash/social/ticker overlays. One logo per scene, so it is cheap.

Preview mirrors it: the staged scene's brand logo is drawn above the blur host (StagedBrandLogo),
so what you see in the editor is what the encoder gets.

Test: a blur covering the logo's area leaves the logo's pixels exactly white while the coloured
background beneath it blends.
2026-11-01 13:32:23 -08:00
gramps bb51164f2f feat(blur): universal — the blur covers every layer, webcam included
The creator found the use case that reframes the feature: a moment of privacy while the webcam is
on. A blur that can only cover the desktop cannot do that.

- SceneCompositor applies the blur group AFTER every element is composited (still before the
  flash / social bar / ticker / zoom overlays), so it covers webcam, chat, alerts — anything. Its
  position in the layer list no longer affects the output, so it is added at the top and the
  reorder clamp is gone.
- Supersedes the earlier "blur sits below the brand" rule: a universal blur does obscure the logo
  when it covers it. Called out in frame-pipeline.md so it is not re-litigated.
- Preview mirrors it exactly: the blur host moved OUT of CanvasGrid to a sibling above it, so the
  VisualBrush samples every layer (and cannot sample itself). It used to sample only the backdrop,
  which is why a circle over the webcam would have shown sharp pixels in the editor and blurred
  ones in the stream.
2026-11-01 13:29:15 -08:00
gramps bb80ec8370 ui(properties): geometry for every placeable layer, and no fake opacity on a blur
Two holes in the blur's property panel, both of which also affected other layers:

- X/Y/W/H were gated on IsWebcamSelected, so a blur (or an image, chat box or alert zone)
  had no numeric position or size at all — only dragging. The block is generic: it always
  edited SelectedElement's own values, so the gate was the only thing excluding them.
- Opacity showed for a blur, but the compositor's blur reads BlurAmount — the slider would
  have moved a number that changes nothing in the output. Hidden for blur layers.

Blur panel is now: Box | Circle, strength, and the shared geometry fields.
2026-11-01 13:20:13 -08:00
gramps da508f0a14 fix(blur): the (+) menu entry re-evaluates — CanAddBlur was never re-notified
The Blur item's Visibility is bound to CanAddBlur, which depends on the staged scene. The scene
setter never raised it, so the binding evaluated once (collapsed) and stayed collapsed for the
session — build 1082: the option simply wasn't there.

StagedScene now notifies CanAddBlur, with a test that pins both halves: Live true, Chat false,
and a notification on every staged-scene change.
2026-11-01 13:17:40 -08:00
gramps 9b44a32054 fix(blur): the layer is draggable, so adding one drops a rectangle with a resize handle
Source.IsDraggable listed Image/Web/Chat/Alert only, so a blur had no selection box, no corner
handle, and no hit-test — the rectangle existed in the render but could not be grabbed. Adding
Blur to that list gives it the same selection chrome and resize path every placeable layer has
(drag to move, corner dot to resize, one undo snapshot per gesture).

It is selected on add (AddSource already does that), so the rectangle appears already outlined
and ready to size.
2026-11-01 13:14:51 -08:00
gramps 1416548f24 feat(blur): the editor shows the blur — whatever is beneath it is blurred, in the preview
The preview canvas is WPF visuals; a blur layer contributes no visual of its own, so until now
the creator saw nothing where the blur was and could not tell what it was hiding.

Each visible blur now draws a rectangle (or ellipse) filled with a VisualBrush of the whole
BackdropLayer — the desktop capture plus the background art — sampled at the blur's own rect and
carrying a BlurEffect at the same strength the compositor uses. The host canvas sits after the
backdrop and before the element layers, which is the model's own z-rule, so the preview shows
exactly what the output will: desktop blurred, brand and everything above it untouched.

Rebuilt on scene change, on add/remove, and on any blur property change (position, size, shape,
strength) — the brush samples the live backdrop, so the picture keeps moving underneath.
2026-11-01 13:12:27 -08:00
gramps 0ed341fd18 fix(blur): the crash on launch — BlurAmount was in the INSERT and the reader, not the SELECT
LayoutStore.Load threw ArgumentOutOfRangeException on GetOrdinal("BlurAmount") during the
MainViewModel constructor, so the app died at startup rather than when a blur was used. The
migration adds the column and Save writes it; the reading query still listed its columns
explicitly and BlurAmount was missing from that list.

Adds LayoutBlurPersistenceTests: a blur saved and reloaded, asserting the amount and geometry
survive. That is the test that should have existed with the feature — the startup path it
covers has no other guard.
2026-11-01 13:08:03 -08:00
gramps 71d0e87cac feat(blur): a privacy blur layer for the Live scene — boxes and circles over the desktop
Creator request 2026-11-01: a layer that hides part of the desktop from viewers. Box or circle,
drag/resize like any layer, one strength slider, several allowed.

**Z-order is policy, not preference.** `AddSource` inserts a blur directly above the background
and therefore below the brand logo, and `OnSceneElementsReordered` pushes any blur that ends up
above the brand back down. Nothing else in the app can move it into the brand's way.

**Overlap = the strongest single blur, never a stack.** `SceneCompositor.ApplyBlurLayers` collects
every visible blur the first time one is reached in the z-order, sorts them strongest-first, and
shares one coverage map: a pixel already covered by a stronger blur is skipped. Blurring
back-to-front would have produced something stronger than any slider setting allows, which is
exactly what was ruled out.

**One blur curve, shared with the webcam.** `RegionBlur` carries the constants the webcam blur
already used — downscale 4, radius 1–6 downscaled px, `RadiusFor(strength)` — and
`BackgroundEffectProcessor` now delegates to it instead of holding its own copy. The layer's
slider is the same 0–1 scale with the same 0.5 default, so "half strength" means the same blur in
both features. Cost is proportional to the blur's own rect, not the frame.

**Live scene only**, enforced in `AddSource` as well as the (+) menu (`CanAddBlur`), so a stale
menu item or a scripted call cannot plant one on BRB. `ElementKind.Dynamic`, so it is never baked
into the static base and every render path gets it — pump, preview, thumbnails, scene dump.

Persistence: `Source.BlurAmount` column + migration; shape rides the existing `ClipShape`.
Properties panel: Box | Circle plus the strength slider, gated on `IsBlurSelected`.

4 tests: outside the mask is byte-identical, inside loses its hard edges, a circle leaves its
box corners alone, and two identical stacked blurs equal one (the coverage map). Release builds
at 0 warnings.
2026-11-01 09:55:04 -08:00
gramps 2e12c5651e ui(drawers): 20px of content padding on the right of every pull-out
The five drawers each sized their content Grid to Width=320 inside a panel that itself
animates to 320, with 14px margins — so the content box was 348 wide in a 320 window and its
right edge was clipped. That is why every drawer's content jammed into the right margin
regardless of the margin value.

The Grid now fills the panel (no fixed width) with Margin 14,10,20,12: 14 on the left, 20
between the content and the right edge of the div, which is the requested gutter.
2026-11-01 09:35:37 -08:00
gramps a543d3629b ui(settings): 20px right gutter on the drawer, rail tabs centred on the preview
Two build-1047 notes. The settings content gets a 20px right margin (plus 4 left) inside the
scroll viewer, so text and controls stop running into the panel edge and the scrollbar has
somewhere to live. The rail tab stack is VerticalAlignment=Center instead of Stretch, so the
whole group of tabs sits centred against the preview rather than hanging from the top.
2026-11-01 09:22:02 -08:00
gramps a35ec0c5f8 refactor(settings): a pull-out drawer, with Zoom as a category — and the menu moves to the wordmark
Creator directive, 2026-11-01. Settings stopped being a centred modal.

- **Drawer** (Controls/SettingsDrawer): hosted in PreviewPane's pull-out stack, 320px, the same
  animated-width pattern as Stream Settings / YPP / Socials / TEST, opened by the gear rail tab
  on a single left click. SettingsDrawerOpen is exclusive with the other four, both directions.
  This also removes the modal's MaxHeight-700 scroll problem for good: the drawer is the height
  of the preview.
- **Categories**: headings with controls indented beneath them. Zoom now owns *Zoom view shape*
  (Circle / Phone / Tablet) and *Zoom box follows*; Recordings, Brand logo and Scene transition
  are their own categories.
- **The app menu moved to the LlamaCasty wordmark** (right-click → Report Bug / Feature Request /
  About). Left-click still opens About. The gear tab no longer carries a menu at all, so clicking
  it does exactly one thing.

OverlayHost keeps only the Bug / Feature / About panels; its brand-logo handlers and the dev-panel
injection moved with the settings block. BrandLogoPreviewTests follows the control (same assertions,
new path). Release 0 warnings; 15 tests pass across brand logo, zoom, entitlement and preview
history.
2026-11-01 09:16:27 -08:00
gramps c418288215 fix(settings): the App Settings panel scrolls — the lower options were clipped off-screen
The shell is MaxHeight 700 and the settings panel had grown past it with no ScrollViewer,
so everything below roughly the transition section was unreachable. That is why 'Tablet
(Horizontal Rectangle)' existed in the XAML and in the model but never appeared in the app:
the shape control itself was cut off, not the option.

Panel row is now * with an Auto ScrollViewer, so every section is reachable and the next
one added cannot silently fall off the bottom.
2026-11-01 09:08:08 -08:00
gramps 517e60d593 fix(zoom): the magnifier freezes the layers — no picking up objects while it is open
While zoom is active a left drag moves the box and never selects or moves a layer beneath
it (creator ruling 2026-11-01). MouseMove already owned the zoom drag; the missing guard was
in MouseLeftButtonDown, which happily hit-tested a layer first and left a stray selection
plus a half-started drag behind the moving box.
2026-11-01 09:06:05 -08:00
gramps c3bbf1fdda fix(zoom): ignore Ctrl auto-repeat — the box was closing itself as it was created
Creation holds Ctrl (Ctrl+right-click), and Windows repeats a held modifier. The repeat
tick landed after the box existed, so the dismiss handler saw an open box and closed it:
appear, then vanish ~500ms later. Guarded with e.IsRepeat, which only ever skips the
repeat events — a genuine second press still closes the box.
2026-11-01 09:01:02 -08:00
gramps 15734a5477 feat(zoom): Ctrl closes the box, and a Follow pill that re-anchors the capture
Two creator directives, 2026-11-01.

**Ctrl-down dismisses an open zoom box.** Window-level PreviewKeyDown, so the same hand that
opened it can put it away. It cannot cancel itself at creation: Ctrl is already held before
the right-click that makes the box, so the keydown fires while nothing is open.

**Follow mode, default Anchor.** A PillToggle in App Settings ("Follow the box"), persisted
as Zoom.FollowBox. Off — the default — keeps the 2026-10-08 model: the capture stays on the
clicked point and dragging only moves the box over it. On, UpdateZoomMove re-anchors the
capture to the box centre (half the box's size, clamped per axis), so the magnifier shows
whatever it hovers. Flipping to Follow while the box is open snaps it immediately.

Three tests: anchor drags leave CaptureX alone, follow moves it to the expected quarter-offset
centre, and the setting round-trips through LayoutStore (tested against the store, not via two
view models — two live VMs fight over the temp DB, which is a fixture problem, not a bug).

Both new test classes share a collection tag: MainViewModel.LayoutPathOverride is static, and
xUnit runs classes in parallel, so without it the two view models collided (one failure in a
combined run, clean when run apart).

Release build 0 warnings; 14 tests pass across zoom, entitlement and preview history. Debug
build is blocked by the running app (PID 47388) — close it and the exe updates.
2026-11-01 08:51:28 -08:00
gramps 1d2d58f1d7 fix(zoom): the gesture now creates the box instead of only closing it
Creator report: Ctrl+right in edit mode and left-click in preview did nothing when
neither streaming nor recording. The bindings were correct; the action was not.

Two causes, both in the model rather than the handler:
- ActivateZoom opened with `if (!(IsLive || IsRecording)) return;` — the box could not be
  created outside a session at all.
- ToggleZoom only ever called DismissZoom, so "toggle" could turn it off and never on.

Now ToggleZoom(x, y) activates at the cursor or dismisses if already open, and the live-only
guard is gone — the magnifier is an editing aid as much as a live one. Both call sites pass
the canvas point, so the box still anchors on the click rather than the frame centre.

Debug 0 warnings; ZoomBox + ZoomMagnifier tests pass (3).
2026-11-01 08:43:17 -08:00
gramps 4b91760f92 fix(preview): Ctrl+right no longer opens the menu, and the social bar keeps its click
Two event-pairing bugs found by validating every handler instead of trusting the table.

1. Ctrl+right-click opened the context menu in edit mode. Cause: WPF's PopupControlService
   opens menus on right-button-UP, and only the DOWN event was being handled — so the zoom
   toggled and the menu appeared under it. Both events are now handled when Ctrl is down.
   (The creator saw this in edit mode; preview mode had the same latent bug.)

2. The social bar's left-click was dead in preview mode and dragged the layer beneath it in
   edit mode. Cause: PreviewGrid handles the TUNNELLING PreviewMouseLeftButtonDown, which
   fires before the bar's bubbling handler — and since preview-mode left-click now toggles
   zoom, that handler swallowed the bar's click too. The preview handler now steps aside when
   the point is inside the bar's bounds (SocialBarElement.RenderSize, translated to canvas).

Audited and left alone because they are correct: left-down → resize handle / element drag /
deselect; move → zoom drag before edit drag (by design); left-up → EndPreviewDrag; right-up
→ zoom-drag release then the Ctrl swallow.

Build Debug 0 warnings, 22 tests pass across ZoomBox, PreviewHistory and SocialBar.
2026-11-01 08:19:17 -08:00
gramps 6d1c982e26 feat(entitlement): IEntitlement seam — Steam DLC answers, everything fails closed
The first half of surge day 1. One question, "may this session emit Pro output?", with
one method on the interface so nothing downstream knows which rail proved it.

SteamEntitlement reads the lifetime SKU the way Valve intends: SteamAPI.Init() then
SteamApps.BIsDlcInstalled(dlcAppId). Four different failure paths all resolve to the
free tier rather than to Pro or to a crash — no DLC id configured, no Steam client,
steam_api64.dll missing (a throw on first touch), and simply not owned. A copied folder
run without Steam is the common case, not an exceptional one.

NotConfigured() is the shipping default until Steamworks creates the DLC app; it answers
false without ever touching the native library, so today's builds behave exactly as they
did before this commit.

HasProOutput is now IsPremium || DeveloperMode || rail, with an internal EntitlementOverride
test seam (internal, because a public setter here is a licence bypass). Four tests: no id
reads false, no client reads false without throwing, the fake reports what a test sets, and
the view model takes its answer from the rail.

Steamworks.NET 2024.8.0 added; the native DLL still comes from scripts/steam-sdk.sh, so the
csproj change is three lines and no formatting churn.
2026-11-01 08:13:25 -08:00
gramps 279eb08dea feat(preview): right-click is the menu, zoom is the single-handed gesture
Creator ruling 2026-11-01, and the reason is live-stream ergonomics: no two-handed
chords while a broadcast or recording is running.

- Edit mode: left selects / drags / resizes, right opens the context menu, Ctrl+right
  toggles the zoom box. Chords are acceptable here because editing is a stopped activity.
- Preview mode: left toggles the zoom box, right opens the context menu, and Ctrl+right
  is swallowed outright — handled rather than left to fall through, so Ctrl+right cannot
  open a menu by accident while one hand is on the mouse.

This also removes the old live behaviour where right-click activated the magnifier at the
cursor point (and dismissed it). Zoom in preview is now a plain toggle; if point-zoom is
wanted back it needs a one-button gesture, not a chord.

Build: Release 0 warnings. Debug is currently blocked by the running app holding the exe
(PID 47252) — close it and the Debug build copies normally.
2026-11-01 08:10:04 -08:00
gramps fdb27f0758 feat(ui): gear to the rail, EDIT on the panel edge, preview undo/redo
Three creator directives (2026-11-01), done ahead of the surge.

**Gear moved to the preview rail** — first tab, orange (Brush.Attention), gear icon
only. Left-click opens the same app menu the top bar gear owned (Settings / Bug /
Feature / About), right-click goes straight to App Settings; both behaviours moved
with it, so nothing lost an entry point. TopBar keeps the wordmark and EDIT.

**EDIT right edge aligned to the layers panel.** The work area is margin 8 + a 360px
column, the top bar is padding 16, so the shared edge is 352 inside the bar. TopBar
column 0 is now a fixed 352 grid with EDIT right-aligned in it — alignment by
arithmetic instead of by eye.

**Preview undo/redo: Ctrl+Z / Ctrl+Shift+Z.** Models/PreviewHistory snapshots element
REFERENCES plus geometry, visibility, order and membership — a deep clone would mirror
every property of a dozen element subclasses and quietly miss the next one added.
One snapshot per gesture (pushed at drag/resize start, never in the move loop), bounded
at 50, redo survives multiple undos, cleared on layout load. Gated on EditingActive:
undo while the preview shows program output would rewrite a scene nobody is looking at.

Honest scope, in the type's doc comment: layout edits only. Colour/opacity/border/font
edits are not captured yet, so Ctrl+Z after one of those restores the last layout change.

6 tests in PreviewHistoryTests; 19 pass across it and the neighbouring UI classes; Debug
and Release both build at 0 warnings.
2026-11-01 07:46:10 -08:00
gramps bd669f2e73 docs(handoff): the six-day surge is the next action 2026-11-01 07:35:49 -08:00
gramps 600088c794 docs(tasks): six days, all remaining code — no week 2, no after-launch list
Correcting my own plan: the surge is six calendar days (Mon 2 - Sat 7), Saturday included,
and it finishes the coding side. Every open row is assigned to a day; the week-2 and
after-launch sections are gone because there are no such sections.

Days: licensing (entitlement, licence UI, greyed tiers, system messages), release blockers
(visibility picker, output contract, webcam identity, Move transitions), resilience (TASK 32,
bandwidth step-down), content and media (text layer, media wiring, profanity filter,
scheduled streams), data and settings (reward persistence, YPP slice 2, defaults split,
scene audio, settings round, disk hygiene), finish and prove (publish recording, undo, gold
pass, full sweep).

Target 6-8 units a day against a measured baseline of 3-5 — that gap is the surge. If a day
overruns, the smallest item moves; a launch blocker never does. Day 6 is the only polish day.
2026-11-01 07:35:38 -08:00
gramps 68fdacc12d docs(handoff): trim to the 40-line cap 2026-11-01 07:33:00 -08:00
gramps 724f940f5e docs(handoff): 40 lines 2026-11-01 07:32:44 -08:00
gramps 832955bbb8 docs(handoff): fit the 40-line cap 2026-11-01 07:32:30 -08:00
gramps 7dab7ded36 docs(handoff): HANDOFF under the 40-line cap for the surge plan 2026-11-01 07:32:13 -08:00
gramps b2e8b26b6e docs(tasks): the surge week, coding only — five days sized at 3-5 units each
Non-coding is parked on Valve (identity verification, store page, depot); the week is code,
tests, debugging, polish. Ordered by what actually blocks a public build: entitlement seam
and licence UI (days 1-2), greyed tiers (2), visibility picker (3), stream resilience (3-4),
output contract (4), gold pass (5).

Sized honestly against the measured rate: ~50 units remain, 15-25 fit in five days, so the
plan names week-2 candidates and the five items that should not block launch at all
(scheduled streams, scene audio, defaults split, YPP slice 2, feedback batch).

Every unit carries the same definition of done — clean build, per-class tests, verify.sh on
the declared scope, and the falsified doc corrected in the same commit.
2026-11-01 07:31:52 -08:00
gramps f189c5e328 build(steam): the SDK zip IS the only download — ContentBuilder included, links recorded
The partner dashboard offers exactly one download because there is only one: the SDK zip
carries the runtime (steam_api64.dll) and the release tooling (sdk/tools/ContentBuilder
with steamcmd.exe for Windows and steamcmd.sh for Linux/macOS, plus the app_build and
depot_build VDF templates). Verified against the zip rather than assumed.

scripts/steam-sdk.sh gains --contentbuilder, opt-in because it is 27 MB of binaries that
only the uploading machine needs.

Distribution.md §2 now opens with that fact — there is no separate ContentBuilder
download to hunt for — plus a reference table of the pages that actually get used:
SteamPipe upload, DLC setup, BIsDlcInstalled, store artwork sizes, Coming Soon window,
the Wallet rule, recurring subs, partner support and Steamworks.NET.
2026-11-01 07:26:51 -08:00
gramps 1fe84be64a build(steam): stage steam_api64.dll beside the exe — one file, not the whole SDK
The SDK zip is 24 MB of headers, examples and tools we never build. The runtime
dependency is one native library, so scripts/steam-sdk.sh extracts exactly
sdk/redistributable_bin/win64/steam_api64.dll into steam/ (gitignored, like ffmpeg/ —
the script is the audit trail) and writes steam_appid.txt = 480, Valve's Spacewar app,
so SteamAPI.Init() resolves an app id locally before LlamaCasty has one of its own.

Two csproj details that would have cost a debugging session:
- Link="steam_api64.dll" puts it BESIDE the exe; without Link, None items keep their
  relative path and it lands in steam/, where the loader does not look.
- ExcludeFromSingleFile, for the same reason ffmpeg needed it: a native DLL otherwise
  gets swallowed into the single-file bundle and cannot be loaded at runtime.

steam_appid.txt is Debug-only — Valve's guidance is not to ship it — and the publish
output confirms it: dll present at the root, no appid file, exe still 127 MB (proof the
DLL was not bundled).

Also queued, as asked: preview undo (Ctrl+Z / Ctrl+Shift+Z) in edit mode, noted as the
partner to the defaults-vs-current split — undo covers the slip, defaults cover the mess.
2026-11-01 07:23:29 -08:00
gramps 27fc6fb507 feat(profile): the free budget is pixels and fps, enforced once — with a dev-only release hatch
The paid delta is output quality, so the rule needs to be measurable rather than a word:
921,600 pixels and 30 fps, fail-closed. Models/OutputProfile.cs is that rule as pure
policy — a permitted tier passes through untouched (Pro, or the free tier's own 720p30),
a disallowed one resolves to the best tier the budget allows and carries ITS bitrate, so
a capped user is never offered an 8 Mbps budget for a 720p frame.

Applied once, in BuildEncoderOptions. That is genuinely one place: the stream and the
local recording are two output blocks of ONE ffmpeg process fed by one EncoderOptions,
so there is no second encoder to forget. (commercial.md claimed "both encoders — never
two checks"; the code is stronger than the doc, and the doc is corrected.)

Developer override, as asked: a "Developer mode — all resolutions" checkbox in App
Settings, bound to MainViewModel.DeveloperMode, which feeds HasProOutput. It is not
hidden in a release build — Controls/DeveloperPanel's Page and Compile items are removed
when Configuration != Debug, and OverlayHost adds it at runtime inside #if DEBUG, so a
shipped exe has no BAML for it at all. The setter also refuses the value when
DevBuild.IsDevelopment is false, which is now the single source for that question (the
scoreboard partial had its own duplicate const).

Two traps worth their lines: a `const bool` dev flag makes `if (!Flag) return;` an
unreachable-code warning in one configuration or the other (CS0162), so DevBuild uses
static readonly; and a Condition on an ItemGroup is invisible to a test reading
item.Attribute("Condition") — read the parent.

Tests: 14 pass across OutputProfileTests, AssemblyIdentityTests and StorePackagingTests.
The invariant test is the one that matters: iterate every shipped tier under a free
entitlement and assert none emits more than the budget, so a future 4K tier fails here
instead of shipping to everyone. App builds Debug and Release at 0 warnings.
2026-11-01 07:11:49 -08:00
gramps abfab25685 build: the exe is LlamaCasty.exe, and the publish script proves the artifact
Renames AssemblyName to LlamaCasty before the first Steam depot — Steamworks is explicit
that renaming a live exe is painful, so this had to land first, not later.

Four assembly-qualified pack URIs carried the old name, not three: MainWindow (window
icon), OverlayHost (logo), RenameRecordingDialog and KeepBroadcastDialog. Pack URIs
resolve by assembly name at runtime, so a stale one compiles, passes every test and then
silently renders nothing the first time that view opens. AssemblyIdentityTests guards
both halves — the assembly name, and no source XAML still naming the legacy assembly.
Packaging/Package.appxmanifest and package-msix.sh carry the exe name too.

scripts/publish.sh replaces the by-hand publish: single-file win-x64, ReadyToRun,
ffmpeg beside the exe, and it refuses to finish if ffmpeg, LICENSE, PRIVACY.md or
THIRD-PARTY-NOTICES.txt are missing, or if a test assembly leaked in.

That last guard exists because the first publish was wrong in a way no test could see:
PublishSingleFile + IncludeNativeLibrariesForSelfExtract bundled the libav*.dll family
into the exe — a 9-file output with no ffmpeg folder and a 182 MB binary, so the locator
would have found nothing at runtime. ExcludeFromSingleFile="true" on the content keeps
the folder a folder. Diffing against a control publish without the single-file flags
found it; guessing at item globs wasted two attempts first (recorded in MyMistakes.md).

Measured: 127 MB exe + 129 MB ffmpeg = 257 MB depot. Tests: AssemblyIdentity,
StorePackaging, BuildStamp, BundledFonts all pass; app builds with 0 warnings.
2026-11-01 07:01:50 -08:00
gramps 8f79b20a18 docs(distribution): Steam is the only channel — the zip, winget and the Store are dead
The site said "Coming soon to Steam" while the app docs still said direct download plus
winget primary with Steam parked. One of them had to move, and the creator's ruling is
Steam exclusive: a free app on Steam with the paid edition as a Steam DLC, and the
$10/month plan sold off-Steam by Polar.

Records the constraint that shapes the code, not just the prose:
- Steamworks requires in-app purchases to use the Steam Wallet (Microtransactions doc,
  quoted in commercial.md), so the monthly is *stated*, never *sold*, inside a Steam
  build; the lifetime is plain DLC bought on the store page and read with BIsDlcInstalled.
- Entitlement is `steamDlcOwned || polarKeyValid`, both resolving to one OutputProfile.
  steam_api64.dll ships beside the exe and is a functional dependency, not the rejected
  "IP protection" native DLL — without it DLC ownership cannot be read. Launched without
  Steam, the app falls back to the free profile rather than refusing to start.
- Signing is moot: Steam installs never meet SmartScreen. Artifact Signing stays on the
  shelf for the day a non-Steam download exists. Year-one fixed cost is ~$115.
- The exe rename must land before the first depot upload — Steamworks warns about
  renaming a live exe.

Distribution.md is rewritten to SteamPipe mechanics (publish output, depot, steamcmd,
DLC wiring, clean-account purchase/refund test). product.md, decisions.md (a new
"Steam exclusive" entry with every dead vector), TASKS.md (Steamworks entitlement row,
Steam packaging row), ai.md, index.md and the TASK 48 banner follow. MyMistakes.md gains
the Steam rules that cost real time today: installs skip SmartScreen, updates are free,
the Wallet rule, and the recurring-billing caveat.
2026-10-31 11:05:53 -07:00
72 changed files with 2928 additions and 526 deletions
+4
View File
@@ -21,3 +21,7 @@ CREDENTIALS.md
.aider*
ffmpeg/
BuildCounter.txt
# Steamworks runtime (steam_api64.dll, 312 KB) — extracted from the SDK zip, never committed;
# scripts/steam-sdk.sh documents which file and why. Same rule as ffmpeg/: the pin is the audit trail.
steam/
+21
View File
@@ -0,0 +1,21 @@
<UserControl x:Class="ytLive.Controls.DeveloperPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- ⛔ THIS FILE IS EXCLUDED FROM THE RELEASE COMPILE (see ytLive.csproj: Page Remove +
Compile Remove under '$(Configuration) != Debug'). It is not merely hidden in a
Release build — its BAML never exists, so there is nothing to reveal. Do not add it
to a window or reference it from code that compiles in Release; the only host is
OverlayHost.xaml.cs inside #if DEBUG. -->
<StackPanel>
<TextBlock Text="Developer" Foreground="{StaticResource Brush.Attention}" FontSize="11"
FontWeight="SemiBold" Margin="0,10,0,2"/>
<CheckBox Margin="10,2,0,0" IsChecked="{Binding DeveloperMode, Mode=TwoWay}"
Foreground="{StaticResource Brush.OnSurface}"
Content="Developer mode — all resolutions, output budget ignored"/>
<TextBlock Text="Debug builds only. Overrides the free output profile (921,600 px / 30 fps). Never present in a release build."
Foreground="{StaticResource Brush.Attention}" FontSize="10" TextWrapping="Wrap"
Margin="10,4,0,8"/>
</StackPanel>
</UserControl>
+21
View File
@@ -0,0 +1,21 @@
using System.Windows.Controls;
namespace ytLive.Controls;
/// <summary>
/// The developer affordances that must never exist in a shipped build: today, the
/// all-resolutions override for the output profile.
///
/// <para><b>This file is excluded from the Release compile</b> (<c>ytLive.csproj</c> removes
/// the Page and this Compile item when <c>Configuration != Debug</c>), so a Release binary
/// contains no BAML for it and cannot reveal it. That is deliberate over the cheaper
/// "collapse the panel" approach: a collapsed panel still exists in the visual tree of every
/// shipped copy, and "not visible" is a much weaker claim than "not compiled".</para>
/// </summary>
public partial class DeveloperPanel : UserControl
{
public DeveloperPanel()
{
InitializeComponent();
}
}
+35 -1
View File
@@ -82,6 +82,11 @@
<MenuItem Header="Stream Alerts" Command="{Binding AddSourceCommand}" CommandParameter="{x:Static models:SourceType.AlertBox}"
IsEnabled="{Binding CanAddAlerts}"
ToolTip="Celebration zone for Super Chat &amp; memberships — one alert layer at a time"/>
<!-- Privacy blur: Live scene only (creator ruling 2026-11-01). Sits
above the desktop and below the brand logo; several allowed. -->
<MenuItem Header="Blur" Command="{Binding AddSourceCommand}" CommandParameter="{x:Static models:SourceType.Blur}"
Visibility="{Binding CanAddBlur, Converter={StaticResource BoolToVis}}"
ToolTip="Hide part of your desktop from viewers — box or circle"/>
</ContextMenu>
</Button.ContextMenu>
<Path Data="M12,4 L12,20 M4,12 L20,12" Stroke="{StaticResource Brush.Tertiary}" StrokeThickness="2"
@@ -309,6 +314,7 @@
<!-- Opacity + mirror/shape (draggable elements: image, webcam) -->
<StackPanel Visibility="{Binding SelectedElement.IsDraggable, Converter={StaticResource BoolToVis}}" Margin="0,0,0,8">
<StackPanel Visibility="{Binding SelectedElement.IsChatBox, Converter={StaticResource InverseBoolToVis}}">
<StackPanel Visibility="{Binding SelectedElement.IsBlur, Converter={StaticResource InverseBoolToVis}}">
<TextBlock Text="Opacity" Foreground="{StaticResource Brush.OnSurfaceVariant}" FontSize="11" Margin="0,0,0,2"/>
<DockPanel Margin="0,0,0,6">
<TextBlock x:Name="OpacityValueText" Text="100%" Foreground="{StaticResource Brush.OnSurfaceVariant}" FontSize="11"
@@ -317,6 +323,7 @@
Value="{Binding SelectedElement.Opacity, Mode=TwoWay}"
ValueChanged="OpacitySlider_ValueChanged" VerticalAlignment="Center"/>
</DockPanel>
</StackPanel>
</StackPanel>
<!-- TASK 59: the shape is a CHOICE (Rect | Circle) under a
"Shape" title, with Rect selected by default — the circle
@@ -339,6 +346,33 @@
</ToggleButton>
</StackPanel>
</StackPanel>
<!-- Privacy blur (creator ruling 2026-11-01): a shape choice and one
strength slider, on the SAME 0–1 scale and default as the
webcam's background blur — one radius curve, shared. -->
<StackPanel Visibility="{Binding IsBlurSelected, Converter={StaticResource BoolToVis}}" Margin="0,0,0,8">
<TextBlock Text="Blur" Foreground="{StaticResource Brush.OnSurfaceVariant}" FontSize="11" FontWeight="SemiBold" Margin="0,0,0,4"/>
<StackPanel Orientation="Horizontal" Margin="10,0,0,6">
<ToggleButton Style="{StaticResource SegmentToggle}" Padding="10,4"
IsChecked="{Binding SelectedElement.IsRectShape, Mode=TwoWay}">
<TextBlock Text="Box" Style="{StaticResource SegmentLabel}"/>
</ToggleButton>
<ToggleButton Style="{StaticResource SegmentToggle}" Padding="10,4" Margin="4,0,0,0"
IsChecked="{Binding SelectedElement.IsRoundShape, Mode=TwoWay}">
<TextBlock Text="Circle" Style="{StaticResource SegmentLabel}"/>
</ToggleButton>
</StackPanel>
<DockPanel Margin="10,0,0,4">
<TextBlock DockPanel.Dock="Right" Foreground="{StaticResource Brush.OnSurfaceVariant}" FontSize="11" VerticalAlignment="Center" Margin="8,0,0,0" Width="34">
<Run Text="{Binding SelectedElement.BlurAmount, Mode=OneWay, StringFormat={}{0:P0}}"/>
</TextBlock>
<Slider Minimum="0" Maximum="1" SmallChange="0.05" LargeChange="0.1"
Value="{Binding SelectedElement.BlurAmount, Mode=TwoWay}"
VerticalAlignment="Center"/>
</DockPanel>
<TextBlock Text="Strongest blur wins where they overlap — layers cannot add up."
Foreground="{StaticResource Brush.OnSurfaceVariant}" FontSize="10" TextWrapping="Wrap" Margin="10,2,0,0"/>
</StackPanel>
<!-- The drag hint sits under the shape row — indented, so the
parentage shows. -->
<TextBlock Text="Drag to move · drag the corner dot to resize"
@@ -351,7 +385,7 @@
IsWebcamSelected (the same condition as the mirror/shape row
above) so the webcam's border/background section stays the
one panel bound to SelectedElement.IsWebcam. -->
<StackPanel Visibility="{Binding IsWebcamSelected, Converter={StaticResource BoolToVis}}" Margin="0,0,0,8">
<StackPanel Visibility="{Binding SelectedElement.IsDraggable, Converter={StaticResource BoolToVis}}" Margin="0,0,0,8">
<TextBlock Text="Geometry" Foreground="{StaticResource Brush.OnSurfaceVariant}" FontSize="11" FontWeight="SemiBold" Margin="0,8,0,4"/>
<!-- TASK 61: the four fields share ONE fixed width — wide enough
for the largest geometry value (1920, plus a typed sign) and
+2 -80
View File
@@ -21,7 +21,7 @@
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Header -->
@@ -35,84 +35,6 @@
</Button>
</Grid>
<!-- App Settings: broadcast fields live in the preview's
Text pull-out now — this panel keeps app-level prefs only.
(Currently empty; the overlay shell stays for future use.) -->
<StackPanel Grid.Row="1" Margin="0,8,0,0"
Visibility="{Binding IsSettingsOpen, Converter={StaticResource BoolToVis}}">
<TextBlock Text="Recordings" Foreground="{StaticResource Brush.OnSurfaceVariant}" FontSize="11" FontWeight="SemiBold" Margin="0,8,0,2"/>
<TextBlock Text="Default location" Foreground="{StaticResource Brush.OnSurfaceVariant}" FontSize="11" Margin="10,0,0,2"/>
<DockPanel Margin="10,0,0,8">
<Button DockPanel.Dock="Right" Content="Browse…" Command="{Binding ChooseRecordFolderCommand}"
Style="{StaticResource YtButtonSecondary}" Padding="8,2" FontSize="11" Margin="6,0,0,0"/>
<Button DockPanel.Dock="Right" Content="Use Downloads" Command="{Binding ResetRecordFolderCommand}"
Style="{StaticResource YtButtonSecondary}" Padding="8,2" FontSize="11" Margin="6,0,0,0"/>
<TextBox Style="{StaticResource YtTextBoxCompact}" Text="{Binding RecordFolderDisplay, Mode=OneWay}"
IsReadOnly="True" Foreground="{StaticResource Brush.OnSurfaceVariant}" VerticalAlignment="Center"/>
</DockPanel>
<TextBlock Text="Brand logo" Foreground="{StaticResource Brush.OnSurfaceVariant}" FontSize="11" FontWeight="SemiBold" Margin="0,8,0,2"/>
<TextBlock Text="Image file (shown on every scene)" Foreground="{StaticResource Brush.OnSurfaceVariant}" FontSize="11" Margin="10,0,0,2"/>
<DockPanel Margin="10,0,0,8">
<Button DockPanel.Dock="Right" Content="Browse…" Command="{Binding BrowseBrandLogoCommand}"
Style="{StaticResource YtButtonSecondary}" Padding="8,2" FontSize="11" Margin="6,0,0,0"/>
<!-- A file NAME says nothing about the picture. The thumbnail shows what
is set; hovering enlarges it, a click collapses it again. -->
<Border x:Name="BrandLogoThumbFrame" DockPanel.Dock="Left" Width="28" Height="28"
Margin="0,0,6,0" CornerRadius="4" ClipToBounds="True"
Background="{StaticResource Brush.SurfaceContainerLowest}"
BorderBrush="{StaticResource Brush.Outline}" BorderThickness="1"
Cursor="Hand" ToolTip="Hover to enlarge — click to close"
Visibility="{Binding BrandLogoPreviewImage, Converter={StaticResource NotNullToVis}}">
<Image x:Name="BrandLogoThumbImage" Source="{Binding BrandLogoPreviewImage}"
Stretch="Uniform" MouseEnter="BrandLogoThumb_MouseEnter"
MouseLeave="BrandLogoThumb_MouseLeave"
MouseLeftButtonUp="BrandLogoThumb_Click"/>
</Border>
<TextBox Style="{StaticResource YtTextBoxCompact}" Text="{Binding BrandLogoFileDisplay, Mode=OneWay}"
IsReadOnly="True" Foreground="{StaticResource Brush.OnSurfaceVariant}" VerticalAlignment="Center"/>
</DockPanel>
<Popup x:Name="BrandLogoPreviewPopup" PlacementTarget="{Binding ElementName=BrandLogoThumbFrame}"
Placement="Right" HorizontalOffset="6" StaysOpen="True" AllowsTransparency="True"
IsHitTestVisible="True" MouseLeave="BrandLogoPreviewPopup_MouseLeave">
<Border Padding="6" CornerRadius="6"
Background="{StaticResource Brush.SurfaceContainerHighest}"
BorderBrush="{StaticResource Brush.Outline}" BorderThickness="1">
<StackPanel>
<Image Source="{Binding BrandLogoPreviewImage}" MaxWidth="420" MaxHeight="320"
Stretch="Uniform" RenderOptions.BitmapScalingMode="HighQuality"/>
<TextBlock Text="{Binding BrandLogoFileDisplay}" FontSize="11" Margin="0,6,0,0"
Foreground="{StaticResource Brush.OnSurfaceVariant}"/>
</StackPanel>
</Border>
</Popup>
<TextBlock Text="Preview" Foreground="{StaticResource Brush.OnSurfaceVariant}" FontSize="11" FontWeight="SemiBold" Margin="0,8,0,2"/>
<TextBlock Text="Zoom view shape" Foreground="{StaticResource Brush.OnSurfaceVariant}" FontSize="11" Margin="10,0,0,2"/>
<ComboBox Style="{StaticResource YtComboBox}" Margin="10,0,0,8" SelectedValue="{Binding ZoomShape}" SelectedValuePath="Tag">
<ComboBoxItem Content="Circle" Tag="{x:Static Models:ZoomShape.Circle}"/>
<ComboBoxItem Content="Phone (Vertical Rectangle)" Tag="{x:Static Models:ZoomShape.VerticalRectangle}"/>
<ComboBoxItem Content="Tablet (Horizontal Rectangle)" Tag="{x:Static Models:ZoomShape.HorizontalRectangle}"/>
</ComboBox>
<TextBlock Text="Scene transition" Foreground="{StaticResource Brush.OnSurfaceVariant}" FontSize="11" FontWeight="SemiBold" Margin="0,8,0,2"/>
<TextBlock Text="Type" Foreground="{StaticResource Brush.OnSurfaceVariant}" FontSize="11" Margin="10,0,0,2"/>
<ComboBox Style="{StaticResource YtComboBox}" Margin="10,0,0,8" SelectedValue="{Binding SelectedTransitionType}" SelectedValuePath="Tag">
<ComboBoxItem Content="Cut" Tag="{x:Static services:TransitionType.Cut}"/>
<ComboBoxItem Content="Fade" Tag="{x:Static services:TransitionType.Fade}"/>
<ComboBoxItem Content="Move" Tag="{x:Static services:TransitionType.Move}"/>
<ComboBoxItem Content="Wipe" Tag="{x:Static services:TransitionType.Wipe}"/>
</ComboBox>
<DockPanel Margin="10,0,0,6">
<TextBlock DockPanel.Dock="Right" Foreground="{StaticResource Brush.OnSurfaceVariant}" FontSize="11" VerticalAlignment="Center" Margin="8,0,0,0" Width="56">
<Run Text="{Binding TransitionDurationMs, StringFormat={}{0:0}}"/><Run Text=" ms"/>
</TextBlock>
<Slider Minimum="100" Maximum="2000" TickFrequency="50" IsSnapToTickEnabled="True"
Value="{Binding TransitionDurationMs, Mode=TwoWay}" VerticalAlignment="Center"/>
</DockPanel>
</StackPanel>
<!-- Report Bug -->
<StackPanel Grid.Row="1" Margin="0,16,0,0"
Visibility="{Binding IsBugOpen, Converter={StaticResource BoolToVis}}">
@@ -156,7 +78,7 @@
<!-- Hub view -->
<StackPanel Visibility="{Binding IsHubVisible, Converter={StaticResource BoolToVis}}">
<Image Source="/ytLive;component/Assets/llamacasty-logo.jpg" Height="125" Stretch="Uniform"
<Image Source="/LlamaCasty;component/Assets/llamacasty-logo.jpg" Height="125" Stretch="Uniform"
HorizontalAlignment="Center" Margin="0,0,0,12"/>
<TextBlock Text="{Binding AppVersionLabel}" Foreground="{StaticResource Brush.OnSurfaceVariant}" FontSize="12"
HorizontalAlignment="Center" Margin="0,4,0,0"/>
-30
View File
@@ -11,36 +11,6 @@ public partial class OverlayHost : UserControl
InitializeComponent();
}
/// <summary>Is the enlarged brand-logo preview showing? Test seam — a Popup is a separate
/// window, so nothing else can observe it.</summary>
internal bool IsBrandLogoPreviewOpen => BrandLogoPreviewPopup.IsOpen;
/// <summary>Hover opens the enlargement. Nothing to show when no image is set, so the
/// thumbnail simply does nothing in that case.</summary>
private void BrandLogoThumb_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e)
=> OpenBrandLogoPreview();
/// <summary>Leaving the thumbnail closes it — unless the pointer walked onto the popup
/// itself (which sits beside it), where it stays put so the creator can look closely.</summary>
private void BrandLogoThumb_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e)
{
if (BrandLogoPreviewPopup.Child?.IsMouseOver == true) return;
CloseBrandLogoPreview();
}
/// <summary>A click collapses the enlargement — the explicit "enough, thanks" gesture.</summary>
private void BrandLogoThumb_Click(object sender, System.Windows.Input.MouseButtonEventArgs e)
=> CloseBrandLogoPreview();
private void BrandLogoPreviewPopup_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e)
=> CloseBrandLogoPreview();
/// <summary>The thumbnail is hidden when no image is set (see the XAML), so there is nothing
/// to open in that case — no empty frame can appear.</summary>
internal void OpenBrandLogoPreview() => BrandLogoPreviewPopup.IsOpen = true;
internal void CloseBrandLogoPreview() => BrandLogoPreviewPopup.IsOpen = false;
private void BackToAbout_Click(object sender, RoutedEventArgs e)
{
if (DataContext is MainViewModel vm)
+91 -6
View File
@@ -2,7 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Helpers="clr-namespace:ytLive.Helpers"
xmlns:local="clr-namespace:ytLive">
xmlns:local="clr-namespace:ytLive" xmlns:controls="clr-namespace:ytLive.Controls">
<Border Background="{StaticResource Brush.SurfaceContainerLowest}" CornerRadius="6" Margin="8,0"
BorderBrush="{Binding PreviewGlowBrush}" BorderThickness="{Binding PreviewGlowThickness}">
<Grid>
@@ -20,6 +20,11 @@
PreviewMouseRightButtonUp="Preview_MouseRightButtonUp">
<Viewbox Stretch="Uniform">
<Canvas x:Name="PreviewCanvas" Width="1920" Height="1080" ClipToBounds="True">
<!-- Privacy blur preview (2026-11-01): the blur is UNIVERSAL — it covers
every layer beneath it, so this host sits ABOVE the whole CanvasGrid
rather than inside it. Each child samples CanvasGrid (all layers, no
recursion because this canvas is a sibling) at the blur's rect and
carries a BlurEffect at the output's strength. -->
<Grid x:Name="CanvasGrid" Width="1920" Height="1080" ClipToBounds="True" Background="Transparent">
<Grid.RenderTransform>
<TransformGroup>
@@ -465,6 +470,14 @@
<VisualBrush x:Name="ZoomVisualBrush" ViewboxUnits="Absolute" Stretch="Fill"/>
</Grid.Background>
</Grid>
<Canvas x:Name="BlurPreviewHost" Width="1920" Height="1080" IsHitTestVisible="False"/>
<!-- The brand logo rides ABOVE the blur host, mirroring the compositor:
a privacy blur can never swallow it. -->
<Image Canvas.Left="{Binding StagedBrandLogo.X}" Canvas.Top="{Binding StagedBrandLogo.Y}"
Width="{Binding StagedBrandLogo.Width}" Height="{Binding StagedBrandLogo.Height}"
Source="{Binding StagedBrandLogo.DisplaySource}" Stretch="Fill"
IsHitTestVisible="False"
Visibility="{Binding StagedBrandLogo, Converter={StaticResource NotNullToVis}}"/>
</Canvas>
</Viewbox>
<Border HorizontalAlignment="Left" VerticalAlignment="Top" Margin="8,8,0,0"
@@ -538,7 +551,7 @@
</Style>
</Border.Style>
<!-- Fixed-width inner so text never reflows mid-animation -->
<Grid Width="320" Margin="14,10,14,12">
<Grid Margin="14,10,20,12">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
@@ -627,7 +640,7 @@
</Style.Triggers>
</Style>
</Border.Style>
<Grid Width="320" Margin="14,10,14,12">
<Grid Margin="14,10,20,12">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
@@ -684,7 +697,7 @@
</Style.Triggers>
</Style>
</Border.Style>
<Grid Width="320" Margin="14,10,14,12">
<Grid Margin="14,10,20,12">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
@@ -818,7 +831,7 @@
</Style.Triggers>
</Style>
</Border.Style>
<Grid Width="320" Margin="14,10,14,12">
<Grid Margin="14,10,20,12">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
@@ -881,8 +894,80 @@
</StackPanel>
</Grid>
</Border>
<!-- The Settings drawer: same animated-width pattern as the other
pull-outs, opened by the gear rail tab (creator ruling 2026-11-01).
Settings used to be a centred modal; it is a drawer now. -->
<Border Background="{StaticResource Brush.SurfaceContainer}" ClipToBounds="True">
<Border.Style>
<Style TargetType="Border">
<Setter Property="Width" Value="0"/>
<Style.Triggers>
<DataTrigger Binding="{Binding SettingsDrawerOpen}" Value="True">
<DataTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="Width"
To="320" Duration="0:0:0.2">
<DoubleAnimation.EasingFunction>
<CubicEase EasingMode="EaseOut"/>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
<DataTrigger.ExitActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="Width"
To="0" Duration="0:0:0.2">
<DoubleAnimation.EasingFunction>
<CubicEase EasingMode="EaseOut"/>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
</Storyboard>
</BeginStoryboard>
</DataTrigger.ExitActions>
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
<Grid Margin="14,10,20,12">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0" Margin="0,0,0,8">
<TextBlock Text="SETTINGS" Style="{StaticResource SectionHeader}" HorizontalAlignment="Left"/>
<Button HorizontalAlignment="Right" VerticalAlignment="Top"
Background="Transparent" BorderThickness="0" Cursor="Hand"
Command="{Binding OpenSettingsCommand}"
ToolTip="Close">
<Button.Template>
<ControlTemplate TargetType="Button">
<ContentPresenter/>
</ControlTemplate>
</Button.Template>
<TextBlock Text="✕" Foreground="{StaticResource Brush.OnSurfaceVariant}" FontSize="14" FontWeight="Bold"/>
</Button>
</Grid>
<controls:SettingsDrawer Grid.Row="1"/>
</Grid>
</Border>
<!-- The stacked white tabs -->
<StackPanel Orientation="Vertical" HorizontalAlignment="Right" VerticalAlignment="Stretch">
<StackPanel Orientation="Vertical" HorizontalAlignment="Right" VerticalAlignment="Center">
<!-- Settings: the first tab, orange, gear only (creator ruling
2026-11-01). A left click opens the Settings DRAWER immediately
— same behaviour as the other rail tabs. The app menu (Report
Bug / Feature Request / About) moved to a right-click on the
LlamaCasty wordmark in the top bar. -->
<Border Width="30" VerticalAlignment="Center" Background="{StaticResource Brush.Attention}"
CornerRadius="4,0,0,4" Padding="0,10" Cursor="Hand" Margin="0,4,0,0"
ToolTip="Settings"
MouseLeftButtonUp="SettingsTab_Click">
<Path Data="M19.43,12.98c0.04,-0.32 0.07,-0.65 0.07,-0.98c0,-0.33 -0.03,-0.66 -0.07,-0.98l2.11,-1.65c0.19,-0.15 0.24,-0.42 0.12,-0.64l-2,-3.46c-0.12,-0.22 -0.38,-0.31 -0.61,-0.22l-2.49,1c-0.52,-0.4 -1.08,-0.73 -1.69,-0.98l-0.38,-2.65C14.46,2.18 14.25,2 14,2h-4c-0.25,0 -0.46,0.18 -0.49,0.42l-0.38,2.65c-0.61,0.25 -1.17,0.59 -1.69,0.98l-2.49,-1c-0.23,-0.09 -0.49,0 -0.61,0.22l-2,3.46c-0.13,0.22 -0.07,0.49 0.12,0.64l2.11,1.65c-0.04,0.32 -0.07,0.65 -0.07,0.98c0,0.33 0.03,0.66 0.07,0.98l-2.11,1.65c-0.19,0.15 -0.24,0.42 -0.12,0.64l2,3.46c0.12,0.22 0.38,0.31 0.61,0.22l2.49,-1c0.52,0.4 1.08,0.73 1.69,0.98l0.38,2.65c0.03,0.24 0.24,0.42 0.49,0.42h4c0.25,0 0.46,-0.18 0.49,-0.42l0.38,-2.65c0.61,-0.25 1.17,-0.59 1.69,-0.98l2.49,1c0.23,0.09 0.49,0 0.61,-0.22l2,-3.46c0.12,-0.22 0.07,-0.49 -0.12,-0.64L19.43,12.98zM12,15.5c-1.93,0 -3.5,-1.57 -3.5,-3.5c0,-1.93 1.57,-3.5 3.5,-3.5c1.93,0 3.5,1.57 3.5,3.5C15.5,13.93 13.93,15.5 12,15.5z"
Fill="{StaticResource Brush.Background}" Width="18" Height="18" Stretch="Uniform"
HorizontalAlignment="Center"/>
</Border>
<Border Width="30" VerticalAlignment="Center" Background="{StaticResource Brush.Youtube}"
CornerRadius="4,0,0,4" Padding="0,10" Cursor="Hand" Margin="0,4,0,0"
ToolTip="Broadcast text fields">
+161 -21
View File
@@ -47,6 +47,7 @@ public partial class PreviewPane : UserControl
newVm.PreviewTransition += PlayPreviewTransition;
UpdateZoomBox();
UpdateSelectedLayerZOrder();
HookBlurPreview();
}
}
@@ -402,6 +403,18 @@ public partial class PreviewPane : UserControl
e.Handled = true;
}
/// <summary>Is this canvas point inside the social bar? It is a full-width strip at the top or
/// bottom of the frame and it consumes its own click, so the preview's tunnelling handler has
/// to step aside (see <c>Preview_MouseLeftButtonDown</c>).</summary>
private bool IsOverSocialBar(Point canvasPoint)
{
if (DataContext is not MainViewModel { SocialBarVisible: true }) return false;
if (SocialBarElement.ActualHeight <= 0) return false;
var topLeft = SocialBarElement.TranslatePoint(new Point(0, 0), CanvasGrid);
return new Rect(topLeft, SocialBarElement.RenderSize).Contains(canvasPoint);
}
private void SocialsButton_MouseEnter(object sender, MouseEventArgs e)
{
if (SocialBarElement == null) return;
@@ -451,14 +464,35 @@ public partial class PreviewPane : UserControl
private void Preview_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
var vm = DataContext as MainViewModel;
if (vm is null || !vm.IsEditMode) return;
if (vm is null) return;
var grid = (Grid)sender;
var toCanvas = CanvasGrid.TransformToVisual(grid).Inverse;
var p = toCanvas.Transform(e.GetPosition(grid));
// The social bar owns its own left-click (toggle top ⇄ bottom). This handler is the
// TUNNELLING preview event, so it fires before the bar's bubbling handler: without this
// guard the bar would be unclickable in preview mode (zoom would win) and, in edit mode,
// it would drag whatever layer sat underneath it.
if (IsOverSocialBar(p)) return;
// Preview mode (EDIT off): the left button drives the zoom box — the common gesture in
// the mode where nothing is editable. Dragging it afterwards is handled by MouseMove.
if (!vm.IsEditMode)
{
vm.ToggleZoom(p.X, p.Y);
e.Handled = true;
return;
}
// Zoom freezes the layers (creator ruling 2026-11-01): while the magnifier is up, a left
// drag moves the box and NEVER picks up a layer underneath it. MouseMove owns the drag.
if (vm.IsZoomActive) return;
var selected = vm.SelectedElement;
if (selected is { } sel && IsDraggableElement(sel) && HitHandle(e.GetPosition(grid), sel))
{
vm.PushPreviewUndo();
_isResizing = true;
_resizeAspect = sel.ClipShape == ClipShape.Round ? 1 : sel.Width / Math.Max(1, sel.Height);
grid.CaptureMouse();
@@ -470,6 +504,9 @@ public partial class PreviewPane : UserControl
if (hit != null)
{
vm.SelectedElement = hit;
// One snapshot per gesture: pushing inside the move loop would fill the stack with
// a hundred one-pixel steps.
vm.PushPreviewUndo();
_isDraggingOverlay = true;
_grabOffset = new Point(p.X - hit.X, p.Y - hit.Y);
grid.CaptureMouse();
@@ -572,32 +609,29 @@ public partial class PreviewPane : UserControl
private void Preview_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
{
// Ctrl + right-click opens the element / backdrop context menu — sources and windows can
// be changed at ANY time, live or not (creator ruling 2026-10-30). Plain right-click stays
// with the zoom box, which is why the menu needed its own chord.
// Returning without Handled lets WPF's ContextMenuService open the menu under the cursor.
if ((Keyboard.Modifiers & ModifierKeys.Control) != 0) return;
// Right-click = the context menu, in both modes (creator ruling 2026-11-01).
// Ctrl+right-click = the zoom box, EDIT MODE ONLY: the creator asked for no two-handed
// chords while live or recording, so the preview swallows Ctrl+right-click instead of
// letting it fall through to the menu. Returning without Handled is what lets WPF's
// ContextMenuService open the menu under the cursor.
var vm = DataContext as MainViewModel;
if (vm == null) return;
var grid = (Grid)sender;
var toCanvas = CanvasGrid.TransformToVisual(grid).Inverse;
var p = toCanvas.Transform(e.GetPosition(grid));
if ((vm.IsLive || vm.IsRecording) && !vm.IsEditMode)
if (vm is null) return;
if ((Keyboard.Modifiers & ModifierKeys.Control) == 0) return;
if (!vm.IsEditMode)
{
if (vm.IsZoomActive)
{
vm.DismissZoom();
e.Handled = true;
return;
}
vm.ActivateZoom(p.X, p.Y);
e.Handled = true;
return;
}
vm.ToggleZoom();
var grid = (Grid)sender;
var toCanvas = CanvasGrid.TransformToVisual(grid).Inverse;
var p = toCanvas.Transform(e.GetPosition(grid));
vm.ToggleZoom(p.X, p.Y);
e.Handled = true;
} private void Preview_MouseRightButtonUp(object sender, MouseButtonEventArgs e)
}
private void Preview_MouseRightButtonUp(object sender, MouseButtonEventArgs e)
{
if (_isZoomDragging)
{
@@ -608,6 +642,13 @@ public partial class PreviewPane : UserControl
e.Handled = true;
return;
}
// WPF's PopupControlService opens a context menu on right-button-UP, not down — so
// handling the Down event alone still let a menu appear under a Ctrl+right-click (found
// by the creator in edit mode, 2026-11-01). Swallow the Up event too, in both modes:
// Down decides the action, Up must not undo that decision.
if ((Keyboard.Modifiers & ModifierKeys.Control) != 0)
e.Handled = true;
}
private void EndPreviewDrag(Grid grid)
@@ -689,4 +730,103 @@ public partial class PreviewPane : UserControl
ZoomVisualBrush.Visual = null;
}
}
/// <summary>Rail settings tab (creator ruling 2026-11-01): a left click opens the Settings
/// DRAWER immediately, exactly like the other rail tabs — no menu, no modal.</summary>
private void SettingsTab_Click(object sender, MouseButtonEventArgs e)
{
if (DataContext is MainViewModel vm) vm.ToggleSettingsDrawer();
e.Handled = true;
}
// ─── Privacy blur preview (2026-11-01) ───
// The editor has to show the blur it is about to bake into the output, and the blur is
// UNIVERSAL: it covers every layer, webcam and chat included. Each blur becomes a
// rectangle/ellipse filled with a VisualBrush of the whole CanvasGrid sampled at that rect,
// with a BlurEffect at the same strength the compositor uses. The host canvas is a SIBLING
// above CanvasGrid, which is what stops the brush from sampling itself.
private MainViewModel? _blurVm;
private Scene? _blurScene;
private void HookBlurPreview()
{
if (_blurVm != null) _blurVm.PropertyChanged -= BlurViewModelChanged;
_blurVm = DataContext as MainViewModel;
if (_blurVm != null) _blurVm.PropertyChanged += BlurViewModelChanged;
HookBlurScene();
}
private void BlurViewModelChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
{
if (e.PropertyName is nameof(MainViewModel.StagedScene)) HookBlurScene();
else if (e.PropertyName is nameof(MainViewModel.ActiveBackgroundImage)
or nameof(MainViewModel.BackgroundImage)) RebuildBlurPreview();
}
private void HookBlurScene()
{
if (_blurScene != null)
{
_blurScene.Elements.CollectionChanged -= BlurElementsChanged;
foreach (var element in _blurScene.Elements) element.PropertyChanged -= BlurElementChanged;
}
_blurScene = _blurVm?.StagedScene;
if (_blurScene != null)
{
_blurScene.Elements.CollectionChanged += BlurElementsChanged;
foreach (var element in _blurScene.Elements) element.PropertyChanged += BlurElementChanged;
}
RebuildBlurPreview();
}
private void BlurElementsChanged(object? sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
{
foreach (var element in e.OldItems?.OfType<SceneElement>() ?? System.Linq.Enumerable.Empty<SceneElement>())
element.PropertyChanged -= BlurElementChanged;
foreach (var element in e.NewItems?.OfType<SceneElement>() ?? System.Linq.Enumerable.Empty<SceneElement>())
element.PropertyChanged += BlurElementChanged;
RebuildBlurPreview();
}
private void BlurElementChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
{
if (sender is Source { IsBlur: true }) RebuildBlurPreview();
}
/// <summary>Rebuild one overlay shape per visible blur. Cheap by design: a handful of shapes,
/// and the VisualBrush samples the live backdrop so the preview keeps moving underneath.</summary>
private void RebuildBlurPreview()
{
if (BlurPreviewHost == null) return;
BlurPreviewHost.Children.Clear();
if (_blurScene == null) return;
foreach (var blur in _blurScene.Elements.OfType<Source>()
.Where(s => s.IsBlur && s.IsVisible && s.Width > 0 && s.Height > 0))
{
var shape = new Rectangle
{
Width = blur.Width,
Height = blur.Height,
Fill = new VisualBrush(CanvasGrid)
{
Viewbox = new Rect(blur.X, blur.Y, blur.Width, blur.Height),
ViewboxUnits = BrushMappingMode.Absolute,
Stretch = Stretch.Fill,
},
// 4..24 px at master scale, the same shape of curve the compositor's radius uses.
Effect = new BlurEffect { Radius = 4 + 20 * Math.Clamp(blur.BlurAmount, 0, 1), KernelType = KernelType.Gaussian },
};
if (blur.ClipShape == ClipShape.Round)
shape.Clip = new EllipseGeometry(new Rect(0, 0, blur.Width, blur.Height));
Canvas.SetLeft(shape, blur.X);
Canvas.SetTop(shape, blur.Y);
BlurPreviewHost.Children.Add(shape);
}
}
}
+104
View File
@@ -0,0 +1,104 @@
<UserControl x:Class="ytLive.Controls.SettingsDrawer"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:models="clr-namespace:ytLive.Models"
xmlns:services="clr-namespace:ytLive.Services">
<!-- App Settings, as a RIGHT-EDGE PULL-OUT (creator ruling 2026-11-01): the gear tab opens
this drawer immediately, in the same animated-width pattern as Stream Settings / YPP /
Socials / TEST. It used to be a centred modal overlay, which then needed its own scroll
viewer once the section list outgrew the shell — a drawer has the height of the preview
and that problem disappears.
Categories are headings; their controls are indented under them (Zoom is one). -->
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
<StackPanel Margin="0,0,0,0">
<!-- ═══ RECORDINGS ═══ -->
<TextBlock Text="Recordings" Style="{StaticResource SectionHeader}" Margin="0,0,0,4"/>
<TextBlock Text="Default location" Foreground="{StaticResource Brush.OnSurfaceVariant}" FontSize="11" Margin="10,0,0,2"/>
<DockPanel Margin="10,0,0,10">
<Button DockPanel.Dock="Right" Content="Browse…" Command="{Binding ChooseRecordFolderCommand}"
Style="{StaticResource YtButtonSecondary}" Padding="8,2" FontSize="11" Margin="6,0,0,0"/>
<Button DockPanel.Dock="Right" Content="Use Downloads" Command="{Binding ResetRecordFolderCommand}"
Style="{StaticResource YtButtonSecondary}" Padding="8,2" FontSize="11" Margin="6,0,0,0"/>
<TextBox Style="{StaticResource YtTextBoxCompact}" Text="{Binding RecordFolderDisplay, Mode=OneWay}"
IsReadOnly="True" Foreground="{StaticResource Brush.OnSurfaceVariant}" VerticalAlignment="Center"/>
</DockPanel>
<!-- ═══ BRAND ═══ -->
<TextBlock Text="Brand logo" Style="{StaticResource SectionHeader}" Margin="0,6,0,4"/>
<TextBlock Text="Image file (shown on every scene)" Foreground="{StaticResource Brush.OnSurfaceVariant}" FontSize="11" Margin="10,0,0,2"/>
<DockPanel Margin="10,0,0,10">
<Button DockPanel.Dock="Right" Content="Browse…" Command="{Binding BrowseBrandLogoCommand}"
Style="{StaticResource YtButtonSecondary}" Padding="8,2" FontSize="11" Margin="6,0,0,0"/>
<!-- A file NAME says nothing about the picture. The thumbnail shows what is set;
hovering enlarges it, a click collapses it again. -->
<Border x:Name="BrandLogoThumbFrame" DockPanel.Dock="Left" Width="28" Height="28"
Margin="0,0,6,0" CornerRadius="4" ClipToBounds="True"
Background="{StaticResource Brush.SurfaceContainerLowest}"
BorderBrush="{StaticResource Brush.Outline}" BorderThickness="1"
Cursor="Hand" ToolTip="Hover to enlarge — click to close"
Visibility="{Binding BrandLogoPreviewImage, Converter={StaticResource NotNullToVis}}">
<Image x:Name="BrandLogoThumbImage" Source="{Binding BrandLogoPreviewImage}"
Stretch="Uniform" MouseEnter="BrandLogoThumb_MouseEnter"
MouseLeave="BrandLogoThumb_MouseLeave"
MouseLeftButtonUp="BrandLogoThumb_Click"/>
</Border>
<TextBox Style="{StaticResource YtTextBoxCompact}" Text="{Binding BrandLogoFileDisplay, Mode=OneWay}"
IsReadOnly="True" Foreground="{StaticResource Brush.OnSurfaceVariant}" VerticalAlignment="Center"/>
</DockPanel>
<Popup x:Name="BrandLogoPreviewPopup" PlacementTarget="{Binding ElementName=BrandLogoThumbFrame}"
Placement="Left" HorizontalOffset="-6" StaysOpen="True" AllowsTransparency="True"
IsHitTestVisible="True" MouseLeave="BrandLogoPreviewPopup_MouseLeave">
<Border Padding="6" CornerRadius="6"
Background="{StaticResource Brush.SurfaceContainerHighest}"
BorderBrush="{StaticResource Brush.Outline}" BorderThickness="1">
<StackPanel>
<Image Source="{Binding BrandLogoPreviewImage}" MaxWidth="420" MaxHeight="320"
Stretch="Uniform" RenderOptions.BitmapScalingMode="HighQuality"/>
<TextBlock Text="{Binding BrandLogoFileDisplay}" FontSize="11" Margin="0,6,0,0"
Foreground="{StaticResource Brush.OnSurfaceVariant}"/>
</StackPanel>
</Border>
</Popup>
<!-- ═══ ZOOM ═══ -->
<TextBlock Text="Zoom" Style="{StaticResource SectionHeader}" Margin="0,6,0,4"/>
<TextBlock Text="Zoom view shape" Foreground="{StaticResource Brush.OnSurfaceVariant}" FontSize="11" Margin="10,0,0,2"/>
<ComboBox Style="{StaticResource YtComboBox}" Margin="10,0,0,8" SelectedValue="{Binding ZoomShape}" SelectedValuePath="Tag">
<ComboBoxItem Content="Circle" Tag="{x:Static models:ZoomShape.Circle}"/>
<ComboBoxItem Content="Phone (Vertical Rectangle)" Tag="{x:Static models:ZoomShape.VerticalRectangle}"/>
<ComboBoxItem Content="Tablet (Horizontal Rectangle)" Tag="{x:Static models:ZoomShape.HorizontalRectangle}"/>
</ComboBox>
<DockPanel Margin="10,0,0,10">
<ToggleButton DockPanel.Dock="Right" Style="{StaticResource PillToggle}"
IsChecked="{Binding ZoomFollowsBox, Mode=TwoWay}" VerticalAlignment="Center"
ToolTip="Off: the box magnifies the area you clicked. On: it magnifies whatever it hovers over."/>
<TextBlock Text="Zoom box follows" Foreground="{StaticResource Brush.OnSurface}" FontSize="11" VerticalAlignment="Center"/>
</DockPanel>
<!-- ═══ SCENE TRANSITIONS ═══ -->
<TextBlock Text="Scene transition" Style="{StaticResource SectionHeader}" Margin="0,6,0,4"/>
<TextBlock Text="Type" Foreground="{StaticResource Brush.OnSurfaceVariant}" FontSize="11" Margin="10,0,0,2"/>
<ComboBox Style="{StaticResource YtComboBox}" Margin="10,0,0,8" SelectedValue="{Binding SelectedTransitionType}" SelectedValuePath="Tag">
<ComboBoxItem Content="Cut" Tag="{x:Static services:TransitionType.Cut}"/>
<ComboBoxItem Content="Fade" Tag="{x:Static services:TransitionType.Fade}"/>
<ComboBoxItem Content="Move" Tag="{x:Static services:TransitionType.Move}"/>
<ComboBoxItem Content="Wipe" Tag="{x:Static services:TransitionType.Wipe}"/>
</ComboBox>
<DockPanel Margin="10,0,0,10">
<TextBlock DockPanel.Dock="Right" Foreground="{StaticResource Brush.OnSurfaceVariant}" FontSize="11" VerticalAlignment="Center" Margin="8,0,0,0" Width="56">
<Run Text="{Binding TransitionDurationMs, StringFormat={}{0:0}}"/><Run Text=" ms"/>
</TextBlock>
<Slider Minimum="100" Maximum="2000" TickFrequency="50" IsSnapToTickEnabled="True"
Value="{Binding TransitionDurationMs, Mode=TwoWay}" VerticalAlignment="Center"/>
</DockPanel>
<!-- Development panel host. Empty in a Release build: the panel itself is excluded
from the Release compile, and the code-behind only fills this inside #if DEBUG. -->
<StackPanel x:Name="DeveloperPanelHost"/>
</StackPanel>
</ScrollViewer>
</UserControl>
+58
View File
@@ -0,0 +1,58 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
namespace ytLive.Controls;
/// <summary>
/// App Settings as a right-edge pull-out (creator ruling 2026-11-01). Hosted by
/// <see cref="PreviewPane"/>'s drawer stack and opened by the gear rail tab, exactly like Stream
/// Settings / YPP / Socials / TEST.
///
/// <para>Born from the modal overlay: that shell was MaxHeight 700, so once the section list grew
/// the bottom options were clipped and unreachable — including the zoom shape the creator was
/// looking for. A drawer is the height of the preview, so the list can grow without a second
/// scroll decision to get wrong.</para>
/// </summary>
public partial class SettingsDrawer : UserControl
{
public SettingsDrawer()
{
InitializeComponent();
#if DEBUG
// Development affordances are added at runtime, never declared in XAML: the panel is
// excluded from the Release compile (ytLive.csproj), so this line is the only reference.
DeveloperPanelHost.Children.Add(new DeveloperPanel());
#endif
}
/// <summary>Is the enlarged brand-logo preview showing? Test seam — a Popup is a separate
/// window, so nothing else can observe it.</summary>
internal bool IsBrandLogoPreviewOpen => BrandLogoPreviewPopup.IsOpen;
/// <summary>The thumbnail is hidden when no image is set (see the XAML), so there is nothing to
/// open in that case — no empty frame can appear.</summary>
internal void OpenBrandLogoPreview() => BrandLogoPreviewPopup.IsOpen = true;
internal void CloseBrandLogoPreview() => BrandLogoPreviewPopup.IsOpen = false;
/// <summary>Hover opens the enlargement. Nothing to show when no image is set, so the
/// thumbnail simply does nothing in that case.</summary>
private void BrandLogoThumb_MouseEnter(object sender, MouseEventArgs e)
=> BrandLogoPreviewPopup.IsOpen = true;
/// <summary>Leaving the thumbnail closes it — unless the pointer walked onto the popup
/// itself, where it stays put so the creator can look closely.</summary>
private void BrandLogoThumb_MouseLeave(object sender, MouseEventArgs e)
{
if (BrandLogoPreviewPopup.Child?.IsMouseOver == true) return;
BrandLogoPreviewPopup.IsOpen = false;
}
/// <summary>A click collapses the enlargement — the explicit "enough, thanks" gesture.</summary>
private void BrandLogoThumb_Click(object sender, MouseButtonEventArgs e)
=> BrandLogoPreviewPopup.IsOpen = false;
private void BrandLogoPreviewPopup_MouseLeave(object sender, MouseEventArgs e)
=> BrandLogoPreviewPopup.IsOpen = false;
}
+34 -29
View File
@@ -5,18 +5,38 @@
x:Name="TopBarRoot">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<!-- 352 = the layers panel's right edge in the work area below: window margin 8 +
360px column = 368, minus this bar's own 16px padding. EDIT is right-aligned in
this column so the two edges line up exactly (creator ruling 2026-11-01). -->
<ColumnDefinition Width="352"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<!-- LOGO / BRAND — clicking opens the in-app About overlay; the gear sits
a couple characters past the build stamp and opens App Settings. -->
<StackPanel Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center"
Margin="0,0,24,0">
<Button Background="Transparent" BorderThickness="0" Cursor="Hand"
VerticalAlignment="Center" ToolTip="About LlamaCasty"
Command="{Binding OpenAboutCommand}">
<!-- BRAND + EDIT. The gear moved to the preview's right rail, first tab (2026-11-01):
app-level actions live with the other pull-outs now. -->
<Grid Grid.Column="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<!-- LOGO / BRAND — left-click opens the in-app About overlay; right-click opens the app
menu (Report Bug / Feature Request / About). App Settings is no longer in this
menu: the gear rail tab opens the Settings drawer directly (creator ruling
2026-11-01). -->
<Button Grid.Column="0" Background="Transparent" BorderThickness="0" Cursor="Hand"
HorizontalAlignment="Left"
VerticalAlignment="Center" ToolTip="About LlamaCasty — right-click for the menu"
Command="{Binding OpenAboutCommand}"
PreviewMouseRightButtonDown="BrandWordmark_PreviewMouseRightButtonDown">
<Button.ContextMenu>
<ContextMenu DataContext="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource Self}}">
<MenuItem Header="Report Bug" Command="{Binding OpenBugCommand}"/>
<MenuItem Header="Feature Request" Command="{Binding OpenFeatureCommand}"/>
<MenuItem Header="About" Command="{Binding OpenAboutCommand}"/>
</ContextMenu>
</Button.ContextMenu>
<Button.Template>
<ControlTemplate TargetType="Button">
<ContentPresenter/>
@@ -32,28 +52,13 @@
ToolTipService.ToolTip="{x:Static helpers:BuildStamp.Label}"/><Run Text=" " FontSize="4"/>
</TextBlock>
</Button>
<!-- Settings gear (user directive): a couple characters beyond the brand,
nudged right a couple more places 2026-09-22 (build 77 feedback).
Moved up from the bottom bar — one menu: App Settings / Bug / Feature / About. -->
<Button Style="{StaticResource IconButton}" Margin="18,0,0,2" VerticalAlignment="Center"
ToolTip="Menu" Click="GearButton_Click" PreviewMouseRightButtonDown="GearButton_PreviewMouseRightButtonDown">
<Button.ContextMenu>
<ContextMenu DataContext="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource Self}}">
<MenuItem Header="App Settings" Command="{Binding OpenSettingsCommand}"/>
<Separator/>
<MenuItem Header="Report Bug" Command="{Binding OpenBugCommand}"/>
<MenuItem Header="Feature Request" Command="{Binding OpenFeatureCommand}"/>
<MenuItem Header="About" Command="{Binding OpenAboutCommand}"/>
</ContextMenu>
</Button.ContextMenu>
<Path Data="M19.43,12.98c0.04,-0.32 0.07,-0.65 0.07,-0.98c0,-0.33 -0.03,-0.66 -0.07,-0.98l2.11,-1.65c0.19,-0.15 0.24,-0.42 0.12,-0.64l-2,-3.46c-0.12,-0.22 -0.38,-0.31 -0.61,-0.22l-2.49,1c-0.52,-0.4 -1.08,-0.73 -1.69,-0.98l-0.38,-2.65C14.46,2.18 14.25,2 14,2h-4c-0.25,0 -0.46,0.18 -0.49,0.42l-0.38,2.65c-0.61,0.25 -1.17,0.59 -1.69,0.98l-2.49,-1c-0.23,-0.09 -0.49,0 -0.61,0.22l-2,3.46c-0.13,0.22 -0.07,0.49 0.12,0.64l2.11,1.65c-0.04,0.32 -0.07,0.65 -0.07,0.98c0,0.33 0.03,0.66 0.07,0.98l-2.11,1.65c-0.19,0.15 -0.24,0.42 -0.12,0.64l2,3.46c0.12,0.22 0.38,0.31 0.61,0.22l2.49,-1c0.52,0.4 1.08,0.73 1.69,0.98l0.38,2.65c0.03,0.24 0.24,0.42 0.49,0.42h4c0.25,0 0.46,-0.18 0.49,-0.42l0.38,-2.65c0.61,-0.25 1.17,-0.59 1.69,-0.98l2.49,1c0.23,0.09 0.49,0 0.61,-0.22l2,-3.46c0.12,-0.22 0.07,-0.49 -0.12,-0.64L19.43,12.98zM12,15.5c-1.93,0 -3.5,-1.57 -3.5,-3.5c0,-1.93 1.57,-3.5 3.5,-3.5c1.93,0 3.5,1.57 3.5,3.5C15.5,13.93 13.93,15.5 12,15.5z"
Fill="{StaticResource Brush.Attention}" Width="18" Height="18" Stretch="Uniform"/>
</Button>
<!-- EDIT: explicit toggle. Neutral = off (chat), blue = on (layers/properties). The
trigger used to set the SAME colour as the resting state, so the button never
looked pressed. -->
<ToggleButton IsChecked="{Binding EditingActive, Mode=TwoWay}" Content="EDIT"
Cursor="Hand" Height="32" Padding="14,0" Margin="18,0,0,2" VerticalAlignment="Center"
looked pressed. Right edge aligns with the layers panel below. -->
<ToggleButton Grid.Column="1" IsChecked="{Binding EditingActive, Mode=TwoWay}" Content="EDIT"
Cursor="Hand" Height="32" Padding="14,0" Margin="18,0,0,2"
HorizontalAlignment="Right" VerticalAlignment="Center"
FontWeight="Bold" FontSize="12" Foreground="{StaticResource Brush.OnAccent}" BorderThickness="0">
<ToggleButton.Template>
<ControlTemplate TargetType="ToggleButton">
@@ -68,7 +73,7 @@
</ControlTemplate>
</ToggleButton.Template>
</ToggleButton>
</StackPanel>
</Grid>
<!-- Session surface (top bar redesign): the bar is ONE surface rendered by
the FIRST decision — Record or Stream. Each world is the whole bar; the
+10 -16
View File
@@ -21,31 +21,25 @@ public partial class TopBar : UserControl
AvatarInitial.Visibility = System.Windows.Visibility.Collapsed;
}
public void RefreshAvatar()
/// <summary>Right-click on the LlamaCasty wordmark opens the app menu (Report Bug / Feature
/// Request / About) — the menu that used to hang off the gear, which now opens the Settings
/// drawer directly (creator ruling 2026-11-01).</summary>
private void BrandWordmark_PreviewMouseRightButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
_ = LoadAvatarImageAsync();
}
private void GearButton_PreviewMouseRightButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
// Right-click goes straight to App Settings; the menu stays on left-click.
e.Handled = true;
if (DataContext is MainViewModel { OpenSettingsCommand: { } open } && open.CanExecute(null))
open.Execute(null);
}
private void GearButton_Click(object sender, RoutedEventArgs e)
{
// One menu (Settings / Bug / Feature / About), opened on click — moved up
// from the bottom bar so app-level actions live next to the brand.
if (sender is Button { ContextMenu: { } menu } button)
{
menu.PlacementTarget = button;
menu.Placement = System.Windows.Controls.Primitives.PlacementMode.Bottom;
menu.IsOpen = true;
e.Handled = true;
}
}
public void RefreshAvatar()
{
_ = LoadAvatarImageAsync();
}
private async System.Threading.Tasks.Task LoadAvatarImageAsync()
{
var vm = DataContext as MainViewModel;
+102 -111
View File
@@ -1,153 +1,144 @@
# Distribution & release mechanics
How the build becomes a file someone installs. **Policy — prices, entitlement, which channels
exist and why — is [`docs/ai/commercial.md`](docs/ai/commercial.md).** This file is the how.
How the build becomes an install on someone's PC. **Policy — prices, entitlement, why Steam is the
only channel, support — is [`docs/ai/commercial.md`](docs/ai/commercial.md).** This file is the how.
> The previous version of this document was a 736-line Polar/MSIX/obfuscation plan. It was
> superseded on 2026-10-31; the reasoning that still matters lives in `commercial.md` and
> `docs/ai/decisions.md`, and the full text is in `git log -- Distribution.md`.
> Superseded twice on 2026-10-31. The 736-line Polar/MSIX/obfuscation plan is in
> `git log -- Distribution.md`; the zip-plus-winget plan written earlier the same day is in the
> same place. The reasoning that survives lives in `commercial.md` and `docs/ai/decisions.md`.
## 1. The artifact
One self-contained single-file exe plus the bundled ffmpeg folder, zipped. No .NET install on the
target machine, no installer framework, no admin rights.
A self-contained win-x64 publish plus the bundled `ffmpeg\` folder, uploaded to a Steam depot. No
installer, no admin rights, no zip for anyone to mirror.
```bash
dotnet publish ytLive.csproj -c Release -r win-x64 --self-contained true \
-p:PublishSingleFile=true \
-p:IncludeNativeLibrariesForSelfExtract=true \
-p:EnableCompressionInSingleFile=true \
-p:PublishReadyToRun=true
-p:PublishReadyToRun=true -o artifacts/steam-stage
```
- **`PublishTrimmed` stays OFF.** Trimming breaks WPF's XAML reflection (`Binding`, `DataTemplate`,
`StaticResource`). The exe is therefore fat — expect ~110–150 MB compressed with the runtime
inside, and that is the accepted cost of "copy it and run it".
- **ffmpeg stays outside the exe** — `ffmpeg\` beside it (already the app's locator contract, see
[`output.md`](output.md) → "FFmpeg locator"). Embedding it passes 200 MB and adds an extraction
step for no benefit.
- **WebView2 is the one machine dependency**: the Evergreen runtime ships with Windows 11 and most
Windows 10; a genuinely clean machine needs the bootstrapper once. Say so in the download note.
- **`AssemblyName` is still `ytLive`** → the shipped exe is `ytLive.exe` today. The rename to
`LlamaCasty.exe` is queued (three pack URIs break — see `product.md`), and until it lands every
release note names the real file.
`StaticResource`). Expect ~110–150 MB in the depot; that is the cost of "no .NET install".
- **ffmpeg stays outside the exe** — `ffmpeg\` beside it (the app's locator contract, see
[`output.md`](output.md) → "FFmpeg locator").
- **`steam_api64.dll` ships beside the exe** and is loaded at startup; without it the app cannot
read DLC ownership. Its absence must degrade to the free profile, never to a crash.
- **WebView2 is the one machine dependency.** Valve's Common Redistributables configure the
Evergreen bootstrapper as a prerequisite, so the depot declares it instead of us shipping it.
- **`AssemblyName` is `LlamaCasty`** (renamed 2026-11-01, before the first depot because
Steamworks warns about renaming a live exe) → the artifact is `LlamaCasty.exe` plus its
`ffmpeg\` folder. `scripts/publish.sh` stages both and refuses to finish if either is missing.
- **⛔ `ExcludeFromSingleFile="true"` on the ffmpeg content.** Without it, `PublishSingleFile` +
`IncludeNativeLibrariesForSelfExtract` swallow the libav\*.dll family **into the exe** — a
182 MB binary with no `ffmpeg\` folder beside it, so the locator finds nothing and every stream
fails at runtime. The publish output is ~257 MB: 127 MB exe + 129 MB ffmpeg.
- **Portable mode** (`portable.txt` → `.\data\`) survives as a feature for a copied install; it is
not a delivery vector.
**Portable mode.** A `portable.txt` marker beside the exe keeps the layout DB, `Assets` and
settings in `.\data\` instead of `%APPDATA%\ytLlive` (hung off `LayoutPathOverride`). Same binary,
USB-stick behaviour, nothing to uninstall.
## 2. Steamworks setup, once
## 2. Where releases live — the public handout repo
**The SDK zip is the only download.** It is ~24 MB and contains the runtime
(`sdk/redistributable_bin/win64/steam_api64.dll`) *and* the release tooling
(`sdk/tools/ContentBuilder/` → `steamcmd.exe` for Windows, `steamcmd.sh` for Linux/macOS, plus the
`app_build_*.vdf` / `depot_build_*.vdf` templates). There is no separate "ContentBuilder download"
on the partner dashboard — the dashboard's Downloads page only re-offers the SDK.
**The source repo stays private.** Releases live in a **second Gitea repo,
`llamacasty-releases`**, which is push-mirrored to a **public GitHub repo** (`llamacasty/releases`).
That public repo holds nothing but a README, an issue template, a known-issues page and the release
assets — so the only thing that can ever leak is content authored for publication.
**Reference links, so nobody hunts again:**
Why it is shaped that way: GitHub has no "public issues on a private repo" switch, and issue
visibility follows repo visibility. An empty public repo gives a public issue tracker, a durable
binary URL for winget, and `releases/latest` for the update notice, without the code going anywhere.
| What | Where |
|---|---|
| SDK zip (sign in to partner first) | `partner.steamgames.com/downloads/steamworks_sdk.zip` |
| Docs home | `partner.steamgames.com/doc/home` |
| SteamPipe upload (steamcmd + VDF fields) | `partner.steamgames.com/doc/sdk/uploading` |
| DLC configuration | `partner.steamgames.com/doc/store/application/dlc` |
| `BIsDlcInstalled` | `partner.steamgames.com/doc/api/ISteamApps` |
| Store artwork sizes | `partner.steamgames.com/doc/store/assets/standard` |
| Coming Soon / 2-week public window | `partner.steamgames.com/doc/store/coming_soon` |
| Wallet rule (in-app purchases) | `partner.steamgames.com/doc/features/microtransactions` |
| Recurring subscriptions | `partner.steamgames.com/doc/store/pricing/subscriptions` |
| Partner support | `help.steampowered.com/en/wizard/HelpWithPublishing` |
| Steamworks.NET (managed wrapper) | `nuget.org/packages/Steamworks.NET` |
**The mirror carries refs, not release assets.** Git mirrors branches and tags; GitHub Release
uploads live outside the object store, so the zip is uploaded separately.
**Setup, once:**
1. Gitea → new repo `llamacasty-releases` (private) with `README.md`,
`.github/ISSUE_TEMPLATE/bug.yml`, `known-issues.md`.
2. Gitea → that repo → **Settings → Mirror Settings → push mirror** →
`https://github.com/llamacasty/releases.git` + a GitHub PAT. One-way and force-updating, so the
public copy can never drift from what was authored.
3. Create the free GitHub **organisation** `llamacasty` so URLs aren't tied to a personal account.
4. Point the Steam store page's support URL at
`https://github.com/llamacasty/releases/issues/new/choose` — the template chooser, never the
open-issue list.
**Rejected:** a submodule (publishes a pointer, not files), `git subtree split` (three static files
don't justify the history surgery, and one stray private file in the prefix leaks forever), and
serving zips from the droplet (uses the VPS as a CDN and makes the update notice hand-rolled).
1. **Steamworks account** → onboarding (NDA, identity, company details, tax interview, payout bank,
then the **$100 Steam Direct fee** per app). The store page cannot be configured before the fee.
2. **App IDs.** One **base app** (free) and one **DLC app** (the lifetime Pro). Note both numbers:
the DLC app ID is what the app passes to `BIsDlcInstalled`.
3. **Depot.** One depot holding the publish output; the base app and the DLC share the install
directory, and the DLC package grants no files of its own — it is entitlement only.
4. **Steamworks SDK.** `./scripts/steam-sdk.sh ~/Downloads/steamworks_sdk_165.zip` extracts
`steam_api64.dll` from `sdk/redistributable_bin/win64/` into `steam/` (gitignored) and stages
`steam_appid.txt` = 480 — Valve's Spacewar app, so `SteamAPI.Init()` works locally before
LlamaCasty has an App ID. Add `--contentbuilder` on the machine that uploads a depot. The csproj
copies the DLL **beside the exe** (`Link`) with `ExcludeFromSingleFile`, and copies
`steam_appid.txt` in Debug only — never into a depot. The managed side is the `Steamworks.NET`
package (`SteamApps.BIsDlcInstalled`).
5. **Store page** configured and made public **two weeks before release** — Valve's rule, and it is
the window where wishlists accumulate.
## 3. Release
```
publish → zip → SHA-256 → gh release create → winget manifest PR → update notice
publish → steam-stage → steamcmd + app_build.vdf → build upload → set live → announcement
```
1. **Tag and publish.** `v<major>.<minor>.<patch>` tag; upload
`LlamaCasty-<version>-win-x64.zip` with
`gh release create v1.0.0 LlamaCasty-1.0.0-win-x64.zip --repo llamacasty/releases
--notes-file RELEASE.md`. Binaries live there, never on the droplet — free CDN, durable URLs,
release notes in the same place, and `wingetcreate` reads `releases/latest` natively.
2. **Record the hash.** `sha256sum` the zip; it goes in the winget manifest and in the release
notes. This is the anti-tamper wall: the official channel delivers exactly this artifact or
fails.
3. **winget.** `wingetcreate update LlamaCasty.LlamaCasty --version <v> --urls <release-url>
--submit` — it opens the PR against `microsoft/winget-pkgs`. Manifest shape:
`InstallerType: portable`, `InstallerSha256`, `NestedInstallerType` where the zip nests the exe.
First submission is `wingetcreate new`; the identifier is `LlamaCasty.LlamaCasty`.
4. **Update notice.** Commit the current version into the releases repo (so it arrives in the same
push or a follow-up commit) or read `releases/latest` from the GitHub API. The app shows one
line — *"v1.4 is out — `winget upgrade LlamaCasty.LlamaCasty`"*. **Nothing downloads or
executes**: that is Store policy 10.2.2 and a permanent no (see `product.md`).
5. **Optional mirrors.** Scoop (a small JSON manifest hosted in a bucket) and Chocolatey (a nupkg
with a checksum) — ten minutes each, same audience.
6. **MSIX** stays buildable for the parked Store channel: `scripts/package-msix.sh` →
`artifacts/LlamaCasty.msix`, submitted nowhere until the (now free) developer account exists.
1. **Upload the depot** with `steamcmd +login <user> +run_app_build ..\scripts\app_build_<appid>.vdf
+quit`. The VDF names the app, depot, content root and branch.
2. **Set the build live** in Steamworks → *Builds* → the new build → **Set Build Live** on the
default branch. That *is* the release; there is no artifact to hash and no manifest to submit.
3. **Announce** with Steam Events (release notes appear in the library and on the store page).
4. **Verify**: install from a clean Steam account, confirm `BIsDlcInstalled` returns false, buy the
DLC (or use a test licence), confirm the high tiers unlock, then refund the test purchase.
## 4. Signing — deferred until revenue
**Updates** are the same upload with a higher build ID. The app keeps **no self-updater and no
version banner** — Steam is the update path, and that policy has not changed.
**Unsigned is the launch state.** Artifact Signing is bought at **two subscribers**, not before:
it never removes the day-one warning (EV's SmartScreen bypass died in March 2024), so the only
thing it changes early is the publisher line. Costs and posture:
[`docs/ai/commercial.md`](docs/ai/commercial.md).
## 4. Entitlement wiring
- **Azure Artifact Signing** (renamed from "Trusted Signing") — **$9.99/month Basic**, 5,000
signatures, **requires a paid Azure subscription**. Individual identity validation is the slow
part (days to weeks) and must be renewed; start it when the purchase is decided.
- **⛔ No EV certificate, and no certificate with an HSM.** Microsoft removed the EV instant-bypass
in March 2024, so EV ($400+/yr) buys exactly what OV (~$150–300/yr) buys.
- **The free alternative is the Microsoft Store**: the individual developer fee was waived, and
Microsoft signs the MSIX, so a Store install never meets SmartScreen at all.
- **Unsigned costs a warning on every release**, because SmartScreen ties reputation to the file
hash. Signing accrues reputation to the **publisher** — the only exit from that loop.
- **Signing never clears the warning on day one either.** Plan for weeks.
- Secrets: the Trusted Signing profile lives in CI secrets; **never commit** a `.pfx` or
`metadata.json` with credentials. `MSIX_PFX`/`MSIX_PFX_PASSWORD` are for local test installs only.
- Verify every release: `signtool verify /pa /v <file>`, and confirm the hash in the manifest
matches the uploaded zip.
- `IEntitlement` (`Services/Entitlement/`) has one method, `IsPro`. **Steam DLC** answers it today
(`SteamEntitlement`, `Steamworks.NET` + `steam_api64.dll`); the **Polar** monthly rail plugs in
beside it. Resolution is `Pro = steamDlc || polarLease`, then `MainViewModel.HasProOutput` adds
the Debug-only `DeveloperMode`; anything unresolved is the free profile.
- **`SteamEntitlement.NotConfigured()` is the shipping default** until the DLC app id exists — it
answers false without touching the native library. Set the id when Steamworks creates the DLC.
- **Fail closed on every path:** no id, no client, missing DLL, thrown load, not owned.
- **Never sell the monthly inside the Steam build.** Steamworks requires in-app purchases to use
the Steam Wallet; the app may *state* that monthly plans exist on the site, with no checkout,
no price and no payment field. Confirm the wording with Steamworks support before shipping it.
- **Never gate a feature.** The only delta is the output profile.
## 5. Release checklist
- Build clean, 0 warnings (`./scripts/verify.sh`), full test suite green.
- `signtool verify /pa` passes on the shipped exe.
- Launch on a clean Windows profile: first-run works, recording writes where it claims, ffmpeg is
found beside the exe, WebView2-loaded UI renders.
- Fresh install through `winget install LlamaCasty.LlamaCasty` on a second machine, then
`winget upgrade` over the previous version.
- ZIP hash published; manifest PR merged; version notice updated.
- Portable mode: `portable.txt` present → data lands in `.\data\`, deleting the folder deletes the
app's footprint.
- Build clean, 0 warnings (`./scripts/verify.sh`), tests green.
- `steam_api64.dll` present; app starts **without** Steam and falls back to the free profile.
- DLC ownership false → free profile; true → every tier offered.
- `LlamaCasty.exe` rename landed (never rename a live exe).
- Clean Steam install on a second machine, then an update pushed and observed.
- Store page public for the full two weeks; support contact and announcements configured.
- Portable mode: `portable.txt` present → data lands in `.\data\`.
## 6. Legal and takedown
- **`LICENSE`** (EULA) forbids redistribution, resale, reverse-engineering and circumvention, and
disclaims warranty. It is what makes a mirror site a licence breach rather than a grey area.
- **`PRIVACY.md`** must name any third party the app contacts — today that is Google/YouTube,
ffmpeg is local, and **Polar** is added the day licence validation ships.
disclaims warranty.
- **`PRIVACY.md`** must name any third party the app contacts — Google/YouTube today, **Polar** the
day licence validation ships. Steam itself is named by Valve's own policy, not ours.
- **`THIRD-PARTY-NOTICES.txt`** stays shipped and shown in About; the ffmpeg pin stays
`lgpl-shared`, and no GPL component may be linked (see `product.md` → "Licensing").
- **DMCA**: statutory damages need a registration ($65), and a takedown needs only the notice —
host, link, good-faith statement, signature. Worth doing once there is something to pirate.
- **What actually protects the product** is in `commercial.md` → "Anti-piracy posture": signed
hash-pinned delivery, short leases, a free tier good enough that a crack buys nothing, and a
licence ID in About. **Not obfuscation, not a native DLL, not hardware locking.**
`lgpl-shared`; no GPL component may be linked (see `product.md` → "Licensing").
- **DMCA**: a takedown needs only the notice — host, link, good-faith statement, signature.
Statutory damages need a registration ($65). Worth doing once there is something to pirate.
- **What actually protects the product** is in `commercial.md` → "Anti-piracy posture": a free tier
good enough that a crack buys nothing, Steam's own delivery, short Polar leases, and a licence ID
in About. **Not obfuscation, not a native DLL, not hardware locking.**
## 7. Effort, once
| Step | Effort |
|---|---|
| Publish profile + portable mode | 0.5 day |
| Releases repo + Gitea→GitHub push mirror | 0.5 day |
| `gh release` + hash + version notice | 0.5 day |
| First winget manifest (`wingetcreate new`) | 0.5 day, then ~15 min per release |
| Clean-machine + `winget` smoke test | 0.5 day |
| Artifact Signing profile + CI step (deferred) | 0.5 day, at two subscribers |
| Steamworks onboarding + $100 fee | 0.5–1 day, mostly waiting on verification |
| Publish profile + `steam_api64.dll` + `IEntitlement` Steam path | 1 day |
| Depot + first `steamcmd` upload | 0.5 day, then ~15 min per release |
| Store page + assets (screenshots, capsule art) | 1–2 days |
| Clean-account install + DLC purchase/refund test | 0.5 day |
+30 -27
View File
@@ -1,37 +1,40 @@
# HANDOFF — 2026-10-31 (commercial settled; the surge week starts at the artifact, not the Text layer)
# HANDOFF — 2026-11-01 (exe renamed, depot builds, output rule enforced)
## State
- Branch `main`, level with `origin` through `7827d23` + `0b41b7d`; this doc unit is local.
- **Commercial is settled and written down**: freemium (free = whole app at a 921,600 px / 30 fps
profile, stream **and** recording), Pro $10/mo or $400 lifetime through **Polar with no server at
all** — the client calls the customer-portal API with the key, and channel binding rides in
`conditions: {channel_id}`. Signing is **deferred until two subscribers**; the Store account is
now free; binaries live in `llamacasty-releases` push-mirrored to public GitHub.
- **Support policy recorded**: email, best effort, no SLA, refunds on request; no training service;
a repeated question becomes a training video on `@llamacasty`. `MARCOM.md` holds the loop.
- `www.llamacasty.com` resolves and 301s to the apex (CNAME + YunoHost domain + LE cert + nginx
`.d` include). Recipe in `MyMistakes.md`.
- Branch `main`, level with `origin` through `8f79b20`; this unit is local.
- **The shipped exe is `LlamaCasty.exe`** (`AssemblyName` renamed; four pack URIs fixed — the docs
said three, `KeepBroadcastDialog.xaml:5` was the fourth). Guarded by `AssemblyIdentityTests`.
- **`scripts/publish.sh`** stages `artifacts/steam-stage` and refuses to finish if `ffmpeg\`, the
licence, privacy or notices file is missing, or test assemblies leaked in. Output 257 MB.
- **The output-profile rule is built and enforced**: `Models/OutputProfile.cs` (921,600 px / 30 fps,
fail closed) resolved once in `BuildEncoderOptions` — one ffmpeg process, two outputs.
`MainViewModel.DeveloperMode` bypasses it in Debug only.
- **Distribution is Steam-exclusive** (2026-10-31): free app + paid edition as a Steam **DLC**; the
**$10/month** plan sold off-Steam by Polar, *stated, never sold*, in-app. Entitlement is
`steamDlcOwned || polarKeyValid`; the app must start without Steam, falling back to free.
- **Site live with Steam** (`a9d07ce`); `www.llamacasty.com` 301s to the apex.
## Next action
**Surge week, day 1: artifact shape.** `LlamaCasty.exe` rename (three pack URIs:
`MainWindow.xaml:14`, `OverlayHost.xaml:96`, `RenameRecordingDialog.xaml:5`), `scripts/publish.sh`
(self-contained win-x64, no test artifacts), `portable.txt` via `LayoutPathOverride`. It ends when
the zip runs on a clean profile.
Then: OutputProfile gate + TASK 53 geometry tests → entitlement seam + system messages → licence UI
and a real test broadcast. Day 5 if all four land: the visibility picker.
**Surge, 2026-11-02 → 11-07 — six days, all remaining code.** Day 1 is partly done ahead of time:
`IEntitlement` + `SteamEntitlement` (Steamworks.NET, fail-closed on every path) + `FakeEntitlement`,
with `HasProOutput` reading the rail. Undo/redo, the rail gear and the EDIT alignment also landed
early. Remaining on day 1: greyed tiers, licence UI's four states, system messages, licence ID in
About. Days 2–6 in `TASKS.md` → "The surge".
## Landmines
- **Nothing may gate a feature.** The only paid delta is the output profile. `ShowBrandFlash` stays
- **⛔ `ExcludeFromSingleFile="true"` on the ffmpeg content** — without it the publisher bundles
libav\*.dll into the exe and the app ships unable to find ffmpeg. Recipe in `MyMistakes.md`.
- **Dev affordances are compiled out, not hidden** — `DeveloperPanel` is removed from the Release
build; `Helpers/DevBuild.cs` is the single source for the flag (never `const`).
- **Nothing may gate a feature.** The only paid delta is the output profile; `ShowBrandFlash` stays
`false` and entitlement must never enable it.
- **The org access token never ships.** `organization_id` is public; the token is not. No claim
page, no callback endpoint, no key database — `conditions` does the binding.
- **The site publishes the model, never the numbers**, and its CTA stays "Coming soon to the
Microsoft Store" until the creator says the download exists.
- **No self-updater, by policy**: `winget upgrade` + a version banner. `StorePackagingTests` asserts it.
- Pre-existing: the **full test suite hangs** (WASAPI teardown). Per-class runs are the way.
- Not every hex is a theme colour — `BorderColorPalette`/chat defaults are USER DATA; on-stream
graphics come from `OutputPalette`. A red settings control is still a bug.
- **No checkout inside a Steam build** — the Wallet rule. The monthly is named, never sold, in-app.
- **The org access token never ships.** `organization_id` is public; the token is not.
- **The site publishes the model, never the numbers**, and never takes payment or links a checkout.
- **No self-updater and no version banner**: Steam updates the app.
- Pre-existing: the **full test suite hangs** (WASAPI teardown) — per-class runs; `ytLive.Tests`
carries 3 xUnit warnings the app-only gate does not see.
- Not every hex is a theme colour — `BorderColorPalette`/chat defaults are USER DATA, not tokens.
+29
View File
@@ -0,0 +1,29 @@
namespace ytLive.Helpers;
/// <summary>
/// Whether this binary is a **development build**.
///
/// <para><b>Why <c>static readonly</c> and not <c>const</c>:</b> a const makes
/// <c>if (!DevBuild.IsDevelopment) return;</c> a compile-time branch, so whichever arm is dead
/// raises CS0162 — in Debug the guard is dead, in Release the body is. A readonly field is set
/// once at type init, so both arms compile clean and the JIT folds the branch away.</para>
///
/// <para><b>This is not the only defence.</b> The developer panel's XAML and code-behind are
/// removed from the Release compile entirely (<c>ytLive.csproj</c>, Page/Compile Remove), so a
/// shipped binary contains no BAML to reveal. This flag is the second lock: it refuses the
/// value even if something else calls the setter.</para>
///
/// <para>Single source for the question. It gates the multi-instance profile
/// (<see cref="InstanceProfile"/>), the scoreboard's debug seeding, and the all-resolutions
/// override (<c>MainViewModel.DeveloperMode</c>).</para>
/// </summary>
public static class DevBuild
{
/// <summary>True for a Debug compile; false for Release and anything else.</summary>
public static readonly bool IsDevelopment =
#if DEBUG
true;
#else
false;
#endif
}
+1 -1
View File
@@ -2,7 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Keep this broadcast?" Height="240" Width="460"
Icon="/ytLive;component/Assets/llamacasty-icon.png"
Icon="/LlamaCasty;component/Assets/llamacasty-icon.png"
WindowStartupLocation="CenterOwner" ResizeMode="NoResize"
ShowInTaskbar="False" Background="{StaticResource Brush.Background}">
+10 -1
View File
@@ -11,7 +11,7 @@
mc:Ignorable="d"
Title="{Binding WindowTitle}" Height="1040" Width="1920"
MinWidth="1366" MinHeight="768"
Icon="/ytLive;component/Assets/llamacasty-icon.png"
Icon="/LlamaCasty;component/Assets/llamacasty-icon.png"
Background="{StaticResource Brush.Background}"
FontFamily="{StaticResource FontFamily.Sans}"
WindowStartupLocation="Manual"
@@ -19,9 +19,18 @@
Loaded="MainWindow_Loaded"
Activated="MainWindow_Activated"
Deactivated="MainWindow_Deactivated"
PreviewKeyDown="MainWindow_PreviewKeyDown"
PreviewMouseLeftButtonDown="Window_PreviewMouseLeftButtonDown"
ContextMenuOpening="Window_ContextMenuOpening">
<!-- Preview undo/redo (creator directive 2026-11-01). Window-level so the keys work wherever
focus sits; the commands themselves refuse unless EditingActive, because undo with the
preview showing program output would rewrite a scene nobody is looking at. -->
<Window.InputBindings>
<KeyBinding Gesture="Ctrl+Z" Command="{Binding UndoPreviewCommand}"/>
<KeyBinding Gesture="Ctrl+Shift+Z" Command="{Binding RedoPreviewCommand}"/>
</Window.InputBindings>
<Window.DataContext>
<vm:MainViewModel/>
</Window.DataContext>
+21
View File
@@ -162,6 +162,27 @@ public partial class MainWindow : Window
{
}
/// <summary>
/// Ctrl released/late-pressed while the magnifier is open → the box closes (creator ruling
/// 2026-11-01). This is the "let go and it's gone" half of the zoom gesture; it also means one
/// hand can dismiss without reaching for the mouse. Creating the box still takes Ctrl+right
/// (edit) or a left click (preview), so holding Ctrl to *make* it never cancels it: the key is
/// already down before the box exists.
/// </summary>
private void MainWindow_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
{
// ⛔ e.IsRepeat matters: Windows auto-repeats a held modifier. Creation holds Ctrl (the
// chord is Ctrl+right-click), so without this guard the repeat tick ~500 ms later saw an
// open box and closed it — the box appeared and vanished as it was created.
if (e.IsRepeat) return;
if (e.Key is System.Windows.Input.Key.LeftCtrl or System.Windows.Input.Key.RightCtrl
&& _viewModel.IsZoomActive)
{
_viewModel.DismissZoomIfActive();
}
}
private void UpdateTaskbarOverlay()
{
TaskbarInfo.Overlay = _viewModel.IsLive
+62
View File
@@ -0,0 +1,62 @@
namespace ytLive.Models;
/// <summary>
/// The one entitlement rule, as pure policy: what a build is allowed to emit.
///
/// <para><b>Why pixels and a frame rate rather than "720p".</b> The paid delta is output
/// quality, and a resolution name is a marketing word, not a measurable bound — 720p60 is
/// 921,600 pixels at twice the frame rate, and vertical 720×1280 is the same pixel count
/// with a different shape. A pixel budget plus a frame-rate ceiling expresses the same
/// promise without a lookup table that a new tier can quietly escape.</para>
///
/// <para><b>Fail closed.</b> Callers pass <c>pro: false</c> when entitlement is unknown,
/// unreadable or unresolved; the free profile is the default state, never the fallback
/// after an error.</para>
///
/// <para><b>This is not a feature gate.</b> Every feature, scene, overlay and the recording
/// itself stay available; only the emitted frame gets smaller. Never call it for anything
/// else — a cracked build buys almost nothing, which is the entire anti-piracy posture.</para>
/// </summary>
public static class OutputProfile
{
/// <summary>Free ceiling: 921,600 px = 1280×720, i.e. one 720p frame.</summary>
public const int FreeMaxPixels = 921_600;
/// <summary>Free ceiling: 30 frames per second.</summary>
public const int FreeMaxFps = 30;
/// <summary>The named tier a capped build falls back to when nothing else qualifies.</summary>
public const string FreeFallbackName = "720p30";
/// <summary>Is this tier within the free budget? Pro may use anything shipped.</summary>
public static bool IsAllowed(QualityOption tier, bool pro)
=> pro
|| (tier.Width * tier.Height <= FreeMaxPixels && tier.Fps <= FreeMaxFps);
/// <summary>
/// The tier a session will actually encode. A permitted selection passes through
/// untouched (so Pro and the free tier's own 720p30 keep their exact bitrate); a
/// disallowed one resolves to the best tier the budget allows — most pixels first, then
/// most frames, then the cheapest bitrate — because silently encoding something the user
/// did not pick is only acceptable if it is the closest legal thing to it.
/// </summary>
/// <param name="requested">What the dropdown says.</param>
/// <param name="shipped">Every tier the build offers.</param>
/// <param name="pro">Entitlement, already resolved. Unknown must be passed as false.</param>
public static QualityOption Resolve(
QualityOption requested, IEnumerable<QualityOption> shipped, bool pro)
{
if (IsAllowed(requested, pro)) return requested;
var candidate = shipped
.Where(tier => IsAllowed(tier, pro))
.OrderByDescending(tier => tier.Width * tier.Height)
.ThenByDescending(tier => tier.Fps)
.ThenBy(tier => tier.Bitrate)
.FirstOrDefault();
// No shipped tier fits the budget: build the floor explicitly rather than trusting
// the table. A build whose tiers were all redefined must still emit a legal frame.
return candidate ?? new QualityOption(FreeFallbackName, FreeMaxFps, 6.0, 1280, 720);
}
}
+115
View File
@@ -0,0 +1,115 @@
namespace ytLive.Models;
/// <summary>
/// Undo/redo for what the creator does in the preview: move, resize, reorder, add, remove, hide.
///
/// <para><b>Snapshots hold element REFERENCES, not copies.</b> The model has a dozen subclasses
/// with dozens of properties each; a deep clone would be a large, fragile mirror of every one of
/// them, and it would silently miss the next field someone adds. Holding the live instances and
/// recording the values the preview can change (geometry, visibility, order, and which elements a
/// scene contains) means a new model property cannot break undo — it simply is not part of this
/// stack's contract.</para>
///
/// <para><b>Scope, stated plainly:</b> this covers layout edits. Property edits (colour, opacity,
/// border, font) are not captured yet — pressing Ctrl+Z after one of those restores the last
/// layout change instead. That is a limitation, not a bug to discover later.</para>
///
/// <para><b>Bounded:</b> <see cref="MaxDepth"/> entries; the oldest falls off. Snapshots are
/// references plus a handful of doubles, so the stack costs kilobytes, not megabytes.</para>
/// </summary>
public sealed class PreviewHistory
{
public const int MaxDepth = 50;
private readonly List<LayoutState> _undo = new();
private readonly List<LayoutState> _redo = new();
public bool CanUndo => _undo.Count > 0;
public bool CanRedo => _redo.Count > 0;
public int UndoDepth => _undo.Count;
public int RedoDepth => _redo.Count;
/// <summary>Record the layout as it is now, before an edit. Clears the redo branch — a new
/// edit after an undo is a new future.</summary>
public void Capture(IEnumerable<Scene> scenes)
{
_undo.Add(LayoutState.From(scenes));
_redo.Clear();
if (_undo.Count > MaxDepth) _undo.RemoveAt(0);
}
/// <summary>Restore the previous layout. The current layout is pushed onto the redo stack, so
/// redo is exact even after several undos.</summary>
public bool Undo(IEnumerable<Scene> scenes)
{
if (_undo.Count == 0) return false;
var sceneList = scenes as IList<Scene> ?? scenes.ToList();
_redo.Add(LayoutState.From(sceneList));
var previous = _undo[^1];
_undo.RemoveAt(_undo.Count - 1);
previous.RestoreTo(sceneList);
return true;
}
public bool Redo(IEnumerable<Scene> scenes)
{
if (_redo.Count == 0) return false;
var sceneList = scenes as IList<Scene> ?? scenes.ToList();
_undo.Add(LayoutState.From(sceneList));
var next = _redo[^1];
_redo.RemoveAt(_redo.Count - 1);
next.RestoreTo(sceneList);
return true;
}
/// <summary>Dropped when the layout is reloaded from disk — undoing across a reload would
/// resurrect a layout the creator never had.</summary>
public void Clear()
{
_undo.Clear();
_redo.Clear();
}
/// <summary>One scene's contents and geometry at a point in time.</summary>
private sealed record SceneState(Scene Scene, SceneElement[] Order, ElementState[] Elements);
private sealed record ElementState(SceneElement Element, double X, double Y, double Width, double Height, bool IsVisible);
private sealed record LayoutState(SceneState[] Scenes)
{
public static LayoutState From(IEnumerable<Scene> scenes) => new(
scenes.Select(scene => new SceneState(
scene,
scene.Elements.ToArray(),
scene.Elements.Select(element => new ElementState(
element, element.X, element.Y, element.Width, element.Height, element.IsVisible)).ToArray()))
.ToArray());
public void RestoreTo(IList<Scene> scenes)
{
foreach (var state in Scenes)
{
// A scene removed from the layout since the snapshot is not restored — the
// layout, not the history, owns which scenes exist.
if (!scenes.Contains(state.Scene)) continue;
foreach (var element in state.Elements)
{
element.Element.X = element.X;
element.Element.Y = element.Y;
element.Element.Width = element.Width;
element.Element.Height = element.Height;
element.Element.IsVisible = element.IsVisible;
}
var elements = state.Scene.Elements;
// Membership AND order: this is what makes add / remove / reorder undo-able.
if (elements.SequenceEqual(state.Order)) continue;
elements.Clear();
foreach (var element in state.Order) elements.Add(element);
}
}
}
}
+26 -2
View File
@@ -18,7 +18,10 @@ public enum SourceType
MediaSource,
/// <summary>The designated alert zone: the six monetization events play their
/// unique celebration animations here (OBS alert-box equivalent, native).</summary>
AlertBox
AlertBox,
/// <summary>A privacy blur: blurs the frame beneath it inside a rect or ellipse. Live scene
/// only, always below the brand logo, several allowed (strongest wins on overlap).</summary>
Blur
}
/// <summary>Distinguishes how a media source presents its content (TASK 21).</summary>
@@ -81,11 +84,16 @@ public class Source : SceneElement
}
}
public override bool IsDraggable => Type is SourceType.Image or SourceType.WebSource or SourceType.ChatBox or SourceType.AlertBox;
/// <summary>Blur is draggable like a layer: it has no pixels of its own, but the creator places
/// and sizes it in the preview, so it needs the same selection box, grab and resize handle
/// (creator ruling 2026-11-01).</summary>
public override bool IsDraggable => Type is SourceType.Image or SourceType.WebSource or SourceType.ChatBox
or SourceType.AlertBox or SourceType.Blur;
/// <summary>Live captures, chat, web sources and media are dynamic; static art is fixed.</summary>
public override ElementKind Kind => Type is SourceType.DisplayCapture or SourceType.WindowCapture
or SourceType.ChatBox or SourceType.WebSource or SourceType.MediaSource or SourceType.AlertBox
or SourceType.Blur
? ElementKind.Dynamic : ElementKind.Static;
public override bool IsWebSource => Type == SourceType.WebSource;
@@ -158,6 +166,22 @@ public class Source : SceneElement
// Countdown config
private int _timerMinutes = 15;
// Privacy blur (Live scene only): 0–1, the same scale and default as the webcam's background
// blur so "half strength" means the same blur in both places.
private double _blurAmount = 0.5;
public double BlurAmount
{
get => _blurAmount;
set => Set(ref _blurAmount, Math.Clamp(value, 0, 1));
}
public bool IsBlur => Type == SourceType.Blur;
/// <summary>True for a round blur (circle) — the shape rides the existing clip surface, so the
/// box/circle choice is the same switch every other layer uses rather than a second concept.</summary>
public bool IsRoundBlur => IsBlur && ClipShape == ClipShape.Round;
public int TimerMinutes
{
get => _timerMinutes;
+66
View File
@@ -166,6 +166,72 @@ in Studio → Settings → Channel → **Feature eligibility**:
*"Advanced YouTube features aren't available for this account"*. If ID verification is ever
wanted on a personal channel, do it **before** converting to a brand account.
### THE `const` THAT MAKES A GUARD UNREACHABLE (2026-11-01)
A dev-build flag declared `const bool` turns `if (!DevBuild.IsDevelopment) return;` into a
compile-time branch: Debug reports **CS0162 unreachable** on the guard, Release reports it on the
body — and the repo builds at 0 warnings, so either config fails the gate.
**Fix:** `public static readonly bool IsDevelopment =` … set once from `#if DEBUG`. Both arms
compile clean in both configurations, and the JIT still folds the branch. The *real* guarantee for
"this must not ship" is not the flag anyway — it is removing the UI's `Page`/`Compile` items from
the Release build (`<ItemGroup Condition="'$(Configuration)' != 'Debug'">`).
⚠️ A Condition on the **ItemGroup** is invisible to a test that reads `item.Attribute("Condition")`.
Read the parent too — that mistake cost one failing test here.
### THE SINGLE-FILE PUBLISHER EATS ffmpeg (2026-11-01)
**Problem:** `dotnet publish` with `PublishSingleFile=true` +
`IncludeNativeLibrariesForSelfExtract=true` produced a **9-file** output with **no `ffmpeg\`
folder** and a **182 MB exe** — the libav\*.dll family had been bundled *inside* the binary. The
build was green, the tests passed, and the app would have shipped unable to find ffmpeg at
runtime (the locator looks for `ffmpeg\ffmpeg.exe` beside the exe).
**Diagnosis that worked:** diff the publish output against a **control publish with the
single-file flags removed** — ffmpeg was there. Then add flags back one at a time;
`IncludeNativeLibrariesForSelfExtract` was the one that broke it.
**Fix:** mark the content `ExcludeFromSingleFile="true"`.
```xml
<None Include="ffmpeg\**" CopyToOutputDirectory="PreserveNewest"
CopyToPublishDirectory="Always" ExcludeFromSingleFile="true" />
```
After: 127 MB exe, `ffmpeg\` present, depot ≈ 257 MB total.
- ⚠️ **The `<None Remove="ffmpeg\**" />` before it is not the fix** — it silences a duplicate-item
warning from the SDK's default glob, and I tried it first and wrongly believed it had worked.
Two failed remedies in a row is the research trigger: read the publisher's own metadata
(`ExcludeFromSingleFile`) instead of guessing at item globs.
- ⚠️ **A clean build and green tests cannot see this.** Only the artifact can, which is why
`scripts/publish.sh` fails loudly when `ffmpeg\`, `LICENSE`, `PRIVACY.md` or
`THIRD-PARTY-NOTICES.txt` are missing, and when test assemblies leak in.
### STEAM IS THE DISTRIBUTOR — AND WHAT IT DOES NOT ALLOW (2026-10-31)
**Why recorded:** the distribution answer changed three times in one day (winget → zip+GitHub →
Steam), and each pivot invalidated a doc written hours earlier. These are the facts that won't
change.
- **Steam installs skip SmartScreen entirely** — Valve's client delivers the files, so there is no
browser download, no Mark-of-the-Web and no publisher warning. An unsigned exe is *fine* in this
channel, and a certificate is only needed if a non-Steam download ever exists.
- **Steam updates the app** — no self-updater, no version banner, no update endpoint.
- **⛔ In-app purchases must use the Steam Wallet.** Steamworks, *Microtransactions (In-Game
Purchases)*: *"For any in-game purchases, you'll need to use the microtransaction API so Steam
customers can only make purchases from the Steam Wallet."* So a subscription sold through Polar
inside a Steam build is a policy violation. **Lifetime = plain DLC bought on the store page**
(the app only calls `BIsDlcInstalled`); the monthly is *stated*, never *sold*, in-app.
- **Steam can technically do recurring billing** (`ISteamMicroTxn` + `ProcessAgreement`) but its own
doc opens with *"Recurring Subscriptions is not a fully supported feature"* and requires a server
of yours to poll renewals — more infrastructure than Polar, for a 30% cut.
- **Renaming a live exe is painful** (Steamworks → *Tip – Renaming a live exe*). Do the
`LlamaCasty.exe` rename **before** the first depot upload, not after.
- **The Steam store page must be public two weeks before release**, and the $100 Steam Direct fee
must be paid before the page can be configured at all.
### CONVERTING A MEDIAPIPE .tflite (WITH CUSTOM OPS) TO ONNX — AND PROVING IT (RECIPE, TASK 51)
**Problem:** MediaPipe segmentation models end in the custom op `Convolution2DTransposeBias`;
+1 -1
View File
@@ -50,7 +50,7 @@
<Applications>
<Application
Id="LlamaCasty"
Executable="ytLive.exe"
Executable="LlamaCasty.exe"
EntryPoint="Windows.FullTrustApplication"
uap10:TrustLevel="mediumIL"
uap10:RuntimeBehavior="packagedClassicApp">
+1 -1
View File
@@ -2,7 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Rename Recording" Height="304" Width="460"
Icon="/ytLive;component/Assets/llamacasty-icon.png"
Icon="/LlamaCasty;component/Assets/llamacasty-icon.png"
WindowStartupLocation="CenterOwner" ResizeMode="NoResize"
ShowInTaskbar="False" Background="{StaticResource Brush.Background}">
@@ -1,5 +1,6 @@
using ytLive.Helpers;
using ytLive.Models;
using ytLive.Services.Compositor;
namespace ytLive.Services.BackgroundEffects;
@@ -28,16 +29,12 @@ public sealed class BackgroundEffectProcessor
{
public const double DefaultStrength = 0.5;
/// <summary>The background is blurred at 1/<see cref="BlurDownscale"/> resolution and
/// upsampled while blending — a strong blur at a fraction of the cost.</summary>
internal const int BlurDownscale = 4;
/// <summary>Box-blur radius (in downscaled pixels) at strength 0 and 1. The maximum was halved
/// from 12 (2026-10-09): the creator found full range too heavy — the old max spread ≈48 full
/// px. The established tools blur far less: StreamFX defaults its Box blur size to 5 and its
/// author stops downscale-based blurs around 8 px.</summary>
internal const int MinBlurRadius = 1;
internal const int MaxBlurRadius = 6;
/// <summary>Shared with the privacy blur layer (Services/Compositor/RegionBlur): one radius
/// curve for both, so a strength means the same thing everywhere. The maximum was halved from
/// 12 on 2026-10-09 — full range was too heavy, and the established tools blur far less.</summary>
internal const int BlurDownscale = RegionBlur.Downscale;
internal const int MinBlurRadius = RegionBlur.MinRadius;
internal const int MaxBlurRadius = RegionBlur.MaxRadius;
private readonly IPersonSegmenter _segmenter;
private bool _loggedFailure;
@@ -218,11 +215,7 @@ public sealed class BackgroundEffectProcessor
/// <summary>Blur radius in downscaled pixels for a strength. Quadratic (s²), not linear, so the
/// default 0.5 stays gentle (2 small px ≈ ~8–10 full px of perceived spread, ~3× lighter than
/// the old linear 6) while only the top of the slider approaches the full range.</summary>
internal static int BlurRadius(double strength)
{
var s = Math.Clamp(strength, 0, 1);
return (int)Math.Round(MinBlurRadius + (MaxBlurRadius - MinBlurRadius) * s * s);
}
internal static int BlurRadius(double strength) => RegionBlur.RadiusFor(strength);
/// <summary>Row-parallel pixel loops, capped so the effect worker can't starve the compositor
/// and encoder threads.</summary>
+206
View File
@@ -0,0 +1,206 @@
namespace ytLive.Services.Compositor;
/// <summary>
/// A region of the composed frame, blurred in place. The privacy layer (a Blur element on the
/// Live scene) and the webcam's background blur share this arithmetic, so "half strength" means
/// exactly the same blur in both places — the creator asked for consistency, and two copies of a
/// radius curve is how two features quietly disagree.
///
/// <para><b>The algorithm is the webcam's:</b> box-average downscale by
/// <see cref="Downscale"/>, three separable box passes at <see cref="Radius"/> (≈ a Gaussian), then
/// blend back inside the mask. Working at ¼ resolution is what keeps a strong blur affordable.</para>
///
/// <para><b>Region-scoped.</b> Cost is proportional to the blur's own rectangle, not the frame, so
/// a small privacy box costs almost nothing; the full-frame webcam case pays the full price.</para>
/// </summary>
public static class RegionBlur
{
/// <summary>Blur work happens at 1/<see cref="Downscale"/> resolution and is upsampled while
/// blending — a strong blur at a fraction of the cost.</summary>
public const int Downscale = 4;
/// <summary>Box-blur radius (in downscaled pixels) at strength 0 and 1. The maximum was halved
/// from 12 on 2026-10-09: the creator found full range too heavy, and the established tools
/// blur far less (StreamFX defaults its box blur to 5).</summary>
public const int MinRadius = 1;
public const int MaxRadius = 6;
/// <summary>Strength (0–1) → box radius. Squared so the low half of the slider stays gentle.</summary>
public static int RadiusFor(double strength)
{
var s = double.IsFinite(strength) ? Math.Clamp(strength, 0, 1) : 0;
return (int)Math.Round(MinRadius + (MaxRadius - MinRadius) * s * s);
}
/// <summary>
/// Blur a rectangle of <paramref name="buffer"/> (BGRA, <paramref name="stride"/> bytes per row)
/// in place, inside a rectangular or elliptical mask.
/// </summary>
/// <param name="coverage">
/// Optional per-buffer-pixel map (1 byte each) of areas a STRONGER blur already covered. Pixels
/// marked there are skipped and never double-blurred, which is what makes overlapping blur
/// layers read as "the strongest one wins" instead of stacking into something stronger than any
/// single setting allows. The caller sorts blurs strongest-first and allocates this once.
/// </param>
/// <returns>True when it actually blurred something.</returns>
public static bool ApplyInPlace(
byte[] buffer, int stride, int frameWidth, int frameHeight,
int x, int y, int width, int height,
double strength, bool round, byte[]? coverage = null)
{
if (buffer is null || width <= 0 || height <= 0) return false;
// Clamp to the frame; the elements are draggable past the edges by design.
var x0 = Math.Clamp(x, 0, frameWidth);
var y0 = Math.Clamp(y, 0, frameHeight);
var x1 = Math.Clamp(x + width, 0, frameWidth);
var y1 = Math.Clamp(y + height, 0, frameHeight);
var w = x1 - x0;
var h = y1 - y0;
if (w <= 0 || h <= 0) return false;
var f = Downscale;
var sw = (w + f - 1) / f;
var sh = (h + f - 1) / f;
if (sw <= 0 || sh <= 0) return false;
var radius = RadiusFor(strength);
// 1. Downscale by box-averaging f×f blocks (3 channels; alpha is preserved as-is).
var small = new float[sw * sh * 3];
for (var sy = 0; sy < sh; sy++)
{
var py0 = y0 + sy * f;
var py1 = Math.Min(y0 + h, py0 + f);
for (var sx = 0; sx < sw; sx++)
{
var px0 = x0 + sx * f;
var px1 = Math.Min(x0 + w, px0 + f);
float b = 0, g = 0, r = 0;
var n = 0;
for (var py = py0; py < py1; py++)
{
var p = py * stride + px0 * 4;
for (var px = px0; px < px1; px++, p += 4)
{
b += buffer[p]; g += buffer[p + 1]; r += buffer[p + 2];
n++;
}
}
if (n == 0) n = 1;
var o = (sy * sw + sx) * 3;
small[o] = b / n; small[o + 1] = g / n; small[o + 2] = r / n;
}
}
// 2. Three separable box passes ≈ a Gaussian (the webcam's exact shape).
var scratch = new float[small.Length];
for (var pass = 0; pass < 3; pass++)
{
BoxHorizontal(small, scratch, sw, sh, radius);
BoxVertical(scratch, small, sw, sh, radius);
}
// 3. Blend back inside the mask. Bilinear on the small grid so the blur edge is not blocky.
var cx = w / 2.0;
var cy = h / 2.0;
var rx = Math.Max(1.0, w / 2.0);
var ry = Math.Max(1.0, h / 2.0);
for (var row = 0; row < h; row++)
{
var py = y0 + row;
var syf = (row + 0.5) / f - 0.5;
var sy0 = Math.Clamp((int)Math.Floor(syf), 0, sh - 1);
var sy1 = Math.Clamp(sy0 + 1, 0, sh - 1);
var ty = Math.Clamp(syf - sy0, 0, 1);
// Ellipse test in region space, per row: half-width of the chord.
var ny = (row + 0.5 - cy) / ry;
var chord = round && Math.Abs(ny) < 1 ? rx * Math.Sqrt(1 - ny * ny) : rx;
for (var col = 0; col < w; col++)
{
var px = x0 + col;
var index = py * stride + px * 4;
if (coverage is not null && coverage[py * frameWidth + px] != 0) continue;
if (round)
{
var dx = col + 0.5 - cx;
if (Math.Abs(dx) > chord) continue;
}
var sxf = (col + 0.5) / f - 0.5;
var sx0 = Math.Clamp((int)Math.Floor(sxf), 0, sw - 1);
var sx1 = Math.Clamp(sx0 + 1, 0, sw - 1);
var tx = Math.Clamp(sxf - sx0, 0, 1);
var i00 = (sy0 * sw + sx0) * 3;
var i01 = (sy0 * sw + sx1) * 3;
var i10 = (sy1 * sw + sx0) * 3;
var i11 = (sy1 * sw + sx1) * 3;
for (var c = 0; c < 3; c++)
{
var top = small[i00 + c] + (small[i01 + c] - small[i00 + c]) * tx;
var bottom = small[i10 + c] + (small[i11 + c] - small[i10 + c]) * tx;
var value = top + (bottom - top) * ty;
buffer[index + c] = ClampByte((float)value);
}
if (coverage is not null) coverage[py * frameWidth + px] = 1;
}
}
return true;
}
private static void BoxHorizontal(float[] src, float[] dst, int w, int h, int radius)
{
var window = radius * 2 + 1;
for (var y = 0; y < h; y++)
{
var row = y * w * 3;
for (var c = 0; c < 3; c++)
{
float sum = 0;
for (var i = -radius; i <= radius; i++)
sum += src[row + Math.Clamp(i, 0, w - 1) * 3 + c];
for (var x = 0; x < w; x++)
{
dst[row + x * 3 + c] = sum / window;
var add = Math.Clamp(x + radius + 1, 0, w - 1);
var drop = Math.Clamp(x - radius, 0, w - 1);
sum += src[row + add * 3 + c] - src[row + drop * 3 + c];
}
}
}
}
private static void BoxVertical(float[] src, float[] dst, int w, int h, int radius)
{
var window = radius * 2 + 1;
for (var x = 0; x < w; x++)
{
for (var c = 0; c < 3; c++)
{
float sum = 0;
for (var i = -radius; i <= radius; i++)
sum += src[Math.Clamp(i, 0, h - 1) * w * 3 + x * 3 + c];
for (var y = 0; y < h; y++)
{
dst[y * w * 3 + x * 3 + c] = sum / window;
var add = Math.Clamp(y + radius + 1, 0, h - 1);
var drop = Math.Clamp(y - radius, 0, h - 1);
sum += src[add * w * 3 + x * 3 + c] - src[drop * w * 3 + x * 3 + c];
}
}
}
}
private static byte ClampByte(float value) =>
value <= 0 ? (byte)0 : value >= 255 ? (byte)255 : (byte)value;
}
+63
View File
@@ -178,11 +178,18 @@ public sealed class SceneCompositor
{
var element = scene.Elements[i];
if (!element.IsVisible) continue;
// Blurs are applied once, after every layer (see below) — they are universal.
if (element is Source { Type: SourceType.Blur }) continue;
switch (element)
{
case Source { IsBackground: true }:
case Source { Type: SourceType.Background }:
case Source { Type: SourceType.TextOverlay }:
// ⛔ The brand logo is drawn AFTER the blur group (creator ruling 2026-11-01):
// the blur is universal and must never hide the brand.
case Source { IsBrandLogo: true }:
case ZoomSceneElement { IsZoomActive: true }:
continue;
}
@@ -191,6 +198,21 @@ public sealed class SceneCompositor
BlitBakedElement(buffer, cropW, cropH, options, element, frame, timings, $"#{i} {element.Name}");
}
// ⛔ Privacy blur is UNIVERSAL (creator ruling 2026-11-01): it is applied after every
// layer has been composited, so it can cover the webcam, chat, alerts, anything — the
// creator's "moment of privacy" case. It is the only layer that ignores its z-position;
// overlapping blurs still resolve to the strongest single one.
ApplyBlurLayers(scene, buffer, cropW, cropH, options, timings);
// ⛔ The brand logo cannot be blurred (creator ruling 2026-11-01): it is blitted after the
// universal blur, so a privacy cover never swallows it. One per scene, so this is cheap.
foreach (var brand in scene.Elements.OfType<Source>().Where(s => s.IsBrandLogo && s.IsVisible))
{
var brandFrame = frameFor(brand);
if (brandFrame == null) continue;
BlitBakedElement(buffer, cropW, cropH, options, brand, brandFrame, timings, $"brand {brand.Name}");
}
if (flashFrame != null)
{
var tFlash = System.Diagnostics.Stopwatch.GetTimestamp();
@@ -348,6 +370,9 @@ public sealed class SceneCompositor
case Source { IsBackground: true }:
case Source { Type: SourceType.Background }:
case Source { Type: SourceType.TextOverlay }:
// ⛔ The brand logo is drawn AFTER the blur group (creator ruling 2026-11-01):
// the blur is universal and must never hide the brand.
case Source { IsBrandLogo: true }:
case ZoomSceneElement { IsZoomActive: true }:
continue;
}
@@ -377,6 +402,44 @@ public sealed class SceneCompositor
return scaled;
}
/// <summary>
/// Apply every visible privacy blur to the composed-so-far buffer, strongest first, skipping
/// pixels a stronger blur already covered. That ordering is what makes an overlap read as "the
/// strongest one wins": blurring back-to-front would stack passes and produce something
/// stronger than any single slider allows, which the creator ruled out.
/// </summary>
private static void ApplyBlurLayers(
Scene scene, byte[] buffer, int cropW, int cropH, CompositorOptions options, CompositeTimings? timings)
{
var blurs = scene.Elements.OfType<Source>()
.Where(s => s.Type == SourceType.Blur && s.IsVisible && s.Width > 0 && s.Height > 0)
.OrderByDescending(s => s.BlurAmount)
.ToArray();
if (blurs.Length == 0) return;
var tBlur = System.Diagnostics.Stopwatch.GetTimestamp();
var coverage = System.Buffers.ArrayPool<byte>.Shared.Rent(cropW * cropH);
try
{
Array.Clear(coverage, 0, cropW * cropH);
var stride = cropW * 4;
foreach (var blur in blurs)
{
var x = (int)Math.Round(blur.X - options.SourceRectX);
var y = (int)Math.Round(blur.Y - options.SourceRectY);
RegionBlur.ApplyInPlace(
buffer, stride, cropW, cropH,
x, y, (int)Math.Round(blur.Width), (int)Math.Round(blur.Height),
blur.BlurAmount, blur.ClipShape == ClipShape.Round, coverage);
}
}
finally
{
System.Buffers.ArrayPool<byte>.Shared.Return(coverage);
}
timings?.Add("blur", System.Diagnostics.Stopwatch.GetTimestamp() - tBlur);
}
private static void BlitBakedElement(
byte[] buffer, int cropW, int cropH, CompositorOptions options, SceneElement element, VideoFrame frame,
CompositeTimings? timings, string stage)
+13
View File
@@ -0,0 +1,13 @@
namespace ytLive.Services.Entitlement;
/// <summary>
/// Test double for the entitlement rail. Production never uses it — a fake that could be reached
/// in a shipped build is a licence bypass, so it lives here only because tests need to drive both
/// answers without a Steam client or a network.
/// </summary>
public sealed class FakeEntitlement : IEntitlement
{
public FakeEntitlement(bool isPro = false) => IsPro = isPro;
public bool IsPro { get; set; }
}
+19
View File
@@ -0,0 +1,19 @@
namespace ytLive.Services.Entitlement;
/// <summary>
/// Where "is this copy licensed for Pro output?" comes from.
///
/// <para><b>One question, two sources.</b> The lifetime SKU is a Steam DLC; the monthly is a Polar
/// lease. Both answer this interface, and everything downstream — the output profile, the greyed
/// tier list, the notices — reads only this. Nothing outside <c>Services/Entitlement</c> may know
/// which rail proved it.</para>
///
/// <para><b>Fail closed.</b> An implementation that cannot reach its source, cannot load its
/// native library, or has no product id configured returns <c>false</c>. Pro is never a default,
/// never a cached "probably", and never the result of an exception being swallowed as true.</para>
/// </summary>
public interface IEntitlement
{
/// <summary>True when this session may emit above the free output budget.</summary>
bool IsPro { get; }
}
+82
View File
@@ -0,0 +1,82 @@
using Steamworks;
namespace ytLive.Services.Entitlement;
/// <summary>
/// The lifetime SKU: a Steam **DLC** on the free app, read locally from the Steam client.
///
/// <para><b>This is the whole purchase story.</b> There is no key, no server and no lease — the
/// customer buys the DLC on the store page and Steam already knows. The app asks once and caches
/// the answer; a refunded DLC stops reporting ownership the next time the app starts.</para>
///
/// <para><b>⛔ Never sell the monthly plan through this.</b> Steamworks requires in-app purchases
/// to use the Steam Wallet, so anything sold from inside the app would be a policy violation. The
/// monthly lives on the website and is billed by Polar (<see cref="PolarEntitlement"/> when it
/// lands); this class only ever reads what Valve already sold.</para>
///
/// <para><b>Steam absent is normal, not exceptional.</b> A copied folder, a shortcut run without
/// the client, or a CI machine has no Steam — <see cref="SteamAPI.Init"/> returns false and the
/// app runs as the free tier. It must never refuse to start over an entitlement lookup.</para>
/// </summary>
public sealed class SteamEntitlement : IEntitlement
{
/// <summary>The DLC's own app id, not the base app's. Zero = not configured yet, which reads
/// as "no entitlement" rather than "try anyway".</summary>
private readonly uint _dlcAppId;
private bool _initAttempted;
private bool _available;
private bool? _cached;
public SteamEntitlement(uint dlcAppId) => _dlcAppId = dlcAppId;
/// <summary>Configured with no product id — the state before the Steamworks app exists.</summary>
public static SteamEntitlement NotConfigured() => new(0);
public bool IsPro
{
get
{
if (_dlcAppId == 0) return false;
if (_cached is { } known) return known;
if (!_initAttempted)
{
_initAttempted = true;
try
{
// No steam_appid.txt and no client → false. That is the documented free path.
_available = SteamAPI.Init();
}
catch (Exception)
{
// A missing steam_api64.dll throws on first touch. Free tier, never a crash.
_available = false;
}
}
if (!_available) { _cached = false; return false; }
try
{
var owned = SteamApps.BIsDlcInstalled(new AppId_t(_dlcAppId));
_cached = owned;
return owned;
}
catch (Exception)
{
return false;
}
}
}
/// <summary>Matches Steam's own lifecycle callbacks; called from the frame pump's pump thread
/// would be wrong, so nothing here schedules it automatically.</summary>
public void Shutdown()
{
if (_available) SteamAPI.Shutdown();
_available = false;
_cached = null;
_initAttempted = false;
}
}
+2 -1
View File
@@ -111,7 +111,7 @@ public partial class LayoutStore : IDisposable
ChatShowTimestamps, ChatShowBadges, ChatMemberColor, ChatSuperChatColor,
WebUri, MediaPath, MediaIsLooping, MediaVolume, MediaPlaybackState,
AlertVideoAssetId, AlertVideoPath, AlertUseDefaultVideo, AlertShowTicker, AlertVideoVolume, SortOrder,
AlertDisplayMethod, IsBrandLogo
AlertDisplayMethod, IsBrandLogo, BlurAmount
FROM Source ORDER BY SortOrder
""";
using var reader = cmd.ExecuteReader();
@@ -164,6 +164,7 @@ public partial class LayoutStore : IDisposable
AlertVideoVolume = reader.IsDBNull(34) ? 1.0 : reader.GetDouble(34),
AlertDisplayMethod = reader.IsDBNull(36) ? AlertDisplayMethod.TickerScroll : (AlertDisplayMethod)reader.GetInt32(36),
IsBrandLogo = reader.GetInt32(reader.GetOrdinal("IsBrandLogo")) != 0,
BlurAmount = reader.IsDBNull(reader.GetOrdinal("BlurAmount")) ? 0.5 : reader.GetDouble(reader.GetOrdinal("BlurAmount")),
};
if (!sourcesByScene.TryGetValue(sceneId, out var list))
sourcesByScene[sceneId] = list = new List<(Source, int)>();
+7
View File
@@ -199,6 +199,13 @@ public partial class LayoutStore : IDisposable
cmd.ExecuteNonQuery();
}
if (!columns.Contains("BlurAmount"))
{
using var blur = _connection.CreateCommand();
blur.CommandText = "ALTER TABLE Source ADD COLUMN BlurAmount REAL NOT NULL DEFAULT 0.5;";
blur.ExecuteNonQuery();
}
if (!columns.Contains("IsBrandLogo"))
{
using var cmd = _connection.CreateCommand();
+4 -2
View File
@@ -92,7 +92,7 @@ public partial class LayoutStore : IDisposable
ChatShowTimestamps, ChatShowBadges, ChatMemberColor, ChatSuperChatColor,
WebUri, MediaPath, MediaIsLooping, MediaVolume, MediaPlaybackState,
AlertVideoAssetId, AlertVideoPath, AlertUseDefaultVideo, AlertShowTicker, AlertVideoVolume,
AlertDisplayMethod, IsBrandLogo)
AlertDisplayMethod, IsBrandLogo, BlurAmount)
VALUES ($id, $sceneId, $assetId, $type, $name, $isEnabled,
$x, $y, $w, $h, $opacity, $monitor,
$clip, $mirrored, $isBackground, $captureKey, $showDesktop, $sort,
@@ -100,7 +100,7 @@ public partial class LayoutStore : IDisposable
$chatTimestamps, $chatBadges, $chatMemberColor, $chatSuperChatColor,
$webUri, $mediaPath, $mediaIsLooping, $mediaVolume, $mediaPlaybackState,
$alertVideoAssetId, $alertVideoPath, $alertUseDefaultVideo, $alertShowTicker, $alertVideoVolume,
$alertDisplayMethod, $isBrandLogo)
$alertDisplayMethod, $isBrandLogo, $blurAmount)
""";
cmd.Transaction = tx;
var idP = cmd.Parameters.Add("$id", SqliteType.Text);
@@ -141,6 +141,7 @@ public partial class LayoutStore : IDisposable
var alertVideoVolumeP = cmd.Parameters.Add("$alertVideoVolume", SqliteType.Real);
var alertDisplayMethodP = cmd.Parameters.Add("$alertDisplayMethod", SqliteType.Integer);
var isBrandLogoP = cmd.Parameters.Add("$isBrandLogo", SqliteType.Integer);
cmd.Parameters.Add("$blurAmount", SqliteType.Real);
// Source and WebcamSceneConfig share ONE z-order space per scene:
// each element gets its index within scene.Elements regardless of
@@ -190,6 +191,7 @@ public partial class LayoutStore : IDisposable
alertVideoVolumeP.Value = source.AlertVideoVolume;
alertDisplayMethodP.Value = (int)source.AlertDisplayMethod;
isBrandLogoP.Value = source.IsBrandLogo ? 1 : 0;
cmd.Parameters["$blurAmount"].Value = source.BlurAmount;
cmd.ExecuteNonQuery();
}
}
+7
View File
@@ -45,6 +45,13 @@ public partial class LayoutStore : IDisposable
UpsertSetting("Audio.SyncOffsetMs", Math.Clamp(ms, -500, 500).ToString());
}
/// <summary>Zoom box follow mode (creator ruling 2026-11-01): false = ANCHOR (the capture
/// stays on the point that was clicked, the default), true = FOLLOW (the capture re-anchors
/// to the box centre while it is dragged).</summary>
public bool LoadZoomFollowBox() => GetSetting("Zoom.FollowBox") == "1";
public void SaveZoomFollowBox(bool follow) => UpsertSetting("Zoom.FollowBox", follow ? "1" : "0");
/// <summary>Mono output (creator ruling 2026-10-30): folds the mix so single-sided audio is
/// audible on both sides. Restored at startup — an accessibility switch that resets is a
/// failure, not a default.</summary>
+36 -26
View File
@@ -5,32 +5,40 @@
> decisions are in [`docs/ai/decisions.md`](docs/ai/decisions.md).
> Markers: ☐ queued · 🔶 in progress · ⏳ blocked · ⏸ deferred · ❌ retired.
## Next up
## The surge — six days, all remaining coding (2026-11-02 → 11-07)
**The surge week (4 days, in this order).** Not every row below — this slice only, because it is
what the first public release is waiting on:
**Every open coding row is assigned below.** No later phase, no "after launch" list. Target is
**6–8 units a day** (above the measured 3–5 baseline — that is the point of a surge). If a day
overruns, the smallest item moves to the next day; a launch blocker never moves.
1. **Artifact shape** — `LlamaCasty.exe` rename (three pack URIs), `scripts/publish.sh`,
portable mode. Ends with a zip that runs on a clean machine.
2. **OutputProfile gate** — ≤921,600 px / ≤30 fps for the stream **and** the recorder, greyed tier
entries, plus the TASK 53 geometry tests that pin every tier.
3. **Entitlement seam** — `IEntitlement` against Polar's customer-portal API with a fake for tests,
`--activate` parsing, system messages.
4. **Real-machine day** — licence UI skeleton, a clean-profile install, a test broadcast.
**Rules, every unit, no exceptions:** one Good Dog test · clean build 0 warnings · per-class tests
green · `./scripts/verify.sh` on the declared scope · commit with the doc fact it falsifies
corrected. No new scope mid-week; anything discovered goes on a list for day 6.
Detail: [`commercial.md`](docs/ai/commercial.md) → Output profile / Entitlement;
[`Distribution.md`](Distribution.md). Day 5, if the four go well: the visibility picker (a hard
prerequisite for any *public* build).
| Day | Units | Done when |
|---|---|---|
| **1 · Mon** — licensing | `IEntitlement` seam + Steam DLC impl + fake · `HasProOutput` on the seam · greyed tier entries · licence UI four states + 7/1/0-day notices + "monthly is on the website, not Steam" · licence ID in About · system messages (`SystemMessage`/`MessageCenter` strip) · Debug-only `InternalsVisibleTo` | Fake drives all four states; Steam-less launch is the free profile; About shows the licence ID |
| **2 · Tue** — release blockers | Visibility picker + `UpdateBroadcast` · `StreamConfig` defaults · TASK 53 output contract (geometry test per tier, 9:16 e2e) · 9·5 webcam identity key · Move transitions (per-layer carry-across-scenes) | A public broadcast starts and changes while live; every tier pinned by a test |
| **3 · Wed** — resilience | TASK 32: blip retry → measured grace → amber RECONNECTING → one-click Back on air → fragmented MP4 → ingest pre-flight · 33 bandwidth step-down | Killing the network mid-broadcast recovers without ending it |
| **4 · Thu** — content & media | 3·17 Text layer · 21 media acquisition wiring + file picker + loop/volume UI · 49 chat profanity filter · 34 scheduled streams | Text layer renders/persists; media file plays, loops, has volume; scheduled stream created |
| **5 · Fri** — data & settings | 3·20 RewardEvent persistence + `superChatEvents.list` backfill · 39·2 YPP slice 2 · 37 defaults-vs-current split · 35 scene-linked audio · 40·A/C/D settings round · 55·2–3 disk hygiene | Session report reads persisted events; defaults can be reverted; temp clips cleaned |
| **6 · Sat** — finish & prove | 50 publish recording · preview undo (Ctrl+Z) · 14 creator feedback batch · 36 gold pass · full sweep: clean build, whole per-class suite, `publish.sh` artifact, EULA/privacy/notices in the artifact · commit + push | Gold pass list empty; artifact stages; suite green; pushed |
**TASK 3·17 — the Text layer** stays the first product row after the surge. The `TextOverlay` source
type exists as a placeholder and nothing else does: `AddSource` creates it 0×0, all four compositor
paths `continue` past it, `FramePump`'s hash skips it, it is not draggable, and it has no
text/font/colour properties or persistence. The unit: text content, font family/size/weight/style,
colour, alignment, drag/resize, persisted; renderer mirrors `Services/ChatBoxRenderer.cs`. One Good
Dog test.
**Day 6 is the only polish day.** No polish passes before it — a surge dies on cosmetic passes taken
in the middle.
## Next up (after the surge slice)
**TASK 3·17 — the Text layer** is scheduled in the surge (day 4). Placeholder detail retained for
the unit itself: `AddSource` creates it 0×0, all four compositor paths `continue` past it,
`FramePump`'s hash skips it, it is not draggable, and it has no text/font/colour properties or
persistence. Text content, font family/size/weight/style, colour, alignment, drag/resize,
persisted; renderer mirrors `Services/ChatBoxRenderer.cs`.
## Queue
> Every open coding row here is assigned to a surge day above. Rows still marked ☐ on
> 2026-11-07 are a failure of the plan, not a scheduling note.
| Task | Status | Scope | Detail |
|---|---|---|---|
| 3·17 | ☐ **NEXT** | **Text layer** — content, font family/size/weight/style, colour, alignment, drag/resize, persisted | [`task-03`](TASKS/task-03-capture-pipeline.md) |
@@ -44,16 +52,18 @@ Dog test.
| 34 | ☐ | Scheduled streams (Text-drawer version) | [`task-34`](TASKS/task-34-scheduled-streams.md) |
| 35 | ☐ | Scene-linked audio | [`task-35`](TASKS/task-35-scene-linked-audio.md) |
| 37 | ☐ | Defaults vs current layout split (build-id); enables one-click revert to defaults | [`task-37`](TASKS/task-37-defaults-current-split.md) |
| — | ✅ | **Preview undo (Ctrl+Z / Ctrl+Shift+Z)** — done 2026-11-01: `Models/PreviewHistory` + `MainViewModel.Preview`, one step per gesture, gated on `EditingActive`, cleared on layout load. Property edits not yet in the stack | [`ui-surface`](docs/ai/ui-surface.md) |
| 39·2 | ☐ | YPP slice 2: Analytics scopes, watch-hours/Shorts velocity + ETA | [`task-39`](TASKS/task-39-ypp-journey-tracker.md) |
| 49 | ☐ | Chat profanity filter: local, opt-in, **non-persistent**, user-supplied word list | [`task-49`](TASKS/task-49-chat-profanity-filter.md) |
| 50 | ☐ | One-button publish of the local recording (resumable upload) | [`task-50`](TASKS/task-50-publish-recording.md) |
| 53 | ☐ | Output-format contract: pin every tier with a geometry test, prove 9:16 end-to-end, recorded file matches output | [`task-53`](TASKS/task-53-output-formats.md) |
| 54 | 🔶 | Freemium: EULA + privacy shipped; **no licence path built** — needs the entitlement seam, the output-profile cap and the licence UI below; site copy still says free forever | [`task-54`](TASKS/task-54-marcom-free-merch.md) |
| — | ☐ | **Entitlement seam** — `IEntitlement` over Polar's customer-portal API (org ID public, org token never in the app), `conditions: {channel_id}`, 2 activations, 7–14 day lease, `--activate` CLI. **No claim page, no server** | [`commercial`](docs/ai/commercial.md) |
| — | ☐ | **OutputProfile gate** — ≤921,600 px / ≤30 fps for stream **and** recording, greyed tier entries, live re-resolve, never mid-stream | [`commercial`](docs/ai/commercial.md) |
| — | ☐ | **Licence UI** — key entry + four states, 7/1/0-day notices, portal link, licence ID in About | [`commercial`](docs/ai/commercial.md) |
| — | 🔶 | **Steamworks entitlement** — `IEntitlement` + `SteamEntitlement` (Steamworks.NET) + fake **done**; needs the DLC app id from Steamworks, then the ownership path is live | [`commercial`](docs/ai/commercial.md) |
| — | ☐ | **Entitlement seam** — Polar customer-portal path for the monthly (org ID public, org token never in the app), `conditions: {channel_id}`, 7–14 day lease, `--activate` CLI. **No claim page, no server** | [`commercial`](docs/ai/commercial.md) |
| — | 🔶 | **OutputProfile gate** — resolver + `EncoderOptions` wiring **done** (`Models/OutputProfile.cs`, one ffmpeg/two outputs, dev override); remaining: greyed tier entries in the dropdown, entitlement wiring | [`commercial`](docs/ai/commercial.md) |
| — | ☐ | **Licence UI** — four states, 7/1/0-day notices, "monthly is on the website, not Steam" line, portal link, licence ID in About | [`commercial`](docs/ai/commercial.md) |
| — | ☐ | **System messages** — `SystemMessage` + `MessageCenter`, strip above the dock, dedupe by key, short history, never composited | [`ui-surface`](docs/ai/ui-surface.md) |
| — | ☐ | **Packaging** — rename, `scripts/publish.sh`, portable mode; then `llamacasty-releases` repo + Gitea→GitHub push mirror, `gh release create`, winget manifest. Signing **deferred** until two subscribers | [`Distribution.md`](Distribution.md) |
| — | ☐ | **Steam packaging** — rename, `publish` output + `steam_api64.dll`, depot, `steamcmd` upload, store page + assets, DLC app | [`Distribution.md`](Distribution.md) |
| — | ☐ | **Training-video series** — capture the first 8–10 recurring questions as videos on `@llamacasty`; each is documentation, channel content and monetization at once | MARCOM → support→content loop |
| 9·5 | ☐ | Webcam identity key reconciliation | [`task-09`](TASKS/task-09-live-stream-management.md) |
| 14 | 🔶 | Creator feedback batch — branch 3+ | [`task-14`](TASKS/task-14-creator-feedback-batch.md) |
@@ -77,9 +87,9 @@ Dog test.
`UpdateBroadcast` in the same unit (it is the only code that can change a broadcast's privacy).
- **Kill the dev multi-instance affordance** — `Helpers/InstanceProfile.cs` is already `#if DEBUG`;
re-prove it on a Release build.
- **Release engineering** — `scripts/publish.sh` (self-contained win-x64, no test artifacts),
Debug-only `InternalsVisibleTo`, the `LlamaCasty.exe` assembly rename (three pack URIs, incl.
`MainWindow.xaml:14`), full license texts beside `THIRD-PARTY-NOTICES.txt` (TASK 4 req 9).
- **Release engineering** — `scripts/publish.sh` **done** (self-contained win-x64, `ffmpeg\`
guarded, no test artifacts), `LlamaCasty.exe` assembly rename **done**, full license texts beside
`THIRD-PARTY-NOTICES.txt` (TASK 4 req 9). Outstanding: Debug-only `InternalsVisibleTo`.
- **Gold pass** (TASK 36): the screens/layers audit, native-Windows verification, and the
branding-flash decision.
+5 -6
View File
@@ -1,11 +1,10 @@
# TASK 48 — Distribution & packaging: route decision, MSIX, signing
> ⛔ **THE ROUTE IN THIS FILE IS SUPERSEDED — 2026-10-31.** Distribution is **direct download from
> `llamacasty.com` (GitHub Releases) + winget primary**; **Steam and the Microsoft Store are parked**,
> third and fourth. Store IAP is not the billing path — **Polar** is, and the paid delta is output
> quality. Live policy: [`docs/ai/commercial.md`](../docs/ai/commercial.md); mechanics:
> [`Distribution.md`](../Distribution.md); cause of death: [`docs/ai/decisions.md`](../docs/ai/decisions.md).
> The MSIX build steps below are still accurate and remain the parked Store channel's artifact.
> ⛔ **THE ROUTE IN THIS FILE IS SUPERSEDED — 2026-10-31.** Distribution is **Steam exclusive**: a
> free app on Steam with the paid edition as a Steam DLC; the monthly plan is sold off-Steam. There
> is no direct download, no winget and no Store submission. Live policy:
> [`docs/ai/commercial.md`](../docs/ai/commercial.md); mechanics: [`Distribution.md`](../Distribution.md).
> The MSIX build steps below still work and are simply unused.
> Catalog: [`TASKS.md`](../TASKS.md) — status and requirements live here.
> **Research: [`TASKS/research-store-certification.md`](research-store-certification.md)** — the "why".
+5
View File
@@ -97,6 +97,11 @@ public partial class MainViewModel
Height = BrandLogoHeight,
};
/// <summary>The staged scene's brand logo, exposed so the preview can draw it ABOVE the universal
/// blur (the compositor blits it after the blur group — the logo is never obscured).</summary>
public Source? StagedBrandLogo =>
StagedScene?.Elements.OfType<Source>().FirstOrDefault(s => s.IsBrandLogo);
/// <summary>Exactly one brand logo per scene, placed directly above the background, carrying
/// the current App Settings image.</summary>
internal void EnsureBrandLogos()
+5
View File
@@ -44,6 +44,11 @@ public partial class MainViewModel : ViewModelBase
=> StagedScene != null
&& !Scenes.Any(s => s.Elements.OfType<Source>().Any(e => e.Type == SourceType.AlertBox));
/// <summary>Privacy blur is a Live-scene tool only (creator ruling 2026-11-01) — every other
/// scene's art is authored, and there is no desktop there to hide.</summary>
public bool CanAddBlur
=> StagedScene != null && SceneCatalog.Is(StagedScene.Name, SceneCatalog.Live);
public bool ShowChatInactiveMessage => !IsLive;
private void OnChatMessageReceived(ChatMessage message)
+68
View File
@@ -0,0 +1,68 @@
using ytLive.Helpers;
using ytLive.Services.Entitlement;
namespace ytLive.ViewModels;
/// <summary>
/// The entitlement surface: whether this session may emit output above the free budget.
///
/// <para>Deliberately a separate partial from <c>License.cs</c>: that file owns *how* a
/// licence is validated (Polar today), this one owns *what the answer means* for output.
/// Steam's DLC check and Polar's lease both collapse into <see cref="IsPremium"/>; nothing
/// downstream of <see cref="HasProOutput"/> cares which one proved it.</para>
/// </summary>
public partial class MainViewModel
{
/// <summary>
/// The single input to <see cref="Models.OutputProfile.Resolve"/>.
///
/// <para><b>Fail closed:</b> an unresolved or unreadable licence is simply false, so a
/// build with no entitlement emits the free profile. There is no "unknown" branch to get
/// wrong.</para>
///
/// <para><b>Developer mode never ships:</b> <see cref="DeveloperMode"/> is only ever
/// settable inside a development build (see <see cref="DevBuild"/>), so this expression
/// reduces to <c>IsPremium</c> in a Release binary.</para>
/// </summary>
public bool HasProOutput => IsPremium || DeveloperMode || _entitlement.IsPro;
/// <summary>
/// The entitlement rail for this session. Lifetime = Steam DLC; until the DLC app id exists it
/// is <see cref="SteamEntitlement.NotConfigured"/>, which reads false (fail closed). Tests
/// inject a fake through <see cref="EntitlementOverride"/>.
/// </summary>
private IEntitlement _entitlement = SteamEntitlement.NotConfigured();
/// <summary>Test seam: swap the rail without a Steam client. Internal — the test assembly is
/// the only caller, and a public setter here would be a licence bypass surface.</summary>
internal IEntitlement EntitlementOverride
{
get => _entitlement;
set
{
_entitlement = value;
OnPropertyChanged(nameof(HasProOutput));
}
}
private bool _developerMode;
/// <summary>
/// Development-only override: ignore the output budget and allow every shipped tier.
///
/// <para>There is no UI to reach this in a Release build — the panel that hosts the
/// checkbox is excluded from the Release compile — and the setter refuses the value
/// unless <see cref="DevBuild.IsDevelopment"/> is true, so even a hand-edited settings
/// file cannot unlock it.</para>
/// </summary>
public bool DeveloperMode
{
get => _developerMode;
set
{
if (!DevBuild.IsDevelopment) return;
if (!SetProperty(ref _developerMode, value)) return;
OnPropertyChanged(nameof(HasProOutput));
}
}
}
+79
View File
@@ -0,0 +1,79 @@
using ytLive.Helpers;
using ytLive.Models;
namespace ytLive.ViewModels;
/// <summary>
/// Preview undo/redo (creator directive 2026-11-01): Ctrl+Z and Ctrl+Shift+Z in edit mode.
///
/// <para>The stack lives on the view model rather than in <c>PreviewPane</c> because the edit
/// surface is not one control — a layer can be moved by a drag, removed from the layers list, or
/// hidden from the properties panel — and undo has to cover all of them or it is a lie.</para>
///
/// <para><b>Gated on edit mode.</b> Undo only means something while the preview is the edit
/// surface; with editing off the preview shows program output and a stray Ctrl+Z would silently
/// rewrite a scene the creator isn't looking at.</para>
/// </summary>
public partial class MainViewModel
{
private readonly PreviewHistory _previewHistory = new();
public bool CanUndoPreview => EditingActive && _previewHistory.CanUndo;
public bool CanRedoPreview => EditingActive && _previewHistory.CanRedo;
public RelayCommand UndoPreviewCommand { get; private set; } = null!;
public RelayCommand RedoPreviewCommand { get; private set; } = null!;
/// <summary>Call immediately BEFORE a layout mutation — once per gesture, never per mouse
/// move, or a single drag eats the whole stack.</summary>
internal void PushPreviewUndo()
{
if (!EditingActive) return;
_previewHistory.Capture(Scenes);
NotifyHistoryChanged();
}
private void UndoPreview()
{
if (!EditingActive || !_previewHistory.Undo(Scenes)) return;
AfterHistoryStep();
}
private void RedoPreview()
{
if (!EditingActive || !_previewHistory.Redo(Scenes)) return;
AfterHistoryStep();
}
private void AfterHistoryStep()
{
// Restored geometry has to reach the compositor: the baked region is cached per scene
// and keyed on element identity, so a pure value change is invisible to it until the
// cache is dropped. Without this, undo moves the model and the picture stays put.
foreach (var scene in Scenes) _sceneGraph.InvalidateBake(scene);
ScheduleSave();
NotifyHistoryChanged();
}
private void NotifyHistoryChanged()
{
OnPropertyChanged(nameof(CanUndoPreview));
OnPropertyChanged(nameof(CanRedoPreview));
}
private void InitPreviewHistory()
{
// RelayCommand queries CommandManager.RequerySuggested, so no explicit invalidation is
// needed when CanExecute changes.
UndoPreviewCommand = new RelayCommand(_ => UndoPreview(), _ => CanUndoPreview);
RedoPreviewCommand = new RelayCommand(_ => RedoPreview(), _ => CanRedoPreview);
}
/// <summary>Dropped on layout load: undoing across a reload would resurrect a layout the
/// creator never had.</summary>
private void ClearPreviewHistory()
{
_previewHistory.Clear();
NotifyHistoryChanged();
}
}
+9
View File
@@ -33,6 +33,12 @@ public partial class MainViewModel
foreach (var s in Scenes)
s.IsStaged = s == value;
// Scene-scoped menu affordances: the (+) menu's Blur entry is Live-only, and a
// binding that is never re-notified stays collapsed for the rest of the session
// (build 1082: the option vanished after the first layout load).
OnPropertyChanged(nameof(CanAddBlur));
OnPropertyChanged(nameof(StagedBrandLogo));
SelectedElement = null;
if (value != null)
{
@@ -87,6 +93,9 @@ public partial class MainViewModel
{
if (!SetProperty(ref _editingActive, value)) return;
OnPropertyChanged(nameof(IsEditMode));
// Undo only exists while the preview is the edit surface.
OnPropertyChanged(nameof(CanUndoPreview));
OnPropertyChanged(nameof(CanRedoPreview));
// EDIT decides whether the ON-AIR start is live or a test (creator ruling 2026-10-30).
OnPropertyChanged(nameof(PrimaryStartKind));
OnPropertyChanged(nameof(PrimaryStartButtonLabel));
+3 -8
View File
@@ -78,20 +78,15 @@ public partial class MainViewModel
}
}
#if DEBUG
private const bool DevelopmentBuild = true;
#else
private const bool DevelopmentBuild = false;
#endif
/// <summary>Can the scoreboard be configured at all? Signed-in creators yes; in a DEBUG build
/// always, so the strip can be previewed and judged before there is an account (creator,
/// 2026-10-30).</summary>
public bool CanUseScoreboard => IsConnected || IsDevelopmentBuild;
/// <summary>True in a DEBUG build. Used only to expose development-only controls, never to
/// change behaviour — the shipped binary differs by their absence, not by a code path.</summary>
public bool IsDevelopmentBuild => DevelopmentBuild;
/// change behaviour — the shipped binary differs by their absence, not by a code path.
/// Single source: <see cref="DevBuild.IsDevelopment"/>.</summary>
public bool IsDevelopmentBuild => DevBuild.IsDevelopment;
private bool _scoreboardSimulate;
+42
View File
@@ -0,0 +1,42 @@
namespace ytLive.ViewModels;
/// <summary>
/// App Settings as a right-edge drawer (creator ruling 2026-11-01): the gear rail tab opens it
/// immediately, in the same exclusive-slide pattern as Stream Settings / YPP / Socials / TEST.
///
/// <para>It is a separate flag from <see cref="IsSettingsOpen"/> because the overlay shell now
/// only carries Report Bug / Feature Request / About — settings stopped being a modal.</para>
/// </summary>
public partial class MainViewModel
{
private bool _settingsDrawerOpen;
public bool SettingsDrawerOpen
{
get => _settingsDrawerOpen;
private set => SetProperty(ref _settingsDrawerOpen, value);
}
internal void ToggleSettingsDrawer()
{
if (_settingsDrawerOpen)
{
SettingsDrawerOpen = false;
return;
}
// One drawer at a time, like the rail's other tabs.
BroadcastForm.IsDrawerOpen = false;
Ypp.IsDrawerOpen = false;
TestSession.IsDrawerOpen = false;
if (SocialsDrawerOpen) CloseSocialsDrawer();
SettingsDrawerOpen = true;
}
/// <summary>Called by the other drawers when they open, so settings yields to them.</summary>
private void CloseSettingsDrawerIfOpen()
{
if (_settingsDrawerOpen) SettingsDrawerOpen = false;
}
}
+1
View File
@@ -185,6 +185,7 @@ public partial class MainViewModel
BroadcastForm.IsDrawerOpen = false;
Ypp.IsDrawerOpen = false;
TestSession.IsDrawerOpen = false;
CloseSettingsDrawerIfOpen();
SocialsDrawerOpen = true;
OnPropertyChanged(nameof(SocialsDrawer));
OnPropertyChanged(nameof(SocialsDrawerOpen));
+28 -4
View File
@@ -18,12 +18,20 @@ public partial class MainViewModel
{
var scene = StagedScene;
if (scene == null) return;
PushPreviewUndo();
var sourceType = parameter is SourceType typed
? typed
: Enum.TryParse<SourceType>(parameter?.ToString(), true, out var parsed) ? parsed : SourceType.Image;
// Privacy blur is a Live-scene tool: it exists to hide the creator's desktop, and every
// other scene's art is authored. Rejecting here (not only in the (+) menu) keeps a stale
// menu item or a scripted call from planting one on BRB.
if (sourceType == SourceType.Blur && !SceneCatalog.Is(scene.Name, SceneCatalog.Live))
return;
var baseName = sourceType switch
{
SourceType.Blur => "Blur",
SourceType.Image => "Image",
SourceType.TextOverlay => "Text",
SourceType.Countdown => "Countdown",
@@ -52,14 +60,30 @@ public partial class MainViewModel
? $"{baseName}-{webCount}"
: NextSourceName(scene, baseName),
Type = sourceType,
X = sourceType == SourceType.ChatBox ? 1400 : sourceType == SourceType.AlertBox ? 620 : 0,
X = sourceType == SourceType.ChatBox ? 1400
: sourceType == SourceType.AlertBox ? 620
: sourceType == SourceType.Blur ? 700 : 0,
// The scoreboard is a full-width bar: its Y comes from the edge it owns (resolved
// against the social bar at render time), never from a drag.
Y = sourceType == SourceType.Scoreboard ? 1024
: sourceType == SourceType.ChatBox ? 20 : sourceType == SourceType.AlertBox ? 430 : 0,
Width = sourceType == SourceType.WebSource ? 640 : sourceType == SourceType.ChatBox ? 500 : sourceType == SourceType.AlertBox ? 680 : sourceType == SourceType.Scoreboard ? 1920 : 0,
Height = sourceType == SourceType.WebSource ? 480 : sourceType == SourceType.ChatBox ? 648 : sourceType == SourceType.AlertBox ? 200 : sourceType == SourceType.Scoreboard ? 56 : 0,
: sourceType == SourceType.ChatBox ? 20
: sourceType == SourceType.AlertBox ? 430
: sourceType == SourceType.Blur ? 600 : 0,
Width = sourceType == SourceType.WebSource ? 640
: sourceType == SourceType.ChatBox ? 500
: sourceType == SourceType.AlertBox ? 680
: sourceType == SourceType.Scoreboard ? 1920
: sourceType == SourceType.Blur ? 240 : 0,
Height = sourceType == SourceType.WebSource ? 480
: sourceType == SourceType.ChatBox ? 648
: sourceType == SourceType.AlertBox ? 200
: sourceType == SourceType.Scoreboard ? 56
: sourceType == SourceType.Blur ? 160 : 0,
};
// The blur is universal (creator ruling 2026-11-01): the compositor applies it over every
// layer, so its position in the list does not affect the output. It is added at the top so
// the layer list reads "this covers everything", and no reorder clamp is needed.
_sceneGraph.AddElement(scene, source);
if (sourceType == SourceType.WebSource)
@@ -405,10 +405,14 @@ public partial class MainViewModel : ViewModelBase
// Full encoder options for the current tier, or null when no RTMP URL is
// available — the pump then skips the encoder entirely (TASK 5 fills the seam).
//
// BOTH outputs (RTMP + local MP4) are encoded from this one option set, so the
// output-profile rule is applied here, once: a capped build cannot stream 1080p and
// record it too. See Models/OutputProfile.cs — pixels, not "720p".
private EncoderOptions? BuildEncoderOptions()
{
var url = _rtmpUrlProvider();
var quality = SelectedQuality;
var quality = OutputProfile.Resolve(SelectedQuality, QualityOptions, HasProOutput);
return new EncoderOptions
{
RtmpUrl = url ?? string.Empty,
+3
View File
@@ -74,6 +74,9 @@ public partial class MainViewModel
/// <summary>Shows the mirror / clip-shape row in the source chip when a webcam is selected.</summary>
public bool IsWebcamSelected => SelectedElement is WebcamSceneConfig;
/// <summary>The selected layer is a privacy blur — its properties panel shows shape + amount.</summary>
public bool IsBlurSelected => SelectedElement is Source { IsBlur: true };
/// <summary>
/// The reason the webcam feed is down (device in use, offline, locked, no frames),
/// or null when it's alive. Surfaced as a red chip so a dead camera is never a
+3
View File
@@ -39,6 +39,7 @@ public partial class MainViewModel
Ypp.IsDrawerOpen = false;
TestSession.IsDrawerOpen = false;
CloseSocialsDrawer();
CloseSettingsDrawerIfOpen();
}
};
Ypp.PropertyChanged += (_, e) =>
@@ -48,6 +49,7 @@ public partial class MainViewModel
BroadcastForm.IsDrawerOpen = false;
TestSession.IsDrawerOpen = false;
CloseSocialsDrawer();
CloseSettingsDrawerIfOpen();
}
};
TestSession.PropertyChanged += (_, e) =>
@@ -57,6 +59,7 @@ public partial class MainViewModel
BroadcastForm.IsDrawerOpen = false;
Ypp.IsDrawerOpen = false;
CloseSocialsDrawer();
CloseSettingsDrawerIfOpen();
}
};
}
+64 -4
View File
@@ -21,7 +21,6 @@ public partial class MainViewModel
{
public void ActivateZoom(double clickX, double clickY)
{
if (!(IsLive || IsRecording)) return;
var maxW = MasterFrameWidth * 0.7;
var maxH = MasterFrameHeight * 0.7;
double w, h;
@@ -74,9 +73,51 @@ public partial class MainViewModel
RefreshZoomUi();
}
public void ToggleZoom()
/// <summary>
/// The gesture behind the zoom box: activate it centred on the click, or dismiss it if it is
/// already open. Both halves live here because the old split (activate while live, dismiss
/// only otherwise) made the gesture do nothing at all when idle — the box could be turned off
/// but never on (creator, 2026-11-01).
/// </summary>
/// <summary>
/// Settings pill: **Anchor** (default, off) keeps the capture on the clicked point while the
/// box moves; **Follow** (on) re-anchors the capture to the box centre so the magnifier shows
/// whatever it hovers over. Persisted, because a creator who chose follow should not have to
/// choose it again every launch.
/// </summary>
private bool _zoomFollowsBox;
public bool ZoomFollowsBox
{
get => _zoomFollowsBox;
set
{
if (!SetProperty(ref _zoomFollowsBox, value)) return;
_layoutStore.SaveZoomFollowBox(value);
// Switching to follow mid-hold snaps the capture under the box immediately rather
// than waiting for the next drag.
if (value && _zoomState.IsActive)
{
ReanchorCaptureToBox();
var zoomTarget = StagedScene?.Elements.OfType<ZoomSceneElement>().FirstOrDefault(e => e.IsZoomActive);
if (zoomTarget != null)
{
zoomTarget.CaptureX = _zoomState.CaptureX;
zoomTarget.CaptureY = _zoomState.CaptureY;
}
if (StagedScene != null) _sceneGraph.InvalidateBake(StagedScene);
OnPropertyChanged(nameof(ZoomState));
}
}
}
/// <summary>Releasing the box: called when Ctrl goes down while the magnifier is open, so the
/// creator can dismiss it with the same hand that opened it (in addition to the gesture).</summary>
public void DismissZoomIfActive() => DismissZoom();
public void ToggleZoom(double clickX, double clickY)
{
if (_zoomState.IsActive) DismissZoom();
else ActivateZoom(clickX, clickY);
}
public void DismissZoom()
@@ -117,13 +158,32 @@ public partial class MainViewModel
{
zoomTarget.X = _zoomState.X;
zoomTarget.Y = _zoomState.Y;
// CaptureX/Y are deliberately NOT touched: dragging relocates the box,
// never the anchored captured area (creator ruling 2026-10-08).
// ANCHOR (default): CaptureX/Y are deliberately untouched — dragging relocates the
// box over the area that was clicked (creator ruling 2026-10-08). FOLLOW (opt-in via
// the Settings pill): the capture re-anchors to the box centre every move, so the
// magnifier shows whatever it is hovering over (creator ruling 2026-11-01).
if (_zoomFollowsBox)
{
ReanchorCaptureToBox();
zoomTarget.CaptureX = _zoomState.CaptureX;
zoomTarget.CaptureY = _zoomState.CaptureY;
}
}
OnPropertyChanged(nameof(ZoomState));
RebuildDimRectsForZoom();
}
/// <summary>Point the capture window at the box's current centre. The capture is half the
/// box's size, exactly as <see cref="ActivateZoom"/> computes it, and clamped to the master
/// frame independently so an edge drag can keep the box on screen and the capture legal.</summary>
private void ReanchorCaptureToBox()
{
var boxCentreX = _zoomState.X + _zoomState.Width / 2;
var boxCentreY = _zoomState.Y + _zoomState.Height / 2;
_zoomState.CaptureX = Math.Clamp(boxCentreX - _zoomState.Width / 4, 0, MasterFrameWidth - _zoomState.Width / 2);
_zoomState.CaptureY = Math.Clamp(boxCentreY - _zoomState.Height / 4, 0, MasterFrameHeight - _zoomState.Height / 2);
}
public void EndZoomMove()
{
if (_zoomState.IsMoving)
+7 -3
View File
@@ -66,6 +66,7 @@ public partial class MainViewModel : ViewModelBase
if (SetProperty(ref _selectedElement, value))
{
OnPropertyChanged(nameof(IsWebcamSelected));
OnPropertyChanged(nameof(IsBlurSelected));
OnPropertyChanged(nameof(IsElementsPanelEmpty));
OnPropertyChanged(nameof(CanToggleClipShape));
if (_selectedElement != null)
@@ -208,9 +209,9 @@ public partial class MainViewModel : ViewModelBase
AddSourceCommand = new RelayCommand(parameter => AddSource(parameter));
AddWebcamCommand = new RelayCommand(_ => _ = AddWebcamToStagedSceneAsync());
AddImageCommand = new RelayCommand(_ => AddImage());
RemoveSourceCommand = new RelayCommand(element => RemoveElement(element as SceneElement));
RemoveSourceCommand = new RelayCommand(element => { PushPreviewUndo(); RemoveElement(element as SceneElement); });
EditElementCommand = new RelayCommand(element => BeginEditElement(element as SceneElement));
ToggleElementVisibilityCommand = new RelayCommand(element => ToggleElementVisibility(element as SceneElement));
ToggleElementVisibilityCommand = new RelayCommand(element => { PushPreviewUndo(); ToggleElementVisibility(element as SceneElement); });
BrowseAlertVideoCommand = new RelayCommand(element => BrowseAlertVideo(element as Source), element => element is Source { Type: SourceType.AlertBox });
ResetAlertVideoCommand = new RelayCommand(element => ResetAlertVideo(element as Source), element => element is Source { Type: SourceType.AlertBox });
ChangeWebcamCommand = new RelayCommand(_ => _ = ChangeWebcamAsync(), _ => CanChangeWebcam);
@@ -232,7 +233,8 @@ public partial class MainViewModel : ViewModelBase
ToggleMicMuteCommand = new RelayCommand(_ => ToggleMicMute());
ToggleGameMuteCommand = new RelayCommand(_ => ToggleGameMute());
OpenMicPickerCommand = new RelayCommand(_ => PickMicrophone());
OpenSettingsCommand = new RelayCommand(_ => ShowOverlay(nameof(IsSettingsOpen), "App Settings"));
OpenSettingsCommand = new RelayCommand(_ => ToggleSettingsDrawer());
InitPreviewHistory();
OpenBugCommand = new RelayCommand(_ => ShowOverlay(nameof(IsBugOpen), "Report Bug"));
OpenFeatureCommand = new RelayCommand(_ => ShowOverlay(nameof(IsFeatureOpen), "Feature Request"));
OpenAboutCommand = new RelayCommand(_ => ShowOverlay(nameof(IsAboutOpen), "About"));
@@ -276,6 +278,7 @@ public partial class MainViewModel : ViewModelBase
// (yellow) instead of silently falling back to the default.
MicSourceName = _layoutStore.LoadMicSourceName();
AudioSyncOffsetMs = _layoutStore.LoadAudioSyncOffsetMs();
_zoomFollowsBox = _layoutStore.LoadZoomFollowBox();
MonoOutput = _layoutStore.LoadMonoOutput(); // applied to the mixer by the setter
_musicPlayer.UserGain = (float)Helpers.GainDb.FromDb(TraxDefaultDb); // background by default
InitScoreboard();
@@ -450,6 +453,7 @@ public partial class MainViewModel : ViewModelBase
{
_isLoading = false;
}
ClearPreviewHistory();
StagedScene = Scenes.FirstOrDefault(s => SceneCatalog.Is(s.Name, SceneCatalog.Starting)) ?? Scenes.FirstOrDefault();
UpdateActiveBackground();
UpdateActiveChatBoxPreviews();
+1 -1
View File
@@ -52,7 +52,7 @@ C# / WPF (.NET 8) following MVVM:
| Go-live, broadcasts, health, chat API | [`docs/ai/youtube-api.md`](docs/ai/youtube-api.md) | go-live, broadcast lifecycle, health polling, streaming close-out |
| Control surface, theming, transitions | [`docs/ai/ui-surface.md`](docs/ai/ui-surface.md) | anything the creator looks at |
| Brand, packaging, legal posture | [`docs/ai/product.md`](docs/ai/product.md) | branding, naming, packaging behaviour, legal obligations |
| Prices, entitlement, channels, signing, promo | [`docs/ai/commercial.md`](docs/ai/commercial.md) | anything about money: pricing, licence keys, output cap, winget/Steam/Store, costs |
| Prices, entitlement, channels, support | [`docs/ai/commercial.md`](docs/ai/commercial.md) | anything about money: pricing, licence keys, output cap, Steam/Steamworks, the monthly plan, costs |
| Hosts, build commands, test map | [`docs/ai/environment.md`](docs/ai/environment.md) | building, running, adding a test |
| Routes for every subsystem | [`docs/ai/index.md`](docs/ai/index.md) | you want the full table with a "read when" per file |
+89 -62
View File
@@ -3,7 +3,7 @@
The single source of truth for what LlamaCasty charges, what a licence entitles, how it ships and
what support it does and does not include. Read before any pricing, licensing, distribution,
storefront, support or promo work. Cause of death for every retired path:
[`decisions.md`](decisions.md). Release mechanics (build, zip, mirror, winget):
[`decisions.md`](decisions.md). Release mechanics (build, depot, SteamPipe upload):
[`Distribution.md`](../../Distribution.md).
## Model
@@ -31,9 +31,15 @@ The cap is a pixel budget plus a frame rate, not the word "720p":
| Vertical 9:16 | 720×1280 @30 | 1080×1920 @60 |
- **Records too.** The cap governs the file the creator keeps as well as the stream; otherwise
free 1080p recording is a re-upload hole. One `OutputProfile`, resolved once per session and
consumed by **both** the stream encoder and the recorder — never two checks.
free 1080p recording is a re-upload hole. **There is one ffmpeg process with two output blocks**
(FLV to RTMP, MP4 to disk) fed by one `EncoderOptions`, and the profile is resolved once when
those options are built (`MainViewModel.Streaming.Operations.cs` → `Models/OutputProfile.cs`).
There is no second encoder to keep in step and therefore no second check to forget.
- **Fail closed.** Unresolved, unreadable or unvalidated entitlement = free tier. Never Pro.
- **The development override exists and never ships.** `MainViewModel.DeveloperMode` bypasses the
budget in a Debug build only; the Settings row that toggles it is **excluded from the Release
compile** (`ytLive.csproj` removes its Page and code-behind), and the setter refuses the value
when `Helpers/DevBuild.IsDevelopment` is false. Not a hidden row — an absent one.
- **Never downgrade a running stream.** The gate applies to the next start; pulling quality out
of a live broadcast is a worse bug than one free 1080p session.
- **The greyed menu entry is the sales surface.** It stays clickable, says what it costs, opens
@@ -43,11 +49,29 @@ The cap is a pixel budget plus a frame rate, not the word "720p":
(cancel, revoke, sign-out, channel switch) greys them again on the next refresh.
- **Bitrate follows the profile** — a capped user is not offered a 1080p bitrate.
## Entitlement
## Entitlement — two sources, one profile
**Polar is the merchant of record and the only source of truth.** It takes the money, remits
VAT/GST, handles refunds and chargebacks, and holds the keys. **There is no server of ours in the
loop** — no claim page, no callback endpoint, no key database.
**Pro is `steamDlcOwned || polarKeyValid`.** Both resolve to the same `OutputProfile`; neither
touches a feature. Fail closed: anything unresolved is the free tier.
### Steam (lifetime)
- **Steam owns the lifetime SKU.** `BIsDlcInstalled(dlcAppId)` after `SteamAPI.Init`, behind
`IEntitlement` (`Services/Entitlement/`). It is a local check against Steam's own state — no
server, no key, no lease.
- **Fail closed, four ways:** no DLC app id configured, `SteamAPI.Init()` false (no client),
a thrown native load (missing `steam_api64.dll`), and "not owned" all resolve to the free tier.
None of them may crash the app or grant Pro.
- **Steam down or not running** → free profile, with a line explaining why, never a refusal to
start. A Steam build launched outside Steam is the common case for people who pin shortcuts.
- **No licence key exists for the Steam SKU**, so nothing to paste, email or lose. A refunded DLC
simply stops reporting ownership on the next start.
### Polar (monthly, sold off-Steam)
**Polar is the merchant of record and the only source of truth** for the monthly plan. It takes the
money, remits VAT/GST, handles refunds and chargebacks, and holds the keys. **There is no server of
ours in the loop** — no claim page, no callback endpoint, no key database.
- **Key** — `LCYT-` prefix; org `c05fb364-…` and the endpoints are in `CREDENTIALS.md`. No
product is created yet.
@@ -84,57 +108,51 @@ channel ID. That is accepted: the free tier is the defence, the licence is a lea
determined crack buys little. Do not propose a signed token, a hardware fingerprint or a server
to "fix" it.
## Channels
## Channels — Steam only
**One artifact, several ways to get it.** A self-contained single-file `LlamaCasty.exe` plus the
bundled `ffmpeg\` folder, zipped. No .NET install, no admin, no installer framework. Trimming
stays off (WPF reflection), so expect ~110–150 MB.
**Steam is the distributor.** One free app on the store, the paid edition as a Steam **DLC**, and
no other vector: no direct download, no winget, no Scoop/Chocolatey, no Microsoft Store. The store
page is the single authoritative source for the download, the stats and the reviews.
1. **Direct download** — `llamacasty.com` links the zip. **Binaries live in a second Gitea repo
(`llamacasty-releases`), push-mirrored to a public GitHub repo**, so the source repo stays
private and the handout repo contains nothing but a README, an issue template and the release
assets. The mirror carries refs, not GitHub Release assets — the zip is uploaded with
`gh release create`. Mechanics: [`Distribution.md`](../../Distribution.md).
2. **winget — the primary install path.** Manifest in `microsoft/winget-pkgs`, `InstallerType:
portable`, pinned SHA-256. That hash pin is the anti-tamper wall: the official channel delivers
exactly the published artifact or fails. One `wingetcreate update` PR per release. Optional:
Scoop and Chocolatey manifests over the same zip.
3. **Steam — parked at $100.** Lifetime Pro as DLC only (Steam has no subscriptions), page public
two weeks before release, 30% cut, and price parity with the site. It is the only channel with
discovery *and* an install that never meets SmartScreen, and it updates itself — which is why it
stays in the plan despite the cut.
4. **Microsoft Store — parked, and now free.** Microsoft waived the **$19** individual developer
fee (and removed the **$99** company fee in May 2026). It is the only storefront that bills a
subscription natively *and* the only zero-cost route to a Microsoft-signed install with no
SmartScreen warning, because Microsoft signs the MSIX. Bans self-updaters, so a Store build
ships without one.
- **Lifetime Pro = Steam DLC.** Bought on the **store page**; the app only reads ownership
(`ISteamApps::BIsDlcInstalled` / `UserHasLicenseForApp`). No purchase flow in the app, no Steam
Wallet code, nothing to reconcile.
- **The $10/month plan is sold outside Steam** and is **never purchasable inside a Steam build**.
Steamworks requires in-app purchases to go through the Steam Wallet — so the app *states* that
monthly plans exist on the site and does not sell them. If the app ever grows a checkout for it,
that is the policy violation.
- **Boot shape:** the app ships `steam_api64.dll` beside the exe and calls `SteamAPI.Init`. That
is a functional dependency, not the rejected "native helper DLL for IP protection" — Steam
ownership cannot be checked without it. Launched without Steam running, the app must fall back to
the **free profile** and say so, never refuse to start.
- **Updates are Steam's.** The depot push is the update; the app keeps no updater and no version
banner (the old "no self-updater" rule stays, for the same reason: it works differently).
- **Portable mode is no longer a distributable.** `portable.txt` remains as a feature for anyone who
copies the installed folder; it is not a delivery mechanism.
- **Steam Direct** is **$100 per app**, recoupable after $1,000 adjusted gross revenue.
- **Price parity:** if the lifetime is ever sold off-Steam, it may not be cheaper than the Steam
price.
**Not channels, ever:** Patreon or any subscription platform of our own, paywalled early access,
a paid beta, a Discord. Content is the funnel; the channel is only the checkout.
**Not channels, ever:** direct download, winget/Chocolatey/Scoop, the Microsoft Store, Patreon or
any subscription platform of our own, paywalled early access, a paid beta, a Discord. Content is
the funnel; Steam is the checkout.
**Portable mode:** a `portable.txt` marker beside the exe keeps the layout DB and settings in
`.\data\` instead of `%APPDATA%\ytLlive` — the USB-stick case, hung off `LayoutPathOverride`.
It is the reason the zip survives even if Steam becomes the primary channel.
**Support surfaces this creates:** the Steam store page's support contact, Steam **Announcements**
for known issues and release notes, Steam Discussions left pinned and unread, and one public issue
repo for bugs that survive the friction of needing an account.
## Signing — deferred until there is revenue
## Signing — not needed for the Steam channel
- **Not bought at launch.** Artifact Signing is listed in the costs as **deferred**: it is paid for
out of Pro revenue, and the trigger is **two subscribers**.
- **What it actually buys:** a named publisher line, fewer antivirus false positives on a ~150 MB
self-extracting exe, and tamper evidence for hand-downloaded zips. It does **not** remove the
SmartScreen warning on day one — Microsoft deleted the EV instant-bypass in March 2024, so a new
certificate has zero reputation and clears only with download volume.
- **Azure Artifact Signing** (renamed from "Trusted Signing"), **$9.99/month Basic**, up to 5,000
signatures, **requires a paid Azure subscription**. Individual identity validation exists and
must be renewed before it expires; it is the slow (days-to-weeks) part, so start it *when the
purchase is decided*, not before.
- **Reputation accrues to the publisher, not the file.** Unsigned means the warning on **every**
release, forever, because SmartScreen ties reputation to each file hash. Signing is the only exit
from that per-release tax.
- **The free alternative is the Store** (see Channels 4): a free developer account gets
Microsoft-signed installs with no certificate of ours.
- **No EV certificate, ever** — $400+/yr for what OV buys, and the bypass is gone.
- Every signed release: same pass, SHA-256 in the winget manifest, licence ID visible in About.
- **Steam installs never meet SmartScreen.** Valve's client delivers the files, so there is no
browser download, no Mark-of-the-Web and no "unknown publisher" wall. The certificate that
existed only to soften that wall has nothing to do.
- **Artifact Signing** (renamed from "Trusted Signing") stays on the shelf: Azure Artifact
Signing, $9.99/month Basic, requires a paid Azure subscription, individual identity validation
is the slow part. Buy it the day a non-Steam download exists — the zip case, not this one.
- **Never EV, never a certificate with an HSM.** Microsoft removed the EV SmartScreen instant-bypass
in March 2024; it buys nothing.
- **Steam does not sign our exe either** — it just never puts it through the browser gauntlet.
Windows may still show a UAC prompt for the app; that is elevation, not publisher trust.
## Support
@@ -174,14 +192,19 @@ Cash cost **$0**; it is priced in support time and forgone list revenue.
|---|---|
| Domain | ~$15/yr |
| Droplet | $0 — serves the existing site |
| GitHub public repo (releases + issues), Gitea, winget, Scoop, Chocolatey | $0 |
| Polar | 5% + 50¢ per sale → $10 nets $9.00, $400 nets $379.50 |
| Azure Artifact Signing — **deferred** | $9.99/month (~$120/yr), bought at two subscribers |
| Steam Direct (optional) | $100 once, recoupable after $1,000 AGR |
| Microsoft Store (optional) | **$0** — the individual fee was waived |
| Steam Direct | **$100 once**, recoupable after $1,000 AGR |
| Steam revenue share | 30% on the lifetime DLC → $400 nets **$280** |
| Polar | 5% + 50¢ per sale → $10 nets $9.00 (monthly only) |
| Steamworks, public issue repo, Gitea | $0 |
| Azure Artifact Signing — **not needed** | Steam installs don't meet SmartScreen |
| Microsoft Store — **not used** | — |
Fixed year one ≈ **$15** while unsigned, ≈ **$135** once signing starts. **Break-even is two
subscribers** (15 subscriber-months ≈ $135); one $400 lifetime sale covers nearly three years.
Fixed year one ≈ **$115** (domain + Steam Direct, one time). The Steam cut is the price of not
paying for a certificate, a storefront or an update path.
**Signing is now moot as a launch cost.** Steam installs never meet SmartScreen, so the certificate
that existed only to soften that wall has no job. Artifact Signing stays on the shelf for the day a
non-Steam download exists.
## Anti-piracy posture
@@ -190,9 +213,13 @@ pointless and a leak that is traceable — not an unbreakable binary.
- **The free tier is the real defence.** If the only delta is pixels above 921,600, a cracked
build buys almost nothing and forfeits updates, support and the publisher's signature.
- **Hash-pinned delivery, signed once revenue exists** — a patched build cannot arrive through
winget, and a forged one is not signed as us. Until signing starts, the SHA-256 pin is the wall.
- **Short leases** — a revoked or refunded key dies inside the grace window.
- **Steam DRM is optional and not needed.** The DLC check is already the entitlement; adding
Valve's DRM wrapper buys nothing a determined crack respects, and it can break an exe on a
machine that never runs Steam.
- **The distribution is not a handout.** Steam deliveries go through Valve's client and account, so
there is no public zip for a mirror site to repackage, and no hash pin for us to maintain.
- **Short leases** — a revoked or refunded Polar key dies inside the grace window; a refunded Steam
DLC stops reporting ownership the next time Steam is asked.
- **Licence ID in About** — a leaked build traces back to a purchase.
⛔ **Rejected, do not re-propose:** a native helper DLL for "IP protection", obfuscation, hardware
+24
View File
@@ -23,6 +23,30 @@ the subsystem files. This is the graveyard with cause of death.
remote is Gitea). The route is a separate **`llamacasty-releases`** Gitea repo push-mirrored to a
public GitHub repo: issues and assets public, code private, one publish direction.
## Distribution — Steam exclusive (2026-10-31, final)
**Steam is the only vector.** A free app on Steam with the paid edition as a Steam **DLC**; the
monthly plan is sold outside Steam and never purchasable in a Steam build. Live rules:
[`commercial.md`](commercial.md).
**Why the other vectors died, all on the same day:**
- **Direct download + winget** (the plan of that morning) — a zip on a second Gitea repo mirrored to
public GitHub, hash-pinned into winget. Superseded because Steam supplies delivery, stats,
discovery, install trust and updates in one move, and because an unsigned zip meets SmartScreen on
every single release while a Steam install never meets it at all.
- **Microsoft Store** — was free, and free is not the same as wanted. It was the last thing keeping
a Microsoft account, an MSIX pipeline and a publisher line in the plan.
- **Azure Artifact Signing** — never needed once Steam delivers the install. Kept on the shelf for
the day a non-Steam download exists.
- **The public `llamacasty-releases` repo** survives only as the **issue tracker**; it holds no
binaries, no manifest and no version file.
**The constraint that shapes the app:** Steamworks requires in-app purchases to use the **Steam
Wallet**. Therefore the monthly is *stated*, never *sold*, inside the Steam build — no checkout, no
price, no payment fields. The lifetime is plain DLC bought on the store page, so it needs no
transaction code at all.
## Support — decided 2026-10-31
- **No training service, no helpdesk, no SLA.** Email, best effort, refunds on request without
+13
View File
@@ -787,6 +787,19 @@ Full suite 290/291 passing, the sole failure the pre-existing compositor pixel t
blits it **last — above the branding flash** at `socialBarTop` (0 = top, `SourceRectHeight − barHeight` =
bottom) in master space. `MainViewModel` owns the frame (`_socialBarFrame`, rebuilt by `RenderSocialBarFrame`
on load/save/`NotifySocialsChanged`).
- **Privacy blur layer (2026-11-01):** `SourceType.Blur` is a Live-scene element that blurs the
composed frame inside a rect or ellipse. **It is universal**: `SceneCompositor` applies the blur
group AFTER every layer has been composited (before the flash/social/ticker overlays), so it can
cover the webcam, chat, alerts — anything — which is the creator's "moment of privacy" case. Its
position in the layer list is cosmetic for that reason (it is added at the top), and the earlier
"never above the brand" rule is superseded for blurs: a blur over the logo does obscure it. `SceneCompositor` treats all visible blurs as ONE group the first time one is
reached in the z-order (`ApplyBlurLayers`), sorts them **strongest first** and passes a shared
coverage map to `RegionBlur.ApplyInPlace`, so an overlap resolves to the strongest single blur
rather than a blurred blur. `RegionBlur` shares the webcam's radius curve and constants
(`Downscale 4`, `MinRadius 1`, `MaxRadius 6`, `RadiusFor(strength)`), so a strength means the
same thing in both features; the webcam's `BackgroundEffectProcessor` delegates to it.
Blur is `ElementKind.Dynamic`, so it is never baked into the static base and every render path
(pump, preview, thumbnails, scene dump) gets it from the one compositor.
- Known consideration: the pump reads the active scene on a background thread while the UI can still edit
it; a concurrent-mutation exception is contained (logged + `Failed` + the pump stops) rather than
crashing. The background thread + video pipeline is the new reality since this step.
+1 -1
View File
@@ -14,7 +14,7 @@ Read the file whose row matches the task. There is no required reading order.
| [`output.md`](output.md) | The bundled `ffmpeg.exe` and the encoder subprocess (args, probe order, seams), local recording (REC/ON-AIR, filenames, private-broadcast close-out), and the WASAPI capture → filter → mix → named-pipe audio chain (TRAX, sync offset, ducking, limiter) | Touching ffmpeg args/bundling, encoder or recording behaviour, REC/ON-AIR, the audio mix and its meters, or loudness/sync problems |
| [`environment.md`](environment.md) | LAN hosts/IPs/SSH and the Gitea push recipe, the Windows `dotnet.exe` build + run commands, the test suite map, and the hermetic real-`MainWindow` test rule | Before building, running, adding a test, or reaching any box on the LAN |
| [`product.md`](product.md) | Brand/naming split, AI transparency, the licensing prohibitions, the freemium posture, auth/account assumptions, and packaging behaviour | Branding, naming, packaging, or a legal/third-party obligation |
| [`commercial.md`](commercial.md) | The live commercial policy: model and prices, the output-profile cap (stream **and** recording), Polar entitlement via `conditions` (no server, no claim page), the channels (releases repo → winget → Steam → Store), signing (deferred), the Founding 200 promo, costs, **support policy**, anti-piracy posture | Any question about money or support: pricing, licence keys, what free gets, how it ships, what a sale costs |
| [`commercial.md`](commercial.md) | The live commercial policy: model and prices, the output-profile cap (stream **and** recording), entitlement (`steamDlcOwned \|\| polarKeyValid`; Steam DLC for lifetime, Polar for the monthly, no server), **Steam as the only channel**, signing (moot), the Founding 200 promo, costs, **support policy**, anti-piracy posture | Any question about money or support: pricing, licence keys, what free gets, how it ships, what a sale costs |
| [`youtube-api.md`](youtube-api.md) | Go-live ordering + the broadcast-binding fix, the private-only lock, health parsing, end-stream pre-flight, Test mode, and chat-insert shape | Touching go-live, broadcast lifecycle, health polling, streaming close-out, or the chat service |
| [`overlays.md`](overlays.md) | The social bar, the native alert box (six animations, alert clip, ticker) and the chat box conventions — everything composited over the frame | Adding or changing anything drawn on top of the output |
| [`decisions.md`](decisions.md) | Retired paths with cause of death: the paid-tier history and pricing, the free-forever era, Store IAP, the Store ordering, rejected monetization and anti-piracy ideas, and the permanent out-of-product list | You are about to re-open a decision that was already settled |
+50 -58
View File
@@ -28,18 +28,22 @@ the internal repo/assembly/namespace name only. Exact current split:
| surface | name | note |
|---|---|---|
| product / site / marketing | **LlamaCasty** | llamacasty.com, llamachile.tube |
| repo dir, csproj, `RootNamespace` | `ytLive` | 230 files: `namespace ytLive.*` |
| `AssemblyName` → shipped exe | `ytLive` | `ytLive.exe` |
| repo dir, csproj file, `RootNamespace` | `ytLive` | 230+ files: `namespace ytLive.*` |
| `AssemblyName` → shipped exe | **`LlamaCasty`** | `LlamaCasty.exe` — renamed 2026-11-01 |
| app data dir | `%APPDATA%\ytLlive` | **capital L**, drifts from `ytLive` |
| `Distribution.md` tells customers | `LlamaCasty.exe` | ⚠ **mismatch vs the real `ytLive.exe`** |
**Consequences, so nobody re-hunts them:**
- Renaming `<AssemblyName>` to `LlamaCasty` is the cheap win (the customer-visible exe
name matches what `Distribution.md` already promises; namespaces can stay `ytLive.*`).
It is **4 lines**, but it hard-breaks three pack URIs that spell the assembly name:
`MainWindow.xaml:14` (the **window icon** — taskbar/Alt-Tab), `OverlayHost.xaml:96`,
`RenameRecordingDialog.xaml:5`. Miss those and you ship a broken icon. Queued in TASKS.md
under the shipping task, not done.
- The assembly rename landed 2026-11-01 (before the first Steam depot, because Steamworks warns
that renaming a live exe is painful). Namespaces stay `ytLive.*` — they are not user-visible
and renaming them would churn every file for nothing.
- An assembly-qualified pack URI spells the assembly name, so the rename **hard-breaks silently**
at runtime, not at compile time. Four carried it, not three:
`MainWindow.xaml:14` (window icon — taskbar/Alt-Tab), `OverlayHost.xaml:96`,
`RenameRecordingDialog.xaml:5`, and `KeepBroadcastDialog.xaml:5`.
`ytLive.Tests/AssemblyIdentityTests.cs` now guards both halves: the assembly name is
`LlamaCasty` and no source XAML still names the legacy assembly.
- `Packaging/Package.appxmanifest` (`Executable`) and `scripts/package-msix.sh` carry the exe
name too; the MSIX is unused but must not lie about the artifact.
- Renaming the `%APPDATA%\ytLlive` folder is **breaking** — it would orphan every existing
user's layout DB, `Assets` and settings. Never do it casually; needs a migration.
- No code compares its own assembly name (no `GetExecutingAssembly().GetName().Name` checks),
@@ -189,46 +193,40 @@ YouTube channel, they go to YouTube first. This assumption is explicit and must
replaced by an in-app account-creation step. Zero state = the Start Stream dialog's "Sign in to
YouTube" button; going live is unreachable until an account is connected.
## Windows packaging & distribution (winget primary; Steam + Store parked)
## Windows packaging & distribution (Steam only)
Live channel policy, the artifact and signing costs: [`commercial.md`](commercial.md). Build
mechanics (publish flags, the releases repo mirror, the winget manifest):
[`Distribution.md`](../../Distribution.md). Retired routes and cause of death:
Live channel policy, the artifact and costs: [`commercial.md`](commercial.md). Build and depot
mechanics: [`Distribution.md`](../../Distribution.md). Retired routes and cause of death:
[`decisions.md`](decisions.md).
**The channels, in order:** direct download from `llamacasty.com` (binaries in a separate
`llamacasty-releases` repo, push-mirrored to public GitHub) → **winget**, the primary install path →
Steam (parked, $100, lifetime Pro as DLC only; the only channel with discovery *and* an install
that never meets SmartScreen) → Microsoft Store (parked, **free** account since the $19 individual
fee was waived — the only zero-cost route to a Microsoft-signed install).
**One vector: Steam.** A free app on Steam with the paid edition as a Steam **DLC**; the monthly
plan is sold outside Steam and is never purchasable inside a Steam build (Steamworks requires the
Steam Wallet for in-app purchases). No direct download, no winget, no Microsoft Store.
**Consequences that are architecture, not packaging detail:**
- **⛔ There is no self-updater, by policy as well as by history.** Velopack was removed on
2026-10-22 (TASK 48 slice 3) because it downloaded *and executed*, which Store policy 10.2.2
forbids — and the same rule would close the Store for good if it came back. Updates arrive
through the package manager (`winget upgrade`) plus an in-app "newer version exists" banner read
from a version file in the releases repo. `ytLive.Tests/StorePackagingTests.cs` must keep
asserting that no self-updater returns.
- **The MSIX package stays buildable** via `scripts/package-msix.sh` (TASK 48 slice 2) — publish
`Release -r win-x64 --self-contained` into `artifacts/msix-stage`, copy
`Packaging/Package.appxmanifest` in as `AppxManifest.xml` + `Packaging/Assets/`, then
`makeappx pack` → `artifacts/LlamaCasty.msix` (159 MB, gitignored; `MSIX_PFX` signs it for a
local install). It is the Store channel's artifact, unsubmitted until that account exists. The
manifest is a **full-trust `packagedClassicApp` at `mediumIL`** with `runFullTrust` + webcam +
microphone. `Square310x310Logo`/`Wide150x150Logo` traps are in `MyMistakes.md`. Logos come from
the app's own artwork via `scripts/make-store-logos.py`.
- **⛔ Bundle ffmpeg — no runtime downloads** (was Store policy 10.2.2; still right for a direct
download, and it fixes the 2026-09-01 404). See [`output.md`](output.md) → "FFmpeg locator".
- **⛔ There is no self-updater, and now no version banner either.** Steam delivers updates; the
app keeps nothing that downloads or executes, for the same Store-policy reason it always had.
`ytLive.Tests/StorePackagingTests.cs` must keep asserting that no self-updater returns.
- **⛔ `steam_api64.dll` is a functional dependency**, not the rejected "native helper DLL for IP
protection" — Steam DLC ownership cannot be read without it. The app must start without Steam
running and fall back to the free profile.
- **The MSIX package stays buildable but is now unused** — `scripts/package-msix.sh` (TASK 48
slice 2) still produces `artifacts/LlamaCasty.msix` from `Packaging/Package.appxmanifest` +
`Packaging/Assets/`. It was the Store channel's artifact; with Steam exclusive there is no
submission target. The full-trust `packagedClassicApp` findings below remain true and are still
worth reading before any packaged build is attempted.
- **⛔ Bundle ffmpeg — no runtime downloads** (was Store policy 10.2.2; still right for a Steam
depot, and it fixes the 2026-09-01 404). See [`output.md`](output.md) → "FFmpeg locator".
- **⛔ 64-bit Windows only (creator ruling 2026-10-09).** Both csproj files set
`<PlatformTarget>x64</PlatformTarget>` (the test project too — an AnyCPU test project
referencing an x64 app raises MSB3270 and breaks the 0-warning gate). Why: the bundled ffmpeg
is the win64 build, ONNX Runtime 1.31 ships no win-x86 native (only win-x64/win-arm64), and a
32-bit address space can't hold the 1080p frame buffers. Windows 11 is 64-bit-only anyway.
Public copy says "64-bit Windows 10 or 11".
- **Portable mode is the distributable's shape:** `portable.txt` beside the exe keeps the layout DB
and settings in `.\data\` (hung off `LayoutPathOverride`), so a USB stick carries someone's
scenes. The `winget` install and the hand-to-a-friend zip are the same artifact.
- **Portable mode is a feature, not a channel:** `portable.txt` beside the exe keeps the layout DB
and settings in `.\data\` (hung off `LayoutPathOverride`), so a copied install carries someone's
scenes. Steam installs it; the marker is for afterwards.
**What does NOT change: no watermark and no feature gating.** The free tier is the whole app at a
720p30 profile. `Monetization` above governs.
@@ -252,32 +250,26 @@ trust. No `broadFileSystemAccess` capability is needed, and none should be added
error.** A comment at `DefaultRecordFolder()` is owed **when the manifest lands** (TASK 48
item 6) — not before; a comment describing a manifest that doesn't exist is worse than none.
### Signing — deferred until revenue; Azure Artifact Signing, never EV
### Signing — not needed, because Steam installs the app
Microsoft **removed the SmartScreen instant-bypass for EV certificates in March 2024**, so EV
($400+/yr) buys what OV (~$150–300/yr) buys; both need an HSM or hardware token and renew inside
**460 days**. The 2026-10-31 ruling was **Azure Trusted Signing (~$9.99/month)**; the later ruling
the same week is that it is **deferred until two subscribers exist**, because it never removes the
warning on day one — only download volume does — and the storefront alternative is now free.
Steam's client delivers the files, so there is no browser download, no Mark-of-the-Web and no
SmartScreen wall. **The certificate has no job in this channel.** It stays on the shelf for the day
a non-Steam download exists:
- **Renamed**: it is **Azure Artifact Signing** now. Basic is $9.99/month, 5,000 signatures, and it
**requires a paid Azure subscription**; individual identity validation exists and must be
renewed, and it is the slow (days-to-weeks) part — start it when the purchase is decided.
- **Unsigned is a per-release tax**: SmartScreen ties reputation to the file hash, so an unsigned
product warns on **every** release, forever. Signing is the only exit from that loop.
- **The free exit is the Microsoft Store** — the individual developer account fee was waived, and
Microsoft signs the MSIX, so a Store install never meets the wall.
- **Never EV, never a certificate with an HSM**, for this product.
Signing steps: [`Distribution.md`](../../Distribution.md). Costs: [`commercial.md`](commercial.md).
- **Azure Artifact Signing** (renamed from "Trusted Signing") — $9.99/month Basic, up to 5,000
signatures, **requires a paid Azure subscription**; individual identity validation is the slow
part and must be renewed.
- **Never EV** — Microsoft removed the EV SmartScreen instant-bypass in March 2024, so EV buys what
OV buys. **Never a certificate with an HSM** for this product.
- **Steam does not sign the exe.** A UAC prompt for the app is elevation, not publisher trust.
### Distribution and licensing are independent — the channel never decides billing
A **Store-distributed** app *may* still verify licences with **Polar** (Store policy 10.8.1
explicitly permits a secure third-party purchase API for non-game PC products), so "which
channel?" never implies "which billing?". **Polar is the live provider** (2026-10-31) because the
2026-10-30 freemium ruling created something to sell; winget has no storefront at all, so the
licence path is entirely ours there. The lesson worth keeping: the licensing choice rides on a
**monetization** decision, not on a distribution decision.
The Steam build sells the lifetime as **Steam DLC** and reads it with `BIsDlcInstalled`, while the
monthly plan is billed by **Polar** outside Steam. Steamworks forbids taking payment inside the app
with anything but the Steam Wallet, so the app states where the monthly lives and never sells it.
The lesson worth keeping: the licensing choice rides on a **monetization** decision, not on a
distribution decision.
### ⛔ "Only when the user says so" is enforced by Windows, not by us
+5 -1
View File
@@ -103,7 +103,11 @@ The app is a **director's control surface**, not an editor. This replaces the OB
**Current layout (2026-10-26 redesign commits):** `MainWindow` has a top bar and health banner, then a two-column work area with a fixed 360px left column and preview column. Its top row holds stream readouts/resolution on the left and the five-scene strip above the preview; the lower row holds the left panel and central preview. The bottom bar is now only a height-preserving spacer.
- **Left panel:** `EditingActive` is an explicit `EDIT` toggle, not a mode inferred from `StreamStatus`. On = scene layers + properties; off = YouTube chat. Go Live turns editing off and stopping restores it; recording does not automatically switch it off. The staged scene is the preview/edit target; `LiveScene` is the program output.
- **Top bar:** the `EDIT` toggle sits beside the REC/ON-AIR session controls; the brand/gear and account surfaces remain at the sides. The gear's left-click menu remains; right-click opens App Settings directly.
- **Settings is a right-edge drawer, not a modal (2026-11-01):** the gear rail tab opens `Controls/SettingsDrawer` in the same animated-width stack as Stream Settings / YPP / Socials / TEST (`SettingsDrawerOpen`, exclusive with the other four). Categories are section headings with their controls indented under them — Zoom holds *Zoom view shape* and *Zoom box follows*. The app menu (Report Bug / Feature Request / About) hangs off a **right-click on the LlamaCasty wordmark**; left-click still opens About. The modal shell keeps only Bug / Feature / About, which is why it no longer needs a scroll viewer.
- **Top bar:** the `EDIT` toggle sits beside the REC/ON-AIR session controls; the brand and account surfaces remain at the sides. Its **right edge aligns with the layers panel below** (`TopBar` column 0 is a fixed **352** = work-area margin 8 + 360px column − the bar's own 16px padding), so the button and the panel share an edge. The **settings gear moved to the preview rail** (2026-11-01): first tab, orange (`Brush.Attention`), gear icon only — left-click opens the app menu (Settings / Bug / Feature / About), right-click goes straight to App Settings.
- **Preview gestures (2026-11-01):** *edit mode* — left selects/drags/resizes, right opens the context menu, **Ctrl+right toggles the zoom box**. *Preview mode* — **left toggles the zoom box**, right opens the context menu; **Ctrl+right does nothing at all** (no chord while live or recording — one hand, always). ⚠️ **Both the Down and the Up event must be handled for a Ctrl+right-click**: WPF's `PopupControlService` opens a context menu on right-button-**up**, so suppressing only the down event leaves the menu appearing under the gesture (found 2026-11-01 in edit mode). Menus exist on the webcam layer and the backdrop; every other layer right-clicks through to the backdrop menu. Left-dragging with the zoom box open moves it, in both modes. **Ctrl-down closes it**: pressing Ctrl while the box is open dismisses it, so the same hand that opened it can put it away (`MainWindow_PreviewKeyDown`; the box cannot cancel itself on creation because Ctrl is already down before it exists). **Follow mode** is a Settings pill, default **off = Anchor**: with Follow on, dragging re-anchors the capture to the box centre (`ZoomFollowsBox`, persisted as the `Zoom.FollowBox` setting). **The gesture activates the box at the cursor**, not merely dismisses it: `ActivateZoom` no longer refuses when idle (it used to return unless `IsLive || IsRecording`, and `ToggleZoom` only ever dismissed — so the gesture did nothing at all outside a session until 2026-11-01). The social bar consumes its own click (toggle top ⇄ bottom), and the preview's tunnelling handler steps aside for it — otherwise the bar is unclickable in preview mode and drags the layer beneath it in edit mode.
- **Preview undo/redo (2026-11-01):** `Ctrl+Z` / `Ctrl+Shift+Z`, window-level bindings, live only while `EditingActive` — undo with the preview showing program output would rewrite a scene nobody is looking at. `Models/PreviewHistory` snapshots element **references** plus geometry, visibility, order and membership, so move / resize / reorder / add / remove / hide all undo in one step per gesture (`PushPreviewUndo` is called once at drag or resize start, never inside the move loop). Property edits (colour, opacity, border, font) are **not** captured yet — stated in the type's doc comment so nobody assumes otherwise. The stack clears on layout load. Guard: `ytLive.Tests/PreviewHistoryTests.cs`.
- **Developer affordances are compiled out of release, not hidden.** Any control that must never ship (today: the all-resolutions override) lives in its own `UserControl` whose `Page` and `Compile` items are removed by `ytLive.csproj` when `$(Configuration) != 'Debug'`, and is added to its host at runtime inside `#if DEBUG` (`OverlayHost`). A collapsed row still exists in the visual tree of every shipped copy; "not compiled" is the only claim worth making. Label such rows with `Brush.Attention` (orange) while they are visible in Debug. Guard: `ytLive.Tests/OutputProfileTests.cs` asserts the build rule, and `Helpers/DevBuild.cs` is the single source for "is this a dev build".
- **Scene strip:** five fixed-size cards above the preview show the scene name and hotkey; the staged scene carries a `PROGRAM` badge, and staged/live borders use orange. Click stages a scene while idle; while streaming or recording it changes program output and starts the selected transition.
- **Preview rail:** stream info, YPP, Socials, and TEST are icon/color tabs on the preview's right edge. Socials opens an animated in-preview drawer; it is no longer a standalone modal window. The bottom live-controls row retains TRAX and the game/mic meters and controls.
- **Central monitor:** shows the staged scene while editing and the program scene when editing is off. Preview transitions snapshot and animate the outgoing picture in every mode; output transitions run while streaming or recording. Go Live itself remains a Cut.
+1 -1
View File
@@ -39,7 +39,7 @@ mkdir -p "$STAGE_WSL"
--nologo -v minimal \
-o "$(wslpath -w "$STAGE_WSL")"
[ -f "$STAGE_WSL/ytLive.exe" ] || { echo "publish produced no ytLive.exe" >&2; exit 1; }
[ -f "$STAGE_WSL/LlamaCasty.exe" ] || { echo "publish produced no LlamaCasty.exe" >&2; exit 1; }
[ -d "$STAGE_WSL/ffmpeg" ] || {
echo "ffmpeg/ is missing from the package — it must ship bundled (Store policy 10.2.2)." >&2
exit 1
+62
View File
@@ -0,0 +1,62 @@
#!/usr/bin/env bash
# publish.sh — build the artifact that goes into the Steam depot.
# Usage: ./scripts/publish.sh [output-dir] (default: artifacts/steam-stage)
#
# Why a script: the flags below are load-bearing and easy to lose. PublishTrimmed stays OFF
# (WPF resolves XAML by reflection), the single-file bundle must extract natives or ffmpeg-
# adjacent loading breaks, and ReadyToRun is what keeps startup under a second on a cold
# machine. Getting one of them wrong does not fail the build — it fails on a user's PC.
#
# The output is a folder, not a zip: steamcmd uploads a directory into a depot, and Steam
# delivers it. There is no installer, no admin prompt and no self-updater (Steam updates).
#
# Requires WINDOWS dotnet — see docs/ai/environment.md -> Run.
set -euo pipefail
DOTNET="/mnt/c/Program Files/dotnet/dotnet.exe"
[ -x "$DOTNET" ] || { echo "❌ Windows dotnet not found at $DOTNET"; exit 1; }
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
OUT_REL="${1:-artifacts/steam-stage}"
OUT="$ROOT/$OUT_REL"
echo "══ publish ══"
rm -rf "$OUT"
mkdir -p "$OUT"
"$DOTNET" publish "$(wslpath -w "$ROOT/ytLive.csproj")" \
-c Release -r win-x64 --self-contained true \
-p:PublishSingleFile=true \
-p:IncludeNativeLibrariesForSelfExtract=true \
-p:EnableCompressionInSingleFile=true \
-p:PublishReadyToRun=true \
-p:DebugType=none \
--nologo -v minimal \
-o "$(wslpath -w "$OUT")"
echo "══ verify the staged artifact ══"
fail() { echo "❌ $1" >&2; exit 1; }
[ -f "$OUT/LlamaCasty.exe" ] || fail "publish produced no LlamaCasty.exe (AssemblyName reverted?)"
[ -d "$OUT/ffmpeg" ] || fail "ffmpeg/ is missing — it must ship beside the exe (docs/ai/output.md)"
[ -f "$OUT/LICENSE" ] || fail "LICENSE is missing from the artifact"
[ -f "$OUT/PRIVACY.md" ] || fail "PRIVACY.md is missing from the artifact"
[ -f "$OUT/THIRD-PARTY-NOTICES.txt" ] || fail "THIRD-PARTY-NOTICES.txt is missing from the artifact"
# Test artifacts must never reach a depot: a shipped xunit host is a support ticket.
if compgen -G "$OUT/*.Tests.dll" > /dev/null || compgen -G "$OUT/xunit*" > /dev/null; then
fail "test assemblies leaked into the publish output"
fi
# steam_api64.dll arrives with the Steamworks SDK; until then its absence is expected and the
# app must fall back to the free profile, so this is a notice, not a failure.
if [ ! -f "$OUT/steam_api64.dll" ]; then
echo "⚠ steam_api64.dll not staged — the build will run as the free profile only."
fi
echo ""
du -sh "$OUT" | awk '{print " artifact size: " $1}'
echo "✓ staged: $OUT_REL"
echo ""
echo "Next: steamcmd +run_app_build scripts/app_build_<appid>.vdf"
+75
View File
@@ -0,0 +1,75 @@
#!/usr/bin/env bash
# steam-sdk.sh — extract the one file the app needs from the Steamworks SDK, and stage the
# local-only app id.
#
# Why not unzip the whole SDK: it is ~24 MB of C++ headers, examples and tools we never build.
# The runtime dependency is exactly one native library, and the release tooling (ContentBuilder)
# is only needed on the machine that uploads a depot.
#
# ./scripts/steam-sdk.sh ~/Downloads/steamworks_sdk_165.zip
# ./scripts/steam-sdk.sh ~/Downloads/steamworks_sdk_165.zip --contentbuilder
#
# --contentbuilder also extracts sdk/tools/ContentBuilder into steam/contentbuilder/ — that is
# the release tooling (steamcmd + the app_build/depot vdf templates). It is a separate opt-in
# because it is only needed on the machine that uploads a depot, and it is ~12 MB of binaries.
#
# steam_api64.dll is Valve's redistributable — shipping it beside a Steam-published exe is
# permitted by the Steamworks terms. It is NOT committed: steam/ is gitignored, like ffmpeg/.
set -euo pipefail
ZIP="${1:-$HOME/Downloads/steamworks_sdk_165.zip}"
WANT_CONTENTBUILDER="${2:-}"
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
[ -f "$ZIP" ] || { echo "❌ SDK zip not found: $ZIP" >&2; echo " Download it from partner.steamgames.com/downloads/steamworks_sdk.zip while signed in." >&2; exit 1; }
mkdir -p "$ROOT/steam"
python3 - "$ZIP" "$ROOT" <<'PY'
import sys, zipfile, pathlib
zip_path, root = sys.argv[1], pathlib.Path(sys.argv[2])
want = "sdk/redistributable_bin/win64/steam_api64.dll"
dest = root / "steam" / "steam_api64.dll"
with zipfile.ZipFile(zip_path) as z:
with z.open(want) as src, open(dest, "wb") as out:
out.write(src.read())
print(f"✓ {dest.relative_to(root)} ({dest.stat().st_size // 1024} KB)")
PY
# steam_appid.txt is a LOCAL TESTING affordance: it lets SteamAPI.Init() resolve an app id
# without going through the Steam client. 480 is Valve's public Spacewar test app, so the app
# can be exercised before LlamaCasty has an app id of its own. It is Debug-only in the csproj
# and must never ship in a depot — Valve's guidance is to remove it from release builds.
printf '480\n' > "$ROOT/steam/steam_appid.txt"
echo "✓ steam/steam_appid.txt = 480 (Spacewar, local Debug testing only)"
if [ "$WANT_CONTENTBUILDER" = "--contentbuilder" ]; then
python3 - "$ZIP" "$ROOT" <<'PY'
import sys, zipfile, pathlib
zip_path, root = sys.argv[1], pathlib.Path(sys.argv[2])
prefix = "sdk/tools/ContentBuilder/"
dest = root / "steam" / "contentbuilder"
count = 0
with zipfile.ZipFile(zip_path) as z:
for name in z.namelist():
if not name.startswith(prefix) or name.endswith("/"):
continue
target = dest / name[len(prefix):]
target.parent.mkdir(parents=True, exist_ok=True)
with z.open(name) as src, open(target, "wb") as out:
out.write(src.read())
count += 1
print(f"✓ steam/contentbuilder/ ({count} files)")
print(" Windows upload: steam/contentbuilder/builder/steamcmd.exe +login <user> +run_app_build <vdf>")
PY
fi
echo ""
echo "Next: the entitlement seam (IEntitlement + SteamApps.BIsDlcInstalled)."
+71
View File
@@ -0,0 +1,71 @@
using System;
using System.IO;
using System.Linq;
using Xunit;
namespace ytLive.Tests;
/// <summary>
/// The shipped binary is <c>LlamaCasty.exe</c> (renamed 2026-11-01, before the first Steam
/// depot). Two things have to agree for that to be true, and neither fails the build when it
/// doesn't:
///
/// <list type="number">
/// <item>The assembly name comes from <c>ytLive.csproj</c> and silently reverting it produces
/// <c>ytLive.exe</c> again — which is why the rename lands before a depot upload rather than
/// after (Steamworks: renaming a live exe is painful).</item>
/// <item>Assembly-qualified WPF pack URIs (<c>/Assembly;component/path</c>) resolve by that
/// same name. A stale <c>/ytLive;component/…</c> compiles, runs, and then fails <b>silently</b>
/// the moment that particular view opens — a blank window icon, a missing logo in the overlay
/// host. Nobody notices until a dialog is opened at the wrong time, so the rename is exactly the
/// kind of change that needs a source-level guard.</item>
/// </list>
///
/// <para>The C# namespaces stay <c>ytLive</c>: they are not user-visible, and the file churn
/// would buy nothing. Only the assembly name and the URIs that quote it move.</para>
/// </summary>
public class AssemblyIdentityTests
{
private const string ShipName = "LlamaCasty";
private const string LegacyName = "ytLive";
[Fact]
public void The_assembly_is_LlamaCasty_and_no_pack_uri_still_names_the_legacy_assembly()
{
Assert.Equal(ShipName, typeof(MainWindow).Assembly.GetName().Name);
var root = RepoRoot();
var stale = Directory.EnumerateFiles(root, "*.xaml", SearchOption.AllDirectories)
.Where(path => !IsBuildOutput(path))
.Where(path => File.ReadAllText(path).Contains("/" + LegacyName + ";component/", StringComparison.Ordinal))
.Select(path => Path.GetRelativePath(root, path))
.ToArray();
Assert.True(stale.Length == 0,
"These XAML files still point at the legacy assembly name in a pack URI, which " +
"fails silently at runtime: " + string.Join(", ", stale));
}
/// <summary>Walks up from the test output directory to the repo root (the folder holding
/// <c>ytLive.csproj</c>).</summary>
private static string RepoRoot()
{
var dir = new DirectoryInfo(AppContext.BaseDirectory);
while (dir != null)
{
if (File.Exists(Path.Combine(dir.FullName, "ytLive.csproj"))) return dir.FullName;
dir = dir.Parent;
}
throw new InvalidOperationException("Could not locate the repo root from " + AppContext.BaseDirectory);
}
/// <summary>Publish and compile output carry copies of the XAML (and old generated XAML);
/// only the source tree is the thing under test.</summary>
private static bool IsBuildOutput(string path)
{
var parts = path.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
return parts.Any(part => part.Equals("bin", StringComparison.OrdinalIgnoreCase)
|| part.Equals("obj", StringComparison.OrdinalIgnoreCase)
|| part.Equals("artifacts", StringComparison.OrdinalIgnoreCase));
}
}
+87
View File
@@ -0,0 +1,87 @@
using Xunit;
using ytLive.Models;
using ytLive.Services;
using ytLive.Services.Compositor;
namespace ytLive.Tests;
/// <summary>
/// The universal privacy blur at the compositor level (creator ruling 2026-11-01): it blankets
/// every layer beneath it, and the brand logo — blitted after the blur — is never swallowed.
/// </summary>
public class BlurCompositorTests
{
private static VideoFrame Solid(int w, int h, byte r, byte g, byte b)
{
var pixels = new byte[w * h * 4];
for (var i = 0; i < pixels.Length; i += 4)
{
pixels[i] = b; pixels[i + 1] = g; pixels[i + 2] = r; pixels[i + 3] = 255;
}
return new VideoFrame(w, h, pixels);
}
/// <summary>Hard left/right colour split — blurring is unmistakable on it.</summary>
private static VideoFrame Split(int w, int h, byte lr, byte lg, byte lb, byte rr, byte rg, byte rb)
{
var pixels = new byte[w * h * 4];
var half = w / 2;
for (var y = 0; y < h; y++)
for (var x = 0; x < w; x++)
{
var i = (y * w + x) * 4;
pixels[i] = x < half ? lb : rb;
pixels[i + 1] = x < half ? lg : rg;
pixels[i + 2] = x < half ? lr : rr;
pixels[i + 3] = 255;
}
return new VideoFrame(w, h, pixels);
}
private static void AssertPixel(VideoFrame frame, int x, int y, byte r, byte g, byte b)
{
var i = (y * frame.Width + x) * 4;
Assert.True(
frame.BgraPixels[i + 2] == r && frame.BgraPixels[i + 1] == g && frame.BgraPixels[i] == b,
$"pixel ({x},{y}): expected rgb({r},{g},{b}), got rgb({frame.BgraPixels[i + 2]},{frame.BgraPixels[i + 1]},{frame.BgraPixels[i]})");
}
[Fact]
public void The_blur_covers_what_is_beneath_it_and_never_the_brand_logo()
{
var stripes = Split(1920, 1080, 0, 0, 255, 0, 255, 0); // blue | green, hard edge at x=960
var brand = Solid(120, 60, 255, 255, 255); // white logo
var background = new Source { Type = SourceType.DisplayCapture, IsBackground = true, CaptureKey = "monitor:0" };
var logo = new Source { Type = SourceType.Image, IsBrandLogo = true, X = 900, Y = 500, Width = 120, Height = 60 };
var blur = new Source { Type = SourceType.Blur, X = 700, Y = 400, Width = 600, Height = 300, BlurAmount = 1.0 };
var scene = new Scene { Name = "Live" };
scene.Elements.Add(background);
scene.Elements.Add(logo);
scene.Elements.Add(blur);
VideoFrame? FrameFor(SceneElement e) => e switch
{
Source { IsBackground: true } => stripes,
Source { IsBrandLogo: true } => brand,
_ => null,
};
var options = new CompositorOptions
{
SourceRectX = 0, SourceRectY = 0, SourceRectWidth = 1920, SourceRectHeight = 1080,
OutputWidth = 1920, OutputHeight = 1080,
};
var output = new SceneCompositor().Render(scene, FrameFor, null, options);
// 1. Inside the blur, over the colour edge: blended, not the hard split.
var i = (450 * output.Width + 950) * 4;
Assert.True(output.BgraPixels[i] > 0 && output.BgraPixels[i + 1] > 0,
"a blurred pixel on the colour edge must be a blend of both sides");
// 2. The logo, sitting inside the blur's area, is untouched.
AssertPixel(output, 950, 530, 255, 255, 255);
}
}
+51
View File
@@ -0,0 +1,51 @@
using System;
using System.IO;
using System.Linq;
using Xunit;
using ytLive.Models;
using ytLive.ViewModels;
namespace ytLive.Tests;
/// <summary>
/// The (+) menu's Blur entry is Live-scene only, and it is bound — so the view model has to
/// re-notify `CanAddBlur` whenever the staged scene changes. It did not, and the option stayed
/// collapsed for the rest of the session (build 1082: "it no longer appears as an option").
/// </summary>
[Collection("MainViewModelLayoutPath")]
public class BlurMenuAvailabilityTests
{
private static MainViewModel NewVm(out string dbPath)
{
dbPath = Path.Combine(Path.GetTempPath(), $"llamacasty-blurmenu-{Guid.NewGuid():N}.db");
MainViewModel.LayoutPathOverride = dbPath;
return new MainViewModel();
}
[Fact]
public void Blur_is_offered_on_the_live_scene_only_and_the_flag_is_re_notified()
{
var vm = NewVm(out var dbPath);
try
{
var live = vm.Scenes.First(s => SceneCatalog.Is(s.Name, SceneCatalog.Live));
var chat = vm.Scenes.First(s => SceneCatalog.Is(s.Name, SceneCatalog.Chat));
vm.StagedScene = live;
Assert.True(vm.CanAddBlur, "the Live scene must offer the blur layer");
vm.StagedScene = chat;
Assert.False(vm.CanAddBlur, "other scenes must not offer a desktop blur");
// The regression: a bound property with no notification never re-evaluates.
var notified = 0;
vm.PropertyChanged += (_, e) => { if (e.PropertyName == nameof(MainViewModel.CanAddBlur)) notified++; };
vm.StagedScene = live;
Assert.True(notified > 0, "changing the staged scene must re-notify CanAddBlur");
}
finally
{
MainViewModel.LayoutPathOverride = null;
try { File.Delete(dbPath); } catch (IOException) { }
}
}
}
+2 -2
View File
@@ -21,7 +21,7 @@ public class BrandLogoPreviewTests
{
// 1. Wiring: the thumbnail is image-bound and hidden when no image is set, the enlarged
// popup shows the same source at a readable size, and every gesture reaches a handler.
var xaml = SourceAssert.Text("Controls", "OverlayHost.xaml");
var xaml = SourceAssert.Text("Controls", "SettingsDrawer.xaml");
Assert.Contains("x:Name=\"BrandLogoThumbImage\"", xaml);
Assert.Contains("{Binding BrandLogoPreviewImage}", xaml);
Assert.Contains("NotNullToVis", xaml);
@@ -41,7 +41,7 @@ public class BrandLogoPreviewTests
{
// A Popup refuses to open until its placement target is in a live visual tree, so the
// control is hosted in a real window — the same condition the app provides.
var host = new ytLive.Controls.OverlayHost();
var host = new ytLive.Controls.SettingsDrawer();
var window = new System.Windows.Window { Content = host, Width = 420, Height = 420 };
window.Show();
try
+70
View File
@@ -0,0 +1,70 @@
using System;
using System.IO;
using Xunit;
using ytLive.Services.Entitlement;
using ytLive.ViewModels;
namespace ytLive.Tests;
/// <summary>
/// The entitlement seam (2026-11-01): one question — "may this session emit Pro output?" — with a
/// Steam DLC rail, a Polar rail to come, and a fail-closed default.
///
/// <para>The rule that must never break: **no configured rail means the free profile**. A missing
/// DLC id, a missing Steam client or a thrown native load all resolve to false; none of them may
/// crash the app or quietly grant Pro.</para>
/// </summary>
// Shares the static MainViewModel.LayoutPathOverride with the sibling class; without a
// shared collection xUnit runs them in parallel and the two view models fight over one temp DB.
[Collection("MainViewModelLayoutPath")]
public class EntitlementTests
{
[Fact]
public void No_configured_dlc_id_reads_as_no_entitlement()
{
// The state before the Steamworks app exists: pure false, no native call attempted.
Assert.False(SteamEntitlement.NotConfigured().IsPro);
}
[Fact]
public void A_steam_entitlement_without_a_client_is_the_free_tier_not_a_crash()
{
// No steam_appid.txt in the test host and no client running: Init fails, we report false.
var entitlement = new SteamEntitlement(1234567u);
Assert.False(entitlement.IsPro);
}
[Fact]
public void The_fake_reports_what_a_test_sets()
{
var fake = new FakeEntitlement(true);
Assert.True(fake.IsPro);
fake.IsPro = false;
Assert.False(fake.IsPro);
}
[Fact]
public void The_view_model_takes_its_answer_from_the_rail()
{
var tempDb = Path.Combine(Path.GetTempPath(), $"llamacasty-entitlement-{Guid.NewGuid():N}.db");
MainViewModel.LayoutPathOverride = tempDb;
try
{
var vm = new MainViewModel();
// Default rail is NotConfigured → free output.
Assert.False(vm.HasProOutput);
vm.EntitlementOverride = new FakeEntitlement(true);
Assert.True(vm.HasProOutput);
vm.EntitlementOverride = new FakeEntitlement(false);
Assert.False(vm.HasProOutput);
}
finally
{
MainViewModel.LayoutPathOverride = null;
try { File.Delete(tempDb); } catch (IOException) { }
}
}
}
@@ -0,0 +1,50 @@
using System;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using Xunit;
using ytLive.Models;
using ytLive.Services;
namespace ytLive.Tests;
/// <summary>
/// The blur column round-trips through SQLite (2026-11-01). This exists because the first cut
/// added `BlurAmount` to the INSERT and the reader but not to the SELECT — the app then crashed on
/// launch inside `GetOrdinal("BlurAmount")`, which is a startup path no other test covers.
/// </summary>
public class LayoutBlurPersistenceTests
{
[Fact]
public void A_blur_layer_survives_a_save_and_reload_with_its_amount()
{
var dbPath = Path.Combine(Path.GetTempPath(), $"llamacasty-blur-{Guid.NewGuid():N}.db");
try
{
var scenes = new ObservableCollection<Scene>
{
new() { Name = SceneCatalog.Live },
};
var background = new Source { Name = "Background", Type = SourceType.Background, IsBackground = true, Width = 1920, Height = 1080 };
var blur = new Source { Name = "Blur", Type = SourceType.Blur, X = 40, Y = 50, Width = 240, Height = 160, BlurAmount = 0.8 };
scenes[0].Elements.Add(background);
scenes[0].Elements.Add(blur);
using (var store = new LayoutStore(dbPath))
store.Save(scenes, null, null);
using (var reopened = new LayoutStore(dbPath))
{
var loaded = reopened.Load();
var loadedBlur = loaded.SelectMany(s => s.Elements).OfType<Source>().Single(s => s.Type == SourceType.Blur);
Assert.Equal(0.8, loadedBlur.BlurAmount, 3);
Assert.Equal(240, loadedBlur.Width, 3);
Assert.Equal(SourceType.Blur, loadedBlur.Type);
}
}
finally
{
try { File.Delete(dbPath); } catch (IOException) { }
}
}
}
+112
View File
@@ -0,0 +1,112 @@
using System;
using System.IO;
using System.Linq;
using System.Xml.Linq;
using Xunit;
using ytLive.Models;
namespace ytLive.Tests;
/// <summary>
/// The output-profile rule (2026-11-01): a build without Pro may emit at most 921,600 pixels
/// at 30 fps, and this is the only place that decision is made.
///
/// <para>The one thing that must never break: a cracked or unlicensed build silently gets a
/// *smaller frame*, never a smaller feature set. If a future tier is added above the budget,
/// the last test here fails instead of shipping it to everyone.</para>
/// </summary>
public class OutputProfileTests
{
/// <summary>Mirror of <c>MainViewModel.QualityOptions</c> — the shipped tiers. Kept in
/// step deliberately: this is the table the budget has to cover.</summary>
private static readonly QualityOption[] Shipped =
{
new("1080p60", 60, 8.0, 1920, 1080),
new("1080p30", 30, 8.0, 1920, 1080),
new("720p60", 60, 6.0, 1280, 720),
new("720p30", 30, 6.0, 1280, 720),
new("Vertical 1080p30", 30, 8.0, 1080, 1920),
new("Vertical 1080p60", 60, 8.0, 1080, 1920),
};
private static QualityOption Tier(string name) => Shipped.Single(t => t.Display == name);
[Fact]
public void A_free_build_resolves_1080p60_down_to_720p30_with_its_own_bitrate()
{
var resolved = OutputProfile.Resolve(Tier("1080p60"), Shipped, pro: false);
Assert.Equal(1280, resolved.Width);
Assert.Equal(720, resolved.Height);
Assert.Equal(30, resolved.Fps);
// The bitrate follows the profile: a capped user is not offered an 8 Mbps budget.
Assert.Equal(6.0, resolved.Bitrate);
}
[Fact]
public void A_free_build_leaves_its_own_tier_untouched()
{
var requested = Tier("720p30");
Assert.Same(requested, OutputProfile.Resolve(requested, Shipped, pro: false));
}
[Fact]
public void Pro_passes_every_shipped_tier_through()
{
foreach (var tier in Shipped)
Assert.Same(tier, OutputProfile.Resolve(tier, Shipped, pro: true));
}
[Theory]
[InlineData("1080p60")]
[InlineData("1080p30")]
[InlineData("720p60")]
[InlineData("720p30")]
[InlineData("Vertical 1080p30")]
[InlineData("Vertical 1080p60")]
public void No_free_selection_can_emit_more_than_the_budget(string name)
{
var resolved = OutputProfile.Resolve(Tier(name), Shipped, pro: false);
Assert.True(resolved.Width * resolved.Height <= OutputProfile.FreeMaxPixels,
$"{resolved.Display} resolves to {resolved.Width * resolved.Height} px on a free build");
Assert.True(resolved.Fps <= OutputProfile.FreeMaxFps,
$"{resolved.Display} resolves to {resolved.Fps} fps on a free build");
}
[Fact]
public void An_empty_tier_table_still_yields_a_legal_frame()
{
var resolved = OutputProfile.Resolve(Tier("1080p60"), Array.Empty<QualityOption>(), pro: false);
Assert.Equal(1280, resolved.Width);
Assert.Equal(720, resolved.Height);
Assert.Equal(30, resolved.Fps);
}
/// <summary>
/// The developer override must not exist in a shipped binary. A runtime test cannot prove
/// that (the test host is a Debug build), so this asserts the build rule itself: the
/// panel's XAML and code-behind are removed whenever the configuration is not Debug.
/// </summary>
[Fact]
public void The_developer_panel_is_excluded_from_the_release_compile()
{
var project = XDocument.Load(SourceAssert.RepoPath("ytLive.csproj"));
var guards = project.Descendants()
.Where(e => e.Name.LocalName is "Page" or "Compile")
.Where(e => (string?)e.Attribute("Remove") is string remove
&& remove.Contains("DeveloperPanel", StringComparison.OrdinalIgnoreCase))
.ToArray();
Assert.Equal(2, guards.Length);
foreach (var guard in guards)
{
// The condition may sit on the item or on its ItemGroup — either excludes it.
var condition = (string?)guard.Attribute("Condition")
?? (string?)guard.Parent?.Attribute("Condition");
Assert.NotNull(condition);
Assert.Contains("'$(Configuration)' != 'Debug'", condition, StringComparison.Ordinal);
}
}
}
+120
View File
@@ -0,0 +1,120 @@
using System.Collections.ObjectModel;
using System.Linq;
using Xunit;
using ytLive.Models;
namespace ytLive.Tests;
/// <summary>
/// Preview undo/redo (creator directive 2026-11-01). The contract that matters: one gesture is
/// one undo step, a restored layout is exactly what was there before, and redo survives several
/// undos — because a stack that only works one step deep is worse than none.
/// </summary>
public class PreviewHistoryTests
{
private static Scene NewScene(params SceneElement[] elements)
{
var scene = new Scene { Name = "Live" };
foreach (var element in elements) scene.Elements.Add(element);
return scene;
}
private static SceneElement NewElement(double x = 0, double y = 0, double w = 100, double h = 100)
=> new Source { Name = "Layer", X = x, Y = y, Width = w, Height = h };
[Fact]
public void Undo_restores_geometry_and_redo_reapplies_it()
{
var element = NewElement(10, 20);
var scenes = new ObservableCollection<Scene> { NewScene(element) };
var history = new PreviewHistory();
history.Capture(scenes);
element.X = 300;
element.Y = 400;
Assert.True(history.Undo(scenes));
Assert.Equal(10, element.X);
Assert.Equal(20, element.Y);
Assert.True(history.Redo(scenes));
Assert.Equal(300, element.X);
Assert.Equal(400, element.Y);
}
[Fact]
public void Undo_removes_a_layer_added_after_the_snapshot_and_redo_brings_it_back()
{
var first = NewElement();
var scene = NewScene(first);
var scenes = new ObservableCollection<Scene> { scene };
var history = new PreviewHistory();
history.Capture(scenes);
var added = NewElement();
scene.Elements.Add(added);
history.Undo(scenes);
Assert.Single(scene.Elements);
Assert.DoesNotContain(added, scene.Elements);
history.Redo(scenes);
Assert.Equal(2, scene.Elements.Count);
Assert.Contains(added, scene.Elements);
}
[Fact]
public void Undo_restores_a_removed_layer_in_its_original_position()
{
var top = NewElement();
var middle = NewElement();
var bottom = NewElement();
var scene = NewScene(top, middle, bottom);
var scenes = new ObservableCollection<Scene> { scene };
var history = new PreviewHistory();
history.Capture(scenes);
scene.Elements.Remove(middle);
history.Undo(scenes);
Assert.Equal(new SceneElement[] { top, middle, bottom }, scene.Elements.ToArray());
}
[Fact]
public void A_new_edit_after_undo_drops_the_redo_branch()
{
var element = NewElement();
var scenes = new ObservableCollection<Scene> { NewScene(element) };
var history = new PreviewHistory();
history.Capture(scenes);
element.X = 50;
history.Undo(scenes);
Assert.True(history.CanRedo);
history.Capture(scenes);
Assert.False(history.CanRedo);
}
[Fact]
public void The_stack_is_bounded()
{
var scenes = new ObservableCollection<Scene> { NewScene(NewElement()) };
var history = new PreviewHistory();
for (var i = 0; i < PreviewHistory.MaxDepth + 20; i++) history.Capture(scenes);
Assert.Equal(PreviewHistory.MaxDepth, history.UndoDepth);
}
[Fact]
public void Undo_with_nothing_captured_is_a_no_op()
{
var element = NewElement(5, 5);
var scenes = new ObservableCollection<Scene> { NewScene(element) };
var history = new PreviewHistory();
Assert.False(history.Undo(scenes));
Assert.Equal(5, element.X);
}
}
+116
View File
@@ -0,0 +1,116 @@
using System;
using Xunit;
using ytLive.Services.Compositor;
namespace ytLive.Tests;
/// <summary>
/// The privacy blur (creator ruling 2026-11-01): a Live-scene layer that blurs the frame beneath it
/// inside a box or circle, so a creator can hide part of their desktop.
///
/// <para>Two rules are load-bearing and both are here: pixels OUTSIDE the mask must be untouched
/// (otherwise the layer is a full-frame filter), and overlapping layers must resolve to the
/// strongest single blur, never to a blurred blur — the creator was explicit that a stack cannot
/// be stronger than any one slider setting.</para>
/// </summary>
public class RegionBlurTests
{
private const int W = 320;
private const int H = 180;
private const int Stride = W * 4;
/// <summary>A frame of vertical hard edges: blurring is then obvious (edges go grey).</summary>
private static byte[] StripedFrame()
{
var pixels = new byte[Stride * H];
for (var y = 0; y < H; y++)
for (var x = 0; x < W; x++)
{
var p = y * Stride + x * 4;
var on = (x / 8) % 2 == 0;
pixels[p] = pixels[p + 1] = pixels[p + 2] = (byte)(on ? 255 : 0);
pixels[p + 3] = 255;
}
return pixels;
}
private static int CenterVariance(byte[] pixels, int x0, int y0, int x1, int y1)
{
// Crude "is this still hard-edged" measure: count horizontal transitions in the middle row.
var y = (y0 + y1) / 2;
var transitions = 0;
for (var x = x0 + 1; x < x1; x++)
{
var a = pixels[y * Stride + (x - 1) * 4];
var b = pixels[y * Stride + x * 4];
if (Math.Abs(a - b) > 32) transitions++;
}
return transitions;
}
[Fact]
public void Pixels_outside_the_mask_are_untouched_and_inside_are_blurred()
{
var pixels = StripedFrame();
var before = (byte[])pixels.Clone();
var applied = RegionBlur.ApplyInPlace(
pixels, Stride, W, H, 100, 60, 120, 60, strength: 0.8, round: false);
Assert.True(applied);
// Outside: untouched, byte for byte.
for (var y = 0; y < H; y++)
for (var x = 0; x < W; x++)
{
var inside = x >= 100 && x < 220 && y >= 60 && y < 120;
if (inside) continue;
var p = y * Stride + x * 4;
Assert.Equal(before[p], pixels[p]);
}
// Inside: the hard stripes are gone.
Assert.True(CenterVariance(pixels, 110, 70, 210, 110) < CenterVariance(before, 110, 70, 210, 110));
}
[Fact]
public void A_round_blur_leaves_the_corners_of_its_box_alone()
{
var pixels = StripedFrame();
var before = (byte[])pixels.Clone();
RegionBlur.ApplyInPlace(pixels, Stride, W, H, 100, 60, 120, 60, strength: 0.8, round: true);
// The box's corner is outside the inscribed ellipse.
var corner = 60 * Stride + 100 * 4;
Assert.Equal(before[corner], pixels[corner]);
}
[Fact]
public void An_overlap_uses_the_strongest_blur_once_and_never_stacks()
{
// Same region blurred twice: without the coverage map the second pass blurs an already
// blurred region, which is stronger than either slider setting. With it, the second pass
// skips the covered pixels and the result equals a single strong pass.
var once = StripedFrame();
RegionBlur.ApplyInPlace(once, Stride, W, H, 100, 60, 120, 60, 0.8, false);
var onceVariance = CenterVariance(once, 110, 70, 210, 110);
var stacked = StripedFrame();
var coverage = new byte[W * H];
RegionBlur.ApplyInPlace(stacked, Stride, W, H, 100, 60, 120, 60, 0.8, false, coverage);
RegionBlur.ApplyInPlace(stacked, Stride, W, H, 100, 60, 120, 60, 0.8, false, coverage);
Assert.Equal(onceVariance, CenterVariance(stacked, 110, 70, 210, 110));
}
[Fact]
public void Strength_zero_still_blurs_a_little_and_the_curve_is_the_webcams()
{
// The shared radius curve: 1 downscaled px at 0, 6 at 1 — the webcam's own numbers.
Assert.Equal(RegionBlur.MinRadius, RegionBlur.RadiusFor(0));
Assert.Equal(RegionBlur.MaxRadius, RegionBlur.RadiusFor(1));
Assert.Equal(RegionBlur.MaxRadius, RegionBlur.RadiusFor(4)); // clamped
Assert.Equal(RegionBlur.MinRadius, RegionBlur.RadiusFor(-1));
}
}
+1 -1
View File
@@ -97,7 +97,7 @@ public class StorePackagingTests
var application = package.Element(Foundation + "Applications")!
.Element(Foundation + "Application")!;
Assert.Equal("Windows.FullTrustApplication", (string?)application.Attribute("EntryPoint"));
Assert.Equal("ytLive.exe", (string?)application.Attribute("Executable"));
Assert.Equal("LlamaCasty.exe", (string?)application.Attribute("Executable"));
Assert.Equal("mediumIL", (string?)application.Attribute(Uap10 + "TrustLevel"));
Assert.Equal("packagedClassicApp", (string?)application.Attribute(Uap10 + "RuntimeBehavior"));
+105
View File
@@ -0,0 +1,105 @@
using System;
using System.IO;
using Xunit;
using ytLive.ViewModels;
namespace ytLive.Tests;
/// <summary>
/// Zoom box follow mode (creator ruling 2026-11-01): the Settings pill toggles between **Anchor**
/// — the capture stays on the clicked point, which is the default and the 2026-10-08 model — and
/// **Follow**, where dragging the box re-anchors the capture to the box centre so the magnifier
/// shows whatever it hovers over.
/// </summary>
// Shares the static MainViewModel.LayoutPathOverride with the sibling class; without a
// shared collection xUnit runs them in parallel and the two view models fight over one temp DB.
[Collection("MainViewModelLayoutPath")]
public class ZoomFollowModeTests
{
private static MainViewModel NewVm(out string dbPath)
{
dbPath = Path.Combine(Path.GetTempPath(), $"llamacasty-zoom-{Guid.NewGuid():N}.db");
MainViewModel.LayoutPathOverride = dbPath;
return new MainViewModel();
}
[Fact]
public void Anchor_is_the_default_and_dragging_leaves_the_capture_alone()
{
var vm = NewVm(out var dbPath);
try
{
Assert.False(vm.ZoomFollowsBox);
vm.ActivateZoom(1000, 500);
var captureX = vm.ZoomState.CaptureX;
vm.StartZoomMove(1000, 500);
vm.UpdateZoomMove(1200, 700);
Assert.Equal(captureX, vm.ZoomState.CaptureX);
}
finally
{
MainViewModel.LayoutPathOverride = null;
try { File.Delete(dbPath); } catch (IOException) { }
}
}
[Fact]
public void Follow_moves_the_capture_with_the_box()
{
var vm = NewVm(out var dbPath);
try
{
vm.ActivateZoom(1000, 500);
var anchoredCaptureX = vm.ZoomState.CaptureX;
vm.ZoomFollowsBox = true;
vm.StartZoomMove(1000, 500);
vm.UpdateZoomMove(1200, 700);
Assert.NotEqual(anchoredCaptureX, vm.ZoomState.CaptureX);
// The capture is half the box, centred on the box: box centre minus a quarter of it.
var expected = Math.Clamp(
vm.ZoomState.X + vm.ZoomState.Width / 2 - vm.ZoomState.Width / 4,
0, 1920 - vm.ZoomState.Width / 2);
Assert.Equal(expected, vm.ZoomState.CaptureX, 3);
}
finally
{
MainViewModel.LayoutPathOverride = null;
try { File.Delete(dbPath); } catch (IOException) { }
}
}
[Fact]
public void The_choice_persists_in_settings()
{
// Persistence is the store's job, tested against the store directly: two live view models
// in one process fight over the SQLite file and the frame pump, which is a property of the
// fixture, not of the setting.
var dbPath = Path.Combine(Path.GetTempPath(), $"llamacasty-zoom-{Guid.NewGuid():N}.db");
try
{
using (var store = new ytLive.Services.LayoutStore(dbPath))
{
Assert.False(store.LoadZoomFollowBox());
store.SaveZoomFollowBox(true);
}
using (var reopened = new ytLive.Services.LayoutStore(dbPath))
{
Assert.True(reopened.LoadZoomFollowBox());
reopened.SaveZoomFollowBox(false);
}
using (var again = new ytLive.Services.LayoutStore(dbPath))
Assert.False(again.LoadZoomFollowBox());
}
finally
{
try { File.Delete(dbPath); } catch (IOException) { }
}
}
}
+43 -2
View File
@@ -8,7 +8,10 @@
<UseWPF>true</UseWPF>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
<ApplicationIcon>Assets\llamacasty-icon.ico</ApplicationIcon>
<AssemblyName>ytLive</AssemblyName>
<!-- The shipped exe is LlamaCasty.exe (renamed 2026-11-01, before the first Steam depot so
the store never sees the legacy name). RootNamespace stays `ytLive` — the C# namespaces
are not user-visible and renaming them would churn every file for no benefit. -->
<AssemblyName>LlamaCasty</AssemblyName>
<RootNamespace>ytLive</RootNamespace>
<!-- 64-bit Windows only (creator ruling 2026-10-09). The bundled ffmpeg is the win64 build
and ONNX Runtime ships no win-x86 native, so a 32-bit process could never stream; a
@@ -89,6 +92,29 @@
<Resource Include="Assets\Fonts\JetBrainsMono-SemiBold.ttf" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)' != 'Debug'">
<!-- ⛔ Development-only UI never ships: no BAML, no code-behind, nothing to reveal.
OverlayHost adds the panel at runtime inside #if DEBUG, so a Release build has no
reference to it and compiles cleanly. -->
<Page Remove="Controls\DeveloperPanel.xaml" />
<Compile Remove="Controls\DeveloperPanel.xaml.cs" />
</ItemGroup>
<!-- Steamworks runtime (scripts/steam-sdk.sh extracts it; steam/ is gitignored).
⛔ Link puts it BESIDE the exe rather than under steam/, because the loader looks there.
⛔ ExcludeFromSingleFile matters for the same reason as ffmpeg: a native DLL otherwise
gets swallowed into the single-file bundle and the app cannot load it at runtime. -->
<ItemGroup>
<None Remove="steam\**" />
<None Include="steam\steam_api64.dll" Link="steam_api64.dll"
CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="Always"
ExcludeFromSingleFile="true" />
<!-- Local-only: lets SteamAPI.Init() resolve an app id outside the Steam client (480 =
Valve's Spacewar test app). Never published — Valve's guidance is to omit it. -->
<None Include="steam\steam_appid.txt" Link="steam_appid.txt" Condition="'$(Configuration)' == 'Debug'"
CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
<ItemGroup>
<None Include="THIRD-PARTY-NOTICES.txt" CopyToOutputDirectory="PreserveNewest" />
<!-- The EULA and privacy policy travel with every copy: they are what the About screen and
@@ -116,7 +142,19 @@
from a pinned URL, verifying SHA-256 first. CopyToPublishDirectory=Always is the
one that matters for the MSIX package. -->
<ItemGroup>
<None Include="ffmpeg\**" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="Always" />
<!-- `Remove` first: the SDK's default None glob already matched ffmpeg\**, so an Include
without removing it produced DUPLICATE items — one carrying the copy metadata and one
with none. Harmless until PublishSingleFile + IncludeNativeLibrariesForSelfExtract came
along, where the bundler collapses the duplicate and the folder silently stops being
published (found 2026-11-01: a 9-file publish with no ffmpeg in it). -->
<!-- ⛔ ExcludeFromSingleFile is load-bearing. With PublishSingleFile +
IncludeNativeLibrariesForSelfExtract the bundler treats the libav*.dll family as native
libs and swallows them INTO the exe — a 182 MB exe with no ffmpeg\ folder beside it, so
the locator finds nothing and every stream fails at runtime. The metadata keeps the
folder a folder. (Found 2026-11-01 by diffing the publish output against a control
publish without the single-file flags.) -->
<None Remove="ffmpeg\**" />
<None Include="ffmpeg\**" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="Always" ExcludeFromSingleFile="true" />
</ItemGroup>
<Target Name="GuardBundledFfmpeg" BeforeTargets="CoreCompile">
@@ -137,6 +175,9 @@
<PackageReference Include="NAudio.WinMM" Version="2.2.1" />
<PackageReference Include="Notification.Wpf" Version="11.0.0" />
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3" Version="2.1.12" />
<!-- Steam's managed wrapper. The native steam_api64.dll comes from the SDK via
scripts/steam-sdk.sh; this package only provides the C# surface (SteamAPI, SteamApps). -->
<PackageReference Include="Steamworks.NET" Version="2024.8.0" />
<PackageReference Include="System.Security.Cryptography.ProtectedData" Version="8.0.0" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2903.40" />
</ItemGroup>