diff --git a/CUETools.AccurateRip/AccurateRip.cs b/CUETools.AccurateRip/AccurateRip.cs index 9fac6ee..6ce9844 100644 --- a/CUETools.AccurateRip/AccurateRip.cs +++ b/CUETools.AccurateRip/AccurateRip.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Collections.Specialized; using System.Text; using System.Globalization; using System.Net; @@ -348,11 +347,6 @@ namespace CUETools.AccurateRip } } - public bool SetTags(NameValueCollection tags) - { - throw new Exception("unsupported"); - } - public void Close() { if (_sampleCount != _finalSampleCount) diff --git a/CUETools.Codecs.ALAC/ALACDotNet.cs b/CUETools.Codecs.ALAC/ALACDotNet.cs index 32cef67..234f233 100644 --- a/CUETools.Codecs.ALAC/ALACDotNet.cs +++ b/CUETools.Codecs.ALAC/ALACDotNet.cs @@ -476,7 +476,7 @@ namespace CUETools.Codecs.ALAC for (int output_count = 0; output_count < output_size; output_count++) { int x = sign_modifier + decode_scalar(buff, ref pos, 31 - count_leading_zeroes((history >> 9) + 3), rice_kmodifier, readsamplesize); - output_buffer[output_count] = ((x + 1) >> 1) * (1 - ((x & 1) << 1)); + output_buffer[output_count] = (x >> 1) ^ - (x & 1); sign_modifier = 0; /* now update the history */ @@ -542,7 +542,7 @@ namespace CUETools.Codecs.ALAC return; for (i = 0; i < output_size; i++) { - sample += buf_err[i]; + sample = extend_sign32(sample + buf_err[i], readsamplesize); buf_out[i] = sample; } return; @@ -554,7 +554,7 @@ namespace CUETools.Codecs.ALAC /* read warm-up samples */ for (i = 0; i <= predictor_info.predictor_coef_num; i++) { - sample += buf_err[i]; + sample = extend_sign32(sample + buf_err[i], readsamplesize); buf_out[i] = sample; } @@ -576,7 +576,7 @@ namespace CUETools.Codecs.ALAC outval >>= pr->prediction_quantitization; outval += sample_val + error_val; - buf_pos[pr->predictor_coef_num] = outval; + buf_pos[pr->predictor_coef_num] = extend_sign32(outval, readsamplesize); if (error_val != 0) { @@ -614,14 +614,20 @@ namespace CUETools.Codecs.ALAC { for (i = 0; i < _samplesInBuffer; i++) { - int a = buf_a[i]; - int b = buf_b[i]; + int midright = buf_a[i]; + int diff = buf_b[i]; - a -= (b * _interlacing_leftweight) >> _interlacing_shift; - b += a; + midright -= (diff * _interlacing_leftweight) >> _interlacing_shift; - buf_s[i * 2] = b; - buf_s[i * 2 + 1] = a; + buf_s[i * 2] = midright + diff; + buf_s[i * 2 + 1] = midright; + +#if DEBUG + if (buf_s[i * 2] >= (1 << _bitsPerSample) || buf_s[i * 2] < -(1 << _bitsPerSample) || + buf_s[i * 2 + 1] >= (1 << _bitsPerSample) || buf_s[i * 2 + 1] < -(1 << _bitsPerSample) + ) + throw new Exception("overflow in ALAC decoder"); +#endif } return; } @@ -1169,21 +1175,22 @@ namespace CUETools.Codecs.ALAC qtmovie_add_any_parser("top.moov.trak.mdia.minf.stbl.stsz", new qtmovie_read_atom(qtmovie_read_chunk_stsz), null); // _sample_byte_size qtmovie_add_nul_parser("top.moov.trak.mdia.minf.stbl.stsc"); /* skip these, no indexing for us! */ qtmovie_add_nul_parser("top.moov.trak.mdia.minf.stbl.stco"); /* skip these, no indexing for us! */ - qtmovie_add_lst_parser("top.moov.udta", null); - qtmovie_add_lst_parser("top.moov.udta.meta", (uint)4); - qtmovie_add_lst_parser("top.moov.udta.meta.ilst", null); - qtmovie_add_tag_parser("top.moov.udta.meta.ilst.nam", "TITLE"); - qtmovie_add_tag_parser("top.moov.udta.meta.ilst.ART", "ARTIST"); - qtmovie_add_tag_parser("top.moov.udta.meta.ilst.wrt", "COMPOSER"); - qtmovie_add_tag_parser("top.moov.udta.meta.ilst.alb", "ALBUM"); - qtmovie_add_tag_parser("top.moov.udta.meta.ilst.day", "DATE"); - qtmovie_add_tag_parser("top.moov.udta.meta.ilst.gen", "GENRE"); - qtmovie_add_tag_parser("top.moov.udta.meta.ilst.disk"); - qtmovie_add_tag_parser("top.moov.udta.meta.ilst.trkn"); - qtmovie_add_any_parser("top.moov.udta.meta.ilst.----", new qtmovie_read_atom(qtmovie_read_meta_freeform), null); - qtmovie_add_any_parser("top.moov.udta.meta.ilst.----.mean", new qtmovie_read_atom(qtmovie_read_meta_mean), null); - qtmovie_add_any_parser("top.moov.udta.meta.ilst.----.name", new qtmovie_read_atom(qtmovie_read_meta_name), null); - qtmovie_add_any_parser("top.moov.udta.meta.ilst.----.data", new qtmovie_read_atom(qtmovie_read_meta_data), null); + qtmovie_add_nul_parser("top.moov.udta"); + //qtmovie_add_lst_parser("top.moov.udta", null); + //qtmovie_add_lst_parser("top.moov.udta.meta", (uint)4); + //qtmovie_add_lst_parser("top.moov.udta.meta.ilst", null); + //qtmovie_add_tag_parser("top.moov.udta.meta.ilst.nam", "TITLE"); + //qtmovie_add_tag_parser("top.moov.udta.meta.ilst.ART", "ARTIST"); + //qtmovie_add_tag_parser("top.moov.udta.meta.ilst.wrt", "COMPOSER"); + //qtmovie_add_tag_parser("top.moov.udta.meta.ilst.alb", "ALBUM"); + //qtmovie_add_tag_parser("top.moov.udta.meta.ilst.day", "DATE"); + //qtmovie_add_tag_parser("top.moov.udta.meta.ilst.gen", "GENRE"); + //qtmovie_add_tag_parser("top.moov.udta.meta.ilst.disk"); + //qtmovie_add_tag_parser("top.moov.udta.meta.ilst.trkn"); + //qtmovie_add_any_parser("top.moov.udta.meta.ilst.----", new qtmovie_read_atom(qtmovie_read_meta_freeform), null); + //qtmovie_add_any_parser("top.moov.udta.meta.ilst.----.mean", new qtmovie_read_atom(qtmovie_read_meta_mean), null); + //qtmovie_add_any_parser("top.moov.udta.meta.ilst.----.name", new qtmovie_read_atom(qtmovie_read_meta_name), null); + //qtmovie_add_any_parser("top.moov.udta.meta.ilst.----.data", new qtmovie_read_atom(qtmovie_read_meta_data), null); while (true) { diff --git a/CUETools.Codecs.APE/CUETools.Codecs.APE.cpp b/CUETools.Codecs.APE/CUETools.Codecs.APE.cpp index bf3a6c2..71d4519 100644 --- a/CUETools.Codecs.APE/CUETools.Codecs.APE.cpp +++ b/CUETools.Codecs.APE/CUETools.Codecs.APE.cpp @@ -3,10 +3,8 @@ using namespace System; using namespace System::Text; using namespace System::Collections::Generic; -using namespace System::Collections::Specialized; using namespace System::Runtime::InteropServices; using namespace System::IO; -using namespace APETagsDotNet; using namespace CUETools::Codecs; #ifndef _WAVEFORMATEX_ @@ -212,33 +210,6 @@ namespace CUETools { namespace Codecs { namespace APE { } } - 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 array^ Read(array^ buff) { return AudioSamples::Read(this, buff); @@ -273,7 +244,6 @@ namespace CUETools { namespace Codecs { namespace APE { private: IAPEDecompress * pAPEDecompress; - NameValueCollection^ _tags; Int64 _sampleCount, _sampleOffset; Int32 _bitsPerSample, _channelCount, _sampleRate; UInt32 _bufferOffset, _bufferLength; @@ -305,7 +275,6 @@ namespace CUETools { namespace Codecs { namespace APE { throw gcnew Exception("Monkey's Audio doesn't support selected bits per sample value."); _path = path; - _tags = gcnew NameValueCollection(); _winFileIO = NULL; _compressionLevel = COMPRESSION_LEVEL_NORMAL; @@ -344,15 +313,6 @@ namespace CUETools { namespace Codecs { namespace APE { throw gcnew Exception("Samples written differs from the expected sample count."); } - if (_tags->Count > 0) - { - APETagDotNet^ apeTag = gcnew APETagDotNet (_IO, true); - apeTag->SetStringTags (_tags, true); - apeTag->Save(); - apeTag->Close(); - _tags->Clear (); - } - if (_IO != nullptr) { _IO->Close (); @@ -413,12 +373,6 @@ namespace CUETools { namespace Codecs { namespace APE { } } - virtual bool SetTags (NameValueCollection^ tags) - { - _tags = tags; - return true; - } - property Int32 CompressionLevel { Int32 get() { return _compressionLevel; @@ -437,7 +391,6 @@ namespace CUETools { namespace Codecs { namespace APE { Int32 _finalSampleCount, _samplesWritten; Int32 _bitsPerSample, _channelCount, _sampleRate, _blockAlign; Int32 _compressionLevel; - NameValueCollection^ _tags; String^ _path; Stream^ _IO; GCHandle _gchIO, _gchBuffer; diff --git a/CUETools.Codecs.APE/CUETools.Codecs.APE.vcproj b/CUETools.Codecs.APE/CUETools.Codecs.APE.vcproj index b1072e9..8d657c2 100644 --- a/CUETools.Codecs.APE/CUETools.Codecs.APE.vcproj +++ b/CUETools.Codecs.APE/CUETools.Codecs.APE.vcproj @@ -333,13 +333,9 @@ RelativePath="System.XML.dll" AssemblyName="System.Xml, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" /> - @@ -349,11 +345,11 @@ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" > type == FLAC__METADATA_TYPE_VORBIS_COMMENT) + // FLAC__metadata_iterator_delete_block (i, false); + // } while (FLAC__metadata_iterator_next (i)); - IntPtr pathChars = Marshal::StringToHGlobalAnsi(_path); - int res = FLAC__metadata_chain_read (chain, (const char*)pathChars.ToPointer()); - Marshal::FreeHGlobal(pathChars); - if (!res) { - FLAC__metadata_chain_delete (chain); - return false; - } - FLAC__Metadata_Iterator* i = FLAC__metadata_iterator_new (); - FLAC__metadata_iterator_init (i, chain); - do { - FLAC__StreamMetadata* metadata = FLAC__metadata_iterator_get_block (i); - if (metadata->type == FLAC__METADATA_TYPE_VORBIS_COMMENT) - FLAC__metadata_iterator_delete_block (i, false); - } while (FLAC__metadata_iterator_next (i)); + // FLAC__StreamMetadata * vorbiscomment = FLAC__metadata_object_new(FLAC__METADATA_TYPE_VORBIS_COMMENT); + // for (int tagno = 0; tagno <_tags->Count; tagno++) + // { + // String ^ tag_name = _tags->GetKey(tagno); + // int tag_len = tag_name->Length; + // char * tag = new char [tag_len + 1]; + // IntPtr nameChars = Marshal::StringToHGlobalAnsi(tag_name); + // memcpy (tag, (const char*)nameChars.ToPointer(), tag_len); + // Marshal::FreeHGlobal(nameChars); + // tag[tag_len] = 0; - FLAC__StreamMetadata * vorbiscomment = FLAC__metadata_object_new(FLAC__METADATA_TYPE_VORBIS_COMMENT); - for (int tagno = 0; tagno <_tags->Count; tagno++) - { - String ^ tag_name = _tags->GetKey(tagno); - int tag_len = tag_name->Length; - char * tag = new char [tag_len + 1]; - IntPtr nameChars = Marshal::StringToHGlobalAnsi(tag_name); - memcpy (tag, (const char*)nameChars.ToPointer(), tag_len); - Marshal::FreeHGlobal(nameChars); - tag[tag_len] = 0; + // array^ tag_values = _tags->GetValues(tagno); + // for (int valno = 0; valno < tag_values->Length; valno++) + // { + // UTF8Encoding^ enc = gcnew UTF8Encoding(); + // array^ value_array = enc->GetBytes (tag_values[valno]); + // int value_len = value_array->Length; + // char * value = new char [value_len + 1]; + // Marshal::Copy (value_array, 0, (IntPtr) value, value_len); + // value[value_len] = 0; - array^ tag_values = _tags->GetValues(tagno); - for (int valno = 0; valno < tag_values->Length; valno++) - { - UTF8Encoding^ enc = gcnew UTF8Encoding(); - array^ value_array = enc->GetBytes (tag_values[valno]); - int value_len = value_array->Length; - char * value = new char [value_len + 1]; - Marshal::Copy (value_array, 0, (IntPtr) value, value_len); - value[value_len] = 0; + // FLAC__StreamMetadata_VorbisComment_Entry entry; + // /* create and entry and append it */ + // if(!FLAC__metadata_object_vorbiscomment_entry_from_name_value_pair(&entry, tag, value)) { + // throw gcnew Exception("Unable to add tags, must be valid utf8."); + // } + // if(!FLAC__metadata_object_vorbiscomment_append_comment(vorbiscomment, entry, /*copy=*/false)) { + // throw gcnew Exception("Unable to add tags."); + // } + // delete [] value; + // } + // delete [] tag; + // } - FLAC__StreamMetadata_VorbisComment_Entry entry; - /* create and entry and append it */ - if(!FLAC__metadata_object_vorbiscomment_entry_from_name_value_pair(&entry, tag, value)) { - throw gcnew Exception("Unable to add tags, must be valid utf8."); - } - if(!FLAC__metadata_object_vorbiscomment_append_comment(vorbiscomment, entry, /*copy=*/false)) { - throw gcnew Exception("Unable to add tags."); - } - delete [] value; - } - delete [] tag; - } - - FLAC__metadata_iterator_insert_block_after (i, vorbiscomment); - FLAC__metadata_iterator_delete (i); - FLAC__metadata_chain_sort_padding (chain); - res = FLAC__metadata_chain_write (chain, true, preserveTime); - FLAC__metadata_chain_delete (chain); - return 0 != res; - } + // FLAC__metadata_iterator_insert_block_after (i, vorbiscomment); + // FLAC__metadata_iterator_delete (i); + // FLAC__metadata_chain_sort_padding (chain); + // res = FLAC__metadata_chain_write (chain, true, preserveTime); + // FLAC__metadata_chain_delete (chain); + // return 0 != res; + //} virtual property UInt64 Remaining { UInt64 get() { @@ -311,7 +299,6 @@ namespace CUETools { namespace Codecs { namespace FLAC { Int32 _bitsPerSample, _channelCount, _sampleRate; array^ _sampleBuffer; array^ _readBuffer; - NameValueCollection^ _tags; String^ _path; bool _decoderActive; Stream^ _IO; @@ -370,23 +357,23 @@ namespace CUETools { namespace Codecs { namespace FLAC { _sampleRate = metadata->data.stream_info.sample_rate; _sampleCount = metadata->data.stream_info.total_samples; } - if (metadata->type == FLAC__METADATA_TYPE_VORBIS_COMMENT) - { - for (unsigned tagno = 0; tagno < metadata->data.vorbis_comment.num_comments; tagno ++) - { - char * field_name, * field_value; - if(!FLAC__metadata_object_vorbiscomment_entry_to_name_value_pair(metadata->data.vorbis_comment.comments[tagno], &field_name, &field_value)) - throw gcnew Exception("Unable to parse vorbis comment."); - String^ name = Marshal::PtrToStringAnsi ((IntPtr) field_name); - free (field_name); - array^ bvalue = gcnew array((int) strlen (field_value)); - Marshal::Copy ((IntPtr) field_value, bvalue, 0, (int) strlen (field_value)); - free (field_value); - UTF8Encoding^ enc = gcnew UTF8Encoding(); - String ^value = enc->GetString (bvalue); - _tags->Add (name, value); - } - } + //if (metadata->type == FLAC__METADATA_TYPE_VORBIS_COMMENT) + //{ + // for (unsigned tagno = 0; tagno < metadata->data.vorbis_comment.num_comments; tagno ++) + // { + // char * field_name, * field_value; + // if(!FLAC__metadata_object_vorbiscomment_entry_to_name_value_pair(metadata->data.vorbis_comment.comments[tagno], &field_name, &field_value)) + // throw gcnew Exception("Unable to parse vorbis comment."); + // String^ name = Marshal::PtrToStringAnsi ((IntPtr) field_name); + // free (field_name); + // array^ bvalue = gcnew array((int) strlen (field_value)); + // Marshal::Copy ((IntPtr) field_value, bvalue, 0, (int) strlen (field_value)); + // free (field_value); + // UTF8Encoding^ enc = gcnew UTF8Encoding(); + // String ^value = enc->GetString (bvalue); + // _tags->Add (name, value); + // } + //} } void ErrorCallback(const FLAC__StreamDecoder *decoder, @@ -474,7 +461,6 @@ namespace CUETools { namespace Codecs { namespace FLAC { _paddingLength = 8192; _verify = false; _blockSize = 0; - _tags = gcnew NameValueCollection(); _encoder = FLAC__stream_encoder_new(); @@ -495,11 +481,8 @@ namespace CUETools { namespace Codecs { namespace FLAC { FLAC__stream_encoder_delete(_encoder); - 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() @@ -536,12 +519,6 @@ namespace CUETools { namespace Codecs { namespace FLAC { int get() { return _bitsPerSample; } } - virtual bool SetTags (NameValueCollection^ tags) - { - _tags = tags; - return true; - } - virtual property String^ Path { String^ get() { return _path; @@ -556,7 +533,18 @@ namespace CUETools { namespace Codecs { namespace FLAC { if (!FLAC__stream_encoder_process_interleaved(_encoder, (const FLAC__int32*)pSampleBuffer, sampleCount)) { - throw gcnew Exception("An error occurred while encoding."); + String^ state = gcnew String(FLAC__StreamEncoderStateString[FLAC__stream_encoder_get_state(_encoder)]); + if (FLAC__stream_encoder_get_state(_encoder) == FLAC__STREAM_ENCODER_VERIFY_MISMATCH_IN_AUDIO_DATA) + { + FLAC__uint64 absolute_sample; + unsigned frame_number; + unsigned channel; + unsigned sample; + FLAC__int32 expected, got; + FLAC__stream_encoder_get_verify_decoder_error_stats(_encoder, &absolute_sample, &frame_number, &channel, &sample, &expected, &got); + state = state + String::Format("({0:x} instead of {1:x} @{2:x})", got, expected, absolute_sample); + } + throw gcnew Exception("An error occurred while encoding: " + state); } _samplesWritten += sampleCount; @@ -606,7 +594,6 @@ namespace CUETools { namespace Codecs { namespace FLAC { Boolean _verify; FLAC__StreamMetadata **_metadataList; int _metadataCount; - NameValueCollection^ _tags; void Initialize() { FLAC__StreamMetadata *padding, *seektable, *vorbiscomment; @@ -625,39 +612,38 @@ namespace CUETools { namespace Codecs { namespace FLAC { } vorbiscomment = FLAC__metadata_object_new(FLAC__METADATA_TYPE_VORBIS_COMMENT); + //for (int tagno = 0; tagno < _tags->Count; tagno++) + //{ + // String ^ tag_name = _tags->GetKey(tagno); + // int tag_len = tag_name->Length; + // char * tag = new char [tag_len + 1]; + // IntPtr nameChars = Marshal::StringToHGlobalAnsi(tag_name); + // memcpy (tag, (const char*)nameChars.ToPointer(), tag_len); + // Marshal::FreeHGlobal(nameChars); + // tag[tag_len] = 0; - for (int tagno = 0; tagno < _tags->Count; tagno++) - { - String ^ tag_name = _tags->GetKey(tagno); - int tag_len = tag_name->Length; - char * tag = new char [tag_len + 1]; - IntPtr nameChars = Marshal::StringToHGlobalAnsi(tag_name); - memcpy (tag, (const char*)nameChars.ToPointer(), tag_len); - Marshal::FreeHGlobal(nameChars); - tag[tag_len] = 0; + // array^ tag_values = _tags->GetValues(tagno); + // for (int valno = 0; valno < tag_values->Length; valno++) + // { + // UTF8Encoding^ enc = gcnew UTF8Encoding(); + // array^ value_array = enc->GetBytes (tag_values[valno]); + // int value_len = value_array->Length; + // char * value = new char [value_len + 1]; + // Marshal::Copy (value_array, 0, (IntPtr) value, value_len); + // value[value_len] = 0; - array^ tag_values = _tags->GetValues(tagno); - for (int valno = 0; valno < tag_values->Length; valno++) - { - UTF8Encoding^ enc = gcnew UTF8Encoding(); - array^ value_array = enc->GetBytes (tag_values[valno]); - int value_len = value_array->Length; - char * value = new char [value_len + 1]; - Marshal::Copy (value_array, 0, (IntPtr) value, value_len); - value[value_len] = 0; - - FLAC__StreamMetadata_VorbisComment_Entry entry; - /* create and entry and append it */ - if(!FLAC__metadata_object_vorbiscomment_entry_from_name_value_pair(&entry, tag, value)) { - throw gcnew Exception("Unable to add tags, must be valid utf8."); - } - if(!FLAC__metadata_object_vorbiscomment_append_comment(vorbiscomment, entry, /*copy=*/false)) { - throw gcnew Exception("Unable to add tags."); - } - delete [] value; - } - delete [] tag; - } + // FLAC__StreamMetadata_VorbisComment_Entry entry; + // /* create and entry and append it */ + // if(!FLAC__metadata_object_vorbiscomment_entry_from_name_value_pair(&entry, tag, value)) { + // throw gcnew Exception("Unable to add tags, must be valid utf8."); + // } + // if(!FLAC__metadata_object_vorbiscomment_append_comment(vorbiscomment, entry, /*copy=*/false)) { + // throw gcnew Exception("Unable to add tags."); + // } + // delete [] value; + // } + // delete [] tag; + //} _metadataList[_metadataCount++] = vorbiscomment; if (_paddingLength != 0) { diff --git a/CUETools.Codecs.LossyWAV/LossyWAV.cs b/CUETools.Codecs.LossyWAV/LossyWAV.cs index 0e42589..b6e06c8 100644 --- a/CUETools.Codecs.LossyWAV/LossyWAV.cs +++ b/CUETools.Codecs.LossyWAV/LossyWAV.cs @@ -23,7 +23,6 @@ using System; using System.Collections.Generic; -using System.Collections.Specialized; using System.Text; using CUETools.Codecs; @@ -118,13 +117,6 @@ namespace CUETools.Codecs.LossyWAV } } - public bool SetTags(NameValueCollection tags) - { - if (_audioDest != null) _audioDest.SetTags(tags); - if (_lwcdfDest != null) _lwcdfDest.SetTags(tags); - return true; - } - public string Path { get { return _audioDest.Path; } } public void Delete() @@ -972,23 +964,6 @@ namespace CUETools.Codecs.LossyWAV } } - public NameValueCollection Tags - { - get - { - return _audioSource.Tags; - } - set - { - _audioSource.Tags = value; - } - } - - public bool UpdateTags(bool preserveTime) - { - return _audioSource.UpdateTags(preserveTime); - } - public string Path { get diff --git a/CUETools.Codecs.TTA/CUETools.Codecs.TTA.cpp b/CUETools.Codecs.TTA/CUETools.Codecs.TTA.cpp index 7878f61..cc98e6f 100644 --- a/CUETools.Codecs.TTA/CUETools.Codecs.TTA.cpp +++ b/CUETools.Codecs.TTA/CUETools.Codecs.TTA.cpp @@ -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^ _sampleBuffer; array^ _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() { diff --git a/CUETools.Codecs.TTA/CUETools.Codecs.TTA.h b/CUETools.Codecs.TTA/CUETools.Codecs.TTA.h index 446a12a..4bed2f2 100644 --- a/CUETools.Codecs.TTA/CUETools.Codecs.TTA.h +++ b/CUETools.Codecs.TTA/CUETools.Codecs.TTA.h @@ -6,6 +6,5 @@ using namespace System; using namespace System::Text; using namespace System::IO; using namespace System::Collections::Generic; -using namespace System::Collections::Specialized; using namespace System::Runtime::InteropServices; using namespace CUETools::Codecs; diff --git a/CUETools.Codecs.TTA/CUETools.Codecs.TTA.vcproj b/CUETools.Codecs.TTA/CUETools.Codecs.TTA.vcproj index 69f339b..3078298 100644 --- a/CUETools.Codecs.TTA/CUETools.Codecs.TTA.vcproj +++ b/CUETools.Codecs.TTA/CUETools.Codecs.TTA.vcproj @@ -332,10 +332,6 @@ ReferencedProjectIdentifier="{6458A13A-30EF-45A9-9D58-E5031B17BEE2}" RelativePathToProject="..\CUETools.Codecs\CUETools.Codecs.csproj" /> - @@ -157,31 +155,6 @@ namespace CUETools { namespace Codecs { namespace WavPack { } } - 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 void Close() { if (_wpc != NULL) @@ -215,7 +188,6 @@ namespace CUETools { namespace Codecs { namespace WavPack { private: WavpackContext *_wpc; - NameValueCollection^ _tags; Int32 _sampleCount, _sampleOffset; Int32 _bitsPerSample, _channelCount, _sampleRate; String^ _path; @@ -334,7 +306,6 @@ namespace CUETools { namespace Codecs { namespace WavPack { throw gcnew Exception("Bits per sample must be 16..24."); _path = path; - _tags = gcnew NameValueCollection(); _compressionMode = 1; _extraMode = 0; @@ -366,18 +337,8 @@ namespace CUETools { namespace Codecs { namespace WavPack { _wpc = WavpackCloseFile(_wpc); fclose(_hFile); - if ((_finalSampleCount != 0) && (_samplesWritten != _finalSampleCount)) { + 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 (); - } } virtual void Delete() @@ -455,12 +416,6 @@ namespace CUETools { namespace Codecs { namespace WavPack { } } - virtual bool SetTags (NameValueCollection^ tags) - { - _tags = tags; - return true; - } - property Int32 CompressionMode { Int32 get() { return _compressionMode; @@ -510,7 +465,6 @@ namespace CUETools { namespace Codecs { namespace WavPack { Int32 _finalSampleCount, _samplesWritten; Int32 _bitsPerSample, _channelCount, _sampleRate, _blockAlign; Int32 _compressionMode, _extraMode, _blockSize; - NameValueCollection^ _tags; String^ _path; bool _md5Sum; MD5^ _md5hasher; diff --git a/CUETools.Codecs.WavPack/CUETools.Codecs.WavPack.vcproj b/CUETools.Codecs.WavPack/CUETools.Codecs.WavPack.vcproj index 14bbb48..f1a9950 100644 --- a/CUETools.Codecs.WavPack/CUETools.Codecs.WavPack.vcproj +++ b/CUETools.Codecs.WavPack/CUETools.Codecs.WavPack.vcproj @@ -332,13 +332,9 @@ RelativePath="System.XML.dll" AssemblyName="System.Xml, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" /> - diff --git a/CUETools.Codecs/Codecs.cs b/CUETools.Codecs/Codecs.cs index 6e61e4a..6cad38c 100644 --- a/CUETools.Codecs/Codecs.cs +++ b/CUETools.Codecs/Codecs.cs @@ -2,8 +2,8 @@ using System; using System.IO; using System.Text; using System.Collections.Generic; -using System.Collections.Specialized; using System.Threading; +using System.Diagnostics; namespace CUETools.Codecs { @@ -13,8 +13,6 @@ namespace CUETools.Codecs int[,] Read(int[,] buff); ulong Length { get; } ulong Position { get; set; } - NameValueCollection Tags { get; set; } - bool UpdateTags(bool preserveTime); ulong Remaining { get; } void Close(); int BitsPerSample { get; } @@ -26,7 +24,6 @@ namespace CUETools.Codecs public interface IAudioDest { void Write(int[,] buff, uint sampleCount); - bool SetTags(NameValueCollection tags); void Close(); void Delete(); int BitsPerSample { get; } @@ -189,11 +186,6 @@ namespace CUETools.Codecs _bitsPerSample = bitsPerSample; } - public bool SetTags(NameValueCollection tags) - { - return false; - } - public void Close() { } @@ -288,22 +280,6 @@ namespace CUETools.Codecs } } - public NameValueCollection Tags - { - get - { - return new NameValueCollection(); - } - set - { - } - } - - public bool UpdateTags(bool preserveTime) - { - return false; - } - public uint Read(int [,] buff, uint sampleCount) { uint samplesRemaining = (uint)(_sampleCount - _sampleOffset); @@ -536,22 +512,6 @@ namespace CUETools.Codecs } } - public NameValueCollection Tags - { - get - { - return new NameValueCollection(); - } - set - { - } - } - - public bool UpdateTags(bool preserveTime) - { - return false; - } - public uint Read(int[,] buff, uint sampleCount) { if (sampleCount > Remaining) @@ -562,8 +522,14 @@ namespace CUETools.Codecs int byteCount = (int) sampleCount * _blockAlign; if (_sampleBuffer == null || _sampleBuffer.Length < byteCount) _sampleBuffer = new byte[byteCount]; - if (_IO.Read(_sampleBuffer, 0, (int)byteCount) != byteCount) - throw new Exception("Incomplete file read."); + int pos = 0; + do + { + int len = _IO.Read(_sampleBuffer, pos, (int)byteCount - pos); + if (len <= 0) + throw new Exception("Incomplete file read."); + pos += len; + } while (pos < byteCount); AudioSamples.BytesToFLACSamples(_sampleBuffer, 0, buff, 0, sampleCount, _channelCount, _bitsPerSample); _samplePos += sampleCount; @@ -604,11 +570,6 @@ namespace CUETools.Codecs _bw = new BinaryWriter(_IO); } - public bool SetTags(NameValueCollection tags) - { - return false; - } - public void WriteChunk(uint fcc, byte[] data) { if (_sampleLen > 0) @@ -766,6 +727,219 @@ namespace CUETools.Codecs public string Path { get { return _path; } } } + public class UserDefinedWriter : IAudioDest + { + string _path, _encoder, _encoderParams; + Process _encoderProcess; + WAVWriter wrt; + + public UserDefinedWriter(string path, int bitsPerSample, int channelCount, int sampleRate, Stream IO, string encoder, string encoderParams) + { + _path = path; + _encoder = encoder; + _encoderParams = encoderParams; + + _encoderProcess = new Process(); + _encoderProcess.StartInfo.FileName = _encoder; + _encoderProcess.StartInfo.Arguments = _encoderParams.Replace("%O", "\"" + path + "\""); + _encoderProcess.StartInfo.CreateNoWindow = true; + _encoderProcess.StartInfo.RedirectStandardInput = true; + _encoderProcess.StartInfo.UseShellExecute = false; + bool started = false; + Exception ex = null; + try + { + started = _encoderProcess.Start(); + } + catch (Exception _ex) + { + ex = _ex; + } + if (!started) + throw new Exception(_encoder + ": " + (ex == null ? "please check the path" : ex.Message)); + wrt = new WAVWriter(path, bitsPerSample, channelCount, sampleRate, _encoderProcess.StandardInput.BaseStream); + } + + public void Close() + { + wrt.Close(); + if (!_encoderProcess.HasExited) + _encoderProcess.WaitForExit(); + if (_encoderProcess.ExitCode != 0) + throw new Exception(String.Format("{0} returned error code {1}", _encoder, _encoderProcess.ExitCode)); + } + + public void Delete() + { + Close(); + File.Delete(_path); + } + + public long Position + { + get + { + return wrt.Position; + } + } + + public long FinalSampleCount + { + set { wrt.FinalSampleCount = value; } + } + + public long BlockSize + { + set { } + } + + public int BitsPerSample + { + get { return wrt.BitsPerSample; } + } + + public void Write(int[,] buff, uint sampleCount) + { + wrt.Write(buff, sampleCount); + //_sampleLen += sampleCount; + } + + public string Path { get { return _path; } } + } + + public class UserDefinedReader : IAudioSource + { + string _path, _decoder, _decoderParams; + bool _apev2tags; + Process _decoderProcess; + WAVReader rdr; + + public UserDefinedReader(string path, Stream IO, string decoder, string decoderParams, bool apev2tags) + { + _path = path; + _decoder = decoder; + _decoderParams = decoderParams; + _apev2tags = apev2tags; + _decoderProcess = null; + rdr = null; + } + + void Initialize() + { + if (_decoderProcess != null) + return; + _decoderProcess = new Process(); + _decoderProcess.StartInfo.FileName = _decoder; + _decoderProcess.StartInfo.Arguments = _decoderParams.Replace("%I", "\"" + _path + "\""); + _decoderProcess.StartInfo.CreateNoWindow = true; + _decoderProcess.StartInfo.RedirectStandardOutput = true; + _decoderProcess.StartInfo.UseShellExecute = false; + bool started = false; + Exception ex = null; + try + { + started = _decoderProcess.Start(); + } + catch (Exception _ex) + { + ex = _ex; + } + if (!started) + throw new Exception(_decoder + ": " + (ex == null ? "please check the path" : ex.Message)); + rdr = new WAVReader(_path, _decoderProcess.StandardOutput.BaseStream); + } + + public void Close() + { + if (rdr != null) + rdr.Close(); + if (_decoderProcess != null && !_decoderProcess.HasExited) + try { _decoderProcess.Kill(); _decoderProcess.WaitForExit(); } + catch { } + } + + public ulong Position + { + get + { + Initialize(); + return rdr.Position; + } + set + { + Initialize(); + rdr.Position = value; + } + } + + public ulong Length + { + get + { + Initialize(); + return rdr.Length; + } + } + + public ulong Remaining + { + get + { + Initialize(); + return rdr.Remaining; + } + } + + public int ChannelCount + { + get + { + Initialize(); + return rdr.ChannelCount; + } + } + + public int SampleRate + { + get + { + Initialize(); + return rdr.SampleRate; + } + } + + public int BitsPerSample + { + get + { + Initialize(); + return rdr.BitsPerSample; + } + } + + public int BlockAlign + { + get + { + Initialize(); + return rdr.BlockAlign; + } + } + + public uint Read(int[,] buff, uint sampleCount) + { + Initialize(); + return rdr.Read(buff, sampleCount); + } + + public int[,] Read(int[,] buff) + { + return AudioSamples.Read(this, buff); + } + + public string Path { get { return _path; } } + } + public class AudioPipe : IAudioSource//, IDisposable { private readonly Queue _buffer = new Queue(); @@ -899,22 +1073,6 @@ namespace CUETools.Codecs } } - public NameValueCollection Tags - { - get - { - return _source.Tags; - //return new NameValueCollection(); - } - set - { - } - } - - public bool UpdateTags(bool preserveTime) - { - return false; - } public int[,] Read(int[,] buff) { diff --git a/CUETools.Converter/CUETools.Converter.csproj b/CUETools.Converter/CUETools.Converter.csproj index 4349d15..b851158 100644 --- a/CUETools.Converter/CUETools.Converter.csproj +++ b/CUETools.Converter/CUETools.Converter.csproj @@ -81,6 +81,10 @@ + + {4CC18776-125E-4318-9D24-D60110AD9697} + taglib-sharp + {6458A13A-30EF-45A9-9D58-E5031B17BEE2} CUETools.Codecs diff --git a/CUETools.Converter/Program.cs b/CUETools.Converter/Program.cs index 549e9d6..4770659 100644 --- a/CUETools.Converter/Program.cs +++ b/CUETools.Converter/Program.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Text; using CUETools.Codecs; using CUETools.Processor; @@ -33,16 +34,18 @@ namespace CUETools.Converter DateTime start = DateTime.Now; TimeSpan lastPrint = TimeSpan.FromMilliseconds(0); CUEConfig config = new CUEConfig(); + + SettingsReader sr = new SettingsReader("CUE Tools", "settings.txt"); + config.Load(sr); config.lossyWAVHybrid = false; #if !DEBUG try #endif { - IAudioSource audioSource = AudioReadWrite.GetAudioSource(sourceFile, null); + IAudioSource audioSource = AudioReadWrite.GetAudioSource(sourceFile, null, config); IAudioDest audioDest = AudioReadWrite.GetAudioDest(destFile, (long)audioSource.Length, audioSource.BitsPerSample, audioSource.SampleRate, config); - int[,] buff = new int[0x1000, audioSource.ChannelCount]; + int[,] buff = new int[0x4000, audioSource.ChannelCount]; - audioDest.SetTags(audioSource.Tags); Console.WriteLine("Filename : {0}", sourceFile); Console.WriteLine("File Info : {0}kHz; {1} channel; {2} bit; {3}", audioSource.SampleRate, audioSource.ChannelCount, audioSource.BitsPerSample, TimeSpan.FromSeconds(audioSource.Length * 1.0 / audioSource.SampleRate)); @@ -72,6 +75,16 @@ namespace CUETools.Converter ); audioSource.Close(); audioDest.Close(); + + TagLib.UserDefined.AdditionalFileTypes.Config = config; + TagLib.File sourceInfo = TagLib.File.Create(new TagLib.File.LocalFileAbstraction(sourceFile)); + TagLib.File destInfo = TagLib.File.Create(new TagLib.File.LocalFileAbstraction(destFile)); + if (Tagging.UpdateTags(destInfo, Tagging.Analyze(sourceInfo), config)) + { + sourceInfo.Tag.CopyTo(destInfo.Tag, true); + destInfo.Tag.Pictures = sourceInfo.Tag.Pictures; + destInfo.Save(); + } } #if !DEBUG catch (Exception ex) diff --git a/CUETools.Processor/AudioReadWrite.cs b/CUETools.Processor/AudioReadWrite.cs index c1c29e6..80995d9 100644 --- a/CUETools.Processor/AudioReadWrite.cs +++ b/CUETools.Processor/AudioReadWrite.cs @@ -15,7 +15,7 @@ using System.Collections.Specialized; namespace CUETools.Processor { public static class AudioReadWrite { - public static IAudioSource GetAudioSource(string path, Stream IO, string extension) + public static IAudioSource GetAudioSource(string path, Stream IO, string extension, CUEConfig config) { switch (extension) { @@ -34,25 +34,27 @@ namespace CUETools.Processor return new TTAReader(path, IO); #endif default: + if (extension == "." + config.udc1Extension && config.udc1Decoder != "") + return new UserDefinedReader(path, IO, config.udc1Decoder, config.udc1Params, config.udc1APEv2); throw new Exception("Unsupported audio type: " + path); } } - public static IAudioSource GetAudioSource(string path, Stream IO) + 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); + 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); + IAudioSource lossySource = GetAudioSource(lossyPath, null, extension, config); IAudioSource lwcdfSource = null; try { - lwcdfSource = GetAudioSource(lwcdfPath, null, extension); + lwcdfSource = GetAudioSource(lwcdfPath, null, extension, config); } catch { @@ -91,6 +93,11 @@ namespace CUETools.Processor break; #endif default: + if (extension == "." + config.udc1Extension && config.udc1Encoder != "") + { + dest = new UserDefinedWriter(path, bitsPerSample, channelCount, sampleRate, null, config.udc1Encoder, config.udc1EncParams); + break; + } throw new Exception("Unsupported audio type: " + path); } dest.FinalSampleCount = finalSampleCount; diff --git a/CUETools.Processor/CUETools.Processor.csproj b/CUETools.Processor/CUETools.Processor.csproj index 4a9e873..28c52e9 100644 --- a/CUETools.Processor/CUETools.Processor.csproj +++ b/CUETools.Processor/CUETools.Processor.csproj @@ -99,8 +99,14 @@ + + + + {4CC18776-125E-4318-9D24-D60110AD9697} + taglib-sharp + {F2EC7193-D5E5-4252-9803-5CEB407E910F} CUETools.Codecs.ALAC diff --git a/CUETools.Processor/Processor.cs b/CUETools.Processor/Processor.cs index e5b8fbc..70336e7 100644 --- a/CUETools.Processor/Processor.cs +++ b/CUETools.Processor/Processor.cs @@ -53,7 +53,8 @@ namespace CUETools.Processor WavPack, APE, TTA, - NoAudio + NoAudio, + UDC1 } public enum AccurateRipMode @@ -74,7 +75,7 @@ namespace CUETools.Processor } public static class General { - public static string FormatExtension(OutputAudioFormat value) + public static string FormatExtension(OutputAudioFormat value, CUEConfig config) { switch (value) { @@ -84,6 +85,7 @@ namespace CUETools.Processor case OutputAudioFormat.TTA: return ".tta"; case OutputAudioFormat.WAV: return ".wav"; case OutputAudioFormat.NoAudio: return ".dummy"; + case OutputAudioFormat.UDC1: return "." + config.udc1Extension; } return ".wav"; } @@ -270,6 +272,8 @@ namespace CUETools.Processor public bool lossyWAVHybrid; public bool decodeHDCDtoLW16; public bool decodeHDCDto24bit; + public string udc1Extension, udc1Decoder, udc1Params, udc1Encoder, udc1EncParams; + public bool udc1APEv2; public CUEConfig() { @@ -316,6 +320,9 @@ namespace CUETools.Processor lossyWAVHybrid = true; decodeHDCDtoLW16 = false; decodeHDCDto24bit = true; + + udc1Extension = udc1Decoder = udc1Params = udc1Encoder = udc1EncParams = ""; + udc1APEv2 = false; } public void Save (SettingsWriter sw) @@ -363,6 +370,15 @@ namespace CUETools.Processor sw.Save("LossyWAVHybrid", lossyWAVHybrid); sw.Save("DecodeHDCDToLossyWAV16", decodeHDCDtoLW16); sw.Save("DecodeHDCDTo24bit", decodeHDCDto24bit); + if (udc1Extension != "") + { + sw.Save("UDC1Extension", udc1Extension); + sw.Save("UDC1Decoder", udc1Decoder); + sw.Save("UDC1Params", udc1Params); + sw.Save("UDC1Encoder", udc1Encoder); + sw.Save("UDC1EncParams", udc1EncParams); + sw.Save("UDC1APEv2", udc1APEv2); + } } public void Load(SettingsReader sr) @@ -410,6 +426,13 @@ namespace CUETools.Processor lossyWAVHybrid = sr.LoadBoolean("LossyWAVHybrid") ?? true; decodeHDCDtoLW16 = sr.LoadBoolean("DecodeHDCDToLossyWAV16") ?? false; decodeHDCDto24bit = sr.LoadBoolean("DecodeHDCDTo24bit") ?? true; + + udc1Extension = sr.Load("UDC1Extension") ?? ""; + udc1Decoder = sr.Load("UDC1Decoder") ?? ""; + udc1Params = sr.Load("UDC1Params") ?? ""; + udc1Encoder = sr.Load("UDC1Encoder") ?? ""; + udc1EncParams = sr.Load("UDC1EncParams") ?? ""; + udc1APEv2 = sr.LoadBoolean("UDC1APEv2") ?? false; } public string CleanseString (string s) @@ -484,7 +507,7 @@ namespace CUETools.Processor private string _mbReleaseId; private string _eacLog; private string _cuePath; - private NameValueCollection _albumTags; + private TagLib.File _fileInfo; private const int _arOffsetRange = 5 * 588 - 1; private HDCDDotNet.HDCDDotNet hdcdDecoder; private bool _outputLossyWAV = false; @@ -516,7 +539,6 @@ namespace CUETools.Processor _toc = new CDImageLayout(); _sources = new List(); _sourcePaths = new List(); - _albumTags = new NameValueCollection(); _stop = false; _pause = false; _cuePath = null; @@ -701,7 +723,7 @@ namespace CUETools.Processor bool seenFirstFileIndex = false; List indexes = new List(); IndexInfo indexInfo; - NameValueCollection _trackTags = null; + TagLib.File _trackFileInfo = null; TextReader sr; if (Directory.Exists(pathIn)) @@ -712,6 +734,8 @@ namespace CUETools.Processor string[] audioExts = new string[] { "*.wav", "*.flac", "*.wv", "*.ape", "*.m4a", "*.tta" }; for (i = 0; i < audioExts.Length && cueSheet == null; i++) cueSheet = CUESheet.CreateDummyCUESheet(pathIn, audioExts[i]); + if (_config.udc1Extension != null && cueSheet == null) + cueSheet = CUESheet.CreateDummyCUESheet(pathIn, "*." + _config.udc1Extension); if (cueSheet == null) throw new Exception("Input directory doesn't contain supported audio files."); sr = new StringReader(cueSheet); @@ -839,7 +863,7 @@ namespace CUETools.Processor sr = new StreamReader (pathIn, CUESheet.Encoding); string logPath = Path.ChangeExtension(pathIn, ".log"); - if (File.Exists(logPath)) + if (System.IO.File.Exists(logPath)) { StreamReader logReader = new StreamReader(logPath, CUESheet.Encoding); _eacLog = logReader.ReadToEnd(); @@ -848,7 +872,7 @@ namespace CUETools.Processor else if (CUEToolsSelection != null) { CUEToolsSelectionEventArgs e = new CUEToolsSelectionEventArgs(); - e.choices = Directory.GetFiles(cueDir, "*.log"); + e.choices = Directory.GetFiles(cueDir == "" ? "." : cueDir, "*.log"); if (e.choices.Length > 0) { CUEToolsSelection(this, e); @@ -862,18 +886,15 @@ namespace CUETools.Processor } } else { - IAudioSource audioSource; - NameValueCollection tags; string cuesheetTag = null; - - audioSource = AudioReadWrite.GetAudioSource(pathIn,null); - tags = audioSource.Tags; + TagLib.File fileInfo; + GetSampleLength(pathIn, out fileInfo); + NameValueCollection tags = Tagging.Analyze(fileInfo); cuesheetTag = tags.Get("CUESHEET"); _accurateRipId = tags.Get("ACCURATERIPID"); _eacLog = tags.Get("LOG"); if (_eacLog == null) _eacLog = tags.Get("LOGFILE"); if (_eacLog == null) _eacLog = tags.Get("EACLOG"); - audioSource.Close(); if (cuesheetTag == null) throw new Exception("Input file does not contain a .cue sheet."); sr = new StringReader (cuesheetTag); @@ -909,8 +930,8 @@ namespace CUETools.Processor } _sourcePaths.Add(pathAudio); absoluteFileStartTime += fileTimeLengthFrames; - NameValueCollection tags; - fileTimeLengthSamples = GetSampleLength(pathAudio, out tags); + TagLib.File fileInfo; + fileTimeLengthSamples = GetSampleLength(pathAudio, out fileInfo); if ((fileTimeLengthSamples % 588) == 492 && _config.truncate4608ExtraSamples) { _truncated4608 = true; @@ -918,9 +939,9 @@ namespace CUETools.Processor } fileTimeLengthFrames = (int)((fileTimeLengthSamples + 587) / 588); if (_hasEmbeddedCUESheet) - _albumTags = tags; + _fileInfo = fileInfo; else - _trackTags = tags; + _trackFileInfo = fileInfo; seenFirstFileIndex = false; } } @@ -947,8 +968,9 @@ namespace CUETools.Processor seenFirstFileIndex = true; if (isAudioTrack) { - if (_tracks.Count > 0 && _trackTags != null && _trackTags.Count != 0) - _tracks[_tracks.Count - 1]._trackTags = _trackTags; + if (_tracks.Count > 0 && _trackFileInfo != null) + _tracks[_tracks.Count - 1]._fileInfo = _trackFileInfo; + _trackFileInfo = null; sourceInfo.Path = pathAudio; sourceInfo.Offset = 0; sourceInfo.Length = (uint)fileTimeLengthSamples; @@ -1116,30 +1138,46 @@ namespace CUETools.Processor } if (!_hasEmbeddedCUESheet && _hasSingleFilename) { - _albumTags = _tracks[0]._trackTags; - _tracks[0]._trackTags = new NameValueCollection(); + _fileInfo = _tracks[0]._fileInfo; + _tracks[0]._fileInfo = null; } if (_config.fillUpCUE) { - if ((_config.overwriteCUEData || General.FindCUELine(_attributes, "PERFORMER") == null) && GetCommonTag("ALBUM ARTIST") != null) - General.SetCUELine(_attributes, "PERFORMER", GetCommonTag("ALBUM ARTIST"), true); - if ((_config.overwriteCUEData || General.FindCUELine(_attributes, "PERFORMER") == null) && GetCommonTag("ARTIST") != null) - General.SetCUELine(_attributes, "PERFORMER", GetCommonTag("ARTIST"), true); - if ((_config.overwriteCUEData || General.FindCUELine(_attributes, "TITLE") == null) && GetCommonTag("ALBUM") != null) - General.SetCUELine(_attributes, "TITLE", GetCommonTag("ALBUM"), true); - if ((_config.overwriteCUEData || General.FindCUELine(_attributes, "REM", "DATE") == null) && GetCommonTag("DATE") != null) - General.SetCUELine(_attributes, "REM", "DATE", GetCommonTag("DATE"), false); - if ((_config.overwriteCUEData || General.FindCUELine(_attributes, "REM", "DATE") == null) && GetCommonTag("YEAR") != null) - General.SetCUELine(_attributes, "REM", "DATE", GetCommonTag("YEAR"), false); - if ((_config.overwriteCUEData || General.FindCUELine(_attributes, "REM", "GENRE") == null) && GetCommonTag("GENRE") != null) - General.SetCUELine(_attributes, "REM", "GENRE", GetCommonTag("GENRE"), true); + if (_config.overwriteCUEData || General.FindCUELine(_attributes, "PERFORMER") == null) + { + string value = GetCommonTag(delegate(TagLib.File file) { return file.Tag.JoinedAlbumArtists; }); + if (value == null) + value = GetCommonTag(delegate(TagLib.File file) { return file.Tag.JoinedPerformers; }); + if (value != null) + General.SetCUELine(_attributes, "PERFORMER", value, true); + } + if (_config.overwriteCUEData || General.FindCUELine(_attributes, "TITLE") == null) + { + string value = GetCommonTag(delegate(TagLib.File file) { return file.Tag.Album; }); + if (value != null) + General.SetCUELine(_attributes, "TITLE", value, true); + } + if (_config.overwriteCUEData || General.FindCUELine(_attributes, "REM", "DATE") == null) + { + string value = GetCommonTag(delegate(TagLib.File file) { return file.Tag.Year != 0 ? file.Tag.Year.ToString() : null; }); + if (value != null) + General.SetCUELine(_attributes, "REM", "DATE", value, false); + } + if (_config.overwriteCUEData || General.FindCUELine(_attributes, "REM", "GENRE") == null) + { + string value = GetCommonTag(delegate(TagLib.File file) { return file.Tag.JoinedGenres; }); + if (value != null) + General.SetCUELine(_attributes, "REM", "GENRE", value, true); + } for (i = 0; i < TrackCount; i++) { TrackInfo track = _tracks[i]; - string artist = _hasTrackFilenames ? track._trackTags.Get("ARTIST") : - _hasEmbeddedCUESheet ? _albumTags.Get(String.Format("cue_track{0:00}_ARTIST", i + 1)) : null; - string title = _hasTrackFilenames ? track._trackTags.Get("TITLE") : - _hasEmbeddedCUESheet ? _albumTags.Get(String.Format("cue_track{0:00}_TITLE", i + 1)) : null; + string artist = _hasTrackFilenames ? track._fileInfo.Tag.JoinedPerformers : + _hasEmbeddedCUESheet ? Tagging.TagListToSingleValue(Tagging.GetMiscTag(_fileInfo, String.Format("cue_track{0:00}_ARTIST", i + 1))) : + null; + string title = _hasTrackFilenames ? track._fileInfo.Tag.Title : + _hasEmbeddedCUESheet ? Tagging.TagListToSingleValue(Tagging.GetMiscTag(_fileInfo, String.Format("cue_track{0:00}_TITLE", i + 1))) : + null; if ((_config.overwriteCUEData || track.Artist == "") && artist != null) track.Artist = artist; if ((_config.overwriteCUEData || track.Title == "") && title != null) @@ -1149,10 +1187,11 @@ namespace CUETools.Processor CUELine cddbDiscIdLine = General.FindCUELine(_attributes, "REM", "DISCID"); _cddbDiscIdTag = cddbDiscIdLine != null && cddbDiscIdLine.Params.Count == 3 ? cddbDiscIdLine.Params[2] : null; - if (_cddbDiscIdTag == null) _cddbDiscIdTag = GetCommonTag("DISCID"); + if (_cddbDiscIdTag == null) + _cddbDiscIdTag = GetCommonMiscTag("DISCID"); if (_accurateRipId == null) - _accurateRipId = GetCommonTag("ACCURATERIPID"); + _accurateRipId = GetCommonMiscTag("ACCURATERIPID"); if (_accurateRipId == null) { @@ -1291,7 +1330,7 @@ namespace CUETools.Processor } } - private Stream OpenArchive(string fileName, bool showProgress) + internal Stream OpenArchive(string fileName, bool showProgress) { #if !MONO if (Path.GetExtension(_archivePath).ToLower() == ".rar") @@ -1305,18 +1344,10 @@ namespace CUETools.Processor #endif if (Path.GetExtension(_archivePath).ToLower() == ".zip") { - ZipInputStream zipStream = new ZipInputStream(File.OpenRead(_archivePath)); - ZipEntry theEntry = null; - while ((theEntry = zipStream.GetNextEntry()) != null) - if (theEntry.Name == fileName) - break; - if (theEntry == null) - throw new Exception("Archive entry not found."); - if (theEntry.IsCrypted) - { - unrar_PasswordRequired(this, new PasswordRequiredEventArgs()); - zipStream.Password = _archivePassword; - } + SeekableZipStream zipStream = new SeekableZipStream(_archivePath, fileName); + zipStream.PasswordRequired += new PasswordRequiredHandler(unrar_PasswordRequired); + if (showProgress) + zipStream.ExtractionProgress += new ExtractionProgressHandler(unrar_ExtractionProgress); return zipStream; } throw new Exception("Unknown archive type."); @@ -1403,10 +1434,12 @@ namespace CUETools.Processor } #endif - public string GetCommonTag(string tagName) + public delegate string GetStringTagProvider(TagLib.File file); + + public string GetCommonTag(GetStringTagProvider provider) { if (_hasEmbeddedCUESheet || _hasSingleFilename) - return _albumTags.Get(tagName); + return General.EmptyStringToNull(provider(_fileInfo)); if (_hasTrackFilenames) { string tagValue = null; @@ -1414,7 +1447,7 @@ namespace CUETools.Processor for (int i = 0; i < TrackCount; i++) { TrackInfo track = _tracks[i]; - string newValue = track._trackTags.Get (tagName); + string newValue = General.EmptyStringToNull(provider(track._fileInfo)); if (tagValue == null) tagValue = newValue; else @@ -1425,6 +1458,11 @@ namespace CUETools.Processor return null; } + public string GetCommonMiscTag(string tagName) + { + return GetCommonTag(delegate(TagLib.File file) { return Tagging.TagListToSingleValue(Tagging.GetMiscTag(file, tagName)); }); + } + private static string LocateFile(string dir, string file, List contents) { List dirList, fileList; string altDir; @@ -1446,7 +1484,7 @@ namespace CUETools.Processor for (int iDir = 0; iDir < dirList.Count; iDir++) { for (int iFile = 0; iFile < fileList.Count; iFile++) { string path = Path.Combine(dirList[iDir], fileList[iFile]); - if ( (contents == null && File.Exists(path)) + if ((contents == null && System.IO.File.Exists(path)) || (contents != null && contents.Contains(path))) return path; path = dirList[iDir] + '/' + fileList[iFile]; @@ -1464,7 +1502,7 @@ namespace CUETools.Processor _outputFormat = format; _cuePath = outputPath; - string extension = General.FormatExtension(format); + string extension = General.FormatExtension(format, _config); List find, replace; string filename; int iTrack; @@ -1551,16 +1589,17 @@ namespace CUETools.Processor } } - private int GetSampleLength(string path, out NameValueCollection tags) + private int GetSampleLength(string path, out TagLib.File fileInfo) { - IAudioSource audioSource; - ShowProgress("Analyzing input file...", 0.0, 0.0, path, null); - if (_isArchive) - audioSource = AudioReadWrite.GetAudioSource(path, OpenArchive(path, true)); - else - audioSource = AudioReadWrite.GetAudioSource(path, null); + + TagLib.UserDefined.AdditionalFileTypes.Config = _config; + TagLib.File.IFileAbstraction file = _isArchive + ? (TagLib.File.IFileAbstraction) new ArchiveFileAbstraction(this, path) + : (TagLib.File.IFileAbstraction) new TagLib.File.LocalFileAbstraction(path); + fileInfo = TagLib.File.Create(file); + IAudioSource audioSource = AudioReadWrite.GetAudioSource(path, _isArchive ? OpenArchive(path, true) : null, _config); if ((audioSource.BitsPerSample != 16) || (audioSource.ChannelCount != 2) || (audioSource.SampleRate != 44100) || @@ -1569,8 +1608,6 @@ namespace CUETools.Processor audioSource.Close(); throw new Exception("Audio format is invalid."); } - - tags = audioSource.Tags; audioSource.Close(); return (int)audioSource.Length; } @@ -2021,13 +2058,12 @@ namespace CUETools.Processor { string logContents = LOGContents(); string cueContents = CUESheetContents(style); - bool needNewCRCs = _accurateRipMode != AccurateRipMode.None && - (_accurateRipMode == AccurateRipMode.VerifyAndConvert || _isCD) && - _config.writeArTagsOnConvert && - _arVerify.AccResult == HttpStatusCode.OK; uint tracksMatch = 0; int bestOffset = 0; - if (needNewCRCs) + + if (_accurateRipMode != AccurateRipMode.None && + _config.writeArTagsOnConvert && + _arVerify.AccResult == HttpStatusCode.OK) FindBestOffset(1, true, out tracksMatch, out bestOffset); if (logContents != null) @@ -2035,51 +2071,70 @@ namespace CUETools.Processor else if (_eacLog != null && _config.extractLog) WriteText(Path.ChangeExtension(_cuePath, ".log"), _eacLog); - if (style != CUEStyle.SingleFileWithCUE) + + if (style == CUEStyle.SingleFileWithCUE || style == CUEStyle.SingleFile) { - WriteText(_cuePath, cueContents); -#if !MONO - if (needNewCRCs && style != CUEStyle.SingleFile) + if (style == CUEStyle.SingleFileWithCUE && _config.createCUEFileWhenEmbedded) + WriteText(Path.ChangeExtension(_cuePath, ".cue"), cueContents); + if (style == CUEStyle.SingleFile) + WriteText(_cuePath, cueContents); + if (_outputFormat != OutputAudioFormat.NoAudio) { - for (int iTrack = 0; iTrack < TrackCount; iTrack++) + NameValueCollection tags = GenerateAlbumTags(bestOffset, style == CUEStyle.SingleFileWithCUE); + TagLib.UserDefined.AdditionalFileTypes.Config = _config; + TagLib.File fileInfo = TagLib.File.Create(new TagLib.File.LocalFileAbstraction(destPaths[0])); + if (Tagging.UpdateTags(fileInfo, tags, _config)) { - IAudioSource audioSource = AudioReadWrite.GetAudioSource(destPaths[iTrack + (htoaToFile ? 1 : 0)], null); - CleanupTags(audioSource.Tags, "ACCURATERIP"); - GenerateAccurateRipTags(audioSource.Tags, 0, bestOffset, iTrack); - audioSource.UpdateTags(false); - audioSource.Close(); - audioSource = null; + fileInfo.Tag.DiscCount = (_tracks[0]._fileInfo ?? _fileInfo).Tag.DiscCount; // TODO: GetCommonTag? + fileInfo.Tag.Disc = (_tracks[0]._fileInfo ?? _fileInfo).Tag.Disc; + //fileInfo.Tag.Title = null; + //fileInfo.Tag.Performers = (_tracks[iTrack]._fileInfo ?? _fileInfo).Tag.Performers; + //if (fileInfo.Tag.Performers.Length == 0) fileInfo.Tag.Performers = new string[] { _tracks[iTrack].Artist != "" ? _tracks[iTrack].Artist : Artist }; + fileInfo.Tag.AlbumArtists = (_tracks[0]._fileInfo ?? _fileInfo).Tag.AlbumArtists; + if (fileInfo.Tag.AlbumArtists.Length == 0) fileInfo.Tag.AlbumArtists = new string[] { Artist }; + fileInfo.Tag.Album = (_tracks[0]._fileInfo ?? _fileInfo).Tag.Album ?? Title; + uint year = (_tracks[0]._fileInfo ?? _fileInfo).Tag.Year; + fileInfo.Tag.Year = year != 0 ? year : ("" != Year && uint.TryParse(Year, out year)) ? year : 0; + fileInfo.Tag.Genres = (_tracks[0]._fileInfo ?? _fileInfo).Tag.Genres; + if (fileInfo.Tag.Genres.Length == 0) fileInfo.Tag.Genres = new string[] { Genre }; + fileInfo.Tag.Pictures = (_tracks[0]._fileInfo ?? _fileInfo).Tag.Pictures; + fileInfo.Save(); } } -#endif } else { - if (_config.createCUEFileWhenEmbedded) - WriteText(Path.ChangeExtension(_cuePath, ".cue"), cueContents); -#if !MONO - if (needNewCRCs || _isCD) - { - IAudioSource audioSource = AudioReadWrite.GetAudioSource(destPaths[0], null); - if (_isCD) + WriteText(_cuePath, cueContents); + if (_config.createM3U) + WriteText(Path.ChangeExtension(_cuePath, ".m3u"), M3UContents(style)); + if (_outputFormat != OutputAudioFormat.NoAudio) + for (int iTrack = 0; iTrack < TrackCount; iTrack++) { - if (_accurateRipMode != AccurateRipMode.VerifyThenConvert) - audioSource.Tags.Add("CUESHEET", cueContents); - audioSource.Tags.Add("LOG", logContents); + string path = destPaths[iTrack + (htoaToFile ? 1 : 0)]; + NameValueCollection tags = GenerateTrackTags(iTrack, bestOffset); + TagLib.UserDefined.AdditionalFileTypes.Config = _config; + TagLib.File fileInfo = TagLib.File.Create(new TagLib.File.LocalFileAbstraction(path)); + if (Tagging.UpdateTags(fileInfo, tags, _config)) + { + fileInfo.Tag.TrackCount = (uint) TrackCount; + fileInfo.Tag.Track = (uint) iTrack + 1; + fileInfo.Tag.DiscCount = (_tracks[iTrack]._fileInfo ?? _fileInfo).Tag.DiscCount; + fileInfo.Tag.Disc = (_tracks[iTrack]._fileInfo ?? _fileInfo).Tag.Disc; + fileInfo.Tag.Title = _tracks[iTrack]._fileInfo != null ? _tracks[iTrack]._fileInfo.Tag.Title : _tracks[iTrack].Title; + fileInfo.Tag.Performers = (_tracks[iTrack]._fileInfo ?? _fileInfo).Tag.Performers; + if (fileInfo.Tag.Performers.Length == 0) fileInfo.Tag.Performers = new string[] { _tracks[iTrack].Artist != "" ? _tracks[iTrack].Artist : Artist }; + fileInfo.Tag.AlbumArtists = (_tracks[iTrack]._fileInfo ?? _fileInfo).Tag.AlbumArtists; + if (fileInfo.Tag.AlbumArtists.Length == 0) fileInfo.Tag.AlbumArtists = new string[] { Artist }; + fileInfo.Tag.Album = (_tracks[iTrack]._fileInfo ?? _fileInfo).Tag.Album ?? Title; + uint year = (_tracks[iTrack]._fileInfo ?? _fileInfo).Tag.Year; + fileInfo.Tag.Year = year != 0 ? year : ("" != Year && uint.TryParse(Year, out year)) ? year : 0; + fileInfo.Tag.Genres = (_tracks[iTrack]._fileInfo ?? _fileInfo).Tag.Genres; + if (fileInfo.Tag.Genres.Length == 0) fileInfo.Tag.Genres = new string[] { Genre }; + fileInfo.Tag.Pictures = (_tracks[iTrack]._fileInfo ?? _fileInfo).Tag.Pictures; + fileInfo.Save(); + } } - if (needNewCRCs) - { - CleanupTags(audioSource.Tags, "ACCURATERIP"); - GenerateAccurateRipTags(audioSource.Tags, 0, bestOffset, -1); - } - audioSource.UpdateTags(false); - audioSource.Close(); - audioSource = null; - } -#endif } - if (style != CUEStyle.SingleFileWithCUE && style != CUEStyle.SingleFile && _config.createM3U) - WriteText(Path.ChangeExtension(_cuePath, ".m3u"), M3UContents(style)); } } @@ -2095,34 +2150,25 @@ namespace CUETools.Processor if (_hasEmbeddedCUESheet) { - IAudioSource audioSource = AudioReadWrite.GetAudioSource(_sourcePaths[0], null); - NameValueCollection tags = audioSource.Tags; - CleanupTags(tags, "ACCURATERIP"); - GenerateAccurateRipTags (tags, 0, bestOffset, -1); -#if !MONO - if (audioSource is FLACReader) - audioSource.UpdateTags (true); -#endif - audioSource.Close(); - audioSource = null; + if (_fileInfo is TagLib.Flac.File) + { + NameValueCollection tags = Tagging.Analyze(_fileInfo); + CleanupTags(tags, "ACCURATERIP"); + GenerateAccurateRipTags(tags, 0, bestOffset, -1); + if (Tagging.UpdateTags(_fileInfo, tags, _config)) + _fileInfo.Save(); + } } else if (_hasTrackFilenames) { for (int iTrack = 0; iTrack < TrackCount; iTrack++) - { - string src = _sourcePaths[iTrack + (_hasHTOAFilename ? 1 : 0)]; - IAudioSource audioSource = AudioReadWrite.GetAudioSource(src, null); -#if !MONO - if (audioSource is FLACReader) + if (_tracks[iTrack]._fileInfo is TagLib.Flac.File) { - NameValueCollection tags = audioSource.Tags; + NameValueCollection tags = Tagging.Analyze(_tracks[iTrack]._fileInfo); CleanupTags(tags, "ACCURATERIP"); - GenerateAccurateRipTags (tags, 0, bestOffset, iTrack); - audioSource.UpdateTags(true); + GenerateAccurateRipTags(tags, 0, bestOffset, iTrack); + if (Tagging.UpdateTags(_tracks[iTrack]._fileInfo, tags, _config)) + _tracks[iTrack]._fileInfo.Save(); } -#endif - audioSource.Close(); - audioSource = null; - } } } @@ -2145,76 +2191,74 @@ namespace CUETools.Processor } } - private void SetTrackTags(IAudioDest audioDest, int iTrack, int bestOffset) + private NameValueCollection GenerateTrackTags(int iTrack, int bestOffset) { NameValueCollection destTags = new NameValueCollection(); - + if (_hasEmbeddedCUESheet) { - string trackPrefix = String.Format ("cue_track{0:00}_", iTrack + 1); - string[] keys = _albumTags.AllKeys; - for (int i = 0; i < keys.Length; i++) + string trackPrefix = String.Format("cue_track{0:00}_", iTrack + 1); + NameValueCollection albumTags = Tagging.Analyze(_fileInfo); + foreach (string key in albumTags.AllKeys) { - if (keys[i].ToLower().StartsWith(trackPrefix) - || !keys[i].ToLower().StartsWith("cue_track")) + if (key.ToLower().StartsWith(trackPrefix) + || !key.ToLower().StartsWith("cue_track")) { - string name = keys[i].ToLower().StartsWith(trackPrefix) ? - keys[i].Substring(trackPrefix.Length) : keys[i]; - string[] values = _albumTags.GetValues(keys[i]); + string name = key.ToLower().StartsWith(trackPrefix) ? + key.Substring(trackPrefix.Length) : key; + string[] values = albumTags.GetValues(key); for (int j = 0; j < values.Length; j++) destTags.Add(name, values[j]); } } } else if (_hasTrackFilenames) - destTags.Add(_tracks[iTrack]._trackTags); + destTags.Add(Tagging.Analyze(_tracks[iTrack]._fileInfo)); else if (_hasSingleFilename) { // TODO? } - destTags.Remove("CUESHEET"); + // these will be set explicitely + destTags.Remove("ARTIST"); + destTags.Remove("TITLE"); + destTags.Remove("ALBUM"); + destTags.Remove("ALBUMARTIST"); + destTags.Remove("DATE"); + destTags.Remove("GENRE"); destTags.Remove("TRACKNUMBER"); + destTags.Remove("TRACKTOTAL"); destTags.Remove("TOTALTRACKS"); + destTags.Remove("DISCNUMBER"); + destTags.Remove("DISCTOTAL"); + destTags.Remove("TOTALDISCS"); + destTags.Remove("LOG"); destTags.Remove("LOGFILE"); destTags.Remove("EACLOG"); + + // these are not valid + destTags.Remove("CUESHEET"); CleanupTags(destTags, "ACCURATERIP"); CleanupTags(destTags, "REPLAYGAIN"); - if (destTags.Get("TITLE") == null && "" != _tracks[iTrack].Title) - destTags.Add("TITLE", _tracks[iTrack].Title); - if (destTags.Get("ARTIST") == null && "" != _tracks[iTrack].Artist) - destTags.Add("ARTIST", _tracks[iTrack].Artist); - if (destTags.Get("ARTIST") == null && "" != Artist) - destTags.Add("ARTIST", Artist); - if (destTags.Get("ALBUM ARTIST") == null && "" != Artist) - destTags.Add("ALBUM ARTIST", Artist); - if (destTags.Get("ALBUM") == null && "" != Title) - destTags.Add("ALBUM", Title); - if (destTags.Get("DATE") == null && "" != Year) - destTags.Add("DATE", Year); - if (destTags.Get("GENRE") == null && "" != Genre) - destTags.Add("GENRE", Genre); - destTags.Add("TRACKNUMBER", (iTrack + 1).ToString("00")); - destTags.Add("TOTALTRACKS", TrackCount.ToString("00")); if (_config.writeArTagsOnConvert) { - if (!_isCD && _accurateRipMode == AccurateRipMode.VerifyThenConvert && _arVerify.AccResult == HttpStatusCode.OK) + if (_accurateRipMode != AccurateRipMode.None && _arVerify.AccResult == HttpStatusCode.OK) GenerateAccurateRipTags(destTags, _writeOffset, bestOffset, iTrack); else destTags.Add("ACCURATERIPID", _accurateRipId); } - audioDest.SetTags(destTags); + return destTags; } - private void SetAlbumTags(IAudioDest audioDest, int bestOffset, bool fWithCUE) + private NameValueCollection GenerateAlbumTags(int bestOffset, bool fWithCUE) { NameValueCollection destTags = new NameValueCollection(); if (_hasEmbeddedCUESheet || _hasSingleFilename) { - destTags.Add(_albumTags); + destTags.Add(Tagging.Analyze(_fileInfo)); if (!fWithCUE) CleanupTags(destTags, "CUE_TRACK"); } @@ -2222,32 +2266,45 @@ namespace CUETools.Processor { for (int iTrack = 0; iTrack < TrackCount; iTrack++) { - string[] keys = _tracks[iTrack]._trackTags.AllKeys; - for (int i = 0; i < keys.Length; i++) + NameValueCollection trackTags = Tagging.Analyze(_tracks[iTrack]._fileInfo); + foreach (string key in trackTags.AllKeys) { - string singleValue = GetCommonTag (keys[i]); + string singleValue = GetCommonMiscTag(key); if (singleValue != null) { - if (destTags.Get(keys[i]) == null) - destTags.Add(keys[i], singleValue); + if (destTags.Get(key) == null) + destTags.Add(key, singleValue); } - else if (fWithCUE && keys[i].ToUpper() != "TRACKNUMBER") + else if (fWithCUE && key.ToUpper() != "TRACKNUMBER") { - string[] values = _tracks[iTrack]._trackTags.GetValues(keys[i]); + string[] values = trackTags.GetValues(key); for (int j = 0; j < values.Length; j++) - destTags.Add(String.Format("cue_track{0:00}_{1}", iTrack + 1, keys[i]), values[j]); + destTags.Add(String.Format("cue_track{0:00}_{1}", iTrack + 1, key), values[j]); } } } } - destTags.Remove("CUESHEET"); + // these will be set explicitely + destTags.Remove("ARTIST"); destTags.Remove("TITLE"); + destTags.Remove("ALBUM"); + destTags.Remove("ALBUMARTIST"); + destTags.Remove("DATE"); + destTags.Remove("GENRE"); destTags.Remove("TRACKNUMBER"); + destTags.Remove("TRACKTOTAL"); + destTags.Remove("TOTALTRACKS"); + destTags.Remove("DISCNUMBER"); + destTags.Remove("DISCTOTAL"); + destTags.Remove("TOTALDISCS"); + + // these are not valid CleanupTags(destTags, "ACCURATERIP"); CleanupTags(destTags, "REPLAYGAIN"); - if (fWithCUE && (!_isCD || _accurateRipMode == AccurateRipMode.VerifyThenConvert)) + destTags.Remove("CUESHEET"); + if (fWithCUE) destTags.Add("CUESHEET", CUESheetContents(CUEStyle.SingleFileWithCUE)); if (_config.embedLog) @@ -2255,18 +2312,21 @@ namespace CUETools.Processor destTags.Remove("LOG"); destTags.Remove("LOGFILE"); destTags.Remove("EACLOG"); - if (_eacLog != null) + string logContents = LOGContents(); + if (logContents != null) + destTags.Add("LOG", logContents); + else if (_eacLog != null) destTags.Add("LOG", _eacLog); } if (_config.writeArTagsOnConvert) { - if (fWithCUE && !_isCD && _accurateRipMode == AccurateRipMode.VerifyThenConvert && _arVerify.AccResult == HttpStatusCode.OK) + if (fWithCUE && _accurateRipMode != AccurateRipMode.None && _arVerify.AccResult == HttpStatusCode.OK) GenerateAccurateRipTags(destTags, _writeOffset, bestOffset, -1); else destTags.Add("ACCURATERIPID", _accurateRipId); } - audioDest.SetTags(destTags); + return destTags; } public void WriteAudioFilesPass(string dir, CUEStyle style, string[] destPaths, int[] destLengths, bool htoaToFile, bool noOutput) @@ -2324,11 +2384,6 @@ namespace CUETools.Processor _appliedWriteOffset = true; } - uint tracksMatch; - int bestOffset = _writeOffset; - if (!noOutput && _accurateRipMode == AccurateRipMode.VerifyThenConvert && _config.writeArTagsOnConvert && _arVerify.AccResult == HttpStatusCode.OK) - FindBestOffset(1, true, out tracksMatch, out bestOffset); - if (_config.detectHDCD) { // currently broken verifyThenConvert on HDCD detection!!!! need to check for HDCD results higher @@ -2336,13 +2391,10 @@ namespace CUETools.Processor catch { } } - if (style == CUEStyle.SingleFile || style == CUEStyle.SingleFileWithCUE) { iDest++; audioDest = GetAudioDest(destPaths[iDest], destLengths[iDest], hdcdDecoder != null && hdcdDecoder.Decoding ? hdcdDecoder.BitsPerSample : 16, noOutput); - if (!noOutput) - SetAlbumTags(audioDest, bestOffset, style == CUEStyle.SingleFileWithCUE); } uint currentOffset = 0, previousOffset = 0; @@ -2371,8 +2423,6 @@ namespace CUETools.Processor if (audioDest != null) audioDest.Close(); audioDest = GetAudioDest(destPaths[iDest], destLengths[iDest], hdcdDecoder != null && hdcdDecoder.Decoding ? hdcdDecoder.BitsPerSample : 16, noOutput); - if (!noOutput) - SetTrackTags(audioDest, iTrack, bestOffset); } for (iIndex = 0; iIndex <= _toc[_toc.FirstAudio + iTrack].LastIndex; iIndex++) @@ -2394,8 +2444,6 @@ namespace CUETools.Processor audioDest.Close(); iDest++; audioDest = GetAudioDest(destPaths[iDest], destLengths[iDest], hdcdDecoder != null && hdcdDecoder.Decoding ? hdcdDecoder.BitsPerSample : 16, noOutput); - if (!noOutput) - SetTrackTags(audioDest, iTrack, bestOffset); } if ((style == CUEStyle.GapsAppended) && (iIndex == 0) && (iTrack == 0)) @@ -2740,9 +2788,9 @@ namespace CUETools.Processor } else #endif if (_isArchive) - audioSource = AudioReadWrite.GetAudioSource(sourceInfo.Path, OpenArchive(sourceInfo.Path, false)); + audioSource = AudioReadWrite.GetAudioSource(sourceInfo.Path, OpenArchive(sourceInfo.Path, false), _config); else - audioSource = AudioReadWrite.GetAudioSource(sourceInfo.Path, null); + audioSource = AudioReadWrite.GetAudioSource(sourceInfo.Path, null, _config); } if (sourceInfo.Offset != 0) @@ -2957,6 +3005,155 @@ namespace CUETools.Processor } } + public class SeekableZipStream : Stream + { + ZipFile zipFile; + ZipEntry zipEntry; + Stream zipStream; + long position; + byte[] temp; + + public SeekableZipStream(string path, string fileName) + { + zipFile = new ZipFile(path); + zipEntry = zipFile.GetEntry(fileName); + if (zipEntry == null) + throw new Exception("Archive entry not found."); + zipStream = zipFile.GetInputStream(zipEntry); + temp = new byte[65536]; + position = 0; + } + public override bool CanRead + { + get { return true; } + } + public override bool CanSeek + { + get { return true; } + } + public override bool CanWrite + { + get { return false; } + } + public override long Length + { + get + { + return zipEntry.Size; + } + } + public override long Position + { + get { return position; } + set { Seek(value, SeekOrigin.Begin); } + } + public override void Close() + { + zipStream.Close(); + zipEntry = null; + zipFile.Close(); + } + public override void Flush() + { + throw new NotSupportedException(); + } + public override void SetLength(long value) + { + throw new NotSupportedException(); + } + public override int Read(byte[] buffer, int offset, int count) + { + if (position == 0 && zipEntry.IsCrypted && ((ZipInputStream)zipStream).Password == null && PasswordRequired != null) + { + PasswordRequiredEventArgs e = new PasswordRequiredEventArgs(); + PasswordRequired(this, e); + if (e.ContinueOperation && e.Password.Length > 0) + ((ZipInputStream)zipStream).Password = e.Password; + } + // TODO: always save to a local temp circular buffer for optimization of the backwards seek. + int total = zipStream.Read(buffer, offset, count); + position += total; + if (ExtractionProgress != null) + { + ExtractionProgressEventArgs e = new ExtractionProgressEventArgs(); + e.BytesExtracted = position; + e.FileName = zipEntry.Name; + e.FileSize = zipEntry.Size; + e.PercentComplete = 100.0 * position / zipEntry.Size; + ExtractionProgress(this, e); + } + return total; + } + public override long Seek(long offset, SeekOrigin origin) + { + long seek_to; + switch (origin) + { + case SeekOrigin.Begin: + seek_to = offset; + break; + case SeekOrigin.Current: + seek_to = Position + offset; + break; + case SeekOrigin.End: + seek_to = Length + offset; + break; + default: + throw new NotSupportedException(); + } + if (seek_to < 0 || seek_to > Length) + throw new IOException("Invalid seek"); + if (seek_to < position) + { + zipStream.Close(); + zipStream = zipFile.GetInputStream(zipEntry); + position = 0; + } + while (seek_to > position) + if (Read(temp, 0, (int) Math.Min(seek_to - position, (long) temp.Length)) <= 0) + throw new IOException("Invalid seek"); + return position; + } + public override void Write(byte[] array, int offset, int count) + { + throw new NotSupportedException(); + } + public event PasswordRequiredHandler PasswordRequired; + public event ExtractionProgressHandler ExtractionProgress; + } + + public class ArchiveFileAbstraction : TagLib.File.IFileAbstraction + { + private string name; + private CUESheet _cueSheet; + + public ArchiveFileAbstraction(CUESheet cueSheet, string file) + { + name = file; + _cueSheet = cueSheet; + } + + public string Name + { + get { return name; } + } + + public System.IO.Stream ReadStream + { + get { return _cueSheet.OpenArchive(Name, true); } + } + + public System.IO.Stream WriteStream + { + get { return null; } + } + + public void CloseStream(System.IO.Stream stream) + { + stream.Close(); + } + } + public class CUELine { private List _params; private List _quoted; @@ -3034,11 +3231,11 @@ namespace CUETools.Processor public class TrackInfo { private List _attributes; - public NameValueCollection _trackTags; + public TagLib.File _fileInfo; public TrackInfo() { _attributes = new List(); - _trackTags = new NameValueCollection(); + _fileInfo = null; } public List Attributes { diff --git a/CUETools.Processor/Tagging.cs b/CUETools.Processor/Tagging.cs new file mode 100644 index 0000000..cba2c90 --- /dev/null +++ b/CUETools.Processor/Tagging.cs @@ -0,0 +1,178 @@ +using System; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.Text; + +namespace CUETools.Processor +{ + public class Tagging + { + public static bool UpdateTags(TagLib.File fileInfo, NameValueCollection tags, CUEConfig config) + { + if (fileInfo is TagLib.Flac.File) + { + TagLib.Ogg.XiphComment xiph = (TagLib.Ogg.XiphComment)fileInfo.GetTag(TagLib.TagTypes.Xiph); + foreach (string tag in tags.AllKeys) + xiph.SetField(tag, tags.GetValues(tag)); + return true; + } + if (fileInfo is TagLib.Riff.File) + return false; + if (fileInfo is TagLib.UserDefined.File && !(fileInfo as TagLib.UserDefined.File).SupportsAPEv2) + return false; + TagLib.Ape.Tag ape = (TagLib.Ape.Tag)fileInfo.GetTag(TagLib.TagTypes.Ape, true); + foreach (string tag in tags.AllKeys) + ape.SetValue(XiphTagNameToApe(tag), tags.GetValues(tag)); + return true; + } + + public static void UpdateTags(string path, NameValueCollection tags, CUEConfig config) + { + TagLib.UserDefined.AdditionalFileTypes.Config = config; + TagLib.File fileInfo = TagLib.File.Create(new TagLib.File.LocalFileAbstraction(path)); + if (UpdateTags(fileInfo, tags, config)) + fileInfo.Save(); + //IAudioSource audioSource = AudioReadWrite.GetAudioSource(path, null, config); + //audioSource.Tags = tags; + //audioSource.UpdateTags(false); + //audioSource.Close(); + //audioSource = null; + } + + public static string[] GetMiscTag(TagLib.File file, string name) + { + //TagLib.Mpeg4.AppleTag apple = (TagLib.Mpeg4.AppleTag)file.GetTag(TagLib.TagTypes.Apple); + //TagLib.Id3v2.Tag id3v2 = (TagLib.Id3v2.Tag)file.GetTag(TagLib.TagTypes.Id3v2); + TagLib.Ogg.XiphComment xiph = (TagLib.Ogg.XiphComment)file.GetTag(TagLib.TagTypes.Xiph); + TagLib.Ape.Tag ape = (TagLib.Ape.Tag)file.GetTag(TagLib.TagTypes.Ape); + + //if (apple != null) + //{ + // string[] text = apple.GetText(name); + // if (text.Length != 0) + // return text; + //} + + //if (id3v2 != null) + // foreach (TagLib.Id3v2.Frame f in id3v2.GetFrames()) + // if (f is TagLib.Id3v2.TextInformationFrame && ((TagLib.Id3v2.TextInformationFrame)f).Text != null) + // return ((TagLib.Id3v2.TextInformationFrame)f).Text; + + if (xiph != null) + { + string[] l = xiph.GetField(name); + if (l != null && l.Length != 0) + return l; + } + + if (ape != null) + { + TagLib.Ape.Item item = ape.GetItem(name); + if (item != null) + return item.ToStringArray(); + } + + return null; + } + + public static string TagListToSingleValue(string[] list) + { + return list == null ? null : + list.Length == 0 ? null : + list.Length == 1 ? list[0] : + null; // TODO: merge them? + } + + public static string ApeTagNameToXiph(string tag) + { + if (tag.ToUpper() == "YEAR") + return "DATE"; + if (tag.ToUpper() == "TRACK") + return "TRACKNUMBER"; + if (tag.ToUpper() == "DISC") + return "DISCNUMBER"; + return tag; + } + + public static string XiphTagNameToApe(string tag) + { + if (tag.ToUpper() == "DATE") + return "Year"; + if (tag.ToUpper() == "TRACKNUMBER") + return "Track"; + if (tag.ToUpper() == "DISCNUMBER") + return "Disc"; + return tag; + } + + public static NameValueCollection Analyze(string path) + { + return Analyze(new TagLib.File.LocalFileAbstraction(path)); + } + + public static NameValueCollection Analyze(TagLib.File.IFileAbstraction file) + { + return Analyze(TagLib.File.Create(file)); + } + + public static NameValueCollection Analyze(TagLib.File fileInfo) + { + NameValueCollection tags = new NameValueCollection(); + + TagLib.Ogg.XiphComment xiph = (TagLib.Ogg.XiphComment)fileInfo.GetTag(TagLib.TagTypes.Xiph); + TagLib.Ape.Tag ape = (TagLib.Ape.Tag)fileInfo.GetTag(TagLib.TagTypes.Ape); + + if (xiph != null) + { + foreach (string tag in xiph) + foreach (string value in xiph.GetField(tag)) + tags.Add(tag, value); + } + else if (ape != null) + { + foreach (string tag in ape) + foreach (string value in ape.GetItem(tag).ToStringArray()) + tags.Add(ApeTagNameToXiph(tag), value); + } + else + { + //if (audioSource is CUETools.Codecs.ALAC.ALACReader) + //tags = (audioSource as CUETools.Codecs.ALAC.ALACReader).Tags; + } + + // TODO: enumerate dash atoms somehow? + //TagLib.Mpeg4.AppleTag apple = (TagLib.Mpeg4.AppleTag)fileInfo.GetTag(TagLib.TagTypes.Apple); + //if (apple != null) + //{ + // tags = new NameValueCollection(); + // foreach (TagLib.Mpeg4.Box tag in apple) + // if (tag.BoxType == "----") + // foreach (string value in apple.GetDashBox(tag.) + // tags.Add(tag, value); + //} + return tags; + } + + //public void SetTextField(TagLib.File file, + // TagLib.ByteVector apple_name, TagLib.ByteVector id3v2_name, + // string xiph_name, string ape_name, string[] values) + //{ + // TagLib.Mpeg4.AppleTag apple = (TagLib.Mpeg4.AppleTag)file.GetTag(TagLib.TagTypes.Apple, true); + // TagLib.Id3v2.Tag id3v2 = (TagLib.Id3v2.Tag)file.GetTag(TagLib.TagTypes.Id3v2, true); + // TagLib.Ogg.XiphComment xiph = (TagLib.Ogg.XiphComment)file.GetTag(TagLib.TagTypes.Xiph, true); + // TagLib.Ape.Tag ape = (TagLib.Ape.Tag)file.GetTag(TagLib.TagTypes.Ape, (file is TagLib.Mpc.File)); + + // if (apple != null) + // apple.SetText(apple_name, values); + + // if (id3v2 != null) + // id3v2.SetTextFrame(id3v2_name, new TagLib.StringList(values)); + + // if (xiph != null) + // xiph.AddFields(xiph_name, values); + + // if (ape != null) + // ape.AddValues(ape_name, values, true); + //} + } +} diff --git a/CUETools.Processor/UserDefined.cs b/CUETools.Processor/UserDefined.cs new file mode 100644 index 0000000..bcb79fe --- /dev/null +++ b/CUETools.Processor/UserDefined.cs @@ -0,0 +1,319 @@ +// +// File.cs: Provides tagging and properties support for WavPack files. +// +// Author: +// Brian Nickel (brian.nickel@gmail.com) +// +// Original Source: +// wvfile.cpp from libtunepimp +// +// Copyright (C) 2006-2007 Brian Nickel +// Copyright (C) 2006 by Lukáš Lalinský (Original Implementation) +// Copyright (C) 2004 by Allan Sandfeld Jensen (Original Implementation) +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License version +// 2.1 as published by the Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA +// + +using System; +using TagLib; + +namespace TagLib.UserDefined { + /// + /// This class extends to + /// provide tagging and properties support for user defined format files. + /// + /// + /// A will be added automatically to + /// any file that doesn't contain one. This change does not effect + /// the file and can be reversed using the following method: + /// file.RemoveTags (file.TagTypes & ~file.TagTypesOnDisk); + /// + [SupportedMimeType("taglib/misc", "misc")] + public class File : TagLib.NonContainer.File + { + #region Private Fields + + private bool _supportsAPEv2 = true; + + #endregion + + + + #region Constructors + + /// + /// Constructs and initializes a new instance of for a specified path in the local file + /// system and specified read style. + /// + /// + /// A object containing the path of the + /// file to use in the new instance. + /// + /// + /// A value specifying at what level + /// of accuracy to read the media properties, or to ignore the properties. + /// + /// + /// is . + /// + public File (string path, ReadStyle propertiesStyle, bool supportsAPEv2) + : base (path, propertiesStyle) + { + _supportsAPEv2 = supportsAPEv2; + } + + /// + /// Constructs and initializes a new instance of for a specified path in the local file + /// system with an average read style. + /// + /// + /// A object containing the path of the + /// file to use in the new instance. + /// + /// + /// is . + /// + public File (string path, bool supportsAPEv2) : base (path) + { + _supportsAPEv2 = supportsAPEv2; + } + + /// + /// Constructs and initializes a new instance of for a specified file abstraction and + /// specified read style. + /// + /// + /// A object to use when + /// reading from and writing to the file. + /// + /// + /// A value specifying at what level + /// of accuracy to read the media properties, or to ignore the properties. + /// + /// + /// is . + /// + public File (File.IFileAbstraction abstraction, + ReadStyle propertiesStyle, bool supportsAPEv2) + : base (abstraction, propertiesStyle) + { + _supportsAPEv2 = supportsAPEv2; + } + + /// + /// Constructs and initializes a new instance of for a specified file abstraction with an + /// average read style. + /// + /// + /// A object to use when + /// reading from and writing to the file. + /// + /// + /// is . + /// + public File (File.IFileAbstraction abstraction, bool supportsAPEv2) + : base (abstraction) + { + _supportsAPEv2 = supportsAPEv2; + } + + #endregion + + + + #region Public Methods + + public bool SupportsAPEv2 + { + get + { + return _supportsAPEv2; + } + } + + + /// + /// Gets a tag of a specified type from the current instance, + /// optionally creating a new tag if possible. + /// + /// + /// A value indicating the + /// type of tag to read. + /// + /// + /// A value specifying whether or not to + /// try and create the tag if one is not found. + /// + /// + /// A object containing the tag that was + /// found in or added to the current instance. If no + /// matching tag was found and none was created, is returned. + /// + /// + /// If a is added to the + /// current instance, it will be placed at the start of the + /// file. On the other hand, + /// will be added to the end of + /// the file. All other tag types will be ignored. + /// + public override TagLib.Tag GetTag (TagTypes type, bool create) + { + Tag t = (Tag as TagLib.NonContainer.Tag).GetTag (type); + + if (t != null || !create) + return t; + + switch (type) + { + case TagTypes.Id3v1: + return EndTag.AddTag (type, Tag); + + case TagTypes.Id3v2: + return StartTag.AddTag (type, Tag); + + case TagTypes.Ape: + return EndTag.AddTag (type, Tag); + + default: + return null; + } + } + + #endregion + + + + #region Protected Methods + + /// + /// Reads format specific information at the start of the + /// file. + /// + /// + /// A value containing the seek position + /// at which the tags end and the media data begins. + /// + /// + /// A value specifying at what level + /// of accuracy to read the media properties, or to ignore the properties. + /// + protected override void ReadStart (long start, + ReadStyle propertiesStyle) + { + } + + /// + /// Reads format specific information at the end of the + /// file. + /// + /// + /// A value containing the seek position + /// at which the media data ends and the tags begin. + /// + /// + /// A value specifying at what level + /// of accuracy to read the media properties, or to ignore the properties. + /// + protected override void ReadEnd (long end, + ReadStyle propertiesStyle) + { + // Make sure we have an APE tag. + if (_supportsAPEv2) + GetTag (TagTypes.Ape, true); + } + + /// + /// Reads the audio properties from the file represented by + /// the current instance. + /// + /// + /// A value containing the seek position + /// at which the tags end and the media data begins. + /// + /// + /// A value containing the seek position + /// at which the media data ends and the tags begin. + /// + /// + /// A value specifying at what level + /// of accuracy to read the media properties, or to ignore the properties. + /// + /// + /// A object describing the + /// media properties of the file represented by the current + /// instance. + /// + protected override Properties ReadProperties (long start, + long end, + ReadStyle propertiesStyle) + { + return new Properties (); + } + + #endregion + } + + public static class AdditionalFileTypes + { + private static bool inited = false; + private static CUETools.Processor.CUEConfig _config; + + public static CUETools.Processor.CUEConfig Config + { + set + { + Init(); + _config = value; + } + } + + private static TagLib.File UserDefinedResolver(TagLib.File.IFileAbstraction abstraction, string mimetype, TagLib.ReadStyle style) + { + if (mimetype == "taglib/flac" || mimetype == "taglib/wv" || mimetype == "taglib/ape" || mimetype == "taglib/wav") + return null; + if (mimetype == "taglib/tta") + return new File(abstraction, style, true); + if (mimetype == "taglib/" + _config.udc1Extension) + return new File(abstraction, style, _config.udc1APEv2); + return null; + } + + static AdditionalFileTypes () + { + Init(); + } + + internal static void Init() + { + if (inited) + return; + TagLib.File.AddFileTypeResolver(new TagLib.File.FileTypeResolver(UserDefinedResolver)); + //FileTypes.Register(typeof(TagLib.NonContainer.File)); + inited = true; + } + } +} diff --git a/CUETools.Ripper.SCSI/SCSIDrive.cs b/CUETools.Ripper.SCSI/SCSIDrive.cs index 12aab53..bfe0d54 100644 --- a/CUETools.Ripper.SCSI/SCSIDrive.cs +++ b/CUETools.Ripper.SCSI/SCSIDrive.cs @@ -23,7 +23,6 @@ using System; using System.Runtime.InteropServices; using System.Collections; using System.Collections.Generic; -using System.Collections.Specialized; using System.Text; using System.IO; using Bwg.Scsi; @@ -1069,22 +1068,6 @@ namespace CUETools.Ripper.SCSI } } - public NameValueCollection Tags - { - get - { - return null; - } - set - { - } - } - - public bool UpdateTags(bool preserveTime) - { - return false; - } - public string Path { get diff --git a/CUETools/CUETools.sln b/CUETools/CUETools.sln index e01d77f..d676ddb 100644 --- a/CUETools/CUETools.sln +++ b/CUETools/CUETools.sln @@ -10,7 +10,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CUETools.Codecs.FLAC", "..\ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CUETools.Codecs.APE", "..\CUETools.Codecs.APE\CUETools.Codecs.APE.vcproj", "{9AE965C4-301E-4C01-B90F-297AF341ACC6}" ProjectSection(ProjectDependencies) = postProject - {CA200BCB-DFC6-4153-9BD4-785BC768B26B} = {CA200BCB-DFC6-4153-9BD4-785BC768B26B} {0B9C97D4-61B8-4294-A1DF-BA90752A1779} = {0B9C97D4-61B8-4294-A1DF-BA90752A1779} EndProjectSection EndProject @@ -19,7 +18,6 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CUETools.Codecs.WavPack", "..\CUETools.Codecs.WavPack\CUETools.Codecs.WavPack.vcproj", "{CC2E74B6-534A-43D8-9F16-AC03FE955000}" ProjectSection(ProjectDependencies) = postProject {5CCCB9CF-0384-458F-BA08-72B73866840F} = {5CCCB9CF-0384-458F-BA08-72B73866840F} - {CA200BCB-DFC6-4153-9BD4-785BC768B26B} = {CA200BCB-DFC6-4153-9BD4-785BC768B26B} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MACLib", "..\MAC_SDK\Source\MACLib\MACLib.vcproj", "{0B9C97D4-61B8-4294-A1DF-BA90752A1779}" @@ -28,8 +26,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CodecWrappers", "CodecWrapp EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libFLAC_static", "..\flac\src\libFLAC\libFLAC_static.vcproj", "{4CEFBC84-C215-11DB-8314-0800200C9A66}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "APETagDotNet", "..\APETagDotNet\APETagDotNet.csproj", "{CA200BCB-DFC6-4153-9BD4-785BC768B26B}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libwavpack", "..\wavpack-4.5.0\src\libwavpack.vcproj", "{5CCCB9CF-0384-458F-BA08-72B73866840F}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArCueDotNet", "..\ArCueDotNet\ArCueDotNet.csproj", "{A5A8D8FA-9E32-4010-8AAF-AE580C5AF728}" @@ -87,6 +83,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CUETools.Codecs.TTA", "..\C EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CUETools.Converter", "..\CUETools.Converter\CUETools.Converter.csproj", "{115CC5B0-0385-41CD-8A23-6A7EA4C51926}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "taglib-sharp", "..\..\taglib-sharp\taglib-sharp.csproj", "{4CC18776-125E-4318-9D24-D60110AD9697}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -159,18 +157,6 @@ Global {4CEFBC84-C215-11DB-8314-0800200C9A66}.Release|x64.Build.0 = Release|x64 {4CEFBC84-C215-11DB-8314-0800200C9A66}.Release|x86.ActiveCfg = Release|Win32 {4CEFBC84-C215-11DB-8314-0800200C9A66}.Release|x86.Build.0 = Release|Win32 - {CA200BCB-DFC6-4153-9BD4-785BC768B26B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CA200BCB-DFC6-4153-9BD4-785BC768B26B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CA200BCB-DFC6-4153-9BD4-785BC768B26B}.Debug|x64.ActiveCfg = Debug|x64 - {CA200BCB-DFC6-4153-9BD4-785BC768B26B}.Debug|x64.Build.0 = Debug|x64 - {CA200BCB-DFC6-4153-9BD4-785BC768B26B}.Debug|x86.ActiveCfg = Debug|x86 - {CA200BCB-DFC6-4153-9BD4-785BC768B26B}.Debug|x86.Build.0 = Debug|x86 - {CA200BCB-DFC6-4153-9BD4-785BC768B26B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CA200BCB-DFC6-4153-9BD4-785BC768B26B}.Release|Any CPU.Build.0 = Release|Any CPU - {CA200BCB-DFC6-4153-9BD4-785BC768B26B}.Release|x64.ActiveCfg = Release|x64 - {CA200BCB-DFC6-4153-9BD4-785BC768B26B}.Release|x64.Build.0 = Release|x64 - {CA200BCB-DFC6-4153-9BD4-785BC768B26B}.Release|x86.ActiveCfg = Release|x86 - {CA200BCB-DFC6-4153-9BD4-785BC768B26B}.Release|x86.Build.0 = Release|x86 {5CCCB9CF-0384-458F-BA08-72B73866840F}.Debug|Any CPU.ActiveCfg = Debug|x64 {5CCCB9CF-0384-458F-BA08-72B73866840F}.Debug|x64.ActiveCfg = Debug|x64 {5CCCB9CF-0384-458F-BA08-72B73866840F}.Debug|x64.Build.0 = Debug|x64 @@ -425,6 +411,18 @@ Global {115CC5B0-0385-41CD-8A23-6A7EA4C51926}.Release|x64.Build.0 = Release|x64 {115CC5B0-0385-41CD-8A23-6A7EA4C51926}.Release|x86.ActiveCfg = Release|x86 {115CC5B0-0385-41CD-8A23-6A7EA4C51926}.Release|x86.Build.0 = Release|x86 + {4CC18776-125E-4318-9D24-D60110AD9697}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4CC18776-125E-4318-9D24-D60110AD9697}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4CC18776-125E-4318-9D24-D60110AD9697}.Debug|x64.ActiveCfg = Debug|Any CPU + {4CC18776-125E-4318-9D24-D60110AD9697}.Debug|x64.Build.0 = Debug|Any CPU + {4CC18776-125E-4318-9D24-D60110AD9697}.Debug|x86.ActiveCfg = Debug|Any CPU + {4CC18776-125E-4318-9D24-D60110AD9697}.Debug|x86.Build.0 = Debug|Any CPU + {4CC18776-125E-4318-9D24-D60110AD9697}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4CC18776-125E-4318-9D24-D60110AD9697}.Release|Any CPU.Build.0 = Release|Any CPU + {4CC18776-125E-4318-9D24-D60110AD9697}.Release|x64.ActiveCfg = Release|Any CPU + {4CC18776-125E-4318-9D24-D60110AD9697}.Release|x64.Build.0 = Release|Any CPU + {4CC18776-125E-4318-9D24-D60110AD9697}.Release|x86.ActiveCfg = Release|Any CPU + {4CC18776-125E-4318-9D24-D60110AD9697}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/CUETools/frmBatch.cs b/CUETools/frmBatch.cs index aac94f0..1fb0b14 100644 --- a/CUETools/frmBatch.cs +++ b/CUETools/frmBatch.cs @@ -157,7 +157,7 @@ namespace JDP if (outputAudio) { if (_cueStyle == CUEStyle.SingleFileWithCUE) - cueSheet.SingleFilename = Path.ChangeExtension(Path.GetFileName(pathOut), General.FormatExtension(_audioFormat)); + cueSheet.SingleFilename = Path.ChangeExtension(Path.GetFileName(pathOut), General.FormatExtension(_audioFormat, _config)); } cueSheet.UsePregapForFirstTrackInSingleFile = false; diff --git a/CUETools/frmCUETools.Designer.cs b/CUETools/frmCUETools.Designer.cs index 893b4dd..426bfc6 100644 --- a/CUETools/frmCUETools.Designer.cs +++ b/CUETools/frmCUETools.Designer.cs @@ -79,6 +79,7 @@ namespace JDP { this.rbFreedbAlways = new System.Windows.Forms.RadioButton(); this.rbFreedbIf = new System.Windows.Forms.RadioButton(); this.rbFreedbNever = new System.Windows.Forms.RadioButton(); + this.rbUDC1 = new System.Windows.Forms.RadioButton(); this.grpCUEPaths.SuspendLayout(); this.grpOutputStyle.SuspendLayout(); this.grpOutputPathGeneration.SuspendLayout(); @@ -90,125 +91,78 @@ namespace JDP { // // btnConvert // - this.btnConvert.AccessibleDescription = null; - this.btnConvert.AccessibleName = null; resources.ApplyResources(this.btnConvert, "btnConvert"); - this.btnConvert.BackgroundImage = null; - this.btnConvert.Font = null; this.btnConvert.Name = "btnConvert"; - this.toolTip1.SetToolTip(this.btnConvert, resources.GetString("btnConvert.ToolTip")); this.btnConvert.UseVisualStyleBackColor = true; this.btnConvert.Click += new System.EventHandler(this.btnConvert_Click); // // grpCUEPaths // - this.grpCUEPaths.AccessibleDescription = null; - this.grpCUEPaths.AccessibleName = null; - resources.ApplyResources(this.grpCUEPaths, "grpCUEPaths"); - this.grpCUEPaths.BackgroundImage = null; this.grpCUEPaths.Controls.Add(this.btnBrowseOutput); this.grpCUEPaths.Controls.Add(this.btnBrowseInput); this.grpCUEPaths.Controls.Add(this.lblOutput); this.grpCUEPaths.Controls.Add(this.lblInput); this.grpCUEPaths.Controls.Add(this.txtOutputPath); this.grpCUEPaths.Controls.Add(this.txtInputPath); - this.grpCUEPaths.Font = null; + resources.ApplyResources(this.grpCUEPaths, "grpCUEPaths"); this.grpCUEPaths.Name = "grpCUEPaths"; this.grpCUEPaths.TabStop = false; - this.toolTip1.SetToolTip(this.grpCUEPaths, resources.GetString("grpCUEPaths.ToolTip")); // // btnBrowseOutput // - this.btnBrowseOutput.AccessibleDescription = null; - this.btnBrowseOutput.AccessibleName = null; resources.ApplyResources(this.btnBrowseOutput, "btnBrowseOutput"); - this.btnBrowseOutput.BackgroundImage = null; - this.btnBrowseOutput.Font = null; this.btnBrowseOutput.Name = "btnBrowseOutput"; - this.toolTip1.SetToolTip(this.btnBrowseOutput, resources.GetString("btnBrowseOutput.ToolTip")); this.btnBrowseOutput.UseVisualStyleBackColor = true; this.btnBrowseOutput.Click += new System.EventHandler(this.btnBrowseOutput_Click); // // btnBrowseInput // - this.btnBrowseInput.AccessibleDescription = null; - this.btnBrowseInput.AccessibleName = null; resources.ApplyResources(this.btnBrowseInput, "btnBrowseInput"); - this.btnBrowseInput.BackgroundImage = null; - this.btnBrowseInput.Font = null; this.btnBrowseInput.Name = "btnBrowseInput"; - this.toolTip1.SetToolTip(this.btnBrowseInput, resources.GetString("btnBrowseInput.ToolTip")); this.btnBrowseInput.UseVisualStyleBackColor = true; this.btnBrowseInput.Click += new System.EventHandler(this.btnBrowseInput_Click); // // lblOutput // - this.lblOutput.AccessibleDescription = null; - this.lblOutput.AccessibleName = null; resources.ApplyResources(this.lblOutput, "lblOutput"); - this.lblOutput.Font = null; this.lblOutput.Name = "lblOutput"; - this.toolTip1.SetToolTip(this.lblOutput, resources.GetString("lblOutput.ToolTip")); // // lblInput // - this.lblInput.AccessibleDescription = null; - this.lblInput.AccessibleName = null; resources.ApplyResources(this.lblInput, "lblInput"); - this.lblInput.Font = null; this.lblInput.Name = "lblInput"; - this.toolTip1.SetToolTip(this.lblInput, resources.GetString("lblInput.ToolTip")); // // txtOutputPath // - this.txtOutputPath.AccessibleDescription = null; - this.txtOutputPath.AccessibleName = null; this.txtOutputPath.AllowDrop = true; resources.ApplyResources(this.txtOutputPath, "txtOutputPath"); - this.txtOutputPath.BackgroundImage = null; - this.txtOutputPath.Font = null; this.txtOutputPath.Name = "txtOutputPath"; - this.toolTip1.SetToolTip(this.txtOutputPath, resources.GetString("txtOutputPath.ToolTip")); this.txtOutputPath.DragDrop += new System.Windows.Forms.DragEventHandler(this.PathTextBox_DragDrop); this.txtOutputPath.DragEnter += new System.Windows.Forms.DragEventHandler(this.PathTextBox_DragEnter); // // txtInputPath // - this.txtInputPath.AccessibleDescription = null; - this.txtInputPath.AccessibleName = null; this.txtInputPath.AllowDrop = true; resources.ApplyResources(this.txtInputPath, "txtInputPath"); - this.txtInputPath.BackgroundImage = null; - this.txtInputPath.Font = null; this.txtInputPath.Name = "txtInputPath"; - this.toolTip1.SetToolTip(this.txtInputPath, resources.GetString("txtInputPath.ToolTip")); this.txtInputPath.TextChanged += new System.EventHandler(this.txtInputPath_TextChanged); this.txtInputPath.DragDrop += new System.Windows.Forms.DragEventHandler(this.PathTextBox_DragDrop); this.txtInputPath.DragEnter += new System.Windows.Forms.DragEventHandler(this.PathTextBox_DragEnter); // // grpOutputStyle // - this.grpOutputStyle.AccessibleDescription = null; - this.grpOutputStyle.AccessibleName = null; - resources.ApplyResources(this.grpOutputStyle, "grpOutputStyle"); - this.grpOutputStyle.BackgroundImage = null; this.grpOutputStyle.Controls.Add(this.rbEmbedCUE); this.grpOutputStyle.Controls.Add(this.rbGapsLeftOut); this.grpOutputStyle.Controls.Add(this.rbGapsPrepended); this.grpOutputStyle.Controls.Add(this.rbGapsAppended); this.grpOutputStyle.Controls.Add(this.rbSingleFile); - this.grpOutputStyle.Font = null; + resources.ApplyResources(this.grpOutputStyle, "grpOutputStyle"); this.grpOutputStyle.Name = "grpOutputStyle"; this.grpOutputStyle.TabStop = false; - this.toolTip1.SetToolTip(this.grpOutputStyle, resources.GetString("grpOutputStyle.ToolTip")); // // rbEmbedCUE // - this.rbEmbedCUE.AccessibleDescription = null; - this.rbEmbedCUE.AccessibleName = null; resources.ApplyResources(this.rbEmbedCUE, "rbEmbedCUE"); - this.rbEmbedCUE.BackgroundImage = null; - this.rbEmbedCUE.Font = null; this.rbEmbedCUE.Name = "rbEmbedCUE"; this.rbEmbedCUE.TabStop = true; this.toolTip1.SetToolTip(this.rbEmbedCUE, resources.GetString("rbEmbedCUE.ToolTip")); @@ -217,45 +171,29 @@ namespace JDP { // // rbGapsLeftOut // - this.rbGapsLeftOut.AccessibleDescription = null; - this.rbGapsLeftOut.AccessibleName = null; resources.ApplyResources(this.rbGapsLeftOut, "rbGapsLeftOut"); - this.rbGapsLeftOut.BackgroundImage = null; - this.rbGapsLeftOut.Font = null; this.rbGapsLeftOut.Name = "rbGapsLeftOut"; this.toolTip1.SetToolTip(this.rbGapsLeftOut, resources.GetString("rbGapsLeftOut.ToolTip")); this.rbGapsLeftOut.UseVisualStyleBackColor = true; // // rbGapsPrepended // - this.rbGapsPrepended.AccessibleDescription = null; - this.rbGapsPrepended.AccessibleName = null; resources.ApplyResources(this.rbGapsPrepended, "rbGapsPrepended"); - this.rbGapsPrepended.BackgroundImage = null; - this.rbGapsPrepended.Font = null; this.rbGapsPrepended.Name = "rbGapsPrepended"; this.toolTip1.SetToolTip(this.rbGapsPrepended, resources.GetString("rbGapsPrepended.ToolTip")); this.rbGapsPrepended.UseVisualStyleBackColor = true; // // rbGapsAppended // - this.rbGapsAppended.AccessibleDescription = null; - this.rbGapsAppended.AccessibleName = null; resources.ApplyResources(this.rbGapsAppended, "rbGapsAppended"); - this.rbGapsAppended.BackgroundImage = null; - this.rbGapsAppended.Font = null; this.rbGapsAppended.Name = "rbGapsAppended"; this.toolTip1.SetToolTip(this.rbGapsAppended, resources.GetString("rbGapsAppended.ToolTip")); this.rbGapsAppended.UseVisualStyleBackColor = true; // // rbSingleFile // - this.rbSingleFile.AccessibleDescription = null; - this.rbSingleFile.AccessibleName = null; resources.ApplyResources(this.rbSingleFile, "rbSingleFile"); - this.rbSingleFile.BackgroundImage = null; this.rbSingleFile.Checked = true; - this.rbSingleFile.Font = null; this.rbSingleFile.Name = "rbSingleFile"; this.rbSingleFile.TabStop = true; this.toolTip1.SetToolTip(this.rbSingleFile, resources.GetString("rbSingleFile.ToolTip")); @@ -263,22 +201,13 @@ namespace JDP { // // btnAbout // - this.btnAbout.AccessibleDescription = null; - this.btnAbout.AccessibleName = null; resources.ApplyResources(this.btnAbout, "btnAbout"); - this.btnAbout.BackgroundImage = null; - this.btnAbout.Font = null; this.btnAbout.Name = "btnAbout"; - this.toolTip1.SetToolTip(this.btnAbout, resources.GetString("btnAbout.ToolTip")); this.btnAbout.UseVisualStyleBackColor = true; this.btnAbout.Click += new System.EventHandler(this.btnAbout_Click); // // grpOutputPathGeneration // - this.grpOutputPathGeneration.AccessibleDescription = null; - this.grpOutputPathGeneration.AccessibleName = null; - resources.ApplyResources(this.grpOutputPathGeneration, "grpOutputPathGeneration"); - this.grpOutputPathGeneration.BackgroundImage = null; this.grpOutputPathGeneration.Controls.Add(this.txtCustomFormat); this.grpOutputPathGeneration.Controls.Add(this.rbCustomFormat); this.grpOutputPathGeneration.Controls.Add(this.txtCreateSubdirectory); @@ -286,100 +215,61 @@ namespace JDP { this.grpOutputPathGeneration.Controls.Add(this.rbCreateSubdirectory); this.grpOutputPathGeneration.Controls.Add(this.rbAppendFilename); this.grpOutputPathGeneration.Controls.Add(this.txtAppendFilename); - this.grpOutputPathGeneration.Font = null; + resources.ApplyResources(this.grpOutputPathGeneration, "grpOutputPathGeneration"); this.grpOutputPathGeneration.Name = "grpOutputPathGeneration"; this.grpOutputPathGeneration.TabStop = false; - this.toolTip1.SetToolTip(this.grpOutputPathGeneration, resources.GetString("grpOutputPathGeneration.ToolTip")); // // txtCustomFormat // - this.txtCustomFormat.AccessibleDescription = null; - this.txtCustomFormat.AccessibleName = null; resources.ApplyResources(this.txtCustomFormat, "txtCustomFormat"); - this.txtCustomFormat.BackgroundImage = null; - this.txtCustomFormat.Font = null; this.txtCustomFormat.Name = "txtCustomFormat"; - this.toolTip1.SetToolTip(this.txtCustomFormat, resources.GetString("txtCustomFormat.ToolTip")); this.txtCustomFormat.TextChanged += new System.EventHandler(this.txtCustomFormat_TextChanged); // // rbCustomFormat // - this.rbCustomFormat.AccessibleDescription = null; - this.rbCustomFormat.AccessibleName = null; resources.ApplyResources(this.rbCustomFormat, "rbCustomFormat"); - this.rbCustomFormat.BackgroundImage = null; - this.rbCustomFormat.Font = null; this.rbCustomFormat.Name = "rbCustomFormat"; this.rbCustomFormat.TabStop = true; - this.toolTip1.SetToolTip(this.rbCustomFormat, resources.GetString("rbCustomFormat.ToolTip")); this.rbCustomFormat.UseVisualStyleBackColor = true; this.rbCustomFormat.CheckedChanged += new System.EventHandler(this.rbCustomFormat_CheckedChanged); // // txtCreateSubdirectory // - this.txtCreateSubdirectory.AccessibleDescription = null; - this.txtCreateSubdirectory.AccessibleName = null; resources.ApplyResources(this.txtCreateSubdirectory, "txtCreateSubdirectory"); - this.txtCreateSubdirectory.BackgroundImage = null; - this.txtCreateSubdirectory.Font = null; this.txtCreateSubdirectory.Name = "txtCreateSubdirectory"; - this.toolTip1.SetToolTip(this.txtCreateSubdirectory, resources.GetString("txtCreateSubdirectory.ToolTip")); this.txtCreateSubdirectory.TextChanged += new System.EventHandler(this.txtCreateSubdirectory_TextChanged); // // rbDontGenerate // - this.rbDontGenerate.AccessibleDescription = null; - this.rbDontGenerate.AccessibleName = null; resources.ApplyResources(this.rbDontGenerate, "rbDontGenerate"); - this.rbDontGenerate.BackgroundImage = null; - this.rbDontGenerate.Font = null; this.rbDontGenerate.Name = "rbDontGenerate"; - this.toolTip1.SetToolTip(this.rbDontGenerate, resources.GetString("rbDontGenerate.ToolTip")); this.rbDontGenerate.UseVisualStyleBackColor = true; // // rbCreateSubdirectory // - this.rbCreateSubdirectory.AccessibleDescription = null; - this.rbCreateSubdirectory.AccessibleName = null; resources.ApplyResources(this.rbCreateSubdirectory, "rbCreateSubdirectory"); - this.rbCreateSubdirectory.BackgroundImage = null; this.rbCreateSubdirectory.Checked = true; - this.rbCreateSubdirectory.Font = null; this.rbCreateSubdirectory.Name = "rbCreateSubdirectory"; this.rbCreateSubdirectory.TabStop = true; - this.toolTip1.SetToolTip(this.rbCreateSubdirectory, resources.GetString("rbCreateSubdirectory.ToolTip")); this.rbCreateSubdirectory.UseVisualStyleBackColor = true; this.rbCreateSubdirectory.CheckedChanged += new System.EventHandler(this.rbCreateSubdirectory_CheckedChanged); // // rbAppendFilename // - this.rbAppendFilename.AccessibleDescription = null; - this.rbAppendFilename.AccessibleName = null; resources.ApplyResources(this.rbAppendFilename, "rbAppendFilename"); - this.rbAppendFilename.BackgroundImage = null; - this.rbAppendFilename.Font = null; this.rbAppendFilename.Name = "rbAppendFilename"; - this.toolTip1.SetToolTip(this.rbAppendFilename, resources.GetString("rbAppendFilename.ToolTip")); this.rbAppendFilename.UseVisualStyleBackColor = true; this.rbAppendFilename.CheckedChanged += new System.EventHandler(this.rbAppendFilename_CheckedChanged); // // txtAppendFilename // - this.txtAppendFilename.AccessibleDescription = null; - this.txtAppendFilename.AccessibleName = null; resources.ApplyResources(this.txtAppendFilename, "txtAppendFilename"); - this.txtAppendFilename.BackgroundImage = null; - this.txtAppendFilename.Font = null; this.txtAppendFilename.Name = "txtAppendFilename"; - this.toolTip1.SetToolTip(this.txtAppendFilename, resources.GetString("txtAppendFilename.ToolTip")); this.txtAppendFilename.TextChanged += new System.EventHandler(this.txtAppendFilename_TextChanged); // // grpAudioOutput // - this.grpAudioOutput.AccessibleDescription = null; - this.grpAudioOutput.AccessibleName = null; - resources.ApplyResources(this.grpAudioOutput, "grpAudioOutput"); - this.grpAudioOutput.BackgroundImage = null; + this.grpAudioOutput.Controls.Add(this.rbUDC1); this.grpAudioOutput.Controls.Add(this.rbTTA); this.grpAudioOutput.Controls.Add(this.chkLossyWAV); this.grpAudioOutput.Controls.Add(this.rbAPE); @@ -387,31 +277,21 @@ namespace JDP { this.grpAudioOutput.Controls.Add(this.rbWavPack); this.grpAudioOutput.Controls.Add(this.rbWAV); this.grpAudioOutput.Controls.Add(this.rbFLAC); - this.grpAudioOutput.Font = null; + resources.ApplyResources(this.grpAudioOutput, "grpAudioOutput"); this.grpAudioOutput.Name = "grpAudioOutput"; this.grpAudioOutput.TabStop = false; - this.toolTip1.SetToolTip(this.grpAudioOutput, resources.GetString("grpAudioOutput.ToolTip")); // // rbTTA // - this.rbTTA.AccessibleDescription = null; - this.rbTTA.AccessibleName = null; resources.ApplyResources(this.rbTTA, "rbTTA"); - this.rbTTA.BackgroundImage = null; - this.rbTTA.Font = null; this.rbTTA.Name = "rbTTA"; this.rbTTA.TabStop = true; - this.toolTip1.SetToolTip(this.rbTTA, resources.GetString("rbTTA.ToolTip")); this.rbTTA.UseVisualStyleBackColor = true; this.rbTTA.CheckedChanged += new System.EventHandler(this.rbTTA_CheckedChanged); // // chkLossyWAV // - this.chkLossyWAV.AccessibleDescription = null; - this.chkLossyWAV.AccessibleName = null; resources.ApplyResources(this.chkLossyWAV, "chkLossyWAV"); - this.chkLossyWAV.BackgroundImage = null; - this.chkLossyWAV.Font = null; this.chkLossyWAV.Name = "chkLossyWAV"; this.toolTip1.SetToolTip(this.chkLossyWAV, resources.GetString("chkLossyWAV.ToolTip")); this.chkLossyWAV.UseVisualStyleBackColor = true; @@ -419,24 +299,15 @@ namespace JDP { // // rbAPE // - this.rbAPE.AccessibleDescription = null; - this.rbAPE.AccessibleName = null; resources.ApplyResources(this.rbAPE, "rbAPE"); - this.rbAPE.BackgroundImage = null; - this.rbAPE.Font = null; this.rbAPE.Name = "rbAPE"; this.rbAPE.TabStop = true; - this.toolTip1.SetToolTip(this.rbAPE, resources.GetString("rbAPE.ToolTip")); this.rbAPE.UseVisualStyleBackColor = true; this.rbAPE.CheckedChanged += new System.EventHandler(this.rbAPE_CheckedChanged); // // rbNoAudio // - this.rbNoAudio.AccessibleDescription = null; - this.rbNoAudio.AccessibleName = null; resources.ApplyResources(this.rbNoAudio, "rbNoAudio"); - this.rbNoAudio.BackgroundImage = null; - this.rbNoAudio.Font = null; this.rbNoAudio.Name = "rbNoAudio"; this.toolTip1.SetToolTip(this.rbNoAudio, resources.GetString("rbNoAudio.ToolTip")); this.rbNoAudio.UseVisualStyleBackColor = true; @@ -444,137 +315,85 @@ namespace JDP { // // rbWavPack // - this.rbWavPack.AccessibleDescription = null; - this.rbWavPack.AccessibleName = null; resources.ApplyResources(this.rbWavPack, "rbWavPack"); - this.rbWavPack.BackgroundImage = null; - this.rbWavPack.Font = null; this.rbWavPack.Name = "rbWavPack"; - this.toolTip1.SetToolTip(this.rbWavPack, resources.GetString("rbWavPack.ToolTip")); this.rbWavPack.UseVisualStyleBackColor = true; this.rbWavPack.CheckedChanged += new System.EventHandler(this.rbWavPack_CheckedChanged); // // rbWAV // - this.rbWAV.AccessibleDescription = null; - this.rbWAV.AccessibleName = null; resources.ApplyResources(this.rbWAV, "rbWAV"); - this.rbWAV.BackgroundImage = null; this.rbWAV.Checked = true; - this.rbWAV.Font = null; this.rbWAV.Name = "rbWAV"; this.rbWAV.TabStop = true; - this.toolTip1.SetToolTip(this.rbWAV, resources.GetString("rbWAV.ToolTip")); this.rbWAV.UseVisualStyleBackColor = true; this.rbWAV.CheckedChanged += new System.EventHandler(this.rbWAV_CheckedChanged); // // rbFLAC // - this.rbFLAC.AccessibleDescription = null; - this.rbFLAC.AccessibleName = null; resources.ApplyResources(this.rbFLAC, "rbFLAC"); - this.rbFLAC.BackgroundImage = null; - this.rbFLAC.Font = null; this.rbFLAC.Name = "rbFLAC"; - this.toolTip1.SetToolTip(this.rbFLAC, resources.GetString("rbFLAC.ToolTip")); this.rbFLAC.UseVisualStyleBackColor = true; this.rbFLAC.CheckedChanged += new System.EventHandler(this.rbFLAC_CheckedChanged); // // btnBatch // - this.btnBatch.AccessibleDescription = null; - this.btnBatch.AccessibleName = null; resources.ApplyResources(this.btnBatch, "btnBatch"); - this.btnBatch.BackgroundImage = null; - this.btnBatch.Font = null; this.btnBatch.Name = "btnBatch"; - this.toolTip1.SetToolTip(this.btnBatch, resources.GetString("btnBatch.ToolTip")); this.btnBatch.UseVisualStyleBackColor = true; this.btnBatch.Click += new System.EventHandler(this.btnBatch_Click); // // btnFilenameCorrector // - this.btnFilenameCorrector.AccessibleDescription = null; - this.btnFilenameCorrector.AccessibleName = null; resources.ApplyResources(this.btnFilenameCorrector, "btnFilenameCorrector"); - this.btnFilenameCorrector.BackgroundImage = null; - this.btnFilenameCorrector.Font = null; this.btnFilenameCorrector.Name = "btnFilenameCorrector"; - this.toolTip1.SetToolTip(this.btnFilenameCorrector, resources.GetString("btnFilenameCorrector.ToolTip")); this.btnFilenameCorrector.UseVisualStyleBackColor = true; this.btnFilenameCorrector.Click += new System.EventHandler(this.btnFilenameCorrector_Click); // // btnSettings // - this.btnSettings.AccessibleDescription = null; - this.btnSettings.AccessibleName = null; resources.ApplyResources(this.btnSettings, "btnSettings"); - this.btnSettings.BackgroundImage = null; - this.btnSettings.Font = null; this.btnSettings.Name = "btnSettings"; - this.toolTip1.SetToolTip(this.btnSettings, resources.GetString("btnSettings.ToolTip")); this.btnSettings.UseVisualStyleBackColor = true; this.btnSettings.Click += new System.EventHandler(this.btnSettings_Click); // // grpAccurateRip // - this.grpAccurateRip.AccessibleDescription = null; - this.grpAccurateRip.AccessibleName = null; - resources.ApplyResources(this.grpAccurateRip, "grpAccurateRip"); - this.grpAccurateRip.BackgroundImage = null; this.grpAccurateRip.Controls.Add(this.rbArAndEncode); this.grpAccurateRip.Controls.Add(this.label1); this.grpAccurateRip.Controls.Add(this.txtDataTrackLength); this.grpAccurateRip.Controls.Add(this.rbArApplyOffset); this.grpAccurateRip.Controls.Add(this.rbArVerify); this.grpAccurateRip.Controls.Add(this.rbArNone); - this.grpAccurateRip.Font = null; + resources.ApplyResources(this.grpAccurateRip, "grpAccurateRip"); this.grpAccurateRip.Name = "grpAccurateRip"; this.grpAccurateRip.TabStop = false; - this.toolTip1.SetToolTip(this.grpAccurateRip, resources.GetString("grpAccurateRip.ToolTip")); // // rbArAndEncode // - this.rbArAndEncode.AccessibleDescription = null; - this.rbArAndEncode.AccessibleName = null; resources.ApplyResources(this.rbArAndEncode, "rbArAndEncode"); - this.rbArAndEncode.BackgroundImage = null; - this.rbArAndEncode.Font = null; this.rbArAndEncode.Name = "rbArAndEncode"; this.rbArAndEncode.TabStop = true; - this.toolTip1.SetToolTip(this.rbArAndEncode, resources.GetString("rbArAndEncode.ToolTip")); this.rbArAndEncode.UseVisualStyleBackColor = true; // // label1 // - this.label1.AccessibleDescription = null; - this.label1.AccessibleName = null; resources.ApplyResources(this.label1, "label1"); - this.label1.Font = null; this.label1.Name = "label1"; - this.toolTip1.SetToolTip(this.label1, resources.GetString("label1.ToolTip")); // // txtDataTrackLength // - this.txtDataTrackLength.AccessibleDescription = null; - this.txtDataTrackLength.AccessibleName = null; - resources.ApplyResources(this.txtDataTrackLength, "txtDataTrackLength"); - this.txtDataTrackLength.BackgroundImage = null; this.txtDataTrackLength.Culture = new System.Globalization.CultureInfo(""); this.txtDataTrackLength.CutCopyMaskFormat = System.Windows.Forms.MaskFormat.IncludePromptAndLiterals; - this.txtDataTrackLength.Font = null; this.txtDataTrackLength.InsertKeyMode = System.Windows.Forms.InsertKeyMode.Overwrite; + resources.ApplyResources(this.txtDataTrackLength, "txtDataTrackLength"); this.txtDataTrackLength.Name = "txtDataTrackLength"; this.txtDataTrackLength.TextMaskFormat = System.Windows.Forms.MaskFormat.IncludePromptAndLiterals; this.toolTip1.SetToolTip(this.txtDataTrackLength, resources.GetString("txtDataTrackLength.ToolTip")); // // rbArApplyOffset // - this.rbArApplyOffset.AccessibleDescription = null; - this.rbArApplyOffset.AccessibleName = null; resources.ApplyResources(this.rbArApplyOffset, "rbArApplyOffset"); - this.rbArApplyOffset.BackgroundImage = null; - this.rbArApplyOffset.Font = null; this.rbArApplyOffset.Name = "rbArApplyOffset"; this.toolTip1.SetToolTip(this.rbArApplyOffset, resources.GetString("rbArApplyOffset.ToolTip")); this.rbArApplyOffset.UseVisualStyleBackColor = true; @@ -582,11 +401,7 @@ namespace JDP { // // rbArVerify // - this.rbArVerify.AccessibleDescription = null; - this.rbArVerify.AccessibleName = null; resources.ApplyResources(this.rbArVerify, "rbArVerify"); - this.rbArVerify.BackgroundImage = null; - this.rbArVerify.Font = null; this.rbArVerify.Name = "rbArVerify"; this.toolTip1.SetToolTip(this.rbArVerify, resources.GetString("rbArVerify.ToolTip")); this.rbArVerify.UseVisualStyleBackColor = true; @@ -594,12 +409,8 @@ namespace JDP { // // rbArNone // - this.rbArNone.AccessibleDescription = null; - this.rbArNone.AccessibleName = null; resources.ApplyResources(this.rbArNone, "rbArNone"); - this.rbArNone.BackgroundImage = null; this.rbArNone.Checked = true; - this.rbArNone.Font = null; this.rbArNone.Name = "rbArNone"; this.rbArNone.TabStop = true; this.toolTip1.SetToolTip(this.rbArNone, resources.GetString("rbArNone.ToolTip")); @@ -607,44 +418,32 @@ namespace JDP { // // statusStrip1 // - this.statusStrip1.AccessibleDescription = null; - this.statusStrip1.AccessibleName = null; - resources.ApplyResources(this.statusStrip1, "statusStrip1"); - this.statusStrip1.BackgroundImage = null; - this.statusStrip1.Font = null; this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripStatusLabel1, this.toolStripProgressBar1, this.toolStripProgressBar2}); + resources.ApplyResources(this.statusStrip1, "statusStrip1"); this.statusStrip1.Name = "statusStrip1"; this.statusStrip1.SizingGrip = false; - this.toolTip1.SetToolTip(this.statusStrip1, resources.GetString("statusStrip1.ToolTip")); // // toolStripStatusLabel1 // - this.toolStripStatusLabel1.AccessibleDescription = null; - this.toolStripStatusLabel1.AccessibleName = null; - resources.ApplyResources(this.toolStripStatusLabel1, "toolStripStatusLabel1"); - this.toolStripStatusLabel1.BackgroundImage = null; this.toolStripStatusLabel1.Name = "toolStripStatusLabel1"; + resources.ApplyResources(this.toolStripStatusLabel1, "toolStripStatusLabel1"); this.toolStripStatusLabel1.Spring = true; // // toolStripProgressBar1 // - this.toolStripProgressBar1.AccessibleDescription = null; - this.toolStripProgressBar1.AccessibleName = null; - resources.ApplyResources(this.toolStripProgressBar1, "toolStripProgressBar1"); this.toolStripProgressBar1.AutoToolTip = true; this.toolStripProgressBar1.Name = "toolStripProgressBar1"; + resources.ApplyResources(this.toolStripProgressBar1, "toolStripProgressBar1"); this.toolStripProgressBar1.Style = System.Windows.Forms.ProgressBarStyle.Continuous; // // toolStripProgressBar2 // - this.toolStripProgressBar2.AccessibleDescription = null; - this.toolStripProgressBar2.AccessibleName = null; - resources.ApplyResources(this.toolStripProgressBar2, "toolStripProgressBar2"); this.toolStripProgressBar2.AutoToolTip = true; this.toolStripProgressBar2.Name = "toolStripProgressBar2"; + resources.ApplyResources(this.toolStripProgressBar2, "toolStripProgressBar2"); this.toolStripProgressBar2.Style = System.Windows.Forms.ProgressBarStyle.Continuous; // // toolTip1 @@ -655,109 +454,74 @@ namespace JDP { // // btnCUECreator // - this.btnCUECreator.AccessibleDescription = null; - this.btnCUECreator.AccessibleName = null; resources.ApplyResources(this.btnCUECreator, "btnCUECreator"); - this.btnCUECreator.BackgroundImage = null; - this.btnCUECreator.Font = null; this.btnCUECreator.Name = "btnCUECreator"; - this.toolTip1.SetToolTip(this.btnCUECreator, resources.GetString("btnCUECreator.ToolTip")); this.btnCUECreator.UseVisualStyleBackColor = true; this.btnCUECreator.Click += new System.EventHandler(this.btnCUECreator_Click); // // btnStop // - this.btnStop.AccessibleDescription = null; - this.btnStop.AccessibleName = null; resources.ApplyResources(this.btnStop, "btnStop"); - this.btnStop.BackgroundImage = null; - this.btnStop.Font = null; this.btnStop.Name = "btnStop"; - this.toolTip1.SetToolTip(this.btnStop, resources.GetString("btnStop.ToolTip")); this.btnStop.UseVisualStyleBackColor = true; this.btnStop.Click += new System.EventHandler(this.btnStop_Click); // // btnPause // - this.btnPause.AccessibleDescription = null; - this.btnPause.AccessibleName = null; resources.ApplyResources(this.btnPause, "btnPause"); - this.btnPause.BackgroundImage = null; - this.btnPause.Font = null; this.btnPause.Name = "btnPause"; - this.toolTip1.SetToolTip(this.btnPause, resources.GetString("btnPause.ToolTip")); this.btnPause.UseVisualStyleBackColor = true; this.btnPause.Click += new System.EventHandler(this.btnPause_Click); // // btnResume // - this.btnResume.AccessibleDescription = null; - this.btnResume.AccessibleName = null; resources.ApplyResources(this.btnResume, "btnResume"); - this.btnResume.BackgroundImage = null; - this.btnResume.Font = null; this.btnResume.Name = "btnResume"; - this.toolTip1.SetToolTip(this.btnResume, resources.GetString("btnResume.ToolTip")); this.btnResume.UseVisualStyleBackColor = true; this.btnResume.Click += new System.EventHandler(this.btnPause_Click); // // groupBox1 // - this.groupBox1.AccessibleDescription = null; - this.groupBox1.AccessibleName = null; - resources.ApplyResources(this.groupBox1, "groupBox1"); - this.groupBox1.BackgroundImage = null; this.groupBox1.Controls.Add(this.rbFreedbAlways); this.groupBox1.Controls.Add(this.rbFreedbIf); this.groupBox1.Controls.Add(this.rbFreedbNever); - this.groupBox1.Font = null; + resources.ApplyResources(this.groupBox1, "groupBox1"); this.groupBox1.Name = "groupBox1"; this.groupBox1.TabStop = false; - this.toolTip1.SetToolTip(this.groupBox1, resources.GetString("groupBox1.ToolTip")); // // rbFreedbAlways // - this.rbFreedbAlways.AccessibleDescription = null; - this.rbFreedbAlways.AccessibleName = null; resources.ApplyResources(this.rbFreedbAlways, "rbFreedbAlways"); - this.rbFreedbAlways.BackgroundImage = null; - this.rbFreedbAlways.Font = null; this.rbFreedbAlways.Name = "rbFreedbAlways"; this.rbFreedbAlways.TabStop = true; - this.toolTip1.SetToolTip(this.rbFreedbAlways, resources.GetString("rbFreedbAlways.ToolTip")); this.rbFreedbAlways.UseVisualStyleBackColor = true; // // rbFreedbIf // - this.rbFreedbIf.AccessibleDescription = null; - this.rbFreedbIf.AccessibleName = null; resources.ApplyResources(this.rbFreedbIf, "rbFreedbIf"); - this.rbFreedbIf.BackgroundImage = null; - this.rbFreedbIf.Font = null; this.rbFreedbIf.Name = "rbFreedbIf"; this.rbFreedbIf.TabStop = true; - this.toolTip1.SetToolTip(this.rbFreedbIf, resources.GetString("rbFreedbIf.ToolTip")); this.rbFreedbIf.UseVisualStyleBackColor = true; // // rbFreedbNever // - this.rbFreedbNever.AccessibleDescription = null; - this.rbFreedbNever.AccessibleName = null; resources.ApplyResources(this.rbFreedbNever, "rbFreedbNever"); - this.rbFreedbNever.BackgroundImage = null; - this.rbFreedbNever.Font = null; this.rbFreedbNever.Name = "rbFreedbNever"; this.rbFreedbNever.TabStop = true; - this.toolTip1.SetToolTip(this.rbFreedbNever, resources.GetString("rbFreedbNever.ToolTip")); this.rbFreedbNever.UseVisualStyleBackColor = true; // + // rbUDC1 + // + resources.ApplyResources(this.rbUDC1, "rbUDC1"); + this.rbUDC1.Name = "rbUDC1"; + this.rbUDC1.TabStop = true; + this.rbUDC1.UseVisualStyleBackColor = true; + this.rbUDC1.CheckedChanged += new System.EventHandler(this.rbUDC1_CheckedChanged); + // // frmCUETools // - this.AccessibleDescription = null; - this.AccessibleName = null; resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackgroundImage = null; this.Controls.Add(this.groupBox1); this.Controls.Add(this.btnResume); this.Controls.Add(this.btnPause); @@ -775,10 +539,8 @@ namespace JDP { this.Controls.Add(this.grpCUEPaths); this.Controls.Add(this.btnConvert); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.Icon = null; this.MaximizeBox = false; this.Name = "frmCUETools"; - this.toolTip1.SetToolTip(this, resources.GetString("$this.ToolTip")); this.Load += new System.EventHandler(this.frmCUETools_Load); this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.frmCUETools_FormClosed); this.grpCUEPaths.ResumeLayout(false); @@ -856,6 +618,7 @@ namespace JDP { private System.Windows.Forms.RadioButton rbFreedbAlways; private System.Windows.Forms.RadioButton rbFreedbIf; private System.Windows.Forms.RadioButton rbFreedbNever; + private System.Windows.Forms.RadioButton rbUDC1; } } diff --git a/CUETools/frmCUETools.cs b/CUETools/frmCUETools.cs index 2c633bd..6a23c24 100644 --- a/CUETools/frmCUETools.cs +++ b/CUETools/frmCUETools.cs @@ -126,6 +126,7 @@ namespace JDP { _writeOffset = settingsForm.WriteOffset; _reducePriority = settingsForm.ReducePriority; _config = settingsForm.Config; + updateOutputStyles(); UpdateOutputPath(); } } @@ -741,7 +742,10 @@ namespace JDP { if (rbAPE.Checked) return OutputAudioFormat.APE; if (rbTTA.Checked) return OutputAudioFormat.TTA; if (rbNoAudio.Checked) return OutputAudioFormat.NoAudio; - return OutputAudioFormat.WAV; + if (rbWAV.Checked) return OutputAudioFormat.WAV; + if (rbUDC1.Checked) return OutputAudioFormat.UDC1; + return OutputAudioFormat.NoAudio; + //throw new Exception("output format invalid"); } set { switch (value) { @@ -751,6 +755,7 @@ namespace JDP { case OutputAudioFormat.TTA: rbTTA.Checked = true; break; case OutputAudioFormat.WAV: rbWAV.Checked = true; break; case OutputAudioFormat.NoAudio: rbNoAudio.Checked = true; break; + case OutputAudioFormat.UDC1: rbUDC1.Checked = true; break; } } } @@ -859,7 +864,7 @@ namespace JDP { } ext = ".cue"; if (rbEmbedCUE.Checked) - ext = General.FormatExtension (SelectedOutputAudioFormat); + ext = General.FormatExtension (SelectedOutputAudioFormat, _config); if (chkLossyWAV.Checked) ext = ".lossy" + ext; if (_config.detectHDCD && _config.decodeHDCD && (!chkLossyWAV.Checked || !_config.decodeHDCDtoLW16)) @@ -901,11 +906,14 @@ namespace JDP { private void updateOutputStyles() { - rbEmbedCUE.Enabled = rbFLAC.Checked || rbWavPack.Checked || rbAPE.Checked; + rbEmbedCUE.Enabled = rbFLAC.Checked || rbWavPack.Checked || rbAPE.Checked || (rbUDC1.Checked && _config.udc1APEv2); chkLossyWAV.Enabled = rbFLAC.Checked || rbWavPack.Checked || rbWAV.Checked; rbNoAudio.Enabled = !rbEmbedCUE.Checked && !chkLossyWAV.Checked; rbWAV.Enabled = !rbEmbedCUE.Checked; rbTTA.Enabled = rbAPE.Enabled = !chkLossyWAV.Checked; + rbUDC1.Enabled = _config.udc1Extension != "" && _config.udc1Encoder != "" && (_config.udc1APEv2 || !rbEmbedCUE.Checked) && !chkLossyWAV.Checked; + rbUDC1.Text = _config.udc1Extension == "" ? "User" : _config.udc1Extension.ToUpper(); + // _config.udc1Extension.Substring(0, 1).ToUpper() + _config.udc1Extension.Substring(1); } private void rbWAV_CheckedChanged(object sender, EventArgs e) @@ -1027,6 +1035,12 @@ namespace JDP { updateOutputStyles(); UpdateOutputPath(); } + + private void rbUDC1_CheckedChanged(object sender, EventArgs e) + { + updateOutputStyles(); + UpdateOutputPath(); + } } enum OutputPathGeneration { diff --git a/CUETools/frmCUETools.resx b/CUETools/frmCUETools.resx index fec317e..2f0cbf3 100644 --- a/CUETools/frmCUETools.resx +++ b/CUETools/frmCUETools.resx @@ -117,1531 +117,1765 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - - - - - 54, 21 - - - - - - 00:00:00 - - - 226, 21 - - - 226, 21 - - - - 14 - - - toolTip1 - - - 59, 17 - - - 4 - - - rbGapsLeftOut - - - 0 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - NoControl - - - 1 - - - btnPause - - - 3 - - - grpOutputPathGeneration - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 9 - - - 66, 23 - - - Gaps Left Out - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - grpOutputStyle - - - %1:-2\New\%-1\%F.cue - - - groupBox1 - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - grpOutputPathGeneration - - - 4 - - - System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 77, 138 - - - 10 - - - 0 - - - 0 - - - 398, 115 - - - grpAccurateRip - - - 2 - - - CenterScreen - - - System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 552, 400 - - - 0 - - - btnAbout - - - 5 - - - rbEmbedCUE - - - - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - lblInput - - - btnResume - - - 1 - - - LossyWAV - - - 3 - - - System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - btnBrowseInput - - - True - - - 15 - - - txtCreateSubdirectory - - - 5 - - - - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 6 - - - 3 - - - rbWavPack - - - chkLossyWAV - - - Browse... - - - False - - - Create a pair of files - .lossy.wav(flac,etc) and .lwcdf.wav(flac,etc). Lossy file contains (lossy) compressed music, but together with the lwcdf (correction) file the original audio can be reconstructed. - - - 0 - - - btnConvert - - - 452, 49 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - - - - - System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 2 - - - $this - - - Batch... - - - 3 - - - Verify, &then encode - - - 15 - - - rbArVerify - - - 1 - - - Create single file with embedded CUE sheet. - - - - - - 535, 84 - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 11 - - - rbAPE - - - Append to filename: - - - $this - - - rbGapsPrepended - - - - - - System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - - - rbGapsAppended - - - grpAccurateRip - - - 244, 211 - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 2 - - - 552, 22 - - - NoControl - - - Encode and verify - - - frmCUETools - - - 3 - - - grpOutputPathGeneration - - - True - - - True - - - NoControl - - - $this - - - &Pause - - - &None - - - 7 - - - 122, 17 - - - True - - - 3 - - - btnBrowseOutput - - - - - - 4 - - - 6 - - - Advanced Settings... - - - 8, 24 - - - 412, 277 - - - 4 - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - - - - - 1 - - - rbDontGenerate - - - 385, 21 - - - True - - - grpAudioOutput - - - - - - 0 - - - 66, 23 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - btnFilenameCorrector - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 71, 23 - - - CUE Paths - - - If needed + + 412, 339 131, 23 - - True - - - System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 2 - - - $this - - - grpAudioOutput - - - 3 - - - $this - - - grpCUEPaths - - - 10, 51 - - - &WAV - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 412, 184 - - - btnStop - - - - - + + 5 - - 10, 102 - - - True - - - 131, 23 - - - True - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - 452, 20 - - - btnSettings - - - - - - $this - - - NoControl - - - 4 - - - - - - System.Windows.Forms.MaskedTextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 1 - - - CUE Sheet Creator... - - - 50, 17 - - - 2 - - - grpAccurateRip - - - &Stop - - - Wav&Pack - - - 123, 17 - - - NoControl - - - 2 - - - &Manual - - - 8, 4 - - - - - - grpOutputStyle - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - rbSingleFile - - - - - - Create multiple files with gaps left out - - - 5 - - - System.Windows.Forms.StatusStrip, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 2 - - - Tahoma, 8.25pt - - - &Output: - - - 8, 52 - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - - grpOutputPathGeneration - - - 10, 66 - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 92, 164 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 2 - - - 5 - - - Track progress - - - True - - - 5 - - - APE - - - Filename Corrector... - - - 104, 17 - - - grpOutputPathGeneration - - - 10, 34 - - - Not used for normal music CDs. Enhanced CDs with data tracks cannot be found in database unless you know the length of the data track. You can often find it in EAC log. If EAC log is found next to the CUE sheet, it will be parsed automaticly and you won't have to enter anything here. - - - 0 - - - 162, 164 - - - - - - False - - - 69, 17 - - - True - - - grpOutputPathGeneration - - - 1 - - - grpAudioOutput - - - 1 - - - 13 - - - $this - - - About - - - lblOutput - - - grpOutputStyle - &Go - - txtInputPath + + btnConvert - - 44, 17 - - - 412, 339 - - - Freedb lookup - - - Always - - - 0, 378 - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 2 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 1 - - - AccurateRip - - - 412, 215 - - - grpOutputStyle - - - btnCUECreator - - - 44, 17 - - - 8, 211 - - - 10, 71 - - - rbFreedbAlways - - - &Single File + CUE - - - 10, 89 - - - 5 - - - 131, 86 - - - - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 0 - - - C&reate subdirectory: - - - Browse... - - - - - - 2 - - - 4 - - + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 166, 18 - - - 0 - - - 412, 339 - - - 125, 17 - - - grpAudioOutput - - - txtCustomFormat - - - 412, 308 - - + $this - - 45, 13 + + 15 - - 66, 23 + + btnBrowseOutput - + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpCUEPaths + + + 0 + + + btnBrowseInput + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpCUEPaths + + 1 - - grpOutputPathGeneration + + lblOutput - - statusStrip1 + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 412, 92 + + grpCUEPaths - - + + 2 - - + + lblInput - - System.Windows.Forms.ToolStripProgressBar, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 120, 17 + + grpCUEPaths - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - rbWAV - - - Create single file + CUE sheet - - - - - - 10, 20 - - - 92, 17 - - - 6 - - - 1 - - - 131, 23 - - - 8, 92 - - - Disk progress - - - TTA - - - True - - - grpAccurateRip - - - True - - - &FLAC - - - Output Path - - - - - - True - - - - - - 0 - - - 106, 17 - - - 72, 17 - - - 59, 22 - - - - - - $this - - - 0 - - - grpAudioOutput - - - rbFreedbIf - - - True - - - Create multiple files with gaps appended - - - New - - - - - - 6 - - - 5 - - - - - - 54, 17 - - - 140, 16 - - - - - - $this + + 3 txtOutputPath - - 6 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 166, 39 - - - txtAppendFilename - - - True - - - 477, 339 - - - Contact the AccurateRip databse for validation and compare the image against database - - - 11, 87 - - - System.Windows.Forms.ToolStripProgressBar, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 140, 16 - - - System.Windows.Forms.ToolTip, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - - - - - 4 - - - 6, 53 - - - 1 - - - grpOutputStyle - - - True - - - 6, 13 - - - grpAccurateRip - - - 10, 68 - System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 grpCUEPaths - - 7, 141 - - - True - - - 0 - - - -New - - - - - - 122, 17 - - - 6, 141 - - - 11, 19 - - - label1 - - - rbTTA - - - 10, 43 - - - 7 - - - 10, 54 - - - 253, 17 - - - Data track: - - - &Resume - - - 76, 17 - - - 8 - - - Don't create any audio files, only CUE sheet - - - - - - grpAudioOutput - - - 1 - - - - - - 2 - - - 13 - - - grpAccurateRip - - - 226, 21 - - - rbCustomFormat - - - 61, 13 - - - grpAccurateRip - - - Audio Output - - - rbFreedbNever - - - 128, 164 - - - rbAppendFilename - - - Create multiple files with gaps prepended - - - 2 - - - Use custom format: - - - System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 37, 13 - - - 3 - - - 3 - - - statusStrip1 - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - On the first pass, verify and try to find an offset correction which makes the rip accurate according to the AccurateRip database. On the second pass, convert, possibly applying offset correction. - - - System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - - - &Verify, don't encode - - - 6, 36 - - + 4 - - 10, 20 + + txtInputPath - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 166, 60 - - - grpOutputStyle - - - CUE Style - - - 131, 23 - - - rbArApplyOffset - - - $this - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - - - True - - - grpCUEPaths - - - rbArNone - - - 101, 17 - - - 10, 37 - - - 0 - - - 1 - - - 11 - - + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 0 - - - grpOutputPathGeneration - - - 8 - - - 11, 53 - - - grpCUEPaths - - - 3 - - - grpAudioOutput - - - CUE Tools - grpCUEPaths - - $this - - - $this - - - toolStripProgressBar2 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - + 5 - - True + + 8, 4 - - 385, 21 + + 535, 84 - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - &Embedded - - - 6 - - - 2 - - - 10, 17 - - - 4 - - - toolStripProgressBar1 - - - - - - Never - - - 131, 23 - - - 2 - - - 11, 70 - - - True - - - - - - 75, 17 - - + 0 - - 3 + + CUE Paths - - 5 - - - MiddleLeft - - - - - - 48, 17 - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Don't contact the AccurateRip database for validation - - - Gaps Prepended - - - &Input: - - - 1 - - - toolStripStatusLabel1 - - - Gaps &Appended - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 10 - - + grpCUEPaths - - 119, 17 - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 131, 23 - - - 11, 36 - - - &Don't verify, encode - - - 412, 246 - - - 71, 23 - - - rbArAndEncode - - - 4 - - - 50, 17 - - - rbNoAudio - - - 4 - - - True - - - btnBatch - - - grpCUEPaths - - - rbFLAC - - - $this - - - 112, 17 - - - grpAudioOutput - - - $this - - - 6, 19 - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - - 12 - - - 12 - - - 9 + + $this 14 - - rbCreateSubdirectory + + 452, 49 - - 477, 339 + + 71, 23 - + + 5 + + + Browse... + + + btnBrowseOutput + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpCUEPaths + + + 0 + + + 452, 20 + + + 71, 23 + + + 2 + + + Browse... + + + btnBrowseInput + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpCUEPaths + + + 1 + + True - - 108, 211 + + 8, 52 - + + 45, 13 + + 3 - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + &Output: - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + lblOutput - - 59, 17 + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - txtDataTrackLength + + grpCUEPaths - - 10, 85 + + 2 - - groupBox1 + + True - - + + 8, 24 + + + 37, 13 + + + 0 + + + &Input: + + + lblInput + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpCUEPaths + + + 3 59, 48 - - System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 385, 21 + + + 4 + + + txtOutputPath + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpCUEPaths + + + 4 + + + 59, 22 + + + 385, 21 + + + 1 + + + txtInputPath + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpCUEPaths + + + 5 + + + rbEmbedCUE + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpOutputStyle + + + 0 + + + rbGapsLeftOut + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpOutputStyle + + + 1 + + + rbGapsPrepended + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpOutputStyle + + + 2 + + + rbGapsAppended + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpOutputStyle + + + 3 + + + rbSingleFile + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpOutputStyle + + + 4 + + + 108, 211 + + + 128, 164 + + + 3 + + + CUE Style + + + grpOutputStyle + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 13 153, 8 - + True - + + + + NoControl + + + 11, 19 + + + 75, 17 + + + 0 + + + &Embedded + + + Create single file with embedded CUE sheet. + + + rbEmbedCUE + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpOutputStyle + + + 0 + + + True + + + 11, 87 + + + 92, 17 + + + 4 + + + Gaps Left Out + + + Create multiple files with gaps left out + + + rbGapsLeftOut + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpOutputStyle + + + 1 + + + True + + + 11, 70 + + + 104, 17 + + + 3 + + + Gaps Prepended + + + Create multiple files with gaps prepended + + + rbGapsPrepended + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpOutputStyle + + + 2 + + + True + + + 11, 53 + + + 101, 17 + + + 2 + + + Gaps &Appended + + + Create multiple files with gaps appended + + + rbGapsAppended + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpOutputStyle + + + 3 + + + True + + + 11, 36 + + + 106, 17 + + + 1 + + + &Single File + CUE + + + Create single file + CUE sheet + + + rbSingleFile + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpOutputStyle + + + 4 + + + 412, 184 + + + 131, 23 + + + 10 + + + About + + + btnAbout + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 12 + + + txtCustomFormat + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpOutputPathGeneration + + + 0 + + + rbCustomFormat + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpOutputPathGeneration + + + 1 + + + txtCreateSubdirectory + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpOutputPathGeneration + + + 2 + + + rbDontGenerate + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpOutputPathGeneration + + + 3 + + + rbCreateSubdirectory + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpOutputPathGeneration + + + 4 + + + rbAppendFilename + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpOutputPathGeneration + + + 5 + + + txtAppendFilename + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpOutputPathGeneration + + + 6 + + + 8, 92 + + + 398, 115 + + + 1 + + + Output Path + + + grpOutputPathGeneration + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 11 + + + 166, 60 + + + 226, 21 + + + 5 + + + %1:-2\New\%-1\%F.cue + + + txtCustomFormat + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpOutputPathGeneration + + + 0 + + + True + + + 10, 66 + + + 119, 17 + + + 4 + + + Use custom format: + + + rbCustomFormat + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpOutputPathGeneration + + + 1 + + + 166, 18 + + + 226, 21 + + + 1 + + + New + + + txtCreateSubdirectory + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpOutputPathGeneration + + + 2 + + + True + + + 10, 89 + + + 59, 17 + + + 6 + + + &Manual + + + rbDontGenerate + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpOutputPathGeneration + + + 3 + + + True + + + 10, 20 + + + 125, 17 + + + 0 + + + C&reate subdirectory: + + + rbCreateSubdirectory + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpOutputPathGeneration + + + 4 + + + True + + + 10, 43 + + + 122, 17 + + + 2 + + + Append to filename: + + + rbAppendFilename + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpOutputPathGeneration + + + 5 + + + 166, 39 + + + 226, 21 + + + 3 + + + -New + + + txtAppendFilename + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpOutputPathGeneration + + + 6 + + + True + + + 10, 119 + + + 47, 17 + + + 7 + + + User + + + rbUDC1 + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpAudioOutput + + + 0 + + + True + + + 10, 68 + + + 44, 17 + + + 6 + + + TTA + + + rbTTA + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpAudioOutput + + + 1 + + + True + + + 6, 141 + + + 76, 17 + + + 5 + + + LossyWAV + + + Create a pair of files - .lossy.wav(flac,etc) and .lwcdf.wav(flac,etc). Lossy file contains (lossy) compressed music, but together with the lwcdf (correction) file the original audio can be reconstructed. + + + chkLossyWAV + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpAudioOutput + + + 2 + + + True + + + 10, 51 + + + 44, 17 + + + 2 + + + APE + + + rbAPE + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpAudioOutput + + + 3 + + + True + + + 10, 102 + + + 50, 17 + + + 4 + + + &None + + + Don't create any audio files, only CUE sheet + + + rbNoAudio + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpAudioOutput + + + 4 + + + True + + + 10, 34 + + + 69, 17 + + + 1 + + + Wav&Pack + + + rbWavPack + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpAudioOutput + + + 5 + + + True + + + 10, 85 + + + 48, 17 + + + 3 + + + &WAV + + + rbWAV + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpAudioOutput + + + 6 + + + True + + + 10, 17 + + + 50, 17 + + + 0 + + + &FLAC + + + rbFLAC + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpAudioOutput + + + 7 + + + 8, 211 + + + 92, 164 + + + 2 + + + Audio Output + + + grpAudioOutput + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 10 + + + 412, 308 + + + 131, 23 + + + 6 + + + Batch... + + + btnBatch + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 9 + + + 412, 277 + + + 131, 23 + + + 7 + + + Filename Corrector... + + + btnFilenameCorrector + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 8 + + + 412, 215 + + + 131, 23 + + + 9 + + + Advanced Settings... + + + btnSettings + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 7 + + + rbArAndEncode + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpAccurateRip + + + 0 + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpAccurateRip + + + 1 + + + txtDataTrackLength + + + System.Windows.Forms.MaskedTextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpAccurateRip + + + 2 + + + rbArApplyOffset + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpAccurateRip + + + 3 + + + rbArVerify + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpAccurateRip + + + 4 + + + rbArNone + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpAccurateRip + + + 5 + + + 244, 211 + + + 162, 164 + + + 4 + + + AccurateRip + + + grpAccurateRip + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 6 + + + True + + + 10, 37 + + + 112, 17 + + + 5 + + + Encode and verify + + + rbArAndEncode + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpAccurateRip + + + 0 + + + True + + + 7, 141 + + + 61, 13 + + + 3 + + + Data track: + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpAccurateRip + + + 1 + + + 77, 138 + + + 00:00:00 + + + 0 + + + 54, 21 + + + 4 + + + Not used for normal music CDs. Enhanced CDs with data tracks cannot be found in database unless you know the length of the data track. You can often find it in EAC log. If EAC log is found next to the CUE sheet, it will be parsed automaticly and you won't have to enter anything here. + + + txtDataTrackLength + + + System.Windows.Forms.MaskedTextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpAccurateRip + + + 2 + + + True + + + 10, 20 + + + 120, 17 + + + 0 + + + Verify, &then encode + + + On the first pass, verify and try to find an offset correction which makes the rip accurate according to the AccurateRip database. On the second pass, convert, possibly applying offset correction. + + + rbArApplyOffset + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpAccurateRip + + + 3 + + + True + + + 10, 71 + + + 122, 17 + + + 2 + + + &Verify, don't encode + + + Contact the AccurateRip databse for validation and compare the image against database + + + rbArVerify + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpAccurateRip + + + 4 + + + True + + + 10, 54 + + + 123, 17 + + + 1 + + + &Don't verify, encode + + + Don't contact the AccurateRip database for validation + + + rbArNone + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpAccurateRip + + + 5 + 0, 378 + + 0, 378 + + + 552, 22 + + + 11 + + + statusStrip1 + + + statusStrip1 + + + System.Windows.Forms.StatusStrip, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 5 + + + 253, 17 + + + MiddleLeft + + + 140, 16 + + + Track progress + + + 140, 16 + + + Disk progress + + + 153, 8 + + + NoControl + + + 412, 246 + + + 131, 23 + + + 8 + + + CUE Sheet Creator... + + + btnCUECreator + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 4 + + + NoControl + + + 412, 339 + + + 66, 23 + + + 12 + + + &Stop + + + False + + + btnStop + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 3 + + + NoControl + + + 477, 339 + + + 66, 23 + + + 13 + + + &Pause + + + False + + + btnPause + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + NoControl + + + 477, 339 + + + 66, 23 + + + 14 + + + &Resume + + + False + + + btnResume + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + rbFreedbAlways + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 0 + + + rbFreedbIf + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 1 + + + rbFreedbNever + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 2 + + + 412, 92 + + + 131, 86 + + + 15 + + + Freedb lookup + + + groupBox1 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 53 + + + 59, 17 + + + 2 + + + Always + + + rbFreedbAlways + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 0 + + + True + + + 6, 36 + + + 72, 17 + + + 1 + + + If needed + + + rbFreedbIf + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 1 + + + True + + + 6, 19 + + + 54, 17 + + + 0 + + + Never + + + rbFreedbNever + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 2 + + + True + + + 6, 13 + + + 552, 400 + + + Tahoma, 8.25pt + + + CenterScreen + + + CUE Tools + + + toolStripStatusLabel1 + + + System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + toolStripProgressBar1 + + + System.Windows.Forms.ToolStripProgressBar, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + toolStripProgressBar2 + + + System.Windows.Forms.ToolStripProgressBar, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + toolTip1 + + + System.Windows.Forms.ToolTip, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + frmCUETools + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + \ No newline at end of file diff --git a/CUETools/frmSettings.Designer.cs b/CUETools/frmSettings.Designer.cs index b473f3e..ab1385e 100644 --- a/CUETools/frmSettings.Designer.cs +++ b/CUETools/frmSettings.Designer.cs @@ -27,6 +27,7 @@ namespace JDP { System.Windows.Forms.Button btnCancel; System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmSettings)); this.grpGeneral = new System.Windows.Forms.GroupBox(); + this.chkOverwriteTags = new System.Windows.Forms.CheckBox(); this.chkExtractLog = new System.Windows.Forms.CheckBox(); this.chkReducePriority = new System.Windows.Forms.CheckBox(); this.chkTruncateExtra4206Samples = new System.Windows.Forms.CheckBox(); @@ -38,12 +39,10 @@ namespace JDP { this.chkAutoCorrectFilenames = new System.Windows.Forms.CheckBox(); this.chkPreserveHTOA = new System.Windows.Forms.CheckBox(); this.lblWriteOffset = new System.Windows.Forms.Label(); - this.grpFLAC = new System.Windows.Forms.GroupBox(); this.numericFLACCompressionLevel = new System.Windows.Forms.NumericUpDown(); this.lblFLACCompressionLevel = new System.Windows.Forms.Label(); this.chkFLACVerify = new System.Windows.Forms.CheckBox(); this.btnOK = new System.Windows.Forms.Button(); - this.grpWavPack = new System.Windows.Forms.GroupBox(); this.chkWVStoreMD5 = new System.Windows.Forms.CheckBox(); this.numWVExtraMode = new System.Windows.Forms.NumericUpDown(); this.chkWVExtraMode = new System.Windows.Forms.CheckBox(); @@ -81,7 +80,6 @@ namespace JDP { this.lblTrackFilenameFormat = new System.Windows.Forms.Label(); this.lblSingleFilenameFormat = new System.Windows.Forms.Label(); this.txtSingleFilenameFormat = new System.Windows.Forms.TextBox(); - this.groupBox2 = new System.Windows.Forms.GroupBox(); this.rbAPEinsane = new System.Windows.Forms.RadioButton(); this.rbAPEextrahigh = new System.Windows.Forms.RadioButton(); this.rbAPEhigh = new System.Windows.Forms.RadioButton(); @@ -93,19 +91,32 @@ namespace JDP { this.groupBox3 = new System.Windows.Forms.GroupBox(); this.chkWriteARLogOnVerify = new System.Windows.Forms.CheckBox(); this.tabPage3 = new System.Windows.Forms.TabPage(); - this.groupBox4 = new System.Windows.Forms.GroupBox(); - this.numericLossyWAVQuality = new System.Windows.Forms.NumericUpDown(); + this.tabControl2 = new System.Windows.Forms.TabControl(); + this.tabPage5 = new System.Windows.Forms.TabPage(); + this.tabPage6 = new System.Windows.Forms.TabPage(); + this.tabPage7 = new System.Windows.Forms.TabPage(); + this.tabPage8 = new System.Windows.Forms.TabPage(); this.label1 = new System.Windows.Forms.Label(); + this.numericLossyWAVQuality = new System.Windows.Forms.NumericUpDown(); this.tabPage4 = new System.Windows.Forms.TabPage(); this.grpHDCD = new System.Windows.Forms.GroupBox(); this.chkHDCDDetect = new System.Windows.Forms.CheckBox(); - this.chkOverwriteTags = new System.Windows.Forms.CheckBox(); + this.tabPage9 = new System.Windows.Forms.TabPage(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.textUDC1Extension = new System.Windows.Forms.TextBox(); + this.textUDC1Decoder = new System.Windows.Forms.TextBox(); + this.textUDC1Params = new System.Windows.Forms.TextBox(); + this.textUDC1Encoder = new System.Windows.Forms.TextBox(); + this.textUDC1EncParams = new System.Windows.Forms.TextBox(); + this.label5 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.chkUDC1APEv2 = new System.Windows.Forms.CheckBox(); btnCancel = new System.Windows.Forms.Button(); this.grpGeneral.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericWriteOffset)).BeginInit(); - this.grpFLAC.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericFLACCompressionLevel)).BeginInit(); - this.grpWavPack.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numWVExtraMode)).BeginInit(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numEncodeWhenPercent)).BeginInit(); @@ -113,16 +124,20 @@ namespace JDP { ((System.ComponentModel.ISupportInitialize)(this.numFixWhenConfidence)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numFixWhenPercent)).BeginInit(); this.grpAudioFilenames.SuspendLayout(); - this.groupBox2.SuspendLayout(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); this.tabPage2.SuspendLayout(); this.groupBox3.SuspendLayout(); this.tabPage3.SuspendLayout(); - this.groupBox4.SuspendLayout(); + this.tabControl2.SuspendLayout(); + this.tabPage5.SuspendLayout(); + this.tabPage6.SuspendLayout(); + this.tabPage7.SuspendLayout(); + this.tabPage8.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericLossyWAVQuality)).BeginInit(); this.tabPage4.SuspendLayout(); this.grpHDCD.SuspendLayout(); + this.tabPage9.SuspendLayout(); this.SuspendLayout(); // // btnCancel @@ -150,6 +165,12 @@ namespace JDP { this.grpGeneral.Name = "grpGeneral"; this.grpGeneral.TabStop = false; // + // chkOverwriteTags + // + resources.ApplyResources(this.chkOverwriteTags, "chkOverwriteTags"); + this.chkOverwriteTags.Name = "chkOverwriteTags"; + this.chkOverwriteTags.UseVisualStyleBackColor = true; + // // chkExtractLog // resources.ApplyResources(this.chkExtractLog, "chkExtractLog"); @@ -228,15 +249,6 @@ namespace JDP { resources.ApplyResources(this.lblWriteOffset, "lblWriteOffset"); this.lblWriteOffset.Name = "lblWriteOffset"; // - // grpFLAC - // - this.grpFLAC.Controls.Add(this.numericFLACCompressionLevel); - this.grpFLAC.Controls.Add(this.lblFLACCompressionLevel); - this.grpFLAC.Controls.Add(this.chkFLACVerify); - resources.ApplyResources(this.grpFLAC, "grpFLAC"); - this.grpFLAC.Name = "grpFLAC"; - this.grpFLAC.TabStop = false; - // // numericFLACCompressionLevel // resources.ApplyResources(this.numericFLACCompressionLevel, "numericFLACCompressionLevel"); @@ -271,19 +283,6 @@ namespace JDP { this.btnOK.UseVisualStyleBackColor = true; this.btnOK.Click += new System.EventHandler(this.btnOK_Click); // - // grpWavPack - // - this.grpWavPack.Controls.Add(this.chkWVStoreMD5); - this.grpWavPack.Controls.Add(this.numWVExtraMode); - this.grpWavPack.Controls.Add(this.chkWVExtraMode); - this.grpWavPack.Controls.Add(this.rbWVVeryHigh); - this.grpWavPack.Controls.Add(this.rbWVHigh); - this.grpWavPack.Controls.Add(this.rbWVNormal); - this.grpWavPack.Controls.Add(this.rbWVFast); - resources.ApplyResources(this.grpWavPack, "grpWavPack"); - this.grpWavPack.Name = "grpWavPack"; - this.grpWavPack.TabStop = false; - // // chkWVStoreMD5 // resources.ApplyResources(this.chkWVStoreMD5, "chkWVStoreMD5"); @@ -610,17 +609,6 @@ namespace JDP { resources.ApplyResources(this.txtSingleFilenameFormat, "txtSingleFilenameFormat"); this.txtSingleFilenameFormat.Name = "txtSingleFilenameFormat"; // - // groupBox2 - // - this.groupBox2.Controls.Add(this.rbAPEinsane); - this.groupBox2.Controls.Add(this.rbAPEextrahigh); - this.groupBox2.Controls.Add(this.rbAPEhigh); - this.groupBox2.Controls.Add(this.rbAPEnormal); - this.groupBox2.Controls.Add(this.rbAPEfast); - resources.ApplyResources(this.groupBox2, "groupBox2"); - this.groupBox2.Name = "groupBox2"; - this.groupBox2.TabStop = false; - // // rbAPEinsane // resources.ApplyResources(this.rbAPEinsane, "rbAPEinsane"); @@ -703,20 +691,67 @@ namespace JDP { // tabPage3 // this.tabPage3.BackColor = System.Drawing.SystemColors.Control; - this.tabPage3.Controls.Add(this.groupBox4); - this.tabPage3.Controls.Add(this.grpWavPack); - this.tabPage3.Controls.Add(this.groupBox2); - this.tabPage3.Controls.Add(this.grpFLAC); + this.tabPage3.Controls.Add(this.tabControl2); resources.ApplyResources(this.tabPage3, "tabPage3"); this.tabPage3.Name = "tabPage3"; // - // groupBox4 + // tabControl2 // - this.groupBox4.Controls.Add(this.numericLossyWAVQuality); - this.groupBox4.Controls.Add(this.label1); - resources.ApplyResources(this.groupBox4, "groupBox4"); - this.groupBox4.Name = "groupBox4"; - this.groupBox4.TabStop = false; + this.tabControl2.Controls.Add(this.tabPage5); + this.tabControl2.Controls.Add(this.tabPage6); + this.tabControl2.Controls.Add(this.tabPage7); + this.tabControl2.Controls.Add(this.tabPage8); + this.tabControl2.Controls.Add(this.tabPage9); + resources.ApplyResources(this.tabControl2, "tabControl2"); + this.tabControl2.Multiline = true; + this.tabControl2.Name = "tabControl2"; + this.tabControl2.SelectedIndex = 0; + // + // tabPage5 + // + this.tabPage5.Controls.Add(this.numericFLACCompressionLevel); + this.tabPage5.Controls.Add(this.lblFLACCompressionLevel); + this.tabPage5.Controls.Add(this.chkFLACVerify); + resources.ApplyResources(this.tabPage5, "tabPage5"); + this.tabPage5.Name = "tabPage5"; + this.tabPage5.UseVisualStyleBackColor = true; + // + // tabPage6 + // + this.tabPage6.Controls.Add(this.chkWVStoreMD5); + this.tabPage6.Controls.Add(this.numWVExtraMode); + this.tabPage6.Controls.Add(this.rbWVFast); + this.tabPage6.Controls.Add(this.chkWVExtraMode); + this.tabPage6.Controls.Add(this.rbWVNormal); + this.tabPage6.Controls.Add(this.rbWVVeryHigh); + this.tabPage6.Controls.Add(this.rbWVHigh); + resources.ApplyResources(this.tabPage6, "tabPage6"); + this.tabPage6.Name = "tabPage6"; + this.tabPage6.UseVisualStyleBackColor = true; + // + // tabPage7 + // + this.tabPage7.Controls.Add(this.rbAPEinsane); + this.tabPage7.Controls.Add(this.rbAPEextrahigh); + this.tabPage7.Controls.Add(this.rbAPEfast); + this.tabPage7.Controls.Add(this.rbAPEhigh); + this.tabPage7.Controls.Add(this.rbAPEnormal); + resources.ApplyResources(this.tabPage7, "tabPage7"); + this.tabPage7.Name = "tabPage7"; + this.tabPage7.UseVisualStyleBackColor = true; + // + // tabPage8 + // + this.tabPage8.Controls.Add(this.label1); + this.tabPage8.Controls.Add(this.numericLossyWAVQuality); + resources.ApplyResources(this.tabPage8, "tabPage8"); + this.tabPage8.Name = "tabPage8"; + this.tabPage8.UseVisualStyleBackColor = true; + // + // label1 + // + resources.ApplyResources(this.label1, "label1"); + this.label1.Name = "label1"; // // numericLossyWAVQuality // @@ -732,11 +767,6 @@ namespace JDP { 0, 0, 0}); - // - // label1 - // - resources.ApplyResources(this.label1, "label1"); - this.label1.Name = "label1"; // // tabPage4 // @@ -763,11 +793,78 @@ namespace JDP { this.chkHDCDDetect.UseVisualStyleBackColor = true; this.chkHDCDDetect.CheckedChanged += new System.EventHandler(this.chkHDCDDetect_CheckedChanged); // - // chkOverwriteTags + // tabPage9 // - resources.ApplyResources(this.chkOverwriteTags, "chkOverwriteTags"); - this.chkOverwriteTags.Name = "chkOverwriteTags"; - this.chkOverwriteTags.UseVisualStyleBackColor = true; + this.tabPage9.Controls.Add(this.chkUDC1APEv2); + this.tabPage9.Controls.Add(this.label6); + this.tabPage9.Controls.Add(this.label5); + this.tabPage9.Controls.Add(this.textUDC1EncParams); + this.tabPage9.Controls.Add(this.textUDC1Encoder); + this.tabPage9.Controls.Add(this.textUDC1Params); + this.tabPage9.Controls.Add(this.textUDC1Decoder); + this.tabPage9.Controls.Add(this.textUDC1Extension); + this.tabPage9.Controls.Add(this.label4); + this.tabPage9.Controls.Add(this.label3); + this.tabPage9.Controls.Add(this.label2); + resources.ApplyResources(this.tabPage9, "tabPage9"); + this.tabPage9.Name = "tabPage9"; + this.tabPage9.UseVisualStyleBackColor = true; + // + // label2 + // + resources.ApplyResources(this.label2, "label2"); + this.label2.Name = "label2"; + // + // label3 + // + resources.ApplyResources(this.label3, "label3"); + this.label3.Name = "label3"; + // + // label4 + // + resources.ApplyResources(this.label4, "label4"); + this.label4.Name = "label4"; + // + // textUDC1Extension + // + resources.ApplyResources(this.textUDC1Extension, "textUDC1Extension"); + this.textUDC1Extension.Name = "textUDC1Extension"; + // + // textUDC1Decoder + // + resources.ApplyResources(this.textUDC1Decoder, "textUDC1Decoder"); + this.textUDC1Decoder.Name = "textUDC1Decoder"; + // + // textUDC1Params + // + resources.ApplyResources(this.textUDC1Params, "textUDC1Params"); + this.textUDC1Params.Name = "textUDC1Params"; + // + // textUDC1Encoder + // + resources.ApplyResources(this.textUDC1Encoder, "textUDC1Encoder"); + this.textUDC1Encoder.Name = "textUDC1Encoder"; + // + // textUDC1EncParams + // + resources.ApplyResources(this.textUDC1EncParams, "textUDC1EncParams"); + this.textUDC1EncParams.Name = "textUDC1EncParams"; + // + // label5 + // + resources.ApplyResources(this.label5, "label5"); + this.label5.Name = "label5"; + // + // label6 + // + resources.ApplyResources(this.label6, "label6"); + this.label6.Name = "label6"; + // + // chkUDC1APEv2 + // + resources.ApplyResources(this.chkUDC1APEv2, "chkUDC1APEv2"); + this.chkUDC1APEv2.Name = "chkUDC1APEv2"; + this.chkUDC1APEv2.UseVisualStyleBackColor = true; // // frmSettings // @@ -784,17 +881,12 @@ namespace JDP { this.MinimizeBox = false; this.Name = "frmSettings"; this.ShowIcon = false; - this.ShowInTaskbar = false; this.Load += new System.EventHandler(this.frmSettings_Load); this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmSettings_FormClosing); this.grpGeneral.ResumeLayout(false); this.grpGeneral.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericWriteOffset)).EndInit(); - this.grpFLAC.ResumeLayout(false); - this.grpFLAC.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericFLACCompressionLevel)).EndInit(); - this.grpWavPack.ResumeLayout(false); - this.grpWavPack.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.numWVExtraMode)).EndInit(); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); @@ -804,21 +896,28 @@ namespace JDP { ((System.ComponentModel.ISupportInitialize)(this.numFixWhenPercent)).EndInit(); this.grpAudioFilenames.ResumeLayout(false); this.grpAudioFilenames.PerformLayout(); - this.groupBox2.ResumeLayout(false); - this.groupBox2.PerformLayout(); this.tabControl1.ResumeLayout(false); this.tabPage1.ResumeLayout(false); this.tabPage2.ResumeLayout(false); this.groupBox3.ResumeLayout(false); this.groupBox3.PerformLayout(); this.tabPage3.ResumeLayout(false); - this.groupBox4.ResumeLayout(false); - this.groupBox4.PerformLayout(); + this.tabControl2.ResumeLayout(false); + this.tabPage5.ResumeLayout(false); + this.tabPage5.PerformLayout(); + this.tabPage6.ResumeLayout(false); + this.tabPage6.PerformLayout(); + this.tabPage7.ResumeLayout(false); + this.tabPage7.PerformLayout(); + this.tabPage8.ResumeLayout(false); + this.tabPage8.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericLossyWAVQuality)).EndInit(); this.tabPage4.ResumeLayout(false); this.tabPage4.PerformLayout(); this.grpHDCD.ResumeLayout(false); this.grpHDCD.PerformLayout(); + this.tabPage9.ResumeLayout(false); + this.tabPage9.PerformLayout(); this.ResumeLayout(false); } @@ -828,11 +927,9 @@ namespace JDP { private System.Windows.Forms.GroupBox grpGeneral; private System.Windows.Forms.CheckBox chkPreserveHTOA; private System.Windows.Forms.Label lblWriteOffset; - private System.Windows.Forms.GroupBox grpFLAC; private System.Windows.Forms.Label lblFLACCompressionLevel; private System.Windows.Forms.CheckBox chkFLACVerify; private System.Windows.Forms.Button btnOK; - private System.Windows.Forms.GroupBox grpWavPack; private System.Windows.Forms.RadioButton rbWVVeryHigh; private System.Windows.Forms.RadioButton rbWVHigh; private System.Windows.Forms.RadioButton rbWVNormal; @@ -868,7 +965,6 @@ namespace JDP { private System.Windows.Forms.CheckBox chkEmbedLog; private System.Windows.Forms.CheckBox chkFillUpCUE; private System.Windows.Forms.CheckBox chkFilenamesANSISafe; - private System.Windows.Forms.GroupBox groupBox2; private System.Windows.Forms.RadioButton rbAPEinsane; private System.Windows.Forms.RadioButton rbAPEextrahigh; private System.Windows.Forms.RadioButton rbAPEhigh; @@ -892,13 +988,29 @@ namespace JDP { private System.Windows.Forms.CheckBox chkCreateCUEFileWhenEmbedded; private System.Windows.Forms.CheckBox chkTruncateExtra4206Samples; private System.Windows.Forms.CheckBox chkReducePriority; - private System.Windows.Forms.GroupBox groupBox4; private System.Windows.Forms.NumericUpDown numericLossyWAVQuality; private System.Windows.Forms.Label label1; private System.Windows.Forms.CheckBox chkHDCDLW16; private System.Windows.Forms.CheckBox chkHDCD24bit; private System.Windows.Forms.CheckBox chkExtractLog; private System.Windows.Forms.CheckBox chkOverwriteTags; + private System.Windows.Forms.TabControl tabControl2; + private System.Windows.Forms.TabPage tabPage5; + private System.Windows.Forms.TabPage tabPage6; + private System.Windows.Forms.TabPage tabPage7; + private System.Windows.Forms.TabPage tabPage8; + private System.Windows.Forms.TabPage tabPage9; + private System.Windows.Forms.TextBox textUDC1Params; + private System.Windows.Forms.TextBox textUDC1Decoder; + private System.Windows.Forms.TextBox textUDC1Extension; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.TextBox textUDC1EncParams; + private System.Windows.Forms.TextBox textUDC1Encoder; + private System.Windows.Forms.CheckBox chkUDC1APEv2; } } \ No newline at end of file diff --git a/CUETools/frmSettings.cs b/CUETools/frmSettings.cs index 8a9aa23..fcd8d0b 100644 --- a/CUETools/frmSettings.cs +++ b/CUETools/frmSettings.cs @@ -70,6 +70,12 @@ namespace JDP { chkHDCD24bit.Checked = _config.decodeHDCDto24bit; chkOverwriteTags.Checked = _config.overwriteCUEData; + textUDC1Extension.Text = _config.udc1Extension; + textUDC1Decoder.Text = _config.udc1Decoder; + textUDC1Params.Text = _config.udc1Params; + textUDC1Encoder.Text = _config.udc1Encoder; + textUDC1EncParams.Text = _config.udc1EncParams; + chkUDC1APEv2.Checked = _config.udc1APEv2; EnableDisable(); } @@ -147,6 +153,13 @@ namespace JDP { _config.decodeHDCDtoLW16 = chkHDCDLW16.Checked; _config.decodeHDCDto24bit = chkHDCD24bit.Checked; _config.overwriteCUEData = chkOverwriteTags.Checked; + + _config.udc1Extension = textUDC1Extension.Text; + _config.udc1Decoder = textUDC1Decoder.Text; + _config.udc1Params = textUDC1Params.Text; + _config.udc1Encoder = textUDC1Encoder.Text; + _config.udc1EncParams = textUDC1EncParams.Text; + _config.udc1APEv2 = chkUDC1APEv2.Checked; } private void EnableDisable() diff --git a/CUETools/frmSettings.resx b/CUETools/frmSettings.resx index 211d9cd..5b32b31 100644 --- a/CUETools/frmSettings.resx +++ b/CUETools/frmSettings.resx @@ -511,7 +511,7 @@ 0 - 112, 37 + 123, 6 36, 21 @@ -529,7 +529,7 @@ System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - grpFLAC + tabPage5 0 @@ -538,7 +538,7 @@ True - 9, 41 + 6, 8 97, 13 @@ -556,7 +556,7 @@ System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - grpFLAC + tabPage5 1 @@ -565,7 +565,7 @@ True - 12, 20 + 9, 37 54, 17 @@ -583,35 +583,11 @@ System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - grpFLAC + tabPage5 2 - - 317, 6 - - - 204, 71 - - - 4 - - - FLAC - - - grpFLAC - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPage3 - - - 3 - 194, 290 @@ -640,7 +616,7 @@ True - 12, 114 + 5, 101 125, 17 @@ -658,13 +634,13 @@ System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - grpWavPack + tabPage6 0 - 103, 91 + 96, 78 36, 21 @@ -682,7 +658,7 @@ System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - grpWavPack + tabPage6 1 @@ -691,7 +667,7 @@ True - 12, 92 + 5, 79 85, 17 @@ -709,16 +685,16 @@ System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - grpWavPack + tabPage6 - 2 + 3 True - 13, 70 + 6, 57 71, 17 @@ -736,16 +712,16 @@ System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - grpWavPack + tabPage6 - 3 + 5 True - 13, 53 + 6, 40 46, 17 @@ -763,16 +739,16 @@ System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - grpWavPack + tabPage6 - 4 + 6 True - 13, 36 + 6, 23 58, 17 @@ -790,16 +766,16 @@ System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - grpWavPack + tabPage6 - 5 + 4 True - 13, 19 + 6, 6 46, 17 @@ -817,34 +793,10 @@ System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - grpWavPack + tabPage6 - 6 - - - 6, 6 - - - 146, 148 - - - 3 - - - WavPack (.wv) - - - grpWavPack - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPage3 - - - 1 + 2 Top, Right @@ -1642,7 +1594,7 @@ True - 13, 88 + 6, 74 58, 17 @@ -1660,7 +1612,7 @@ System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - groupBox2 + tabPage7 0 @@ -1669,7 +1621,7 @@ True - 13, 71 + 6, 57 75, 17 @@ -1687,7 +1639,7 @@ System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - groupBox2 + tabPage7 1 @@ -1696,7 +1648,7 @@ True - 13, 54 + 6, 40 46, 17 @@ -1714,16 +1666,16 @@ System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - groupBox2 + tabPage7 - 2 + 3 True - 13, 37 + 6, 23 58, 17 @@ -1741,16 +1693,16 @@ System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - groupBox2 + tabPage7 - 3 + 4 True - 13, 20 + 6, 6 46, 17 @@ -1768,33 +1720,9 @@ System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - groupBox2 + tabPage7 - 4 - - - 166, 6 - - - 145, 148 - - - 7 - - - Monkey's Audio (.ape) - - - groupBox2 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPage3 - - 2 @@ -1908,30 +1836,87 @@ 1 - - 109, 29 + + 4, 22 - - 36, 21 + + 3, 3, 3, 3 - - 4 + + 512, 223 - - Right - - - numericLossyWAVQuality - - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox4 - - + 0 + + FLAC + + + tabPage5 + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabControl2 + + + 0 + + + 4, 22 + + + 3, 3, 3, 3 + + + 512, 223 + + + 1 + + + WavPack + + + tabPage6 + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabControl2 + + + 1 + + + 4, 22 + + + 3, 3, 3, 3 + + + 512, 223 + + + 2 + + + Monkey's Audio + + + tabPage7 + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabControl2 + + + 2 + True @@ -1939,7 +1924,7 @@ NoControl - 6, 33 + 6, 12 45, 13 @@ -1957,33 +1942,375 @@ System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - groupBox4 + tabPage8 + 0 + + + 98, 10 + + + 36, 21 + + + 4 + + + Right + + + numericLossyWAVQuality + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage8 + + 1 - - 321, 87 + + 4, 22 - - 200, 67 + + 3, 3, 3, 3 - - 8 + + 512, 223 - + + 3 + + LossyWAV - - groupBox4 + + tabPage8 - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + + tabControl2 + + + 3 + + + True + + + 162, 8 + + + 81, 17 + + + 10 + + + APEv2 tags + + + chkUDC1APEv2 + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage9 + + + 0 + + + True + + + 6, 117 + + + 62, 13 + + + 9 + + + Parameters + + + label6 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage9 + + + 1 + + + True + + + 6, 90 + + + 46, 13 + + + 8 + + + Encoder + + + label5 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage9 + + + 2 + + + 89, 114 + + + 417, 21 + + + 7 + + + textUDC1EncParams + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage9 + + + 3 + + + 89, 87 + + + 417, 21 + + + 6 + + + textUDC1Encoder + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage9 + + + 4 + + + 89, 60 + + + 417, 21 + + + 5 + + + textUDC1Params + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage9 + + + 5 + + + 89, 33 + + + 417, 21 + + + 4 + + + textUDC1Decoder + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage9 + + + 6 + + + 89, 6 + + + 67, 21 + + + 3 + + + textUDC1Extension + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage9 + + + 7 + + + True + + + 6, 63 + + + 62, 13 + + + 2 + + + Parameters + + + label4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage9 + + + 8 + + + True + + + 6, 36 + + + 47, 13 + + + 1 + + + Decoder + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage9 + + + 9 + + + True + + + 6, 9 + + + 54, 13 + + + 0 + + + Extension + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPage9 + + + 10 + + + 4, 22 + + + 3, 3, 3, 3 + + + 512, 223 + + + 4 + + + User defined + + + tabPage9 + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabControl2 + + + 4 + + + 6, 6 + + + 520, 249 + + + 9 + + + tabControl2 + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + tabPage3 - + 0 diff --git a/CUETools/frmSettings.ru-RU.resx b/CUETools/frmSettings.ru-RU.resx index 82a2511..c4ead40 100644 --- a/CUETools/frmSettings.ru-RU.resx +++ b/CUETools/frmSettings.ru-RU.resx @@ -120,8 +120,14 @@ Отмена - - Общие + + + + + + + + @@ -130,6 +136,9 @@ Понизить приоритет процесса + + + 202, 17 @@ -145,18 +154,27 @@ Создавать .cue даже при встраивании + + + 166, 17 Создавать плейлисты .m3u + + + 221, 17 Пополнить .cue информацией из тэгов + + + 156, 17 @@ -166,6 +184,9 @@ Работает, если .log лежит в той же папке и имеет то же имя, что и исходный файл + + + 213, 17 @@ -181,68 +202,98 @@ Сохранять HTOA при разбивке на треки + + + 114, 13 Смещение (сэмплов): - - 113, 44 + + - - 9, 46 + + Общие - - 94, 13 + + + + + Уровень сжатия: - - 94, 17 + + Верификация + + + + + + 119, 17 MD5-хеширование + + + + + + 89, 17 Доп. режим: + + + 103, 17 Очень высокий + + + 68, 17 Высокий + + + 69, 17 Средний + + + 70, 17 Быстрый - - Проверить и записать + + 150, 77 @@ -253,6 +304,9 @@ и нулевым смещением + + + 6, 100 @@ -262,6 +316,9 @@ Исправлять смещение если + + + 6, 181 @@ -271,6 +328,9 @@ Записывать отчет AccurateRip + + + 6, 164 @@ -292,9 +352,15 @@ % проверенных треков >= + + + 250, 35 + + + 125, 58 @@ -304,15 +370,24 @@ с достоверностью >= + + + 250, 56 + + + 176, 17 Конвертировать только если + + + Top, Right @@ -330,9 +405,15 @@ с достоверностью >= + + + 251, 137 + + + Top, Right @@ -348,9 +429,21 @@ % проверенных треков >= + + + 250, 116 + + + + + Проверить и записать + + + + 207, 17 @@ -408,27 +501,39 @@ При конвертации в lossyWAV, обрезать до 16 бит - - Имена аудиофайлов - 157, 17 Сохранять оригинальные + + + + + + 223, 17 Удалять специальные символы кроме: + + + 209, 17 Заменять пробелы подчеркиванями + + + + + + 10, 75 @@ -438,26 +543,44 @@ Трек: + + + 75, 13 Образ диска: - - Форматы + + - - Параметры + + - - 120, 17 + + Имена аудиофайлов - - Определять HDCD + + - - При проверке + + + + + + + + + + + + + + + + + 5, 181 @@ -468,13 +591,76 @@ Записывать отчет AccurateRip + + + + + При проверке + + + + + + + + + + + + + + + + 59, 13 Качество: + + + + + + + + + + + + + + Форматы + + + + + + Параметры + + + + + + 120, 17 + + + Определять HDCD + + + + + + + + + + Продвинутые настройки + + + \ No newline at end of file diff --git a/MAC_SDK/Source/MACLib/Assembly/Assembly.obj b/MAC_SDK/Source/MACLib/Assembly/Assembly.obj index d8ff87f..cc5abb6 100644 Binary files a/MAC_SDK/Source/MACLib/Assembly/Assembly.obj and b/MAC_SDK/Source/MACLib/Assembly/Assembly.obj differ diff --git a/flac/examples/c/encode/file/main.c b/flac/examples/c/encode/file/main.c index 3ccf784..db9977c 100644 --- a/flac/examples/c/encode/file/main.c +++ b/flac/examples/c/encode/file/main.c @@ -36,7 +36,7 @@ static void progress_callback(const FLAC__StreamEncoder *encoder, FLAC__uint64 bytes_written, FLAC__uint64 samples_written, unsigned frames_written, unsigned total_frames_estimate, void *client_data); -#define READSIZE 1024 +#define READSIZE 0x4000 static unsigned total_samples = 0; /* can use a 32-bit number due to WAVE size limitations */ static FLAC__byte buffer[READSIZE/*samples*/ * 2/*bytes_per_sample*/ * 2/*channels*/]; /* we read the WAVE data into here */ @@ -140,7 +140,11 @@ int main(int argc, char *argv[]) pcm[i] = (FLAC__int32)(((FLAC__int16)(FLAC__int8)buffer[2*i+1] << 8) | (FLAC__int16)buffer[2*i]); } /* feed samples to encoder */ - ok = FLAC__stream_encoder_process_interleaved(encoder, pcm, need); + if (!FLAC__stream_encoder_process_interleaved(encoder, pcm, need)) + { + fprintf(stderr, "ERROR: encode\n"); + ok = false; + } } left -= need; } @@ -166,7 +170,7 @@ void progress_callback(const FLAC__StreamEncoder *encoder, FLAC__uint64 bytes_wr (void)encoder, (void)client_data; #ifdef _MSC_VER - fprintf(stderr, "wrote %I64u bytes, %I64u/%u samples, %u/%u frames\n", bytes_written, samples_written, total_samples, frames_written, total_frames_estimate); + //fprintf(stderr, "wrote %I64u bytes, %I64u/%u samples, %u/%u frames\n", bytes_written, samples_written, total_samples, frames_written, total_frames_estimate); #else fprintf(stderr, "wrote %llu bytes, %llu/%u samples, %u/%u frames\n", bytes_written, samples_written, total_samples, frames_written, total_frames_estimate); #endif diff --git a/flac/src/libFLAC/libFLAC_static.vcproj b/flac/src/libFLAC/libFLAC_static.vcproj index e389ca6..701087d 100644 --- a/flac/src/libFLAC/libFLAC_static.vcproj +++ b/flac/src/libFLAC/libFLAC_static.vcproj @@ -108,7 +108,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories=".\include;..\..\include" - PreprocessorDefinitions="WIN32;_DEBUG;_LIB;FLAC__CPU_IA64;FLAC__HAS_NASM;FLAC__USE_3DNOW;VERSION=\"1.2.0\";FLAC__NO_DLL;DEBUG;FLAC__OVERFLOW_DETECT" + PreprocessorDefinitions="WIN32;_DEBUG;_LIB;FLAC__CPU_IA64_NOT;FLAC__HAS_NASM;FLAC__USE_3DNOW;VERSION=\"1.2.0\";FLAC__NO_DLL;DEBUG;FLAC__OVERFLOW_DETECT" MinimalRebuild="false" ExceptionHandling="2" BasicRuntimeChecks="0" @@ -292,11 +292,11 @@ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" > - - - - - - - - - - - - - - @@ -840,6 +794,52 @@ /> + + + + + + + + + + + + + +