diff --git a/OngekiFumenEditor/Kernel/CommandExecutor/DefaultCommandExecutor.cs b/OngekiFumenEditor/Kernel/CommandExecutor/DefaultCommandExecutor.cs index bd8c0a6b..d4676a3d 100644 --- a/OngekiFumenEditor/Kernel/CommandExecutor/DefaultCommandExecutor.cs +++ b/OngekiFumenEditor/Kernel/CommandExecutor/DefaultCommandExecutor.cs @@ -37,7 +37,7 @@ internal class DefaultCommandExecutor : ICommandExecutor public DefaultCommandExecutor() { rootCommand = new RootCommand("CommandLine for OngekiFumenEditor"); - rootCommand.AddCommand(GenerateVerbCommands("svg", Resources.ProgramCommandDescriptionSvg, ProcessSvgCommand)); + rootCommand.AddCommand(GenerateVerbCommands("svg", Resources.ProgramCommandDescriptionSvg, ProcessSvgCommand)); rootCommand.AddCommand(GenerateVerbCommands("convert", Resources.ProgramCommandConvert, ProcessConvertCommand)); rootCommand.AddCommand(GenerateVerbCommands("jacket", Resources.ProgramCommandJacket, ProcessJacketCommand)); rootCommand.AddCommand(GenerateVerbCommands("acb", Resources.ProgramCommandAcb, ProcessAcbCommand)); @@ -78,7 +78,7 @@ public Task Execute(string[] args) return command; } - private async Task ProcessSvgCommand(GenerateOption opt) + private async Task ProcessSvgCommand(SvgGenerateOption opt) { if (CheckRelativePaths(opt.AudioFilePath, opt.InputFumenFilePath, opt.OutputFilePath)) return -1; diff --git a/OngekiFumenEditor/Modules/PreviewSvgGenerator/Commands/GenerateSvg/GenerateSvgCommandHandler.cs b/OngekiFumenEditor/Modules/PreviewSvgGenerator/Commands/GenerateSvg/GenerateSvgCommandHandler.cs index dfe9abc3..879fed2d 100644 --- a/OngekiFumenEditor/Modules/PreviewSvgGenerator/Commands/GenerateSvg/GenerateSvgCommandHandler.cs +++ b/OngekiFumenEditor/Modules/PreviewSvgGenerator/Commands/GenerateSvg/GenerateSvgCommandHandler.cs @@ -39,7 +39,7 @@ public override async Task Run(Command command) { try { - var opt = new GenerateOption() + var opt = new SvgGenerateOption() { Duration = editor.EditorProjectData.AudioDuration, OutputFilePath = Path.GetTempFileName() + ".svg" diff --git a/OngekiFumenEditor/Modules/PreviewSvgGenerator/IPreviewSvgGenerator.cs b/OngekiFumenEditor/Modules/PreviewSvgGenerator/IPreviewSvgGenerator.cs index 27dde809..c0a2f27b 100644 --- a/OngekiFumenEditor/Modules/PreviewSvgGenerator/IPreviewSvgGenerator.cs +++ b/OngekiFumenEditor/Modules/PreviewSvgGenerator/IPreviewSvgGenerator.cs @@ -11,6 +11,6 @@ namespace OngekiFumenEditor.Modules.PreviewSvgGenerator { public interface IPreviewSvgGenerator { - Task GenerateSvgAsync(OngekiFumen fumen, GenerateOption option); + Task GenerateSvgAsync(OngekiFumen fumen, SvgGenerateOption option); } } diff --git a/OngekiFumenEditor/Modules/PreviewSvgGenerator/Kernel/DefaultPreviewSvgGenerator.cs b/OngekiFumenEditor/Modules/PreviewSvgGenerator/Kernel/DefaultPreviewSvgGenerator.cs index 97393cc4..45a64a7f 100644 --- a/OngekiFumenEditor/Modules/PreviewSvgGenerator/Kernel/DefaultPreviewSvgGenerator.cs +++ b/OngekiFumenEditor/Modules/PreviewSvgGenerator/Kernel/DefaultPreviewSvgGenerator.cs @@ -37,7 +37,7 @@ namespace OngekiFumenEditor.Modules.PreviewSvgGenerator.Kernel [Export(typeof(IPreviewSvgGenerator))] public class DefaultPreviewSvgGenerator : IPreviewSvgGenerator { - private SoflanList GenerateWeightedSoflan(SoflanList soflans, GenerateOption opt) + private SoflanList GenerateWeightedSoflan(SoflanList soflans, SvgGenerateOption opt) { var offset = opt.WeightedSoflanOffset; var stress = opt.WeightedSoflanStress; @@ -70,7 +70,7 @@ float sigmoid(float x) return newList; } - public async Task GenerateSvgAsync(OngekiFumen rawFumen, GenerateOption option) + public async Task GenerateSvgAsync(OngekiFumen rawFumen, SvgGenerateOption option) { var svgDocument = new SvgDocument(); diff --git a/OngekiFumenEditor/Modules/PreviewSvgGenerator/Kernel/GenerateContext.cs b/OngekiFumenEditor/Modules/PreviewSvgGenerator/Kernel/GenerateContext.cs index 96931cd8..5b5a2dfc 100644 --- a/OngekiFumenEditor/Modules/PreviewSvgGenerator/Kernel/GenerateContext.cs +++ b/OngekiFumenEditor/Modules/PreviewSvgGenerator/Kernel/GenerateContext.cs @@ -10,7 +10,7 @@ namespace OngekiFumenEditor.Modules.PreviewSvgGenerator.Kernel { public class GenerateContext { - public GenerateOption Option { get; init; } + public SvgGenerateOption Option { get; init; } public double TotalWidth => Option.ViewWidth; public double TotalHeight { get; init; } public TGrid MaxTGrid { get; init; } diff --git a/OngekiFumenEditor/Modules/PreviewSvgGenerator/GenerateOption.cs b/OngekiFumenEditor/Modules/PreviewSvgGenerator/SvgGenerateOption.cs similarity index 94% rename from OngekiFumenEditor/Modules/PreviewSvgGenerator/GenerateOption.cs rename to OngekiFumenEditor/Modules/PreviewSvgGenerator/SvgGenerateOption.cs index 7a1ee678..bceae93b 100644 --- a/OngekiFumenEditor/Modules/PreviewSvgGenerator/GenerateOption.cs +++ b/OngekiFumenEditor/Modules/PreviewSvgGenerator/SvgGenerateOption.cs @@ -4,12 +4,14 @@ namespace OngekiFumenEditor.Modules.PreviewSvgGenerator { - public class GenerateOption + public class SvgGenerateOption { [LocalizableOptionBinding("inputFile", nameof(Resources.ProgramOptionInputFileNyageki), default, true)] public string InputFumenFilePath { get; set; } [LocalizableOptionBinding("outputFile", nameof(Resources.ProgramOptionOutputFile), default, true)] public string OutputFilePath { get; set; } + [LocalizableOptionBinding("audioFile", nameof(Resources.ProgramOptionInputFileAudio), default, true)] + public string AudioFilePath { get; set; } [LocalizableOptionBinding("maxXGrid", nameof(Resources.ProgramOptionSvgMaxXGrid), 40)] public double XGridDisplayMaxUnit { get; set; } = 40; @@ -18,12 +20,8 @@ public class GenerateOption [LocalizableOptionBinding("verticalScale", nameof(Resources.ProgramOptionSvgVerticalScale), 1)] public double VerticalScale { get; set; } = 1; - [LocalizableOptionBinding("audioFile", nameof(Resources.ProgramOptionInputFileAudio), default)] - public string AudioFilePath { get; set; } - [LocalizableOptionBinding("soflanMode", nameof(Resources.ProgramOptionSvgSoflanMode), SoflanMode.Soflan)] public SoflanMode SoflanMode { get; set; } = SoflanMode.WeightedSoflan; - [LocalizableOptionBinding("weightedSoflanOffset", nameof(Resources.ProgramOptionSvgWeightedSoflanOffset), 70f)] public float WeightedSoflanOffset { get; set; } = 70f; [LocalizableOptionBinding("weightedSoflanStress", nameof(Resources.ProgramOptionSvgWeightedSoflanStress), 0.95f)]