new menu items added to navigate to the first and last playlist position

This commit is contained in:
Frank Skare
2019-08-09 01:59:20 +02:00
parent 1ef9e64a41
commit a8c2409ed1
7 changed files with 16 additions and 10 deletions

View File

@@ -4,6 +4,8 @@
- the default of remember-volume has been set to yes - the default of remember-volume has been set to yes
- scale, cscale, dscale defaults have been set to spline36, - scale, cscale, dscale defaults have been set to spline36,
profile=gpu-hq is not used in the defaults because it starts very slow 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 ### 5.2.1.3

View File

@@ -19,7 +19,8 @@ namespace mpvnet
case "open-files": OpenFiles(args); break; case "open-files": OpenFiles(args); break;
case "open-url": OpenURL(); break; case "open-url": OpenURL(); break;
case "open-optical-media": Open_DVD_Or_BD_Folder(); 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 "cycle-audio": CycleAudio(); break;
case "load-audio": LoadAudio(); break; case "load-audio": LoadAudio(); break;
case "load-sub": LoadSubtitle(); break; case "load-sub": LoadSubtitle(); break;
@@ -30,10 +31,10 @@ namespace mpvnet
case "show-about": ShowDialog(typeof(AboutWindow)); break; case "show-about": ShowDialog(typeof(AboutWindow)); break;
case "show-conf-editor": ShowDialog(typeof(ConfWindow)); break; case "show-conf-editor": ShowDialog(typeof(ConfWindow)); break;
case "show-input-editor": ShowDialog(typeof(InputWindow)); 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 "open-conf-folder": Process.Start(mp.ConfigFolder); break;
case "shell-execute": Process.Start(args[0]); break; case "shell-execute": Process.Start(args[0]); break;
case "show-info": ShowInfo(); break; case "show-info": ShowInfo(); break;
case "playlist-last": PlaylistLast(); break;
case "add-files-to-playlist": OpenFiles("append"); break; // deprecated 2019 case "add-files-to-playlist": OpenFiles("append"); break; // deprecated 2019
default: Msg.ShowError($"No command '{id}' found."); break; 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(() => { InvokeOnMainThread(new Action(() => {
using (var d = new FolderBrowserDialog()) 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() public static void ShowHistory()
{ {
var fp = mp.ConfigFolder + "history.txt"; var fp = mp.ConfigFolder + "history.txt";
@@ -256,7 +259,5 @@ namespace mpvnet
mp.commandv("show-text", audTracks[aid - 1].Text.Substring(3), "5000"); mp.commandv("show-text", audTracks[aid - 1].Text.Substring(3), "5000");
} }
} }
public static void ManageFileAssociations() => ShowDialog(typeof(SetupWindow)); // deprecated 2019
} }
} }

View File

@@ -41,6 +41,9 @@
F11 playlist-prev #menu: Navigate > Previous File F11 playlist-prev #menu: Navigate > Previous File
F12 playlist-next #menu: Navigate > Next File F12 playlist-next #menu: Navigate > Next File
_ ignore #menu: Navigate > - _ 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 PGUP add chapter 1 #menu: Navigate > Next Chapter
PGDWN add chapter -1 #menu: Navigate > Previous Chapter PGDWN add chapter -1 #menu: Navigate > Previous Chapter
_ ignore #menu: Navigate > - _ ignore #menu: Navigate > -

View File

@@ -2,6 +2,7 @@
input-ar-delay = 500 input-ar-delay = 500
input-ar-rate = 20 input-ar-rate = 20
hwdec = yes hwdec = yes
keep-open = yes
keep-open-pause = no keep-open-pause = no
osd-playing-msg = '${filename}' osd-playing-msg = '${filename}'
screenshot-directory = '~~desktop/' screenshot-directory = '~~desktop/'

View File

@@ -337,8 +337,8 @@ options = [{ name = "yes" },
name = "keep-open" name = "keep-open"
default = "no" default = "no"
filter = "Playback" filter = "Playback"
help = "Unlike mpv, mpv.net never exits automatically." help = "Using no, mpv would terminate after the last file but mpv.net never terminates automatically."
options = [{ name = "yes", help = "Useless in mpv.net because 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 = "no", help = "If the current file ends, go to the next file." },
{ name = "always", help = "Playback will never automatically advance to the next file."}] { name = "always", help = "Playback will never automatically advance to the next file."}]

View File

@@ -4,7 +4,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" 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"> WindowStartupLocation="CenterOwner" ResizeMode="NoResize">
<Grid> <Grid>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center"> <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">

View File

@@ -1,7 +1,6 @@
using System.IO; using System.IO;
using System.Windows; using System.Windows;
using System.Windows.Input; using System.Windows.Input;
using System.Windows.Media;
namespace mpvnet namespace mpvnet
{ {
@@ -10,7 +9,7 @@ namespace mpvnet
public AboutWindow() public AboutWindow()
{ {
InitializeComponent(); 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()})"; mpvVersion.Text = $"{mp.get_property_string("mpv-version")} ({File.GetLastWriteTime(PathHelp.StartupPath + "mpv-1.dll").ToShortDateString()})";
} }