Compare commits

...

6 Commits

Author SHA1 Message Date
stax76
ace7566c2a v7.1.1.3 Beta 2024-10-20 09:15:34 +02:00
stax76
0b646cedb5 New command Video > Stream Quality (Alt+q) 2024-10-14 15:18:11 +02:00
stax76
a0d2fb6a4e command palette support 2024-10-13 14:18:04 +02:00
stax76
59a556794f support for autocreate-playlist, video-exts, audio-exts, image-exts 2024-10-12 21:50:46 +02:00
stax76
cca474a5a5 Merge pull request #710 from emmanuel-ferdman/main
update manual guide reference
2024-10-10 19:25:14 +02:00
Emmanuel Ferdman
ae05b997c7 update manual guide reference
Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
2024-10-10 06:52:50 -07:00
10 changed files with 404 additions and 275 deletions

View File

@@ -1,4 +1,20 @@
# v7.1.1.3 Beta (2024-10-20)
- Support for autocreate-playlist, video-exts, audio-exts, image-exts.
Windows 7 support should still work, but needs auto-load-folder to be enabled
or autoload.lua.
- The command palette user script is installable from the context menu under
`Settings > Setup > Install Command Palette`. The command palette features
are shown in the menu under 'View > Command Palette'.
- New command to select the stream quality `Video > Stream Quality (Alt+q)`,
this calls the Stream Quality feature of the command palette.
- The Command Palette interacts with mpv.net to enable the Recent Files
feature in the Command Palette.
- New zhongfly libmpv x64 build.
- New Andarwinux libmpv ARM64 build.
# v7.1.1.2 Beta (2024-10-10)
- Polish translation fixed. German, Turkish and Japanese translation updated.

View File

@@ -22,7 +22,6 @@ Table of contents
* [Extensions](#extensions)
* [Color Theme](#color-theme)
* [Advanced Features](#advanced-features)
* [Hidden Features](#hidden-features)
* [Differences compared to mpv](#differences-compared-to-mpv)
* [Environment Variables](#environment-variables)
* [user-data](#user-data)
@@ -319,6 +318,9 @@ Shows available profiles with a message box.
### show-text \<text\> \<duration\> \<font-size\>
Shows a OSD message with given text, duration and font size.
### stream-quality
Shows a menu to select the stream quality.
### window-scale \<factor\>
Works similar as the [window-scale](https://mpv.io/manual/master/#command-interface-window-scale) mpv property.
@@ -448,18 +450,6 @@ Amount of recent files to be remembered. Default: 15
Usage of the media info library instead of mpv to access media information. Default: yes (mpv.net specific option)
#### --video-file-extensions=\<string\>
Video file extensions used to create file associations and used by the auto-load-folder feature.
#### --audio-file-extensions=\<string\>
Audio file extensions used to create file associations and used by the auto-load-folder feature.
#### --image-file-extensions=\<string\>
Image file extensions used to create file associations and used by the auto-load-folder feature.
#### --debug-mode=\<yes|no\>
Enable this only when a developer asks for it. Default: no
@@ -593,14 +583,6 @@ demuxer-lavf-format = vapoursynth
Python and VapourSynth must be in the path environment variable.
Hidden Features
---------------
Selecting multiple files in File Explorer and pressing enter will
open the files in mpv.net. Explorer restricts this to maximum 15 files
and the order will be random.
Differences compared to mpv
---------------------------
@@ -1420,7 +1402,7 @@ Shows the [mpv.net web site](https://github.com/mpvnet-player/mpv.net).
### Help > Show mpv.net manual
Shows the [mpv.net manual](https://github.com/mpvnet-player/mpv.net/blob/main/manual.md).
Shows the [mpv.net manual](https://github.com/mpvnet-player/mpv.net/blob/main/docs/manual.md).
### Help > About mpv.net

View File

@@ -32,6 +32,7 @@ public class GuiCommand
{
["add-to-path"] = args => AddToPath(),
["edit-conf-file"] = EditCongFile,
["install-command-palette"] = args => InstallCommandPalette(),
["load-audio"] = LoadAudio,
["load-sub"] = LoadSubtitle,
["move-window"] = args => MoveWindow?.Invoke(args[0]),
@@ -55,6 +56,8 @@ public class GuiCommand
["show-profiles"] = args => Msg.ShowInfo(Player.GetProfiles()),
["show-properties"] = args => Player.Command("script-binding select/show-properties"),
["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)),
@@ -236,9 +239,9 @@ public class GuiCommand
switch (perceivedType)
{
case "video": extensions = FileTypes.Video; break;
case "audio": extensions = FileTypes.Audio; break;
case "image": extensions = FileTypes.Image; break;
case "video": extensions = FileTypes.GetVideoExts(); break;
case "audio": extensions = FileTypes.GetAudioExts(); break;
case "image": extensions = FileTypes.GetImgExts(); break;
}
try
@@ -267,6 +270,72 @@ public class GuiCommand
catch { }
}
void InstallCommandPalette()
{
if (Msg.ShowQuestion("Install command palette?") != MessageBoxResult.OK)
return;
try
{
Environment.SetEnvironmentVariable("MPVNET_HOME", Player.ConfigFolder);
using Process proc = new Process();
proc.StartInfo.FileName = "powershell";
proc.StartInfo.Arguments = "-executionpolicy bypass -nologo -noexit -noprofile -command \"irm https://raw.githubusercontent.com/stax76/mpv-scripts/refs/heads/main/powershell/command_palette_installer.ps1 | iex\"";
proc.Start();
}
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 = new string []{ "loadfile", file },
hint = file});
o.items = items.ToArray();
string json = JsonSerializer.Serialize(o);
Player.CommandV("script-message", "show-command-palette-json", json);
}
class Obj
{
public string title { get; set; } = "";
public int selected_index { get; set; } = 0;
public Item[] items { get; set; } = Array.Empty<Item>();
}
class Item
{
public string[] value { get; set; } = Array.Empty<string>();
public string title { get; set; } = "";
public string hint { get; set; } = "";
}
void ShowMediaInfo(IList<string> args)
{
if (Player.PlaylistPos == -1)
@@ -284,13 +353,13 @@ public class GuiCommand
if (File.Exists(path) && osd)
{
if (FileTypes.Audio.Contains(path.Ext()))
if (FileTypes.IsAudio(path.Ext()))
{
text = Player.GetPropertyOsdString("filtered-metadata");
Player.CommandV("show-text", text, "5000");
return;
}
else if (FileTypes.Image.Contains(path.Ext()))
else if (FileTypes.IsImage(path.Ext()))
{
fileSize = new FileInfo(path).Length;

View File

@@ -11,9 +11,9 @@
<UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>mpv-icon.ico</ApplicationIcon>
<Product>mpv.net</Product>
<FileVersion>7.1.1.2</FileVersion>
<AssemblyVersion>7.1.1.2</AssemblyVersion>
<InformationalVersion>7.1.1.2</InformationalVersion>
<FileVersion>7.1.1.3</FileVersion>
<AssemblyVersion>7.1.1.3</AssemblyVersion>
<InformationalVersion>7.1.1.3</InformationalVersion>
<Nullable>enable</Nullable>
</PropertyGroup>

View File

@@ -21,23 +21,11 @@ default = yes
option = yes
option = no
name = video-file-extensions
file = mpvnet
name = image-exts
file = mpv
directory = General
width = 500
help = Video file extensions used to create file associations and used by the auto-load-folder feature. (mpv.net option)
name = audio-file-extensions
file = mpvnet
directory = General
width = 500
help = Audio file extensions used to create file associations and used by the auto-load-folder feature. (mpv.net option)
name = image-file-extensions
file = mpvnet
directory = General
width = 500
help = Image file extensions used to create file associations and used by the auto-load-folder feature. (mpv.net option)
help = Image file extentions to try to match when using --cover-art-auto, --autocreate-playlist or --directory-filter-types. By mpv.net used to create file associations and used by the auto-load-folder feature. Default: avif,bmp,gif,j2k,jp2,jpeg,jpg,jxl,png,svg,tga,tif,tiff,webp
name = menu-syntax
file = mpvnet
@@ -790,6 +778,12 @@ file = mpv
directory = Video/Screenshot
help = <0-5> Set the filter applied prior to PNG compression. 0 is none, 1 is 'sub', 2 is 'up', 3 is 'average', 4 is 'Paeth', and 5 is 'mixed'. This affects the level of compression that can be achieved. For most images, 'mixed' achieves the best compression ratio, hence it is the default.
name = video-exts
file = mpv
directory = Video
width = 500
help = Video file extentions to try to match when using --autocreate-playlist or --directory-filter-types. By mpv.net used to create file associations and used by the auto-load-folder feature. Default: 3g2,3gp,avi,flv,m2ts,m4v,mj2,mkv,mov,mp4,mpeg,mpg,ogv,rmvb,ts,webm,wmv,y4m
name = volume
file = mpv
directory = Audio
@@ -833,6 +827,12 @@ default = yes
option = yes
option = no
name = audio-exts
file = mpv
directory = Audio
width = 500
help = Audio file extentions to try to match when using --audio-file-auto, --autocreate-playlist or --directory-filter-types. By mpv.net used to create file associations and used by the auto-load-folder feature. Default: aac,ac3,aiff,ape,au,dts,eac3,flac,m4a,mka,mp3,oga,ogg,ogm,opus,thd,wav,wav,wma,wv
name = slang
file = mpv
directory = Subtitle
@@ -1097,10 +1097,19 @@ file = mpv
directory = Playback
help = <N|inf|force|no> Loops playback N times. A value of 1 plays it one time (default), 2 two times, etc. inf means forever. no is the same as 1 and disables looping. If several files are specified on command line, the entire playlist is looped. The force mode is like inf, but does not skip playlist entries which have been marked as failing. This means the player might waste CPU time trying to loop a file that doesn't exist. But it might be useful for playing webradios under very bad network conditions.
name = autocreate-playlist
file = mpv
directory = Playback
help = When opening a local file, act as if the parent directory is opened and create a playlist automatically.\n\nno: Load a single file (mpv default).\n\nFilter: Create a playlist from the parent directory with files matching --directory-filter-types. (mpv.net default)\n\nsame: Create a playlist from the parent directory with files matching the same category as the currently loaded file. One of the *-exts is selected based on the input file and only files with matching extensions are added to the playlist. If the input file itself is not matched to any extension list, the playlist is not autogenerated.
default = filter
option = no
option = filter
option = same
name = auto-load-folder
file = mpvnet
directory = Playback
help = For single files automatically load the entire directory into the playlist. (mpv.net option)
help = For single files automatically load the entire directory into the playlist. (deprecated mpv.net option, autocreate-playlist can be used instead)
default = yes
option = yes
option = no

View File

@@ -131,14 +131,12 @@ public class AppClass
{
switch (name)
{
case "audio-file-extensions": FileTypes.Audio = value.Split(" ,;".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); return true;
case "auto-load-folder": AutoLoadFolder = value == "yes"; return true;
case "autofit-audio": AutofitAudio = value.Trim('%').ToInt(70) / 100f; return true;
case "autofit-image": AutofitImage = value.Trim('%').ToInt(80) / 100f; return true;
case "dark-mode": DarkMode = value; return true;
case "dark-theme": DarkTheme = value.Trim('\'', '"'); return true;
case "debug-mode": DebugMode = value == "yes"; return true;
case "image-file-extensions": FileTypes.Image = value.Split(" ,;".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); return true;
case "language": Language = value; return true;
case "light-theme": LightTheme = value.Trim('\'', '"'); return true;
case "media-info": MediaInfo = value == "yes"; return true;
@@ -152,7 +150,6 @@ public class AppClass
case "remember-volume": RememberVolume = value == "yes"; return true;
case "remember-window-position": RememberWindowPosition = value == "yes"; return true;
case "start-size": StartSize = value; return true;
case "video-file-extensions": FileTypes.Video = value.Split(" ,;".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); return true;
default:
if (writeError)

View File

@@ -5,16 +5,49 @@ namespace MpvNet;
public static class FileTypes
{
public static string[] Video { get; set; } = "mkv mp4 avi mov flv mpg webm wmv ts vob 264 265 asf avc avs dav h264 h265 hevc m2t m2ts m2v m4v mpeg mpv mts vpy y4m".Split(' ');
public static string[] Audio { get; set; } = "mp3 flac m4a mka mp2 ogg opus aac ac3 dts dtshd dtshr dtsma eac3 mpa mpc thd w64 wav".Split(' ');
public static string[] Image { get; set; } = { "jpg", "bmp", "png", "gif", "webp" };
public static string[] Subtitle { get; } = { "srt", "ass", "idx", "sub", "sup", "ttxt", "txt", "ssa", "smi", "mks" };
public static bool IsImage(string extension) => Image.Contains(extension);
public static bool IsAudio(string extension) => Audio.Contains(extension);
public static bool IsVideo(string[] exts, string ext) => exts?.Contains(ext) ?? false;
public static bool IsAudio(string[] exts, string ext) => exts?.Contains(ext) ?? false;
public static bool IsImage(string[] exts, string ext) => exts?.Contains(ext) ?? false;
public static bool IsMedia(string extension) =>
Video.Contains(extension) || Audio.Contains(extension) || Image.Contains(extension);
public static bool IsVideo(string ext) => GetVideoExts().Contains(ext);
public static bool IsAudio(string ext) => GetAudioExts().Contains(ext);
public static bool IsImage(string ext) => GetImgExts().Contains(ext);
public static IEnumerable<string> GetMediaFiles(IEnumerable<string> files) => files.Where(i => IsMedia(i.Ext()));
public static string[] GetVideoExts()
{
string exts = Player.GetPropertyString("video-exts");
if (string.IsNullOrEmpty(exts))
return "mkv mp4 avi mov flv mpg webm wmv ts vob 264 265 asf avc avs dav h264 h265 hevc m2t m2ts m2v m4v mpeg mpv mts vpy y4m".Split(' ');
return exts.Split(" ,;".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
}
public static string[] GetAudioExts()
{
string exts = Player.GetPropertyString("audio-exts");
if (string.IsNullOrEmpty(exts))
return "mp3 flac m4a mka mp2 ogg opus aac ac3 dts dtshd dtshr dtsma eac3 mpa mpc thd w64 wav".Split(' ');
return exts.Split(" ,;".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
}
public static string[] GetImgExts()
{
string exts = Player.GetPropertyString("image-exts");
if (string.IsNullOrEmpty(exts))
return new string[]{ "jpg", "bmp", "png", "gif", "webp" };
return exts.Split(" ,;".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
}
public static bool IsMedia(string[] exts, string ext) =>
IsVideo(exts, ext) || IsAudio(exts, ext) || IsImage(exts, ext);
public static IEnumerable<string> GetMediaFiles(string[] files) =>
files.Where(i => IsMedia(files, i.Ext()));
}

View File

@@ -7,228 +7,255 @@ public static class InputHelp
{
public static List<Binding> GetDefaults()
{
List<Binding> bindings = new List<Binding>()
{
new (_("File"), _("Open Files..."), "script-message-to mpvnet open-files", "o"),
new (_("File"), _("Open URL or file from clipboard"), "script-message-to mpvnet open-clipboard", "Ctrl+v"),
new (_("File"), _("Open DVD/Blu-ray Drive/Folder..."), "script-message-to mpvnet open-optical-media"),
new (_("File"), "-"),
new (_("File"), _("Add external audio files..."), "script-message-to mpvnet load-audio", "Alt+a"),
new (_("File"), _("Add external subtitle files..."), "script-message-to mpvnet load-sub", "Alt+s"),
new (_("File"), "-"),
new (_("File"), _("Add files to playlist..."), "script-message-to mpvnet open-files append"),
new (_("File"), _("Add files/URLs to playlist from clipboard"), "script-message-to mpvnet open-clipboard append", "Ctrl+Shift+v"),
new (_("File"), "-"),
new (_("File"), _("Recent Files")),
new (_("File"), _("Exit"), "quit", "Esc"),
List<Binding> b = new();
new (_("Playback"), _("Play/Pause"), "script-message-to mpvnet play-pause", "Space"),
new (_("Playback"), _("Stop"), "stop", "Ctrl+s"),
Add(b, new (_("File"), _("Open Files..."), "script-message-to mpvnet open-files", "o"));
Add(b, new (_("File"), _("Open URL or file from clipboard"), "script-message-to mpvnet open-clipboard", "Ctrl+v"));
Add(b, new (_("File"), _("Open DVD/Blu-ray Drive/Folder..."), "script-message-to mpvnet open-optical-media"));
Add(b, new (_("File"), "-"));
Add(b, new (_("File"), _("Add external audio files..."), "script-message-to mpvnet load-audio", "Alt+a"));
Add(b, new (_("File"), _("Add external subtitle files..."), "script-message-to mpvnet load-sub", "Alt+s"));
Add(b, new (_("File"), "-"));
Add(b, new (_("File"), _("Add files to playlist..."), "script-message-to mpvnet open-files append"));
Add(b, new (_("File"), _("Add files/URLs to playlist from clipboard"), "script-message-to mpvnet open-clipboard append", "Ctrl+Shift+v"));
Add(b, new (_("File"), "-"));
Add(b, new (_("File"), _("Recent Files")));
Add(b, new (_("File"), _("Exit"), "quit", "Esc"));
new (_("Navigate"), _("Previous File"), "playlist-prev", "F11"),
new (_("Navigate"), _("Next File"), "playlist-next", "F12"),
new (_("Navigate"), "-"),
new (_("Navigate"), _("First File"), "script-message-to mpvnet playlist-first", "Home"),
new (_("Navigate"), _("Last File"), "script-message-to mpvnet playlist-last", "End"),
Add(b, new (_("Playback"), _("Play/Pause"), "script-message-to mpvnet play-pause", "Space"));
Add(b, new (_("Playback"), _("Stop"), "stop", "Ctrl+s"));
new (_("Navigate"), "-"),
new (_("Navigate"), _("Next Chapter"), "add chapter 1", "PGUP"),
new (_("Navigate"), _("Previous Chapter"), "add chapter -1", "PGDWN"),
new (_("Navigate"), "-"),
new (_("Navigate"), _("Jump To Next Frame"), "frame-step", "."),
new (_("Navigate"), _("Jump To Previous Frame"), "frame-back-step", ","),
new (_("Navigate"), "-"),
new (_("Navigate"), _("Jump 5 sec forward"), "seek 5", "Right"),
new (_("Navigate"), _("Jump 5 sec backward"), "seek -5", "Left"),
new (_("Navigate"), "-"),
new (_("Navigate"), _("Jump 30 sec forward"), "seek 30", "Up"),
new (_("Navigate"), _("Jump 30 sec backward"), "seek -30", "Down"),
new (_("Navigate"), "-"),
new (_("Navigate"), _("Jump 5 min forward"), "seek 300", "Ctrl+Right"),
new (_("Navigate"), _("Jump 5 min backward"), "seek -300", "Ctrl+Left"),
new (_("Navigate"), "-"),
new (_("Navigate"), _("Title")),
new (_("Navigate"), _("Chapter")),
Add(b, new (_("Navigate"), _("Previous File"), "playlist-prev", "F11"));
Add(b, new (_("Navigate"), _("Next File"), "playlist-next", "F12"));
Add(b, new (_("Navigate"), "-"));
Add(b, new (_("Navigate"), _("First File"), "script-message-to mpvnet playlist-first", "Home"));
Add(b, new (_("Navigate"), _("Last File"), "script-message-to mpvnet playlist-last", "End"));
new (_("Pan & Scan"), _("Decrease Size"), "add video-zoom -0.1", "Ctrl+-"),
new (_("Pan & Scan"), _("Increase Size"), "add video-zoom 0.1", "Ctrl++"),
new (_("Pan & Scan"), "-"),
new (_("Pan & Scan"), _("Move Left"), "add video-pan-x -0.01", "Ctrl+KP4"),
new (_("Pan & Scan"), _("Move Right"), "add video-pan-x 0.01", "Ctrl+KP6"),
new (_("Pan & Scan"), "-"),
new (_("Pan & Scan"), _("Move Up"), "add video-pan-y -0.01", "Ctrl+KP8"),
new (_("Pan & Scan"), _("Move Down"), "add video-pan-y 0.01", "Ctrl+KP2"),
new (_("Pan & Scan"), "-"),
new (_("Pan & Scan"), _("Decrease Height"), "add panscan -0.1", "w"),
new (_("Pan & Scan"), _("Increase Height"), "add panscan 0.1", "W"),
new (_("Pan & Scan"), "-"),
new (_("Pan & Scan"), _("Reset"), "set video-zoom 0; set video-pan-x 0; set video-pan-y 0", "Ctrl+BS"),
Add(b, new (_("Navigate"), "-"));
Add(b, new (_("Navigate"), _("Next Chapter"), "add chapter 1", "PGUP"));
Add(b, new (_("Navigate"), _("Previous Chapter"), "add chapter -1", "PGDWN"));
Add(b, new (_("Navigate"), "-"));
Add(b, new (_("Navigate"), _("Jump To Next Frame"), "frame-step", "."));
Add(b, new (_("Navigate"), _("Jump To Previous Frame"), "frame-back-step", ","));
Add(b, new (_("Navigate"), "-"));
Add(b, new (_("Navigate"), _("Jump 5 sec forward"), "seek 5", "Right"));
Add(b, new (_("Navigate"), _("Jump 5 sec backward"), "seek -5", "Left"));
Add(b, new (_("Navigate"), "-"));
Add(b, new (_("Navigate"), _("Jump 30 sec forward"), "seek 30", "Up"));
Add(b, new (_("Navigate"), _("Jump 30 sec backward"), "seek -30", "Down"));
Add(b, new (_("Navigate"), "-"));
Add(b, new (_("Navigate"), _("Jump 5 min forward"), "seek 300", "Ctrl+Right"));
Add(b, new (_("Navigate"), _("Jump 5 min backward"), "seek -300", "Ctrl+Left"));
Add(b, new (_("Navigate"), "-"));
Add(b, new (_("Navigate"), _("Title")));
Add(b, new (_("Navigate"), _("Chapter")));
new (_("Video"), _("Decrease Contrast"), "add contrast -1", "Ctrl+1"),
new (_("Video"), _("Increase Contrast"), "add contrast 1", "Ctrl+2"),
new (_("Video"), "-"),
new (_("Video"), _("Decrease Brightness"), "add brightness -1", "Ctrl+3"),
new (_("Video"), _("Increase Brightness"), "add brightness 1", "Ctrl+4"),
new (_("Video"), "-"),
new (_("Video"), _("Decrease Gamma"), "add gamma -1", "Ctrl+5"),
new (_("Video"), _("Increase Gamma"), "add gamma 1", "Ctrl+6"),
new (_("Video"), "-"),
new (_("Video"), _("Decrease Saturation"), "add saturation -1", "Ctrl+7"),
new (_("Video"), _("Increase Saturation"), "add saturation 1", "Ctrl+8"),
new (_("Video"), "-"),
new (_("Video"), _("Take Screenshot"), "async screenshot", "s"),
new (_("Video"), _("Take Screenshot without subtitles"), "async screenshot video", "S"),
new (_("Video"), _("Toggle Deinterlace"), "cycle deinterlace", "d"),
new (_("Video"), _("Change Aspect Ratio"), "cycle-values video-aspect-override 16:9 4:3 2.35:1 0 -1", "a"),
new (_("Video"), _("Rotate Video"), "cycle-values video-rotate 90 180 270 0", "Ctrl+r"),
Add(b, new (_("Pan & Scan"), _("Decrease Size"), "add video-zoom -0.1", "Ctrl+-"));
Add(b, new (_("Pan & Scan"), _("Increase Size"), "add video-zoom 0.1", "Ctrl++"));
Add(b, new (_("Pan & Scan"), "-"));
Add(b, new (_("Pan & Scan"), _("Move Left"), "add video-pan-x -0.01", "Ctrl+KP4"));
Add(b, new (_("Pan & Scan"), _("Move Right"), "add video-pan-x 0.01", "Ctrl+KP6"));
Add(b, new (_("Pan & Scan"), "-"));
Add(b, new (_("Pan & Scan"), _("Move Up"), "add video-pan-y -0.01", "Ctrl+KP8"));
Add(b, new (_("Pan & Scan"), _("Move Down"), "add video-pan-y 0.01", "Ctrl+KP2"));
Add(b, new (_("Pan & Scan"), "-"));
Add(b, new (_("Pan & Scan"), _("Decrease Height"), "add panscan -0.1", "w"));
Add(b, new (_("Pan & Scan"), _("Increase Height"), "add panscan 0.1", "W"));
Add(b, new (_("Pan & Scan"), "-"));
Add(b, new (_("Pan & Scan"), _("Reset"), "set video-zoom 0; set video-pan-x 0; set video-pan-y 0", "Ctrl+BS"));
new (_("Audio"), _("Audio Device")),
new (_("Audio"), _("Next Track"), "script-message-to mpvnet cycle-audio", "KP7"),
new (_("Audio"), "-"),
new (_("Audio"), _("Delay +0.1"), "add audio-delay 0.1", "Ctrl+d"),
new (_("Audio"), _("Delay -0.1"), "add audio-delay -0.1", "Ctrl+D"),
Add(b, new (_("Video"), _("Decrease Contrast"), "add contrast -1", "Ctrl+1"));
Add(b, new (_("Video"), _("Increase Contrast"), "add contrast 1", "Ctrl+2"));
Add(b, new (_("Video"), "-"));
Add(b, new (_("Video"), _("Decrease Brightness"), "add brightness -1", "Ctrl+3"));
Add(b, new (_("Video"), _("Increase Brightness"), "add brightness 1", "Ctrl+4"));
Add(b, new (_("Video"), "-"));
Add(b, new (_("Video"), _("Decrease Gamma"), "add gamma -1", "Ctrl+5"));
Add(b, new (_("Video"), _("Increase Gamma"), "add gamma 1", "Ctrl+6"));
Add(b, new (_("Video"), "-"));
Add(b, new (_("Video"), _("Decrease Saturation"), "add saturation -1", "Ctrl+7"));
Add(b, new (_("Video"), _("Increase Saturation"), "add saturation 1", "Ctrl+8"));
Add(b, new (_("Video"), "-"));
Add(b, new (_("Video"), _("Take Screenshot"), "async screenshot", "s"));
Add(b, new (_("Video"), _("Take Screenshot without subtitles"), "async screenshot video", "S"));
Add(b, new (_("Video"), _("Toggle Deinterlace"), "cycle deinterlace", "d"));
Add(b, new (_("Video"), _("Change Aspect Ratio"), "cycle-values video-aspect-override 16:9 4:3 2.35:1 0 -1", "a"));
Add(b, new (_("Video"), _("Rotate Video"), "cycle-values video-rotate 90 180 270 0", "Ctrl+r"));
Add(b, new (_("Video"), _("Stream Quality"), "script-message-to mpvnet stream-quality", "Alt+q"));
new (_("Subtitle"), _("Next Track"), "script-message-to mpvnet cycle-subtitles", "KP8"),
new (_("Subtitle"), _("Toggle Visibility"), "cycle sub-visibility", "v"),
new (_("Subtitle"), "-"),
new (_("Subtitle"), _("Delay -0.1"), "add sub-delay -0.1", "z"),
new (_("Subtitle"), _("Delay +0.1"), "add sub-delay 0.1", "Z"),
new (_("Subtitle"), "-"),
new (_("Subtitle"), _("Move Up"), "add sub-pos -1", "r"),
new (_("Subtitle"), _("Move Down"), "add sub-pos 1", "R"),
new (_("Subtitle"), "-"),
new (_("Subtitle"), _("Decrease Font Size"), "add sub-scale -0.1", "F"),
new (_("Subtitle"), _("Increase Font Size"), "add sub-scale 0.1", "G"),
new (_("Subtitle"), "-"),
new (_("Subtitle") + " > " + _("More"), _("Toggle overriding SSA/ASS styles with normal styles"), "cycle-values sub-ass-override force no", "u"),
Add(b, new (_("Audio"), _("Audio Device")));
Add(b, new (_("Audio"), _("Next Track"), "script-message-to mpvnet cycle-audio", "KP7"));
Add(b, new (_("Audio"), "-"));
Add(b, new (_("Audio"), _("Delay +0.1"), "add audio-delay 0.1", "Ctrl+d"));
Add(b, new (_("Audio"), _("Delay -0.1"), "add audio-delay -0.1", "Ctrl+D"));
new ("", _("Track")),
Add(b, new (_("Subtitle"), _("Next Track"), "script-message-to mpvnet cycle-subtitles", "KP8"));
Add(b, new (_("Subtitle"), _("Toggle Visibility"), "cycle sub-visibility", "v"));
Add(b, new (_("Subtitle"), "-"));
Add(b, new (_("Subtitle"), _("Delay -0.1"), "add sub-delay -0.1", "z"));
Add(b, new (_("Subtitle"), _("Delay +0.1"), "add sub-delay 0.1", "Z"));
Add(b, new (_("Subtitle"), "-"));
Add(b, new (_("Subtitle"), _("Move Up"), "add sub-pos -1", "r"));
Add(b, new (_("Subtitle"), _("Move Down"), "add sub-pos 1", "R"));
Add(b, new (_("Subtitle"), "-"));
Add(b, new (_("Subtitle"), _("Decrease Font Size"), "add sub-scale -0.1", "F"));
Add(b, new (_("Subtitle"), _("Increase Font Size"), "add sub-scale 0.1", "G"));
Add(b, new (_("Subtitle"), "-"));
Add(b, new (_("Subtitle") + " > " + _("More"), _("Toggle overriding SSA/ASS styles with normal styles"), "cycle-values sub-ass-override force no", "u"));
new (_("Volume"), _p("Volume", "Up"), "add volume 2", "+"),
new (_("Volume"), _p("Volume", "Down"), "add volume -2", "-"),
new (_("Volume"), "-"),
new (_("Volume"), _("Mute"), "cycle mute", "m"),
Add(b, new ("", _("Track")));
new (_("Speed"), _("-10%"), "multiply speed 1/1.1", "["),
new (_("Speed"), _("+10%"), "multiply speed 1.1", "]"),
new (_("Speed"), "-"),
new (_("Speed"), _("Half"), "multiply speed 0.5", "{"),
new (_("Speed"), _("Double"), "multiply speed 2.0", "}"),
new (_("Speed"), "-"),
new (_("Speed"), _("Reset"), "set speed 1", "BS"),
Add(b, new (_("Volume"), _p("Volume", "Up"), "add volume 2", "+"));
Add(b, new (_("Volume"), _p("Volume", "Down"), "add volume -2", "-"));
Add(b, new (_("Volume"), "-"));
Add(b, new (_("Volume"), _("Mute"), "cycle mute", "m"));
new (_("View"), _("Toggle Statistics"), "script-binding stats/display-stats-toggle", "t"),
new (_("View"), _("Toggle OSC Visibility"), "script-binding osc/visibility", "Del"),
new (_("View"), _("Show Media Info On-Screen"), "script-message-to mpvnet show-media-info osd", "i"),
new (_("View"), _("Show Media Info Message Box"), "script-message-to mpvnet show-media-info msgbox", "Ctrl+m"),
new (_("View"), _("Show Progress"), "show-progress", "p"),
Add(b, new (_("Speed"), _("-10%"), "multiply speed 1/1.1", "["));
Add(b, new (_("Speed"), _("+10%"), "multiply speed 1.1", "]"));
Add(b, new (_("Speed"), "-"));
Add(b, new (_("Speed"), _("Half"), "multiply speed 0.5", "{"));
Add(b, new (_("Speed"), _("Double"), "multiply speed 2.0", "}"));
Add(b, new (_("Speed"), "-"));
Add(b, new (_("Speed"), _("Reset"), "set speed 1", "BS"));
new (_("View") + " > " + _("On Screen Menu"), _("Playlist"), "script-binding select/select-playlist", "F8"),
new (_("View") + " > " + _("On Screen Menu"), _("Bindings"), "script-binding select/select-binding", "F1"),
new (_("View") + " > " + _("On Screen Menu"), _("Properties"), "script-binding select/show-properties", "F3"),
new (_("View") + " > " + _("On Screen Menu"), _("Chapters"), "script-binding select/select-chapter", "Alt+c"),
new (_("View") + " > " + _("On Screen Menu"), _("Tracks"), "script-binding select/select-track", "F9"),
new (_("View") + " > " + _("On Screen Menu"), _("Audio Tracks"), "script-binding select/select-aid"),
new (_("View") + " > " + _("On Screen Menu"), _("Subtitle Tracks"), "script-binding select/select-sid"),
new (_("View") + " > " + _("On Screen Menu"), _("Secondary Subtitle"), "script-binding select/select-secondary-sid", "Alt+b"),
new (_("View") + " > " + _("On Screen Menu"), _("Video Tracks"), "script-binding select/select-vid", "Alt+v"),
new (_("View") + " > " + _("On Screen Menu"), _("Subtitle Lines"), "script-binding select/select-subtitle-line", "Alt+l"),
new (_("View") + " > " + _("On Screen Menu"), _("Audio Devices"), "script-binding select/select-audio-device", "Alt+d"),
Add(b, new (_("View"), _("Toggle Statistics"), "script-binding stats/display-stats-toggle", "t"));
Add(b, new (_("View"), _("Toggle OSC Visibility"), "script-binding osc/visibility", "Del"));
Add(b, new (_("View"), _("Show Media Info On-Screen"), "script-message-to mpvnet show-media-info osd", "i"));
Add(b, new (_("View"), _("Show Media Info Message Box"), "script-message-to mpvnet show-media-info msgbox", "Ctrl+m"));
Add(b, new (_("View"), _("Show Progress"), "show-progress", "p"));
new (_("View") + " > " + _("More"), _("Show Console"), "script-binding console/enable", "`"),
new (_("View") + " > " + _("More"), _("Show Commands"), "script-message-to mpvnet show-commands", "F2"),
new (_("View") + " > " + _("More"), _("Show Bindings"), "script-message-to mpvnet show-bindings"),
new (_("View") + " > " + _("More"), _("Show Keys"), "script-message-to mpvnet show-keys", "Alt+k"),
new (_("View") + " > " + _("More"), _("Show Protocols"), "script-message-to mpvnet show-protocols", "Alt+p"),
new (_("View") + " > " + _("More"), _("Show Decoders"), "script-message-to mpvnet show-decoders"),
new (_("View") + " > " + _("More"), _("Show Demuxers"), "script-message-to mpvnet show-demuxers"),
Add(b, new (_("View") + " > " + _("On Screen Menu"), _("Playlist"), "script-binding select/select-playlist", "F8"));
Add(b, new (_("View") + " > " + _("On Screen Menu"), _("Bindings"), "script-binding select/select-binding", "F1"));
Add(b, new (_("View") + " > " + _("On Screen Menu"), _("Properties"), "script-binding select/show-properties", "F3"));
Add(b, new (_("View") + " > " + _("On Screen Menu"), _("Chapters"), "script-binding select/select-chapter", "Alt+c"));
Add(b, new (_("View") + " > " + _("On Screen Menu"), _("Tracks"), "script-binding select/select-track", "F9"));
Add(b, new (_("View") + " > " + _("On Screen Menu"), _("Audio Tracks"), "script-binding select/select-aid"));
Add(b, new (_("View") + " > " + _("On Screen Menu"), _("Subtitle Tracks"), "script-binding select/select-sid"));
Add(b, new (_("View") + " > " + _("On Screen Menu"), _("Secondary Subtitle"), "script-binding select/select-secondary-sid", "Alt+b"));
Add(b, new (_("View") + " > " + _("On Screen Menu"), _("Video Tracks"), "script-binding select/select-vid", "Alt+v"));
Add(b, new (_("View") + " > " + _("On Screen Menu"), _("Subtitle Lines"), "script-binding select/select-subtitle-line", "Alt+l"));
Add(b, new (_("View") + " > " + _("On Screen Menu"), _("Audio Devices"), "script-binding select/select-audio-device", "Alt+d"));
new (_("Window"), _("Fullscreen"), "cycle fullscreen", "Enter"),
new (_("Window") + " > " + _("Zoom"), _("Enlarge"), "script-message-to mpvnet scale-window 1.2", "Alt++"),
new (_("Window") + " > " + _("Zoom"), _("Shrink"), "script-message-to mpvnet scale-window 0.8", "Alt+-"),
new (_("Window") + " > " + _("Zoom"), "-"),
new (_("Window") + " > " + _("Zoom"), _("50 %"), "script-message-to mpvnet window-scale 0.5", "Alt+0"),
new (_("Window") + " > " + _("Zoom"), _("100 %"), "script-message-to mpvnet window-scale 1.0", "Alt+1"),
new (_("Window") + " > " + _("Zoom"), _("200 %"), "script-message-to mpvnet window-scale 2.0", "Alt+2"),
new (_("Window") + " > " + _("Zoom"), _("300 %"), "script-message-to mpvnet window-scale 3.0", "Alt+3"),
new (_("Window") + " > " + _("Move"), _p("Move", "Left"), "script-message-to mpvnet move-window left", "Alt+Left"),
new (_("Window") + " > " + _("Move"), _p("Move", "Right"), "script-message-to mpvnet move-window right", "Alt+Right"),
new (_("Window") + " > " + _("Move"), _p("Move", "Up"), "script-message-to mpvnet move-window top", "Alt+Up"),
new (_("Window") + " > " + _("Move"), _p("Move", "Down"), "script-message-to mpvnet move-window bottom", "Alt+Down"),
new (_("Window") + " > " + _("Move"), _p("Move", "Center"), "script-message-to mpvnet move-window center", "Alt+BS"),
new (_("Window"), _("Toggle Border"), "cycle border", "b"),
new (_("Window"), _("Toggle On Top"), "cycle ontop", "Ctrl+t"),
if (File.Exists(Player.ConfigFolder + "/scripts/command_palette.lua"))
{
Add(b, new(_("View") + " > " + _("Command Palette"), _("Command Palette"), "script-message-to command_palette show-command-palette \"Command Palette\"", "Ctrl+p"));
Add(b, new(_("View") + " > " + _("Command Palette"), _("Bindings"), "script-message-to command_palette show-command-palette \"Bindings\"", "F1"));
Add(b, new(_("View") + " > " + _("Command Palette"), _("Properties"), "script-message-to command_palette show-command-palette \"Properties\"", "F2"));
Add(b, new(_("View") + " > " + _("Command Palette"), _("Commands"), "script-message-to command_palette show-command-palette \"Commands\"", "F3"));
Add(b, new(_("View") + " > " + _("Command Palette"), _("Options"), "script-message-to command_palette show-command-palette \"Options\"", "F4"));
Add(b, new(_("View") + " > " + _("Command Palette"), _("Playlist"), "script-message-to command_palette show-command-palette \"Playlist\"", "F8"));
Add(b, new(_("View") + " > " + _("Command Palette"), _("Tracks"), "script-message-to command_palette show-command-palette \"Tracks\"", "F9"));
Add(b, new(_("View") + " > " + _("Command Palette"), _("Audio Tracks"), "script-message-to command_palette show-command-palette \"Audio Tracks\"", "Alt+a"));
Add(b, new(_("View") + " > " + _("Command Palette"), _("Subtitle Tracks"), "script-message-to command_palette show-command-palette \"Subtitle Tracks\"", "Alt+s"));
Add(b, new(_("View") + " > " + _("Command Palette"), _("Secondary Subtitle"), "script-message-to command_palette show-command-palette \"Secondary Subtitle\"", "Alt+b"));
Add(b, new(_("View") + " > " + _("Command Palette"), _("Video Tracks"), "script-message-to command_palette show-command-palette \"Video Tracks\"", "Alt+v"));
Add(b, new(_("View") + " > " + _("Command Palette"), _("Chapters"), "script-message-to command_palette show-command-palette \"Chapters\"", "Alt+c"));
Add(b, new(_("View") + " > " + _("Command Palette"), _("Profiles"), "script-message-to command_palette show-command-palette \"Profiles\"", "Alt+p"));
Add(b, new(_("View") + " > " + _("Command Palette"), _("Audio Devices"), "script-message-to command_palette show-command-palette \"Audio Devices\"", "Alt+d"));
Add(b, new(_("View") + " > " + _("Command Palette"), _("Subtitle Line"), "script-message-to command_palette show-command-palette \"Subtitle Line\"", "Alt+l"));
Add(b, new(_("View") + " > " + _("Command Palette"), _("Blu-ray Titles"), "script-message-to command_palette show-command-palette \"Blu-ray Titles\"", "Alt+t"));
Add(b, new(_("View") + " > " + _("Command Palette"), _("Stream Quality"), "script-message-to command_palette show-command-palette \"Stream Quality\"", "Alt+q"));
Add(b, new(_("View") + " > " + _("Command Palette"), _("Aspect Ratio"), "script-message-to command_palette show-command-palette \"Aspect Ratio\"", "Alt+r"));
Add(b, new(_("View") + " > " + _("Command Palette"), _("Recent Files"), "script-message-to mpvnet show-recent-in-command-palette", "Alt+f"));
}
new ("", _("Profile")),
new (_("Settings"), _("Show Config Editor"), "script-message-to mpvnet show-conf-editor", "Ctrl+,"),
new (_("Settings"), _("Show Input Editor"), "script-message-to mpvnet show-input-editor", "Ctrl+i"),
new (_("Settings"), "-"),
new (_("Settings"), _("Edit mpv.conf"), "script-message-to mpvnet edit-conf-file mpv.conf", "c"),
new (_("Settings"), _("Edit input.conf"), "script-message-to mpvnet edit-conf-file input.conf", "k"),
new (_("Settings"), "-"),
new (_("Settings"), _("Open Config Folder"), "script-message-to mpvnet open-conf-folder", "Ctrl+f"),
new (_("Settings") + " > " + _("Setup"), _("Register video file associations"), "script-message-to mpvnet reg-file-assoc video"),
new (_("Settings") + " > " + _("Setup"), _("Register audio file associations"), "script-message-to mpvnet reg-file-assoc audio"),
new (_("Settings") + " > " + _("Setup"), _("Register image file associations"), "script-message-to mpvnet reg-file-assoc image"),
new (_("Settings") + " > " + _("Setup"), _("Unregister file associations"), "script-message-to mpvnet reg-file-assoc unreg"),
new (_("Settings") + " > " + _("Setup"), "-"),
new (_("Settings") + " > " + _("Setup"), _("Add mpv.net to Path environment variable"), "script-message-to mpvnet add-to-path"),
new (_("Settings") + " > " + _("Setup"), _("Remove mpv.net from Path environment variable"), "script-message-to mpvnet remove-from-path"),
new (_("Tools"), _("Set/clear A-B loop points"), "ab-loop", "l"),
new (_("Tools"), _("Toggle infinite file looping"), "cycle-values loop-file inf no", "L"),
new (_("Tools"), _("Shuffle Playlist"), "playlist-shuffle"),
new (_("Tools"), _("Toggle Hardware Decoding"), "cycle-values hwdec auto no", "Ctrl+h"),
new (_("Tools"), _("Exit Watch Later"), "quit-watch-later", "Q"),
new ("", _("Custom")),
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 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 Protocols"), "script-message-to mpvnet show-protocols", "Alt+p"));
Add(b, new (_("View") + " > " + _("More"), _("Show Decoders"), "script-message-to mpvnet show-decoders"));
Add(b, new (_("View") + " > " + _("More"), _("Show Demuxers"), "script-message-to mpvnet show-demuxers"));
new (_("Help"), _("Website mpv"), "script-message-to mpvnet shell-execute https://mpv.io", "Ctrl+Home"),
new (_("Help"), _("Website mpv.net"), "script-message-to mpvnet shell-execute https://github.com/mpvnet-player/mpv.net"),
new (_("Help"), "-"),
new (_("Help"), _("Manual mpv"), "script-message-to mpvnet shell-execute https://mpv.io/manual/stable", "Ctrl+F1"),
new (_("Help"), _("Manual mpv.net"), "script-message-to mpvnet shell-execute https://github.com/mpvnet-player/mpv.net/blob/main/docs/manual.md", "Ctrl+F2"),
new (_("Help"), "-"),
new (_("Help"), _("awesome-mpv"), "script-message-to mpvnet shell-execute https://github.com/stax76/awesome-mpv", "Ctrl+a"),
new (_("Help"), _("About mpv.net"), "script-message-to mpvnet show-about"),
Add(b, new (_("Window"), _("Fullscreen"), "cycle fullscreen", "Enter"));
Add(b, new (_("Window") + " > " + _("Zoom"), _("Enlarge"), "script-message-to mpvnet scale-window 1.2", "Alt++"));
Add(b, new (_("Window") + " > " + _("Zoom"), _("Shrink"), "script-message-to mpvnet scale-window 0.8", "Alt+-"));
Add(b, new (_("Window") + " > " + _("Zoom"), "-"));
Add(b, new (_("Window") + " > " + _("Zoom"), _("50 %"), "script-message-to mpvnet window-scale 0.5", "Alt+0"));
Add(b, new (_("Window") + " > " + _("Zoom"), _("100 %"), "script-message-to mpvnet window-scale 1.0", "Alt+1"));
Add(b, new (_("Window") + " > " + _("Zoom"), _("200 %"), "script-message-to mpvnet window-scale 2.0", "Alt+2"));
Add(b, new (_("Window") + " > " + _("Zoom"), _("300 %"), "script-message-to mpvnet window-scale 3.0", "Alt+3"));
Add(b, new (_("Window") + " > " + _("Move"), _p("Move", "Left"), "script-message-to mpvnet move-window left", "Alt+Left"));
Add(b, new (_("Window") + " > " + _("Move"), _p("Move", "Right"), "script-message-to mpvnet move-window right", "Alt+Right"));
Add(b, new (_("Window") + " > " + _("Move"), _p("Move", "Up"), "script-message-to mpvnet move-window top", "Alt+Up"));
Add(b, new (_("Window") + " > " + _("Move"), _p("Move", "Down"), "script-message-to mpvnet move-window bottom", "Alt+Down"));
Add(b, new (_("Window") + " > " + _("Move"), _p("Move", "Center"), "script-message-to mpvnet move-window center", "Alt+BS"));
Add(b, new (_("Window"), _("Toggle Border"), "cycle border", "b"));
Add(b, new (_("Window"), _("Toggle On Top"), "cycle ontop", "Ctrl+t"));
new ("", "", "quit", "q", _("Exit")),
new ("", "", "script-message-to mpvnet show-menu", "MBTN_Right", _("Show Menu")),
new ("", "", "script-message-to mpvnet play-pause", "Play", _("Play/Pause")),
new ("", "", "script-message-to mpvnet play-pause", "Pause", _("Play/Pause")),
new ("", "", "script-message-to mpvnet play-pause", "PlayPause", _("Play/Pause")),
new ("", "", "script-message-to mpvnet play-pause", "MBTN_Mid", _("Play/Pause")),
new ("", "", "stop", "Stop", _("Stop")),
new ("", "", "seek 60", "Forward", _("Forward")),
new ("", "", "seek -60", "Rewind", _("Backward")),
new ("", "", "add volume 2", "Wheel_Up", _("Volume Up")),
new ("", "", "add volume -2", "Wheel_Down", _("Volume Down")),
new ("", "", "add volume 2", "Wheel_Right", _("Volume Up")),
new ("", "", "add volume -2", "Wheel_Left", _("Volume Down")),
new ("", "", "playlist-prev", "Prev", _("Previous File")),
new ("", "", "playlist-next", "Next", _("Next File")),
new ("", "", "playlist-prev", "MBTN_Back", _("Previous File")),
new ("", "", "playlist-next", "MBTN_Forward", _("Next File")),
new ("", "", "playlist-prev", "<", _("Previous File")),
new ("", "", "playlist-next", ">", _("Next File")),
new ("", "", "ignore", "MBTN_Left", _("Ignore left mouse butten")),
new ("", "", "cycle fullscreen", "f", _("Fullscreen")),
new ("", "", "cycle fullscreen", "MBTN_Left_DBL", _("Fullscreen")),
new ("", "", "no-osd seek 1 exact", "Shift+Right", _("Seek Forward")),
new ("", "", "no-osd seek -1 exact", "Shift+Left", _("Seek Backward")),
new ("", "", "no-osd seek 5 exact", "Shift+Up", _("Seek Forward")),
new ("", "", "no-osd seek -5 exact", "Shift+Down", _("Seek Backward")),
new ("", "", "revert-seek", "Shift+BS", _("Undo previous (or marked) seek")),
new ("", "", "revert-seek mark", "Shift+Ctrl+BS", _("Mark position for revert-seek")),
new ("", "", "no-osd sub-seek -1", "Ctrl+Shift+Left", _("Seek to previous subtitle")),
new ("", "", "no-osd sub-seek 1", "Ctrl+Shift+Right", _("Seek to next subtitle")),
new ("", "", "no-osd seek 5", "Ctrl+Wheel_Up", _("Seek Forward")),
new ("", "", "no-osd seek -5", "Ctrl+Wheel_Down", _("Seek Backward")),
new ("", "", "quit", "Power", _("Exit")),
};
Add(b, new ("", _("Profile")));
return bindings;
Add(b, new (_("Settings"), _("Show Config Editor"), "script-message-to mpvnet show-conf-editor", "Ctrl+,"));
Add(b, new (_("Settings"), _("Show Input Editor"), "script-message-to mpvnet show-input-editor", "Ctrl+i"));
Add(b, new (_("Settings"), "-"));
Add(b, new (_("Settings"), _("Edit mpv.conf"), "script-message-to mpvnet edit-conf-file mpv.conf", "c"));
Add(b, new (_("Settings"), _("Edit input.conf"), "script-message-to mpvnet edit-conf-file input.conf", "k"));
Add(b, new (_("Settings"), "-"));
Add(b, new (_("Settings"), _("Open Config Folder"), "script-message-to mpvnet open-conf-folder", "Ctrl+f"));
Add(b, new (_("Settings") + " > " + _("Setup"), _("Register video file associations"), "script-message-to mpvnet reg-file-assoc video"));
Add(b, new (_("Settings") + " > " + _("Setup"), _("Register audio file associations"), "script-message-to mpvnet reg-file-assoc audio"));
Add(b, new (_("Settings") + " > " + _("Setup"), _("Register image file associations"), "script-message-to mpvnet reg-file-assoc image"));
Add(b, new (_("Settings") + " > " + _("Setup"), _("Unregister file associations"), "script-message-to mpvnet reg-file-assoc unreg"));
Add(b, new (_("Settings") + " > " + _("Setup"), "-"));
Add(b, new (_("Settings") + " > " + _("Setup"), _("Add mpv.net to Path environment variable"), "script-message-to mpvnet add-to-path"));
Add(b, new (_("Settings") + " > " + _("Setup"), _("Remove mpv.net from Path environment variable"), "script-message-to mpvnet remove-from-path"));
Add(b, new (_("Settings") + " > " + _("Setup"), "-"));
Add(b, new (_("Settings") + " > " + _("Setup"), _("Install Command Palette"), "script-message-to mpvnet install-command-palette"));
Add(b, new (_("Tools"), _("Set/clear A-B loop points"), "ab-loop", "l"));
Add(b, new (_("Tools"), _("Toggle infinite file looping"), "cycle-values loop-file inf no", "L"));
Add(b, new (_("Tools"), _("Shuffle Playlist"), "playlist-shuffle"));
Add(b, new (_("Tools"), _("Toggle Hardware Decoding"), "cycle-values hwdec auto no", "Ctrl+h"));
Add(b, new (_("Tools"), _("Exit Watch Later"), "quit-watch-later", "Q"));
Add(b, new ("", _("Custom")));
Add(b, new (_("Help"), _("Website mpv"), "script-message-to mpvnet shell-execute https://mpv.io", "Ctrl+Home"));
Add(b, new (_("Help"), _("Website mpv.net"), "script-message-to mpvnet shell-execute https://github.com/mpvnet-player/mpv.net"));
Add(b, new (_("Help"), "-"));
Add(b, new (_("Help"), _("Manual mpv"), "script-message-to mpvnet shell-execute https://mpv.io/manual/stable", "Ctrl+F1"));
Add(b, new (_("Help"), _("Manual mpv.net"), "script-message-to mpvnet shell-execute https://github.com/mpvnet-player/mpv.net/blob/main/docs/manual.md", "Ctrl+F2"));
Add(b, new (_("Help"), "-"));
Add(b, new (_("Help"), _("awesome-mpv"), "script-message-to mpvnet shell-execute https://github.com/stax76/awesome-mpv", "Ctrl+a"));
Add(b, new (_("Help"), _("About mpv.net"), "script-message-to mpvnet show-about"));
Add(b, new ("", "", "quit", "q", _("Exit")));
Add(b, new ("", "", "script-message-to mpvnet show-menu", "MBTN_Right", _("Show Menu")));
Add(b, new ("", "", "script-message-to mpvnet play-pause", "Play", _("Play/Pause")));
Add(b, new ("", "", "script-message-to mpvnet play-pause", "Pause", _("Play/Pause")));
Add(b, new ("", "", "script-message-to mpvnet play-pause", "PlayPause", _("Play/Pause")));
Add(b, new ("", "", "script-message-to mpvnet play-pause", "MBTN_Mid", _("Play/Pause")));
Add(b, new ("", "", "stop", "Stop", _("Stop")));
Add(b, new ("", "", "seek 60", "Forward", _("Forward")));
Add(b, new ("", "", "seek -60", "Rewind", _("Backward")));
Add(b, new ("", "", "add volume 2", "Wheel_Up", _("Volume Up")));
Add(b, new ("", "", "add volume -2", "Wheel_Down", _("Volume Down")));
Add(b, new ("", "", "add volume 2", "Wheel_Right", _("Volume Up")));
Add(b, new ("", "", "add volume -2", "Wheel_Left", _("Volume Down")));
Add(b, new ("", "", "playlist-prev", "Prev", _("Previous File")));
Add(b, new ("", "", "playlist-next", "Next", _("Next File")));
Add(b, new ("", "", "playlist-prev", "MBTN_Back", _("Previous File")));
Add(b, new ("", "", "playlist-next", "MBTN_Forward", _("Next File")));
Add(b, new ("", "", "playlist-prev", "<", _("Previous File")));
Add(b, new ("", "", "playlist-next", ">", _("Next File")));
Add(b, new ("", "", "ignore", "MBTN_Left", _("Ignore left mouse butten")));
Add(b, new ("", "", "cycle fullscreen", "f", _("Fullscreen")));
Add(b, new ("", "", "cycle fullscreen", "MBTN_Left_DBL", _("Fullscreen")));
Add(b, new ("", "", "no-osd seek 1 exact", "Shift+Right", _("Seek Forward")));
Add(b, new ("", "", "no-osd seek -1 exact", "Shift+Left", _("Seek Backward")));
Add(b, new ("", "", "no-osd seek 5 exact", "Shift+Up", _("Seek Forward")));
Add(b, new ("", "", "no-osd seek -5 exact", "Shift+Down", _("Seek Backward")));
Add(b, new ("", "", "revert-seek", "Shift+BS", _("Undo previous (or marked) seek")));
Add(b, new ("", "", "revert-seek mark", "Shift+Ctrl+BS", _("Mark position for revert-seek")));
Add(b, new ("", "", "no-osd sub-seek -1", "Ctrl+Shift+Left", _("Seek to previous subtitle")));
Add(b, new ("", "", "no-osd sub-seek 1", "Ctrl+Shift+Right", _("Seek to next subtitle")));
Add(b, new ("", "", "no-osd seek 5", "Ctrl+Wheel_Up", _("Seek Forward")));
Add(b, new ("", "", "no-osd seek -5", "Ctrl+Wheel_Down", _("Seek Backward")));
Add(b, new ("", "", "quit", "Power", _("Exit")));
return b;
static void Add(List<Binding> bindings, Binding b) => bindings.Add(b);
}
public static string ConvertToString(List<Binding> bindings)

View File

@@ -346,6 +346,9 @@ public class MpvClient
public string GetPropertyString(string name)
{
if (Handle == IntPtr.Zero)
return "";
mpv_error err = mpv_get_property(Handle, GetUtf8Bytes(name),
mpv_format.MPV_FORMAT_STRING, out IntPtr lpBuffer);
@@ -364,6 +367,12 @@ public class MpvClient
public void SetPropertyString(string name, string value)
{
if (Handle == IntPtr.Zero)
{
Terminal.WriteError($"error setting property: {name} = {value}");
return;
}
byte[] bytes = GetUtf8Bytes(value);
mpv_error err = mpv_set_property(Handle, GetUtf8Bytes(name), mpv_format.MPV_FORMAT_STRING, ref bytes);

View File

@@ -254,20 +254,7 @@ public class MainPlayer : MpvClient
_configFolder = Folder.AppData + "mpv.net";
if (!Directory.Exists(_configFolder))
{
try {
using Process proc = new Process();
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.CreateNoWindow = true;
proc.StartInfo.FileName = "powershell.exe";
proc.StartInfo.Arguments = $@"-Command New-Item -Path '{_configFolder}' -ItemType Directory";
proc.Start();
proc.WaitForExit();
} catch (Exception) {}
if (!Directory.Exists(_configFolder))
Directory.CreateDirectory(_configFolder);
}
Directory.CreateDirectory(_configFolder);
_configFolder = _configFolder.AddSep();
}