This commit is contained in:
stax76
2025-10-04 15:07:56 +02:00
parent cc1e4bc9f8
commit b1fccbf175
5 changed files with 6 additions and 42 deletions

View File

@@ -1,6 +1,7 @@
# v7.1.1.4 Beta (2025-09-12) # v7.1.1.4 Beta (2025-09-12)
- Fix --script-opt not working.
- The mpv.net manual was updated. - The mpv.net manual was updated.
- The Turkish translation was updated. A Bulgarian translation was added. - The Turkish translation was updated. A Bulgarian translation was added.
Thanks to the translators! Thanks to the translators!

View File

@@ -55,8 +55,6 @@ public class GuiCommand
["show-profiles"] = args => Msg.ShowInfo(Player.GetProfiles()), ["show-profiles"] = args => Msg.ShowInfo(Player.GetProfiles()),
["show-properties"] = args => Player.Command("script-binding select/show-properties"), ["show-properties"] = args => Player.Command("script-binding select/show-properties"),
["show-protocols"] = args => ShowProtocols(), ["show-protocols"] = args => ShowProtocols(),
["show-recent-in-command-palette"] = args => ShowRecentFilesInCommandPalette(),
["stream-quality"] = args => StreamQuality(),
["window-scale"] = args => WindowScaleNet?.Invoke(float.Parse(args[0], CultureInfo.InvariantCulture)), ["window-scale"] = args => WindowScaleNet?.Invoke(float.Parse(args[0], CultureInfo.InvariantCulture)),
@@ -274,42 +272,6 @@ public class GuiCommand
catch { } catch { }
} }
void StreamQuality()
{
int version = Player.GetPropertyInt("user-data/command-palette/version");
if (version >= 2)
Player.Command("script-message-to command_palette show-command-palette \"Stream Quality\"");
else
{
var r = Msg.ShowQuestion("The Stream Quality feature requires the command palette to be installed." + BR2 +
"Would you like to install the command palette now?");
if (r == MessageBoxResult.OK)
Player.Command("script-message-to mpvnet install-command-palette");
}
}
void ShowRecentFilesInCommandPalette()
{
Obj o = new();
o.title = "Recent Files";
o.selected_index = 0;
var items = new List<Item>();
foreach (string file in App.Settings.RecentFiles)
{
items.Add(new Item() { title = Path.GetFileName(file),
value = ["loadfile", file],
hint = file});
}
o.items = items.ToArray();
string json = JsonSerializer.Serialize(o);
Player.CommandV("script-message", "show-command-palette-json", json);
}
class Obj class Obj
{ {
public string title { get; set; } = ""; public string title { get; set; } = "";

View File

@@ -6,9 +6,9 @@ public class CommandLine
static List<StringPair>? _arguments; static List<StringPair>? _arguments;
static string[] _preInitProperties { get; } = { static string[] _preInitProperties { get; } = {
"input-terminal", "terminal", "input-file", "config", "o", "input-terminal", "terminal", "input-file", "config", "o", "config-dir", "input-conf",
"config-dir", "input-conf", "load-scripts", "scripts", "player-operation-mode", "load-scripts", "scripts", "script-opts", "player-operation-mode", "idle", "log-file",
"idle", "log-file", "msg-color", "dump-stats", "msg-level", "really-quiet" }; "msg-color", "dump-stats", "msg-level", "really-quiet" };
public static List<StringPair> Arguments public static List<StringPair> Arguments
{ {
@@ -46,6 +46,7 @@ public class CommandLine
switch (left) switch (left)
{ {
case "script": left = "scripts"; break; case "script": left = "scripts"; break;
case "script-opt": left = "script-opts"; break;
case "audio-file": left = "audio-files"; break; case "audio-file": left = "audio-files"; break;
case "sub-file": left = "sub-files"; break; case "sub-file": left = "sub-files"; break;
case "external-file": left = "external-files"; break; case "external-file": left = "external-files"; break;

View File

@@ -159,7 +159,7 @@ public static class InputHelp
Add(b, new (_("View"), "-")); Add(b, new (_("View"), "-"));
Add(b, new (_("View") + " > " + _("More"), _("Show Console"), "script-binding console/enable", "`")); Add(b, new (_("View") + " > " + _("More"), _("Show Console"), "script-binding console/enable", "`"));
Add(b, new (_("View") + " > " + _("More"), _("Show Commands"), "script-message-to mpvnet show-commands", "F2")); Add(b, new (_("View") + " > " + _("More"), _("Show Commands"), "script-message-to mpvnet show-commands", "F3"));
Add(b, new (_("View") + " > " + _("More"), _("Show Bindings"), "script-message-to mpvnet show-bindings")); Add(b, new (_("View") + " > " + _("More"), _("Show Bindings"), "script-message-to mpvnet show-bindings"));
Add(b, new (_("View") + " > " + _("More"), _("Show Keys"), "script-message-to mpvnet show-keys", "Alt+k")); Add(b, new (_("View") + " > " + _("More"), _("Show Keys"), "script-message-to mpvnet show-keys", "Alt+k"));
Add(b, new (_("View") + " > " + _("More"), _("Show Protocols"), "script-message-to mpvnet show-protocols", "Alt+p")); Add(b, new (_("View") + " > " + _("More"), _("Show Protocols"), "script-message-to mpvnet show-protocols", "Alt+p"));