Esempio n. 1
0
 private string getDeviceDrawString(DeviceInfo info)
 {
     return string.Format("[{0}] {1}",
         info.DataFlow == CoreAudioApi.EDataFlow.eCapture ? 
         Properties.Resources.DeviceTypeName_Capture : Properties.Resources.DeviceTypeName_Render,
         info.FriendlyName);
 }
Esempio n. 2
0
        private void updateDeviceInfoImpl(bool needStop)
        {
            if (needStop)
            {
                stopCaptureImpl();
            }
            lock(_lockObj) {
                _deviceInfos.Clear();
                if (_devices != null)
                {
                    foreach (MMDevice device in _devices.EnumerateAudioEndPoints(EDataFlow.eAll, EDeviceState.DEVICE_STATE_ACTIVE))
                    {
                        AudioEndpointVolume vol = device.AudioEndpointVolume;
                        DeviceInfo info = new DeviceInfo(device.Id, device.FriendlyName, device.DataFlow, device.State);
                        _deviceInfos.Add(info);
                    }
                }
            }

            // イベント発火
            DeviceInfoUpdatedEventHandler del = DeviceInfoUpdated;
            if (del != null)
            {
                List<DeviceInfo> info = this.DeviceInfos;
                del.Invoke(this, new DeviceInfoUpdatedEventArgs(info));
            }
        }