Beispiel #1
0
        public static WaveOutCaps GetDevice(int device)
        {
            WaveOutCaps caps = new WaveOutCaps();

            MMInterops.waveOutGetDevCaps((uint)device, out caps, (uint)Marshal.SizeOf(caps));
            return(caps);
        }
Beispiel #2
0
 public static WaveOutCaps[] GetDevices()
 {
     WaveOutCaps[] caps = new WaveOutCaps[WaveOut.GetDeviceCount()];
     for (int i = 0; i < caps.Length; i++)
     {
         caps[i] = GetDevice(i);
     }
     return(caps);
 }
Beispiel #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WaveOutDevice"/> class.
 /// </summary>
 /// <param name="deviceId">The device identifier.</param>
 public WaveOutDevice(int deviceId)
 {
     var caps = new WaveOutCaps();
     MmException.Try(NativeMethods.waveOutGetDevCaps((IntPtr) deviceId, out caps, (uint) Marshal.SizeOf(caps)),
         "waveOutGetDevCaps");
     DeviceId = deviceId;
     Name = caps.szPname;
     DriverSupported = caps.dwSupport;
     DriverVersion = new Version(caps.vDriverVersion.HighWord(), caps.vDriverVersion.LowWord());
     SupportedFormatsFlags = caps.dwFormats;
     SupportedFormats = caps.GetSupportedFormats();
 }
Beispiel #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="WaveOutDevice"/> class.
        /// </summary>
        /// <param name="deviceId">The device identifier.</param>
        public WaveOutDevice(int deviceId)
        {
            var caps = new WaveOutCaps();

            MmException.Try(NativeMethods.waveOutGetDevCaps((IntPtr)deviceId, out caps, (uint)Marshal.SizeOf(caps)),
                            "waveOutGetDevCaps");
            DeviceId              = deviceId;
            Name                  = caps.szPname;
            DriverSupported       = caps.dwSupport;
            DriverVersion         = new Version(caps.vDriverVersion.HighWord(), caps.vDriverVersion.LowWord());
            SupportedFormatsFlags = caps.dwFormats;
            SupportedFormats      = caps.GetSupportedFormats();
        }
Beispiel #5
0
 public static WaveOutCaps GetDevice(int device)
 {
     WaveOutCaps caps = new WaveOutCaps();
     MMInterops.waveOutGetDevCaps((uint)device, out caps, (uint)Marshal.SizeOf(caps));
     return caps;
 }
Beispiel #6
0
 public static WaveOutCaps[] GetDevices()
 {
     WaveOutCaps[] caps = new WaveOutCaps[WaveOut.GetDeviceCount()];
     for (int i = 0; i < caps.Length; i++)
         caps[i] = GetDevice(i);
     return caps;
 }