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:
@@ -1,3 +1,5 @@
|
||||
using System.Linq;
|
||||
using ytLive.Models;
|
||||
using ytLive.Services;
|
||||
|
||||
namespace ytLive.ViewModels;
|
||||
@@ -44,8 +46,15 @@ public partial class MainViewModel
|
||||
/// Reuses one <see cref="System.Windows.Media.Imaging.WriteableBitmap"/> and
|
||||
/// overwrites its back buffer — a fresh bitmap every tick would churn the
|
||||
/// render cache for no reason.</summary>
|
||||
internal void PublishAlertTickerPreview(VideoFrame? frame)
|
||||
internal void PublishAlertTickerPreview(VideoFrame? incomingFrame)
|
||||
{
|
||||
var frame = incomingFrame;
|
||||
var previewScene = IsEditMode ? StagedScene : LiveScene ?? StagedScene;
|
||||
var alertBox = previewScene?.Elements.OfType<Source>()
|
||||
.FirstOrDefault(source => source.Type == SourceType.AlertBox && source.IsVisible);
|
||||
if (_alertLayer.IsPlaying)
|
||||
frame = _alertLayer.AlertBoxTickerFrame(alertBox);
|
||||
|
||||
if (frame == null)
|
||||
{
|
||||
if (_alertTickerBitmap != null)
|
||||
|
||||
Reference in New Issue
Block a user