using System.Collections.Generic; using Newtonsoft.Json; namespace PepperDash.Essentials.Core; /// /// Describes the current shape of a multiview canvas and the position, size, stacking order and /// routed source of every visible tile within it. Fully product-agnostic (no dependency on any /// particular decoder/hardware type) and JSON-serializable so it can be sent as-is over the routing /// feedback WebSocket () and the routing devices/tie-lines /// HTTP snapshot (), for /// rendering a visual mock-up of what is actually displayed on the fed monitor. /// public class MultiviewLayoutState { /// /// Width, in pixels, of the canvas that positions/sizes are expressed /// against (typically the decoder's current output resolution width). /// [JsonProperty("canvasWidth")] public int CanvasWidth { get; set; } /// /// Height, in pixels, of the canvas that positions/sizes are expressed /// against (typically the decoder's current output resolution height). /// [JsonProperty("canvasHeight")] public int CanvasHeight { get; set; } /// /// Position, size, stacking order and routed source for every visible tile in the layout. /// [JsonProperty("tiles")] public List Tiles { get; set; } = new List(); } /// /// Describes a single tile/window within a . /// public class MultiviewTileState { /// /// 1-based tile/window number, matching the key in /// . /// [JsonProperty("tileNumber")] public int TileNumber { get; set; } /// /// Device key of this tile's child sink, so a client can /// cross-reference existing routing-feedback data (e.g. sink current-source state) for this tile /// without re-deriving it. /// [JsonProperty("tileSinkKey")] public string TileSinkKey { get; set; } /// Left edge of the tile, in pixels, within the canvas. [JsonProperty("x")] public int X { get; set; } /// Top edge of the tile, in pixels, within the canvas. [JsonProperty("y")] public int Y { get; set; } /// Width of the tile, in pixels. [JsonProperty("width")] public int Width { get; set; } /// Height of the tile, in pixels. [JsonProperty("height")] public int Height { get; set; } /// /// Stacking order for overlapping tiles (e.g. picture-in-picture/overlay layouts). Tiles with /// higher values are drawn on top of tiles with lower values. /// [JsonProperty("zOrder")] public int ZOrder { get; set; } /// /// Device key of the source currently routed to this tile, or null if the tile is empty. /// [JsonProperty("sourceDeviceKey")] public string SourceDeviceKey { get; set; } }