public static WaveOutCaps GetDevice(int device) { WaveOutCaps caps = new WaveOutCaps(); MMInterops.waveOutGetDevCaps((uint)device, out caps, (uint)Marshal.SizeOf(caps)); return(caps); }
public static WaveOutCaps[] GetDevices() { WaveOutCaps[] caps = new WaveOutCaps[WaveOut.GetDeviceCount()]; for (int i = 0; i < caps.Length; i++) { caps[i] = GetDevice(i); } return(caps); }
/// <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(); }
/// <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(); }
public static WaveOutCaps GetDevice(int device) { WaveOutCaps caps = new WaveOutCaps(); MMInterops.waveOutGetDevCaps((uint)device, out caps, (uint)Marshal.SizeOf(caps)); return caps; }
public static WaveOutCaps[] GetDevices() { WaveOutCaps[] caps = new WaveOutCaps[WaveOut.GetDeviceCount()]; for (int i = 0; i < caps.Length; i++) caps[i] = GetDevice(i); return caps; }