feat: Add music decryptor definition.

This commit is contained in:
real-zony 2021-05-30 13:26:22 +08:00
parent 300b350f70
commit db283580ba
4 changed files with 33 additions and 1 deletions

View File

@ -1,4 +1,6 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=QQ/@EntryIndexedValue">QQ</s:String>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Decryptor/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Gour/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Zony/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

View File

@ -99,7 +99,7 @@ namespace ZonyLrcTools.Cli.Commands
Log.Logger.Error($"出现了未处理的异常,错误代码: {exception.ErrorCode},错误信息: {ErrorCodeHelper.GetMessage(exception.ErrorCode)}\n调用栈:\n{exception.StackTrace}");
Environment.Exit(exception.ErrorCode);
return exception.ErrorCode;
case Exception unknownException:
case { } unknownException:
Log.Logger.Error($"出现了未处理的异常: {unknownException.Message}\n调用栈:\n{unknownException.StackTrace}");
Environment.Exit(-1);
return 1;

View File

@ -0,0 +1,17 @@
using System.Threading.Tasks;
namespace ZonyLrcTools.Cli.Infrastructure.MusicDecryption
{
/// <summary>
/// 音乐解密器,用于将加密的歌曲数据,转换为可识别的歌曲格式。
/// </summary>
public interface IMusicDecryptor
{
/// <summary>
/// 将加密数据转换为可识别的歌曲格式。
/// </summary>
/// <param name="sourceBytes">源加密的歌曲数据。</param>
/// <returns>解密完成的歌曲数据。</returns>
Task<byte[]> Convert(byte[] sourceBytes);
}
}

View File

@ -0,0 +1,13 @@
using System.Threading.Tasks;
using ZonyLrcTools.Cli.Infrastructure.DependencyInject;
namespace ZonyLrcTools.Cli.Infrastructure.MusicDecryption
{
public class NcmMusicDecryptor : IMusicDecryptor, ITransientDependency
{
public Task<byte[]> Convert(byte[] sourceBytes)
{
throw new System.NotImplementedException();
}
}
}