コード例 #1
0
 private static extern Result midiInOpen(ref MidiDeviceHandle deviceHandle, int deviceID, MidiInputDelegate callback, IntPtr callbackInstance, MidiOpenFlags flags);
コード例 #2
0
 /// <summary>
 /// Opens the specified MIDI input device for receiving MIDI data.
 /// </summary>
 /// <param name="deviceHandle">A <see cref="MidiDeviceHandle"/> to store the obtained device handle.</param>
 /// <param name="deviceID">An <see cref="int"/> representing the MIDI input device's ID.</param>
 /// <param name="callback">A <see cref="MidiInputDelegate"/> specifying the callback function to process MIDI messages.</param>
 /// <param name="callbackInstance">An <see cref="IntPtr"/> specifying user instance data passed to the callback function.</param>
 /// <returns>A <see cref="Result"/> value containing the result of the API call.</returns>
 internal static Result OpenMidiInputDevice(ref MidiDeviceHandle deviceHandle, int deviceID, MidiInputDelegate callback, IntPtr callbackInstance)
 {
     return(midiInOpen(ref deviceHandle, deviceID, callback, callbackInstance, callback == null ? MidiOpenFlags.CALLBACK_NULL : MidiOpenFlags.CALLBACK_FUNCTION | MidiOpenFlags.CALLBACK_IO_STATUS));
 }