mirror of
https://github.com/claunia/cuetools.net.git
synced 2025-12-16 18:14:25 +00:00
Removed AudioEncoderSettings/AudioDecoderSettings classes, all of their functionality is now in IAudioEncoderSettings/IAudioDecoderSettings interfaces.
This commit is contained in:
@@ -15,45 +15,17 @@ namespace CUETools.Codecs
|
||||
|
||||
Type DecoderType { get; }
|
||||
|
||||
bool Lossless { get; }
|
||||
|
||||
int Priority { get; }
|
||||
|
||||
IAudioDecoderSettings Clone();
|
||||
}
|
||||
|
||||
[JsonObject(MemberSerialization.OptIn)]
|
||||
public class AudioDecoderSettings: IAudioDecoderSettings
|
||||
public static class IAudioDecoderSettingsExtensions
|
||||
{
|
||||
[Browsable(false)]
|
||||
public virtual string Name => null;
|
||||
|
||||
[Browsable(false)]
|
||||
public virtual string Extension => null;
|
||||
|
||||
[Browsable(false)]
|
||||
public virtual Type DecoderType => null;
|
||||
|
||||
[Browsable(false)]
|
||||
public virtual bool Lossless => true;
|
||||
|
||||
[Browsable(false)]
|
||||
public virtual int Priority => 0;
|
||||
|
||||
public AudioDecoderSettings()
|
||||
{
|
||||
// Iterate through each property and call ResetValue()
|
||||
foreach (PropertyDescriptor property in TypeDescriptor.GetProperties(this))
|
||||
property.ResetValue(this);
|
||||
}
|
||||
|
||||
public AudioDecoderSettings Clone()
|
||||
{
|
||||
return this.MemberwiseClone() as AudioDecoderSettings;
|
||||
}
|
||||
|
||||
public bool HasBrowsableAttributes()
|
||||
public static bool HasBrowsableAttributes(this IAudioDecoderSettings settings)
|
||||
{
|
||||
bool hasBrowsable = false;
|
||||
foreach (PropertyDescriptor property in TypeDescriptor.GetProperties(this))
|
||||
foreach (PropertyDescriptor property in TypeDescriptor.GetProperties(settings))
|
||||
{
|
||||
bool isBrowsable = true;
|
||||
foreach (var attribute in property.Attributes)
|
||||
@@ -65,5 +37,12 @@ namespace CUETools.Codecs
|
||||
}
|
||||
return hasBrowsable;
|
||||
}
|
||||
|
||||
public static void Init(this IAudioDecoderSettings settings)
|
||||
{
|
||||
// Iterate through each property and call ResetValue()
|
||||
foreach (PropertyDescriptor property in TypeDescriptor.GetProperties(settings))
|
||||
property.ResetValue(settings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user