diff --git a/APEDotNet/apedotnet.cpp b/APEDotNet/apedotnet.cpp index c5eee73..1a8614d 100644 --- a/APEDotNet/apedotnet.cpp +++ b/APEDotNet/apedotnet.cpp @@ -150,24 +150,16 @@ namespace APEDotNet { sampleCount = nBlocksRetrieved; array^ _sampleBuffer = gcnew array (nBlocksRetrieved, 2); + interior_ptr pMyBuffer = &_sampleBuffer[0, 0]; - { - interior_ptr pMyBuffer = &_sampleBuffer[0, 0]; - unsigned short * pAPEBuffer = (unsigned short *) pBuffer; - unsigned short * pAPEBufferEnd = (unsigned short *) pBuffer + 2 * nBlocksRetrieved; + unsigned short * pAPEBuffer = (unsigned short *) pBuffer; + unsigned short * pAPEBufferEnd = (unsigned short *) pBuffer + 2 * nBlocksRetrieved; + + while (pAPEBuffer < pAPEBufferEnd) { + *(pMyBuffer++) = *(pAPEBuffer++); + *(pMyBuffer++) = *(pAPEBuffer++); + } - while (pAPEBuffer < pAPEBufferEnd) { - *(pMyBuffer++) = *(pAPEBuffer++); - *(pMyBuffer++) = *(pAPEBuffer++); - } - } -#if 0 - for (int i = 0; i < nBlocksRetrieved; i++) - { - _sampleBuffer[i,0] = pBuffer[i*4] + (pBuffer[i*4+1] << 8); - _sampleBuffer[i,1] = pBuffer[i*4+2] + (pBuffer[i*4+3] << 8); - } -#endif sampleBuffer = _sampleBuffer; _sampleOffset += nBlocksRetrieved; _samplesWaiting = false; @@ -209,4 +201,126 @@ namespace APEDotNet { #endif }; + public ref class APEWriter { + public: + APEWriter(String^ path, Int32 bitsPerSample, Int32 channelCount, Int32 sampleRate) { + + if ((channelCount != 1) && (channelCount != 2)) { + throw gcnew Exception("Only stereo and mono audio formats are allowed."); + } + + _path = path; + _tags = gcnew NameValueCollection(); + + _compressionLevel = COMPRESSION_LEVEL_NORMAL; + + _bitsPerSample = bitsPerSample; + _channelCount = channelCount; + _sampleRate = sampleRate; + + int nRetVal; + pAPECompress = CreateIAPECompress (&nRetVal); + if (!pAPECompress) { + throw gcnew Exception("Unable to open file."); + } + } + + void Close() { + if (pAPECompress) + { + pAPECompress->Finish (NULL, 0, 0); + delete pAPECompress; + pAPECompress = NULL; + } + + if ((_finalSampleCount != 0) && (_samplesWritten != _finalSampleCount)) { + throw gcnew Exception("Samples written differs from the expected sample count."); + } + + if (_tags->Count > 0) + { + APETagDotNet^ apeTag = gcnew APETagDotNet (_path, true, false); + apeTag->SetStringTags (_tags, true); + apeTag->Save(); + apeTag->Close(); + _tags->Clear (); + } + } + + property Int32 FinalSampleCount { + Int32 get() { + return _finalSampleCount; + } + void set(Int32 value) { + if (value < 0) { + throw gcnew Exception("Invalid final sample count."); + } + if (_initialized) { + throw gcnew Exception("Final sample count cannot be changed after encoding begins."); + } + _finalSampleCount = value; + } + } + + property Int32 CompressionLevel { + Int32 get() { + return _compressionLevel; + } + void set(Int32 value) { + if ((value < 1) || (value > 5)) { + throw gcnew Exception("Invalid compression mode."); + } + _compressionLevel = value * 1000; + } + } + + void Write(array^ sampleBuffer, UInt32 sampleCount) { + if (!_initialized) Initialize(); + + pin_ptr pSampleBuffer = &sampleBuffer[0]; + + if (pAPECompress->AddData (pSampleBuffer, sampleCount * sizeof (int))) + { + throw gcnew Exception("An error occurred while encoding."); + } + + _samplesWritten += sampleCount; + } + + void SetTags (NameValueCollection^ tags) { + _tags = tags; + } + + private: + IAPECompress * pAPECompress; + bool _initialized; + Int32 _finalSampleCount, _samplesWritten; + Int32 _bitsPerSample, _channelCount, _sampleRate; + Int32 _compressionLevel; + NameValueCollection^ _tags; + String^ _path; + + void Initialize() { + IntPtr pathChars; + int res; + WAVEFORMATEX waveFormat; + + pathChars = Marshal::StringToHGlobalUni(_path); + + FillWaveFormatEx (&waveFormat, _sampleRate, _bitsPerSample, _channelCount); + res = pAPECompress->Start ((const wchar_t*)pathChars.ToPointer(), + &waveFormat, + (_finalSampleCount == 0) ? MAX_AUDIO_BYTES_UNKNOWN : _finalSampleCount * sizeof (int), + _compressionLevel, + NULL, + CREATE_WAV_HEADER_ON_DECOMPRESSION); + Marshal::FreeHGlobal(pathChars); + if (res) + { + throw gcnew Exception("Unable to create the encoder."); + } + + _initialized = true; + } + }; } diff --git a/CUETools/AudioReadWrite.cs b/CUETools/AudioReadWrite.cs index a7f3572..69aadc2 100644 --- a/CUETools/AudioReadWrite.cs +++ b/CUETools/AudioReadWrite.cs @@ -51,6 +51,8 @@ namespace JDP { dest = new FLACWriter(path, bitsPerSample, channelCount, sampleRate); break; case ".wv": dest = new WavPackWriter(path, bitsPerSample, channelCount, sampleRate); break; + case ".ape": + dest = new APEWriter(path, bitsPerSample, channelCount, sampleRate); break; case ".dummy": dest = new DummyWriter(path, bitsPerSample, channelCount, sampleRate); break; default: @@ -708,6 +710,81 @@ namespace JDP { } } + class APEWriter : IAudioDest + { + APEDotNet.APEWriter _apeWriter; + //int[,] _sampleBuffer; + int _bitsPerSample; + int _channelCount; + int _sampleRate; + + public APEWriter(string path, int bitsPerSample, int channelCount, int sampleRate) + { + if (bitsPerSample != 16) + { + throw new Exception("Bits per sample must be 16."); + } + _bitsPerSample = bitsPerSample; + _channelCount = channelCount; + _sampleRate = sampleRate; + _apeWriter = new APEDotNet.APEWriter(path, bitsPerSample, channelCount, sampleRate); + } + + public long FinalSampleCount + { + get { return _apeWriter.FinalSampleCount; } + set { _apeWriter.FinalSampleCount = (int) value; } + } + public int CompressionLevel + { + get { return _apeWriter.CompressionLevel; } + set { _apeWriter.CompressionLevel = value; } + } + public bool SetTags(NameValueCollection tags) + { + _apeWriter.SetTags(tags); + return true; + } + public void Close() + { + _apeWriter.Close(); + } + private unsafe void BytesToAPESamples_16(byte[] inSamples, int inByteOffset, + int[,] outSamples, int outSampleOffset, uint sampleCount, int channelCount) + { + uint loopCount = sampleCount * (uint)channelCount; + + if ((inSamples.Length - inByteOffset < loopCount * 2) || + (outSamples.GetLength(0) - outSampleOffset < sampleCount)) + { + throw new IndexOutOfRangeException(); + } + + fixed (byte* pInSamplesFixed = &inSamples[inByteOffset]) + { + fixed (int* pOutSamplesFixed = &outSamples[outSampleOffset, 0]) + { + short* pInSamples = (short*)pInSamplesFixed; + int* pOutSamples = pOutSamplesFixed; + + for (int i = 0; i < loopCount; i++) + { + *(pOutSamples++) = (int)*(pInSamples++); + } + } + } + } + public void Write(byte[] buff, uint sampleCount) + { + //if ((_sampleBuffer == null) || (_sampleBuffer.GetLength(0) < sampleCount)) + //{ + // _sampleBuffer = new int[sampleCount, _channelCount]; + //} + //BytesToAPESamples_16(buff, 0, _sampleBuffer, 0, sampleCount, _channelCount); + //_apeWriter.Write(_sampleBuffer, (int)sampleCount); + _apeWriter.Write (buff, sampleCount); + } + } class WavPackReader : IAudioSource { WavPackDotNet.WavPackReader _wavPackReader; diff --git a/CUETools/Main.cs b/CUETools/Main.cs index 16173ff..96defe4 100644 --- a/CUETools/Main.cs +++ b/CUETools/Main.cs @@ -34,6 +34,7 @@ namespace JDP { WAV, FLAC, WavPack, + APE, NoAudio } @@ -44,6 +45,7 @@ namespace JDP { { case OutputAudioFormat.FLAC: return ".flac"; case OutputAudioFormat.WavPack: return ".wv"; + case OutputAudioFormat.APE: return ".ape"; case OutputAudioFormat.WAV: return ".wav"; case OutputAudioFormat.NoAudio: return ".dummy"; } @@ -214,8 +216,7 @@ namespace JDP { public string specialExceptions; public bool replaceSpaces; public bool embedLog; - - private string[] _charMap; + public bool fillUpCUE; public CUEConfig() { @@ -237,11 +238,11 @@ namespace JDP { keepOriginalFilenames = true; trackFilenameFormat = "%N-%A-%T"; singleFilenameFormat = "%F"; - removeSpecial = true; + removeSpecial = false; specialExceptions = "-()"; replaceSpaces = true; embedLog = true; - BuildCharMap(); + fillUpCUE = true; } public void Save (SettingsWriter sw) @@ -268,6 +269,7 @@ namespace JDP { sw.Save("SpecialCharactersExceptions", specialExceptions); sw.Save("ReplaceSpaces", replaceSpaces ? "1" : "0"); sw.Save("EmbedLog", embedLog ? "1" : "0"); + sw.Save("FillUpCUE", fillUpCUE ? "1" : "0"); } public void Load(SettingsReader sr) @@ -351,59 +353,30 @@ namespace JDP { val = sr.Load("EmbedLog"); embedLog = (val != null) ? (val != "0") : true; - BuildCharMap(); + val = sr.Load("FillUpCUE"); + fillUpCUE = (val != null) ? (val != "0") : true; } - public void BuildCharMap() - { - System.Collections.BitArray allowed = new System.Collections.BitArray(256, true); - char[] invalid = Path.GetInvalidFileNameChars(); - int i; - - if (removeSpecial) - { - byte[] exceptions = CUESheet.Encoding.GetBytes(specialExceptions); - - for (i = 0; i <= 255; i++) - { - allowed[i] = ((i >= 'a') && (i <= 'z')) || - ((i >= 'A') && (i <= 'Z')) || - ((i >= '0') && (i <= '9')) || - (i == ' ') || (i == '_'); - } - - for (i = 0; i < exceptions.Length; i++) - { - allowed[exceptions[i]] = true; - } - } - - for (i = 0; i < invalid.Length; i++) - { - allowed[invalid[i]] = false; - } - - _charMap = new string[256]; - for (i = 0; i <= 255; i++) - { - if (allowed[i]) - { - _charMap[i] = CUESheet.Encoding.GetString(new byte[] { (byte)i }); - } - else - { - _charMap[i] = String.Empty; - } - } - } public string CleanseString (string s) { StringBuilder sb = new StringBuilder(); - byte[] b = CUESheet.Encoding.GetBytes(s); + char[] invalid = Path.GetInvalidFileNameChars(); - for (int i = 0; i < b.Length; i++) + s = Encoding.Default.GetString(Encoding.Default.GetBytes(s)); + + for (int i = 0; i < s.Length; i++) { - sb.Append(_charMap[b[i]]); + char ch = s[i]; + if (removeSpecial && specialExceptions.IndexOf(ch) < 0 && !( + ((ch >= 'a') && (ch <= 'z')) || + ((ch >= 'A') && (ch <= 'Z')) || + ((ch >= '0') && (ch <= '9')) || + (ch == ' ') || (ch == '_'))) + ch = '_'; + if (Array.IndexOf(invalid, ch) >= 0) + sb.Append("_"); + else + sb.Append (ch); } return sb.ToString(); @@ -473,8 +446,6 @@ namespace JDP { accDisks = new List(); _hasEmbeddedCUESheet = false; - _config.BuildCharMap(); - TextReader sr; if (Path.GetExtension(pathIn).ToLower() != ".cue") @@ -710,18 +681,21 @@ namespace JDP { _albumTags = _tracks[0]._trackTags; _tracks[0]._trackTags = new NameValueCollection(); } - if (General.FindCUELine(_attributes, "PERFORMER") == null && GetCommonTag("ALBUM ARTIST") != null) - General.SetCUELine(_attributes, "PERFORMER", GetCommonTag("ALBUM ARTIST"), true); - if (General.FindCUELine(_attributes, "PERFORMER") == null && GetCommonTag("ARTIST") != null) - General.SetCUELine(_attributes, "PERFORMER", GetCommonTag("ARTIST"), true); - if (General.FindCUELine(_attributes, "TITLE") == null && GetCommonTag("ALBUM") != null) - General.SetCUELine(_attributes, "TITLE", GetCommonTag("ALBUM"), true); - if (General.FindCUELine(_attributes, "REM", "DATE") == null && GetCommonTag("DATE") != null) - General.SetCUELine(_attributes, "REM", "DATE", GetCommonTag("DATE"), false); - if (General.FindCUELine(_attributes, "REM", "DATE") == null && GetCommonTag("YEAR") != null) - General.SetCUELine(_attributes, "REM", "DATE", GetCommonTag("YEAR"), false); - if (General.FindCUELine(_attributes, "REM", "GENRE") == null && GetCommonTag("GENRE") != null) - General.SetCUELine(_attributes, "REM", "GENRE", GetCommonTag("GENRE"), true); + if (_config.fillUpCUE) + { + if (General.FindCUELine(_attributes, "PERFORMER") == null && GetCommonTag("ALBUM ARTIST") != null) + General.SetCUELine(_attributes, "PERFORMER", GetCommonTag("ALBUM ARTIST"), true); + if (General.FindCUELine(_attributes, "PERFORMER") == null && GetCommonTag("ARTIST") != null) + General.SetCUELine(_attributes, "PERFORMER", GetCommonTag("ARTIST"), true); + if (General.FindCUELine(_attributes, "TITLE") == null && GetCommonTag("ALBUM") != null) + General.SetCUELine(_attributes, "TITLE", GetCommonTag("ALBUM"), true); + if (General.FindCUELine(_attributes, "REM", "DATE") == null && GetCommonTag("DATE") != null) + General.SetCUELine(_attributes, "REM", "DATE", GetCommonTag("DATE"), false); + if (General.FindCUELine(_attributes, "REM", "DATE") == null && GetCommonTag("YEAR") != null) + General.SetCUELine(_attributes, "REM", "DATE", GetCommonTag("YEAR"), false); + if (General.FindCUELine(_attributes, "REM", "GENRE") == null && GetCommonTag("GENRE") != null) + General.SetCUELine(_attributes, "REM", "GENRE", GetCommonTag("GENRE"), true); + } if (_accurateRipId == null) _accurateRipId = GetCommonTag("ACCURATERIPID"); @@ -762,7 +736,7 @@ namespace JDP { public static Encoding Encoding { get { - return Encoding.GetEncoding(1252); + return Encoding.Default; } } @@ -932,8 +906,13 @@ namespace JDP { } public void Write(string path, CUEStyle style) { - StreamWriter sw = new StreamWriter(path, false, CUESheet.Encoding); - Write (sw, style); + StringWriter sw = new StringWriter(); + Write(sw, style); + sw.Close(); + bool utf8Required = CUESheet.Encoding.GetString(CUESheet.Encoding.GetBytes(sw.ToString())) != sw.ToString(); + StreamWriter sw1 = new StreamWriter(path, false, utf8Required?Encoding.UTF8:CUESheet.Encoding); + sw1.Write(sw.ToString()); + sw1.Close(); } public void Write(TextWriter sw, CUEStyle style) { @@ -1602,7 +1581,7 @@ namespace JDP { { iDest++; audioDest = GetAudioDest(destPaths[iDest], destLengths[iDest], noOutput); - if (audioDest is FLACWriter || audioDest is WavPackWriter) + if (!(audioDest is WAVWriter)) { NameValueCollection destTags = new NameValueCollection(); diff --git a/CUETools/frmCUETools.Designer.cs b/CUETools/frmCUETools.Designer.cs index 46bbf8b..56f6ba8 100644 --- a/CUETools/frmCUETools.Designer.cs +++ b/CUETools/frmCUETools.Designer.cs @@ -68,6 +68,7 @@ namespace JDP { this.toolStripProgressBar2 = new System.Windows.Forms.ToolStripProgressBar(); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this.btnCUECreator = new System.Windows.Forms.Button(); + this.rbAPE = new System.Windows.Forms.RadioButton(); this.grpCUEPaths.SuspendLayout(); this.grpOutputStyle.SuspendLayout(); this.grpOutputPathGeneration.SuspendLayout(); @@ -256,6 +257,7 @@ namespace JDP { // // grpAudioOutput // + this.grpAudioOutput.Controls.Add(this.rbAPE); this.grpAudioOutput.Controls.Add(this.rbNoAudio); this.grpAudioOutput.Controls.Add(this.rbWavPack); this.grpAudioOutput.Controls.Add(this.rbFLAC); @@ -409,6 +411,14 @@ namespace JDP { this.btnCUECreator.UseVisualStyleBackColor = true; this.btnCUECreator.Click += new System.EventHandler(this.btnCUECreator_Click); // + // rbAPE + // + resources.ApplyResources(this.rbAPE, "rbAPE"); + this.rbAPE.Name = "rbAPE"; + this.rbAPE.TabStop = true; + this.rbAPE.UseVisualStyleBackColor = true; + this.rbAPE.CheckedChanged += new System.EventHandler(this.rbAPE_CheckedChanged); + // // frmCUETools // resources.ApplyResources(this, "$this"); @@ -492,6 +502,7 @@ namespace JDP { private System.Windows.Forms.Button btnCUECreator; private System.Windows.Forms.MaskedTextBox txtDataTrackLength; private System.Windows.Forms.Label label1; + private System.Windows.Forms.RadioButton rbAPE; } } diff --git a/CUETools/frmCUETools.cs b/CUETools/frmCUETools.cs index 061eb2d..5e36b78 100644 --- a/CUETools/frmCUETools.cs +++ b/CUETools/frmCUETools.cs @@ -44,8 +44,8 @@ namespace JDP { OpenFileDialog fileDlg = new OpenFileDialog(); DialogResult dlgRes; - fileDlg.Title = "Input CUE Sheet or FLAC image"; - fileDlg.Filter = "CUE Sheets (*.cue)|*.cue|FLAC images (*.flac)|*.flac"; + fileDlg.Title = "Input CUE Sheet or album image"; + fileDlg.Filter = "CUE Sheets (*.cue)|*.cue|FLAC images (*.flac)|*.flac|WavPack images (*.wv)|*.wv|APE images (*.ape)|*.ape"; dlgRes = fileDlg.ShowDialog(); if (dlgRes == DialogResult.OK) { @@ -113,7 +113,6 @@ namespace JDP { _writeOffset = settingsForm.WriteOffset; _config = settingsForm.Config; - _config.BuildCharMap(); UpdateOutputPath(); } } @@ -124,7 +123,7 @@ namespace JDP { StringWriter sw = new StringWriter(); sw.WriteLine("CUE Tools v1.9.2"); sw.WriteLine("Copyright 2006-2007 Moitah http://www.moitah.net/."); - sw.WriteLine("AccurateRip, Monkey's Audio (APE) input and FLAC embedded CUE sheet support added in 2008 by Greg Chudov, gchudov@gmail.com."); + sw.WriteLine("AccurateRip, Monkey's Audio and embedded CUE sheet support added in 2008 by Greg Chudov, gchudov@gmail.com."); sw.WriteLine("Thanks go out to Christopher Key and Whitehobbit for insight on AccurateRip functionality and to Mr Spoon for permission to use the database."); sw.WriteLine("Monkey's Audio library by Matthew T. Ashland."); reportForm.Message = sw.ToString(); @@ -397,7 +396,7 @@ namespace JDP { btnFilenameCorrector.Enabled = !running; btnCUECreator.Enabled = !running; btnBatch.Enabled = !running; - btnConvert.Text = running ? "&Stop" : "&Convert"; + btnConvert.Text = running ? "&Stop" : "&Go"; toolStripStatusLabel1.Text = String.Empty; toolStripProgressBar1.Value = 0; toolStripProgressBar2.Value = 0; @@ -680,6 +679,7 @@ namespace JDP { get { if (rbFLAC.Checked) return OutputAudioFormat.FLAC; if (rbWavPack.Checked) return OutputAudioFormat.WavPack; + if (rbAPE.Checked) return OutputAudioFormat.APE; if (rbNoAudio.Checked) return OutputAudioFormat.NoAudio; return OutputAudioFormat.WAV; } @@ -687,7 +687,8 @@ namespace JDP { switch (value) { case OutputAudioFormat.FLAC: rbFLAC.Checked = true; break; case OutputAudioFormat.WavPack: rbWavPack.Checked = true; break; - case OutputAudioFormat.WAV: rbWAV.Checked = true; break; + case OutputAudioFormat.APE: rbAPE.Checked = true; break; + case OutputAudioFormat.WAV: rbWAV.Checked = true; break; case OutputAudioFormat.NoAudio: rbNoAudio.Checked = true; break; } } @@ -803,7 +804,7 @@ namespace JDP { private void updateOutputStyles() { - rbEmbedCUE.Enabled = rbFLAC.Checked || rbWavPack.Checked; + rbEmbedCUE.Enabled = rbFLAC.Checked || rbWavPack.Checked || rbAPE.Checked; rbNoAudio.Enabled = rbWAV.Enabled = !rbEmbedCUE.Checked; } @@ -890,6 +891,11 @@ namespace JDP { } } } + + private void rbAPE_CheckedChanged(object sender, EventArgs e) + { + updateOutputStyles(); + } } enum OutputPathGeneration { diff --git a/CUETools/frmCUETools.resx b/CUETools/frmCUETools.resx index e41e1cc..3a357f9 100644 --- a/CUETools/frmCUETools.resx +++ b/CUETools/frmCUETools.resx @@ -129,7 +129,7 @@ 5 - &Convert + &Go btnConvert @@ -383,93 +383,6 @@ 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 - - - 114, 211 - - - 119, 118 - - - 3 - - - CUE Style - - - grpOutputStyle - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 9 - - - 153, 8 - True @@ -481,16 +394,19 @@ 12, 19 - 57, 17 + 75, 17 4 - &Embed + &Embedded + + 153, 8 + - Create single file with embedded CUE sheet. Currently supported only for FLAC output + Create single file with embedded CUE sheet. rbEmbedCUE @@ -624,6 +540,30 @@ 4 + + 114, 211 + + + 119, 118 + + + 3 + + + CUE Style + + + grpOutputStyle + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 9 + 410, 135 @@ -936,6 +876,18 @@ 6 + + rbAPE + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpAudioOutput + + + 0 + rbNoAudio @@ -946,7 +898,7 @@ grpAudioOutput - 0 + 1 rbWavPack @@ -958,7 +910,7 @@ grpAudioOutput - 1 + 2 rbFLAC @@ -970,7 +922,7 @@ grpAudioOutput - 2 + 3 rbWAV @@ -982,7 +934,7 @@ grpAudioOutput - 3 + 4 12, 211 @@ -1012,7 +964,7 @@ True - 12, 71 + 11, 85 50, 17 @@ -1036,13 +988,13 @@ grpAudioOutput - 0 + 1 True - 12, 54 + 11, 34 69, 17 @@ -1063,13 +1015,13 @@ grpAudioOutput - 1 + 2 True - 12, 37 + 11, 17 50, 17 @@ -1090,13 +1042,13 @@ grpAudioOutput - 2 + 3 True - 12, 20 + 11, 68 48, 17 @@ -1117,7 +1069,7 @@ grpAudioOutput - 3 + 4 410, 259 @@ -1191,6 +1143,90 @@ 3 + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpAccurateRip + + + 0 + + + txtDataTrackLength + + + System.Windows.Forms.MaskedTextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpAccurateRip + + + 1 + + + rbArApplyOffset + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpAccurateRip + + + 2 + + + rbArVerify + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpAccurateRip + + + 3 + + + rbArNone + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpAccurateRip + + + 4 + + + 238, 211 + + + 144, 118 + + + 11 + + + AccurateRip + + + grpAccurateRip + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + True @@ -1252,7 +1288,7 @@ True - 11, 52 + 8, 20 120, 17 @@ -1263,9 +1299,6 @@ Verify, &then encode - - 153, 8 - 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. @@ -1285,16 +1318,16 @@ True - 11, 35 + 8, 54 - 53, 17 + 122, 17 1 - &Verify + &Verify, don't encode Contact the AccurateRip databse for validation and compare the image against database @@ -1315,16 +1348,16 @@ True - 11, 18 + 8, 37 - 81, 17 + 123, 17 0 - &Don't verify + &Don't verify, encode Don't contact the AccurateRip database for validation @@ -1341,30 +1374,6 @@ 4 - - 238, 211 - - - 144, 118 - - - 11 - - - AccurateRip - - - grpAccurateRip - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 2 - 0, 339 @@ -1437,6 +1446,33 @@ 0 + + True + + + 11, 51 + + + 44, 17 + + + 7 + + + APE + + + rbAPE + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + grpAudioOutput + + + 0 + True diff --git a/CUETools/frmSettings.Designer.cs b/CUETools/frmSettings.Designer.cs index 1e59a8a..7a0b268 100644 --- a/CUETools/frmSettings.Designer.cs +++ b/CUETools/frmSettings.Designer.cs @@ -26,6 +26,7 @@ namespace JDP { this.components = new System.ComponentModel.Container(); System.Windows.Forms.Button btnCancel; this.grpGeneral = new System.Windows.Forms.GroupBox(); + this.chkEmbedLog = new System.Windows.Forms.CheckBox(); this.numericWriteOffset = new System.Windows.Forms.NumericUpDown(); this.chkAutoCorrectFilenames = new System.Windows.Forms.CheckBox(); this.chkPreserveHTOA = new System.Windows.Forms.CheckBox(); @@ -65,7 +66,7 @@ namespace JDP { this.lblTrackFilenameFormat = new System.Windows.Forms.Label(); this.lblSingleFilenameFormat = new System.Windows.Forms.Label(); this.txtSingleFilenameFormat = new System.Windows.Forms.TextBox(); - this.chkEmbedLog = new System.Windows.Forms.CheckBox(); + this.chkFillUpCUE = new System.Windows.Forms.CheckBox(); btnCancel = new System.Windows.Forms.Button(); this.grpGeneral.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericWriteOffset)).BeginInit(); @@ -93,6 +94,7 @@ namespace JDP { // // grpGeneral // + this.grpGeneral.Controls.Add(this.chkFillUpCUE); this.grpGeneral.Controls.Add(this.chkEmbedLog); this.grpGeneral.Controls.Add(this.numericWriteOffset); this.grpGeneral.Controls.Add(this.chkAutoCorrectFilenames); @@ -105,6 +107,17 @@ namespace JDP { this.grpGeneral.TabStop = false; this.grpGeneral.Text = "General"; // + // chkEmbedLog + // + this.chkEmbedLog.AutoSize = true; + this.chkEmbedLog.Location = new System.Drawing.Point(12, 78); + this.chkEmbedLog.Name = "chkEmbedLog"; + this.chkEmbedLog.Size = new System.Drawing.Size(134, 17); + this.chkEmbedLog.TabIndex = 6; + this.chkEmbedLog.Text = "Embed log file as a tag"; + this.toolTip1.SetToolTip(this.chkEmbedLog, "File should be in the same directory as source file and have a .log extension"); + this.chkEmbedLog.UseVisualStyleBackColor = true; + // // numericWriteOffset // this.numericWriteOffset.Location = new System.Drawing.Point(133, 20); @@ -600,16 +613,15 @@ namespace JDP { this.txtSingleFilenameFormat.TabIndex = 2; this.txtSingleFilenameFormat.Text = "%F"; // - // chkEmbedLog + // chkFillUpCUE // - this.chkEmbedLog.AutoSize = true; - this.chkEmbedLog.Location = new System.Drawing.Point(12, 78); - this.chkEmbedLog.Name = "chkEmbedLog"; - this.chkEmbedLog.Size = new System.Drawing.Size(134, 17); - this.chkEmbedLog.TabIndex = 6; - this.chkEmbedLog.Text = "Embed log file as a tag"; - this.toolTip1.SetToolTip(this.chkEmbedLog, "File should be in the same directory as source file and have a .log extension"); - this.chkEmbedLog.UseVisualStyleBackColor = true; + this.chkFillUpCUE.AutoSize = true; + this.chkFillUpCUE.Location = new System.Drawing.Point(12, 95); + this.chkFillUpCUE.Name = "chkFillUpCUE"; + this.chkFillUpCUE.Size = new System.Drawing.Size(187, 17); + this.chkFillUpCUE.TabIndex = 7; + this.chkFillUpCUE.Text = "Fill up missing CUE data from tags"; + this.chkFillUpCUE.UseVisualStyleBackColor = true; // // frmSettings // @@ -697,6 +709,7 @@ namespace JDP { private System.Windows.Forms.CheckBox chkArFixOffset; private System.Windows.Forms.Label label4; private System.Windows.Forms.CheckBox chkEmbedLog; + private System.Windows.Forms.CheckBox chkFillUpCUE; } } \ No newline at end of file diff --git a/CUETools/frmSettings.cs b/CUETools/frmSettings.cs index aad3da9..2bb47be 100644 --- a/CUETools/frmSettings.cs +++ b/CUETools/frmSettings.cs @@ -42,6 +42,7 @@ namespace JDP { chkArNoUnverifiedAudio.Checked = _config.noUnverifiedOutput; chkArFixOffset.Checked = _config.fixOffset; chkEmbedLog.Checked = _config.embedLog; + chkFillUpCUE.Checked = _config.fillUpCUE; } private void frmSettings_FormClosing(object sender, FormClosingEventArgs e) { @@ -94,6 +95,7 @@ namespace JDP { _config.noUnverifiedOutput = chkArNoUnverifiedAudio.Checked; _config.fixOffset = chkArFixOffset.Checked; _config.embedLog = chkEmbedLog.Checked; + _config.fillUpCUE = chkFillUpCUE.Checked; } private void chkArFixOffset_CheckedChanged(object sender, EventArgs e) diff --git a/CUETools/frmSettings.resx b/CUETools/frmSettings.resx index 1182b16..cc681f1 100644 --- a/CUETools/frmSettings.resx +++ b/CUETools/frmSettings.resx @@ -123,10 +123,4 @@ 17, 17 - - 17, 17 - - - 17, 17 - \ No newline at end of file