Exemplo n.º 1
0
        public static string GetDeviceName(int id)
        {
            MidiInCaps caps = new MidiInCaps();

            caps.Name = new char[32];
            int result = NativeMethods.midiInGetDevCaps(id, ref caps,
                                                        (uint)Marshal.SizeOf(caps));
            int len = 0;

            for (int i = 0; i < 32; i++)
            {
                if (caps.Name[i] == 0)
                {
                    len = i;
                    break;
                }
            }


            return(new string(caps.Name, 0, len));
        }
Exemplo n.º 2
0
 internal static extern int midiInGetDevCaps(
     int uDeviceID,
     ref MidiInCaps caps,
     uint cbMidiInCaps);
Exemplo n.º 3
0
 internal static extern int midiInGetDevCaps(
     int uDeviceID,
     ref MidiInCaps caps,
     uint cbMidiInCaps);
Exemplo n.º 4
0
        public static string GetDeviceName(int id)
        {
            var caps = new MidiInCaps();
            caps.Name = new char[32];
            var result = NativeMethods.midiInGetDevCaps(id, ref caps,
            (uint)Marshal.SizeOf(caps));
            var len = 0;
            for (var i = 0; i < 32; i++)
            {
                if (caps.Name[i] == 0)
                {
                    len = i;
                    break;
                }
            }

            return new string(caps.Name, 0, len);
        }