Пример #1
0
        public static string GetDeviceName(int id)
        {
            MidiOutCaps caps = new MidiOutCaps();

            caps.Name = new char[32];
            int result = NativeMethods.midiOutGetDevCaps(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));
        }
Пример #2
0
 internal static extern int midiOutGetDevCaps(
     int uDeviceID,
     ref MidiOutCaps caps,
     uint cbMidiOutCaps);
Пример #3
0
 internal static extern int midiOutGetDevCaps(
     int uDeviceID,
     ref MidiOutCaps caps,
     uint cbMidiOutCaps);
Пример #4
0
 public static string GetDeviceName(int id)
 {
     var caps = new MidiOutCaps();
     caps.Name = new char[32];
     var result = NativeMethods.midiOutGetDevCaps(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);
 }