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(); }
void OnRefresh() { WindowProvider.RefreshDesktopSize(); VideoViewModel.RefreshVideoSources(); VideoViewModel.RefreshCodecs(); AudioSource.Refresh(); WebCamProvider.Refresh(); Status.LocalizationKey = nameof(LanguageManager.Refreshed); }
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(); }
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); }