예제 #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();
        }
예제 #2
0
        void OnRefresh()
        {
            WindowProvider.RefreshDesktopSize();

            VideoViewModel.RefreshVideoSources();

            VideoViewModel.RefreshCodecs();

            AudioSource.Refresh();

            WebCamProvider.Refresh();

            Status.LocalizationKey = nameof(LanguageManager.Refreshed);
        }
예제 #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();
        }
예제 #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);
        }