mirror of
https://github.com/claunia/cuetools.net.git
synced 2025-12-16 18:14:25 +00:00
Wavpack output can now have tags and embedded cue sheet.
This commit is contained in:
@@ -116,7 +116,12 @@ namespace WavPackDotNet {
|
||||
|
||||
property NameValueCollection^ Tags {
|
||||
NameValueCollection^ get () {
|
||||
if (!_tags) _tags = (gcnew APETagDotNet (_path, true))->GetStringTags (true);
|
||||
if (!_tags)
|
||||
{
|
||||
APETagDotNet^ apeTag = gcnew APETagDotNet (_path, true, true);
|
||||
_tags = apeTag->GetStringTags (true);
|
||||
apeTag->Close ();
|
||||
}
|
||||
return _tags;
|
||||
}
|
||||
void set (NameValueCollection ^tags) {
|
||||
@@ -157,6 +162,9 @@ namespace WavPackDotNet {
|
||||
throw gcnew Exception("Only stereo and mono audio formats are allowed.");
|
||||
}
|
||||
|
||||
_path = path;
|
||||
_tags = gcnew NameValueCollection();
|
||||
|
||||
_compressionMode = 1;
|
||||
_extraMode = 0;
|
||||
|
||||
@@ -180,6 +188,15 @@ namespace WavPackDotNet {
|
||||
if ((_finalSampleCount != 0) && (_samplesWritten != _finalSampleCount)) {
|
||||
throw gcnew Exception("Samples written differs from the expected sample count.");
|
||||
}
|
||||
|
||||
if (_tags->Count > 0)
|
||||
{
|
||||
APETagDotNet^ apeTag = gcnew APETagDotNet (_path, true, false);
|
||||
apeTag->SetStringTags (_tags, true);
|
||||
apeTag->Save();
|
||||
apeTag->Close();
|
||||
_tags->Clear ();
|
||||
}
|
||||
}
|
||||
|
||||
property Int32 FinalSampleCount {
|
||||
@@ -233,6 +250,10 @@ namespace WavPackDotNet {
|
||||
_samplesWritten += sampleCount;
|
||||
}
|
||||
|
||||
void SetTags (NameValueCollection^ tags) {
|
||||
_tags = tags;
|
||||
}
|
||||
|
||||
private:
|
||||
FILE *_hFile;
|
||||
bool _initialized;
|
||||
@@ -240,6 +261,8 @@ namespace WavPackDotNet {
|
||||
Int32 _finalSampleCount, _samplesWritten;
|
||||
Int32 _bitsPerSample, _channelCount, _sampleRate;
|
||||
Int32 _compressionMode, _extraMode;
|
||||
NameValueCollection^ _tags;
|
||||
String^ _path;
|
||||
|
||||
void Initialize() {
|
||||
WavpackConfig config;
|
||||
|
||||
Reference in New Issue
Block a user