feat(alerts): add scene-local recent ticker
Model the AlertBox and standalone ticker with shared settings; scene tickers render the in-memory active and queued events without saving history. Keep AlertBox content active-event-only. Ref: https://obsproject.com/kb/obs-studio-overview
This commit is contained in:
@@ -34,6 +34,15 @@ public static class AlertTickerRenderer
|
||||
/// (0.5s on, 0.5s off — a 1Hz pulse for the whole alert).</summary>
|
||||
public const double FlashHalfSeconds = 0.5;
|
||||
|
||||
public static VideoFrame? Render(Ticker ticker, string? text, double elapsedSeconds,
|
||||
double alertSeconds, int readsPerAlert, int width, int height)
|
||||
{
|
||||
if (ticker == null) throw new ArgumentNullException(nameof(ticker));
|
||||
return ticker.IsEnabled
|
||||
? Render(text, elapsedSeconds, ticker.DisplayMethod, alertSeconds, readsPerAlert, width, height)
|
||||
: null;
|
||||
}
|
||||
|
||||
private static readonly object Gate = new();
|
||||
private static readonly Dictionary<string, VideoFrame> StripCache = new();
|
||||
|
||||
@@ -179,4 +188,4 @@ public static class AlertTickerRenderer
|
||||
}
|
||||
return new VideoFrame(pillW, Height, pixels);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user