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 the capabilities could not be retrieved.
            if (result != MidiDeviceException.MMSYSERR_NOERROR)
            {
                // Throw an exception.
                throw new OutputDeviceException(result);
            }

            return(caps);
        }
Exemplo n.º 2
0
        public static MidiOutCaps GetDeviceCapabilities(int deviceID)
        {
            var caps = new MidiOutCaps();

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

            // If the capabilities could not be retrieved.
            if (result != DeviceException.MMSYSERR_NOERROR)
            {
                throw new OutputDeviceException(result);
            }

            return(caps);
        }
 protected static extern int midiOutGetDevCaps(int deviceID,
     ref MidiOutCaps caps, int sizeOfMidiOutCaps);
        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 the capabilities could not be retrieved.
            if (result != MidiDeviceException.MMSYSERR_NOERROR)
            {
                // Throw an exception.
                throw new OutputDeviceException(result);
            }

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