public void SetDevices() { _curCapture = _registry.MediaConfig.CaptureDeviceId != -1 ? SoundDevices.Where(s => s.Id == _registry.MediaConfig.CaptureDeviceId).Take(1).SingleOrDefault() : null; _curPlayback = _registry.MediaConfig.PlaybackDeviceId != -1 ? SoundDevices.Where(s => s.Id == _registry.MediaConfig.PlaybackDeviceId).Take(1).SingleOrDefault() : null; if (_curCapture != null && _curPlayback != null) { _mediaApi.SetCurrentSoundDevices(new Tuple <int, int>(_curCapture.Id, _curPlayback.Id)); } else if (_curCapture == null && _curPlayback != null) { _mediaApi.SetCurrentSoundDevices(new Tuple <int, int>(-1, _curPlayback.Id)); } else if (_curCapture != null && _curPlayback == null) { _mediaApi.SetCurrentSoundDevices(new Tuple <int, int>(_curCapture.Id, -1)); } else { _mediaApi.SetCurrentSoundDevicesToNull(); } }
public bool Equals(SoundDeviceInfo other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; return other.Id == Id && Equals(other.Name, Name) && other.InputCount == InputCount && other.OutputCount == OutputCount && other.DefaultSamplesPerSec == DefaultSamplesPerSec; }
public List <SoundDeviceInfo> GetSoundDeviceList() { List <SoundDeviceInfo> soundDeviceList = new List <SoundDeviceInfo>(); SoundDeviceInfo soundDevice = new SoundDeviceInfo(); // /proc/asound/cards soundDeviceList.Add(soundDevice); return(soundDeviceList); }
public bool Equals(SoundDeviceInfo other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(other.Id == Id && Equals(other.Name, Name) && other.InputCount == InputCount && other.OutputCount == OutputCount && other.DefaultSamplesPerSec == DefaultSamplesPerSec); }
public void SetSoundDevices(SoundDeviceInfo playback, SoundDeviceInfo capture) { SetSoundDevices(playback == null ? -1 : playback.Id, capture == null ? -1 : capture.Id); }