Business.MpcConfigBusiness.AutoConfigure C# (CSharp) Метод

AutoConfigure() публичный статический Метод

Automatically starts or stops SVP and madVR based on current video requirements.
public static AutoConfigure ( Media videoStatus ) : void
videoStatus DataAccess.Media The media containing performance status information.
Результат void
        public static void AutoConfigure(Media videoStatus) {
            // If no status information is supplied, create default object with default values of 'false'.
            if (videoStatus == null)
                videoStatus = new Media();

            IsSvpEnabled = Settings.SavedFile.EnableSvp && !videoStatus.DisableSvp;
            IsMadvrEnabled = Settings.SavedFile.EnableMadVR && !videoStatus.DisableMadVr;
        }

Usage Example

        public async Task ReplayLastAsync()
        {
            if (!player.IsAvailable)
            {
                return;
            }

            if (playedVideos.Count > 1)
            {
                Media LastVideo = PlayerAccess.GetVideoById(playedVideos[playedVideos.Count - 2]);
                if (LastVideo.MediaId != player.CurrentVideo.MediaId)
                {
                    playedVideos.RemoveAt(playedVideos.Count - 1);
                    if (nextVideo != null)
                    {
                        CancelNextDownload(nextVideo);
                    }
                    nextVideo = player.CurrentVideo;

                    // Enable/Disable SVP if necessary.
                    MpcConfigBusiness.AutoConfigure(nextVideo);

                    // Auto-pitch to 432hz
                    bool EnableAutoPitch = AutoPitchBusiness.AppyAutoPitch(LastVideo);

                    await player.PlayVideoAsync(LastVideo, EnableAutoPitch).ConfigureAwait(false);

                    Application.Current.Dispatcher.Invoke(() => PlaylistChanged?.Invoke(this, new EventArgs()));
                }
            }
        }
All Usage Examples Of Business.MpcConfigBusiness::AutoConfigure