Search Results for

    Show / Hide Table of Contents

    Class ReadingSettings

    Settings according to which MIDI data should be read.
    Inheritance
    object
    ReadingSettings
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Melanchall.DryWetMidi.Core
    Assembly: Melanchall.DryWetMidi.dll
    Syntax
    public class ReadingSettings

    Properties

    CustomChunkTypes

    Gets or sets collection of custom chunks types.
    Declaration
    public ChunkTypesCollection CustomChunkTypes { get; set; }
    Property Value
    Type Description
    ChunkTypesCollection
    Remarks

    Types within this collection must be derived from the MidiChunk class and have parameterless constructor. No exception will be thrown if some types don't meet these requirements.

    CustomMetaEventTypes

    Gets or sets collection of custom meta events types.
    Declaration
    public EventTypesCollection CustomMetaEventTypes { get; set; }
    Property Value
    Type Description
    EventTypesCollection
    Remarks

    Types within this collection must be derived from the MetaEvent class and have parameterless constructor. No exception will be thrown if some types don't meet these requirements.

    DecodeTextCallback

    Gets or sets a callback used to decode a string from the specified bytes during reading a text-based meta event's text. The default is null.
    Declaration
    public DecodeTextCallback DecodeTextCallback { get; set; }
    Property Value
    Type Description
    DecodeTextCallback
    Remarks

    If callback is not set, TextEncoding will be used.

    EndOfTrackStoringPolicy

    Gets or sets reaction of the reading engine on End Of Track event encountered. The default is Omit.
    Declaration
    public EndOfTrackStoringPolicy EndOfTrackStoringPolicy { get; set; }
    Property Value
    Type Description
    EndOfTrackStoringPolicy
    Exceptions
    Type Condition
    InvalidEnumArgumentException value specified an invalid value.

    ExtraTrackChunkPolicy

    Gets or sets reaction of the reading engine on new track chunk if already read track chunks count is greater or equals the one declared in the file's header chunk. The default is Read.
    Declaration
    public ExtraTrackChunkPolicy ExtraTrackChunkPolicy { get; set; }
    Property Value
    Type Description
    ExtraTrackChunkPolicy
    Exceptions
    Type Condition
    InvalidEnumArgumentException value specified an invalid value.

    InvalidChannelEventParameterValuePolicy

    Gets or sets reaction of the reading engine on invalid value of a channel event's parameter value. The default is Abort.
    Declaration
    public InvalidChannelEventParameterValuePolicy InvalidChannelEventParameterValuePolicy { get; set; }
    Property Value
    Type Description
    InvalidChannelEventParameterValuePolicy
    Remarks

    Valid values are 0-127 so, for example, 128 is the invalid one and will be processed according with this policy. If Abort is used, an instance of the InvalidChannelEventParameterValueException will be thrown if event's parameter value just read is invalid.

    Exceptions
    Type Condition
    InvalidEnumArgumentException value specified an invalid value.

    InvalidChunkSizePolicy

    Gets or sets reaction of the reading engine on difference between actual chunk's size and the one declared in its header. The default is Abort.
    Declaration
    public InvalidChunkSizePolicy InvalidChunkSizePolicy { get; set; }
    Property Value
    Type Description
    InvalidChunkSizePolicy
    Remarks

    If Abort is used, an instance of the InvalidChunkSizeException will be thrown if actual chunk's size differs from the one declared in chunk's header.

    Exceptions
    Type Condition
    InvalidEnumArgumentException value specified an invalid value.

    InvalidMetaEventParameterValuePolicy

    Gets or sets reaction of the reading engine on invalid value of a meta event's parameter value. The default is Abort.
    Declaration
    public InvalidMetaEventParameterValuePolicy InvalidMetaEventParameterValuePolicy { get; set; }
    Property Value
    Type Description
    InvalidMetaEventParameterValuePolicy
    Remarks

    For example, 255 is the invalid value for the Scale and will be processed according with this policy. If Abort is used, an instance of the InvalidMetaEventParameterValueException will be thrown if event's parameter value just read is invalid.

    Exceptions
    Type Condition
    InvalidEnumArgumentException value specified an invalid value.

    InvalidSystemCommonEventParameterValuePolicy

    Gets or sets reaction of the reading engine on invalid value of a system common event's parameter value. The default is Abort.
    Declaration
    public InvalidSystemCommonEventParameterValuePolicy InvalidSystemCommonEventParameterValuePolicy { get; set; }
    Property Value
    Type Description
    InvalidSystemCommonEventParameterValuePolicy
    Remarks

    For example, 255 is the invalid value for the Number and will be processed according with this policy. If Abort is used, an instance of the InvalidSystemCommonEventParameterValueException will be thrown if event's parameter value just read is invalid.

    Exceptions
    Type Condition
    InvalidEnumArgumentException value specified an invalid value.

    MissedEndOfTrackPolicy

    Gets or sets reaction of the reading engine on missed End Of Track event. The default is Ignore.
    Declaration
    public MissedEndOfTrackPolicy MissedEndOfTrackPolicy { get; set; }
    Property Value
    Type Description
    MissedEndOfTrackPolicy
    Remarks

    If Abort is used, an instance of the MissedEndOfTrackEventException will be thrown if track chunk doesn't end with End Of Track event. Although this event is not optional and therefore missing of it must be treated as error, you can try to read a track chunk relying only on the chunk's size declared in its header.

    Exceptions
    Type Condition
    InvalidEnumArgumentException value specified an invalid value.

    NoHeaderChunkPolicy

    Gets or sets reaction of the reading engine on missing of the header chunk in the MIDI file. The default is Abort.
    Declaration
    public NoHeaderChunkPolicy NoHeaderChunkPolicy { get; set; }
    Property Value
    Type Description
    NoHeaderChunkPolicy
    Remarks

    If Abort is used, an instance of the NoHeaderChunkException will be thrown if the MIDI file doesn't contain the header chunk.

    Exceptions
    Type Condition
    InvalidEnumArgumentException value specified an invalid value.

    NotEnoughBytesPolicy

    Gets or sets reaction of the reading engine on lack of bytes in the underlying stream that are needed to read MIDI data (for example, DWORD requires 4 bytes available). The default is Abort.
    Declaration
    public NotEnoughBytesPolicy NotEnoughBytesPolicy { get; set; }
    Property Value
    Type Description
    NotEnoughBytesPolicy
    Remarks

    If Abort is used, an instance of the NotEnoughBytesException will be thrown if the reader's underlying stream doesn't have enough bytes to read MIDI data.

    Exceptions
    Type Condition
    InvalidEnumArgumentException value specified an invalid value.

    ReaderSettings

    Gets or sets settings according to which MidiReader should read MIDI data.
    Declaration
    public ReaderSettings ReaderSettings { get; set; }
    Property Value
    Type Description
    ReaderSettings
    Remarks

    These settings specify reading binary data without knowledge about MIDI data structures.

    SilentNoteOnPolicy

    Gets or sets reaction of the reading engine on Note On events with velocity of zero. The default is NoteOff.
    Declaration
    public SilentNoteOnPolicy SilentNoteOnPolicy { get; set; }
    Property Value
    Type Description
    SilentNoteOnPolicy
    Remarks

    Although it is recommended to treat silent Note On event as Note Off you can turn this behavior off to get original event stored in a MIDI file.

    Exceptions
    Type Condition
    InvalidEnumArgumentException value specified an invalid value.

    StopReadingOnExpectedTrackChunksCountReached

    Gets or sets a value indicating whether the reading engine should stop or not when the count of read chunks is equal to the value defined in a file's header. The default value is false which means all chunks will be read.
    Declaration
    public bool StopReadingOnExpectedTrackChunksCountReached { get; set; }
    Property Value
    Type Description
    bool
    See Also
    UnexpectedTrackChunksCountPolicy

    TextEncoding

    Gets or sets an Encoding that will be used to read the text of a text-based meta events. The default is ASCII.
    Declaration
    public Encoding TextEncoding { get; set; }
    Property Value
    Type Description
    Encoding
    Remarks

    Value of this property will be used only if DecodeTextCallback is not set.

    UnexpectedTrackChunksCountPolicy

    Gets or sets reaction of the reading engine on unexpected track chunks count. The default is Ignore.
    Declaration
    public UnexpectedTrackChunksCountPolicy UnexpectedTrackChunksCountPolicy { get; set; }
    Property Value
    Type Description
    UnexpectedTrackChunksCountPolicy
    Remarks

    This policy will be taken into account if actual track chunks count is less or greater than tracks number specified in the file's header chunk. If Abort is used, an instance of the UnexpectedTrackChunksCountException will be thrown if track chunks count is unexpected.

    Exceptions
    Type Condition
    InvalidEnumArgumentException value specified an invalid value.

    UnknownChannelEventCallback

    Gets or sets a callback used to read unknown channel event if UnknownChannelEventPolicy set to UseCallback.
    Declaration
    public UnknownChannelEventCallback UnknownChannelEventCallback { get; set; }
    Property Value
    Type Description
    UnknownChannelEventCallback

    UnknownChannelEventPolicy

    Gets or sets reaction of the reading engine on unknown channel event. The default is Abort.
    Declaration
    public UnknownChannelEventPolicy UnknownChannelEventPolicy { get; set; }
    Property Value
    Type Description
    UnknownChannelEventPolicy
    Remarks

    If Abort is used, an instance of the UnknownChannelEventException will be thrown if channel event has unknown status byte.

    Exceptions
    Type Condition
    InvalidEnumArgumentException value specified an invalid value.

    UnknownChunkIdPolicy

    Gets or sets reaction of the reading engine on chunk with unknown ID. The default is ReadAsUnknownChunk.
    Declaration
    public UnknownChunkIdPolicy UnknownChunkIdPolicy { get; set; }
    Property Value
    Type Description
    UnknownChunkIdPolicy
    Remarks

    If Abort is used, an instance of the UnknownChunkException will be thrown if a chunk to be read has unknown ID.

    Exceptions
    Type Condition
    InvalidEnumArgumentException value specified an invalid value.

    UnknownFileFormatPolicy

    Gets or sets reaction of the reading engine on unknown file format stored in a header chunk. The default is Ignore.
    Declaration
    public UnknownFileFormatPolicy UnknownFileFormatPolicy { get; set; }
    Property Value
    Type Description
    UnknownFileFormatPolicy
    Remarks

    If Abort is used, an instance of the UnknownFileFormatException will be thrown if file format stored in a header chunk doesn't belong to values defined by the MidiFileFormat enumeration.

    Exceptions
    Type Condition
    InvalidEnumArgumentException value specified an invalid value.

    ZeroLengthDataPolicy

    Gets or sets reaction of the reading engine on zero-length objects such as strings or arrays. The default is ReadAsEmptyObject.
    Declaration
    public ZeroLengthDataPolicy ZeroLengthDataPolicy { get; set; }
    Property Value
    Type Description
    ZeroLengthDataPolicy
    Exceptions
    Type Condition
    InvalidEnumArgumentException value specified an invalid value.
    In this article
    Back to top 2024 / Generated by DocFX