2018-04-01 16:14:19 -04:00
|
|
|
|
using FFmpeg.AutoGen;
|
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
|
|
|
|
|
|
|
namespace CUETools.Codecs.ffmpegdll
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
[JsonObject(MemberSerialization.OptIn)]
|
|
|
|
|
|
public abstract class DecoderSettings: IAudioDecoderSettings
|
|
|
|
|
|
{
|
|
|
|
|
|
#region IAudioDecoderSettings implementation
|
|
|
|
|
|
|
|
|
|
|
|
[Browsable(false)]
|
|
|
|
|
|
public string Name => "ffmpeg";
|
|
|
|
|
|
|
|
|
|
|
|
[Browsable(false)]
|
|
|
|
|
|
public Type DecoderType => typeof(AudioDecoder);
|
|
|
|
|
|
|
|
|
|
|
|
[Browsable(false)]
|
|
|
|
|
|
public int Priority => 1;
|
|
|
|
|
|
|
|
|
|
|
|
[Browsable(false)]
|
|
|
|
|
|
public abstract string Extension { get; }
|
|
|
|
|
|
|
|
|
|
|
|
public IAudioDecoderSettings Clone()
|
|
|
|
|
|
{
|
|
|
|
|
|
return MemberwiseClone() as IAudioDecoderSettings;
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
2018-04-01 20:43:23 -04:00
|
|
|
|
public abstract string Format { get; }
|
|
|
|
|
|
|
2018-04-01 16:14:19 -04:00
|
|
|
|
// [DisplayName("Version")]
|
|
|
|
|
|
// [Description("Library version")]
|
|
|
|
|
|
// public string Version => Marshal.PtrToStringAnsi(MACLibDll.GetVersionString());
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class MLPDecoderSettings : DecoderSettings, IAudioDecoderSettings
|
|
|
|
|
|
{
|
|
|
|
|
|
public override string Extension => "mlp";
|
2018-04-01 20:43:23 -04:00
|
|
|
|
public override string Format => "mlp";
|
2018-04-01 16:14:19 -04:00
|
|
|
|
public MLPDecoderSettings()
|
|
|
|
|
|
{
|
|
|
|
|
|
this.Init();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
public class FLACDecoderSettings : DecoderSettings, IAudioDecoderSettings
|
|
|
|
|
|
{
|
|
|
|
|
|
public override string Extension => "flac";
|
2018-04-01 20:43:23 -04:00
|
|
|
|
public override string Format => "flac";
|
2018-04-01 16:14:19 -04:00
|
|
|
|
public FLACDecoderSettings()
|
|
|
|
|
|
{
|
|
|
|
|
|
this.Init();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
public class WavPackDecoderSettings : DecoderSettings, IAudioDecoderSettings
|
|
|
|
|
|
{
|
|
|
|
|
|
public override string Extension => "wv";
|
2018-04-01 20:43:23 -04:00
|
|
|
|
public override string Format => "wv";
|
2018-04-01 16:14:19 -04:00
|
|
|
|
public WavPackDecoderSettings()
|
|
|
|
|
|
{
|
|
|
|
|
|
this.Init();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2018-04-01 20:43:23 -04:00
|
|
|
|
public class TtaDecoderSettings : DecoderSettings, IAudioDecoderSettings
|
|
|
|
|
|
{
|
|
|
|
|
|
public override string Extension => "tta";
|
|
|
|
|
|
public override string Format => "tta";
|
|
|
|
|
|
public TtaDecoderSettings()
|
|
|
|
|
|
{
|
|
|
|
|
|
this.Init();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
public class ShnDecoderSettings : DecoderSettings, IAudioDecoderSettings
|
|
|
|
|
|
{
|
|
|
|
|
|
public override string Extension => "shn";
|
|
|
|
|
|
public override string Format => "shn";
|
|
|
|
|
|
public ShnDecoderSettings()
|
|
|
|
|
|
{
|
|
|
|
|
|
this.Init();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
public class AlacDecoderSettings : DecoderSettings, IAudioDecoderSettings
|
|
|
|
|
|
{
|
|
|
|
|
|
public override string Extension => "m4a";
|
|
|
|
|
|
public override string Format => "m4a";
|
|
|
|
|
|
public AlacDecoderSettings()
|
|
|
|
|
|
{
|
|
|
|
|
|
this.Init();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
public class APEDecoderSettings : DecoderSettings, IAudioDecoderSettings
|
|
|
|
|
|
{
|
|
|
|
|
|
public override string Extension => "ape";
|
|
|
|
|
|
public override string Format => "ape";
|
|
|
|
|
|
public APEDecoderSettings()
|
|
|
|
|
|
{
|
|
|
|
|
|
this.Init();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2018-04-01 16:14:19 -04:00
|
|
|
|
}
|