diff --git a/Code/Form1.Designer.cs b/Code/Form1.Designer.cs index a317938..e0221bd 100644 --- a/Code/Form1.Designer.cs +++ b/Code/Form1.Designer.cs @@ -1317,7 +1317,6 @@ this.runStepBtn.TabIndex = 42; this.runStepBtn.Text = "Run This Step"; this.runStepBtn.UseVisualStyleBackColor = false; - this.runStepBtn.Visible = false; this.runStepBtn.Click += new System.EventHandler(this.runStepBtn_Click); // // stepSelector @@ -1339,7 +1338,6 @@ this.stepSelector.Name = "stepSelector"; this.stepSelector.Size = new System.Drawing.Size(203, 24); this.stepSelector.TabIndex = 73; - this.stepSelector.Visible = false; // // Form1 // @@ -1349,6 +1347,7 @@ this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(32)))), ((int)(((byte)(32))))); this.ClientSize = new System.Drawing.Size(934, 501); this.Controls.Add(this.cancelBtn); + this.Controls.Add(this.runBtn); this.Controls.Add(this.stepSelector); this.Controls.Add(this.runStepBtn); this.Controls.Add(this.updateBtn); @@ -1364,7 +1363,6 @@ this.Controls.Add(this.panel1); this.Controls.Add(this.logBox); this.Controls.Add(this.progressCircle); - this.Controls.Add(this.runBtn); this.Controls.Add(this.titleLabel); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); diff --git a/Code/Form1.cs b/Code/Form1.cs index 73c5c9a..4ffec3b 100644 --- a/Code/Form1.cs +++ b/Code/Form1.cs @@ -50,7 +50,7 @@ namespace Flowframes ConfigParser.LoadComboxIndex(aiCombox); Setup.Init(); - UpdateStepByStepControls(); + UpdateStepByStepControls(true); Initialized(); Checks(); @@ -240,6 +240,7 @@ namespace Flowframes foreach (Control c in controlsToHide) c.Visible = !state; Program.busy = state; + Program.mainForm.UpdateStepByStepControls(false); } private void aiCombox_SelectedIndexChanged(object sender, EventArgs e) @@ -367,18 +368,21 @@ namespace Flowframes SetTab("interpolation"); } - public void UpdateStepByStepControls () + public void UpdateStepByStepControls (bool 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" }); - stepSelector.SelectedIndex = 0; + 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" }); + stepSelector.SelectedIndex = 0; + } bool stepByStep = Config.GetInt("processingMode") == 1; - stepSelector.Visible = stepByStep; - runStepBtn.Visible = stepByStep; - runBtn.Visible = !stepByStep; + //stepSelector.Visible = stepByStep && !Program.busy; + //runStepBtn.Visible = stepByStep && !Program.busy; + runBtn.Visible = !stepByStep && !Program.busy; } private async void runStepBtn_Click(object sender, EventArgs e) diff --git a/Code/Forms/SettingsForm.cs b/Code/Forms/SettingsForm.cs index 4648986..a5ff429 100644 --- a/Code/Forms/SettingsForm.cs +++ b/Code/Forms/SettingsForm.cs @@ -30,7 +30,7 @@ namespace Flowframes.Forms private void SettingsForm_FormClosing(object sender, FormClosingEventArgs e) { SaveSettings(); - Program.mainForm.UpdateStepByStepControls(); + Program.mainForm.UpdateStepByStepControls(true); } void SaveSettings () diff --git a/Code/Main/Interpolate.cs b/Code/Main/Interpolate.cs index d19abf1..a4075f4 100644 --- a/Code/Main/Interpolate.cs +++ b/Code/Main/Interpolate.cs @@ -160,9 +160,9 @@ namespace Flowframes bool useTimestamps = Config.GetInt("timingMode") == 1; // TODO: Auto-Disable timestamps if input frames are sequential, not timestamped if(sbsMode) - await VfrDedupe.CreateTimecodeFiles(currentFramesPath, Config.GetBool("enableLoop"), firstFrameFix, -1, useTimestamps); + await VfrDedupe.CreateTimecodeFiles(currentFramesPath, Config.GetBool("enableLoop"), firstFrameFix, -1, !useTimestamps); else - await VfrDedupe.CreateTimecodeFiles(currentFramesPath, Config.GetBool("enableLoop"), firstFrameFix, lastInterpFactor, useTimestamps); + await VfrDedupe.CreateTimecodeFiles(currentFramesPath, Config.GetBool("enableLoop"), firstFrameFix, lastInterpFactor, !useTimestamps); if (canceled) return; @@ -182,8 +182,8 @@ namespace Flowframes public static async Task RunAi(string outpath, int targetFrames, int tilesize, AI ai) { - //currentlyUsingAutoEnc = IOUtils.GetAmountOfFiles(currentFramesPath, false) >= (AutoEncode.chunkSize + AutoEncode.safetyBufferFrames) * 1.2f; TODO: Enable me for v18!! - currentlyUsingAutoEnc = false; + currentlyUsingAutoEnc = IOUtils.GetAmountOfFiles(currentFramesPath, false) >= (AutoEncode.chunkSize + AutoEncode.safetyBufferFrames) * 1.2f; + Directory.CreateDirectory(outpath); List tasks = new List(); @@ -200,8 +200,8 @@ namespace Flowframes if (ai.aiName == Networks.rifeNcnn.aiName) tasks.Add(AiProcess.RunRifeNcnnMulti(currentFramesPath, outpath, tilesize, interpFactor)); - if(currentlyUsingAutoEnc) - tasks.Add(AutoEncode.MainLoop(outpath)); + //if(currentlyUsingAutoEnc) + // tasks.Add(AutoEncode.MainLoop(outpath)); await Task.WhenAll(tasks); } @@ -245,7 +245,6 @@ namespace Flowframes Logger.Log("Canceled interpolation."); if (!string.IsNullOrWhiteSpace(reason) && !noMsgBox) Utils.ShowMessage($"Canceled:\n\n{reason}"); - Program.mainForm.UpdateStepByStepControls(); // This is needed, idk why } public static void Cleanup(string interpFramesDir, bool ignoreKeepSetting = false) diff --git a/Code/Main/VfrDedupe.cs b/Code/Main/VfrDedupe.cs index 2dd9fb6..14c5602 100644 --- a/Code/Main/VfrDedupe.cs +++ b/Code/Main/VfrDedupe.cs @@ -38,6 +38,9 @@ namespace Flowframes.Main if (Interpolate.canceled) return; Logger.Log($"Generating timecodes for {interpFactor}x...", false, true); + if(noTimestamps) + Logger.Log("Timestamps are disabled, using static frame rate."); + bool sceneDetection = true; if(frameFiles == null || frameFiles.Length < 1)