public static MIDI_INCAPS GetInfo(int deviceID)
        {
            MIDI_INCAPS midi_INCAPS = new MIDI_INCAPS();

            if (Midi.MIDI_InGetDevCaps(deviceID, midi_INCAPS) == MIDIError.MIDI_OK)
            {
                return(midi_INCAPS);
            }
            return(null);
        }
        public static string GetDeviceDescription(int deviceID)
        {
            MIDI_INCAPS midi_INCAPS = new MIDI_INCAPS();

            if (Midi.MIDI_InGetDevCaps(deviceID, midi_INCAPS) == MIDIError.MIDI_OK)
            {
                return(midi_INCAPS.name);
            }
            return(null);
        }
        public static int[] GetMidiPorts()
        {
            List <int>  list = new List <int>();
            int         num  = Midi.MIDI_InGetNumDevs();
            MIDI_INCAPS caps = new MIDI_INCAPS();

            for (int i = 0; i < num; i++)
            {
                if (Midi.MIDI_InGetDevCaps(i, caps) == MIDIError.MIDI_OK)
                {
                    list.Add(i);
                }
            }
            return(list.ToArray());
        }
        public static string[] GetDeviceDescriptions()
        {
            List <string> list        = new List <string>();
            int           num         = Midi.MIDI_InGetNumDevs();
            MIDI_INCAPS   midi_INCAPS = new MIDI_INCAPS();

            for (int i = 0; i < num; i++)
            {
                if (Midi.MIDI_InGetDevCaps(i, midi_INCAPS) == MIDIError.MIDI_OK)
                {
                    list.Add(midi_INCAPS.name);
                }
            }
            return(list.ToArray());
        }
Exemple #5
0
 public static MIDIError MIDI_InGetDevCaps(int deviceID, MIDI_INCAPS caps)
 {
     return(Midi.midiInGetDevCaps(new IntPtr(deviceID), caps, Marshal.SizeOf(typeof(MIDI_INCAPS))));
 }
Exemple #6
0
 private static extern MIDIError midiInGetDevCaps(IntPtr deviceID, [In][Out] MIDI_INCAPS caps, int sizeOfMidiInCaps);