Remove ToStringDot, no longer needed with forced CultureInfo

This commit is contained in:
N00MKRAD
2024-11-26 12:14:44 +01:00
parent 67cbff594c
commit b9029cb5f4
6 changed files with 9 additions and 17 deletions

View File

@@ -35,7 +35,7 @@ namespace Flowframes.IO
public static string GetFrameOrderFilename(float factor)
{
return $"{frameOrderPrefix}-{factor.ToStringDot()}x.ini";
return $"{frameOrderPrefix}-{factor.ToString()}x.ini";
}
public static string GetFrameOrderFilenameChunk (int from, int to)

View File

@@ -239,14 +239,6 @@ namespace Flowframes
return filename + suffix + ext;
}
public static string ToStringDot(this float f, string format = "")
{
if (string.IsNullOrWhiteSpace(format))
return f.ToString().Replace(",", ".");
else
return f.ToString(format).Replace(",", ".");
}
public static string[] Split(this string str, string trimStr)
{
return str?.Split(new string[] { trimStr }, StringSplitOptions.None);

View File

@@ -210,7 +210,7 @@ namespace Flowframes.IO
public static float GetFloat(Key key, float defaultVal)
{
WriteIfDoesntExist(key.ToString(), defaultVal.ToStringDot());
WriteIfDoesntExist(key.ToString(), defaultVal.ToString());
return Get(key, Type.Float).GetFloat();
}
@@ -221,7 +221,7 @@ namespace Flowframes.IO
public static float GetFloat(string key, float defaultVal)
{
WriteIfDoesntExist(key, defaultVal.ToStringDot());
WriteIfDoesntExist(key, defaultVal.ToString());
return Get(key, Type.Float).GetFloat();
}

View File

@@ -610,10 +610,10 @@ namespace Flowframes.IO
filename = filename.Replace("[NAME]", inName);
filename = filename.Replace("[FULLNAME]", Path.GetFileName(curr.inPath));
filename = filename.Replace("[FACTOR]", curr.interpFactor.ToStringDot());
filename = filename.Replace("[FACTOR]", curr.interpFactor.ToString());
filename = filename.Replace("[AI]", curr.ai.NameShort.Upper());
filename = filename.Replace("[MODEL]", curr.model.Name.Remove(" "));
filename = filename.Replace("[FPS]", fps.ToStringDot("0.###"));
filename = filename.Replace("[FPS]", fps.ToString("0.###"));
filename = filename.Replace("[ROUNDFPS]", fps.RoundToInt().ToString());
filename = filename.Replace("[RES]", $"{outRes.Width}x{outRes.Height}");
filename = filename.Replace("[H]", $"{outRes.Height}p");

View File

@@ -526,11 +526,11 @@ namespace Flowframes.Media
return "";
if (itsScale > 4)
return $"-af atempo=0.5,atempo=0.5,atempo={((1f / itsScale) * 4).ToStringDot()}";
return $"-af atempo=0.5,atempo=0.5,atempo={((1f / itsScale) * 4).ToString()}";
else if (itsScale > 2)
return $"-af atempo=0.5,atempo={((1f / itsScale) * 2).ToStringDot()}";
return $"-af atempo=0.5,atempo={((1f / itsScale) * 2).ToString()}";
else
return $"-af atempo={(1f / itsScale).ToStringDot()}";
return $"-af atempo={(1f / itsScale).ToString()}";
}
public static string GetSubCodecForContainer(string containerExt)

View File

@@ -206,7 +206,7 @@ namespace Flowframes.Os
string uhdStr = InterpolateUtils.UseUhd() ? "--UHD" : "";
string wthreads = $"--wthreads {2 * (int)interpFactor}";
string rbuffer = $"--rbuffer {Config.GetInt(Config.Key.rifeCudaBufferSize, 200)}";
//string scale = $"--scale {Config.GetFloat("rifeCudaScale", 1.0f).ToStringDot()}";
//string scale = $"--scale {Config.GetFloat("rifeCudaScale", 1.0f).ToString()}";
string prec = Config.GetBool(Config.Key.rifeCudaFp16) ? "--fp16" : "";
string args = $" --input {inPath.Wrap()} --output {outDir} --model {mdl} --multi {interpFactor} {uhdStr} {wthreads} {rbuffer} {prec}";