mirror of
https://github.com/claunia/cuetools.net.git
synced 2025-12-16 18:14:25 +00:00
Cleanup
This commit is contained in:
@@ -996,8 +996,8 @@ namespace CUERipper
|
||||
|
||||
private void resetEncoderModes(CUEToolsUDC encoder)
|
||||
{
|
||||
if (encoder.settings != null) encoder.settings.PCM = AudioPCMConfig.RedBook;
|
||||
buttonEncoderSettings.Enabled = encoder.settings != null && encoder.settings.HasBrowsableAttributes();
|
||||
encoder.settings.PCM = AudioPCMConfig.RedBook;
|
||||
buttonEncoderSettings.Enabled = encoder.settings.HasBrowsableAttributes();
|
||||
string[] modes = encoder.SupportedModes;
|
||||
if (modes == null || modes.Length < 2)
|
||||
{
|
||||
@@ -1008,7 +1008,7 @@ namespace CUERipper
|
||||
}
|
||||
else
|
||||
{
|
||||
if (encoder.EncoderModeIndex == -1 && encoder.settings != null)
|
||||
if (encoder.EncoderModeIndex == -1)
|
||||
{
|
||||
string defaultMode;
|
||||
encoder.settings.GetSupportedModes(out defaultMode);
|
||||
@@ -1592,8 +1592,6 @@ namespace CUERipper
|
||||
CUEToolsUDC encoder = bnComboBoxEncoder.SelectedItem as CUEToolsUDC;
|
||||
if (encoder == null)
|
||||
return;
|
||||
if (encoder.settings == null)
|
||||
return;
|
||||
var form = new Options(encoder.settings);
|
||||
form.ShowDialog(this);
|
||||
resetEncoderModes(encoder);
|
||||
|
||||
@@ -90,15 +90,10 @@ namespace CUETools.Processor
|
||||
settings.PCM = pcm;
|
||||
settings.Padding = padding;
|
||||
settings.Validate();
|
||||
if (encoder.type != null)
|
||||
{
|
||||
object o = Activator.CreateInstance(encoder.type, path, settings);
|
||||
if (o == null || !(o is IAudioDest))
|
||||
throw new Exception("Unsupported audio type: " + path + ": " + encoder.type.FullName);
|
||||
dest = o as IAudioDest;
|
||||
}
|
||||
else
|
||||
throw new Exception("Unsupported audio type: " + path);
|
||||
object o = Activator.CreateInstance(encoder.type, path, settings);
|
||||
if (o == null || !(o is IAudioDest))
|
||||
throw new Exception("Unsupported audio type: " + path + ": " + encoder.type.FullName);
|
||||
dest = o as IAudioDest;
|
||||
dest.FinalSampleCount = finalSampleCount;
|
||||
return dest;
|
||||
}
|
||||
|
||||
@@ -2454,7 +2454,7 @@ namespace JDP
|
||||
else
|
||||
SelectedOutputAudioFmt.encoderLossy = encoder;
|
||||
// TODO: something cleverer than this hack...
|
||||
if (encoder.settings != null) encoder.settings.PCM = AudioPCMConfig.RedBook;
|
||||
encoder.settings.PCM = AudioPCMConfig.RedBook;
|
||||
string[] modes = encoder.SupportedModes;
|
||||
if (modes == null || modes.Length < 2)
|
||||
{
|
||||
@@ -2465,7 +2465,7 @@ namespace JDP
|
||||
}
|
||||
else
|
||||
{
|
||||
if (encoder.EncoderModeIndex == -1 && encoder.settings != null)
|
||||
if (encoder.EncoderModeIndex == -1)
|
||||
{
|
||||
string defaultMode;
|
||||
encoder.settings.GetSupportedModes(out defaultMode);
|
||||
|
||||
Reference in New Issue
Block a user