midiInOpen() public static method

Opens a MIDI input device.
public static midiInOpen ( HMIDIIN &lphMidiIn, UIntPtr uDeviceID, MidiInProc dwCallback, UIntPtr dwCallbackInstance ) : MMRESULT
lphMidiIn HMIDIIN
uDeviceID System.UIntPtr
dwCallback MidiInProc
dwCallbackInstance System.UIntPtr
return MMRESULT
Esempio n. 1
0
 /// <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;
     }
 }