Esempio n. 1
0
        public AudioDevice(IAudio audio, AudioLibrary.Interfaces.IAudioDevice audioDevice)
        {
            _internalAudioDevice  = audioDevice;
            _valueChangedCallback = RaiseEventCallback <IAudioDevice>;
            Audio = audio;

            _internalAudioDevice.VolumeChanged += DefaultLineVolumeChanged;
            _internalAudioDevice.MuteChanged   += DefaultLineMuteChanged;
        }
Esempio n. 2
0
        AudioDevice FindAudioDevice(AudioLibrary.Interfaces.IAudioDevice internalAudioDevice)
        {
            foreach (var audioDevice in _audioDevices)
            {
                if (audioDevice.InternalAudioDevice == internalAudioDevice)
                {
                    return(audioDevice);
                }
            }

            return(null);
        }
Esempio n. 3
0
        void OnRecordingDeviceChanged(AudioLibrary.Interfaces.IAudioDevice device)
        {
            if (device != null && (_recordingDevice != null && device != _recordingDevice.InternalAudioDevice || _recordingDevice == null && device != null))
            {
                var localDevice = FindAudioDevice(device);

                if (localDevice == null)
                {
                    localDevice = new AudioDevice(this, device);
                }

                RecordingDevice = localDevice;
            }
            else if (device == null && _recordingDevice != null)
            {
                RecordingDevice = null;
            }
        }
Esempio n. 4
0
        void OnPlaybackDeviceChanged(AudioLibrary.Interfaces.IAudioDevice device)
        {
            if (device != null && (_playbackDevice != null && device != _playbackDevice.InternalAudioDevice || _playbackDevice == null && device != null))
            {
                var localDevice = FindAudioDevice(device);

                if (localDevice == null)
                {
                    localDevice = new AudioDevice(this, device);
                }

                PlaybackDevice = localDevice;
            }
            else if (device == null && _playbackDevice != null)
            {
                PlaybackDevice = null;
            }
        }
Esempio n. 5
0
 void DefaultLineMuteChanged(AudioLibrary.Interfaces.IAudioDevice obj)
 {
     RaiseMuteChanged();
 }