/// <summary> /// Connects <see cref="InputDevice"/> to <see cref="OutputDevice"/>. /// </summary> /// <exception cref="MidiDeviceException"><see cref="InputDevice"/> is already connected /// to <see cref="OutputDevice"/>.</exception> public void Connect() { var result = MidiConnectWinApi.midiConnect(InputDevice.GetHandle(), OutputDevice.GetHandle(), IntPtr.Zero); if (result == MidiWinApi.MIDIERR_NOTREADY) { throw new MidiDeviceException("Specified input device is already connected to an output device."); } }
/// <summary> /// Disconnects <see cref="InputDevice"/> from <see cref="OutputDevice"/>. /// </summary> public void Disconnect() { MidiConnectWinApi.midiDisconnect(InputDevice.GetHandle(), OutputDevice.GetHandle(), IntPtr.Zero); }