2026-04-03 13:08:36 -04:00
|
|
|
using System;
|
2025-09-26 10:20:48 -04:00
|
|
|
using System.Xml.Serialization;
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
|
2025-09-26 13:06:18 -04:00
|
|
|
namespace SabreTools.Data.Models.Metadata
|
2025-09-26 10:20:48 -04:00
|
|
|
{
|
|
|
|
|
[JsonObject("display"), XmlRoot("display")]
|
2026-04-03 13:08:36 -04:00
|
|
|
public class Display : DatItem, ICloneable, IEquatable<Display>, IEquatable<Video>
|
2025-09-26 10:20:48 -04:00
|
|
|
{
|
2026-04-01 21:59:16 -04:00
|
|
|
#region Properties
|
2025-09-26 10:20:48 -04:00
|
|
|
|
2026-04-03 12:31:24 -04:00
|
|
|
/// <remarks>Only found in Video</remarks>
|
|
|
|
|
public long? AspectX { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <remarks>Only found in Video</remarks>
|
|
|
|
|
public long? AspectY { get; set; }
|
|
|
|
|
|
2026-04-02 02:18:08 -04:00
|
|
|
/// <remarks>(raster|vector|lcd|svg|unknown)</remarks>
|
|
|
|
|
public DisplayType? DisplayType { get; set; }
|
|
|
|
|
|
2025-09-26 10:20:48 -04:00
|
|
|
/// <remarks>(yes|no) "no"</remarks>
|
2026-04-01 21:59:16 -04:00
|
|
|
public bool? FlipX { get; set; }
|
|
|
|
|
|
2026-04-03 11:57:30 -04:00
|
|
|
public long? HBEnd { get; set; }
|
2026-04-03 00:04:11 -04:00
|
|
|
|
2026-04-03 11:57:30 -04:00
|
|
|
public long? HBStart { get; set; }
|
2026-04-02 11:18:49 -04:00
|
|
|
|
2026-04-03 11:57:30 -04:00
|
|
|
public long? Height { get; set; }
|
2026-04-01 21:59:16 -04:00
|
|
|
|
2026-04-03 11:57:30 -04:00
|
|
|
public long? HTotal { get; set; }
|
2025-09-26 10:20:48 -04:00
|
|
|
|
2026-04-03 11:57:30 -04:00
|
|
|
public long? PixClock { get; set; }
|
2025-09-26 10:20:48 -04:00
|
|
|
|
2026-04-03 11:57:30 -04:00
|
|
|
public double? Refresh { get; set; }
|
2025-09-26 10:20:48 -04:00
|
|
|
|
2026-04-03 13:08:36 -04:00
|
|
|
/// <remarks>(0|90|180|270)</remarks>
|
|
|
|
|
public Rotation? Rotate { get; set; }
|
|
|
|
|
|
2026-04-03 11:57:30 -04:00
|
|
|
public string? Tag { get; set; }
|
2025-09-26 10:20:48 -04:00
|
|
|
|
2026-04-03 11:57:30 -04:00
|
|
|
public long? VBEnd { get; set; }
|
2025-09-26 10:20:48 -04:00
|
|
|
|
2026-04-03 11:57:30 -04:00
|
|
|
public long? VBStart { get; set; }
|
2025-09-26 10:20:48 -04:00
|
|
|
|
2026-04-03 11:57:30 -04:00
|
|
|
public long? VTotal { get; set; }
|
2025-09-26 10:20:48 -04:00
|
|
|
|
2026-04-03 11:57:30 -04:00
|
|
|
public long? Width { get; set; }
|
2025-09-26 10:20:48 -04:00
|
|
|
|
2026-04-03 11:57:30 -04:00
|
|
|
#endregion
|
2025-09-26 10:20:48 -04:00
|
|
|
|
2026-04-03 13:08:36 -04:00
|
|
|
public Display() => ItemType = ItemType.Display;
|
2025-09-26 10:20:48 -04:00
|
|
|
|
2026-04-03 13:08:36 -04:00
|
|
|
/// <inheritdoc/>
|
|
|
|
|
public object Clone()
|
|
|
|
|
{
|
|
|
|
|
var obj = new Display();
|
2025-09-26 10:20:48 -04:00
|
|
|
|
2026-04-03 13:08:36 -04:00
|
|
|
obj.AspectX = AspectX;
|
|
|
|
|
obj.AspectY = AspectY;
|
|
|
|
|
obj.DisplayType = DisplayType;
|
|
|
|
|
obj.FlipX = FlipX;
|
|
|
|
|
obj.HBEnd = HBEnd;
|
|
|
|
|
obj.HBStart = HBStart;
|
|
|
|
|
obj.Height = Height;
|
|
|
|
|
obj.HTotal = HTotal;
|
|
|
|
|
obj.PixClock = PixClock;
|
|
|
|
|
obj.Refresh = Refresh;
|
|
|
|
|
obj.Rotate = Rotate;
|
|
|
|
|
obj.Tag = Tag;
|
|
|
|
|
obj.VBEnd = VBEnd;
|
|
|
|
|
obj.VBStart = VBStart;
|
|
|
|
|
obj.VTotal = VTotal;
|
|
|
|
|
obj.Width = Width;
|
2025-09-26 10:20:48 -04:00
|
|
|
|
2026-04-03 13:08:36 -04:00
|
|
|
return obj;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
public bool Equals(Display? other)
|
|
|
|
|
{
|
|
|
|
|
// Null never matches
|
|
|
|
|
if (other is null)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
// Properties
|
|
|
|
|
if (DisplayType != other.DisplayType)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if (FlipX != other.FlipX)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if (HBEnd != other.HBEnd)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if (HBStart != other.HBStart)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if (Height != other.Height)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if (HTotal != other.HTotal)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if (PixClock != other.PixClock)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if (Refresh != other.Refresh)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if (Rotate != other.Rotate)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if ((Tag is null) ^ (other.Tag is null))
|
|
|
|
|
return false;
|
|
|
|
|
else if (Tag is not null && !Tag.Equals(other.Tag, StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if (VBEnd != other.VBEnd)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if (VBStart != other.VBStart)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if (VTotal != other.VTotal)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if (Width != other.Width)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
public bool Equals(Video? other)
|
|
|
|
|
{
|
|
|
|
|
// Null never matches
|
|
|
|
|
if (other is null)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
// Properties
|
|
|
|
|
if (AspectX != other.AspectX)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if (AspectY != other.AspectY)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if (DisplayType != other.Screen)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if (Height != other.Height)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if (Refresh != other.Refresh)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if (Rotate != other.Orientation)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if (Width != other.Width)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2025-09-26 10:20:48 -04:00
|
|
|
}
|
|
|
|
|
}
|