mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-09-22 06:45:11 +00:00
PlayJ model cleanup
This commit is contained in:
@@ -8,12 +8,12 @@ namespace SabreTools.Data.Models.PlayJ
|
||||
/// <summary>
|
||||
/// Header
|
||||
/// </summary>
|
||||
public AudioHeader? Header { get; set; }
|
||||
public AudioHeader Header { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Unknown block 1
|
||||
/// </summary>
|
||||
public UnknownBlock1? UnknownBlock1 { get; set; }
|
||||
public UnknownBlock1 UnknownBlock1 { get; set; }
|
||||
|
||||
#region V1 Only
|
||||
|
||||
@@ -47,4 +47,4 @@ namespace SabreTools.Data.Models.PlayJ
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace SabreTools.Data.Models.PlayJ
|
||||
/// <summary>
|
||||
/// Track name (not null-terminated)
|
||||
/// </summary>
|
||||
public string? Track { get; set; }
|
||||
public string Track { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Length of the artist name
|
||||
@@ -36,7 +36,7 @@ namespace SabreTools.Data.Models.PlayJ
|
||||
/// <summary>
|
||||
/// Artist name (not null-terminated)
|
||||
/// </summary>
|
||||
public string? Artist { get; set; }
|
||||
public string Artist { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Length of the album name
|
||||
@@ -46,7 +46,7 @@ namespace SabreTools.Data.Models.PlayJ
|
||||
/// <summary>
|
||||
/// Album name (not null-terminated)
|
||||
/// </summary>
|
||||
public string? Album { get; set; }
|
||||
public string Album { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Length of the writer name
|
||||
@@ -56,7 +56,7 @@ namespace SabreTools.Data.Models.PlayJ
|
||||
/// <summary>
|
||||
/// Writer name (not null-terminated)
|
||||
/// </summary>
|
||||
public string? Writer { get; set; }
|
||||
public string Writer { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Length of the publisher name
|
||||
@@ -66,7 +66,7 @@ namespace SabreTools.Data.Models.PlayJ
|
||||
/// <summary>
|
||||
/// Publisher name (not null-terminated)
|
||||
/// </summary>
|
||||
public string? Publisher { get; set; }
|
||||
public string Publisher { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Length of the label name
|
||||
@@ -76,7 +76,7 @@ namespace SabreTools.Data.Models.PlayJ
|
||||
/// <summary>
|
||||
/// Label name (not null-terminated)
|
||||
/// </summary>
|
||||
public string? Label { get; set; }
|
||||
public string Label { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Length of the comments
|
||||
@@ -90,4 +90,4 @@ namespace SabreTools.Data.Models.PlayJ
|
||||
/// <remarks>Optional field only in some samples</remarks>
|
||||
public string? Comments { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,4 +59,4 @@ namespace SabreTools.Data.Models.PlayJ
|
||||
/// </summary>
|
||||
public uint Duration { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,4 +123,4 @@ namespace SabreTools.Data.Models.PlayJ
|
||||
/// </summary>
|
||||
public uint Unknown18 { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,4 +6,4 @@ namespace SabreTools.Data.Models.PlayJ
|
||||
|
||||
public const uint SignatureUInt32 = 0x4B539DFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace SabreTools.Data.Models.PlayJ
|
||||
/// <summary>
|
||||
/// Data file name
|
||||
/// </summary>
|
||||
public string? FileName { get; set; }
|
||||
public string FileName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Length of the data
|
||||
|
||||
@@ -119,4 +119,4 @@ namespace SabreTools.Data.Models.PlayJ
|
||||
/// </summary>
|
||||
FolkJazz = 7,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,11 +8,11 @@ namespace SabreTools.Data.Models.PlayJ
|
||||
/// <summary>
|
||||
/// Playlist header
|
||||
/// </summary>
|
||||
public PlaylistHeader? Header { get; set; }
|
||||
public PlaylistHeader Header { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Embedded audio files / headers
|
||||
/// </summary>
|
||||
public AudioFile[]? AudioFiles { get; set; }
|
||||
public AudioFile[] AudioFiles { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,28 +21,21 @@ namespace SabreTools.Serialization.Wrappers
|
||||
Print(builder, Model.Header);
|
||||
Print(builder, Model.UnknownBlock1);
|
||||
|
||||
if (Model.Header?.Version == 0x00000000)
|
||||
if (Model.Header.Version == 0x00000000)
|
||||
{
|
||||
Print(builder, Model.UnknownValue2);
|
||||
Print(builder, Model.UnknownBlock3);
|
||||
}
|
||||
else if (Model.Header?.Version == 0x0000000A)
|
||||
else if (Model.Header.Version == 0x0000000A)
|
||||
{
|
||||
Print(builder, Model.DataFilesCount, Model.DataFiles);
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, AudioHeader? header)
|
||||
private static void Print(StringBuilder builder, AudioHeader header)
|
||||
{
|
||||
builder.AppendLine(" Audio Header Information:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (header == null)
|
||||
{
|
||||
builder.AppendLine(" No audio header");
|
||||
builder.AppendLine();
|
||||
return;
|
||||
}
|
||||
|
||||
builder.AppendLine(header.Signature, " Signature");
|
||||
builder.AppendLine(header.Version, " Version");
|
||||
if (header.Version == 0x00000000 && header is AudioHeaderV1 headerV1)
|
||||
@@ -106,33 +99,19 @@ namespace SabreTools.Serialization.Wrappers
|
||||
builder.AppendLine();
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, UnknownBlock1? block)
|
||||
private static void Print(StringBuilder builder, UnknownBlock1 block)
|
||||
{
|
||||
builder.AppendLine(" Unknown Block 1 Information:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (block == null)
|
||||
{
|
||||
builder.AppendLine(" No unknown block 1r");
|
||||
builder.AppendLine();
|
||||
return;
|
||||
}
|
||||
|
||||
builder.AppendLine(block.Length, " Length");
|
||||
builder.AppendLine(block.Data, " Data");
|
||||
builder.AppendLine();
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, uint? value)
|
||||
private static void Print(StringBuilder builder, uint value)
|
||||
{
|
||||
builder.AppendLine(" Unknown Value 2 Information:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (value == null)
|
||||
{
|
||||
builder.AppendLine(" No unknown block 1r");
|
||||
builder.AppendLine();
|
||||
return;
|
||||
}
|
||||
|
||||
builder.AppendLine(value, " Value");
|
||||
builder.AppendLine();
|
||||
}
|
||||
|
||||
@@ -22,27 +22,20 @@ namespace SabreTools.Serialization.Wrappers
|
||||
Print(builder, Model.AudioFiles);
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, PlaylistHeader? header)
|
||||
private static void Print(StringBuilder builder, PlaylistHeader header)
|
||||
{
|
||||
builder.AppendLine(" Playlist Header Information:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (header == null)
|
||||
{
|
||||
builder.AppendLine(" No playlist header");
|
||||
builder.AppendLine();
|
||||
return;
|
||||
}
|
||||
|
||||
builder.AppendLine(header.TrackCount, " Track count");
|
||||
builder.AppendLine(header.Data, " Data");
|
||||
builder.AppendLine();
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, AudioFile[]? entries)
|
||||
private static void Print(StringBuilder builder, AudioFile[] entries)
|
||||
{
|
||||
builder.AppendLine(" Audio Files Information:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (entries == null || entries.Length == 0)
|
||||
if (entries.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No audio files");
|
||||
builder.AppendLine();
|
||||
@@ -57,12 +50,12 @@ namespace SabreTools.Serialization.Wrappers
|
||||
Print(builder, entry.Header);
|
||||
Print(builder, entry.UnknownBlock1);
|
||||
|
||||
if (entry.Header?.Version == 0x00000000)
|
||||
if (entry.Header.Version == 0x00000000)
|
||||
{
|
||||
Print(builder, entry.UnknownValue2);
|
||||
Print(builder, entry.UnknownBlock3);
|
||||
}
|
||||
else if (entry.Header?.Version == 0x0000000A)
|
||||
else if (entry.Header.Version == 0x0000000A)
|
||||
{
|
||||
Print(builder, entry.DataFilesCount, entry.DataFiles);
|
||||
}
|
||||
@@ -71,17 +64,10 @@ namespace SabreTools.Serialization.Wrappers
|
||||
builder.AppendLine();
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, AudioHeader? header)
|
||||
private static void Print(StringBuilder builder, AudioHeader header)
|
||||
{
|
||||
builder.AppendLine(" Audio Header Information:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (header == null)
|
||||
{
|
||||
builder.AppendLine(" No audio header");
|
||||
builder.AppendLine();
|
||||
return;
|
||||
}
|
||||
|
||||
builder.AppendLine(header.Signature, " Signature");
|
||||
builder.AppendLine(header.Version, " Version");
|
||||
if (header.Version == 0x00000000 && header is AudioHeaderV1 headerV1)
|
||||
@@ -145,33 +131,19 @@ namespace SabreTools.Serialization.Wrappers
|
||||
builder.AppendLine();
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, UnknownBlock1? block)
|
||||
private static void Print(StringBuilder builder, UnknownBlock1 block)
|
||||
{
|
||||
builder.AppendLine(" Unknown Block 1 Information:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (block == null)
|
||||
{
|
||||
builder.AppendLine(" No unknown block 1r");
|
||||
builder.AppendLine();
|
||||
return;
|
||||
}
|
||||
|
||||
builder.AppendLine(block.Length, " Length");
|
||||
builder.AppendLine(block.Data, " Data");
|
||||
builder.AppendLine();
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, uint? value)
|
||||
private static void Print(StringBuilder builder, uint value)
|
||||
{
|
||||
builder.AppendLine(" Unknown Value 2 Information:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (value == null)
|
||||
{
|
||||
builder.AppendLine(" No unknown block 1r");
|
||||
builder.AppendLine();
|
||||
return;
|
||||
}
|
||||
|
||||
builder.AppendLine(value, " Value");
|
||||
builder.AppendLine();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user