diff --git a/CodeLegacy/Data/Implementations.cs b/CodeLegacy/Data/Implementations.cs index fc75fd5..c8908eb 100644 --- a/CodeLegacy/Data/Implementations.cs +++ b/CodeLegacy/Data/Implementations.cs @@ -9,8 +9,8 @@ namespace Flowframes.Data public enum Ai { RifeCuda, - RifeNcnn, RifeNcnnVs, + RifeNcnn, FlavrCuda, DainNcnn, XvfiCuda, @@ -85,8 +85,8 @@ namespace Flowframes.Data private static readonly Dictionary AiLookup = new Dictionary { { Ai.RifeCuda, rifeCuda }, - { Ai.RifeNcnn, rifeNcnn }, { Ai.RifeNcnnVs, rifeNcnnVs }, + { Ai.RifeNcnn, rifeNcnn }, { Ai.FlavrCuda, flavrCuda }, { Ai.DainNcnn, dainNcnn }, { Ai.XvfiCuda, xvfiCuda }, diff --git a/CodeLegacy/Flowframes.csproj b/CodeLegacy/Flowframes.csproj index 87919eb..9e14d44 100644 --- a/CodeLegacy/Flowframes.csproj +++ b/CodeLegacy/Flowframes.csproj @@ -1,6 +1,7 @@  - + + Debug @@ -87,9 +88,6 @@ packages\CircularProgressBar.2.8.0.16\lib\net40\CircularProgressBar.dll - - packages\Costura.Fody.5.8.0-alpha0098\lib\netstandard1.0\Costura.dll - packages\Crc32.NET.1.2.0\lib\net20\Crc32.NET.dll @@ -106,13 +104,23 @@ packages\HTAlt.Standart.0.1.6\lib\netstandard2.0\HTAlt.Standart.dll - - packages\Magick.NET-Q8-AnyCPU.13.10.0\lib\netstandard20\Magick.NET-Q8-AnyCPU.dll + + packages\Magick.NET-Q8-x64.13.10.0\lib\netstandard20\Magick.NET-Q8-x64.dll packages\Magick.NET.Core.13.10.0\lib\netstandard20\Magick.NET.Core.dll + + packages\Microsoft.Build.Framework.15.9.20\lib\net46\Microsoft.Build.Framework.dll + + + packages\Microsoft.Build.Utilities.Core.15.9.20\lib\net46\Microsoft.Build.Utilities.Core.dll + + + packages\Microsoft.VisualStudio.Setup.Configuration.Interop.1.16.30\lib\net35\Microsoft.VisualStudio.Setup.Configuration.Interop.dll + True + packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll True @@ -150,7 +158,11 @@ packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll + + packages\System.Collections.Immutable.1.5.0\lib\netstandard2.0\System.Collections.Immutable.dll + + packages\System.Console.4.3.1\lib\net46\System.Console.dll True @@ -579,6 +591,7 @@ + @@ -626,13 +639,19 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - + + + + + + + $(MSBuildThisFileDirectory)bin\x64\Release + + + + + - - - + \ No newline at end of file diff --git a/CodeLegacy/Forms/SettingsForm.Designer.cs b/CodeLegacy/Forms/SettingsForm.Designer.cs index fe09b26..ab23662 100644 --- a/CodeLegacy/Forms/SettingsForm.Designer.cs +++ b/CodeLegacy/Forms/SettingsForm.Designer.cs @@ -38,9 +38,6 @@ this.custOutDir = new System.Windows.Forms.TextBox(); this.outFolderLoc = new System.Windows.Forms.ComboBox(); this.label78 = new System.Windows.Forms.Label(); - this.label77 = new System.Windows.Forms.Label(); - this.disablePreview = new System.Windows.Forms.CheckBox(); - this.label76 = new System.Windows.Forms.Label(); this.modelDownloaderBtn = new HTAlt.WinForms.HTButton(); this.exportNamePatternLoop = new System.Windows.Forms.TextBox(); this.label69 = new System.Windows.Forms.Label(); @@ -191,6 +188,7 @@ this.settingsTabList.Name = "settingsTabList"; this.settingsTabList.Size = new System.Drawing.Size(920, 427); this.settingsTabList.TabIndex = 0; + this.settingsTabList.SelectedIndexChanged += new System.EventHandler(this.settingsTabList_SelectedIndexChanged); // // generalTab // @@ -201,9 +199,6 @@ this.generalTab.Controls.Add(this.custOutDir); this.generalTab.Controls.Add(this.outFolderLoc); this.generalTab.Controls.Add(this.label78); - this.generalTab.Controls.Add(this.label77); - this.generalTab.Controls.Add(this.disablePreview); - this.generalTab.Controls.Add(this.label76); this.generalTab.Controls.Add(this.modelDownloaderBtn); this.generalTab.Controls.Add(this.exportNamePatternLoop); this.generalTab.Controls.Add(this.label69); @@ -236,7 +231,7 @@ this.btnResetHwEnc.FlatAppearance.BorderSize = 0; this.btnResetHwEnc.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnResetHwEnc.ForeColor = System.Drawing.Color.White; - this.btnResetHwEnc.Location = new System.Drawing.Point(280, 245); + this.btnResetHwEnc.Location = new System.Drawing.Point(280, 215); this.btnResetHwEnc.Name = "btnResetHwEnc"; this.btnResetHwEnc.Size = new System.Drawing.Size(206, 23); this.btnResetHwEnc.TabIndex = 95; @@ -247,7 +242,7 @@ // label10 // this.label10.AutoSize = true; - this.label10.Location = new System.Drawing.Point(10, 250); + this.label10.Location = new System.Drawing.Point(10, 220); this.label10.Margin = new System.Windows.Forms.Padding(10, 10, 10, 7); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(186, 13); @@ -303,43 +298,13 @@ this.label78.TabIndex = 90; this.label78.Text = "Default Output Location"; // - // label77 - // - this.label77.AutoSize = true; - this.label77.ForeColor = System.Drawing.Color.Silver; - this.label77.Location = new System.Drawing.Point(308, 190); - this.label77.Margin = new System.Windows.Forms.Padding(10, 10, 10, 7); - this.label77.Name = "label77"; - this.label77.Size = new System.Drawing.Size(270, 13); - this.label77.TabIndex = 89; - this.label77.Text = "You need to restart the application to apply this change."; - // - // disablePreview - // - this.disablePreview.AutoSize = true; - this.disablePreview.Location = new System.Drawing.Point(280, 190); - this.disablePreview.Name = "disablePreview"; - this.disablePreview.Size = new System.Drawing.Size(15, 14); - this.disablePreview.TabIndex = 88; - this.disablePreview.UseVisualStyleBackColor = true; - // - // label76 - // - this.label76.AutoSize = true; - this.label76.Location = new System.Drawing.Point(10, 190); - this.label76.Margin = new System.Windows.Forms.Padding(10, 10, 10, 7); - this.label76.Name = "label76"; - this.label76.Size = new System.Drawing.Size(105, 13); - this.label76.TabIndex = 87; - this.label76.Text = "Disable Preview Tab"; - // // modelDownloaderBtn // this.modelDownloaderBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); this.modelDownloaderBtn.FlatAppearance.BorderSize = 0; this.modelDownloaderBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.modelDownloaderBtn.ForeColor = System.Drawing.Color.White; - this.modelDownloaderBtn.Location = new System.Drawing.Point(492, 215); + this.modelDownloaderBtn.Location = new System.Drawing.Point(492, 185); this.modelDownloaderBtn.Name = "modelDownloaderBtn"; this.modelDownloaderBtn.Size = new System.Drawing.Size(206, 23); this.modelDownloaderBtn.TabIndex = 86; @@ -414,7 +379,7 @@ this.clearModelCacheBtn.FlatAppearance.BorderSize = 0; this.clearModelCacheBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.clearModelCacheBtn.ForeColor = System.Drawing.Color.White; - this.clearModelCacheBtn.Location = new System.Drawing.Point(280, 215); + this.clearModelCacheBtn.Location = new System.Drawing.Point(280, 185); this.clearModelCacheBtn.Name = "clearModelCacheBtn"; this.clearModelCacheBtn.Size = new System.Drawing.Size(206, 23); this.clearModelCacheBtn.TabIndex = 79; @@ -425,7 +390,7 @@ // label64 // this.label64.AutoSize = true; - this.label64.Location = new System.Drawing.Point(10, 220); + this.label64.Location = new System.Drawing.Point(10, 190); this.label64.Margin = new System.Windows.Forms.Padding(10, 10, 10, 7); this.label64.Name = "label64"; this.label64.Size = new System.Drawing.Size(165, 13); @@ -1788,13 +1753,12 @@ // resetBtn // this.resetBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); - this.resetBtn.ButtonImage = global::Flowframes.Properties.Resources.baseline_restart_alt_white_48dp; + this.resetBtn.ButtonImage = global::Flowframes.Properties.Resources.baseline_restart_alt_white_48dp_40px; this.resetBtn.DrawImage = true; this.resetBtn.FlatAppearance.BorderSize = 0; this.resetBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.resetBtn.ForeColor = System.Drawing.Color.White; this.resetBtn.ImageIndex = 0; - this.resetBtn.ImageSizeMode = HTAlt.WinForms.HTButton.ButtonImageSizeMode.Zoom; this.resetBtn.Location = new System.Drawing.Point(889, 12); this.resetBtn.Name = "resetBtn"; this.resetBtn.Size = new System.Drawing.Size(40, 40); @@ -1964,9 +1928,6 @@ private System.Windows.Forms.Label label58; private System.Windows.Forms.Panel autoEncBlockPanel; private HTAlt.WinForms.HTButton resetBtn; - private System.Windows.Forms.CheckBox disablePreview; - private System.Windows.Forms.Label label76; - private System.Windows.Forms.Label label77; private HTAlt.WinForms.HTButton custOutDirBrowseBtn; private System.Windows.Forms.TextBox custOutDir; private System.Windows.Forms.ComboBox outFolderLoc; diff --git a/CodeLegacy/Forms/SettingsForm.cs b/CodeLegacy/Forms/SettingsForm.cs index f045469..850bc31 100644 --- a/CodeLegacy/Forms/SettingsForm.cs +++ b/CodeLegacy/Forms/SettingsForm.cs @@ -87,7 +87,6 @@ namespace Flowframes.Forms ConfigParser.SaveGuiElement(keepTempFolder); ConfigParser.SaveGuiElement(exportNamePattern); ConfigParser.SaveGuiElement(exportNamePatternLoop); - ConfigParser.SaveGuiElement(disablePreview); // Interpolation ConfigParser.SaveGuiElement(keepAudio); ConfigParser.SaveGuiElement(keepSubs); @@ -134,7 +133,6 @@ namespace Flowframes.Forms ConfigParser.LoadGuiElement(keepTempFolder); ConfigParser.LoadGuiElement(exportNamePattern); ConfigParser.LoadGuiElement(exportNamePatternLoop); - ConfigParser.LoadGuiElement(disablePreview); // Interpolation ConfigParser.LoadGuiElement(keepAudio); ConfigParser.LoadGuiElement(keepSubs); @@ -250,5 +248,17 @@ namespace Flowframes.Forms Close(); Program.mainForm.ResetOutputUi(); } + + private bool _sizeFixApplied = false; + + private void settingsTabList_SelectedIndexChanged(object sender, EventArgs e) + { + if (!_sizeFixApplied) + { + Size = new Size(Width + 1, Height + 1); + Size = new Size(Width - 1, Height - 1); + _sizeFixApplied = true; + } + } } } diff --git a/CodeLegacy/Forms/SettingsForm.resx b/CodeLegacy/Forms/SettingsForm.resx index 95e8249..aadb1c2 100644 --- a/CodeLegacy/Forms/SettingsForm.resx +++ b/CodeLegacy/Forms/SettingsForm.resx @@ -117,6 +117,10 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + If this is enabled together with Auto-Encode, a backup video will be created from already encoded chunks, after each chunk has finished encoding. +This causes a minimal CPU load but requires lots of storage bandwidth - It's only recommended to use this on SSDs for longer videos. + 17, 17 @@ -135,10 +139,6 @@ The loop suffix gets added if the output gets looped. You can use the following placeholders: [LOOPS] for how many times it was looped [PLAYS] for how many times it plays (includes first play, so it's LOOPS+1) - - - If this is enabled together with Auto-Encode, a backup video will be created from already encoded chunks, after each chunk has finished encoding. -This causes a minimal CPU load but requires lots of storage bandwidth - It's only recommended to use this on SSDs for longer videos. diff --git a/CodeLegacy/IO/IoUtils.cs b/CodeLegacy/IO/IoUtils.cs index 7521e46..5096279 100644 --- a/CodeLegacy/IO/IoUtils.cs +++ b/CodeLegacy/IO/IoUtils.cs @@ -436,8 +436,8 @@ namespace Flowframes.IO } path = renamedPath; - - return await TryDeleteIfExistsAsync(path); + TryDeleteIfExists(path); + return true; } catch (Exception e) { @@ -446,8 +446,7 @@ namespace Flowframes.IO if (retries > 0) { await Task.Delay(2000); - retries -= 1; - return await TryDeleteIfExistsAsync(path, retries); + return await TryDeleteIfExistsAsync(path, retries - 1); } else { @@ -459,7 +458,7 @@ namespace Flowframes.IO /// /// Delete a path if it exists. Works for files and directories. Returns success status. /// - public static bool TryDeleteIfExists(string path) // Returns true if no exception occurs + public static bool TryDeleteIfExists(string path) // Returns true if no exception occurs { try { diff --git a/CodeLegacy/Main/Interpolate.cs b/CodeLegacy/Main/Interpolate.cs index 03e9e52..75b9d3a 100644 --- a/CodeLegacy/Main/Interpolate.cs +++ b/CodeLegacy/Main/Interpolate.cs @@ -122,7 +122,7 @@ namespace Flowframes if (Config.GetBool(Config.Key.scnDetect) && !currentSettings.ai.Piped) { Program.mainForm.SetStatus("Extracting scenes from video..."); - await FfmpegExtract.ExtractSceneChanges(currentSettings.inPath, Path.Combine(currentSettings.tempFolder, Paths.scenesDir), currentSettings.inFpsDetected, currentSettings.inputIsFrames, currentSettings.framesExt); + await FfmpegExtract.ExtractSceneChanges(currentSettings.inPath, Path.Combine(currentSettings.tempFolder, Paths.scenesDir), new Fraction(), currentSettings.inputIsFrames, currentSettings.framesExt); } if (!currentSettings.inputIsFrames) // Extract if input is video, import if image sequence @@ -272,17 +272,19 @@ namespace Flowframes if (!currentSettings.stepByStep && !Config.GetBool(Config.Key.keepTempFolder)) { - if (!BatchProcessing.busy && IoUtils.GetAmountOfFiles(Path.Combine(currentSettings.tempFolder, Paths.resumeDir), true) > 0) - { - DialogResult dialogResult = UiUtils.ShowMessageBox($"Delete the temp folder (Yes) or keep it for resuming later (No)?", "Delete temporary files?", MessageBoxButtons.YesNo); + Task.Run(async () => { await IoUtils.TryDeleteIfExistsAsync(currentSettings.tempFolder); }); - if (dialogResult == DialogResult.Yes) - Task.Run(async () => { await IoUtils.TryDeleteIfExistsAsync(currentSettings.tempFolder); }); - } - else - { - Task.Run(async () => { await IoUtils.TryDeleteIfExistsAsync(currentSettings.tempFolder); }); - } + // if (!BatchProcessing.busy && IoUtils.GetAmountOfFiles(Path.Combine(currentSettings.tempFolder, Paths.resumeDir), true) > 0) + // { + // DialogResult dialogResult = UiUtils.ShowMessageBox($"Delete the temp folder (Yes) or keep it for resuming later (No)?", "Delete temporary files?", MessageBoxButtons.YesNo); + // + // if (dialogResult == DialogResult.Yes) + // Task.Run(async () => { await IoUtils.TryDeleteIfExistsAsync(currentSettings.tempFolder); }); + // } + // else + // { + // Task.Run(async () => { await IoUtils.TryDeleteIfExistsAsync(currentSettings.tempFolder); }); + // } } AutoEncode.busy = false; diff --git a/CodeLegacy/Program.cs b/CodeLegacy/Program.cs index 6fbb8af..6944a0e 100644 --- a/CodeLegacy/Program.cs +++ b/CodeLegacy/Program.cs @@ -127,7 +127,9 @@ namespace Flowframes } IoUtils.GetFilesSorted(Paths.GetPkgPath(), false, "*.log*").ToList().ForEach(x => IoUtils.TryDeleteIfExists(x)); - IoUtils.GetFilesSorted(Path.Combine(Environment.ExpandEnvironmentVariables("%LOCALAPPDATA%"), "CrashDumps"), false, "rife*.exe.*.dmp").ToList().ForEach(x => IoUtils.TryDeleteIfExists(x)); + string crashDumpsDir = Path.Combine(Environment.ExpandEnvironmentVariables("%LOCALAPPDATA%"), "CrashDumps"); + IoUtils.GetFilesSorted(crashDumpsDir, false, "rife*.exe.*.dmp").ToList().ForEach(x => IoUtils.TryDeleteIfExists(x)); + IoUtils.GetFilesSorted(crashDumpsDir, false, "flowframes*.exe.*.dmp").ToList().ForEach(x => IoUtils.TryDeleteIfExists(x)); } catch (Exception e) { diff --git a/CodeLegacy/Properties/Resources.Designer.cs b/CodeLegacy/Properties/Resources.Designer.cs index 808b64c..2216ea9 100644 --- a/CodeLegacy/Properties/Resources.Designer.cs +++ b/CodeLegacy/Properties/Resources.Designer.cs @@ -210,6 +210,16 @@ namespace Flowframes.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap baseline_restart_alt_white_48dp_40px { + get { + object obj = ResourceManager.GetObject("baseline_restart_alt_white_48dp_40px", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/CodeLegacy/Properties/Resources.resx b/CodeLegacy/Properties/Resources.resx index f45f454..12e495f 100644 --- a/CodeLegacy/Properties/Resources.resx +++ b/CodeLegacy/Properties/Resources.resx @@ -184,6 +184,9 @@ ..\Resources\baseline_queue_white_48dp_40px.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\baseline_settings_white_48dp_40px.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\baseline_restart_alt_white_48dp.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -220,7 +223,7 @@ ..\Resources\baseline_system_update_alt_white_48dp_40px.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\baseline_settings_white_48dp_40px.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\baseline_restart_alt_white_48dp_40px.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file diff --git a/CodeLegacy/Resources/baseline_restart_alt_white_48dp_40px.png b/CodeLegacy/Resources/baseline_restart_alt_white_48dp_40px.png new file mode 100644 index 0000000..bf3551d Binary files /dev/null and b/CodeLegacy/Resources/baseline_restart_alt_white_48dp_40px.png differ diff --git a/CodeLegacy/packages.config b/CodeLegacy/packages.config index ab57712..6db76b2 100644 --- a/CodeLegacy/packages.config +++ b/CodeLegacy/packages.config @@ -3,16 +3,19 @@ - - + + - + + + + @@ -25,6 +28,7 @@ + diff --git a/Media/baseline_restart_alt_white_48dp_40px.png b/Media/baseline_restart_alt_white_48dp_40px.png new file mode 100644 index 0000000..bf3551d Binary files /dev/null and b/Media/baseline_restart_alt_white_48dp_40px.png differ