mirror of
https://github.com/claunia/cuetools.net.git
synced 2025-12-16 18:14:25 +00:00
Minor bugfixes (2.0.4a)
This commit is contained in:
@@ -32,7 +32,7 @@ namespace ArCueDotNet
|
|||||||
cueSheet.Action = CUEAction.Verify;
|
cueSheet.Action = CUEAction.Verify;
|
||||||
//cueSheet.OutputStyle = CUEStyle.SingleFile;
|
//cueSheet.OutputStyle = CUEStyle.SingleFile;
|
||||||
cueSheet.Open(pathIn);
|
cueSheet.Open(pathIn);
|
||||||
cueSheet.Lookup();
|
cueSheet.UseAccurateRip();
|
||||||
cueSheet.GenerateFilenames(AudioEncoderType.NoAudio, "dummy", pathIn);
|
cueSheet.GenerateFilenames(AudioEncoderType.NoAudio, "dummy", pathIn);
|
||||||
cueSheet.Go();
|
cueSheet.Go();
|
||||||
cueSheet.GenerateAccurateRipLog(sw);
|
cueSheet.GenerateAccurateRipLog(sw);
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ namespace CUERipper
|
|||||||
_config.createEACLOG = sr.LoadBoolean("CreateEACLOG") ?? false;
|
_config.createEACLOG = sr.LoadBoolean("CreateEACLOG") ?? false;
|
||||||
_config.preserveHTOA = sr.LoadBoolean("PreserveHTOA") ?? false;
|
_config.preserveHTOA = sr.LoadBoolean("PreserveHTOA") ?? false;
|
||||||
_config.createM3U = sr.LoadBoolean("CreateM3U") ?? true;
|
_config.createM3U = sr.LoadBoolean("CreateM3U") ?? true;
|
||||||
_pathFormat = sr.Load("PathFormat") ?? "%music%\\%artist%\\%year% - %album%\\%artist% - %album%.cue";
|
_pathFormat = sr.Load("PathFormat") ?? "%music%\\%artist%\\[%year% - ]%album%\\%artist% - %album%.cue";
|
||||||
checkBoxEACMode.Checked = _config.createEACLOG;
|
checkBoxEACMode.Checked = _config.createEACLOG;
|
||||||
SelectedOutputAudioType = (AudioEncoderType?)sr.LoadInt32("OutputAudioType", null, null) ?? AudioEncoderType.Lossless;
|
SelectedOutputAudioType = (AudioEncoderType?)sr.LoadInt32("OutputAudioType", null, null) ?? AudioEncoderType.Lossless;
|
||||||
comboBoxAudioFormat.SelectedIndex = sr.LoadInt32("ComboCodec", 0, comboBoxAudioFormat.Items.Count - 1) ?? 0;
|
comboBoxAudioFormat.SelectedIndex = sr.LoadInt32("ComboCodec", 0, comboBoxAudioFormat.Items.Count - 1) ?? 0;
|
||||||
@@ -244,39 +244,22 @@ namespace CUERipper
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GenerateOutputPath()
|
|
||||||
{
|
|
||||||
List<string> find = new List<string>();
|
|
||||||
find.Add("%music%");
|
|
||||||
find.Add("%artist%");
|
|
||||||
find.Add("%D");
|
|
||||||
find.Add("%album%");
|
|
||||||
find.Add("%C");
|
|
||||||
find.Add("%year%");
|
|
||||||
find.Add("%Y");
|
|
||||||
List<string> replace = new List<string>();
|
|
||||||
replace.Add(m_icon_mgr.GetFolderPath(CUEControls.ExtraSpecialFolder.MyMusic));
|
|
||||||
replace.Add(General.EmptyStringToNull(_config.CleanseString(_cueSheet.Artist)));
|
|
||||||
replace.Add(General.EmptyStringToNull(_config.CleanseString(_cueSheet.Artist)));
|
|
||||||
replace.Add(General.EmptyStringToNull(_config.CleanseString(_cueSheet.Title)));
|
|
||||||
replace.Add(General.EmptyStringToNull(_config.CleanseString(_cueSheet.Title)));
|
|
||||||
replace.Add(_cueSheet.Year);
|
|
||||||
replace.Add(_cueSheet.Year);
|
|
||||||
|
|
||||||
return Path.ChangeExtension(General.ReplaceMultiple(_pathFormat, find, replace) ?? "image.cue", ".cue");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void buttonGo_Click(object sender, EventArgs e)
|
private void buttonGo_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (_reader == null)
|
if (_reader == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
_format = (string)comboBoxAudioFormat.SelectedItem;
|
||||||
_cueSheet.OutputStyle = comboImage.SelectedIndex == 0 ? CUEStyle.SingleFileWithCUE :
|
_cueSheet.OutputStyle = comboImage.SelectedIndex == 0 ? CUEStyle.SingleFileWithCUE :
|
||||||
CUEStyle.GapsAppended;
|
CUEStyle.GapsAppended;
|
||||||
_pathOut = GenerateOutputPath();
|
_pathOut = _cueSheet.GenerateUniqueOutputPath(_pathFormat,
|
||||||
if (_cueSheet.OutputStyle == CUEStyle.SingleFileWithCUE)
|
_cueSheet.OutputStyle == CUEStyle.SingleFileWithCUE ? "." + _format : ".cue",
|
||||||
_cueSheet.SingleFilename = Path.GetFileName(_pathOut);
|
CUEAction.Encode, null);
|
||||||
_format = (string)comboBoxAudioFormat.SelectedItem;
|
if (_pathOut == "")
|
||||||
|
{
|
||||||
|
MessageBox.Show(this, "Output path generation failed", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
_cueSheet.GenerateFilenames(SelectedOutputAudioType, _format, _pathOut);
|
_cueSheet.GenerateFilenames(SelectedOutputAudioType, _format, _pathOut);
|
||||||
|
|
||||||
_workThread = new Thread(Rip);
|
_workThread = new Thread(Rip);
|
||||||
@@ -383,8 +366,9 @@ namespace CUERipper
|
|||||||
}
|
}
|
||||||
if (r.cueSheet.Genre == "") r.cueSheet.Genre = "";
|
if (r.cueSheet.Genre == "") r.cueSheet.Genre = "";
|
||||||
if (r.cueSheet.Year == "") r.cueSheet.Year = "";
|
if (r.cueSheet.Year == "") r.cueSheet.Year = "";
|
||||||
r.cueSheet.Action = CUEAction.VerifyAndConvert;
|
r.cueSheet.Action = CUEAction.Encode;
|
||||||
r.cueSheet.ArVerify.ContactAccurateRip(AccurateRipVerify.CalculateAccurateRipId(audioSource.TOC));
|
r.cueSheet.UseAccurateRip();
|
||||||
|
//r.cueSheet.ArVerify.ContactAccurateRip(AccurateRipVerify.CalculateAccurateRipId(audioSource.TOC));
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -148,7 +148,7 @@
|
|||||||
<value>0, 443</value>
|
<value>0, 443</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
<data name="toolStripStatusLabel1.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="toolStripStatusLabel1.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>229, 17</value>
|
<value>260, 17</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="toolStripStatusLabel1.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
|
<data name="toolStripStatusLabel1.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
|
||||||
<value>MiddleLeft</value>
|
<value>MiddleLeft</value>
|
||||||
@@ -745,7 +745,7 @@
|
|||||||
<value>CenterScreen</value>
|
<value>CenterScreen</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="$this.Text" xml:space="preserve">
|
<data name="$this.Text" xml:space="preserve">
|
||||||
<value>CUERipper 2.0.2</value>
|
<value>CUERipper 2.0.4a</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>toolStripStatusLabel1.Name" xml:space="preserve">
|
<data name=">>toolStripStatusLabel1.Name" xml:space="preserve">
|
||||||
<value>toolStripStatusLabel1</value>
|
<value>toolStripStatusLabel1</value>
|
||||||
|
|||||||
@@ -735,7 +735,7 @@ namespace CUETools.Codecs
|
|||||||
Process _encoderProcess;
|
Process _encoderProcess;
|
||||||
WAVWriter wrt;
|
WAVWriter wrt;
|
||||||
|
|
||||||
public UserDefinedWriter(string path, int bitsPerSample, int channelCount, int sampleRate, Stream IO, string encoder, string encoderParams, string encoderMode)
|
public UserDefinedWriter(string path, int bitsPerSample, int channelCount, int sampleRate, Stream IO, string encoder, string encoderParams, string encoderMode, int padding)
|
||||||
{
|
{
|
||||||
_path = path;
|
_path = path;
|
||||||
_encoder = encoder;
|
_encoder = encoder;
|
||||||
@@ -744,7 +744,7 @@ namespace CUETools.Codecs
|
|||||||
|
|
||||||
_encoderProcess = new Process();
|
_encoderProcess = new Process();
|
||||||
_encoderProcess.StartInfo.FileName = _encoder;
|
_encoderProcess.StartInfo.FileName = _encoder;
|
||||||
_encoderProcess.StartInfo.Arguments = _encoderParams.Replace("%O", "\"" + path + "\"").Replace("%M", encoderMode);
|
_encoderProcess.StartInfo.Arguments = _encoderParams.Replace("%O", "\"" + path + "\"").Replace("%M", encoderMode).Replace("%P", padding.ToString());
|
||||||
_encoderProcess.StartInfo.CreateNoWindow = true;
|
_encoderProcess.StartInfo.CreateNoWindow = true;
|
||||||
_encoderProcess.StartInfo.RedirectStandardInput = true;
|
_encoderProcess.StartInfo.RedirectStandardInput = true;
|
||||||
_encoderProcess.StartInfo.UseShellExecute = false;
|
_encoderProcess.StartInfo.UseShellExecute = false;
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ namespace CUETools.Converter
|
|||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
IAudioSource audioSource = AudioReadWrite.GetAudioSource(sourceFile, null, config);
|
IAudioSource audioSource = AudioReadWrite.GetAudioSource(sourceFile, null, config);
|
||||||
IAudioDest audioDest = AudioReadWrite.GetAudioDest(AudioEncoderType.Lossless, destFile, (long)audioSource.Length, audioSource.BitsPerSample, audioSource.SampleRate, config);
|
IAudioDest audioDest = AudioReadWrite.GetAudioDest(AudioEncoderType.Lossless, destFile, (long)audioSource.Length, audioSource.BitsPerSample, audioSource.SampleRate, 8192, config);
|
||||||
int[,] buff = new int[0x4000, audioSource.ChannelCount];
|
int[,] buff = new int[0x4000, audioSource.ChannelCount];
|
||||||
|
|
||||||
Console.WriteLine("Filename : {0}", sourceFile);
|
Console.WriteLine("Filename : {0}", sourceFile);
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ namespace CUETools.Processor
|
|||||||
return new LossyWAVReader(lossySource, lwcdfSource);
|
return new LossyWAVReader(lossySource, lwcdfSource);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IAudioDest GetAudioDest(AudioEncoderType audioEncoderType, string path, int bitsPerSample, int channelCount, int sampleRate, long finalSampleCount, string extension, CUEConfig config)
|
public static IAudioDest GetAudioDest(AudioEncoderType audioEncoderType, string path, int bitsPerSample, int channelCount, int sampleRate, long finalSampleCount, int padding, string extension, CUEConfig config)
|
||||||
{
|
{
|
||||||
IAudioDest dest;
|
IAudioDest dest;
|
||||||
if (audioEncoderType == AudioEncoderType.NoAudio || extension == ".dummy")
|
if (audioEncoderType == AudioEncoderType.NoAudio || extension == ".dummy")
|
||||||
@@ -94,6 +94,7 @@ namespace CUETools.Processor
|
|||||||
#if !MONO
|
#if !MONO
|
||||||
case "FLACWriter":
|
case "FLACWriter":
|
||||||
dest = new FLACWriter(path, bitsPerSample, channelCount, sampleRate);
|
dest = new FLACWriter(path, bitsPerSample, channelCount, sampleRate);
|
||||||
|
((FLACWriter)dest).PaddingLength = padding;
|
||||||
((FLACWriter)dest).CompressionLevel = encoder.DefaultModeIndex;
|
((FLACWriter)dest).CompressionLevel = encoder.DefaultModeIndex;
|
||||||
((FLACWriter)dest).Verify = config.flacVerify;
|
((FLACWriter)dest).Verify = config.flacVerify;
|
||||||
((FLACWriter)dest).DisableAsm = config.disableAsm;
|
((FLACWriter)dest).DisableAsm = config.disableAsm;
|
||||||
@@ -115,24 +116,24 @@ namespace CUETools.Processor
|
|||||||
default:
|
default:
|
||||||
if (encoder.path == null)
|
if (encoder.path == null)
|
||||||
throw new Exception("Unsupported audio type: " + path);
|
throw new Exception("Unsupported audio type: " + path);
|
||||||
dest = new UserDefinedWriter(path, bitsPerSample, channelCount, sampleRate, null, encoder.path, encoder.parameters, encoder.default_mode);
|
dest = new UserDefinedWriter(path, bitsPerSample, channelCount, sampleRate, null, encoder.path, encoder.parameters, encoder.default_mode, padding);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
dest.FinalSampleCount = finalSampleCount;
|
dest.FinalSampleCount = finalSampleCount;
|
||||||
return dest;
|
return dest;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IAudioDest GetAudioDest(AudioEncoderType audioEncoderType, string path, long finalSampleCount, int bitsPerSample, int sampleRate, CUEConfig config)
|
public static IAudioDest GetAudioDest(AudioEncoderType audioEncoderType, string path, long finalSampleCount, int bitsPerSample, int sampleRate, int padding, CUEConfig config)
|
||||||
{
|
{
|
||||||
string extension = Path.GetExtension(path).ToLower();
|
string extension = Path.GetExtension(path).ToLower();
|
||||||
string filename = Path.GetFileNameWithoutExtension(path);
|
string filename = Path.GetFileNameWithoutExtension(path);
|
||||||
if (audioEncoderType == AudioEncoderType.NoAudio || audioEncoderType == AudioEncoderType.Lossless || Path.GetExtension(filename).ToLower() != ".lossy")
|
if (audioEncoderType == AudioEncoderType.NoAudio || audioEncoderType == AudioEncoderType.Lossless || Path.GetExtension(filename).ToLower() != ".lossy")
|
||||||
return GetAudioDest(audioEncoderType, path, bitsPerSample, 2, sampleRate, finalSampleCount, extension, config);
|
return GetAudioDest(audioEncoderType, path, bitsPerSample, 2, sampleRate, finalSampleCount, padding, extension, config);
|
||||||
|
|
||||||
string lwcdfPath = Path.Combine(Path.GetDirectoryName(path), Path.GetFileNameWithoutExtension(filename) + ".lwcdf" + extension);
|
string lwcdfPath = Path.Combine(Path.GetDirectoryName(path), Path.GetFileNameWithoutExtension(filename) + ".lwcdf" + extension);
|
||||||
int lossyBitsPerSample = (config.detectHDCD && config.decodeHDCD && !config.decodeHDCDtoLW16) ? 24 : 16;
|
int lossyBitsPerSample = (config.detectHDCD && config.decodeHDCD && !config.decodeHDCDtoLW16) ? 24 : 16;
|
||||||
IAudioDest lossyDest = GetAudioDest(AudioEncoderType.Lossless, path, lossyBitsPerSample, 2, sampleRate, finalSampleCount, extension, config);
|
IAudioDest lossyDest = GetAudioDest(AudioEncoderType.Lossless, path, lossyBitsPerSample, 2, sampleRate, finalSampleCount, padding, extension, config);
|
||||||
IAudioDest lwcdfDest = audioEncoderType == AudioEncoderType.Hybrid ? GetAudioDest(AudioEncoderType.Lossless, lwcdfPath, bitsPerSample, 2, sampleRate, finalSampleCount, extension, config) : null;
|
IAudioDest lwcdfDest = audioEncoderType == AudioEncoderType.Hybrid ? GetAudioDest(AudioEncoderType.Lossless, lwcdfPath, bitsPerSample, 2, sampleRate, finalSampleCount, padding, extension, config) : null;
|
||||||
return new LossyWAVWriter(lossyDest, lwcdfDest, bitsPerSample, 2, sampleRate, config.lossyWAVQuality);
|
return new LossyWAVWriter(lossyDest, lwcdfDest, bitsPerSample, 2, sampleRate, config.lossyWAVQuality);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,11 +65,10 @@ namespace CUETools.Processor
|
|||||||
|
|
||||||
public enum CUEAction
|
public enum CUEAction
|
||||||
{
|
{
|
||||||
Convert,
|
Encode = 0,
|
||||||
Verify,
|
Verify = 1,
|
||||||
VerifyAndConvert,
|
CreateDummyCUE = 2,
|
||||||
CreateDummyCUE,
|
CorrectFilenames = 3
|
||||||
CorrectFilenames
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum CUEStyle
|
public enum CUEStyle
|
||||||
@@ -405,6 +404,30 @@ namespace CUETools.Processor
|
|||||||
return ReplaceMultiple(s, find, replace);
|
return ReplaceMultiple(s, find, replace);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public delegate bool CheckIfExists(string output);
|
||||||
|
|
||||||
|
public static string ReplaceMultiple(string fmt, NameValueCollection tags, string unique_key, CheckIfExists exists)
|
||||||
|
{
|
||||||
|
string result = ReplaceMultiple(fmt, tags);
|
||||||
|
if (result == String.Empty || result == null)
|
||||||
|
return result;
|
||||||
|
int unique = 1;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
while (exists(result))
|
||||||
|
{
|
||||||
|
tags[unique_key] = unique.ToString();
|
||||||
|
string new_result = ReplaceMultiple(fmt, tags);
|
||||||
|
if (new_result == result || new_result == String.Empty || new_result == null)
|
||||||
|
break;
|
||||||
|
result = new_result;
|
||||||
|
unique++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
public static string ReplaceMultiple(string s, List<string> find, List<string> replace)
|
public static string ReplaceMultiple(string s, List<string> find, List<string> replace)
|
||||||
{
|
{
|
||||||
if (find.Count != replace.Count)
|
if (find.Count != replace.Count)
|
||||||
@@ -757,7 +780,7 @@ namespace CUETools.Processor
|
|||||||
public bool encodeWhenZeroOffset;
|
public bool encodeWhenZeroOffset;
|
||||||
public bool writeArTagsOnVerify;
|
public bool writeArTagsOnVerify;
|
||||||
public bool writeArLogOnVerify;
|
public bool writeArLogOnVerify;
|
||||||
public bool writeArTagsOnConvert;
|
public bool writeArTagsOnEncode;
|
||||||
public bool writeArLogOnConvert;
|
public bool writeArLogOnConvert;
|
||||||
public bool fixOffset;
|
public bool fixOffset;
|
||||||
public bool noUnverifiedOutput;
|
public bool noUnverifiedOutput;
|
||||||
@@ -798,7 +821,7 @@ namespace CUETools.Processor
|
|||||||
public Dictionary<string, CUEToolsUDC> decoders;
|
public Dictionary<string, CUEToolsUDC> decoders;
|
||||||
public Dictionary<string, CUEToolsScript> scripts;
|
public Dictionary<string, CUEToolsScript> scripts;
|
||||||
public string defaultVerifyScript;
|
public string defaultVerifyScript;
|
||||||
public string defaultVerifyAndConvertScript;
|
public string defaultEncodeScript;
|
||||||
public bool writeBasicTagsFromCUEData;
|
public bool writeBasicTagsFromCUEData;
|
||||||
public bool copyBasicTags;
|
public bool copyBasicTags;
|
||||||
public bool copyUnknownTags;
|
public bool copyUnknownTags;
|
||||||
@@ -813,8 +836,8 @@ namespace CUETools.Processor
|
|||||||
public CUEStyle gapsHandling;
|
public CUEStyle gapsHandling;
|
||||||
|
|
||||||
public bool CopyAlbumArt { get { return copyAlbumArt; } set { copyAlbumArt = value; } }
|
public bool CopyAlbumArt { get { return copyAlbumArt; } set { copyAlbumArt = value; } }
|
||||||
public string ArLogFilenameFormat { get { return arLogFilenameFormat; } }
|
public string ArLogFilenameFormat { get { return arLogFilenameFormat; } set { arLogFilenameFormat = value; } }
|
||||||
public string AlArtFilenameFormat { get { return alArtFilenameFormat; } }
|
public string AlArtFilenameFormat { get { return alArtFilenameFormat; } set { alArtFilenameFormat = value; } }
|
||||||
public CUEToolsUDCList Encoders
|
public CUEToolsUDCList Encoders
|
||||||
{
|
{
|
||||||
get { return encoders; }
|
get { return encoders; }
|
||||||
@@ -829,7 +852,7 @@ namespace CUETools.Processor
|
|||||||
encodeWhenZeroOffset = false;
|
encodeWhenZeroOffset = false;
|
||||||
fixOffset = false;
|
fixOffset = false;
|
||||||
noUnverifiedOutput = false;
|
noUnverifiedOutput = false;
|
||||||
writeArTagsOnConvert = true;
|
writeArTagsOnEncode = true;
|
||||||
writeArLogOnConvert = true;
|
writeArLogOnConvert = true;
|
||||||
writeArTagsOnVerify = false;
|
writeArTagsOnVerify = false;
|
||||||
writeArLogOnVerify = true;
|
writeArLogOnVerify = true;
|
||||||
@@ -840,8 +863,8 @@ namespace CUETools.Processor
|
|||||||
wvExtraMode = 0;
|
wvExtraMode = 0;
|
||||||
wvStoreMD5 = false;
|
wvStoreMD5 = false;
|
||||||
keepOriginalFilenames = false;
|
keepOriginalFilenames = false;
|
||||||
trackFilenameFormat = "%N. %T";
|
trackFilenameFormat = "%tracknumber%. %title%";
|
||||||
singleFilenameFormat = "%F";
|
singleFilenameFormat = "%filename%";
|
||||||
removeSpecial = false;
|
removeSpecial = false;
|
||||||
specialExceptions = "-()";
|
specialExceptions = "-()";
|
||||||
replaceSpaces = false;
|
replaceSpaces = false;
|
||||||
@@ -878,7 +901,7 @@ namespace CUETools.Processor
|
|||||||
arLogToSourceFolder = false;
|
arLogToSourceFolder = false;
|
||||||
arLogVerbose = true;
|
arLogVerbose = true;
|
||||||
fixOffsetToNearest = true;
|
fixOffsetToNearest = true;
|
||||||
arLogFilenameFormat = "%F.accurip";
|
arLogFilenameFormat = "%filename%.accurip";
|
||||||
alArtFilenameFormat = "folder.jpg";
|
alArtFilenameFormat = "folder.jpg";
|
||||||
|
|
||||||
gapsHandling = CUEStyle.GapsAppended;
|
gapsHandling = CUEStyle.GapsAppended;
|
||||||
@@ -926,7 +949,7 @@ namespace CUETools.Processor
|
|||||||
|
|
||||||
scripts = new Dictionary<string, CUEToolsScript>();
|
scripts = new Dictionary<string, CUEToolsScript>();
|
||||||
scripts.Add("default", new CUEToolsScript("default", true,
|
scripts.Add("default", new CUEToolsScript("default", true,
|
||||||
new CUEAction[] { CUEAction.VerifyAndConvert, CUEAction.Verify, CUEAction.Convert },
|
new CUEAction[] { CUEAction.Verify, CUEAction.Encode },
|
||||||
"return processor.Go();"));
|
"return processor.Go();"));
|
||||||
scripts.Add("only if found", new CUEToolsScript("only if found", true,
|
scripts.Add("only if found", new CUEToolsScript("only if found", true,
|
||||||
new CUEAction[] { CUEAction.Verify },
|
new CUEAction[] { CUEAction.Verify },
|
||||||
@@ -934,7 +957,7 @@ namespace CUETools.Processor
|
|||||||
return processor.WriteReport();
|
return processor.WriteReport();
|
||||||
return processor.Go();"));
|
return processor.Go();"));
|
||||||
scripts.Add("fix offset", new CUEToolsScript("fix offset", true,
|
scripts.Add("fix offset", new CUEToolsScript("fix offset", true,
|
||||||
new CUEAction[] { CUEAction.VerifyAndConvert },
|
new CUEAction[] { CUEAction.Encode },
|
||||||
@"if (processor.ArVerify.AccResult != HttpStatusCode.OK)
|
@"if (processor.ArVerify.AccResult != HttpStatusCode.OK)
|
||||||
return processor.WriteReport();
|
return processor.WriteReport();
|
||||||
processor.WriteOffset = 0;
|
processor.WriteOffset = 0;
|
||||||
@@ -946,12 +969,12 @@ processor.FindBestOffset(processor.Config.fixOffsetMinimumConfidence, !processor
|
|||||||
if (tracksMatch * 100 < processor.Config.fixOffsetMinimumTracksPercent * processor.TrackCount)
|
if (tracksMatch * 100 < processor.Config.fixOffsetMinimumTracksPercent * processor.TrackCount)
|
||||||
return status;
|
return status;
|
||||||
processor.WriteOffset = bestOffset;
|
processor.WriteOffset = bestOffset;
|
||||||
processor.Action = CUEAction.VerifyAndConvert;
|
processor.Action = CUEAction.Encode;
|
||||||
//MessageBox.Show(null, processor.AccurateRipLog, " + "\"Done\"" + @"MessageBoxButtons.OK, MessageBoxIcon.Information);
|
//MessageBox.Show(null, processor.AccurateRipLog, " + "\"Done\"" + @"MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
return processor.Go();
|
return processor.Go();
|
||||||
"));
|
"));
|
||||||
scripts.Add("encode if verified", new CUEToolsScript("encode if verified", true,
|
scripts.Add("encode if verified", new CUEToolsScript("encode if verified", true,
|
||||||
new CUEAction[] { CUEAction.VerifyAndConvert },
|
new CUEAction[] { CUEAction.Encode },
|
||||||
@"if (processor.ArVerify.AccResult != HttpStatusCode.OK)
|
@"if (processor.ArVerify.AccResult != HttpStatusCode.OK)
|
||||||
return processor.WriteReport();
|
return processor.WriteReport();
|
||||||
processor.Action = CUEAction.Verify;
|
processor.Action = CUEAction.Verify;
|
||||||
@@ -961,11 +984,11 @@ int bestOffset;
|
|||||||
processor.FindBestOffset(processor.Config.encodeWhenConfidence, false, out tracksMatch, out bestOffset);
|
processor.FindBestOffset(processor.Config.encodeWhenConfidence, false, out tracksMatch, out bestOffset);
|
||||||
if (tracksMatch * 100 < processor.Config.encodeWhenPercent * processor.TrackCount || (processor.Config.encodeWhenZeroOffset && bestOffset != 0))
|
if (tracksMatch * 100 < processor.Config.encodeWhenPercent * processor.TrackCount || (processor.Config.encodeWhenZeroOffset && bestOffset != 0))
|
||||||
return status;
|
return status;
|
||||||
processor.Action = CUEAction.VerifyAndConvert;
|
processor.Action = CUEAction.Encode;
|
||||||
return processor.Go();
|
return processor.Go();
|
||||||
"));
|
"));
|
||||||
defaultVerifyScript = "default";
|
defaultVerifyScript = "default";
|
||||||
defaultVerifyAndConvertScript = "default";
|
defaultEncodeScript = "default";
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Save (SettingsWriter sw)
|
public void Save (SettingsWriter sw)
|
||||||
@@ -978,7 +1001,7 @@ return processor.Go();
|
|||||||
sw.Save("ArEncodeWhenZeroOffset", encodeWhenZeroOffset);
|
sw.Save("ArEncodeWhenZeroOffset", encodeWhenZeroOffset);
|
||||||
sw.Save("ArNoUnverifiedOutput", noUnverifiedOutput);
|
sw.Save("ArNoUnverifiedOutput", noUnverifiedOutput);
|
||||||
sw.Save("ArFixOffset", fixOffset);
|
sw.Save("ArFixOffset", fixOffset);
|
||||||
sw.Save("ArWriteCRC", writeArTagsOnConvert);
|
sw.Save("ArWriteCRC", writeArTagsOnEncode);
|
||||||
sw.Save("ArWriteLog", writeArLogOnConvert);
|
sw.Save("ArWriteLog", writeArLogOnConvert);
|
||||||
sw.Save("ArWriteTagsOnVerify", writeArTagsOnVerify);
|
sw.Save("ArWriteTagsOnVerify", writeArTagsOnVerify);
|
||||||
sw.Save("ArWriteLogOnVerify", writeArLogOnVerify);
|
sw.Save("ArWriteLogOnVerify", writeArLogOnVerify);
|
||||||
@@ -1089,7 +1112,7 @@ return processor.Go();
|
|||||||
}
|
}
|
||||||
sw.Save("CustomScripts", nScripts);
|
sw.Save("CustomScripts", nScripts);
|
||||||
sw.Save("DefaultVerifyScript", defaultVerifyScript);
|
sw.Save("DefaultVerifyScript", defaultVerifyScript);
|
||||||
sw.Save("DefaultVerifyAndConvertScript", defaultVerifyAndConvertScript);
|
sw.Save("DefaultVerifyAndConvertScript", defaultEncodeScript);
|
||||||
|
|
||||||
sw.Save("GapsHandling", (int)gapsHandling);
|
sw.Save("GapsHandling", (int)gapsHandling);
|
||||||
}
|
}
|
||||||
@@ -1105,7 +1128,7 @@ return processor.Go();
|
|||||||
encodeWhenZeroOffset = sr.LoadBoolean("ArEncodeWhenZeroOffset") ?? false;
|
encodeWhenZeroOffset = sr.LoadBoolean("ArEncodeWhenZeroOffset") ?? false;
|
||||||
noUnverifiedOutput = sr.LoadBoolean("ArNoUnverifiedOutput") ?? false;
|
noUnverifiedOutput = sr.LoadBoolean("ArNoUnverifiedOutput") ?? false;
|
||||||
fixOffset = sr.LoadBoolean("ArFixOffset") ?? false;
|
fixOffset = sr.LoadBoolean("ArFixOffset") ?? false;
|
||||||
writeArTagsOnConvert = sr.LoadBoolean("ArWriteCRC") ?? true;
|
writeArTagsOnEncode = sr.LoadBoolean("ArWriteCRC") ?? true;
|
||||||
writeArLogOnConvert = sr.LoadBoolean("ArWriteLog") ?? true;
|
writeArLogOnConvert = sr.LoadBoolean("ArWriteLog") ?? true;
|
||||||
writeArTagsOnVerify = sr.LoadBoolean("ArWriteTagsOnVerify") ?? false;
|
writeArTagsOnVerify = sr.LoadBoolean("ArWriteTagsOnVerify") ?? false;
|
||||||
writeArLogOnVerify = sr.LoadBoolean("ArWriteLogOnVerify") ?? true;
|
writeArLogOnVerify = sr.LoadBoolean("ArWriteLogOnVerify") ?? true;
|
||||||
@@ -1116,8 +1139,8 @@ return processor.Go();
|
|||||||
wvExtraMode = sr.LoadInt32("WVExtraMode", 0, 6) ?? 0;
|
wvExtraMode = sr.LoadInt32("WVExtraMode", 0, 6) ?? 0;
|
||||||
wvStoreMD5 = sr.LoadBoolean("WVStoreMD5") ?? false;
|
wvStoreMD5 = sr.LoadBoolean("WVStoreMD5") ?? false;
|
||||||
keepOriginalFilenames = sr.LoadBoolean("KeepOriginalFilenames") ?? false;
|
keepOriginalFilenames = sr.LoadBoolean("KeepOriginalFilenames") ?? false;
|
||||||
singleFilenameFormat = sr.Load("SingleFilenameFormat") ?? "%F";
|
singleFilenameFormat = sr.Load("SingleFilenameFormat") ?? singleFilenameFormat;
|
||||||
trackFilenameFormat = sr.Load("TrackFilenameFormat") ?? "%N. %T";
|
trackFilenameFormat = sr.Load("TrackFilenameFormat") ?? trackFilenameFormat;
|
||||||
removeSpecial = sr.LoadBoolean("RemoveSpecialCharacters") ?? false;
|
removeSpecial = sr.LoadBoolean("RemoveSpecialCharacters") ?? false;
|
||||||
specialExceptions = sr.Load("SpecialCharactersExceptions") ?? "-()";
|
specialExceptions = sr.Load("SpecialCharactersExceptions") ?? "-()";
|
||||||
replaceSpaces = sr.LoadBoolean("ReplaceSpaces") ?? false;
|
replaceSpaces = sr.LoadBoolean("ReplaceSpaces") ?? false;
|
||||||
@@ -1266,11 +1289,18 @@ return processor.Go();
|
|||||||
}
|
}
|
||||||
|
|
||||||
defaultVerifyScript = sr.Load("DefaultVerifyScript") ?? "default";
|
defaultVerifyScript = sr.Load("DefaultVerifyScript") ?? "default";
|
||||||
defaultVerifyAndConvertScript = sr.Load("DefaultVerifyAndConvertScript") ?? "default";
|
defaultEncodeScript = sr.Load("DefaultVerifyAndConvertScript") ?? "default";
|
||||||
|
|
||||||
gapsHandling = (CUEStyle?)sr.LoadInt32("GapsHandling", null, null) ?? gapsHandling;
|
gapsHandling = (CUEStyle?)sr.LoadInt32("GapsHandling", null, null) ?? gapsHandling;
|
||||||
|
|
||||||
language = sr.Load("Language") ?? Thread.CurrentThread.CurrentUICulture.Name;
|
language = sr.Load("Language") ?? Thread.CurrentThread.CurrentUICulture.Name;
|
||||||
|
|
||||||
|
if (arLogFilenameFormat.Contains("%F"))
|
||||||
|
arLogFilenameFormat = "%filename%.accurip";
|
||||||
|
if (singleFilenameFormat.Contains("%F"))
|
||||||
|
singleFilenameFormat = "%filename%";
|
||||||
|
if (trackFilenameFormat.Contains("%N"))
|
||||||
|
trackFilenameFormat = "%tracknumber%. %title%";
|
||||||
}
|
}
|
||||||
|
|
||||||
public string CleanseString (string s)
|
public string CleanseString (string s)
|
||||||
@@ -1313,10 +1343,10 @@ return processor.Go();
|
|||||||
_script = "only if found";
|
_script = "only if found";
|
||||||
break;
|
break;
|
||||||
case "convert":
|
case "convert":
|
||||||
_action = CUEAction.VerifyAndConvert;
|
_action = CUEAction.Encode;
|
||||||
break;
|
break;
|
||||||
case "fix":
|
case "fix":
|
||||||
_action = CUEAction.VerifyAndConvert;
|
_action = CUEAction.Encode;
|
||||||
_script = "fix offset";
|
_script = "fix offset";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1331,7 +1361,7 @@ return processor.Go();
|
|||||||
_useAccurateRip = sr.LoadBoolean("AccurateRipLookup") ?? _useAccurateRip;
|
_useAccurateRip = sr.LoadBoolean("AccurateRipLookup") ?? _useAccurateRip;
|
||||||
_outputAudioType = (AudioEncoderType?)sr.LoadInt32("OutputAudioType", null, null) ?? _outputAudioType;
|
_outputAudioType = (AudioEncoderType?)sr.LoadInt32("OutputAudioType", null, null) ?? _outputAudioType;
|
||||||
_outputAudioFormat = sr.Load("OutputAudioFmt") ?? _outputAudioFormat;
|
_outputAudioFormat = sr.Load("OutputAudioFmt") ?? _outputAudioFormat;
|
||||||
_action = (CUEAction?)sr.LoadInt32("AccurateRipMode", null, null) ?? _action;
|
_action = (CUEAction?)sr.LoadInt32("AccurateRipMode", (int)CUEAction.Encode, (int)CUEAction.CorrectFilenames) ?? _action;
|
||||||
_CUEStyle = (CUEStyle?)sr.LoadInt32("CUEStyle", null, null) ?? _CUEStyle;
|
_CUEStyle = (CUEStyle?)sr.LoadInt32("CUEStyle", null, null) ?? _CUEStyle;
|
||||||
_writeOffset = sr.LoadInt32("WriteOffset", null, null) ?? 0;
|
_writeOffset = sr.LoadInt32("WriteOffset", null, null) ?? 0;
|
||||||
_outputTemplate = sr.Load("OutputPathTemplate") ?? _outputTemplate;
|
_outputTemplate = sr.Load("OutputPathTemplate") ?? _outputTemplate;
|
||||||
@@ -1357,7 +1387,7 @@ return processor.Go();
|
|||||||
public CUEConfig _config;
|
public CUEConfig _config;
|
||||||
public AudioEncoderType _outputAudioType = AudioEncoderType.Lossless;
|
public AudioEncoderType _outputAudioType = AudioEncoderType.Lossless;
|
||||||
public string _outputAudioFormat = "flac", _outputTemplate = null, _script = "default";
|
public string _outputAudioFormat = "flac", _outputTemplate = null, _script = "default";
|
||||||
public CUEAction _action = CUEAction.VerifyAndConvert;
|
public CUEAction _action = CUEAction.Encode;
|
||||||
public CUEStyle _CUEStyle = CUEStyle.SingleFileWithCUE;
|
public CUEStyle _CUEStyle = CUEStyle.SingleFileWithCUE;
|
||||||
public int _writeOffset = 0;
|
public int _writeOffset = 0;
|
||||||
public bool _useFreeDb = true, _useMusicBrainz = true, _useAccurateRip = true;
|
public bool _useFreeDb = true, _useMusicBrainz = true, _useAccurateRip = true;
|
||||||
@@ -1416,6 +1446,7 @@ return processor.Go();
|
|||||||
private bool _paddedToFrame, _truncated4608, _usePregapForFirstTrackInSingleFile;
|
private bool _paddedToFrame, _truncated4608, _usePregapForFirstTrackInSingleFile;
|
||||||
private int _writeOffset;
|
private int _writeOffset;
|
||||||
private CUEAction _action;
|
private CUEAction _action;
|
||||||
|
private bool _useAccurateRip = false;
|
||||||
private uint? _minDataTrackLength;
|
private uint? _minDataTrackLength;
|
||||||
private string _accurateRipId;
|
private string _accurateRipId;
|
||||||
private string _eacLog;
|
private string _eacLog;
|
||||||
@@ -1444,6 +1475,7 @@ return processor.Go();
|
|||||||
private CDImageLayout _toc;
|
private CDImageLayout _toc;
|
||||||
private string _arLogFileName, _alArtFileName;
|
private string _arLogFileName, _alArtFileName;
|
||||||
private TagLib.IPicture[] _albumArt;
|
private TagLib.IPicture[] _albumArt;
|
||||||
|
private int _padding = 8192;
|
||||||
|
|
||||||
public event ArchivePasswordRequiredHandler PasswordRequired;
|
public event ArchivePasswordRequiredHandler PasswordRequired;
|
||||||
public event CUEToolsProgressHandler CUEToolsProgress;
|
public event CUEToolsProgressHandler CUEToolsProgress;
|
||||||
@@ -1465,7 +1497,7 @@ return processor.Go();
|
|||||||
_paddedToFrame = false;
|
_paddedToFrame = false;
|
||||||
_truncated4608 = false;
|
_truncated4608 = false;
|
||||||
_usePregapForFirstTrackInSingleFile = false;
|
_usePregapForFirstTrackInSingleFile = false;
|
||||||
_action = CUEAction.Convert;
|
_action = CUEAction.Encode;
|
||||||
_appliedWriteOffset = false;
|
_appliedWriteOffset = false;
|
||||||
_minDataTrackLength = null;
|
_minDataTrackLength = null;
|
||||||
hdcdDecoder = null;
|
hdcdDecoder = null;
|
||||||
@@ -1907,7 +1939,8 @@ return processor.Go();
|
|||||||
|
|
||||||
List<CUEToolsSourceFile> logFiles = new List<CUEToolsSourceFile>();
|
List<CUEToolsSourceFile> logFiles = new List<CUEToolsSourceFile>();
|
||||||
foreach (string logPath in Directory.GetFiles(_inputDir, "*.log"))
|
foreach (string logPath in Directory.GetFiles(_inputDir, "*.log"))
|
||||||
logFiles.Add(new CUEToolsSourceFile(logPath, new StreamReader(logPath, CUESheet.Encoding)));
|
try { logFiles.Add(new CUEToolsSourceFile(logPath, new StreamReader(logPath, CUESheet.Encoding))); }
|
||||||
|
catch { }
|
||||||
CUEToolsSourceFile selectedLogFile = ChooseFile(logFiles, Path.GetFileNameWithoutExtension(pathIn), false);
|
CUEToolsSourceFile selectedLogFile = ChooseFile(logFiles, Path.GetFileNameWithoutExtension(pathIn), false);
|
||||||
_eacLog = selectedLogFile != null ? selectedLogFile.contents : null;
|
_eacLog = selectedLogFile != null ? selectedLogFile.contents : null;
|
||||||
}
|
}
|
||||||
@@ -1943,7 +1976,8 @@ return processor.Go();
|
|||||||
sr = new StringReader(cueSheet);
|
sr = new StringReader(cueSheet);
|
||||||
List<CUEToolsSourceFile> logFiles = new List<CUEToolsSourceFile>();
|
List<CUEToolsSourceFile> logFiles = new List<CUEToolsSourceFile>();
|
||||||
foreach (string logPath in Directory.GetFiles(_inputDir, "*.log"))
|
foreach (string logPath in Directory.GetFiles(_inputDir, "*.log"))
|
||||||
logFiles.Add(new CUEToolsSourceFile(logPath, new StreamReader(logPath, CUESheet.Encoding)));
|
try { logFiles.Add(new CUEToolsSourceFile(logPath, new StreamReader(logPath, CUESheet.Encoding))); }
|
||||||
|
catch { }
|
||||||
CUEToolsSourceFile selectedLogFile = ChooseFile(logFiles, null, false);
|
CUEToolsSourceFile selectedLogFile = ChooseFile(logFiles, null, false);
|
||||||
_eacLog = selectedLogFile != null ? selectedLogFile.contents : null;
|
_eacLog = selectedLogFile != null ? selectedLogFile.contents : null;
|
||||||
}
|
}
|
||||||
@@ -2410,41 +2444,42 @@ return processor.Go();
|
|||||||
}
|
}
|
||||||
|
|
||||||
LoadAlbumArt(_tracks[0]._fileInfo ?? _fileInfo);
|
LoadAlbumArt(_tracks[0]._fileInfo ?? _fileInfo);
|
||||||
|
ResizeAlbumArt();
|
||||||
|
if ((_config.embedAlbumArt || _config.copyAlbumArt) && _albumArt != null && _albumArt.Length > 0)
|
||||||
|
_padding += _albumArt[0].Data.Count;
|
||||||
|
if (_config.embedLog && _eacLog != null)
|
||||||
|
_padding += _eacLog.Length;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Lookup()
|
public void UseAccurateRip()
|
||||||
{
|
{
|
||||||
if (_action == CUEAction.Verify
|
ShowProgress((string)"Contacting AccurateRip database...", 0, 0, null, null);
|
||||||
|| _action == CUEAction.VerifyAndConvert
|
if (!_toc[_toc.TrackCount].IsAudio && DataTrackLength == 0 && _minDataTrackLength.HasValue && _accurateRipId == null && _config.bruteForceDTL)
|
||||||
)
|
|
||||||
{
|
{
|
||||||
ShowProgress((string)"Contacting AccurateRip database...", 0, 0, null, null);
|
uint minDTL = _minDataTrackLength.Value;
|
||||||
if (!_toc[_toc.TrackCount].IsAudio && DataTrackLength == 0 && _minDataTrackLength.HasValue && _accurateRipId == null && _config.bruteForceDTL)
|
CDImageLayout toc2 = new CDImageLayout(_toc);
|
||||||
|
for (uint dtl = minDTL; dtl < minDTL + 75; dtl++)
|
||||||
{
|
{
|
||||||
uint minDTL = _minDataTrackLength.Value;
|
toc2[toc2.TrackCount].Length = dtl;
|
||||||
CDImageLayout toc2 = new CDImageLayout(_toc);
|
_arVerify.ContactAccurateRip(AccurateRipVerify.CalculateAccurateRipId(toc2));
|
||||||
for (uint dtl = minDTL; dtl < minDTL + 75; dtl++)
|
if (_arVerify.AccResult != HttpStatusCode.NotFound)
|
||||||
{
|
{
|
||||||
toc2[toc2.TrackCount].Length = dtl;
|
DataTrackLength = dtl;
|
||||||
_arVerify.ContactAccurateRip(AccurateRipVerify.CalculateAccurateRipId(toc2));
|
break;
|
||||||
if (_arVerify.AccResult != HttpStatusCode.NotFound)
|
}
|
||||||
{
|
ShowProgress((string)"Contacting AccurateRip database...", 0, (dtl - minDTL) / 75.0, null, null);
|
||||||
DataTrackLength = dtl;
|
CheckStop();
|
||||||
break;
|
lock (this)
|
||||||
}
|
{
|
||||||
ShowProgress((string)"Contacting AccurateRip database...", 0, (dtl - minDTL) / 75.0, null, null);
|
Monitor.Wait(this, 500);
|
||||||
CheckStop();
|
|
||||||
lock (this)
|
|
||||||
{
|
|
||||||
Monitor.Wait(this, 500);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
_arVerify.ContactAccurateRip(_accurateRipId ?? AccurateRipVerify.CalculateAccurateRipId(_toc));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_arVerify.ContactAccurateRip(_accurateRipId ?? AccurateRipVerify.CalculateAccurateRipId(_toc));
|
||||||
|
}
|
||||||
|
_useAccurateRip = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Encoding Encoding {
|
public static Encoding Encoding {
|
||||||
@@ -2686,20 +2721,14 @@ return processor.Go();
|
|||||||
return pathIn.Length == 3 && pathIn.Substring(1) == ":\\" && new DriveInfo(pathIn).DriveType == DriveType.CDRom;
|
return pathIn.Length == 3 && pathIn.Substring(1) == ":\\" && new DriveInfo(pathIn).DriveType == DriveType.CDRom;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string GenerateOutputPath(CUEConfig _config, string format, NameValueCollection tags, string ext)
|
public string GenerateUniqueOutputPath(string format, string ext, CUEAction action, string pathIn)
|
||||||
{
|
{
|
||||||
string pathOut = General.ReplaceMultiple(format, tags);
|
return GenerateUniqueOutputPath(_config, format, ext, action, new NameValueCollection(), pathIn, this);
|
||||||
if (pathOut == null)
|
|
||||||
return String.Empty;
|
|
||||||
|
|
||||||
try { pathOut = Path.ChangeExtension(pathOut, ext); }
|
|
||||||
catch { pathOut = ""; }
|
|
||||||
return pathOut;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GenerateUniqueOutputPath(CUEConfig _config, string format, string ext, CUEAction action, NameValueCollection vars, string pathIn, CUESheet cueSheet)
|
public static string GenerateUniqueOutputPath(CUEConfig _config, string format, string ext, CUEAction action, NameValueCollection vars, string pathIn, CUESheet cueSheet)
|
||||||
{
|
{
|
||||||
if (pathIn.Length == 0 || (!IsCDROM(pathIn) && !File.Exists(pathIn) && !Directory.Exists(pathIn)))
|
if (pathIn == "" || (pathIn == null && action != CUEAction.Encode) || (pathIn != null && !IsCDROM(pathIn) && !File.Exists(pathIn) && !Directory.Exists(pathIn)))
|
||||||
return String.Empty;
|
return String.Empty;
|
||||||
if (action == CUEAction.Verify && _config.arLogToSourceFolder)
|
if (action == CUEAction.Verify && _config.arLogToSourceFolder)
|
||||||
return Path.ChangeExtension(pathIn, ".cue");
|
return Path.ChangeExtension(pathIn, ".cue");
|
||||||
@@ -2716,20 +2745,22 @@ return processor.Go();
|
|||||||
ext = ".20bit" + ext;
|
ext = ".20bit" + ext;
|
||||||
}
|
}
|
||||||
|
|
||||||
vars.Add("path", pathIn);
|
if (pathIn != null)
|
||||||
try
|
{
|
||||||
{
|
vars.Add("path", pathIn);
|
||||||
vars.Add("filename", Path.GetFileNameWithoutExtension(pathIn));
|
try
|
||||||
vars.Add("filename_ext", Path.GetFileName(pathIn));
|
{
|
||||||
vars.Add("directoryname", General.EmptyStringToNull(Path.GetDirectoryName(pathIn)));
|
vars.Add("filename", Path.GetFileNameWithoutExtension(pathIn));
|
||||||
|
vars.Add("filename_ext", Path.GetFileName(pathIn));
|
||||||
|
vars.Add("directoryname", General.EmptyStringToNull(Path.GetDirectoryName(pathIn)));
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
}
|
}
|
||||||
catch { }
|
|
||||||
vars.Add("music", Environment.GetFolderPath(Environment.SpecialFolder.MyMusic));
|
vars.Add("music", Environment.GetFolderPath(Environment.SpecialFolder.MyMusic));
|
||||||
bool rs = _config.replaceSpaces;
|
|
||||||
string artist = cueSheet == null ? "Artist" : cueSheet.Artist == "" ? "Unknown Artist" : cueSheet.Artist;
|
string artist = cueSheet == null ? "Artist" : cueSheet.Artist == "" ? "Unknown Artist" : cueSheet.Artist;
|
||||||
string album = cueSheet == null ? "Album" : cueSheet.Title == "" ? "Unknown Title" : cueSheet.Title;
|
string album = cueSheet == null ? "Album" : cueSheet.Title == "" ? "Unknown Title" : cueSheet.Title;
|
||||||
vars.Add("artist", General.EmptyStringToNull(_config.CleanseString(rs ? artist.Replace(' ', '_') : artist)));
|
vars.Add("artist", General.EmptyStringToNull(_config.CleanseString(artist)));
|
||||||
vars.Add("album", General.EmptyStringToNull(_config.CleanseString(rs ? album.Replace(' ', '_') : album)));
|
vars.Add("album", General.EmptyStringToNull(_config.CleanseString(album)));
|
||||||
|
|
||||||
if (cueSheet != null)
|
if (cueSheet != null)
|
||||||
{
|
{
|
||||||
@@ -2738,37 +2769,34 @@ return processor.Go();
|
|||||||
vars.Add("discnumber", General.EmptyStringToNull(cueSheet.DiscNumber));
|
vars.Add("discnumber", General.EmptyStringToNull(cueSheet.DiscNumber));
|
||||||
vars.Add("totaldiscs", General.EmptyStringToNull(cueSheet.TotalDiscs));
|
vars.Add("totaldiscs", General.EmptyStringToNull(cueSheet.TotalDiscs));
|
||||||
NameValueCollection tags = cueSheet.Tags;
|
NameValueCollection tags = cueSheet.Tags;
|
||||||
foreach (string tag in tags.AllKeys)
|
if (tags != null)
|
||||||
{
|
foreach (string tag in tags.AllKeys)
|
||||||
string key = tag.ToLower();
|
{
|
||||||
string val = tags[tag];
|
string key = tag.ToLower();
|
||||||
if (vars.Get(key) == null && val != null && val != "")
|
string val = tags[tag];
|
||||||
vars.Add(key, _config.CleanseString(rs ? val.Replace(' ', '_') : val));
|
if (vars.Get(key) == null && val != null && val != "")
|
||||||
}
|
vars.Add(key, _config.CleanseString(val));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
vars.Add("unique", null);
|
vars.Add("unique", null);
|
||||||
string outputPath = GenerateOutputPath(_config, format, vars, ext);
|
|
||||||
if (outputPath == String.Empty)
|
|
||||||
return outputPath;
|
|
||||||
|
|
||||||
int unique = 1;
|
string outputPath = General.ReplaceMultiple(format, vars, "unique",
|
||||||
try
|
(General.CheckIfExists)delegate(string pathOut) {
|
||||||
{
|
return File.Exists(Path.ChangeExtension(pathOut, ext));
|
||||||
while (File.Exists(outputPath))
|
});
|
||||||
{
|
if (outputPath == "" || outputPath == null)
|
||||||
vars["unique"] = unique.ToString();
|
return "";
|
||||||
string newPath = GenerateOutputPath(_config, format, vars, ext);
|
try { outputPath = Path.ChangeExtension(outputPath, ext); }
|
||||||
if (newPath == outputPath || newPath == String.Empty)
|
catch { outputPath = ""; }
|
||||||
break;
|
|
||||||
outputPath = newPath;
|
|
||||||
unique++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch { }
|
|
||||||
return outputPath;
|
return outputPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool CheckIfFileExists(string output)
|
||||||
|
{
|
||||||
|
return File.Exists(Path.Combine(OutputDir, output));
|
||||||
|
}
|
||||||
|
|
||||||
public void GenerateFilenames(AudioEncoderType audioEncoderType, string format, string outputPath)
|
public void GenerateFilenames(AudioEncoderType audioEncoderType, string format, string outputPath)
|
||||||
{
|
{
|
||||||
_audioEncoderType = audioEncoderType;
|
_audioEncoderType = audioEncoderType;
|
||||||
@@ -2777,29 +2805,22 @@ return processor.Go();
|
|||||||
_outputPath = outputPath;
|
_outputPath = outputPath;
|
||||||
|
|
||||||
string extension = "." + format;
|
string extension = "." + format;
|
||||||
List<string> find, replace;
|
|
||||||
string filename;
|
string filename;
|
||||||
int iTrack;
|
int iTrack;
|
||||||
|
|
||||||
find = new List<string>();
|
NameValueCollection vars = new NameValueCollection();
|
||||||
replace = new List<string>();
|
vars.Add("unique", null);
|
||||||
|
vars.Add("album artist", General.EmptyStringToNull(_config.CleanseString(Artist)));
|
||||||
find.Add("%D"); // 0: Album artist
|
vars.Add("artist", General.EmptyStringToNull(_config.CleanseString(Artist)));
|
||||||
find.Add("%C"); // 1: Album title
|
vars.Add("album", General.EmptyStringToNull(_config.CleanseString(Title)));
|
||||||
find.Add("%N"); // 2: Track number
|
vars.Add("year", General.EmptyStringToNull(_config.CleanseString(Year)));
|
||||||
find.Add("%A"); // 3: Track artist
|
vars.Add("catalog", General.EmptyStringToNull(_config.CleanseString(Catalog)));
|
||||||
find.Add("%T"); // 4: Track title
|
vars.Add("discnumber", General.EmptyStringToNull(_config.CleanseString(DiscNumber)));
|
||||||
find.Add("%F"); // 5: Input filename
|
vars.Add("totaldiscs", General.EmptyStringToNull(_config.CleanseString(TotalDiscs)));
|
||||||
find.Add("%Y"); // 6: Album date
|
vars.Add("filename", Path.GetFileNameWithoutExtension(outputPath));
|
||||||
|
vars.Add("tracknumber", null);
|
||||||
replace.Add(General.EmptyStringToNull(_config.CleanseString(Artist)));
|
vars.Add("title", null);
|
||||||
replace.Add(General.EmptyStringToNull(_config.CleanseString(Title)));
|
|
||||||
replace.Add(null);
|
|
||||||
replace.Add(null);
|
|
||||||
replace.Add(null);
|
|
||||||
replace.Add(Path.GetFileNameWithoutExtension(outputPath));
|
|
||||||
replace.Add(General.EmptyStringToNull(_config.CleanseString(Year)));
|
|
||||||
|
|
||||||
if (_config.detectHDCD && _config.decodeHDCD && (!_outputLossyWAV || !_config.decodeHDCDtoLW16))
|
if (_config.detectHDCD && _config.decodeHDCD && (!_outputLossyWAV || !_config.decodeHDCDtoLW16))
|
||||||
{
|
{
|
||||||
if (_config.decodeHDCDto24bit )
|
if (_config.decodeHDCDto24bit )
|
||||||
@@ -2808,21 +2829,17 @@ return processor.Go();
|
|||||||
extension = ".20bit" + extension;
|
extension = ".20bit" + extension;
|
||||||
}
|
}
|
||||||
|
|
||||||
ArLogFileName = General.ReplaceMultiple(_config.arLogFilenameFormat, find, replace) ?? Path.ChangeExtension(outputPath, ".accurip");
|
ArLogFileName = General.ReplaceMultiple(_config.arLogFilenameFormat, vars, "unique", CheckIfFileExists)
|
||||||
AlArtFileName = General.ReplaceMultiple(_config.alArtFilenameFormat, find, replace) ?? "Folder.jpg";
|
?? vars["%filename%"] + ".accurip";
|
||||||
|
AlArtFileName = General.ReplaceMultiple(_config.alArtFilenameFormat, vars, "unique", CheckIfFileExists)
|
||||||
|
?? "folder.jpg";
|
||||||
|
|
||||||
if (_config.keepOriginalFilenames && HasSingleFilename)
|
if (OutputStyle == CUEStyle.SingleFileWithCUE)
|
||||||
{
|
SingleFilename = Path.ChangeExtension(Path.GetFileName(outputPath), extension);
|
||||||
|
else if (_config.keepOriginalFilenames && HasSingleFilename)
|
||||||
SingleFilename = Path.ChangeExtension(SingleFilename, extension);
|
SingleFilename = Path.ChangeExtension(SingleFilename, extension);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
SingleFilename = (General.ReplaceMultiple(_config.singleFilenameFormat, vars) ?? "range") + extension;
|
||||||
filename = General.ReplaceMultiple(_config.singleFilenameFormat, find, replace);
|
|
||||||
if (filename == null)
|
|
||||||
filename = "Range";
|
|
||||||
filename += extension;
|
|
||||||
SingleFilename = filename;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (iTrack = -1; iTrack < TrackCount; iTrack++)
|
for (iTrack = -1; iTrack < TrackCount; iTrack++)
|
||||||
{
|
{
|
||||||
@@ -2843,23 +2860,16 @@ return processor.Go();
|
|||||||
string artist = Tracks[htoa ? 0 : iTrack].Artist;
|
string artist = Tracks[htoa ? 0 : iTrack].Artist;
|
||||||
string title = htoa ? "(HTOA)" : Tracks[iTrack].Title;
|
string title = htoa ? "(HTOA)" : Tracks[iTrack].Title;
|
||||||
|
|
||||||
replace[2] = trackStr;
|
vars["tracknumber"] = trackStr;
|
||||||
replace[3] = General.EmptyStringToNull(_config.CleanseString(artist==""?Artist:artist));
|
vars["artist"] = General.EmptyStringToNull(_config.CleanseString(artist)) ?? vars["album artist"];
|
||||||
replace[4] = General.EmptyStringToNull(_config.CleanseString(title));
|
vars["title"] = General.EmptyStringToNull(_config.CleanseString(title));
|
||||||
|
|
||||||
filename = General.ReplaceMultiple(_config.trackFilenameFormat, find, replace);
|
filename = (General.ReplaceMultiple(_config.trackFilenameFormat, vars) ?? vars["tracknumber"]) + extension;
|
||||||
if (filename == null)
|
|
||||||
filename = replace[2];
|
|
||||||
filename += extension;
|
|
||||||
|
|
||||||
if (htoa)
|
if (htoa)
|
||||||
{
|
|
||||||
HTOAFilename = filename;
|
HTOAFilename = filename;
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
TrackFilenames[iTrack] = filename;
|
TrackFilenames[iTrack] = filename;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2880,6 +2890,34 @@ return processor.Go();
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool OutputExists()
|
||||||
|
{
|
||||||
|
bool outputExists = false;
|
||||||
|
bool outputCUE = Action == CUEAction.Encode && (OutputStyle != CUEStyle.SingleFileWithCUE || _config.createCUEFileWhenEmbedded);
|
||||||
|
bool outputAudio = Action == CUEAction.Encode && _audioEncoderType != AudioEncoderType.NoAudio;
|
||||||
|
if (outputCUE)
|
||||||
|
outputExists = File.Exists(_outputPath);
|
||||||
|
if (_useAccurateRip && (
|
||||||
|
(Action == CUEAction.Encode && _config.writeArLogOnConvert) ||
|
||||||
|
(Action == CUEAction.Verify && _config.writeArLogOnVerify)))
|
||||||
|
outputExists |= File.Exists(Path.Combine(OutputDir, ArLogFileName));
|
||||||
|
if (outputAudio)
|
||||||
|
{
|
||||||
|
if (_config.extractAlbumArt && AlbumArt != null && AlbumArt.Length != 0)
|
||||||
|
outputExists |= File.Exists(Path.Combine(OutputDir, AlArtFileName));
|
||||||
|
if (OutputStyle == CUEStyle.SingleFile || OutputStyle == CUEStyle.SingleFileWithCUE)
|
||||||
|
outputExists |= File.Exists(Path.Combine(OutputDir, SingleFilename));
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (OutputStyle == CUEStyle.GapsAppended && _config.preserveHTOA)
|
||||||
|
outputExists |= File.Exists(Path.Combine(OutputDir, HTOAFilename));
|
||||||
|
for (int i = 0; i < TrackCount; i++)
|
||||||
|
outputExists |= File.Exists(Path.Combine(OutputDir, TrackFilenames[i]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return outputExists;
|
||||||
|
}
|
||||||
|
|
||||||
private int GetSampleLength(string path, out TagLib.File fileInfo)
|
private int GetSampleLength(string path, out TagLib.File fileInfo)
|
||||||
{
|
{
|
||||||
ShowProgress("Analyzing input file...", 0.0, 0.0, path, null);
|
ShowProgress("Analyzing input file...", 0.0, 0.0, path, null);
|
||||||
@@ -3158,7 +3196,7 @@ return processor.Go();
|
|||||||
logWriter.WriteLine("Track {0} contains {1} errors", iTrack + 1, cdErrors);
|
logWriter.WriteLine("Track {0} contains {1} errors", iTrack + 1, cdErrors);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (_action != CUEAction.Convert)
|
if (_useAccurateRip)
|
||||||
{
|
{
|
||||||
logWriter.WriteLine();
|
logWriter.WriteLine();
|
||||||
logWriter.WriteLine("AccurateRip summary");
|
logWriter.WriteLine("AccurateRip summary");
|
||||||
@@ -3216,7 +3254,7 @@ return processor.Go();
|
|||||||
|
|
||||||
using (sw)
|
using (sw)
|
||||||
{
|
{
|
||||||
if (_config.writeArTagsOnConvert)
|
if (_config.writeArTagsOnEncode)
|
||||||
WriteLine(sw, 0, "REM ACCURATERIPID " + (_accurateRipId ?? AccurateRipVerify.CalculateAccurateRipId(_toc)));
|
WriteLine(sw, 0, "REM ACCURATERIPID " + (_accurateRipId ?? AccurateRipVerify.CalculateAccurateRipId(_toc)));
|
||||||
|
|
||||||
for (i = 0; i < _attributes.Count; i++)
|
for (i = 0; i < _attributes.Count; i++)
|
||||||
@@ -3316,8 +3354,7 @@ return processor.Go();
|
|||||||
string prefix = "";
|
string prefix = "";
|
||||||
if (hdcdDecoder != null && hdcdDecoder.Detected)
|
if (hdcdDecoder != null && hdcdDecoder.Detected)
|
||||||
prefix += "hdcd detected, ";
|
prefix += "hdcd detected, ";
|
||||||
if (_action == CUEAction.Verify ||
|
if (_useAccurateRip)
|
||||||
(_action == CUEAction.VerifyAndConvert && _audioEncoderType != AudioEncoderType.NoAudio))
|
|
||||||
{
|
{
|
||||||
if (_arVerify.ARStatus != null)
|
if (_arVerify.ARStatus != null)
|
||||||
prefix += _arVerify.ARStatus;
|
prefix += _arVerify.ARStatus;
|
||||||
@@ -3418,8 +3455,8 @@ return processor.Go();
|
|||||||
bool htoaToFile = ((OutputStyle == CUEStyle.GapsAppended) && _config.preserveHTOA &&
|
bool htoaToFile = ((OutputStyle == CUEStyle.GapsAppended) && _config.preserveHTOA &&
|
||||||
(_toc.Pregap != 0));
|
(_toc.Pregap != 0));
|
||||||
|
|
||||||
if (_isCD && (OutputStyle == CUEStyle.GapsLeftOut || OutputStyle == CUEStyle.GapsPrepended) && (_action == CUEAction.Convert || _action == CUEAction.VerifyAndConvert))
|
if (_isCD && (OutputStyle == CUEStyle.GapsLeftOut || OutputStyle == CUEStyle.GapsPrepended))
|
||||||
throw new Exception("When ripping a CD, gaps Left Out/Gaps prepended modes can only be used in verify-then-convert mode");
|
throw new Exception("Gaps Left Out/Gaps prepended modes cannot be used when ripping a CD");
|
||||||
|
|
||||||
if (_usePregapForFirstTrackInSingleFile)
|
if (_usePregapForFirstTrackInSingleFile)
|
||||||
throw new Exception("UsePregapForFirstTrackInSingleFile is not supported for writing audio files.");
|
throw new Exception("UsePregapForFirstTrackInSingleFile is not supported for writing audio files.");
|
||||||
@@ -3444,15 +3481,17 @@ return processor.Go();
|
|||||||
|
|
||||||
if (_audioEncoderType != AudioEncoderType.NoAudio || _action == CUEAction.Verify)
|
if (_audioEncoderType != AudioEncoderType.NoAudio || _action == CUEAction.Verify)
|
||||||
WriteAudioFilesPass(OutputDir, OutputStyle, destLengths, htoaToFile, _action == CUEAction.Verify);
|
WriteAudioFilesPass(OutputDir, OutputStyle, destLengths, htoaToFile, _action == CUEAction.Verify);
|
||||||
|
|
||||||
CreateRipperLOG();
|
CreateRipperLOG();
|
||||||
if (_action == CUEAction.Convert || _action == CUEAction.VerifyAndConvert)
|
|
||||||
|
if (_action == CUEAction.Encode)
|
||||||
{
|
{
|
||||||
string cueContents = CUESheetContents(OutputStyle);
|
string cueContents = CUESheetContents(OutputStyle);
|
||||||
uint tracksMatch = 0;
|
uint tracksMatch = 0;
|
||||||
int bestOffset = 0;
|
int bestOffset = 0;
|
||||||
|
|
||||||
if (_action != CUEAction.Convert &&
|
if (_useAccurateRip &&
|
||||||
_config.writeArTagsOnConvert &&
|
_config.writeArTagsOnEncode &&
|
||||||
_arVerify.AccResult == HttpStatusCode.OK)
|
_arVerify.AccResult == HttpStatusCode.OK)
|
||||||
FindBestOffset(1, true, out tracksMatch, out bestOffset);
|
FindBestOffset(1, true, out tracksMatch, out bestOffset);
|
||||||
|
|
||||||
@@ -3469,6 +3508,9 @@ return processor.Go();
|
|||||||
if (_eacLog != null && _config.extractLog)
|
if (_eacLog != null && _config.extractLog)
|
||||||
WriteText(Path.ChangeExtension(_outputPath, ".log"), _eacLog);
|
WriteText(Path.ChangeExtension(_outputPath, ".log"), _eacLog);
|
||||||
|
|
||||||
|
if (_audioEncoderType != AudioEncoderType.NoAudio && _config.extractAlbumArt)
|
||||||
|
ExtractAlbumArt();
|
||||||
|
|
||||||
if (OutputStyle == CUEStyle.SingleFileWithCUE || OutputStyle == CUEStyle.SingleFile)
|
if (OutputStyle == CUEStyle.SingleFileWithCUE || OutputStyle == CUEStyle.SingleFile)
|
||||||
{
|
{
|
||||||
if (OutputStyle == CUEStyle.SingleFileWithCUE && _config.createCUEFileWhenEmbedded)
|
if (OutputStyle == CUEStyle.SingleFileWithCUE && _config.createCUEFileWhenEmbedded)
|
||||||
@@ -3524,7 +3566,9 @@ return processor.Go();
|
|||||||
fileInfo.Tag.Year = sourceFileInfo.Tag.Year;
|
fileInfo.Tag.Year = sourceFileInfo.Tag.Year;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProcessAlbumArt(fileInfo);
|
if ((_config.embedAlbumArt || _config.copyAlbumArt) && _albumArt != null && _albumArt.Length > 0)
|
||||||
|
fileInfo.Tag.Pictures = _albumArt;
|
||||||
|
|
||||||
fileInfo.Save();
|
fileInfo.Save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3594,7 +3638,9 @@ return processor.Go();
|
|||||||
fileInfo.Tag.Genres = sourceFileInfo.Tag.Genres;
|
fileInfo.Tag.Genres = sourceFileInfo.Tag.Genres;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProcessAlbumArt(fileInfo);
|
if ((_config.embedAlbumArt || _config.copyAlbumArt) && _albumArt != null && _albumArt.Length > 0)
|
||||||
|
fileInfo.Tag.Pictures = _albumArt;
|
||||||
|
|
||||||
fileInfo.Save();
|
fileInfo.Save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3634,14 +3680,6 @@ return processor.Go();
|
|||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ProcessAlbumArt(TagLib.File destFileInfo)
|
|
||||||
{
|
|
||||||
ResizeAlbumArt();
|
|
||||||
ExtractAlbumArt();
|
|
||||||
if ((_config.embedAlbumArt || _config.copyAlbumArt) && _albumArt != null)
|
|
||||||
destFileInfo.Tag.Pictures = _albumArt;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ExtractAlbumArt()
|
public void ExtractAlbumArt()
|
||||||
{
|
{
|
||||||
if (!_config.extractAlbumArt || _albumArt == null || _albumArt.Length == 0)
|
if (!_config.extractAlbumArt || _albumArt == null || _albumArt.Length == 0)
|
||||||
@@ -3725,8 +3763,7 @@ return processor.Go();
|
|||||||
|
|
||||||
public string WriteReport()
|
public string WriteReport()
|
||||||
{
|
{
|
||||||
if (_action == CUEAction.Verify ||
|
if (_useAccurateRip)
|
||||||
(_action != CUEAction.Convert && _audioEncoderType != AudioEncoderType.NoAudio))
|
|
||||||
{
|
{
|
||||||
ShowProgress((string)"Generating AccurateRip report...", 0, 0, null, null);
|
ShowProgress((string)"Generating AccurateRip report...", 0, 0, null, null);
|
||||||
if (_action == CUEAction.Verify && _config.writeArTagsOnVerify && _writeOffset == 0 && !_isArchive && !_isCD)
|
if (_action == CUEAction.Verify && _config.writeArTagsOnVerify && _writeOffset == 0 && !_isArchive && !_isCD)
|
||||||
@@ -3833,7 +3870,7 @@ return processor.Go();
|
|||||||
//CleanupTags(destTags, "REPLAYGAIN");
|
//CleanupTags(destTags, "REPLAYGAIN");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_config.writeArTagsOnConvert && _action == CUEAction.VerifyAndConvert && _arVerify.AccResult == HttpStatusCode.OK)
|
if (_config.writeArTagsOnEncode && _action == CUEAction.Encode && _useAccurateRip && _arVerify.AccResult == HttpStatusCode.OK)
|
||||||
GenerateAccurateRipTags(destTags, bestOffset, iTrack);
|
GenerateAccurateRipTags(destTags, bestOffset, iTrack);
|
||||||
|
|
||||||
return destTags;
|
return destTags;
|
||||||
@@ -3904,7 +3941,7 @@ return processor.Go();
|
|||||||
if (_config.embedLog && logContents != null)
|
if (_config.embedLog && logContents != null)
|
||||||
destTags.Add("LOG", logContents);
|
destTags.Add("LOG", logContents);
|
||||||
|
|
||||||
if (fWithCUE && _config.writeArTagsOnConvert && _action == CUEAction.VerifyAndConvert && _arVerify.AccResult == HttpStatusCode.OK)
|
if (fWithCUE && _config.writeArTagsOnEncode && _action == CUEAction.Encode && _useAccurateRip && _arVerify.AccResult == HttpStatusCode.OK)
|
||||||
GenerateAccurateRipTags(destTags, bestOffset, -1);
|
GenerateAccurateRipTags(destTags, bestOffset, -1);
|
||||||
|
|
||||||
return destTags;
|
return destTags;
|
||||||
@@ -3975,7 +4012,7 @@ return processor.Go();
|
|||||||
if (style == CUEStyle.SingleFile || style == CUEStyle.SingleFileWithCUE)
|
if (style == CUEStyle.SingleFile || style == CUEStyle.SingleFileWithCUE)
|
||||||
{
|
{
|
||||||
iDest++;
|
iDest++;
|
||||||
audioDest = GetAudioDest(_destPaths[iDest], destLengths[iDest], hdcdDecoder != null && hdcdDecoder.Decoding ? hdcdDecoder.BitsPerSample : 16, noOutput);
|
audioDest = GetAudioDest(_destPaths[iDest], destLengths[iDest], hdcdDecoder != null && hdcdDecoder.Decoding ? hdcdDecoder.BitsPerSample : 16, _padding, noOutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint currentOffset = 0, previousOffset = 0;
|
uint currentOffset = 0, previousOffset = 0;
|
||||||
@@ -3983,7 +4020,7 @@ return processor.Go();
|
|||||||
uint diskLength = 588 * _toc.AudioLength;
|
uint diskLength = 588 * _toc.AudioLength;
|
||||||
uint diskOffset = 0;
|
uint diskOffset = 0;
|
||||||
|
|
||||||
if (_action != CUEAction.Convert)
|
if (_useAccurateRip)
|
||||||
_arVerify.Init();
|
_arVerify.Init();
|
||||||
|
|
||||||
ShowProgress(String.Format("{2} track {0:00} ({1:00}%)...", 0, 0, noOutput ? "Verifying" : "Writing"), 0, 0.0, null, null);
|
ShowProgress(String.Format("{2} track {0:00} ({1:00}%)...", 0, 0, noOutput ? "Verifying" : "Writing"), 0, 0.0, null, null);
|
||||||
@@ -4003,7 +4040,7 @@ return processor.Go();
|
|||||||
hdcdDecoder.AudioDest = null;
|
hdcdDecoder.AudioDest = null;
|
||||||
if (audioDest != null)
|
if (audioDest != null)
|
||||||
audioDest.Close();
|
audioDest.Close();
|
||||||
audioDest = GetAudioDest(_destPaths[iDest], destLengths[iDest], hdcdDecoder != null && hdcdDecoder.Decoding ? hdcdDecoder.BitsPerSample : 16, noOutput);
|
audioDest = GetAudioDest(_destPaths[iDest], destLengths[iDest], hdcdDecoder != null && hdcdDecoder.Decoding ? hdcdDecoder.BitsPerSample : 16, _padding, noOutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (iIndex = 0; iIndex <= _toc[_toc.FirstAudio + iTrack].LastIndex; iIndex++)
|
for (iIndex = 0; iIndex <= _toc[_toc.FirstAudio + iTrack].LastIndex; iIndex++)
|
||||||
@@ -4024,7 +4061,7 @@ return processor.Go();
|
|||||||
if (audioDest != null)
|
if (audioDest != null)
|
||||||
audioDest.Close();
|
audioDest.Close();
|
||||||
iDest++;
|
iDest++;
|
||||||
audioDest = GetAudioDest(_destPaths[iDest], destLengths[iDest], hdcdDecoder != null && hdcdDecoder.Decoding ? hdcdDecoder.BitsPerSample : 16, noOutput);
|
audioDest = GetAudioDest(_destPaths[iDest], destLengths[iDest], hdcdDecoder != null && hdcdDecoder.Decoding ? hdcdDecoder.BitsPerSample : 16, _padding, noOutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((style == CUEStyle.GapsAppended) && (iIndex == 0) && (iTrack == 0))
|
if ((style == CUEStyle.GapsAppended) && (iIndex == 0) && (iTrack == 0))
|
||||||
@@ -4033,7 +4070,7 @@ return processor.Go();
|
|||||||
if (htoaToFile)
|
if (htoaToFile)
|
||||||
{
|
{
|
||||||
iDest++;
|
iDest++;
|
||||||
audioDest = GetAudioDest(_destPaths[iDest], destLengths[iDest], hdcdDecoder != null && hdcdDecoder.Decoding ? hdcdDecoder.BitsPerSample : 16, noOutput);
|
audioDest = GetAudioDest(_destPaths[iDest], destLengths[iDest], hdcdDecoder != null && hdcdDecoder.Decoding ? hdcdDecoder.BitsPerSample : 16, _padding, noOutput);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ((style == CUEStyle.GapsLeftOut) && (iIndex == 0))
|
else if ((style == CUEStyle.GapsLeftOut) && (iIndex == 0))
|
||||||
@@ -4096,7 +4133,7 @@ return processor.Go();
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (_action != CUEAction.Convert)
|
if (_useAccurateRip)
|
||||||
_arVerify.Write(sampleBuffer, copyCount);
|
_arVerify.Write(sampleBuffer, copyCount);
|
||||||
if (iTrack > 0 || iIndex > 0)
|
if (iTrack > 0 || iIndex > 0)
|
||||||
Tracks[iTrack + (iIndex == 0 ? -1 : 0)].MeasurePeakLevel(sampleBuffer, copyCount);
|
Tracks[iTrack + (iIndex == 0 ? -1 : 0)].MeasurePeakLevel(sampleBuffer, copyCount);
|
||||||
@@ -4400,11 +4437,11 @@ return processor.Go();
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private IAudioDest GetAudioDest(string path, int finalSampleCount, int bps, bool noOutput)
|
private IAudioDest GetAudioDest(string path, int finalSampleCount, int bps, int padding, bool noOutput)
|
||||||
{
|
{
|
||||||
if (noOutput)
|
if (noOutput)
|
||||||
return new DummyWriter(path, bps, 2, 44100);
|
return new DummyWriter(path, bps, 2, 44100);
|
||||||
return AudioReadWrite.GetAudioDest(_audioEncoderType, path, finalSampleCount, bps, 44100, _config);
|
return AudioReadWrite.GetAudioDest(_audioEncoderType, path, finalSampleCount, bps, 44100, padding, _config);
|
||||||
}
|
}
|
||||||
|
|
||||||
private IAudioSource GetAudioSource(int sourceIndex) {
|
private IAudioSource GetAudioSource(int sourceIndex) {
|
||||||
@@ -4934,7 +4971,7 @@ return processor.Go();
|
|||||||
if (tracksMatch * 100 >= Config.fixOffsetMinimumTracksPercent * TrackCount)
|
if (tracksMatch * 100 >= Config.fixOffsetMinimumTracksPercent * TrackCount)
|
||||||
{
|
{
|
||||||
WriteOffset = bestOffset;
|
WriteOffset = bestOffset;
|
||||||
Action = CUEAction.VerifyAndConvert;
|
Action = CUEAction.Encode;
|
||||||
status = Go();
|
status = Go();
|
||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
@@ -4953,7 +4990,7 @@ return processor.Go();
|
|||||||
FindBestOffset(Config.encodeWhenConfidence, false, out tracksMatch, out bestOffset);
|
FindBestOffset(Config.encodeWhenConfidence, false, out tracksMatch, out bestOffset);
|
||||||
if (tracksMatch * 100 >= Config.encodeWhenPercent * TrackCount && (!_config.encodeWhenZeroOffset || bestOffset == 0))
|
if (tracksMatch * 100 >= Config.encodeWhenPercent * TrackCount && (!_config.encodeWhenZeroOffset || bestOffset == 0))
|
||||||
{
|
{
|
||||||
Action = CUEAction.VerifyAndConvert;
|
Action = CUEAction.Encode;
|
||||||
status = Go();
|
status = Go();
|
||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
|
|||||||
@@ -156,6 +156,6 @@ hdcd.dll (c) Christopher Key
|
|||||||
<value>439, 296</value>
|
<value>439, 296</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="$this.Text" xml:space="preserve">
|
<data name="$this.Text" xml:space="preserve">
|
||||||
<value>CUETools v1.9.5: О программе</value>
|
<value>CUETools: О программе</value>
|
||||||
</data>
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -114,17 +114,28 @@ namespace JDP
|
|||||||
|
|
||||||
pathIn = Path.GetFullPath(pathIn);
|
pathIn = Path.GetFullPath(pathIn);
|
||||||
|
|
||||||
textBox1.Text += "Processing " + pathIn + ":\r\n";
|
this.Invoke((MethodInvoker)delegate()
|
||||||
textBox1.Select(0, 0);
|
{
|
||||||
|
textBox1.Text += "Processing " + pathIn + ":\r\n";
|
||||||
|
textBox1.Select(0, 0);
|
||||||
|
});
|
||||||
|
|
||||||
if (!File.Exists(pathIn) && !Directory.Exists(pathIn))
|
if (!File.Exists(pathIn) && !Directory.Exists(pathIn))
|
||||||
throw new Exception("Input CUE Sheet not found.");
|
throw new Exception("Input CUE Sheet not found.");
|
||||||
|
|
||||||
|
if (_profile._action == CUEAction.CorrectFilenames)
|
||||||
|
throw new Exception("CorrectFilenames action not yet supported in commandline mode.");
|
||||||
|
if (_profile._action == CUEAction.CreateDummyCUE)
|
||||||
|
throw new Exception("CreateDummyCUE action not yet supported in commandline mode.");
|
||||||
|
|
||||||
|
bool useAR = _profile._action == CUEAction.Verify || _profile._useAccurateRip;
|
||||||
|
|
||||||
cueSheet.Action = _profile._action;
|
cueSheet.Action = _profile._action;
|
||||||
cueSheet.OutputStyle = _profile._CUEStyle;
|
cueSheet.OutputStyle = _profile._CUEStyle;
|
||||||
cueSheet.WriteOffset = _profile._writeOffset;
|
cueSheet.WriteOffset = _profile._writeOffset;
|
||||||
cueSheet.Open(pathIn);
|
cueSheet.Open(pathIn);
|
||||||
cueSheet.Lookup();
|
if (useAR)
|
||||||
|
cueSheet.UseAccurateRip();
|
||||||
|
|
||||||
pathOut = CUESheet.GenerateUniqueOutputPath(_config,
|
pathOut = CUESheet.GenerateUniqueOutputPath(_config,
|
||||||
_profile._outputTemplate,
|
_profile._outputTemplate,
|
||||||
@@ -137,10 +148,8 @@ namespace JDP
|
|||||||
throw new Exception("Could not generate output path.");
|
throw new Exception("Could not generate output path.");
|
||||||
|
|
||||||
cueSheet.GenerateFilenames(_profile._outputAudioType, _profile._outputAudioFormat, pathOut);
|
cueSheet.GenerateFilenames(_profile._outputAudioType, _profile._outputAudioFormat, pathOut);
|
||||||
if (_profile._action != CUEAction.Verify && _profile._CUEStyle == CUEStyle.SingleFileWithCUE)
|
|
||||||
cueSheet.SingleFilename = Path.ChangeExtension(Path.GetFileName(pathOut), "." + _profile._outputAudioFormat);
|
|
||||||
|
|
||||||
cueSheet.UsePregapForFirstTrackInSingleFile = false;
|
cueSheet.UsePregapForFirstTrackInSingleFile = false;
|
||||||
|
|
||||||
if (script == null)
|
if (script == null)
|
||||||
cueSheet.Go();
|
cueSheet.Go();
|
||||||
else
|
else
|
||||||
@@ -158,7 +167,7 @@ namespace JDP
|
|||||||
textBox1.Text += cueSheet.LOGContents;
|
textBox1.Text += cueSheet.LOGContents;
|
||||||
textBox1.Show();
|
textBox1.Show();
|
||||||
}
|
}
|
||||||
else if (cueSheet.Action != CUEAction.Convert)
|
else if (useAR)
|
||||||
{
|
{
|
||||||
StringWriter sw = new StringWriter();
|
StringWriter sw = new StringWriter();
|
||||||
cueSheet.GenerateAccurateRipLog(sw);
|
cueSheet.GenerateAccurateRipLog(sw);
|
||||||
|
|||||||
3
CUETools/frmCUETools.Designer.cs
generated
3
CUETools/frmCUETools.Designer.cs
generated
@@ -629,15 +629,18 @@ namespace JDP {
|
|||||||
// toolStripOutput
|
// toolStripOutput
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.toolStripOutput, "toolStripOutput");
|
resources.ApplyResources(this.toolStripOutput, "toolStripOutput");
|
||||||
|
this.toolStripOutput.GripMargin = new System.Windows.Forms.Padding(0);
|
||||||
this.toolStripOutput.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
|
this.toolStripOutput.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
|
||||||
this.toolStripOutput.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
this.toolStripOutput.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
this.toolStripLabelOutput,
|
this.toolStripLabelOutput,
|
||||||
this.toolStripSplitButtonOutputBrowser});
|
this.toolStripSplitButtonOutputBrowser});
|
||||||
|
this.toolStripOutput.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow;
|
||||||
this.toolStripOutput.Name = "toolStripOutput";
|
this.toolStripOutput.Name = "toolStripOutput";
|
||||||
this.toolStripOutput.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
|
this.toolStripOutput.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
|
||||||
//
|
//
|
||||||
// toolStripLabelOutput
|
// toolStripLabelOutput
|
||||||
//
|
//
|
||||||
|
this.toolStripLabelOutput.Margin = new System.Windows.Forms.Padding(0);
|
||||||
this.toolStripLabelOutput.Name = "toolStripLabelOutput";
|
this.toolStripLabelOutput.Name = "toolStripLabelOutput";
|
||||||
resources.ApplyResources(this.toolStripLabelOutput, "toolStripLabelOutput");
|
resources.ApplyResources(this.toolStripLabelOutput, "toolStripLabelOutput");
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -256,26 +256,6 @@ namespace JDP {
|
|||||||
if (_reducePriority)
|
if (_reducePriority)
|
||||||
Process.GetCurrentProcess().PriorityClass = System.Diagnostics.ProcessPriorityClass.Idle;
|
Process.GetCurrentProcess().PriorityClass = System.Diagnostics.ProcessPriorityClass.Idle;
|
||||||
|
|
||||||
//fileSystemTreeView1.CheckBoxes = FileBrowserState == FileBrowserStateEnum.Checkboxes;
|
|
||||||
//fileSystemTreeView1.IconManager = m_icon_mgr;
|
|
||||||
//if (InputPath != "")
|
|
||||||
//{
|
|
||||||
// TreeNode node = null;
|
|
||||||
// try
|
|
||||||
// {
|
|
||||||
// node = fileSystemTreeView1.LookupNode(InputPath) ??
|
|
||||||
// fileSystemTreeView1.LookupNode(Path.GetDirectoryName(InputPath));
|
|
||||||
// }
|
|
||||||
// catch
|
|
||||||
// {
|
|
||||||
// }
|
|
||||||
// if (node != null)
|
|
||||||
// {
|
|
||||||
// fileSystemTreeView1.SelectedNode = node;
|
|
||||||
// node.Expand();
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
motdImage = null;
|
motdImage = null;
|
||||||
if (File.Exists(MOTDImagePath))
|
if (File.Exists(MOTDImagePath))
|
||||||
using (FileStream imageStream = new FileStream(MOTDImagePath, FileMode.Open, FileAccess.Read))
|
using (FileStream imageStream = new FileStream(MOTDImagePath, FileMode.Open, FileAccess.Read))
|
||||||
@@ -495,6 +475,8 @@ namespace JDP {
|
|||||||
CUEToolsScript script = (CUEToolsScript)p[6];
|
CUEToolsScript script = (CUEToolsScript)p[6];
|
||||||
DialogResult dlgRes = DialogResult.OK;
|
DialogResult dlgRes = DialogResult.OK;
|
||||||
string status = null;
|
string status = null;
|
||||||
|
bool outputAudio = action == CUEAction.Encode && audioEncoderType != AudioEncoderType.NoAudio;
|
||||||
|
bool useAR = action == CUEAction.Verify || (outputAudio && checkBoxUseAccurateRip.Checked);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -743,7 +725,6 @@ namespace JDP {
|
|||||||
}
|
}
|
||||||
else if (File.Exists(pathIn) || IsCDROM(pathIn))
|
else if (File.Exists(pathIn) || IsCDROM(pathIn))
|
||||||
{
|
{
|
||||||
bool convertAction = action == CUEAction.Convert || action == CUEAction.VerifyAndConvert;
|
|
||||||
string pathOut = null;
|
string pathOut = null;
|
||||||
List<object> releases = null;
|
List<object> releases = null;
|
||||||
|
|
||||||
@@ -753,12 +734,14 @@ namespace JDP {
|
|||||||
cueSheet.Action = action;
|
cueSheet.Action = action;
|
||||||
cueSheet.OutputStyle = cueStyle;
|
cueSheet.OutputStyle = cueStyle;
|
||||||
cueSheet.Open(pathIn);
|
cueSheet.Open(pathIn);
|
||||||
if (action != CUEAction.Convert)
|
|
||||||
cueSheet.DataTrackLengthMSF = txtDataTrackLength.Text;
|
|
||||||
cueSheet.PreGapLengthMSF = txtPreGapLength.Text;
|
cueSheet.PreGapLengthMSF = txtPreGapLength.Text;
|
||||||
cueSheet.Lookup();
|
if (useAR)
|
||||||
|
{
|
||||||
|
cueSheet.DataTrackLengthMSF = txtDataTrackLength.Text;
|
||||||
|
cueSheet.UseAccurateRip();
|
||||||
|
}
|
||||||
|
|
||||||
if (_batchPaths.Count == 0 && convertAction)
|
if (_batchPaths.Count == 0 && action == CUEAction.Encode)
|
||||||
{
|
{
|
||||||
if (checkBoxUseFreeDb.Checked || checkBoxUseMusicBrainz.Checked)
|
if (checkBoxUseFreeDb.Checked || checkBoxUseMusicBrainz.Checked)
|
||||||
releases = cueSheet.LookupAlbumInfo(checkBoxUseFreeDb.Checked, checkBoxUseMusicBrainz.Checked);
|
releases = cueSheet.LookupAlbumInfo(checkBoxUseFreeDb.Checked, checkBoxUseMusicBrainz.Checked);
|
||||||
@@ -766,7 +749,7 @@ namespace JDP {
|
|||||||
|
|
||||||
this.Invoke((MethodInvoker)delegate()
|
this.Invoke((MethodInvoker)delegate()
|
||||||
{
|
{
|
||||||
toolStripStatusLabelAR.Visible = action != CUEAction.Convert;// && cueSheet.ArVerify.ARStatus == null;
|
toolStripStatusLabelAR.Visible = useAR;// && cueSheet.ArVerify.ARStatus == null;
|
||||||
toolStripStatusLabelAR.Text = cueSheet.ArVerify.ARStatus == null ? cueSheet.ArVerify.WorstTotal().ToString() : "?";
|
toolStripStatusLabelAR.Text = cueSheet.ArVerify.ARStatus == null ? cueSheet.ArVerify.WorstTotal().ToString() : "?";
|
||||||
toolStripStatusLabelAR.ToolTipText = "AccurateRip: " + (cueSheet.ArVerify.ARStatus ?? "found") + ".";
|
toolStripStatusLabelAR.ToolTipText = "AccurateRip: " + (cueSheet.ArVerify.ARStatus ?? "found") + ".";
|
||||||
if (releases != null)
|
if (releases != null)
|
||||||
@@ -792,31 +775,10 @@ namespace JDP {
|
|||||||
if (dlgRes == DialogResult.Cancel)
|
if (dlgRes == DialogResult.Cancel)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
bool outputAudio = convertAction && audioEncoderType != AudioEncoderType.NoAudio;
|
|
||||||
bool outputCUE = convertAction && (cueStyle != CUEStyle.SingleFileWithCUE || _profile._config.createCUEFileWhenEmbedded);
|
|
||||||
|
|
||||||
cueSheet.GenerateFilenames(audioEncoderType, outputFormat, pathOut);
|
cueSheet.GenerateFilenames(audioEncoderType, outputFormat, pathOut);
|
||||||
string outDir = Path.GetDirectoryName(pathOut);
|
|
||||||
if (cueStyle == CUEStyle.SingleFileWithCUE)
|
|
||||||
cueSheet.SingleFilename = Path.GetFileName(pathOut);
|
|
||||||
if (outDir == "")
|
|
||||||
outDir = ".";
|
|
||||||
|
|
||||||
bool outputExists = false;
|
bool outputExists = cueSheet.OutputExists();
|
||||||
if (outputCUE)
|
|
||||||
outputExists = File.Exists(pathOut);
|
|
||||||
if (outputAudio)
|
|
||||||
{
|
|
||||||
if (cueStyle == CUEStyle.SingleFile || cueStyle == CUEStyle.SingleFileWithCUE)
|
|
||||||
outputExists |= File.Exists(Path.Combine(outDir, cueSheet.SingleFilename));
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (cueStyle == CUEStyle.GapsAppended && _profile._config.preserveHTOA)
|
|
||||||
outputExists |= File.Exists(Path.Combine(outDir, cueSheet.HTOAFilename));
|
|
||||||
for (int i = 0; i < cueSheet.TrackCount; i++)
|
|
||||||
outputExists |= File.Exists(Path.Combine(outDir, cueSheet.TrackFilenames[i]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
dlgRes = DialogResult.Cancel;
|
dlgRes = DialogResult.Cancel;
|
||||||
if (outputExists)
|
if (outputExists)
|
||||||
{
|
{
|
||||||
@@ -872,8 +834,7 @@ namespace JDP {
|
|||||||
//reportForm.Message = _batchReport.ToString();
|
//reportForm.Message = _batchReport.ToString();
|
||||||
//reportForm.ShowDialog(this);
|
//reportForm.ShowDialog(this);
|
||||||
}
|
}
|
||||||
else if (cueSheet.Action == CUEAction.Verify ||
|
else if (useAR)
|
||||||
(cueSheet.Action == CUEAction.VerifyAndConvert && audioEncoderType != AudioEncoderType.NoAudio))
|
|
||||||
{
|
{
|
||||||
using (StringWriter sw = new StringWriter())
|
using (StringWriter sw = new StringWriter())
|
||||||
{
|
{
|
||||||
@@ -963,8 +924,8 @@ namespace JDP {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void SetupControls(bool running) {
|
private void SetupControls(bool running) {
|
||||||
bool converting = (SelectedAction == CUEAction.Convert || SelectedAction == CUEAction.VerifyAndConvert);
|
bool converting = (SelectedAction == CUEAction.Encode);
|
||||||
bool verifying = (SelectedAction == CUEAction.Verify || SelectedAction == CUEAction.VerifyAndConvert);
|
bool verifying = (SelectedAction == CUEAction.Verify || (SelectedAction == CUEAction.Encode && SelectedOutputAudioType != AudioEncoderType.NoAudio && checkBoxUseAccurateRip.Checked));
|
||||||
//grpInput.Enabled = !running;
|
//grpInput.Enabled = !running;
|
||||||
toolStripMenu.Enabled = !running;
|
toolStripMenu.Enabled = !running;
|
||||||
fileSystemTreeView1.Enabled = !running;
|
fileSystemTreeView1.Enabled = !running;
|
||||||
@@ -979,10 +940,10 @@ namespace JDP {
|
|||||||
grpOutputPathGeneration.Enabled = !running;
|
grpOutputPathGeneration.Enabled = !running;
|
||||||
grpAudioOutput.Enabled = !running && converting;
|
grpAudioOutput.Enabled = !running && converting;
|
||||||
grpAction.Enabled = !running;
|
grpAction.Enabled = !running;
|
||||||
checkBoxUseFreeDb.Enabled =
|
//checkBoxUseFreeDb.Enabled =
|
||||||
checkBoxUseMusicBrainz.Enabled =
|
// checkBoxUseMusicBrainz.Enabled =
|
||||||
checkBoxUseAccurateRip.Enabled =
|
// checkBoxUseAccurateRip.Enabled =
|
||||||
!running && !(FileBrowserState == FileBrowserStateEnum.DragDrop || FileBrowserState == FileBrowserStateEnum.Checkboxes) && converting;
|
// !(FileBrowserState == FileBrowserStateEnum.DragDrop || FileBrowserState == FileBrowserStateEnum.Checkboxes) && converting;
|
||||||
txtDataTrackLength.Enabled = !running && verifying;
|
txtDataTrackLength.Enabled = !running && verifying;
|
||||||
txtPreGapLength.Enabled = !running;
|
txtPreGapLength.Enabled = !running;
|
||||||
btnConvert.Visible = !running;
|
btnConvert.Visible = !running;
|
||||||
@@ -1350,6 +1311,7 @@ namespace JDP {
|
|||||||
? toolStripMenuItemOutputManual : toolStripMenuItemOutputBrowse;
|
? toolStripMenuItemOutputManual : toolStripMenuItemOutputBrowse;
|
||||||
toolStripSplitButtonOutputBrowser.Text = toolStripSplitButtonOutputBrowser.DefaultItem.Text;
|
toolStripSplitButtonOutputBrowser.Text = toolStripSplitButtonOutputBrowser.DefaultItem.Text;
|
||||||
toolStripSplitButtonOutputBrowser.Image = toolStripSplitButtonOutputBrowser.DefaultItem.Image;
|
toolStripSplitButtonOutputBrowser.Image = toolStripSplitButtonOutputBrowser.DefaultItem.Image;
|
||||||
|
toolStripSplitButtonOutputBrowser.Enabled = toolStripSplitButtonOutputBrowser.DefaultItem.Enabled;
|
||||||
UpdateOutputPath();
|
UpdateOutputPath();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1375,6 +1337,7 @@ namespace JDP {
|
|||||||
set
|
set
|
||||||
{
|
{
|
||||||
ToolStripMenuItem inputBtn = FileBrowserStateButton(value);
|
ToolStripMenuItem inputBtn = FileBrowserStateButton(value);
|
||||||
|
if (inputBtn == null) { value = FileBrowserStateEnum.Hidden; inputBtn = toolStripMenuItemInputBrowserHide; }
|
||||||
ToolStripMenuItem defaultBtn = FileBrowserStateButton(value != FileBrowserStateEnum.Hidden
|
ToolStripMenuItem defaultBtn = FileBrowserStateButton(value != FileBrowserStateEnum.Hidden
|
||||||
? FileBrowserStateEnum.Hidden : _fileBrowserControlState == FileBrowserStateEnum.Hidden
|
? FileBrowserStateEnum.Hidden : _fileBrowserControlState == FileBrowserStateEnum.Hidden
|
||||||
? FileBrowserStateEnum.Tree : _fileBrowserControlState);
|
? FileBrowserStateEnum.Tree : _fileBrowserControlState);
|
||||||
@@ -1465,8 +1428,7 @@ namespace JDP {
|
|||||||
rbActionVerify.Checked ? CUEAction.Verify :
|
rbActionVerify.Checked ? CUEAction.Verify :
|
||||||
rbActionCorrectFilenames.Checked ? CUEAction.CorrectFilenames :
|
rbActionCorrectFilenames.Checked ? CUEAction.CorrectFilenames :
|
||||||
rbActionCreateCUESheet.Checked ? CUEAction.CreateDummyCUE :
|
rbActionCreateCUESheet.Checked ? CUEAction.CreateDummyCUE :
|
||||||
checkBoxUseAccurateRip.Checked ? CUEAction.VerifyAndConvert :
|
CUEAction.Encode;
|
||||||
CUEAction.Convert;
|
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
@@ -1707,9 +1669,10 @@ namespace JDP {
|
|||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
|
CUEAction action = SelectedAction;
|
||||||
comboBoxScript.Items.Clear();
|
comboBoxScript.Items.Clear();
|
||||||
foreach (KeyValuePair<string, CUEToolsScript> script in _profile._config.scripts)
|
foreach (KeyValuePair<string, CUEToolsScript> script in _profile._config.scripts)
|
||||||
if (script.Value.conditions.Contains(SelectedAction))
|
if (script.Value.conditions.Contains(action))
|
||||||
comboBoxScript.Items.Add(script.Value);
|
comboBoxScript.Items.Add(script.Value);
|
||||||
comboBoxScript.Enabled = btnConvert.Enabled && comboBoxScript.Items.Count > 1;
|
comboBoxScript.Enabled = btnConvert.Enabled && comboBoxScript.Items.Count > 1;
|
||||||
comboBoxScript.SelectedItem =
|
comboBoxScript.SelectedItem =
|
||||||
@@ -1725,9 +1688,8 @@ namespace JDP {
|
|||||||
case CUEAction.Verify:
|
case CUEAction.Verify:
|
||||||
SelectedScript = _profile._config.defaultVerifyScript;
|
SelectedScript = _profile._config.defaultVerifyScript;
|
||||||
break;
|
break;
|
||||||
case CUEAction.Convert:
|
case CUEAction.Encode:
|
||||||
case CUEAction.VerifyAndConvert:
|
SelectedScript = _profile._config.defaultEncodeScript;
|
||||||
SelectedScript = _profile._config.defaultVerifyAndConvertScript;
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
SelectedScript = null;
|
SelectedScript = null;
|
||||||
@@ -1742,9 +1704,8 @@ namespace JDP {
|
|||||||
case CUEAction.Verify:
|
case CUEAction.Verify:
|
||||||
_profile._config.defaultVerifyScript = SelectedScript;
|
_profile._config.defaultVerifyScript = SelectedScript;
|
||||||
break;
|
break;
|
||||||
case CUEAction.Convert:
|
case CUEAction.Encode:
|
||||||
case CUEAction.VerifyAndConvert:
|
_profile._config.defaultEncodeScript = SelectedScript;
|
||||||
_profile._config.defaultVerifyAndConvertScript = SelectedScript;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1756,7 +1717,7 @@ namespace JDP {
|
|||||||
if (sender == rbActionVerify && comboBoxScript.SelectedItem != null)
|
if (sender == rbActionVerify && comboBoxScript.SelectedItem != null)
|
||||||
SaveScripts(CUEAction.Verify);
|
SaveScripts(CUEAction.Verify);
|
||||||
if (sender == rbActionEncode && comboBoxScript.SelectedItem != null)
|
if (sender == rbActionEncode && comboBoxScript.SelectedItem != null)
|
||||||
SaveScripts(CUEAction.VerifyAndConvert);
|
SaveScripts(CUEAction.Encode);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
UpdateOutputPath();
|
UpdateOutputPath();
|
||||||
|
|||||||
@@ -348,7 +348,7 @@
|
|||||||
<value>E&ingabe:</value>
|
<value>E&ingabe:</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="toolStripLabelOutput.Text" xml:space="preserve">
|
<data name="toolStripLabelOutput.Text" xml:space="preserve">
|
||||||
<value>Aus&gabe:</value>
|
<value>Aus&gabe:</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="toolStripMenuItemCorrectorModeChangeExtension.Text" xml:space="preserve">
|
<data name="toolStripMenuItemCorrectorModeChangeExtension.Text" xml:space="preserve">
|
||||||
<value>Neue Erweiterung</value>
|
<value>Neue Erweiterung</value>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -927,4 +927,7 @@
|
|||||||
<data name="toolStripMenuItemCorrectorModeLocateFiles.ToolTipText" xml:space="preserve">
|
<data name="toolStripMenuItemCorrectorModeLocateFiles.ToolTipText" xml:space="preserve">
|
||||||
<value>Автоматический поиск переименованных файлов</value>
|
<value>Автоматический поиск переименованных файлов</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="groupBoxMode.Text" xml:space="preserve">
|
||||||
|
<value>Настройки</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
9
CUETools/frmSettings.Designer.cs
generated
9
CUETools/frmSettings.Designer.cs
generated
@@ -497,6 +497,8 @@ namespace JDP {
|
|||||||
//
|
//
|
||||||
// txtSingleFilenameFormat
|
// txtSingleFilenameFormat
|
||||||
//
|
//
|
||||||
|
this.txtSingleFilenameFormat.AutoCompleteCustomSource.AddRange(new string[] {
|
||||||
|
resources.GetString("txtSingleFilenameFormat.AutoCompleteCustomSource")});
|
||||||
resources.ApplyResources(this.txtSingleFilenameFormat, "txtSingleFilenameFormat");
|
resources.ApplyResources(this.txtSingleFilenameFormat, "txtSingleFilenameFormat");
|
||||||
this.txtSingleFilenameFormat.Name = "txtSingleFilenameFormat";
|
this.txtSingleFilenameFormat.Name = "txtSingleFilenameFormat";
|
||||||
this.toolTip1.SetToolTip(this.txtSingleFilenameFormat, resources.GetString("txtSingleFilenameFormat.ToolTip"));
|
this.toolTip1.SetToolTip(this.txtSingleFilenameFormat, resources.GetString("txtSingleFilenameFormat.ToolTip"));
|
||||||
@@ -826,7 +828,12 @@ namespace JDP {
|
|||||||
this.textBoxARLogExtension.AutoCompleteCustomSource.AddRange(new string[] {
|
this.textBoxARLogExtension.AutoCompleteCustomSource.AddRange(new string[] {
|
||||||
resources.GetString("textBoxARLogExtension.AutoCompleteCustomSource"),
|
resources.GetString("textBoxARLogExtension.AutoCompleteCustomSource"),
|
||||||
resources.GetString("textBoxARLogExtension.AutoCompleteCustomSource1"),
|
resources.GetString("textBoxARLogExtension.AutoCompleteCustomSource1"),
|
||||||
resources.GetString("textBoxARLogExtension.AutoCompleteCustomSource2")});
|
resources.GetString("textBoxARLogExtension.AutoCompleteCustomSource2"),
|
||||||
|
resources.GetString("textBoxARLogExtension.AutoCompleteCustomSource3"),
|
||||||
|
resources.GetString("textBoxARLogExtension.AutoCompleteCustomSource4"),
|
||||||
|
resources.GetString("textBoxARLogExtension.AutoCompleteCustomSource5"),
|
||||||
|
resources.GetString("textBoxARLogExtension.AutoCompleteCustomSource6"),
|
||||||
|
resources.GetString("textBoxARLogExtension.AutoCompleteCustomSource7")});
|
||||||
this.textBoxARLogExtension.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
|
this.textBoxARLogExtension.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
|
||||||
this.textBoxARLogExtension.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
|
this.textBoxARLogExtension.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
|
||||||
this.textBoxARLogExtension.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.cUEConfigBindingSource, "ArLogFilenameFormat", true));
|
this.textBoxARLogExtension.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.cUEConfigBindingSource, "ArLogFilenameFormat", true));
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ namespace JDP {
|
|||||||
numEncodeWhenPercent.Value = _config.encodeWhenPercent;
|
numEncodeWhenPercent.Value = _config.encodeWhenPercent;
|
||||||
chkEncodeWhenZeroOffset.Checked = _config.encodeWhenZeroOffset;
|
chkEncodeWhenZeroOffset.Checked = _config.encodeWhenZeroOffset;
|
||||||
chkFLACVerify.Checked = _config.flacVerify;
|
chkFLACVerify.Checked = _config.flacVerify;
|
||||||
chkWriteArTagsOnConvert.Checked = _config.writeArTagsOnConvert;
|
chkWriteArTagsOnConvert.Checked = _config.writeArTagsOnEncode;
|
||||||
chkWriteARTagsOnVerify.Checked = _config.writeArTagsOnVerify;
|
chkWriteARTagsOnVerify.Checked = _config.writeArTagsOnVerify;
|
||||||
chkWVExtraMode.Checked = (_config.wvExtraMode != 0);
|
chkWVExtraMode.Checked = (_config.wvExtraMode != 0);
|
||||||
if (_config.wvExtraMode != 0) numWVExtraMode.Value = _config.wvExtraMode;
|
if (_config.wvExtraMode != 0) numWVExtraMode.Value = _config.wvExtraMode;
|
||||||
@@ -151,7 +151,7 @@ namespace JDP {
|
|||||||
listViewScriptConditions.Items.Add(resources.GetString("rbActionVerify.Text").Replace("&", ""));
|
listViewScriptConditions.Items.Add(resources.GetString("rbActionVerify.Text").Replace("&", ""));
|
||||||
listViewScriptConditions.Items.Add(resources.GetString("rbActionEncode.Text").Replace("&", ""));
|
listViewScriptConditions.Items.Add(resources.GetString("rbActionEncode.Text").Replace("&", ""));
|
||||||
listViewScriptConditions.Items[0].Tag = CUEAction.Verify;
|
listViewScriptConditions.Items[0].Tag = CUEAction.Verify;
|
||||||
listViewScriptConditions.Items[1].Tag = CUEAction.VerifyAndConvert;
|
listViewScriptConditions.Items[1].Tag = CUEAction.Encode;
|
||||||
|
|
||||||
EnableDisable();
|
EnableDisable();
|
||||||
}
|
}
|
||||||
@@ -207,7 +207,7 @@ namespace JDP {
|
|||||||
_config.encodeWhenConfidence = (uint)numEncodeWhenConfidence.Value;
|
_config.encodeWhenConfidence = (uint)numEncodeWhenConfidence.Value;
|
||||||
_config.encodeWhenZeroOffset = chkEncodeWhenZeroOffset.Checked;
|
_config.encodeWhenZeroOffset = chkEncodeWhenZeroOffset.Checked;
|
||||||
_config.flacVerify = chkFLACVerify.Checked;
|
_config.flacVerify = chkFLACVerify.Checked;
|
||||||
_config.writeArTagsOnConvert = chkWriteArTagsOnConvert.Checked;
|
_config.writeArTagsOnEncode = chkWriteArTagsOnConvert.Checked;
|
||||||
_config.writeArTagsOnVerify = chkWriteARTagsOnVerify.Checked;
|
_config.writeArTagsOnVerify = chkWriteARTagsOnVerify.Checked;
|
||||||
if (!chkWVExtraMode.Checked) _config.wvExtraMode = 0;
|
if (!chkWVExtraMode.Checked) _config.wvExtraMode = 0;
|
||||||
else _config.wvExtraMode = (int) numWVExtraMode.Value;
|
else _config.wvExtraMode = (int) numWVExtraMode.Value;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user