Search Results for

    Show / Hide Table of Contents

    Class ReaderSettings

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

    Properties

    Buffer

    Gets or sets the buffer that will be used by MidiReader in case of UseCustomBuffer policy used for BufferingPolicy.
    Declaration
    public byte[] Buffer { get; set; }
    Property Value
    Type Description
    byte[]

    BufferSize

    Gets or sets the size of a buffer that will be used by MidiReader in case of UseFixedSizeBuffer policy used for BufferingPolicy.
    Declaration
    public int BufferSize { get; set; }
    Property Value
    Type Description
    int
    Exceptions
    Type Condition
    ArgumentOutOfRangeException value is zero or negative.

    BufferingPolicy

    Gets or sets a rule according to which MIDI data should be buffered before reading. The default is UseFixedSizeBuffer.
    Declaration
    public BufferingPolicy BufferingPolicy { get; set; }
    Property Value
    Type Description
    BufferingPolicy
    Exceptions
    Type Condition
    InvalidEnumArgumentException value specified an invalid value.

    BytesPacketMaxLength

    Gets or sets the maximum length of a bytes packet that will be used by MidiTokensReader.
    Declaration
    public int BytesPacketMaxLength { get; set; }
    Property Value
    Type Description
    int
    Exceptions
    Type Condition
    ArgumentOutOfRangeException value is zero or negative.

    NonSeekableStreamBufferSize

    Gets or sets internal buffer for reading MIDI data from non-seekable stream.
    Declaration
    public int NonSeekableStreamBufferSize { get; set; }
    Property Value
    Type Description
    int
    Remarks

    During reading MIDI data there are cases when reader should move current stream's position back. If stream doesn't support seeking, it will fail. So for non-seekable stream reading engine should maintain buffer of last N bytes to have ability to jump back. That N value is controlled by this property.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException Value is zero or negative.

    NonSeekableStreamIncrementalBytesReadingStep

    Gets or sets size of chunk for incremental reading of MIDI data from non-seekable stream.
    Declaration
    public int NonSeekableStreamIncrementalBytesReadingStep { get; set; }
    Property Value
    Type Description
    int
    Remarks

    This property works in conjunction with NonSeekableStreamIncrementalBytesReadingThreshold.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException Value is zero or negative.

    NonSeekableStreamIncrementalBytesReadingThreshold

    Gets or sets minimum count of bytes to read them from non-seekable stream incrementally instead of reading them all at once.
    Declaration
    public int NonSeekableStreamIncrementalBytesReadingThreshold { get; set; }
    Property Value
    Type Description
    int
    Remarks

    If count of bytes to read is greater than or equal to the value of this property, reading engine will read data by chunks of N bytes where N is a value of NonSeekableStreamIncrementalBytesReadingStep property. This property applies for non-seekable streams only. Since there is no way to determine available count of bytes within such streams, incremental reading can prevent OutOfMemoryException.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException Value is zero or negative.
    In this article
    Back to top 2025 / Generated by DocFX