예제 #1
0
 /// <summary>
 /// Retrieves the capabilities of a waveOut device
 /// </summary>
 /// <param name="devNumber">Device to test</param>
 /// <returns>The WaveOut device capabilities</returns>
 public static WaveOutCapabilities GetCapabilities(int devNumber)
 {
     WaveOutCapabilities caps = new WaveOutCapabilities();
     int structSize = Marshal.SizeOf(caps);
     MmException.Try(WaveInterop.waveOutGetDevCaps((IntPtr)devNumber, out caps, structSize), "waveOutGetDevCaps");
     return caps;
 }
예제 #2
0
파일: WaveOut.cs 프로젝트: senlinms/naudio
        /// <summary>
        /// Retrieves the capabilities of a waveOut device
        /// </summary>
        /// <param name="devNumber">Device to test</param>
        /// <returns>The WaveOut device capabilities</returns>
        public static WaveOutCapabilities GetCapabilities(int devNumber)
        {
            WaveOutCapabilities caps = new WaveOutCapabilities();
            int structSize           = Marshal.SizeOf(caps);

            MmException.Try(WaveInterop.waveOutGetDevCaps((IntPtr)devNumber, out caps, structSize), "waveOutGetDevCaps");
            return(caps);
        }
예제 #3
0
        public static WaveOutCapabilities GetCapabilities(int devNumber)
        {
            WaveOutCapabilities waveOutCapabilities = default(WaveOutCapabilities);
            int waveOutCapsSize = Marshal.SizeOf(waveOutCapabilities);

            MmException.Try(WaveInterop.waveOutGetDevCaps((IntPtr)devNumber, out waveOutCapabilities, waveOutCapsSize), "waveOutGetDevCaps");
            return(waveOutCapabilities);
        }
예제 #4
0
        /// <summary>
        /// 根据设备名称返回设备id
        /// </summary>
        /// <param name="_devicename">设备名称</param>
        /// <returns>返回设备id</returns>
        public static int getDeviceByName(string _devicename)
        {
            int _deviceid = 0;

            for (int deviceId = 0; deviceId < WaveOut.DeviceCount; deviceId++)
            {
                WaveOutCapabilities capabilities = WaveOut.GetCapabilities(deviceId);
                if (capabilities.ProductName.Contains(_devicename))
                {
                    _deviceid = deviceId;
                    break;
                }
            }
            return(_deviceid);
        }
 public static extern MmResult waveOutGetDevCaps(IntPtr deviceID, out WaveOutCapabilities waveOutCaps, int waveOutCapsSize);
예제 #6
0
 public static extern MmResult waveOutGetDevCaps(IntPtr deviceID, out WaveOutCapabilities waveOutCaps, int waveOutCapsSize);
예제 #7
0
 public OutputDeviceModel(int n, NAudio.Wave.WaveOutCapabilities capabilities) : base(n, capabilities)
 {
 }
예제 #8
0
 public OutputDevice(WaveOutCapabilities outputDevice, int deviceNumber)
 {
     _outputDevice = outputDevice;
     DeviceNumber = deviceNumber;
 }
예제 #9
0
 protected DeviceModel(int wavDeviceNum, WaveOutCapabilities waveoutcapabilities)
 {
     Provider = DeviceProvider.Wave;
     WavDeviceNumber = wavDeviceNum;
     WaveOutCapabilities = waveoutcapabilities;
 }