Fixed batch processing FPS loading not working correctly

This commit is contained in:
N00MKRAD
2020-12-03 22:06:58 +01:00
parent 896e656e03
commit 8c8731b99b
2 changed files with 11 additions and 12 deletions

View File

@@ -56,7 +56,7 @@ namespace Flowframes
Checks(); Checks();
} }
void Checks () void Checks()
{ {
GetWebInfo.LoadNews(newsLabel); GetWebInfo.LoadNews(newsLabel);
GetWebInfo.LoadPatronList(patronsLabel); GetWebInfo.LoadPatronList(patronsLabel);
@@ -67,9 +67,9 @@ namespace Flowframes
public bool IsInFocus() { return (ActiveForm == this); } public bool IsInFocus() { return (ActiveForm == this); }
public void SetTab (string tabName) public void SetTab(string tabName)
{ {
foreach(TabPage tab in mainTabControl.TabPages) foreach (TabPage tab in mainTabControl.TabPages)
{ {
if (tab.Text.ToLower() == tabName.ToLower()) if (tab.Text.ToLower() == tabName.ToLower())
mainTabControl.SelectedTab = tab; mainTabControl.SelectedTab = tab;
@@ -153,17 +153,18 @@ namespace Flowframes
public void runBtn_Click(object sender, EventArgs e) public void runBtn_Click(object sender, EventArgs e)
{ {
SetTab("interpolate"); if (!BatchProcessing.busy) // Don't load values from gui if batch processing is used
if (!BatchProcessing.busy) {
SetTab("interpolation"); SetTab("interpolation");
Interpolate.SetFps(fpsInTbox.GetFloat()); Interpolate.SetFps(fpsInTbox.GetFloat());
Interpolate.interpFactor = interpFactorCombox.GetInt(); Interpolate.interpFactor = interpFactorCombox.GetInt();
}
string inPath = inputTbox.Text.Trim(); string inPath = inputTbox.Text.Trim();
string outPath = outputTbox.Text.Trim(); string outPath = outputTbox.Text.Trim();
Interpolate.Start(inPath, outPath, GetTilesize(), GetOutMode(), GetAi()); Interpolate.Start(inPath, outPath, GetTilesize(), GetOutMode(), GetAi());
} }
public int GetTilesize () public int GetTilesize()
{ {
if (GetAi().supportsTiling) if (GetAi().supportsTiling)
return tilesize.GetInt(); return tilesize.GetInt();
@@ -248,7 +249,7 @@ namespace Flowframes
tilesize.Visible = GetAi().supportsTiling; tilesize.Visible = GetAi().supportsTiling;
tilesizeNotAvailLabel.Visible = !tilesize.Visible; tilesizeNotAvailLabel.Visible = !tilesize.Visible;
interpFactorCombox_SelectedIndexChanged(null, null); interpFactorCombox_SelectedIndexChanged(null, null);
if(GetAi().supportsTiling) if (GetAi().supportsTiling)
tilesize.Text = Config.GetInt($"tilesize_{GetAi().aiName}").ToString(); tilesize.Text = Config.GetInt($"tilesize_{GetAi().aiName}").ToString();
} }
@@ -368,7 +369,7 @@ namespace Flowframes
SetTab("interpolation"); SetTab("interpolation");
} }
public void UpdateStepByStepControls (bool settingsMayHaveChanged) public void UpdateStepByStepControls(bool settingsMayHaveChanged)
{ {
if (settingsMayHaveChanged) if (settingsMayHaveChanged)
{ {

View File

@@ -132,13 +132,11 @@ namespace Flowframes.Main
ShowMessage("Invalid target frame rate - Must be 1-500."); ShowMessage("Invalid target frame rate - Must be 1-500.");
passes = false; passes = false;
} }
if (tilesize % 32 != 0 || tilesize < 128) if (tilesize % 32 != 0 || tilesize < 128)
{ {
ShowMessage("Tile size is not valid - Must be a multiple of 32 and at least 128!"); ShowMessage("Tile size is not valid - Must be a multiple of 32 and at least 128!");
passes = false; passes = false;
} }
if (!passes) if (!passes)
i.Cancel("Invalid settings detected."); i.Cancel("Invalid settings detected.");
return passes; return passes;