Search Results for

    Show / Hide Table of Contents

    Class OutputEndpoint

    Represents an output MIDI endpoint. More info in the Devices and Output endpoint articles.
    Inheritance
    object
    MidiEndpoint
    OutputEndpoint
    Implements
    IOutputEndpoint
    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 OutputEndpoint : MidiEndpoint, IOutputEndpoint, IDisposable

    Properties

    Name

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

    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 output MIDI devices presented in the system.
    Declaration
    public static ICollection<OutputEndpoint> GetAll()
    Returns
    Type Description
    ICollection<OutputEndpoint> All output 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 output MIDI device with the specified name.
    Declaration
    public static OutputEndpoint GetByName(string name)
    Parameters
    Type Name Description
    string name The name of an output MIDI device to retrieve.
    Returns
    Type Description
    OutputEndpoint Output 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 output 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 output MIDI devices presented in the system.
    Declaration
    public static int GetEndpointsCount()
    Returns
    Type Description
    int Number of output 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(OutputEndpointProperty)

    Returns current value of the specified property attached to the current output endpoint.
    Declaration
    public object GetProperty(OutputEndpointProperty property)
    Parameters
    Type Name Description
    OutputEndpointProperty 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 output endpoints 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
    Technology OutputEndpointTechnology
    VoicesNumber int
    NotesNumber int
    Channels FourBitNumber[]
    Options OutputEndpointOption
    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 OutputEndpoint 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 OutputEndpoint 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 output devices on the current operating system.
    Declaration
    public static OutputEndpointProperty[] GetSupportedProperties()
    Returns
    Type Description
    OutputEndpointProperty[] The list of the properties supported by output devices on the current operating system.
    Exceptions
    Type Condition
    PlatformNotSupportedException This operation is not supported on the current operating system.

    PrepareForEventsSending()

    Prepares output MIDI device for sending events to it allocating necessary resources.
    Declaration
    public void PrepareForEventsSending()
    Remarks
    It is not needed to call this method before actual MIDI data sending since first call of SendEvent(MidiEvent) will prepare the device automatically. But it can take some time so you may decide to call PrepareForEventsSending() before working with device.
    Exceptions
    Type Condition
    NativeApiException An error occurred on device.

    SendEvent(MidiEvent)

    Sends a MIDI event to the current output endpoint.
    Declaration
    public void SendEvent(MidiEvent midiEvent)
    Parameters
    Type Name Description
    MidiEvent midiEvent MIDI event to send.
    Exceptions
    Type Condition
    ObjectDisposedException The current OutputEndpoint is disposed.
    ArgumentNullException midiEvent is null.
    NativeApiException An error occurred on endpoint.
    ArgumentException EscapeSysExEvent is prohibited. Use NormalSysExEvent instead.

    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()

    TurnAllNotesOff()

    Turns off all notes that were turned on by sending Note On events, and which haven't yet been turned off by respective Note Off events.
    Declaration
    public void TurnAllNotesOff()
    Exceptions
    Type Condition
    ObjectDisposedException The current OutputEndpoint is disposed.
    NativeApiException An error occurred on device.

    Events

    EventSent

    Occurs when a MIDI event is sent.
    Declaration
    public event EventHandler<MidiEventSentEventArgs> EventSent
    Event Type
    Type Description
    EventHandler<MidiEventSentEventArgs>

    Operators

    operator ==(OutputEndpoint, OutputEndpoint)

    Determines if two OutputEndpoint objects are equal.
    Declaration
    public static bool operator ==(OutputEndpoint outputEndpoint1, OutputEndpoint outputEndpoint2)
    Parameters
    Type Name Description
    OutputEndpoint outputEndpoint1 The first OutputEndpoint to compare.
    OutputEndpoint outputEndpoint2 The second OutputEndpoint 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 !=(OutputEndpoint, OutputEndpoint)

    Determines if two OutputEndpoint objects are not equal.
    Declaration
    public static bool operator !=(OutputEndpoint outputEndpoint1, OutputEndpoint outputEndpoint2)
    Parameters
    Type Name Description
    OutputEndpoint outputEndpoint1 The first OutputEndpoint to compare.
    OutputEndpoint outputEndpoint2 The second OutputEndpoint 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

    IOutputEndpoint
    IDisposable
    In this article
    Back to top 2026 / Generated by DocFX