Faster trimming

This commit is contained in:
N00MKRAD
2021-03-01 22:38:38 +01:00
parent 4c97b1caf7
commit 5135e8f2ee
5 changed files with 46 additions and 16 deletions

View File

@@ -19,17 +19,19 @@ namespace Flowframes.UI
public static bool doTrimEnd;
public static string trimStart;
public static string trimEnd;
public static long trimStartSecs;
public static long trimEndSecs;
public static void UpdateTrim (TextBox trimStartBox, TextBox trimEndBox)
{
trimStart = trimStartBox.Text.Trim();
trimEnd = trimEndBox.Text.Trim();
long startSecs = FormatUtils.TimestampToSecs(trimStart, false);
long endSecs = FormatUtils.TimestampToSecs(trimEnd, false);
trimStartSecs = FormatUtils.TimestampToSecs(trimStart, false);
trimEndSecs = FormatUtils.TimestampToSecs(trimEnd, false);
if (endSecs <= startSecs)
trimEndBox.Text = FormatUtils.SecsToTimestamp(startSecs + 1);
if (trimEndSecs <= trimStartSecs)
trimEndBox.Text = FormatUtils.SecsToTimestamp(trimStartSecs + 1);
long dur = FormatUtils.TimestampToMs(trimEnd, false) - FormatUtils.TimestampToMs(trimStart, false);
Program.mainForm.currInDurationCut = dur;