Files
UmaViewer/Assets/Scripts/Audio/NAudio/FileFormats/SoundFont/SFVersionBuilder.cs
T
2022-09-10 16:59:44 +08:00

43 lines
786 B
C#

using System;
using System.IO;
namespace NAudio.SoundFont
{
/// <summary>
/// Builds a SoundFont version
/// </summary>
class SFVersionBuilder : StructureBuilder<SFVersion>
{
/// <summary>
/// Reads a SoundFont Version structure
/// </summary>
public override SFVersion Read(BinaryReader br)
{
SFVersion v = new SFVersion();
v.Major = br.ReadInt16();
v.Minor = br.ReadInt16();
data.Add(v);
return v;
}
/// <summary>
/// Writes a SoundFont Version structure
/// </summary>
public override void Write(BinaryWriter bw, SFVersion v)
{
bw.Write(v.Major);
bw.Write(v.Minor);
}
/// <summary>
/// Gets the length of this structure
/// </summary>
public override int Length
{
get
{
return 4;
}
}
}
}