Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement the config for kar/lrc parser. #66

Merged
merged 1 commit into from
Jul 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions LrcParser/Parser/DecodeConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Copyright (c) karaoke.dev <contact@karaoke.dev>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

namespace LrcParser.Parser;

public abstract class DecodeConfig;
6 changes: 6 additions & 0 deletions LrcParser/Parser/EncodeConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Copyright (c) karaoke.dev <contact@karaoke.dev>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

namespace LrcParser.Parser;

public abstract class EncodeConfig;
12 changes: 12 additions & 0 deletions LrcParser/Parser/IHasParserConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright (c) karaoke.dev <contact@karaoke.dev>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

namespace LrcParser.Parser;

public interface IHasParserConfig<TEncodeConfig, TDecodeConfig>
where TEncodeConfig : EncodeConfig
where TDecodeConfig : DecodeConfig
{
TEncodeConfig EncodeConfig { get; set; }
TDecodeConfig DecodeConfig { get; set; }
}
6 changes: 6 additions & 0 deletions LrcParser/Parser/Kar/KarDecodeConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Copyright (c) karaoke.dev <contact@karaoke.dev>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

namespace LrcParser.Parser.Kar;

public class KarDecodeConfig : DecodeConfig;
6 changes: 6 additions & 0 deletions LrcParser/Parser/Kar/KarEncodeConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Copyright (c) karaoke.dev <contact@karaoke.dev>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

namespace LrcParser.Parser.Kar;

public class KarEncodeConfig : EncodeConfig;
5 changes: 4 additions & 1 deletion LrcParser/Parser/Kar/KarParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ namespace LrcParser.Parser.Kar;
/// <summary>
/// Parser for encode and decode .kar lyric format
/// </summary>
public class KarParser : LyricParser
public class KarParser : LyricParser, IHasParserConfig<KarEncodeConfig, KarDecodeConfig>
{
public KarEncodeConfig EncodeConfig { get; set; } = new();
public KarDecodeConfig DecodeConfig { get; set; } = new();

public KarParser()
{
Register<KarRubyParser>();
Expand Down
6 changes: 6 additions & 0 deletions LrcParser/Parser/Lrc/LrcDecodeConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Copyright (c) karaoke.dev <contact@karaoke.dev>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

namespace LrcParser.Parser.Lrc;

public class LrcDecodeConfig : DecodeConfig;
6 changes: 6 additions & 0 deletions LrcParser/Parser/Lrc/LrcEncodeConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Copyright (c) karaoke.dev <contact@karaoke.dev>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

namespace LrcParser.Parser.Lrc;

public class LrcEncodeConfig : EncodeConfig;
5 changes: 4 additions & 1 deletion LrcParser/Parser/Lrc/LrcParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ namespace LrcParser.Parser.Lrc;
/// <summary>
/// Parser for encode and decode .lrc lyric format
/// </summary>
public class LrcParser : LyricParser
public class LrcParser : LyricParser, IHasParserConfig<LrcEncodeConfig, LrcDecodeConfig>
{
public LrcEncodeConfig EncodeConfig { get; set; } = new();
public LrcDecodeConfig DecodeConfig { get; set; } = new();

public LrcParser()
{
Register<LrcLyricParser>();
Expand Down
Loading