1
0
Fork 0

Prepare lsdvd types

This commit is contained in:
Jöran Malek 2025-10-26 18:01:04 +01:00
parent 73d17fdb12
commit 692c50c377
16 changed files with 588 additions and 0 deletions

View file

@ -0,0 +1,59 @@
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Text.Json.Serialization;
using System.Xml.Serialization;
namespace MediaOrganizer.Tools.Types.LsDvd;
public sealed class Audio
{
[XmlElement("ix", typeof(int))]
public int? Index { get; [param: NotNull] set; }
[Browsable(false), JsonIgnore]
public bool IndexSpecified => Index.HasValue;
[XmlElement("langcode")]
public string? LangCode { get; [param: NotNull] set; }
[Browsable(false), JsonIgnore]
public bool LangCodeSpecified => !string.IsNullOrWhiteSpace(LangCode);
[XmlElement("language")]
public string? Language { get; [param: NotNull] set; }
[Browsable(false), JsonIgnore]
public bool LanguageSpecified => !string.IsNullOrWhiteSpace(Language);
[XmlElement("format")]
public string? Format { get; [param: NotNull] set; }
[Browsable(false), JsonIgnore]
public bool FormatSpecified => !string.IsNullOrWhiteSpace(Format);
[XmlElement("frequency", typeof(int))]
public int? Frequency { get; [param: NotNull] set; }
[Browsable(false), JsonIgnore]
public bool FrequencySpecified => Frequency.HasValue;
[XmlElement("quantization")]
public string? Quantization { get; [param: NotNull] set; }
[Browsable(false), JsonIgnore]
public bool QuantizationSpecified => !string.IsNullOrWhiteSpace(Quantization);
[XmlElement("channels", typeof(int))]
public int? Channels { get; [param: NotNull] set; }
[Browsable(false), JsonIgnore]
public bool ChannelsSpecified => Channels.HasValue;
[XmlElement("ap_mode", typeof(int))]
public int? ApMode { get; [param: NotNull] set; }
[Browsable(false), JsonIgnore]
public bool ApModeSpecified => ApMode.HasValue;
[XmlElement("content")]
public string? Content { get; [param: NotNull] set; }
[Browsable(false), JsonIgnore]
public bool ContentSpecified => !string.IsNullOrWhiteSpace(Content);
[XmlElement("streamid")]
public string? StreamId { get; [param: NotNull] set; }
[Browsable(false), JsonIgnore]
public bool StreamIdSpecified => !string.IsNullOrWhiteSpace(StreamId);
}

View file

@ -0,0 +1,19 @@
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Text.Json.Serialization;
using System.Xml.Serialization;
namespace MediaOrganizer.Tools.Types.LsDvd;
public sealed class Cell
{
[XmlElement("ix", typeof(int))]
public int? Index { get; [param: NotNull] set; }
[Browsable(false), JsonIgnore]
public bool IndexSpecified => Index.HasValue;
[XmlElement("length", typeof(double))]
public double? Length { get; [param: NotNull] set; }
[Browsable(false), JsonIgnore]
public bool LengthSpecified => Length.HasValue;
}

View file

@ -0,0 +1,24 @@
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Text.Json.Serialization;
using System.Xml.Serialization;
namespace MediaOrganizer.Tools.Types.LsDvd;
public sealed class Chapter
{
[XmlElement("ix", typeof(int))]
public int? Index { get; [param: NotNull] set; }
[Browsable(false), JsonIgnore]
public bool IndexSpecified => Index.HasValue;
[XmlElement("length", typeof(double))]
public double? Length { get; [param: NotNull] set; }
[Browsable(false), JsonIgnore]
public bool LengthSpecified => Length.HasValue;
[XmlElement("startcell", typeof(int))]
public int? StartCell { get; [param: NotNull] set; }
[Browsable(false), JsonIgnore]
public bool StartCellSpecified => StartCell.HasValue;
}

View file

@ -0,0 +1,38 @@
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Text.Json.Serialization;
using System.Xml.Serialization;
namespace MediaOrganizer.Tools.Types.LsDvd;
[XmlRoot("lsdvd")]
public sealed class LsDvdResult
{
[XmlElement("device")]
public string? Device { get; [param: NotNull] set; }
[Browsable(false), JsonIgnore]
public bool DeviceSpecified => !string.IsNullOrWhiteSpace(Device);
[XmlElement("title")]
public string? Title { get; [param: NotNull] set; }
[Browsable(false), JsonIgnore]
public bool TitleSpecified => !string.IsNullOrWhiteSpace(Title);
[XmlElement("vmg_id")]
public string? VmgId { get; [param: NotNull] set; }
[Browsable(false), JsonIgnore]
public bool VmgIdSpecified => !string.IsNullOrWhiteSpace(VmgId);
[XmlElement("provider_id")]
public string? ProviderId { get; [param: NotNull] set; }
[Browsable(false), JsonIgnore]
public bool ProviderIdSpecified => !string.IsNullOrWhiteSpace(ProviderId);
[XmlElement("track")]
public List<Track> Tracks { get; } = [];
[XmlElement("longest_track")]
public int? LongestTrack { get; [param: NotNull] set; }
[Browsable(false), JsonIgnore]
public bool LongestTrackSpecified => LongestTrack.HasValue;
}

View file

@ -0,0 +1,34 @@
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Text.Json.Serialization;
using System.Xml.Serialization;
namespace MediaOrganizer.Tools.Types.LsDvd;
public sealed class Subtitle
{
[XmlElement("ix", typeof(int))]
public int? Index { get; [param: NotNull] set; }
[Browsable(false), JsonIgnore]
public bool IndexSpecified => Index.HasValue;
[XmlElement("langcode")]
public string? LangCode { get; [param: NotNull] set; }
[Browsable(false), JsonIgnore]
public bool LangCodeSpecified => !string.IsNullOrWhiteSpace(LangCode);
[XmlElement("language")]
public string? Language { get; [param: NotNull] set; }
[Browsable(false), JsonIgnore]
public bool LanguageSpecified => !string.IsNullOrWhiteSpace(Language);
[XmlElement("content")]
public string? Content { get; [param: NotNull] set; }
[Browsable(false), JsonIgnore]
public bool ContentSpecified => !string.IsNullOrWhiteSpace(Content);
[XmlElement("streamid")]
public string? StreamId { get; [param: NotNull] set; }
[Browsable(false), JsonIgnore]
public bool StreamIdSpecified => !string.IsNullOrWhiteSpace(StreamId);
}

View file

@ -0,0 +1,84 @@
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Text.Json.Serialization;
using System.Xml.Serialization;
namespace MediaOrganizer.Tools.Types.LsDvd;
public sealed class Track
{
[XmlElement("ix", typeof(int))]
public int? Index { get; [param: NotNull] set; }
[Browsable(false), JsonIgnore]
public bool IndexSpecified => Index.HasValue;
[XmlElement("length", typeof(double))]
public double? Length { get; [param: NotNull] set; }
[Browsable(false), JsonIgnore]
public bool LengthSpecified => Length.HasValue;
[XmlElement("vts_id")]
public string? VtsId { get; [param: NotNull] set; }
[Browsable(false), JsonIgnore]
public bool VtsIdSpecified => !string.IsNullOrWhiteSpace(VtsId);
[XmlElement("vts", typeof(int))]
public int? Vts { get; [param: NotNull] set; }
[Browsable(false), JsonIgnore]
public bool VtsSpecified => Vts.HasValue;
[XmlElement("ttn", typeof(int))]
public int? Ttn { get; [param: NotNull] set; }
[Browsable(false), JsonIgnore]
public bool TtnSpecified => Vts.HasValue;
[XmlElement("fps", typeof(double))]
public double? FPS { get; [param: NotNull] set; }
[Browsable(false), JsonIgnore]
public bool FPSSpecified => FPS.HasValue;
[XmlElement("format")]
public string? Format { get; [param: NotNull] set; }
[Browsable(false), JsonIgnore]
public bool FormatSpecified => !string.IsNullOrWhiteSpace(Format);
[XmlElement("aspect")]
public string? Aspect { get; [param: NotNull] set; }
[Browsable(false), JsonIgnore]
public bool AspectSpecified => !string.IsNullOrWhiteSpace(Aspect);
[XmlElement("width", typeof(int))]
public int? Width { get; [param: NotNull] set; }
[Browsable(false), JsonIgnore]
public bool WidthSpecified => Width.HasValue;
[XmlElement("height", typeof(int))]
public int? Height { get; [param: NotNull] set; }
[Browsable(false), JsonIgnore]
public bool HeightSpecified => Height.HasValue;
[XmlElement("df")]
public string? Df { get; [param: NotNull] set; }
[Browsable(false), JsonIgnore]
public bool DfSpecified => !string.IsNullOrWhiteSpace(Df);
[XmlArray("palette"), XmlArrayItem("color", IsNullable = false)]
public List<string> Palette { get; } = [];
[XmlElement("angles", typeof(int))]
public int? Angles { get; [param: NotNull] set; }
[Browsable(false), JsonIgnore]
public bool AnglesSpecified => Angles.HasValue;
[XmlElement("audio")]
public List<Audio> Audio { get; } = [];
[XmlElement("chapter")]
public List<Chapter> Chapters { get; } = [];
[XmlElement("cell")]
public List<Cell> Cells { get; } = [];
[XmlElement("subp")]
public List<Subtitle> Subtitles { get; } = [];
}

View file

@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>MediaOrganizer</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageId>media-organizer.Ref</PackageId>
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
</PropertyGroup>
</Project>