Closed motey closed 10 years ago
Hatte halt gehofft, daß die MP-Api eine Methode anbietet um einen shutdown-Befehl auszulösen. Schaut aber nicht so aus, nachdem ich mich mal ein bischen durch den Code gewühlt habe. Plan B war jetzt den Code von http://www.team-mediaportal.com/extensions/other/powerscheduler zu durchwühlen, weil das Plugin, wenn ich es recht in Erinnerung habe, anbietet MP zu schließen. Leider hab ich auf die schnelle den Quellcode nicht gefunden.
I think a simple process will do it
found this method in myEmulator2 http://myemulators2.googlecode.com/svn/trunk/Launcher/Executor.cs:
/* The following code was referenced from the Moving Pictures plugin */
static void suspendMP(bool suspend)
{
if (suspend) //suspend and hide MediaPortal
{
Logger.LogDebug("Suspending MediaPortal...");
// disable mediaportal input devices
InputDevices.Stop();
// hide mediaportal and suspend rendering to save resources for the pc game
GUIGraphicsContext.BlankScreen = true;
GUIGraphicsContext.form.Hide();
GUIGraphicsContext.CurrentState = GUIGraphicsContext.State.SUSPENDING;
}
else //resume Mediaportal
{
Logger.LogDebug("Resuming MediaPortal...");
InputDevices.Init();
// Resume Mediaportal rendering
GUIGraphicsContext.BlankScreen = false;
GUIGraphicsContext.form.Show();
GUIGraphicsContext.ResetLastActivity();
GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_GETFOCUS, 0, 0, 0, 0, 0, null);
GUIWindowManager.SendThreadMessage(msg);
GUIGraphicsContext.CurrentState = GUIGraphicsContext.State.RUNNING;
}
}
We could implement the Option to supsend MediaPortal instead of Killing it. looks very simple
Just commited the suspend / resume. It works if you exit Steam but not if you choose "exit to desktop" -> in that case steam is still running in tray -> MP is not resumed!
I think we have to fix this or at least make it optional.
Also did the configuration part yesterday. Just have to test it and will commit it somewhen this week...
Option to kill MP when steam starts (maybe increases Gaming perfomance) (Add tip to link MP in Steam to get back to MP)