1) Support for user-defined external commandline codecs, tested on TAK

2) Better support for zip archives, which previously worked only with flac/wav files
3) More reliable tag handling, using taglib-sharp. Pictures are now preserved.
4) ALAC decoder bug fixed
This commit is contained in:
chudov
2009-02-19 04:09:59 +00:00
parent 3d94188f92
commit f37d698f6a
32 changed files with 3965 additions and 2641 deletions

View File

@@ -4,8 +4,6 @@
#include "CUETools.Codecs.TTA.h"
using namespace APETagsDotNet;
typedef void * HANDLE;
#include "../TTALib-1.1/TTAReader.h"
@@ -34,7 +32,6 @@ namespace TTA {
public:
TTAReader(String^ path, Stream^ IO)
{
_tags = nullptr;
_sampleOffset = 0;
_sampleBuffer = nullptr;
_path = path;
@@ -128,31 +125,6 @@ namespace TTA {
}
}
virtual property NameValueCollection^ Tags {
NameValueCollection^ get () {
if (!_tags)
{
APETagDotNet^ apeTag = gcnew APETagDotNet (_IO, true);
_tags = apeTag->GetStringTags (true);
apeTag->Close ();
}
return _tags;
}
void set (NameValueCollection ^tags) {
_tags = tags;
}
}
virtual bool UpdateTags (bool preserveTime)
{
Close ();
APETagDotNet^ apeTag = gcnew APETagDotNet (_path, true, false);
apeTag->SetStringTags (_tags, true);
apeTag->Save();
apeTag->Close();
return true;
}
virtual property UInt64 Remaining {
UInt64 get() {
return _sampleCount - _sampleOffset + SamplesInBuffer;
@@ -235,7 +207,6 @@ namespace TTA {
Int32 _bitsPerSample, _channelCount, _sampleRate;
array<Int32, 2>^ _sampleBuffer;
array<unsigned char>^ _readBuffer;
NameValueCollection^ _tags;
String^ _path;
Stream^ _IO;
UInt32 _bufferOffset, _bufferLength;
@@ -267,7 +238,6 @@ namespace TTA {
_sampleRate = sampleRate;
_compressionLevel = 5;
_blockSize = 0;
_tags = gcnew NameValueCollection();
}
virtual void Close() {
@@ -292,19 +262,8 @@ namespace TTA {
if (_IO)
_IO->Close();
if (_tags->Count > 0)
{
APETagDotNet^ apeTag = gcnew APETagDotNet (_path, true, false);
apeTag->SetStringTags (_tags, true);
apeTag->Save();
apeTag->Close();
_tags->Clear ();
}
if ((_finalSampleCount != 0) && (_samplesWritten != _finalSampleCount)) {
if ((_finalSampleCount != 0) && (_samplesWritten != _finalSampleCount))
throw gcnew Exception("Samples written differs from the expected sample count.");
}
_tags->Clear ();
}
virtual void Delete()
@@ -341,12 +300,6 @@ namespace TTA {
int get() { return _bitsPerSample; }
}
virtual bool SetTags (NameValueCollection^ tags)
{
_tags = tags;
return true;
}
virtual property String^ Path {
String^ get() {
return _path;
@@ -397,7 +350,6 @@ namespace TTA {
Int64 _finalSampleCount, _samplesWritten, _blockSize;
Int32 _bitsPerSample, _channelCount, _sampleRate;
Int32 _compressionLevel;
NameValueCollection^ _tags;
void Initialize()
{