Exemple #1
0
        void OnRefresh()
        {
            #region Video Codec
            var lastVideoCodecName = VideoViewModel.SelectedVideoWriter?.ToString();

            VideoViewModel.RefreshCodecs();

            var matchingVideoCodec = VideoViewModel.AvailableVideoWriters.FirstOrDefault(M => M.ToString() == lastVideoCodecName);

            if (matchingVideoCodec != null)
            {
                VideoViewModel.SelectedVideoWriter = matchingVideoCodec;
            }
            #endregion

            #region Audio
            var lastMicNames = AudioSource.AvailableRecordingSources
                               .Where(M => M.Active)
                               .Select(M => M.Name)
                               .ToArray();

            var lastSpeakerNames = AudioSource.AvailableLoopbackSources
                                   .Where(M => M.Active)
                                   .Select(M => M.Name)
                                   .ToArray();

            AudioSource.Refresh();

            foreach (var source in AudioSource.AvailableRecordingSources)
            {
                source.Active = lastMicNames.Contains(source.Name);
            }

            foreach (var source in AudioSource.AvailableLoopbackSources)
            {
                source.Active = lastSpeakerNames.Contains(source.Name);
            }
            #endregion

            #region Webcam
            var lastWebcamName = WebCamProvider.SelectedCam?.Name;

            WebCamProvider.Refresh();

            var matchingWebcam = WebCamProvider.AvailableCams.FirstOrDefault(M => M.Name == lastWebcamName);

            if (matchingWebcam != null)
            {
                WebCamProvider.SelectedCam = matchingWebcam;
            }
            #endregion

            Refreshed?.Invoke();
        }
Exemple #2
0
        void OnRefresh()
        {
            WindowProvider.RefreshDesktopSize();

            VideoViewModel.RefreshVideoSources();

            VideoViewModel.RefreshCodecs();

            AudioSource.Refresh();

            WebCamProvider.Refresh();

            Status.LocalizationKey = nameof(LanguageManager.Refreshed);
        }
Exemple #3
0
        void OnRefresh()
        {
            VideoWritersViewModel.RefreshCodecs();

            AudioSource.Refresh();

            #region Webcam
            var lastWebcamName = WebCamProvider.SelectedCam?.Name;

            WebCamProvider.Refresh();

            var matchingWebcam = WebCamProvider.AvailableCams.FirstOrDefault(M => M.Name == lastWebcamName);

            if (matchingWebcam != null)
            {
                WebCamProvider.SelectedCam = matchingWebcam;
            }
            #endregion

            Refreshed?.Invoke();
        }
Exemple #4
0
        void OnRefresh()
        {
            WindowProvider.RefreshDesktopSize();

            #region Video Source
            var lastVideoSourceName = VideoViewModel.SelectedVideoSource?.Name;

            VideoViewModel.RefreshVideoSources();

            var matchingVideoSource = VideoViewModel.AvailableVideoSources.FirstOrDefault(M => M.Name == lastVideoSourceName);

            if (matchingVideoSource != null)
            {
                VideoViewModel.SelectedVideoSource = matchingVideoSource;
            }
            #endregion

            #region Video Codec
            var lastVideoCodecName = VideoViewModel.SelectedVideoWriter?.ToString();

            VideoViewModel.RefreshCodecs();

            var matchingVideoCodec = VideoViewModel.AvailableVideoWriters.FirstOrDefault(M => M.ToString() == lastVideoCodecName);

            if (matchingVideoCodec != null)
            {
                VideoViewModel.SelectedVideoWriter = matchingVideoCodec;
            }
            #endregion

            #region Audio
            var lastMicNames = AudioSource.AvailableRecordingSources
                               .Where(M => M.Active)
                               .Select(M => M.Name)
                               .ToArray();

            var lastSpeakerNames = AudioSource.AvailableLoopbackSources
                                   .Where(M => M.Active)
                                   .Select(M => M.Name)
                                   .ToArray();

            AudioSource.Refresh();

            foreach (var source in AudioSource.AvailableRecordingSources)
            {
                source.Active = lastMicNames.Contains(source.Name);
            }

            foreach (var source in AudioSource.AvailableLoopbackSources)
            {
                source.Active = lastSpeakerNames.Contains(source.Name);
            }
            #endregion

            #region Webcam
            var lastWebcamName = WebCamProvider.SelectedCam?.Name;

            WebCamProvider.Refresh();

            var matchingWebcam = WebCamProvider.AvailableCams.FirstOrDefault(M => M.Name == lastWebcamName);

            if (matchingWebcam != null)
            {
                WebCamProvider.SelectedCam = matchingWebcam;
            }
            #endregion

            Status.LocalizationKey = nameof(LanguageManager.Refreshed);
        }