mpv.net attaches now to the parent terminal
This commit is contained in:
@@ -17,6 +17,10 @@
|
||||
to fail if it was waiting for a drive to wakeup
|
||||
- a new JavaScript was included to show the playlist with a smaller font size,
|
||||
the script is located at startup/scripts
|
||||
- mpv.net attaches now to the parent terminal, when started from
|
||||
a PowerShell terminal using the --terminal switch mpvnet gives
|
||||
status messages on the console and debug messages useful to write
|
||||
JavaScript and Lua scripts
|
||||
|
||||
### 4.7.7
|
||||
|
||||
|
||||
@@ -64,7 +64,9 @@ namespace mpvnet
|
||||
return;
|
||||
}
|
||||
|
||||
Native.AttachConsole(-1 /*ATTACH_PARENT_PROCESS*/);
|
||||
Application.Run(new MainForm());
|
||||
Native.FreeConsole();
|
||||
mutex.Dispose();
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@@ -6,6 +6,12 @@ namespace mpvnet
|
||||
{
|
||||
public class Native
|
||||
{
|
||||
[DllImport("kernel32.dll")]
|
||||
public static extern bool AttachConsole(int dwProcessId);
|
||||
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
public static extern bool FreeConsole();
|
||||
|
||||
[DllImport("kernel32.dll")]
|
||||
public static extern IntPtr LoadLibrary(string dllToLoad);
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@
|
||||
Ctrl+t set ontop yes #menu: View > On Top > Enable
|
||||
Ctrl+T set ontop no #menu: View > On Top > Disable
|
||||
b cycle border #menu: View > Toggle Border
|
||||
i script-message mpv.net show-info #menu: View > File Info
|
||||
i script-message mpv.net show-info #menu: View > File/Stream Info
|
||||
t script-binding stats/display-stats #menu: View > Show Statistics
|
||||
T script-binding stats/display-stats-toggle #menu: View > Toggle Statistics
|
||||
Del script-binding osc/visibility #menu: View > Toggle OSC Visibility
|
||||
@@ -191,3 +191,4 @@
|
||||
Ctrl+Wheel_Down no-osd seek -7
|
||||
MBTN_Left_DBL cycle fullscreen
|
||||
KP_Enter cycle fullscreen
|
||||
MBTN_Left ignore
|
||||
@@ -598,7 +598,7 @@ namespace mpvnet
|
||||
foreach (string url in App.UrlWhitelist)
|
||||
{
|
||||
if (clipboard.Contains("://") && ! clipboard.Contains("\n") &&
|
||||
! clipboard.Contains(" ") && clipboard.Contains(url.ToLower()) &&
|
||||
! clipboard.Contains(" ") && clipboard.Contains(url.ToLower().Trim()) &&
|
||||
RegHelp.GetString(App.RegPath, "LastURL") != clipboard && Visible)
|
||||
{
|
||||
RegHelp.SetObject(App.RegPath, "LastURL", clipboard);
|
||||
|
||||
@@ -554,14 +554,6 @@ namespace mpvnet
|
||||
}
|
||||
}
|
||||
|
||||
Load(files.ToArray(), App.ProcessInstance != "queue", Control.ModifierKeys.HasFlag(Keys.Control));
|
||||
|
||||
if (files.Count == 0 || files[0].Contains("://"))
|
||||
{
|
||||
VideoSizeAutoResetEvent.Set();
|
||||
VideoSizeChanged?.Invoke();
|
||||
}
|
||||
|
||||
foreach (string i in args)
|
||||
{
|
||||
if (i.StartsWith("--"))
|
||||
@@ -583,6 +575,14 @@ namespace mpvnet
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Load(files.ToArray(), App.ProcessInstance != "queue", Control.ModifierKeys.HasFlag(Keys.Control));
|
||||
|
||||
if (files.Count == 0 || files[0].Contains("://"))
|
||||
{
|
||||
VideoSizeAutoResetEvent.Set();
|
||||
VideoSizeChanged?.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
public static DateTime LastLoad;
|
||||
|
||||
Reference in New Issue
Block a user