コード例 #1
0
        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();
            }
        }
コード例 #2
0
 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;
 }
コード例 #3
0
    public List <SoundDeviceInfo> GetSoundDeviceList()
    {
        List <SoundDeviceInfo> soundDeviceList = new List <SoundDeviceInfo>();

        SoundDeviceInfo soundDevice = new SoundDeviceInfo();

        // /proc/asound/cards

        soundDeviceList.Add(soundDevice);

        return(soundDeviceList);
    }
コード例 #4
0
ファイル: SoundDeviceInfo.cs プロジェクト: xaccc/pjsip4net
 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);
 }
コード例 #5
0
 public void SetSoundDevices(SoundDeviceInfo playback, SoundDeviceInfo capture)
 {
     SetSoundDevices(playback == null ? -1 : playback.Id, capture == null ? -1 : capture.Id);
 }