midiInGetNumDevs() private method

private midiInGetNumDevs ( ) : UInt32
return System.UInt32
Beispiel #1
0
 /// <summary>
 /// Private method for constructing the array of MidiInputDevices by calling the Win32 api.
 /// </summary>
 /// <returns></returns>
 private static InputDevice[] MakeDeviceList()
 {
     uint inDevs = Win32API.midiInGetNumDevs();
     InputDevice[] result = new InputDevice[inDevs];
     for (uint deviceId = 0; deviceId < inDevs; deviceId++)
     {
         Win32API.MIDIINCAPS caps = new Win32API.MIDIINCAPS();
         Win32API.midiInGetDevCaps((UIntPtr)deviceId, out caps);
         result[deviceId] = new InputDevice((UIntPtr)deviceId, caps);
     }
     return result;
 }