mirror of
https://github.com/claunia/cuetools.net.git
synced 2025-12-16 18:14:25 +00:00
Reset encoding mode to default for codecs with dynamic modes list,
when settings become incompatible with the chosen mode. E.g. for flac if -11 was selected and nonsubset modes are disabled, -7 is chosen instead.
This commit is contained in:
@@ -25,13 +25,17 @@ namespace CUETools.Codecs
|
||||
foreach (PropertyDescriptor property in TypeDescriptor.GetProperties(this))
|
||||
property.ResetValue(this);
|
||||
this.m_supported_modes = supported_modes;
|
||||
this.EncoderMode = default_mode;
|
||||
this.m_default_mode = default_mode;
|
||||
//GetSupportedModes(out m_default_mode);
|
||||
this.EncoderMode = m_default_mode;
|
||||
}
|
||||
|
||||
private string m_supported_modes;
|
||||
protected string m_supported_modes;
|
||||
protected string m_default_mode;
|
||||
|
||||
public virtual string GetSupportedModes()
|
||||
public virtual string GetSupportedModes(out string defaultMode)
|
||||
{
|
||||
defaultMode = m_default_mode;
|
||||
return this.m_supported_modes;
|
||||
}
|
||||
|
||||
@@ -101,23 +105,14 @@ namespace CUETools.Codecs
|
||||
set;
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
[Browsable(false)]
|
||||
public string[] SupportedModes
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.GetSupportedModes().Split(' ');
|
||||
}
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
[Browsable(false)]
|
||||
public int EncoderModeIndex
|
||||
{
|
||||
get
|
||||
{
|
||||
string[] modes = this.SupportedModes;
|
||||
string defaultMode;
|
||||
string[] modes = this.GetSupportedModes(out defaultMode).Split(' ');
|
||||
if (modes == null || modes.Length < 1)
|
||||
return -1;
|
||||
for (int i = 0; i < modes.Length; i++)
|
||||
@@ -128,7 +123,8 @@ namespace CUETools.Codecs
|
||||
|
||||
set
|
||||
{
|
||||
string[] modes = this.SupportedModes;
|
||||
string defaultMode;
|
||||
string[] modes = this.GetSupportedModes(out defaultMode).Split(' ');
|
||||
if (modes.Length == 0 && value < 0)
|
||||
return;
|
||||
if (value < 0 || value >= modes.Length)
|
||||
|
||||
Reference in New Issue
Block a user