Class UnknownChunk
Represents an unknown chunk.
Inherited Members
Namespace: Melanchall.DryWetMidi.Core
Assembly: Melanchall.DryWetMidi.dll
Syntax
public sealed class UnknownChunk : MidiChunk
Remarks
Structure of MIDI file chunks allows custom chunks be implemented and written to a MIDI file. Chunks DryWetMIDI doesn't know about will be read as an instances of the UnknownChunk.
See https://midi.org/standard-midi-files-specification for detailed MIDI file specification.
Properties
Data
Gets data contained in the current UnknownChunk.
Declaration
public byte[] Data { get; }
Property Value
Type | Description |
---|---|
byte[] |
Methods
Clone()
Clones chunk by creating a copy of it.
Declaration
public override MidiChunk Clone()
Returns
Type | Description |
---|---|
MidiChunk | Copy of the chunk. |
Overrides
GetContentSize(WritingSettings)
Gets size of UnknownChunk's content as number of bytes required to write it according
to the specified WritingSettings.
Declaration
protected override uint GetContentSize(WritingSettings settings)
Parameters
Type | Name | Description |
---|---|---|
WritingSettings | settings | Settings according to which the chunk's content will be written. |
Returns
Type | Description |
---|---|
uint | Number of bytes required to write UnknownChunk's content. |
Overrides
ReadContent(MidiReader, ReadingSettings, uint)
Reads content of a UnknownChunk.
Declaration
protected override void ReadContent(MidiReader reader, ReadingSettings settings, uint size)
Parameters
Type | Name | Description |
---|---|---|
MidiReader | reader | Reader to read the chunk's content with. |
ReadingSettings | settings | Settings according to which the chunk's content must be read. |
uint | size | Expected size of the content taken from the chunk's header. |
Overrides
Remarks
Content of an UnknownChunk is array of bytes.
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | Method was called after the reader's underlying stream was disposed. |
IOException | An I/O error occurred on the reader's underlying stream. |
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string that represents the current object. |
Overrides
WriteContent(MidiWriter, WritingSettings)
Writes content of a UnknownChunk.
Declaration
protected override void WriteContent(MidiWriter writer, WritingSettings settings)
Parameters
Type | Name | Description |
---|---|---|
MidiWriter | writer | Writer to write the chunk's content with. |
WritingSettings | settings | Settings according to which the chunk's content must be written. |
Overrides
Remarks
Content of an UnknownChunk is array of bytes.
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | Method was called after the writer's underlying stream was disposed. |
IOException | An I/O error occurred on the writer's underlying stream. |