#442 show chapters in the command palette

This commit is contained in:
stax76
2022-06-19 05:23:10 +02:00
parent 55f4a340af
commit 500fe9abc4
7 changed files with 63 additions and 14 deletions

View File

@@ -261,6 +261,13 @@ namespace mpvnet
Action = action;
}
public CommandPaletteItem(string text, string secondaryText, Action action)
{
Text = text;
Action = action;
SecondaryText = secondaryText;
}
public string Text { get; set; } = "";
public string SecondaryText { get; set; } = "";
public Action Action { get; set; }
@@ -283,4 +290,26 @@ namespace mpvnet
});
}
}
public class Chapter
{
public string Title { get; set; }
public double Time { get; set; }
string _TimeDisplay;
public string TimeDisplay {
get {
if (_TimeDisplay == null)
{
_TimeDisplay = TimeSpan.FromSeconds(Time).ToString();
if (_TimeDisplay.ContainsEx("."))
_TimeDisplay = _TimeDisplay.Substring(0, _TimeDisplay.LastIndexOf("."));
}
return _TimeDisplay;
}
}
}
}