Can be compiled with only WAV support (since Mono doesn't support C++/CLI yet).

Adjusted control spacing, tab-order, etc.
Set Localizable=True on all forms to work around .NET auto-scaling issue.
This commit is contained in:
jdpurcell
2008-10-19 17:58:48 +00:00
parent f6138ce9cc
commit 9f58e03075
10 changed files with 1857 additions and 322 deletions

View File

@@ -31,12 +31,14 @@ namespace CUEToolsLib {
switch (Path.GetExtension(path).ToLower()) {
case ".wav":
return new WAVReader(path);
#if !MONO
case ".flac":
return new FLACReader(path);
case ".wv":
return new WavPackReader(path);
case ".ape":
return new APEReader(path);
#endif
default:
throw new Exception("Unsupported audio type.");
}
@@ -47,6 +49,7 @@ namespace CUEToolsLib {
switch (Path.GetExtension(path).ToLower()) {
case ".wav":
dest = new WAVWriter(path, bitsPerSample, channelCount, sampleRate); break;
#if !MONO
case ".flac":
dest = new FLACWriter(path, bitsPerSample, channelCount, sampleRate); break;
case ".wv":
@@ -55,6 +58,7 @@ namespace CUEToolsLib {
dest = new APEWriter(path, bitsPerSample, channelCount, sampleRate); break;
case ".dummy":
dest = new DummyWriter(path, bitsPerSample, channelCount, sampleRate); break;
#endif
default:
throw new Exception("Unsupported audio type.");
}
@@ -378,6 +382,7 @@ namespace CUEToolsLib {
}
}
#if !MONO
class FLACReader : IAudioSource {
FLACDotNet.FLACReader _flacReader;
int[,] _sampleBuffer;
@@ -588,7 +593,9 @@ namespace CUEToolsLib {
_flacWriter.Write(_sampleBuffer, (int) sampleCount);
}
}
#endif
#if !MONO
class APEReader : IAudioSource {
APEDotNet.APEReader _apeReader;
int[,] _sampleBuffer;
@@ -785,7 +792,9 @@ namespace CUEToolsLib {
_apeWriter.Write (buff, sampleCount);
}
}
#endif
#if !MONO
class WavPackReader : IAudioSource {
WavPackDotNet.WavPackReader _wavPackReader;
@@ -965,4 +974,5 @@ namespace CUEToolsLib {
_wavPackWriter.Write(_sampleBuffer, (int) sampleCount);
}
}
#endif
}

View File

@@ -1489,8 +1489,10 @@ namespace CUEToolsLib
NameValueCollection tags = audioSource.Tags;
CleanupTags(tags, "ACCURATERIP");
GenerateAccurateRipTags (tags, 0, bestOffset, -1);
#if !MONO
if (audioSource is FLACReader)
((FLACReader)audioSource).UpdateTags();
#endif
audioSource.Close();
audioSource = null;
} else if (_hasTrackFilenames)
@@ -1499,6 +1501,7 @@ namespace CUEToolsLib
{
string src = _sourcePaths[iTrack + (_hasHTOAFilename ? 1 : 0)];
IAudioSource audioSource = AudioReadWrite.GetAudioSource(src);
#if !MONO
if (audioSource is FLACReader)
{
NameValueCollection tags = audioSource.Tags;
@@ -1506,6 +1509,7 @@ namespace CUEToolsLib
GenerateAccurateRipTags (tags, 0, bestOffset, iTrack);
((FLACReader)audioSource).UpdateTags();
}
#endif
audioSource.Close();
audioSource = null;
}
@@ -1679,6 +1683,7 @@ namespace CUEToolsLib
if (audioDest != null) audioDest.Close();
iDest++;
audioDest = GetAudioDest(destPaths[iDest], destLengths[iDest], noOutput);
#if !MONO
if (audioDest is FLACWriter)
{
NameValueCollection destTags = new NameValueCollection();
@@ -1729,6 +1734,7 @@ namespace CUEToolsLib
}
((FLACWriter)audioDest).SetTags(destTags);
}
#endif
}
if ((style == CUEStyle.GapsAppended) && (iIndex == 0) && (iTrack == 0)) {
@@ -1948,6 +1954,7 @@ namespace CUEToolsLib
IAudioDest dest = AudioReadWrite.GetAudioDest(path, 16, 2, 44100, finalSampleCount);
#if !MONO
if (dest is FLACWriter) {
FLACWriter w = (FLACWriter)dest;
w.CompressionLevel = (int) _config.flacCompressionLevel;
@@ -1958,6 +1965,7 @@ namespace CUEToolsLib
w.CompressionMode = _config.wvCompressionMode;
w.ExtraMode = _config.wvExtraMode;
}
#endif
return dest;
}