Skip to content

Commit 0b646ce

Browse files
committed
New command Video > Stream Quality (Alt+q)
1 parent a0d2fb6 commit 0b646ce

File tree

4 files changed

+27
-4
lines changed

4 files changed

+27
-4
lines changed

docs/changelog.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
# v7.1.1.3 Beta (????-??-??)
33

44
- Support for autocreate-playlist, video-exts, audio-exts, image-exts.
5-
Windows 7 support should still work, but needs auto-load-folder to be enabled.
5+
Windows 7 support should still work, but needs auto-load-folder to be enabled
6+
or autoload.lua.
67
- The command palette user script is installable from the context menu under
78
`Settings > Setup > Install Command Palette`. The command palette features
89
are shown in the menu under 'View > Command Palette'.
9-
10+
- New command to select the stream quality `Video > Stream Quality (Alt+q)`,
11+
this calls the Stream Quality feature of the command palette.
1012

1113
# v7.1.1.2 Beta (2024-10-10)
1214

docs/manual.md

+3
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,9 @@ Shows available profiles with a message box.
319319
### show-text \<text\> \<duration\> \<font-size\>
320320
Shows a OSD message with given text, duration and font size.
321321

322+
### stream-quality
323+
Shows a menu to select the stream quality.
324+
322325
### window-scale \<factor\>
323326
Works similar as the [window-scale](https://mpv.io/manual/master/#command-interface-window-scale) mpv property.
324327

src/MpvNet.Windows/GuiCommand.cs

+19-2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public class GuiCommand
3333
{
3434
["add-to-path"] = args => AddToPath(),
3535
["edit-conf-file"] = EditCongFile,
36+
["install-command-palette"] = args => InstallCommandPalette(),
3637
["load-audio"] = LoadAudio,
3738
["load-sub"] = LoadSubtitle,
3839
["move-window"] = args => MoveWindow?.Invoke(args[0]),
@@ -56,9 +57,9 @@ public class GuiCommand
5657
["show-profiles"] = args => Msg.ShowInfo(Player.GetProfiles()),
5758
["show-properties"] = args => Player.Command("script-binding select/show-properties"),
5859
["show-protocols"] = args => ShowProtocols(),
59-
["window-scale"] = args => WindowScaleNet?.Invoke(float.Parse(args[0], CultureInfo.InvariantCulture)),
60-
["install-command-palette"] = args => InstallCommandPalette(),
6160
["show-recent-in-command-palette"] = args => ShowRecentFilesInCommandPalette(),
61+
["stream-quality"] = args => StreamQuality(),
62+
["window-scale"] = args => WindowScaleNet?.Invoke(float.Parse(args[0], CultureInfo.InvariantCulture)),
6263

6364

6465
// deprecated
@@ -288,6 +289,22 @@ void InstallCommandPalette()
288289
}
289290
}
290291

292+
void StreamQuality()
293+
{
294+
int version = Player.GetPropertyInt("user-data/command-palette/version");
295+
296+
if (version >= 1)
297+
Player.Command("script-message-to command_palette show-command-palette \"Stream Quality\"");
298+
else
299+
{
300+
var r = Msg.ShowQuestion("The Stream Quality feature requires the command palette to be installed." + BR2 +
301+
"Would you like to install the command palette now?");
302+
303+
if (r == MessageBoxResult.OK)
304+
Player.Command("script-message-to mpvnet install-command-palette");
305+
}
306+
}
307+
291308
void ShowRecentFilesInCommandPalette()
292309
{
293310
Obj o = new();

src/MpvNet/InputHelp.cs

+1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ public static List<Binding> GetDefaults()
8181
Add(b, new (_("Video"), _("Toggle Deinterlace"), "cycle deinterlace", "d"));
8282
Add(b, new (_("Video"), _("Change Aspect Ratio"), "cycle-values video-aspect-override 16:9 4:3 2.35:1 0 -1", "a"));
8383
Add(b, new (_("Video"), _("Rotate Video"), "cycle-values video-rotate 90 180 270 0", "Ctrl+r"));
84+
Add(b, new (_("Video"), _("Stream Quality"), "script-message-to mpvnet stream-quality", "Alt+q"));
8485

8586
Add(b, new (_("Audio"), _("Audio Device")));
8687
Add(b, new (_("Audio"), _("Next Track"), "script-message-to mpvnet cycle-audio", "KP7"));

0 commit comments

Comments
 (0)