Source access enforcement (the catalog): 10-source catalog + per-scene access matrix enforced by SceneAccessPolicy; Add-Source menu is one ItemsSource rebuilt per scene (Screen = Live-only, BG/Image/Text every scene), webcam row always present + greys out; Chatbox/Alerts/Socials are inert SourceType rows ready for their features; Text queued as a ship step (countdown + credits modes); Monetization notes socialBar free = YouTube + 1, unlimited with the paid key (79 tests passing)
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
using ytLive.Models;
|
||||
|
||||
namespace ytLive.Services;
|
||||
|
||||
/// <summary>
|
||||
/// The per-scene source access matrix (see the source catalog in TASKS.md).
|
||||
/// One source's availability in a scene is a product decision, enforced by
|
||||
/// scene name on every place a source can be added. Countdown and Credits are
|
||||
/// Text *modes*, not source types: their scene restrictions gate the mode when
|
||||
/// the Text ship step lands. Chatbox / Alerts / Socials are inert values until
|
||||
/// their features ship — the rows are live from today.
|
||||
/// </summary>
|
||||
public static class SceneAccessPolicy
|
||||
{
|
||||
public static bool Allows(string? sceneName, SourceType type)
|
||||
{
|
||||
if (!SceneCatalog.IsCanonical(sceneName)) return false;
|
||||
|
||||
return type switch
|
||||
{
|
||||
SourceType.DisplayCapture or SourceType.WindowCapture =>
|
||||
SceneCatalog.Is(sceneName, SceneCatalog.Live),
|
||||
SourceType.Background or SourceType.Image or SourceType.TextOverlay or
|
||||
SourceType.Alerts or SourceType.Socials => true,
|
||||
SourceType.Chatbox =>
|
||||
SceneCatalog.Is(sceneName, SceneCatalog.Live)
|
||||
|| SceneCatalog.Is(sceneName, SceneCatalog.Brb)
|
||||
|| SceneCatalog.IsChat(sceneName),
|
||||
_ => false,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user