Simplify code for encoder settings

This commit is contained in:
Grigory Chudov
2013-06-19 03:40:43 -04:00
parent bcb42dd531
commit 12f9a66c27
4 changed files with 51 additions and 110 deletions

View File

@@ -67,6 +67,18 @@ namespace CUETools.Codecs
return hasBrowsable;
}
protected void SetDefaultValuesForMode()
{
foreach (PropertyDescriptor property in TypeDescriptor.GetProperties(this))
if (!property.CanResetValue(this))
foreach (var attribute in property.Attributes)
if (attribute is DefaultValueForModeAttribute)
{
var defaultValueForMode = attribute as DefaultValueForModeAttribute;
property.SetValue(this, defaultValueForMode.m_values[EncoderModeIndex]);
}
}
[Browsable(false)]
[XmlIgnore]
public AudioPCMConfig PCM