mirror of
https://github.com/claunia/cuetools.net.git
synced 2025-12-16 18:14:25 +00:00
42 lines
1.1 KiB
C#
42 lines
1.1 KiB
C#
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Text;
|
|||
|
|
using System.Runtime.InteropServices;
|
|||
|
|
using System.IO;
|
|||
|
|
|
|||
|
|
namespace NAudio.Wave
|
|||
|
|
{
|
|||
|
|
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 2)]
|
|||
|
|
class WaveFormatExtraData : WaveFormat
|
|||
|
|
{
|
|||
|
|
// try with 100 bytes for now, increase if necessary
|
|||
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 100)]
|
|||
|
|
byte[] extraData = new byte[100];
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// parameterless constructor for marshalling
|
|||
|
|
/// </summary>
|
|||
|
|
WaveFormatExtraData()
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public WaveFormatExtraData(BinaryReader reader)
|
|||
|
|
: base(reader)
|
|||
|
|
{
|
|||
|
|
if (this.extraSize > 0)
|
|||
|
|
{
|
|||
|
|
reader.Read(extraData,0, extraSize);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public override void Serialize(BinaryWriter writer)
|
|||
|
|
{
|
|||
|
|
base.Serialize(writer);
|
|||
|
|
if (extraSize > 0)
|
|||
|
|
{
|
|||
|
|
writer.Write(extraData, 0, extraSize);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|