namespace TeamsISO.Engine.Domain;

public sealed record IsoHealthStats(
    long FramesIn,
    long FramesOut,
    long FramesDropped,
    long FramesDuplicated,
    DateTimeOffset? LastFrameAt,
    double IncomingFps,
    int IncomingWidth,
    int IncomingHeight)
{
    public static readonly IsoHealthStats Empty =
        new(0, 0, 0, 0, null, 0, 0, 0);

    /// <summary>
    /// Pipeline lifecycle state. <see cref="IsoState.Idle"/> when no pipeline is
    /// running; otherwise reflects the supervisor's current view.
    /// </summary>
    public IsoState State { get; init; } = IsoState.Idle;

    /// <summary>
    /// Most recent peak audio level seen on this pipeline's incoming stream,
    /// in the range [0.0, 1.0]. 0.0 means silence (or no audio capture yet);
    /// 1.0 is full-scale clip. The UI typically displays this as a decaying
    /// VU bar in the participants DataGrid.
    ///
    /// Currently always 0.0 — the engine's NDI receiver doesn't capture audio
    /// frames yet (video-only). The field exists so the UI scaffolding is
    /// in place; the audio capture path is a focused engine follow-up that
    /// adds <c>NdiReceiver</c> audio-frame handling, peak computation, and
    /// surfaces the value through <c>IsoPipeline.GetStats</c>.
    /// </summary>
    public double PeakAudioLevel { get; init; }
}
