Search Results for

    Show / Hide Table of Contents

    Class DevicesConnector

    Provides a way to connect an input MIDI device to an output MIDI devices to redirect all incoming events from the input device to the output ones. More info in the Devices connector article.
    Inheritance
    object
    DevicesConnector
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Melanchall.DryWetMidi.Multimedia
    Assembly: Melanchall.DryWetMidi.dll
    Syntax
    public sealed class DevicesConnector

    Constructors

    DevicesConnector(IInputDevice, params IOutputDevice[])

    Initializes a new instance of the DevicesConnector with the specified input and output MIDI devices.
    Declaration
    public DevicesConnector(IInputDevice inputDevice, params IOutputDevice[] outputDevices)
    Parameters
    Type Name Description
    IInputDevice inputDevice Input MIDI device to connect to outputDevices.
    IOutputDevice[] outputDevices Output MIDI devices to connect inputDevice to.
    Remarks
    inputDevice will not be actually connected to outputDevices after an instance of DevicesConnector is created. You must call Connect() method to establish connection between devices.
    Exceptions
    Type Condition
    ArgumentNullException

    One of the following errors occurred:

    • inputDevice is null.
    • outputDevices is null.
    ArgumentException outputDevices contains null.

    Properties

    AreDevicesConnected

    Gets or sets a value indicating whether InputDevice currently connected to OutputDevices or not (i.e. Connect() method has been called).
    Declaration
    public bool AreDevicesConnected { get; }
    Property Value
    Type Description
    bool

    EventCallback

    Gets or sets a callback to process events coming from InputDevice before they will be sent to OutputDevices. The default value is null which means no processing will be applied.
    Declaration
    public DevicesConnectorEventCallback EventCallback { get; set; }
    Property Value
    Type Description
    DevicesConnectorEventCallback

    InputDevice

    Gets an input MIDI device to connect to OutputDevices.
    Declaration
    public IInputDevice InputDevice { get; }
    Property Value
    Type Description
    IInputDevice

    OutputDevices

    Gets output MIDI devices to connect InputDevice to.
    Declaration
    public IReadOnlyCollection<IOutputDevice> OutputDevices { get; }
    Property Value
    Type Description
    IReadOnlyCollection<IOutputDevice>

    Methods

    Connect()

    Connects InputDevice to OutputDevices so all events coming from the input device will be redirected to the output ones.
    Declaration
    public void Connect()

    Disconnect()

    Disconnects InputDevice from OutputDevices so events coming from the input device will not be redirected to the output ones.
    Declaration
    public void Disconnect()
    In this article
    Back to top 2025 / Generated by DocFX