Skip to content

Instantly share code, notes, and snippets.

Created December 9, 2016 22:29
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save anonymous/3c0fa2cd9ed1f49cbca32354c0650841 to your computer and use it in GitHub Desktop.
private void PlayVideoWithMpc(ScenePlayOptions scenePlayOptions)
{
VideoPlayerProcess = new Process
{
StartInfo =
{
FileName = SettingsVm.Instance.MpcPath,
Arguments = "\"" + scenePlayOptions.SceneVm.Path + "\""
}
};
if (scenePlayOptions.Enqueued)
VideoPlayerProcess.StartInfo.Arguments += " /add";
else if (!Properties.Settings.Default.AllowOnlyOneInstance)
VideoPlayerProcess.StartInfo.Arguments += " /new";
if (Properties.Settings.Default.StartFullScreen)
VideoPlayerProcess.StartInfo.Arguments += " /fullscreen";
if (scenePlayOptions.StartTime > 0)
VideoPlayerProcess.StartInfo.Arguments += " /play /start " + Convert.ToInt32(scenePlayOptions.StartTime);
VideoPlayerProcess.Start();
VideoPlayerProcess.WaitForInputIdle();
SetForegroundWindow(new WindowInteropHelper(Application.Current.MainWindow).Handle);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment