Beispiel #1
0
        public static MIDI_OUTCAPS GetInfo(int deviceID)
        {
            MIDI_OUTCAPS midi_OUTCAPS = new MIDI_OUTCAPS();

            if (Midi.MIDI_OutGetDevCaps(deviceID, midi_OUTCAPS) == MIDIError.MIDI_OK)
            {
                return(midi_OUTCAPS);
            }
            return(null);
        }
Beispiel #2
0
        public static string GetDeviceDescription(int deviceID)
        {
            MIDI_OUTCAPS midi_OUTCAPS = new MIDI_OUTCAPS();

            if (Midi.MIDI_OutGetDevCaps(deviceID, midi_OUTCAPS) == MIDIError.MIDI_OK)
            {
                return(midi_OUTCAPS.name);
            }
            return(null);
        }
Beispiel #3
0
        public static string[] GetDeviceDescriptions()
        {
            List <string> list         = new List <string>();
            int           num          = Midi.MIDI_OutGetNumDevs();
            MIDI_OUTCAPS  midi_OUTCAPS = new MIDI_OUTCAPS();

            for (int i = 0; i < num; i++)
            {
                if (Midi.MIDI_OutGetDevCaps(i, midi_OUTCAPS) == MIDIError.MIDI_OK)
                {
                    list.Add(midi_OUTCAPS.name);
                }
            }
            return(list.ToArray());
        }
Beispiel #4
0
        public static int[] GetMidiPorts()
        {
            List <int>   list         = new List <int>();
            int          num          = Midi.MIDI_OutGetNumDevs();
            MIDI_OUTCAPS midi_OUTCAPS = new MIDI_OUTCAPS();

            for (int i = 0; i < num; i++)
            {
                if (Midi.MIDI_OutGetDevCaps(i, midi_OUTCAPS) == MIDIError.MIDI_OK && midi_OUTCAPS.IsMidiPort)
                {
                    list.Add(i);
                }
            }
            return(list.ToArray());
        }
Beispiel #5
0
 public static MIDIError MIDI_OutGetDevCaps(int deviceID, MIDI_OUTCAPS caps)
 {
     return(Midi.midiOutGetDevCaps(new IntPtr(deviceID), caps, Marshal.SizeOf(typeof(MIDI_OUTCAPS))));
 }
Beispiel #6
0
 private static extern MIDIError midiOutGetDevCaps(IntPtr deviceID, [In][Out] MIDI_OUTCAPS caps, int sizeOfMidiOutCaps);