5.4.5.1 Beta

This commit is contained in:
Frank Skare
2020-05-03 11:10:56 +02:00
parent e1bd44cd00
commit 28045ad33e
46 changed files with 1090 additions and 829 deletions

View File

@@ -0,0 +1,45 @@
// Pauses playback when window is minimized and resumes afterwards.
using System;
using System.Windows.Forms;
using mpvnet;
class Script
{
MainForm Form;
Core core;
bool WasPlaying;
bool WasPaused;
public Script()
{
core = Core.core;
Form = MainForm.Instance;
Form.Resize += Form_Resize;
}
private void Form_Resize(object sender, EventArgs e)
{
if (Form.WindowState == FormWindowState.Minimized)
{
WasPlaying = !core.get_property_bool("pause");
if (WasPlaying)
{
core.set_property_bool("pause", true, true);
WasPaused = true;
}
}
else
{
if (WasPaused)
{
core.set_property_bool("pause", false, true);
WasPaused = false;
}
}
}
}