private static void AfterLoadSuccess(PlayerScreen player) { // Try to load first frame and other initializations. int postLoadResult = player.view.PostLoadProcess(); player.AfterLoad(); switch (postLoadResult) { case 0: // Loading succeeded. We already switched to analysis mode if possible. player.view.EnableDisableActions(true); break; case -1: { // Loading the first frame failed. player.view.ResetToEmptyState(); DisplayErrorAndDisable(player, ScreenManagerLang.LoadMovie_InconsistantMovieError); break; } case -2: { // Loading first frame showed that the file is not supported after all. player.view.ResetToEmptyState(); DisplayErrorAndDisable(player, ScreenManagerLang.LoadMovie_InconsistantMovieError); break; } default: break; } }
private static void AfterLoadSuccess(PlayerScreen player) { // Try to load first frame and other initializations. int postLoadResult = player.view.PostLoadProcess(); player.AfterLoad(); // Note: player.StartReplayWatcher will update the launch descriptor with the current value of the speed slider. // This is to support carrying over user defined speed when swapping with the latest video. // In the case of the initial load, we need to wait until here to call this function so the view has had time // to update the slider with the value set in the descriptor (when using a special default replay speed). // Otherwise we would always pick the default value from the view. if (player.view.LaunchDescription != null && player.view.LaunchDescription.IsReplayWatcher) { player.StartReplayWatcher(player.view.LaunchDescription, player.FilePath); } else { player.StopReplayWatcher(); } switch (postLoadResult) { case 0: // Loading succeeded. We already switched to analysis mode if possible. player.view.EnableDisableActions(true); break; case -1: { // Loading the first frame failed. player.view.ResetToEmptyState(); DisplayErrorAndDisable(player, ScreenManagerLang.LoadMovie_InconsistantMovieError); break; } case -2: { // Loading first frame showed that the file is not supported after all. player.view.ResetToEmptyState(); DisplayErrorAndDisable(player, ScreenManagerLang.LoadMovie_InconsistantMovieError); break; } default: break; } }