2018-03-23 20:26:28 -04:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
|
|
|
|
|
|
|
namespace CUETools.Codecs.CommandLine
|
|
|
|
|
|
{
|
|
|
|
|
|
[JsonObject(MemberSerialization.OptIn)]
|
2018-03-25 17:24:27 -04:00
|
|
|
|
public class EncoderSettings : IAudioEncoderSettings
|
2018-03-23 20:26:28 -04:00
|
|
|
|
{
|
2018-03-25 17:24:27 -04:00
|
|
|
|
#region IAudioEncoderSettings implementation
|
|
|
|
|
|
[DefaultValue("")]
|
|
|
|
|
|
[JsonProperty]
|
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[DefaultValue("")]
|
|
|
|
|
|
[JsonProperty]
|
|
|
|
|
|
public string Extension { get; set; }
|
2018-03-23 20:26:28 -04:00
|
|
|
|
|
2018-03-25 17:24:27 -04:00
|
|
|
|
[Browsable(false)]
|
|
|
|
|
|
public Type EncoderType => typeof(AudioEncoder);
|
2018-03-23 20:26:28 -04:00
|
|
|
|
|
2018-03-25 17:24:27 -04:00
|
|
|
|
[JsonProperty]
|
|
|
|
|
|
public bool Lossless { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[Browsable(false)]
|
|
|
|
|
|
public int Priority => 0;
|
|
|
|
|
|
|
|
|
|
|
|
[DefaultValue("")]
|
|
|
|
|
|
[JsonProperty]
|
|
|
|
|
|
public string SupportedModes { get; set; }
|
2018-03-23 20:26:28 -04:00
|
|
|
|
|
2018-03-25 17:24:27 -04:00
|
|
|
|
public string DefaultMode => EncoderMode;
|
|
|
|
|
|
|
|
|
|
|
|
[Browsable(false)]
|
|
|
|
|
|
[DefaultValue("")]
|
|
|
|
|
|
[JsonProperty]
|
|
|
|
|
|
public string EncoderMode { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[Browsable(false)]
|
|
|
|
|
|
public AudioPCMConfig PCM { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[Browsable(false)]
|
|
|
|
|
|
public int BlockSize { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[Browsable(false)]
|
|
|
|
|
|
[DefaultValue(4096)]
|
|
|
|
|
|
public int Padding { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public IAudioEncoderSettings Clone()
|
|
|
|
|
|
{
|
|
|
|
|
|
return MemberwiseClone() as IAudioEncoderSettings;
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
2018-03-23 20:26:28 -04:00
|
|
|
|
|
|
|
|
|
|
public EncoderSettings()
|
|
|
|
|
|
{
|
2018-03-25 17:24:27 -04:00
|
|
|
|
this.Init();
|
2018-03-23 20:26:28 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
2018-03-24 12:15:49 -04:00
|
|
|
|
public EncoderSettings(
|
2018-03-25 17:24:27 -04:00
|
|
|
|
string name,
|
|
|
|
|
|
string extension,
|
|
|
|
|
|
bool lossless,
|
|
|
|
|
|
string supportedModes,
|
|
|
|
|
|
string defaultMode,
|
|
|
|
|
|
string path,
|
|
|
|
|
|
string parameters
|
2018-03-24 12:15:49 -04:00
|
|
|
|
)
|
|
|
|
|
|
{
|
2018-03-25 17:24:27 -04:00
|
|
|
|
this.Init();
|
|
|
|
|
|
Name = name;
|
|
|
|
|
|
Extension = extension;
|
|
|
|
|
|
Lossless = lossless;
|
|
|
|
|
|
SupportedModes = supportedModes;
|
|
|
|
|
|
Path = path;
|
|
|
|
|
|
EncoderMode = defaultMode;
|
|
|
|
|
|
Parameters = parameters;
|
2018-03-24 12:15:49 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
2018-03-25 17:24:27 -04:00
|
|
|
|
[DefaultValue("")]
|
2018-03-23 20:26:28 -04:00
|
|
|
|
[JsonProperty]
|
|
|
|
|
|
public string Path
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
set;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2018-03-25 17:24:27 -04:00
|
|
|
|
[DefaultValue("")]
|
2018-03-23 20:26:28 -04:00
|
|
|
|
[JsonProperty]
|
|
|
|
|
|
public string Parameters
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
set;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|