step-by-step UX improvements

Run scene detection and deduplication in extraction step, don't reset the combox index after opening and closing settings window
This commit is contained in:
N00MKRAD
2021-02-21 12:39:25 +01:00
parent 1d04d2d3ee
commit 5f3ffc8c4a
5 changed files with 34 additions and 26 deletions

View File

@@ -1251,11 +1251,10 @@
this.stepSelector.ForeColor = System.Drawing.Color.White;
this.stepSelector.FormattingEnabled = true;
this.stepSelector.Items.AddRange(new object[] {
"1) Extract Scene Changes",
"2) Extract Video Frames",
"3) Run Interpolation",
"4) Create Output Video",
"5) Reset/Cleanup"});
"1) Import/Extract Frames",
"2) Run Interpolation",
"3) Export",
"4) Cleanup & Reset"});
this.stepSelector.Location = new System.Drawing.Point(12, 418);
this.stepSelector.Margin = new System.Windows.Forms.Padding(3, 3, 3, 0);
this.stepSelector.Name = "stepSelector";

View File

@@ -59,7 +59,7 @@ namespace Flowframes
InitAis();
InterpolateUtils.preview = previewPicturebox;
UpdateStepByStepControls(true);
UpdateStepByStepControls();
Initialized();
Checks();
@@ -309,7 +309,7 @@ namespace Flowframes
c.Visible = !state;
cancelBtn.Enabled = allowCancel;
Program.busy = state;
Program.mainForm.UpdateStepByStepControls(false);
Program.mainForm.UpdateStepByStepControls();
}
string lastAiComboxStr = "";
@@ -455,17 +455,10 @@ namespace Flowframes
SetTab("interpolation");
}
public void UpdateStepByStepControls(bool settingsMayHaveChanged)
public void UpdateStepByStepControls()
{
if (settingsMayHaveChanged)
{
stepSelector.Items.Clear();
if (Config.GetBool("scnDetect"))
stepSelector.Items.AddRange(new string[] { "1) Extract Scene Changes", "2) Import/Extract Frames", "3) Run Interpolation", "4) Export", "5) Cleanup & Reset" });
else
stepSelector.Items.AddRange(new string[] { "1) Import/Extract Frames", "2) Run Interpolation", "3) Export", "4) Cleanup & Reset" });
if(stepSelector.SelectedIndex < 0)
stepSelector.SelectedIndex = 0;
}
bool stepByStep = Config.GetInt("processingMode") == 1;
runBtn.Visible = !stepByStep && !Program.busy;

View File

@@ -166,6 +166,7 @@
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.label65 = new System.Windows.Forms.Label();
this.rifeCudaFp16 = new System.Windows.Forms.CheckBox();
this.label66 = new System.Windows.Forms.Label();
this.settingsTabList.SuspendLayout();
this.generalTab.SuspendLayout();
this.tabListPage2.SuspendLayout();
@@ -823,6 +824,7 @@
// aiOptsPage
//
this.aiOptsPage.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
this.aiOptsPage.Controls.Add(this.label66);
this.aiOptsPage.Controls.Add(this.rifeCudaFp16);
this.aiOptsPage.Controls.Add(this.label65);
this.aiOptsPage.Controls.Add(this.label35);
@@ -1907,6 +1909,17 @@
this.rifeCudaFp16.TabIndex = 82;
this.rifeCudaFp16.UseVisualStyleBackColor = true;
//
// label66
//
this.label66.AutoSize = true;
this.label66.ForeColor = System.Drawing.Color.Silver;
this.label66.Location = new System.Drawing.Point(308, 211);
this.label66.Margin = new System.Windows.Forms.Padding(10, 10, 10, 7);
this.label66.Name = "label66";
this.label66.Size = new System.Drawing.Size(290, 13);
this.label66.TabIndex = 83;
this.label66.Text = "Only recommended for GeForce RTX or recent Tesla GPUs.";
//
// SettingsForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -2083,5 +2096,6 @@
private System.Windows.Forms.Panel panel13;
private System.Windows.Forms.CheckBox rifeCudaFp16;
private System.Windows.Forms.Label label65;
private System.Windows.Forms.Label label66;
}
}

View File

@@ -46,7 +46,7 @@ namespace Flowframes.Forms
private void SettingsForm_FormClosing(object sender, FormClosingEventArgs e)
{
SaveSettings();
Program.mainForm.UpdateStepByStepControls(true);
Program.mainForm.UpdateStepByStepControls();
}
void SaveSettings ()

View File

@@ -28,13 +28,13 @@ namespace Flowframes.Main
if (!InterpolateUtils.InputIsValid(current.inPath, current.outPath, current.outFps, current.interpFactor, current.outMode)) return; // General input checks
if (step.Contains("Extract Scene Changes"))
{
if (!current.inputIsFrames) // Input is video - extract frames first
await ExtractSceneChanges();
else
InterpolateUtils.ShowMessage("Scene changes can only be extracted from videos, not frames!", "Error");
}
// if (step.Contains("Extract Scene Changes"))
// {
// if (!current.inputIsFrames) // Input is video - extract frames first
// await ExtractSceneChanges();
// else
// InterpolateUtils.ShowMessage("Scene changes can only be extracted from videos, not frames!", "Error");
// }
if (step.Contains("Extract Frames"))
await ExtractFramesStep();
@@ -68,6 +68,9 @@ namespace Flowframes.Main
public static async Task ExtractFramesStep()
{
if (!current.inputIsFrames) // Input is video - extract frames first
await ExtractSceneChanges();
if (!IOUtils.TryDeleteIfExists(current.framesFolder))
{
InterpolateUtils.ShowMessage("Failed to delete existing frames folder - Make sure no file is opened in another program!", "Error");
@@ -78,6 +81,7 @@ namespace Flowframes.Main
AiProcess.filenameMap.Clear();
await GetFrames(true);
await PostProcessFrames(true);
}
public static async Task DoInterpolate()
@@ -101,8 +105,6 @@ namespace Flowframes.Main
//if (Config.GetBool("sbsAllowAutoEnc"))
// nextOutPath = Path.Combine(currentOutPath, Path.GetFileNameWithoutExtension(current.inPath) + IOUtils.GetAiSuffix(current.ai, current.interpFactor) + InterpolateUtils.GetExt(current.outMode));
await PostProcessFrames(true);
if (canceled) return;
Program.mainForm.SetStatus("Running AI...");
await RunAi(current.interpFolder, current.ai, true);