Skip to content

Commit

Permalink
rename SvgGenerateOption
Browse files Browse the repository at this point in the history
  • Loading branch information
MikiraSora committed Oct 28, 2024
1 parent fb01734 commit ae46db4
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ internal class DefaultCommandExecutor : ICommandExecutor
public DefaultCommandExecutor()
{
rootCommand = new RootCommand("CommandLine for OngekiFumenEditor");
rootCommand.AddCommand(GenerateVerbCommands<GenerateOption>("svg", Resources.ProgramCommandDescriptionSvg, ProcessSvgCommand));
rootCommand.AddCommand(GenerateVerbCommands<SvgGenerateOption>("svg", Resources.ProgramCommandDescriptionSvg, ProcessSvgCommand));
rootCommand.AddCommand(GenerateVerbCommands<FumenConvertOption>("convert", Resources.ProgramCommandConvert, ProcessConvertCommand));
rootCommand.AddCommand(GenerateVerbCommands<JacketGenerateOption>("jacket", Resources.ProgramCommandJacket, ProcessJacketCommand));
rootCommand.AddCommand(GenerateVerbCommands<AcbGenerateOption>("acb", Resources.ProgramCommandAcb, ProcessAcbCommand));
Expand Down Expand Up @@ -78,7 +78,7 @@ public Task<int> Execute(string[] args)
return command;
}

private async Task<int> ProcessSvgCommand(GenerateOption opt)
private async Task<int> ProcessSvgCommand(SvgGenerateOption opt)
{
if (CheckRelativePaths(opt.AudioFilePath, opt.InputFumenFilePath, opt.OutputFilePath))
return -1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ namespace OngekiFumenEditor.Modules.PreviewSvgGenerator
{
public interface IPreviewSvgGenerator
{
Task<byte[]> GenerateSvgAsync(OngekiFumen fumen, GenerateOption option);
Task<byte[]> GenerateSvgAsync(OngekiFumen fumen, SvgGenerateOption option);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -70,7 +70,7 @@ float sigmoid(float x)
return newList;
}

public async Task<byte[]> GenerateSvgAsync(OngekiFumen rawFumen, GenerateOption option)
public async Task<byte[]> GenerateSvgAsync(OngekiFumen rawFumen, SvgGenerateOption option)
{
var svgDocument = new SvgDocument();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@

namespace OngekiFumenEditor.Modules.PreviewSvgGenerator
{
public class GenerateOption
public class SvgGenerateOption
{
[LocalizableOptionBinding<string>("inputFile", nameof(Resources.ProgramOptionInputFileNyageki), default, true)]
public string InputFumenFilePath { get; set; }
[LocalizableOptionBinding<string>("outputFile", nameof(Resources.ProgramOptionOutputFile), default, true)]
public string OutputFilePath { get; set; }
[LocalizableOptionBinding<string>("audioFile", nameof(Resources.ProgramOptionInputFileAudio), default, true)]
public string AudioFilePath { get; set; }

[LocalizableOptionBinding<double>("maxXGrid", nameof(Resources.ProgramOptionSvgMaxXGrid), 40)]
public double XGridDisplayMaxUnit { get; set; } = 40;
Expand All @@ -18,12 +20,8 @@ public class GenerateOption
[LocalizableOptionBinding<double>("verticalScale", nameof(Resources.ProgramOptionSvgVerticalScale), 1)]
public double VerticalScale { get; set; } = 1;

[LocalizableOptionBinding<string>("audioFile", nameof(Resources.ProgramOptionInputFileAudio), default)]
public string AudioFilePath { get; set; }

[LocalizableOptionBinding<SoflanMode>("soflanMode", nameof(Resources.ProgramOptionSvgSoflanMode), SoflanMode.Soflan)]
public SoflanMode SoflanMode { get; set; } = SoflanMode.WeightedSoflan;

[LocalizableOptionBinding<float>("weightedSoflanOffset", nameof(Resources.ProgramOptionSvgWeightedSoflanOffset), 70f)]
public float WeightedSoflanOffset { get; set; } = 70f;
[LocalizableOptionBinding<float>("weightedSoflanStress", nameof(Resources.ProgramOptionSvgWeightedSoflanStress), 0.95f)]
Expand Down

0 comments on commit ae46db4

Please sign in to comment.