new quick bookmark feature
This commit is contained in:
@@ -36,6 +36,7 @@ namespace mpvnet
|
||||
public static int RecentCount { get; set; } = 15;
|
||||
|
||||
public static float MinimumAspectRatio { get; set; } = 1.2f;
|
||||
public static float QuickBookmark { get; set; }
|
||||
|
||||
public static Extension Extension { get; set; }
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ namespace mpvnet
|
||||
case "playlist-add": PlaylistAdd(Convert.ToInt32(args[0])); break;
|
||||
case "playlist-first": PlaylistFirst(); break;
|
||||
case "playlist-last": PlaylistLast(); break;
|
||||
case "quick-bookmark": QuickBookmark(); break;
|
||||
case "reg-file-assoc": RegisterFileAssociations(args[0]); break;
|
||||
case "scale-window": ScaleWindow(float.Parse(args[0], CultureInfo.InvariantCulture)); break;
|
||||
case "shell-execute": ProcessHelp.ShellExecute(args[0]); break;
|
||||
@@ -241,7 +242,8 @@ namespace mpvnet
|
||||
string text = FormatTime(position.TotalMinutes) + ":" +
|
||||
FormatTime(position.Seconds) + " / " +
|
||||
FormatTime(duration.TotalMinutes) + ":" +
|
||||
FormatTime(duration.Seconds);
|
||||
FormatTime(duration.Seconds) + " " +
|
||||
DateTime.Now.ToString("H:mm dddd d MMMM", CultureInfo.InvariantCulture);
|
||||
|
||||
Core.CommandV("show-text", text, "5000");
|
||||
}
|
||||
@@ -670,5 +672,19 @@ namespace mpvnet
|
||||
|
||||
Core.SetPropertyInt("playlist-pos", pos);
|
||||
}
|
||||
|
||||
public static void QuickBookmark()
|
||||
{
|
||||
if (App.QuickBookmark == 0)
|
||||
{
|
||||
App.QuickBookmark = (float)Core.GetPropertyDouble("time-pos");
|
||||
Core.Command("show-text 'Bookmark Saved'");
|
||||
}
|
||||
else
|
||||
{
|
||||
Core.SetPropertyDouble("time-pos", App.QuickBookmark);
|
||||
App.QuickBookmark = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -479,9 +479,9 @@ namespace mpvnet
|
||||
{
|
||||
if (App.AutoPlay && Paused)
|
||||
SetPropertyBool("pause", false);
|
||||
|
||||
HideLogo();
|
||||
|
||||
App.QuickBookmark = 0;
|
||||
HideLogo();
|
||||
Duration = TimeSpan.FromSeconds(GetPropertyDouble("duration"));
|
||||
|
||||
if (App.StartSize == "video")
|
||||
|
||||
Reference in New Issue
Block a user