Class MidiWriter
Writer of the MIDI data types.
Assembly: Melanchall.DryWetMidi.dll
Syntax
public sealed class MidiWriter : IDisposable
Constructors
MidiWriter(Stream, WriterSettings)
Initializes a new instance of the
MidiWriter with the specified stream.
Declaration
public MidiWriter(Stream stream, WriterSettings settings)
Parameters
Type |
Name |
Description |
Stream |
stream |
Stream to write MIDI file to. |
WriterSettings |
settings |
Settings according to which MIDI data should be written. |
Exceptions
Properties
Length
Gets the current count of written bytes.
Declaration
public long Length { get; }
Property Value
Methods
Dispose()
Releases all resources used by the current instance of the
MidiWriter class.
Declaration
Write3ByteDword(uint)
Writes a DWORD value (32-bit unsigned integer) to the underlying stream as three bytes
and advances the current position by three bytes.
Declaration
public void Write3ByteDword(uint value)
Parameters
Type |
Name |
Description |
uint |
value |
DWORD value to write. |
Exceptions
WriteByte(byte)
Writes an unsigned byte to the underlying stream and advances the stream position
by one byte.
Declaration
public void WriteByte(byte value)
Parameters
Type |
Name |
Description |
byte |
value |
The unsigned byte to write. |
Exceptions
WriteBytes(byte[])
Writes a byte array to the underlying stream.
Declaration
public void WriteBytes(byte[] bytes)
Parameters
Type |
Name |
Description |
byte[] |
bytes |
A byte array containing the data to write. |
Exceptions
WriteDword(uint)
Writes a DWORD value (32-bit unsigned integer) to the underlying stream and
advances the current position by four bytes.
Declaration
public void WriteDword(uint value)
Parameters
Type |
Name |
Description |
uint |
value |
DWORD value to write. |
Exceptions
WriteInt16(short)
Writes a INT16 value (16-bit signed integer) to the underlying stream and
advances the current position by two bytes.
Declaration
public void WriteInt16(short value)
Parameters
Type |
Name |
Description |
short |
value |
INT16 value to write. |
Exceptions
WriteSByte(sbyte)
Writes a signed byte to the underlying stream and advances the stream position by one byte.
Declaration
public void WriteSByte(sbyte value)
Parameters
Type |
Name |
Description |
sbyte |
value |
The signed byte to write. |
Exceptions
WriteString(string)
Writes a string to the underlying stream as set of ASCII bytes.
Declaration
public void WriteString(string value)
Parameters
Type |
Name |
Description |
string |
value |
The string to write. |
Exceptions
WriteVlqNumber(int)
Writes a 32-bit signed integer to the underlying stream in compressed format called
variable-length quantity (VLQ).
Declaration
public void WriteVlqNumber(int value)
Parameters
Type |
Name |
Description |
int |
value |
The value to write. |
Exceptions
WriteVlqNumber(long)
Writes a 64-bit signed integer to the underlying stream in compressed format called
variable-length quantity (VLQ).
Declaration
public void WriteVlqNumber(long value)
Parameters
Type |
Name |
Description |
long |
value |
The value to write. |
Exceptions
WriteWord(ushort)
Writes a WORD value (16-bit unsigned integer) to the underlying stream and
advances the current position by two bytes.
Declaration
public void WriteWord(ushort value)
Parameters
Type |
Name |
Description |
ushort |
value |
WORD value to write. |
Exceptions
Implements