mirror of
https://github.com/claunia/cuetools.net.git
synced 2025-12-16 18:14:25 +00:00
Removed lossyWAV support from CUETools - it was outdated anyway
This commit is contained in:
@@ -2,7 +2,6 @@ using System;
|
||||
using System.IO;
|
||||
using CUETools.CDImage;
|
||||
using CUETools.Codecs;
|
||||
using CUETools.Codecs.LossyWAV;
|
||||
|
||||
namespace CUETools.Processor
|
||||
{
|
||||
@@ -49,35 +48,14 @@ namespace CUETools.Processor
|
||||
public static IAudioSource GetAudioSource(string path, Stream IO, CUEConfig config)
|
||||
{
|
||||
string extension = Path.GetExtension(path).ToLower();
|
||||
string filename = Path.GetFileNameWithoutExtension(path);
|
||||
string secondExtension = Path.GetExtension(filename).ToLower();
|
||||
if (secondExtension != ".lossy" && secondExtension != ".lwcdf")
|
||||
return GetAudioSource(path, IO, extension, config);
|
||||
|
||||
string lossyPath = Path.Combine(Path.GetDirectoryName(path), Path.GetFileNameWithoutExtension(filename) + ".lossy" + extension);
|
||||
string lwcdfPath = Path.Combine(Path.GetDirectoryName(path), Path.GetFileNameWithoutExtension(filename) + ".lwcdf" + extension);
|
||||
IAudioSource lossySource = GetAudioSource(lossyPath, null, extension, config);
|
||||
IAudioSource lwcdfSource = null;
|
||||
try
|
||||
{
|
||||
lwcdfSource = GetAudioSource(lwcdfPath, null, extension, config);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return lossySource;
|
||||
}
|
||||
return new LossyWAVReader(lossySource, lwcdfSource);
|
||||
return GetAudioSource(path, IO, extension, config);
|
||||
}
|
||||
|
||||
public static IAudioDest GetAudioDest(AudioEncoderType audioEncoderType, string path, AudioPCMConfig pcm, long finalSampleCount, int padding, string extension, CUEConfig config)
|
||||
{
|
||||
IAudioDest dest;
|
||||
if (audioEncoderType == AudioEncoderType.NoAudio || extension == ".dummy")
|
||||
{
|
||||
dest = new DummyWriter(path, new AudioEncoderSettings(pcm));
|
||||
dest.FinalSampleCount = finalSampleCount;
|
||||
return dest;
|
||||
}
|
||||
if (audioEncoderType == AudioEncoderType.NoAudio || extension == ".dummy")
|
||||
return new DummyWriter(path, new AudioEncoderSettings(pcm)) { FinalSampleCount = finalSampleCount };
|
||||
CUEToolsFormat fmt;
|
||||
if (!extension.StartsWith(".") || !config.formats.TryGetValue(extension.Substring(1), out fmt))
|
||||
throw new Exception("Unsupported audio type: " + path);
|
||||
@@ -97,19 +75,5 @@ namespace CUETools.Processor
|
||||
dest.FinalSampleCount = finalSampleCount;
|
||||
return dest;
|
||||
}
|
||||
|
||||
public static IAudioDest GetAudioDest(AudioEncoderType audioEncoderType, string path, long finalSampleCount, int padding, AudioPCMConfig pcm, CUEConfig config)
|
||||
{
|
||||
string extension = Path.GetExtension(path).ToLower();
|
||||
string filename = Path.GetFileNameWithoutExtension(path);
|
||||
if (audioEncoderType == AudioEncoderType.NoAudio || audioEncoderType == AudioEncoderType.Lossless || Path.GetExtension(filename).ToLower() != ".lossy")
|
||||
return GetAudioDest(audioEncoderType, path, pcm, finalSampleCount, padding, extension, config);
|
||||
|
||||
string lwcdfPath = Path.Combine(Path.GetDirectoryName(path), Path.GetFileNameWithoutExtension(filename) + ".lwcdf" + extension);
|
||||
AudioPCMConfig lossypcm = new AudioPCMConfig((config.detectHDCD && config.decodeHDCD && !config.decodeHDCDtoLW16) ? 24 : 16, pcm.ChannelCount, pcm.SampleRate);
|
||||
IAudioDest lossyDest = GetAudioDest(AudioEncoderType.Lossless, path, lossypcm, finalSampleCount, padding, extension, config);
|
||||
IAudioDest lwcdfDest = audioEncoderType == AudioEncoderType.Hybrid ? GetAudioDest(AudioEncoderType.Lossless, lwcdfPath, lossypcm, finalSampleCount, padding, extension, config) : null;
|
||||
return new LossyWAVWriter(lossyDest, lwcdfDest, config.lossyWAVQuality, new AudioEncoderSettings(pcm));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user