This commit is contained in:
stax76
2022-05-21 10:58:39 +02:00
parent cd84819a03
commit 27f7935127
7 changed files with 10 additions and 6 deletions

View File

@@ -25,7 +25,7 @@ namespace mpvnet
static void Execute(string file)
{
string code = File.ReadAllText(file);
string filename = Path.GetFileNameWithoutExtension(file) + " " + StringHelp.GetMD5Hash(code) + "-v5.dll";
string filename = Path.GetFileNameWithoutExtension(file) + " " + StringHelp.GetMD5Hash(code) + "-v6.dll";
string outputFile = Path.Combine(Path.GetTempPath(), filename);
if (!File.Exists(outputFile))

View File

@@ -678,7 +678,9 @@ namespace mpvnet
if (App.QuickBookmark == 0)
{
App.QuickBookmark = (float)Core.GetPropertyDouble("time-pos");
Core.Command("show-text 'Bookmark Saved'");
if (App.QuickBookmark != 0)
Core.Command("show-text 'Bookmark Saved'");
}
else
{

View File

@@ -954,7 +954,7 @@ namespace mpvnet
void UpdateProgressBar()
{
if (Core.TaskbarProgress && Taskbar != null)
Taskbar.SetValue(Core.GetPropertyDouble("time-pos"), Core.Duration.TotalSeconds);
Taskbar.SetValue(Core.GetPropertyDouble("time-pos", false), Core.Duration.TotalSeconds);
}
void PropChangeOnTop(bool value) => BeginInvoke(new Action(() => TopMost = value));

View File

@@ -802,11 +802,11 @@ namespace mpvnet
return lpBuffer.ToInt64();
}
public double GetPropertyDouble(string name)
public double GetPropertyDouble(string name, bool handleError = true)
{
mpv_error err = mpv_get_property(Handle, GetUtf8Bytes(name),
mpv_format.MPV_FORMAT_DOUBLE, out double value);
if (err < 0 && (App.DebugMode || App.DebuggerAttached))
if (err < 0 && handleError && (App.DebugMode || App.DebuggerAttached))
HandleError(err, $"error getting property: {name}");
return value;
}