Search Results for

    Show / Hide Table of Contents

    Class InputEndpoint

    Represents an input MIDI device. More info in the Devices and Input device articles.
    Inheritance
    object
    MidiEndpoint
    InputEndpoint
    Implements
    IInputEndpoint
    IDisposable
    Inherited Members
    MidiEndpoint.ErrorOccurred
    MidiEndpoint.IsEnabled
    MidiEndpoint.GetDeviceInformation()
    MidiEndpoint.Dispose()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Melanchall.DryWetMidi.Multimedia
    Assembly: Melanchall.DryWetMidi.dll
    Syntax
    public sealed class InputEndpoint : MidiEndpoint, IInputEndpoint, IDisposable

    Properties

    IsListeningForEvents

    Gets a value that indicates whether InputEndpoint is currently listening for incoming MIDI events.
    Declaration
    public bool IsListeningForEvents { get; }
    Property Value
    Type Description
    bool

    Name

    Gets the name of the current MIDI device.
    Declaration
    public override string Name { get; }
    Property Value
    Type Description
    string
    Overrides
    MidiEndpoint.Name

    RaiseMidiTimeCodeReceived

    Gets or sets a value indicating if MidiTimeCodeReceived event should be raised or not. Default value is true.
    Declaration
    public bool RaiseMidiTimeCodeReceived { get; set; }
    Property Value
    Type Description
    bool

    SilentNoteOnPolicy

    Gets or sets reaction of the input device on Note On events with velocity of zero. The default is NoteOn.
    Declaration
    public SilentNoteOnPolicy SilentNoteOnPolicy { get; set; }
    Property Value
    Type Description
    SilentNoteOnPolicy
    Exceptions
    Type Condition
    InvalidEnumArgumentException value specified an invalid value.

    SysExBufferSize

    Declaration
    public int SysExBufferSize { get; set; }
    Property Value
    Type Description
    int

    SysExBuffersCount

    Declaration
    public int SysExBuffersCount { get; set; }
    Property Value
    Type Description
    int

    WaitForCompleteSysExEvent

    Gets or sets a value indicating whether system exclusive event is treated as received only when it's completed or not. Default value is true.
    Declaration
    public bool WaitForCompleteSysExEvent { get; set; }
    Property Value
    Type Description
    bool
    Remarks

    Some MIDI devices and MIDI subsystems of operating systems can split a system exclusive event into several parts on sending the event. If WaitForCompleteSysExEvent is set to true (default value), DryWetMIDI will wait until last part received, then the library will combine all event's parts into single MIDI event and fire the EventReceived event.

    For example, considering following separate events are received (here bytes in hex format):

    F0 7F 60

    40 F7

    With WaitForCompleteSysExEvent set to true, the EventReceived will be fired only once providing the single event:

    F0 7F 60 40 F7

    (F7 is a marker of a completed system exclusive event).

    With the property set to false you'll be notified with EventReceived event two times, so every part will be considered as a MIDI event.

    Methods

    Equals(object)

    Determines whether the specified object is equal to the current object.
    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj The object to compare with the current object.
    Returns
    Type Description
    bool true if the specified object is equal to the current object; otherwise, false.
    Overrides
    object.Equals(object)
    Remarks
    On Windows the method will just compare objects references. "True" equality check available on macOS only.

    GetAll()

    Retrieves all input MIDI devices presented in the system.
    Declaration
    public static ICollection<InputEndpoint> GetAll()
    Returns
    Type Description
    ICollection<InputEndpoint> All input MIDI devices presented in the system.
    Exceptions
    Type Condition
    NativeApiException An error occurred.
    PlatformNotSupportedException This operation is not supported on the current operating system.

    GetByName(string)

    Retrieves a first input MIDI device with the specified name.
    Declaration
    public static InputEndpoint GetByName(string name)
    Parameters
    Type Name Description
    string name The name of an input MIDI device to retrieve.
    Returns
    Type Description
    InputEndpoint Input MIDI device with the specified name.
    Exceptions
    Type Condition
    ArgumentException

    One of the following errors occurred:

    • name is null or contains white-spaces only.
    • name specifies an input MIDI device which is not presented in the system.
    NativeApiException An error occurred.
    PlatformNotSupportedException This operation is not supported on the current operating system.

    GetEndpointsCount()

    Retrieves the number of input MIDI devices presented in the system.
    Declaration
    public static int GetEndpointsCount()
    Returns
    Type Description
    int Number of input MIDI devices presented in the system.
    Exceptions
    Type Condition
    NativeApiException An error occurred.
    PlatformNotSupportedException This operation is not supported on the current operating system.

    GetHashCode()

    Serves as the default hash function.
    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int A hash code for the current object.
    Overrides
    object.GetHashCode()

    GetProperty(InputEndpointProperty)

    Returns current value of the specified property attached to the current input device.
    Declaration
    public object GetProperty(InputEndpointProperty property)
    Parameters
    Type Name Description
    InputEndpointProperty property The property to get value of.
    Returns
    Type Description
    object The current value of the property.
    Remarks

    To get the list of properties applicable to input devices on the current operating system use GetSupportedProperties() method.

    Following table shows the type of value returned by the method for each property:

    PropertyType
    Product string
    Manufacturer string
    DriverVersion int
    UniqueId int
    DriverOwner string
    Exceptions
    Type Condition
    InvalidEnumArgumentException property specified an invalid value.
    ArgumentException property is not in the list of the properties supported for the current operating system.
    ObjectDisposedException The current InputEndpoint is disposed.
    NativeApiException An error occurred on the device. One of the cases when this exception can be thrown is device is not in the system anymore (for example, unplugged).
    InvalidOperationException The current InputEndpoint instance is created by EndpointRemoved event and thus considered as removed so you cannot interact with it.

    GetSupportedProperties()

    Returns the list of the properties supported by input devices on the current operating system.
    Declaration
    public static InputEndpointProperty[] GetSupportedProperties()
    Returns
    Type Description
    InputEndpointProperty[] The list of the properties supported by input devices on the current operating system.
    Exceptions
    Type Condition
    PlatformNotSupportedException This operation is not supported on the current operating system.

    StartEventsListening()

    Starts listening for incoming MIDI events on the current input device.
    Declaration
    public void StartEventsListening()
    Exceptions
    Type Condition
    ObjectDisposedException The current InputEndpoint is disposed.
    NativeApiException An error occurred on device.
    InvalidOperationException The current InputEndpoint instance is created by EndpointRemoved event and thus considered as removed so you cannot interact with it.

    StopEventsListening()

    Stops listening for incoming MIDI events on the current input device.
    Declaration
    public void StopEventsListening()
    Exceptions
    Type Condition
    ObjectDisposedException The current InputEndpoint is disposed.
    NativeApiException An error occurred on device.
    InvalidOperationException The current InputEndpoint instance is created by EndpointRemoved event and thus considered as removed so you cannot interact with it.

    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
    MidiEndpoint.ToString()

    Events

    EventReceived

    Occurs when a MIDI event is received.
    Declaration
    public event EventHandler<MidiEventReceivedEventArgs> EventReceived
    Event Type
    Type Description
    EventHandler<MidiEventReceivedEventArgs>

    MidiTimeCodeReceived

    Occurs when MIDI time code received, i.e. all MIDI events to complete MIDI time code are received.
    Declaration
    public event EventHandler<MidiTimeCodeReceivedEventArgs> MidiTimeCodeReceived
    Event Type
    Type Description
    EventHandler<MidiTimeCodeReceivedEventArgs>
    Remarks
    This event will be raised only if RaiseMidiTimeCodeReceived is set to true.

    Operators

    operator ==(InputEndpoint, InputEndpoint)

    Determines if two InputEndpoint objects are equal.
    Declaration
    public static bool operator ==(InputEndpoint inputEndpoint1, InputEndpoint inputEndpoint2)
    Parameters
    Type Name Description
    InputEndpoint inputEndpoint1 The first InputEndpoint to compare.
    InputEndpoint inputEndpoint2 The second InputEndpoint to compare.
    Returns
    Type Description
    bool true if the devices are equal, false otherwise.
    Remarks
    On Windows the operator will just compare objects references. "True" equality check available on macOS only.

    operator !=(InputEndpoint, InputEndpoint)

    Determines if two InputEndpoint objects are not equal.
    Declaration
    public static bool operator !=(InputEndpoint inputEndpoint1, InputEndpoint inputEndpoint2)
    Parameters
    Type Name Description
    InputEndpoint inputEndpoint1 The first InputEndpoint to compare.
    InputEndpoint inputEndpoint2 The second InputEndpoint to compare.
    Returns
    Type Description
    bool false if the devices are equal, true otherwise.
    Remarks
    On Windows the operator will just compare objects references. "True" inequality check available on macOS only.

    Implements

    IInputEndpoint
    IDisposable

    Extension Methods

    EndpointsConnectorUtilities.Connect(IInputEndpoint, params IOutputEndpoint[])
    In this article
    Back to top 2026 / Generated by DocFX