several improvements
This commit is contained in:
@@ -5,6 +5,15 @@ not yet released
|
|||||||
- Custom conf folder location feature removed.
|
- Custom conf folder location feature removed.
|
||||||
- Inno Setup replaced with Microsoft Store setup.
|
- Inno Setup replaced with Microsoft Store setup.
|
||||||
- Fix script-opts files being ingnored.
|
- Fix script-opts files being ingnored.
|
||||||
|
- Showing the recent list in the command palette,
|
||||||
|
the top item gets auto selected.
|
||||||
|
https://github.com/stax76/mpv.net/issues/328#issuecomment-1057296054
|
||||||
|
- If the play list is empty, the most recent file
|
||||||
|
gets loaded when pressing space.
|
||||||
|
https://github.com/stax76/mpv.net/issues/328#issuecomment-1057296054
|
||||||
|
- Ctrl+v (previously u) opens files (or URLs) from the clipboard,
|
||||||
|
previously it had to be a file path (format string) and now
|
||||||
|
it can also be the clipboard format of type file.
|
||||||
- libmpv zhongfly 2022-02-27
|
- libmpv zhongfly 2022-02-27
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ namespace mpvnet
|
|||||||
case "open-files": OpenFiles(args); break;
|
case "open-files": OpenFiles(args); break;
|
||||||
case "open-optical-media": Open_DVD_Or_BD_Folder(); break;
|
case "open-optical-media": Open_DVD_Or_BD_Folder(); break;
|
||||||
case "open-url": OpenURL(); break;
|
case "open-url": OpenURL(); break;
|
||||||
|
case "play-pause": PlayPause(); break;
|
||||||
case "playlist-first": PlaylistFirst(); break;
|
case "playlist-first": PlaylistFirst(); break;
|
||||||
case "playlist-last": PlaylistLast(); break;
|
case "playlist-last": PlaylistLast(); break;
|
||||||
case "reg-file-assoc": RegisterFileAssociations(args[0]); break;
|
case "reg-file-assoc": RegisterFileAssociations(args[0]); break;
|
||||||
@@ -117,6 +118,25 @@ namespace mpvnet
|
|||||||
Core.SetPropertyInt("playlist-pos", count - 1);
|
Core.SetPropertyInt("playlist-pos", count - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void PlayPause()
|
||||||
|
{
|
||||||
|
int count = Core.GetPropertyInt("playlist-count");
|
||||||
|
|
||||||
|
if (count > 0)
|
||||||
|
Core.Command("cycle pause");
|
||||||
|
else if (App.Settings.RecentFiles.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (string i in App.Settings.RecentFiles)
|
||||||
|
{
|
||||||
|
if (i.Contains("://") || File.Exists(i))
|
||||||
|
{
|
||||||
|
Core.LoadFiles(new[] { i }, true, false);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void ShowHistory()
|
public static void ShowHistory()
|
||||||
{
|
{
|
||||||
if (File.Exists(Core.ConfigFolder + "history.txt"))
|
if (File.Exists(Core.ConfigFolder + "history.txt"))
|
||||||
@@ -217,7 +237,14 @@ namespace mpvnet
|
|||||||
public static void OpenURL()
|
public static void OpenURL()
|
||||||
{
|
{
|
||||||
App.InvokeOnMainThread(new Action(() => {
|
App.InvokeOnMainThread(new Action(() => {
|
||||||
string clipboard = System.Windows.Forms.Clipboard.GetText();
|
if (WinForms.Clipboard.ContainsFileDropList())
|
||||||
|
{
|
||||||
|
string[] files = WinForms.Clipboard.GetFileDropList().Cast<string>().ToArray();
|
||||||
|
Core.LoadFiles(files, false, Control.ModifierKeys.HasFlag(Keys.Control));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string clipboard = WinForms.Clipboard.GetText();
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(clipboard) || (!clipboard.Contains("://") && !File.Exists(clipboard)) ||
|
if (string.IsNullOrEmpty(clipboard) || (!clipboard.Contains("://") && !File.Exists(clipboard)) ||
|
||||||
clipboard.Contains("\n"))
|
clipboard.Contains("\n"))
|
||||||
@@ -227,6 +254,7 @@ namespace mpvnet
|
|||||||
}
|
}
|
||||||
|
|
||||||
Core.LoadFiles(new [] { clipboard }, false, Control.ModifierKeys.HasFlag(Keys.Control));
|
Core.LoadFiles(new [] { clipboard }, false, Control.ModifierKeys.HasFlag(Keys.Control));
|
||||||
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -449,7 +477,7 @@ namespace mpvnet
|
|||||||
|
|
||||||
public static void ShowRecent() => App.InvokeOnMainThread(ShowRecentInternal);
|
public static void ShowRecent() => App.InvokeOnMainThread(ShowRecentInternal);
|
||||||
|
|
||||||
public static void ShowRecentInternal()
|
static void ShowRecentInternal()
|
||||||
{
|
{
|
||||||
List<CommandPaletteItem> items = new List<CommandPaletteItem>();
|
List<CommandPaletteItem> items = new List<CommandPaletteItem>();
|
||||||
|
|
||||||
@@ -468,6 +496,7 @@ namespace mpvnet
|
|||||||
|
|
||||||
CommandPalette.Instance.SetItems(items);
|
CommandPalette.Instance.SetItems(items);
|
||||||
MainForm.Instance.ShowCommandPalette();
|
MainForm.Instance.ShowCommandPalette();
|
||||||
|
CommandPalette.Instance.SelectFirst();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void RegisterFileAssociations(string perceivedType)
|
public static void RegisterFileAssociations(string perceivedType)
|
||||||
|
|||||||
@@ -713,6 +713,7 @@ namespace mpvnet
|
|||||||
if (App.Settings.RecentFiles.Contains(path))
|
if (App.Settings.RecentFiles.Contains(path))
|
||||||
App.Settings.RecentFiles.Remove(path);
|
App.Settings.RecentFiles.Remove(path);
|
||||||
|
|
||||||
|
if (path != @"bd://" && path != @"dvd://")
|
||||||
App.Settings.RecentFiles.Insert(0, path);
|
App.Settings.RecentFiles.Insert(0, path);
|
||||||
|
|
||||||
while (App.Settings.RecentFiles.Count > App.RecentCount)
|
while (App.Settings.RecentFiles.Count > App.RecentCount)
|
||||||
@@ -1138,8 +1139,7 @@ namespace mpvnet
|
|||||||
|
|
||||||
if (e.Data.GetDataPresent(DataFormats.FileDrop))
|
if (e.Data.GetDataPresent(DataFormats.FileDrop))
|
||||||
Core.LoadFiles(e.Data.GetData(DataFormats.FileDrop) as String[], true, ModifierKeys.HasFlag(Keys.Control));
|
Core.LoadFiles(e.Data.GetData(DataFormats.FileDrop) as String[], true, ModifierKeys.HasFlag(Keys.Control));
|
||||||
|
else if (e.Data.GetDataPresent(DataFormats.Text))
|
||||||
if (e.Data.GetDataPresent(DataFormats.Text))
|
|
||||||
Core.LoadFiles(new[] { e.Data.GetData(DataFormats.Text).ToString() }, true, ModifierKeys.HasFlag(Keys.Control));
|
Core.LoadFiles(new[] { e.Data.GetData(DataFormats.Text).ToString() }, true, ModifierKeys.HasFlag(Keys.Control));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
# https://mpv.io/manual/master/#input
|
# https://mpv.io/manual/master/#input
|
||||||
|
|
||||||
o script-message mpv.net open-files #menu: Open > Open Files...
|
o script-message mpv.net open-files #menu: Open > Open Files...
|
||||||
u script-message mpv.net open-url #menu: Open > Open URL or file path from clipboard
|
Ctrl+v script-message mpv.net open-url #menu: Open > Open URL or file from clipboard
|
||||||
_ script-message mpv.net open-optical-media #menu: Open > Open DVD/Blu-ray Drive/Folder...
|
_ script-message mpv.net open-optical-media #menu: Open > Open DVD/Blu-ray Drive/Folder...
|
||||||
_ ignore #menu: Open > -
|
_ ignore #menu: Open > -
|
||||||
Alt+a script-message mpv.net load-audio #menu: Open > Load external audio files...
|
Alt+a script-message mpv.net load-audio #menu: Open > Load external audio files...
|
||||||
@@ -32,7 +32,7 @@ _ ignore #menu: Open > -
|
|||||||
_ ignore #menu: Open > Recent
|
_ ignore #menu: Open > Recent
|
||||||
|
|
||||||
_ ignore #menu: -
|
_ ignore #menu: -
|
||||||
Space cycle pause #menu: Play/Pause
|
Space script-message mpv.net play-pause #menu: Play/Pause
|
||||||
Ctrl+s stop #menu: Stop
|
Ctrl+s stop #menu: Stop
|
||||||
_ ignore #menu: -
|
_ ignore #menu: -
|
||||||
Enter cycle fullscreen #menu: Toggle Fullscreen
|
Enter cycle fullscreen #menu: Toggle Fullscreen
|
||||||
|
|||||||
Reference in New Issue
Block a user