diff --git a/Changelog.md b/Changelog.md index 5796b22..68e9d6b 100644 --- a/Changelog.md +++ b/Changelog.md @@ -4,6 +4,8 @@ - the default of remember-volume has been set to yes - scale, cscale, dscale defaults have been set to spline36, profile=gpu-hq is not used in the defaults because it starts very slow +- new menu items have been added to navigate to the first and + last playlist position, key bindings: Home, End ### 5.2.1.3 diff --git a/mpv.net/Misc/Command.cs b/mpv.net/Misc/Command.cs index 2cb68e3..23763e6 100644 --- a/mpv.net/Misc/Command.cs +++ b/mpv.net/Misc/Command.cs @@ -19,7 +19,8 @@ namespace mpvnet case "open-files": OpenFiles(args); break; case "open-url": OpenURL(); break; case "open-optical-media": Open_DVD_Or_BD_Folder(); break; - case "manage-file-associations": ManageFileAssociations(); break; // deprecated 2019 + case "manage-file-associations": // deprecated 2019 + case "show-setup-dialog": ShowDialog(typeof(SetupWindow)); break; case "cycle-audio": CycleAudio(); break; case "load-audio": LoadAudio(); break; case "load-sub": LoadSubtitle(); break; @@ -30,10 +31,10 @@ namespace mpvnet case "show-about": ShowDialog(typeof(AboutWindow)); break; case "show-conf-editor": ShowDialog(typeof(ConfWindow)); break; case "show-input-editor": ShowDialog(typeof(InputWindow)); break; - case "show-setup-dialog": ShowDialog(typeof(SetupWindow)); break; case "open-conf-folder": Process.Start(mp.ConfigFolder); break; case "shell-execute": Process.Start(args[0]); break; case "show-info": ShowInfo(); break; + case "playlist-last": PlaylistLast(); break; case "add-files-to-playlist": OpenFiles("append"); break; // deprecated 2019 default: Msg.ShowError($"No command '{id}' found."); break; } @@ -68,7 +69,7 @@ namespace mpvnet })); } - public static void Open_DVD_Or_BD_Folder(params string[] args) + public static void Open_DVD_Or_BD_Folder() { InvokeOnMainThread(new Action(() => { using (var d = new FolderBrowserDialog()) @@ -93,6 +94,8 @@ namespace mpvnet })); } + public static void PlaylistLast() => mp.set_property_int("playlist-pos", mp.get_property_int("playlist-count") - 1); + public static void ShowHistory() { var fp = mp.ConfigFolder + "history.txt"; @@ -256,7 +259,5 @@ namespace mpvnet mp.commandv("show-text", audTracks[aid - 1].Text.Substring(3), "5000"); } } - - public static void ManageFileAssociations() => ShowDialog(typeof(SetupWindow)); // deprecated 2019 } } \ No newline at end of file diff --git a/mpv.net/Resources/inputConf.txt b/mpv.net/Resources/inputConf.txt index 36312df..9d90267 100644 --- a/mpv.net/Resources/inputConf.txt +++ b/mpv.net/Resources/inputConf.txt @@ -41,6 +41,9 @@ F11 playlist-prev #menu: Navigate > Previous File F12 playlist-next #menu: Navigate > Next File _ ignore #menu: Navigate > - + Home set playlist-pos 0 #menu: Navigate > First File + End script-message mpv.net playlist-last #menu: Navigate > Last File + _ ignore #menu: Navigate > - PGUP add chapter 1 #menu: Navigate > Next Chapter PGDWN add chapter -1 #menu: Navigate > Previous Chapter _ ignore #menu: Navigate > - diff --git a/mpv.net/Resources/mpvConf.txt b/mpv.net/Resources/mpvConf.txt index 56e841b..2470f93 100644 --- a/mpv.net/Resources/mpvConf.txt +++ b/mpv.net/Resources/mpvConf.txt @@ -2,6 +2,7 @@ input-ar-delay = 500 input-ar-rate = 20 hwdec = yes +keep-open = yes keep-open-pause = no osd-playing-msg = '${filename}' screenshot-directory = '~~desktop/' diff --git a/mpv.net/Resources/mpvConfToml.txt b/mpv.net/Resources/mpvConfToml.txt index d5a9659..befaa6d 100644 --- a/mpv.net/Resources/mpvConfToml.txt +++ b/mpv.net/Resources/mpvConfToml.txt @@ -337,8 +337,8 @@ options = [{ name = "yes" }, name = "keep-open" default = "no" filter = "Playback" -help = "Unlike mpv, mpv.net never exits automatically." -options = [{ name = "yes", help = "Useless in mpv.net because mpv.net never terminates automatically."}, +help = "Using no, mpv would terminate after the last file but mpv.net never terminates automatically." +options = [{ name = "yes", help = "If the current file ends, go to the next file, keep the last file open."}, { name = "no", help = "If the current file ends, go to the next file." }, { name = "always", help = "Playback will never automatically advance to the next file."}] diff --git a/mpv.net/WPF/AboutWindow.xaml b/mpv.net/WPF/AboutWindow.xaml index c316cf8..4838722 100644 --- a/mpv.net/WPF/AboutWindow.xaml +++ b/mpv.net/WPF/AboutWindow.xaml @@ -4,7 +4,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" - Title="About mpv.net" Height="230" Width="500" FontSize="16" ShowInTaskbar="False" + Title="About mpv.net" Height="230" Width="400" FontSize="16" ShowInTaskbar="False" WindowStartupLocation="CenterOwner" ResizeMode="NoResize"> diff --git a/mpv.net/WPF/AboutWindow.xaml.cs b/mpv.net/WPF/AboutWindow.xaml.cs index b3ba7ae..d60093f 100644 --- a/mpv.net/WPF/AboutWindow.xaml.cs +++ b/mpv.net/WPF/AboutWindow.xaml.cs @@ -1,7 +1,6 @@ using System.IO; using System.Windows; using System.Windows.Input; -using System.Windows.Media; namespace mpvnet { @@ -10,7 +9,7 @@ namespace mpvnet public AboutWindow() { InitializeComponent(); - Version.Text = $"mpv.net Version {System.Windows.Forms.Application.ProductVersion}"; + Version.Text = $"mpv.net Version {System.Windows.Forms.Application.ProductVersion} ({File.GetLastWriteTime(System.Windows.Forms.Application.ExecutablePath).ToShortDateString()})"; mpvVersion.Text = $"{mp.get_property_string("mpv-version")} ({File.GetLastWriteTime(PathHelp.StartupPath + "mpv-1.dll").ToShortDateString()})"; }