public static MidiOutCaps GetDeviceCapabilities(int deviceID)
        {
            MidiOutCaps caps = new MidiOutCaps();

            // Get the device's capabilities.
            int result = midiOutGetDevCaps(deviceID, ref caps, Marshal.SizeOf(caps));

            if (result != 0)
            {
                throw new OutputDeviceException(result);
            }

            return(caps);
        }
 protected static extern int midiOutGetDevCaps(int deviceID,
                                               ref MidiOutCaps caps, int sizeOfMidiOutCaps);