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
|
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,
|
- a new JavaScript was included to show the playlist with a smaller font size,
|
||||||
the script is located at startup/scripts
|
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
|
### 4.7.7
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,9 @@ namespace mpvnet
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Native.AttachConsole(-1 /*ATTACH_PARENT_PROCESS*/);
|
||||||
Application.Run(new MainForm());
|
Application.Run(new MainForm());
|
||||||
|
Native.FreeConsole();
|
||||||
mutex.Dispose();
|
mutex.Dispose();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|||||||
@@ -6,6 +6,12 @@ namespace mpvnet
|
|||||||
{
|
{
|
||||||
public class Native
|
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")]
|
[DllImport("kernel32.dll")]
|
||||||
public static extern IntPtr LoadLibrary(string dllToLoad);
|
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 yes #menu: View > On Top > Enable
|
||||||
Ctrl+T set ontop no #menu: View > On Top > Disable
|
Ctrl+T set ontop no #menu: View > On Top > Disable
|
||||||
b cycle border #menu: View > Toggle Border
|
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 #menu: View > Show Statistics
|
||||||
T script-binding stats/display-stats-toggle #menu: View > Toggle Statistics
|
T script-binding stats/display-stats-toggle #menu: View > Toggle Statistics
|
||||||
Del script-binding osc/visibility #menu: View > Toggle OSC Visibility
|
Del script-binding osc/visibility #menu: View > Toggle OSC Visibility
|
||||||
@@ -190,4 +190,5 @@
|
|||||||
Ctrl+Wheel_Up no-osd seek 7
|
Ctrl+Wheel_Up no-osd seek 7
|
||||||
Ctrl+Wheel_Down no-osd seek -7
|
Ctrl+Wheel_Down no-osd seek -7
|
||||||
MBTN_Left_DBL cycle fullscreen
|
MBTN_Left_DBL cycle fullscreen
|
||||||
KP_Enter cycle fullscreen
|
KP_Enter cycle fullscreen
|
||||||
|
MBTN_Left ignore
|
||||||
@@ -598,7 +598,7 @@ namespace mpvnet
|
|||||||
foreach (string url in App.UrlWhitelist)
|
foreach (string url in App.UrlWhitelist)
|
||||||
{
|
{
|
||||||
if (clipboard.Contains("://") && ! clipboard.Contains("\n") &&
|
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.GetString(App.RegPath, "LastURL") != clipboard && Visible)
|
||||||
{
|
{
|
||||||
RegHelp.SetObject(App.RegPath, "LastURL", clipboard);
|
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)
|
foreach (string i in args)
|
||||||
{
|
{
|
||||||
if (i.StartsWith("--"))
|
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;
|
public static DateTime LastLoad;
|
||||||
|
|||||||
Reference in New Issue
Block a user