misc
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
5.4.8.2 Beta (not yet released)
|
5.4.8.2 Beta (not yet released)
|
||||||
============
|
============
|
||||||
|
|
||||||
|
- CLI --shuffle issue fix
|
||||||
|
|
||||||
|
|
||||||
5.4.8.1 Beta
|
5.4.8.1 Beta
|
||||||
|
|||||||
@@ -45,7 +45,11 @@ namespace mpvnet
|
|||||||
if (Padding > 0 && value.Length < Padding)
|
if (Padding > 0 && value.Length < Padding)
|
||||||
value = value.PadRight(Padding);
|
value = value.PadRight(Padding);
|
||||||
|
|
||||||
Console.WriteLine(value);
|
if (color == ConsoleColor.Red)
|
||||||
|
Console.Error.WriteLine(value);
|
||||||
|
else
|
||||||
|
Console.WriteLine(value);
|
||||||
|
|
||||||
Console.ResetColor();
|
Console.ResetColor();
|
||||||
Trace.WriteLine(obj);
|
Trace.WriteLine(obj);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ namespace mpvnet
|
|||||||
public List<KeyValuePair<string, ScriptBlock>> EventHandlers = new List<KeyValuePair<string, ScriptBlock>>();
|
public List<KeyValuePair<string, ScriptBlock>> EventHandlers = new List<KeyValuePair<string, ScriptBlock>>();
|
||||||
public List<KeyValuePair<string, ScriptBlock>> PropChangedHandlers = new List<KeyValuePair<string, ScriptBlock>>();
|
public List<KeyValuePair<string, ScriptBlock>> PropChangedHandlers = new List<KeyValuePair<string, ScriptBlock>>();
|
||||||
|
|
||||||
public static List<PowerShell> Instances { get; } = new List<PowerShell>();
|
public static List<PowerShell> References { get; } = new List<PowerShell>();
|
||||||
|
|
||||||
public object Invoke() => Invoke(null, null);
|
public object Invoke() => Invoke(null, null);
|
||||||
|
|
||||||
|
|||||||
@@ -164,7 +164,7 @@
|
|||||||
h script-message mpv.net show-history #menu: Tools > Show History
|
h script-message mpv.net show-history #menu: Tools > Show History
|
||||||
l ab-loop #menu: Tools > Set/clear A-B loop points
|
l ab-loop #menu: Tools > Set/clear A-B loop points
|
||||||
L cycle-values loop-file "inf" "no" #menu: Tools > Toggle infinite file looping
|
L cycle-values loop-file "inf" "no" #menu: Tools > Toggle infinite file looping
|
||||||
_ cycle shuffle #menu: Tools > Toggle Shuffle
|
_ playlist-shuffle #menu: Tools > Shuffle Playlist
|
||||||
Ctrl+h cycle-values hwdec "auto" "no" #menu: Tools > Toggle Hardware Decoding
|
Ctrl+h cycle-values hwdec "auto" "no" #menu: Tools > Toggle Hardware Decoding
|
||||||
_ script-message mpv.net show-setup-dialog #menu: Tools > Setup...
|
_ script-message mpv.net show-setup-dialog #menu: Tools > Setup...
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ osd-duration = 2000
|
|||||||
osd-playing-msg = '${filename}'
|
osd-playing-msg = '${filename}'
|
||||||
script-opts = osc-scalewindowed=1.5,osc-hidetimeout=2000,console-scale=1
|
script-opts = osc-scalewindowed=1.5,osc-hidetimeout=2000,console-scale=1
|
||||||
screenshot-directory = '~~desktop/'
|
screenshot-directory = '~~desktop/'
|
||||||
hwdec = yes
|
|
||||||
|
|
||||||
[protocol.https]
|
[protocol.https]
|
||||||
osd-playing-msg = '${media-title}'
|
osd-playing-msg = '${media-title}'
|
||||||
|
|||||||
@@ -3,16 +3,19 @@ $ErrorActionPreference = 'Stop'
|
|||||||
|
|
||||||
if ($args.Length -ne 2) {
|
if ($args.Length -ne 2) {
|
||||||
Write-Host 'Invalid arguments' -ForegroundColor Red
|
Write-Host 'Invalid arguments' -ForegroundColor Red
|
||||||
|
pause
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
if (-not (Get-Command curl.exe)) {
|
if (-not (Get-Command curl.exe)) {
|
||||||
Write-Host 'Error using curl.exe' -ForegroundColor Red
|
Write-Host 'Error using curl.exe' -ForegroundColor Red
|
||||||
|
pause
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($PSVersionTable.PSVersion.Major -lt 5) {
|
if ($PSVersionTable.PSVersion.Major -lt 5) {
|
||||||
Write-Host 'PowerShell 5.1 not found' -ForegroundColor Red
|
Write-Host 'PowerShell 5.1 not found' -ForegroundColor Red
|
||||||
|
pause
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -582,15 +582,6 @@ namespace mpvnet
|
|||||||
int d_w = (int)(c_h * aspect - c_w);
|
int d_w = (int)(c_h * aspect - c_w);
|
||||||
int d_h = (int)(c_w / aspect - c_h);
|
int d_h = (int)(c_w / aspect - c_h);
|
||||||
|
|
||||||
Debug.WriteLine(d_w);
|
|
||||||
Debug.WriteLine(d_h);
|
|
||||||
|
|
||||||
int d_w2 = (int)(c_h * aspect - c_w);
|
|
||||||
int d_h2 = (int)(c_w / aspect - c_h);
|
|
||||||
|
|
||||||
Debug.WriteLine(d_w2);
|
|
||||||
Debug.WriteLine(d_h2);
|
|
||||||
|
|
||||||
int[] d_corners = { d_w, d_h, -d_w, -d_h };
|
int[] d_corners = { d_w, d_h, -d_w, -d_h };
|
||||||
int[] corners = { rc.Left, rc.Top, rc.Right, rc.Bottom };
|
int[] corners = { rc.Left, rc.Top, rc.Right, rc.Bottom };
|
||||||
int corner = NativeHelp.GetResizeBorder(m.WParam.ToInt32());
|
int corner = NativeHelp.GetResizeBorder(m.WParam.ToInt32());
|
||||||
|
|||||||
@@ -237,8 +237,7 @@ public class ToolStripRendererEx : ToolStripSystemRenderer
|
|||||||
|
|
||||||
RectangleF rectF = new RectangleF(rect.X + rect.Height / 2f - ellipseWidth / 2f,
|
RectangleF rectF = new RectangleF(rect.X + rect.Height / 2f - ellipseWidth / 2f,
|
||||||
rect.Y + rect.Height / 2f - ellipseWidth / 2f,
|
rect.Y + rect.Height / 2f - ellipseWidth / 2f,
|
||||||
ellipseWidth,
|
ellipseWidth, ellipseWidth);
|
||||||
ellipseWidth);
|
|
||||||
|
|
||||||
using (Brush brush = new SolidBrush(ForegroundColor))
|
using (Brush brush = new SolidBrush(ForegroundColor))
|
||||||
e.Graphics.FillEllipse(brush, rectF);
|
e.Graphics.FillEllipse(brush, rectF);
|
||||||
|
|||||||
@@ -366,8 +366,8 @@ namespace mpvnet
|
|||||||
ps.Module = Path.GetFileName(file);
|
ps.Module = Path.GetFileName(file);
|
||||||
ps.Print = true;
|
ps.Print = true;
|
||||||
|
|
||||||
lock (PowerShell.Instances)
|
lock (PowerShell.References)
|
||||||
PowerShell.Instances.Add(ps);
|
PowerShell.References.Add(ps);
|
||||||
|
|
||||||
ps.Invoke();
|
ps.Invoke();
|
||||||
}
|
}
|
||||||
@@ -874,6 +874,7 @@ namespace mpvnet
|
|||||||
|
|
||||||
public void ProcessCommandLine(bool preInit)
|
public void ProcessCommandLine(bool preInit)
|
||||||
{
|
{
|
||||||
|
bool shuffle = false;
|
||||||
var args = Environment.GetCommandLineArgs().Skip(1);
|
var args = Environment.GetCommandLineArgs().Skip(1);
|
||||||
|
|
||||||
string[] preInitProperties = { "input-terminal", "terminal", "input-file", "config",
|
string[] preInitProperties = { "input-terminal", "terminal", "input-file", "config",
|
||||||
@@ -919,7 +920,12 @@ namespace mpvnet
|
|||||||
core.ProcessProperty(left, right);
|
core.ProcessProperty(left, right);
|
||||||
|
|
||||||
if (!App.ProcessProperty(left, right))
|
if (!App.ProcessProperty(left, right))
|
||||||
|
{
|
||||||
set_property_string(left, right, true);
|
set_property_string(left, right, true);
|
||||||
|
|
||||||
|
if (left == "shuffle" && right == "yes")
|
||||||
|
shuffle = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -935,16 +941,19 @@ namespace mpvnet
|
|||||||
List<string> files = new List<string>();
|
List<string> files = new List<string>();
|
||||||
|
|
||||||
foreach (string i in args)
|
foreach (string i in args)
|
||||||
{
|
|
||||||
if (!i.StartsWith("--") && (i == "-" || i.Contains("://") ||
|
if (!i.StartsWith("--") && (i == "-" || i.Contains("://") ||
|
||||||
i.Contains(":\\") || i.StartsWith("\\\\") || File.Exists(i)))
|
i.Contains(":\\") || i.StartsWith("\\\\") || File.Exists(i)))
|
||||||
{
|
|
||||||
files.Add(i);
|
files.Add(i);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LoadFiles(files.ToArray(), !App.Queue, Control.ModifierKeys.HasFlag(Keys.Control) || App.Queue);
|
LoadFiles(files.ToArray(), !App.Queue, Control.ModifierKeys.HasFlag(Keys.Control) || App.Queue);
|
||||||
|
|
||||||
|
if (shuffle)
|
||||||
|
{
|
||||||
|
core.command("playlist-shuffle");
|
||||||
|
set_property_int("playlist-pos", 0);
|
||||||
|
}
|
||||||
|
|
||||||
if (files.Count == 0 || files[0].Contains("://"))
|
if (files.Count == 0 || files[0].Contains("://"))
|
||||||
{
|
{
|
||||||
VideoSizeChanged?.Invoke();
|
VideoSizeChanged?.Invoke();
|
||||||
|
|||||||
Reference in New Issue
Block a user