new config setting recent-count added
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
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
|
||||
- new config setting recent-count added, amount of menu items
|
||||
shown under 'Open > Recent'
|
||||
|
||||
### 5.2.1.3
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ namespace mpvnet
|
||||
public static bool ThemedMenu { get; set; }
|
||||
|
||||
public static int StartThreshold { get; set; } = 1500;
|
||||
public static int RecentCount { get; set; } = 15;
|
||||
|
||||
public static float MinimumAspectRatio { get; set; } = 1.3f;
|
||||
|
||||
@@ -117,6 +118,7 @@ namespace mpvnet
|
||||
case "minimum-aspect-ratio": MinimumAspectRatio = value.Float(); return true;
|
||||
case "auto-load-folder": AutoLoadFolder = value == "yes"; return true;
|
||||
case "themed-menu": ThemedMenu = value == "yes"; return true;
|
||||
case "recent-count": RecentCount = value.Int(); return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
input-default-bindings = no
|
||||
input-ar-delay = 500
|
||||
input-ar-rate = 20
|
||||
hwdec = yes
|
||||
keep-open = yes
|
||||
keep-open-pause = no
|
||||
osd-playing-msg = '${filename}'
|
||||
screenshot-directory = '~~desktop/'
|
||||
script-opts=osc-scalewindowed=1.5
|
||||
screenshot-directory = '~~desktop/'
|
||||
cscale = spline36
|
||||
dscale = spline36
|
||||
scale = spline36
|
||||
scale = spline36
|
||||
hwdec = yes
|
||||
@@ -22,6 +22,11 @@ help = "Enable this only when a developer asks for it. (mpv.net specific setting
|
||||
options = [{ name = "yes" },
|
||||
{ name = "no" }]
|
||||
|
||||
[[settings]]
|
||||
name = "recent-count"
|
||||
filter = "General"
|
||||
help = "<int> Amount of recent files to be remembered. Default: 15"
|
||||
|
||||
[[settings]]
|
||||
name = "start-size"
|
||||
default = "previous"
|
||||
|
||||
@@ -96,7 +96,7 @@ namespace mpvnet
|
||||
public Delegate Delegate { get; set; }
|
||||
public string FilePath { get; set; }
|
||||
|
||||
public void Invoke() => Task.Run(() => { PowerShellScript.Execute(File.ReadAllText(FilePath), null); });
|
||||
public void Invoke() => Task.Run(() => PowerShellScript.Execute(File.ReadAllText(FilePath), null));
|
||||
|
||||
public void InvokeEndFileEventMode(EndFileEventMode arg)
|
||||
{
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace mpvnet
|
||||
foreach (MediaTrack track in vidTracks)
|
||||
{
|
||||
MenuItem mi = new MenuItem(track.Text);
|
||||
mi.Action = () => { mp.commandv("set", "vid", track.ID.ToString()); };
|
||||
mi.Action = () => mp.commandv("set", "vid", track.ID.ToString());
|
||||
mi.Checked = mp.Vid == track.ID.ToString();
|
||||
trackMenuItem.DropDownItems.Add(mi);
|
||||
}
|
||||
@@ -137,7 +137,7 @@ namespace mpvnet
|
||||
foreach (MediaTrack track in audTracks)
|
||||
{
|
||||
MenuItem mi = new MenuItem(track.Text);
|
||||
mi.Action = () => { mp.commandv("set", "aid", track.ID.ToString()); };
|
||||
mi.Action = () => mp.commandv("set", "aid", track.ID.ToString());
|
||||
mi.Checked = mp.Aid == track.ID.ToString();
|
||||
trackMenuItem.DropDownItems.Add(mi);
|
||||
}
|
||||
@@ -148,7 +148,7 @@ namespace mpvnet
|
||||
foreach (MediaTrack track in subTracks)
|
||||
{
|
||||
MenuItem mi = new MenuItem(track.Text);
|
||||
mi.Action = () => { mp.commandv("set", "sid", track.ID.ToString()); };
|
||||
mi.Action = () => mp.commandv("set", "sid", track.ID.ToString());
|
||||
mi.Checked = mp.Sid == track.ID.ToString();
|
||||
trackMenuItem.DropDownItems.Add(mi);
|
||||
}
|
||||
@@ -156,7 +156,7 @@ namespace mpvnet
|
||||
if (subTracks.Length > 0)
|
||||
{
|
||||
MenuItem mi = new MenuItem("S: No subtitles");
|
||||
mi.Action = () => { mp.commandv("set", "sid", "no"); };
|
||||
mi.Action = () => mp.commandv("set", "sid", "no");
|
||||
mi.Checked = mp.Sid == "no";
|
||||
trackMenuItem.DropDownItems.Add(mi);
|
||||
}
|
||||
@@ -167,7 +167,7 @@ namespace mpvnet
|
||||
foreach (MediaTrack track in ediTracks)
|
||||
{
|
||||
MenuItem mi = new MenuItem(track.Text);
|
||||
mi.Action = () => { mp.commandv("set", "edition", track.ID.ToString()); };
|
||||
mi.Action = () => mp.commandv("set", "edition", track.ID.ToString());
|
||||
mi.Checked = mp.Edition == track.ID;
|
||||
trackMenuItem.DropDownItems.Add(mi);
|
||||
}
|
||||
@@ -186,7 +186,7 @@ namespace mpvnet
|
||||
{
|
||||
MenuItem mi = new MenuItem(i.Key);
|
||||
mi.ShortcutKeyDisplayString = TimeSpan.FromSeconds(i.Value).ToString().Substring(0, 8) + " ";
|
||||
mi.Action = () => { mp.commandv("seek", i.Value.ToString(CultureInfo.InvariantCulture), "absolute"); };
|
||||
mi.Action = () => mp.commandv("seek", i.Value.ToString(CultureInfo.InvariantCulture), "absolute");
|
||||
chaptersMenuItem.DropDownItems.Add(mi);
|
||||
}
|
||||
}
|
||||
@@ -377,7 +377,7 @@ namespace mpvnet
|
||||
}));
|
||||
if (RecentFiles.Contains(path)) RecentFiles.Remove(path);
|
||||
RecentFiles.Insert(0, path);
|
||||
if (RecentFiles.Count > 15) RecentFiles.RemoveAt(15);
|
||||
while (RecentFiles.Count > App.RecentCount) RecentFiles.RemoveAt(App.RecentCount);
|
||||
}
|
||||
|
||||
protected override CreateParams CreateParams {
|
||||
@@ -530,8 +530,8 @@ namespace mpvnet
|
||||
CheckClipboardForURL();
|
||||
Cursor.Position = new Point(Cursor.Position.X + 1, Cursor.Position.Y);
|
||||
WasShown = true;
|
||||
Task.Run(() => { mp.LoadScripts(); });
|
||||
Task.Run(() => { mp.Extension = new Extension(); });
|
||||
Task.Run(() => mp.LoadScripts());
|
||||
Task.Run(() => mp.Extension = new Extension());
|
||||
}
|
||||
|
||||
protected override void OnActivated(EventArgs e)
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace mpvnet
|
||||
{
|
||||
LoadLibrary("mpv-1.dll");
|
||||
Handle = mpv_create();
|
||||
Task.Run(() => { EventLoop(); });
|
||||
Task.Run(() => EventLoop());
|
||||
|
||||
if (App.IsStartedFromTerminal)
|
||||
{
|
||||
@@ -676,7 +676,7 @@ namespace mpvnet
|
||||
string path = get_property_string("path");
|
||||
if (!File.Exists(path) || get_property_int("playlist-count") != 1) return;
|
||||
List<string> files = Directory.GetFiles(Path.GetDirectoryName(path)).ToList();
|
||||
files = files.Where((file) =>
|
||||
files = files.Where(file =>
|
||||
App.VideoTypes.Contains(file.ShortExt()) ||
|
||||
App.AudioTypes.Contains(file.ShortExt()) ||
|
||||
App.ImageTypes.Contains(file.ShortExt())).ToList();
|
||||
|
||||
Reference in New Issue
Block a user