Removed legacy InterpSettings deserialization constructor

This commit is contained in:
N00MKRAD
2024-11-26 12:00:54 +01:00
parent 6e4cc8d552
commit 8e5d379216

View File

@@ -131,73 +131,6 @@ namespace Flowframes
RefreshExtensions(ai: ai);
}
public InterpSettings (string serializedData)
{
inPath = "";
outPath = "";
ai = null;
inFpsDetected = new Fraction();
inFps = new Fraction();
interpFactor = 0;
outFps = new Fraction();
outSettings = new OutputSettings();
model = null;
alpha = false;
stepByStep = false;
_inputResolution = new Size(0, 0);
framesExt = "";
interpExt = "";
Dictionary<string, string> entries = new Dictionary<string, string>();
foreach(string line in serializedData.SplitIntoLines())
{
if (line.Length < 3) continue;
string[] keyValuePair = line.Split('|');
entries.Add(keyValuePair[0], keyValuePair[1]);
}
// TODO: Rework this ugly stuff, JSON?
foreach (KeyValuePair<string, string> entry in entries)
{
switch (entry.Key)
{
case "INPATH": inPath = entry.Value; break;
case "OUTPATH": outPath = entry.Value; break;
case "AI": ai = Implementations.GetAi(entry.Value); break;
case "INFPSDETECTED": inFpsDetected = new Fraction(entry.Value); break;
case "INFPS": inFps = new Fraction(entry.Value); break;
case "OUTFPS": outFps = new Fraction(entry.Value); break;
case "INTERPFACTOR": interpFactor = float.Parse(entry.Value); break;
case "OUTMODE": outSettings.Format = (Enums.Output.Format)Enum.Parse(typeof(Enums.Output.Format), entry.Value); break;
case "MODEL": model = AiModels.GetModelByName(ai, entry.Value); break;
case "INPUTRES": _inputResolution = FormatUtils.ParseSize(entry.Value); break;
case "ALPHA": alpha = bool.Parse(entry.Value); break;
case "STEPBYSTEP": stepByStep = bool.Parse(entry.Value); break;
case "FRAMESEXT": framesExt = entry.Value; break;
case "INTERPEXT": interpExt = entry.Value; break;
}
}
try
{
tempFolder = InterpolateUtils.GetTempFolderLoc(inPath, outPath);
framesFolder = Path.Combine(tempFolder, Paths.framesDir);
interpFolder = Path.Combine(tempFolder, Paths.interpDir);
inputIsFrames = IoUtils.IsPathDirectory(inPath);
}
catch
{
Logger.Log("Tried to create InterpSettings struct without an inpath. Can't set tempFolder, framesFolder and interpFolder.", true);
tempFolder = "";
framesFolder = "";
interpFolder = "";
inputIsFrames = false;
}
RefreshExtensions();
}
public void UpdatePaths (string inPathArg, string outPathArg)
{
inPath = inPathArg;