Fixed scene detection in combination with deduplication

This commit is contained in:
N00MKRAD
2021-01-05 23:55:16 +01:00
parent e519e90966
commit 98c6aedac6
2 changed files with 16 additions and 8 deletions

View File

@@ -234,7 +234,7 @@ namespace Flowframes
public void SetWorking(bool state, bool allowCancel = true)
{
Logger.Log($"SetWorking({state})");
Logger.Log($"SetWorking({state})", true);
Control[] controlsToDisable = new Control[] { runBtn, runStepBtn, stepSelector, settingsBtn, installerBtn };
Control[] controlsToHide = new Control[] { runBtn, runStepBtn, stepSelector };
progressCircle.Visible = state;

View File

@@ -217,14 +217,16 @@ namespace Flowframes.Main
int lastNum = totalFileCount;
if (debug) Logger.Log($"Writing frame {totalFileCount} [Discarding Next]", true);
fileContent += $"file '{interpPath}/{totalFileCount.ToString().PadLeft(Padding.interpFrames, '0')}.{ext}'\n";
//fileContent += $"file '{interpPath}/{totalFileCount.ToString().PadLeft(Padding.interpFrames, '0')}.{ext}'\n";
fileContent = WriteFrameWithDupes(dupesAmount, fileContent, totalFileCount, interpPath, ext, debug);
totalFileCount++;
if (debug) Logger.Log("Discarding interp frames with out num " + totalFileCount);
for (int dupeCount = 1; dupeCount < interpFramesAmount; dupeCount++)
{
if (debug) Logger.Log($"Writing frame {totalFileCount} which is actually repeated frame {lastNum}");
fileContent += $"file '{interpPath}/{lastNum.ToString().PadLeft(Padding.interpFrames, '0')}.{ext}'\n";
//fileContent += $"file '{interpPath}/{lastNum.ToString().PadLeft(Padding.interpFrames, '0')}.{ext}'\n";
fileContent = WriteFrameWithDupes(dupesAmount, fileContent, totalFileCount, interpPath, ext, debug);
totalFileCount++;
}
@@ -232,11 +234,7 @@ namespace Flowframes.Main
}
else
{
for(int writtenDupes = -1; writtenDupes < dupesAmount; writtenDupes++) // Write duplicates
{
if (debug) Logger.Log($"Writing frame {totalFileCount} (writtenDupes {writtenDupes})", true, false);
fileContent += $"file '{interpPath}/{totalFileCount.ToString().PadLeft(Padding.interpFrames, '0')}.{ext}'\n";
}
fileContent = WriteFrameWithDupes(dupesAmount, fileContent, totalFileCount, interpPath, ext, debug);
totalFileCount++;
}
}
@@ -270,5 +268,15 @@ namespace Flowframes.Main
if (debug) Logger.Log($"Copied loop frame to {loopFrameTargetPath}.", true);
}
}
static string WriteFrameWithDupes (int dupesAmount, string fileContent, int totalFileCount, string interpPath, string ext, bool debug)
{
for (int writtenDupes = -1; writtenDupes < dupesAmount; writtenDupes++) // Write duplicates
{
if (debug) Logger.Log($"Writing frame {totalFileCount} (writtenDupes {writtenDupes})", true, false);
fileContent += $"file '{interpPath}/{totalFileCount.ToString().PadLeft(Padding.interpFrames, '0')}.{ext}'\n";
}
return fileContent;
}
}
}