Skip to content

Commit

Permalink
[CUETools.Codecs.FLACCL] Fix constructor
Browse files Browse the repository at this point in the history
The constructor parameters of Activator.CreateInstance() were updated
in CUETools.Processor\AudioReadWrite.cs as of commits 16fccfe and
e1f8906. The parameter "settings" was added in front of path and IO,
which required an update to the order of constructor parameters in
several codecs.

- Fixes the following error message, when using FLACCL codec:
  Exception: Constructor on type
  'CUETools.Codecs.FLACCL.AudioEncoder' not found.
- This is a follow-up commit to 18c6c1a
- Resolves #82
  • Loading branch information
c72578 committed Feb 24, 2021
1 parent b108b7f commit cef4ea9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
7 changes: 1 addition & 6 deletions CUETools.Codecs.FLACCL/FLACCLWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ public class AudioEncoder : IAudioDest

public const int MAX_BLOCKSIZE = 65536;

public AudioEncoder(string path, Stream IO, EncoderSettings settings)
public AudioEncoder(EncoderSettings settings, string path, Stream IO)
{
m_settings = settings.Clone() as EncoderSettings;
m_settings.Validate();
Expand All @@ -396,11 +396,6 @@ public AudioEncoder(string path, Stream IO, EncoderSettings settings)
crc8 = new Crc8();
}

public AudioEncoder(string path, EncoderSettings settings)
: this(path, null, settings)
{
}

public int TotalSize
{
get
Expand Down
5 changes: 2 additions & 3 deletions CUETools.FLACCL.cmd/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,9 @@ static int Main(string[] args)
{
if (device_type != null)
settings.DeviceType = (OpenCLDeviceType)(Enum.Parse(typeof(OpenCLDeviceType), device_type, true));
encoder = new Codecs.FLACCL.AudioEncoder((output_file == "-" || output_file == "nul") ? "" : output_file,
encoder = new Codecs.FLACCL.AudioEncoder(settings, (output_file == "-" || output_file == "nul") ? "" : output_file,
output_file == "-" ? Console.OpenStandardOutput() :
output_file == "nul" ? new NullStream() : null,
settings);
output_file == "nul" ? new NullStream() : null);
settings = encoder.Settings as Codecs.FLACCL.EncoderSettings;
encoder.FinalSampleCount = audioSource.Length;
if (stereo_method != null)
Expand Down

0 comments on commit cef4ea9

Please sign in to comment.