This commit is contained in:
Frank Skare
2019-02-27 21:18:12 +01:00
parent 0f68c0cd3e
commit 714eb7c9fa
6 changed files with 99 additions and 60 deletions

View File

@@ -24,28 +24,24 @@ namespace mpvnet
public MainForm()
{
InitializeComponent();
try
{
Application.ThreadException += Application_ThreadException;
InitializeComponent();
SetFormPosSize();
Instance = this;
Hwnd = Handle;
mpv.Init();
mpv.ObserveBoolProp("fullscreen", MpvChangeFullscreen);
mpv.AfterShutdown += Mpv_AfterShutdown;
mpv.VideoSizeChanged += Mpv_VideoSizeChanged;
mpv.PlaybackRestart += mpv_PlaybackRestart;
ChangeFullscreen((mpv.mpvConv.ContainsKey("fullscreen") && mpv.mpvConv["fullscreen"] == "yes") || (mpv.mpvConv.ContainsKey("fs") && mpv.mpvConv["fs"] == "yes"));
ToolStripManager.Renderer = new ToolStripRendererEx(ToolStripRenderModeEx.SystemDefault);
CMS = new ContextMenuStripEx(components);
CMS.Opened += CMS_Opened;
ContextMenuStrip = CMS;
BuildMenu();
}
catch (Exception e)
catch (Exception ex)
{
HandleException(e);
HandleException(ex);
}
}
@@ -298,5 +294,19 @@ namespace mpvnet
CursorHelp.Hide();
}
}
private void MainForm_Load(object sender, EventArgs ea)
{
mpv.Init();
mpv.ObserveBoolProp("fullscreen", MpvChangeFullscreen);
mpv.AfterShutdown += Mpv_AfterShutdown;
mpv.VideoSizeChanged += Mpv_VideoSizeChanged;
mpv.PlaybackRestart += mpv_PlaybackRestart;
}
private void MainForm_Activated(object sender, EventArgs ea)
{
}
}
}