public static midiInOpen ( HMIDIIN &lphMidiIn, |
||
lphMidiIn | HMIDIIN | |
uDeviceID | ||
dwCallback | MidiInProc | |
dwCallbackInstance | ||
return | MMRESULT |
/// <summary> /// Opens this input device. /// </summary> /// <exception cref="InvalidOperationException">The device is already open.</exception> /// <exception cref="DeviceException">The device cannot be opened.</exception> /// <remarks>Note that Open() establishes a connection to the device, but no messages will /// be received until <see cref="StartReceiving"/> is called.</remarks> public void Open() { if (isInsideInputHandler) { throw new InvalidOperationException("Device is open."); } lock (this) { CheckNotOpen(); CheckReturnCode(Win32API.midiInOpen(out handle, deviceId, inputCallbackDelegate, (UIntPtr)0)); isOpen = true; } }