Exemple #1
0
 public static WaveInCaps[] GetCaps()
 {
     uint count = (uint)MMInterops.waveInGetNumDevs();
     WaveInCaps[] caps = new WaveInCaps[count];
     for (uint i = 0; i < count; i++)
     {
         WaveInCaps c;
         var result = MMInterops.waveInGetDevCaps(i, out c, (uint)Marshal.SizeOf(typeof(WaveInCaps)));
         MmException.Try(result, "waveInGetDevCaps");
         caps[i] = c;
     }
     return caps;
 }
Exemple #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="WaveInDevice"/> class.
        /// </summary>
        /// <param name="deviceId">The device identifier.</param>
        public WaveInDevice(int deviceId)
        {
            var caps = new WaveInCaps();
            MmException.Try(
                NativeMethods.waveInGetDevCaps((IntPtr) deviceId, out caps, (uint) Marshal.SizeOf(caps)),
                "waveInGetDevCaps");

            DeviceId = deviceId;
            Name = caps.Name;
            DriverVersion = new Version(caps.DriverVersion.HighWord(), caps.DriverVersion.LowWord());
            SupportedFormatsFlags = caps.Formats;
            SupportedFormats = caps.GetSupportedFormats();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="WaveInDevice"/> class.
        /// </summary>
        /// <param name="deviceId">The device identifier.</param>
        public WaveInDevice(int deviceId)
        {
            var caps = new WaveInCaps();

            MmException.Try(
                NativeMethods.waveInGetDevCaps((IntPtr)deviceId, out caps, (uint)Marshal.SizeOf(caps)),
                "waveInGetDevCaps");

            DeviceId              = deviceId;
            Name                  = caps.Name;
            DriverVersion         = new Version(caps.DriverVersion.HighWord(), caps.DriverVersion.LowWord());
            SupportedFormatsFlags = caps.Formats;
            SupportedFormats      = caps.GetSupportedFormats();
        }
Exemple #4
0
        public static           WaveInCaps[] GetCaps()
        {
            uint count = (uint)MMInterops.waveInGetNumDevs();

            WaveInCaps[] caps = new WaveInCaps[count];
            for (uint i = 0; i < count; i++)
            {
                WaveInCaps c;
                var        result = MMInterops.waveInGetDevCaps(i, out c, (uint)Marshal.SizeOf(typeof(WaveInCaps)));
                MmException.Try(result, "waveInGetDevCaps");
                caps[i] = c;
            }
            return(caps);
        }
Exemple #5
0
 private void deviceslist_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (deviceslist.SelectedItems.Count > 0)
     {
         _selectedDevice = (WaveInCaps)deviceslist.SelectedItems[0].Tag;
         btnStart.Enabled = true;
     }
     else
     {
         btnStart.Enabled = false;
     }
 }