mirror of
https://github.com/claunia/cuetools.net.git
synced 2025-12-16 18:14:25 +00:00
minor fixes
This commit is contained in:
@@ -389,6 +389,25 @@ namespace CUERipper
|
||||
});
|
||||
}
|
||||
|
||||
private ReleaseInfo ConvertEncoding(ICDRipper audioSource, CDEntry cdEntryOrig)
|
||||
{
|
||||
Encoding iso = Encoding.GetEncoding("iso-8859-1");
|
||||
CDEntry cdEntry = cdEntryOrig.Clone() as CDEntry;
|
||||
bool different = false;
|
||||
cdEntry.Artist = Encoding.Default.GetString(iso.GetBytes(cdEntryOrig.Artist));
|
||||
different |= cdEntry.Artist != cdEntryOrig.Artist;
|
||||
cdEntry.Title = Encoding.Default.GetString(iso.GetBytes(cdEntryOrig.Title));
|
||||
different |= cdEntry.Title != cdEntryOrig.Title;
|
||||
for (int i = 0; i < cdEntry.Tracks.Count; i++)
|
||||
{
|
||||
cdEntry.Tracks[i].Title = Encoding.Default.GetString(iso.GetBytes(cdEntryOrig.Tracks[i].Title));
|
||||
different |= cdEntry.Tracks[i].Title != cdEntryOrig.Tracks[i].Title;
|
||||
}
|
||||
if (!different)
|
||||
return null;
|
||||
return CreateCUESheet(audioSource, null, cdEntry);
|
||||
}
|
||||
|
||||
private ReleaseInfo CreateCUESheet(ICDRipper audioSource, Release release, CDEntry cdEntry)
|
||||
{
|
||||
ReleaseInfo r = new ReleaseInfo(cueSheet);
|
||||
@@ -479,24 +498,13 @@ namespace CUERipper
|
||||
code = m_freedb.Read(queryResult, out cdEntry);
|
||||
if (code == FreedbHelper.ResponseCodes.CODE_210)
|
||||
{
|
||||
Encoding iso = Encoding.GetEncoding("iso-8859-1");
|
||||
ReleaseInfo r = CreateCUESheet(audioSource, null, cdEntry);
|
||||
ReleaseInfo r2 = ConvertEncoding(audioSource, cdEntry);
|
||||
this.BeginInvoke((MethodInvoker)delegate()
|
||||
{
|
||||
comboRelease.Items.Add(r);
|
||||
if (r2 != null) comboRelease.Items.Add(r2);
|
||||
});
|
||||
if (Encoding.Default.GetString(iso.GetBytes(cdEntry.Title)) != cdEntry.Title)
|
||||
{
|
||||
cdEntry.Artist = Encoding.Default.GetString(iso.GetBytes(cdEntry.Artist));
|
||||
cdEntry.Title = Encoding.Default.GetString(iso.GetBytes(cdEntry.Title));
|
||||
for (int i = 0; i < cdEntry.Tracks.Count; i++)
|
||||
cdEntry.Tracks[i].Title = Encoding.Default.GetString(iso.GetBytes(cdEntry.Tracks[i].Title));
|
||||
r = CreateCUESheet(audioSource, null, cdEntry);
|
||||
this.BeginInvoke((MethodInvoker)delegate()
|
||||
{
|
||||
comboRelease.Items.Add(r);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -511,9 +519,11 @@ namespace CUERipper
|
||||
if (code == FreedbHelper.ResponseCodes.CODE_210)
|
||||
{
|
||||
ReleaseInfo r = CreateCUESheet(audioSource, null, cdEntry);
|
||||
ReleaseInfo r2 = ConvertEncoding(audioSource, cdEntry);
|
||||
this.BeginInvoke((MethodInvoker)delegate()
|
||||
{
|
||||
comboRelease.Items.Add(r);
|
||||
if (r2 != null) comboRelease.Items.Add(r2);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ namespace CUETools.ALACEnc
|
||||
return 2;
|
||||
}
|
||||
if (buffered)
|
||||
audioSource = new AudioPipe(audioSource, 0x10000);
|
||||
audioSource = new AudioPipe(audioSource, 0x10000, true);
|
||||
if (output_file == null)
|
||||
output_file = Path.ChangeExtension(input_file, "m4a");
|
||||
ALACWriter alac = new ALACWriter((output_file == "-" || output_file == "nul") ? "" : output_file,
|
||||
|
||||
@@ -191,7 +191,7 @@ namespace CUETools.FlaCudaExe
|
||||
return 2;
|
||||
}
|
||||
if (buffered)
|
||||
audioSource = new AudioPipe(audioSource, FlaCudaWriter.MAX_BLOCKSIZE);
|
||||
audioSource = new AudioPipe(audioSource, FlaCudaWriter.MAX_BLOCKSIZE, true);
|
||||
if (output_file == null)
|
||||
output_file = Path.ChangeExtension(input_file, "flac");
|
||||
FlaCudaWriter encoder = new FlaCudaWriter((output_file == "-" || output_file == "nul") ? "" : output_file,
|
||||
|
||||
@@ -173,7 +173,7 @@ namespace CUETools.FlakeExe
|
||||
return;
|
||||
}
|
||||
if (buffered)
|
||||
audioSource = new AudioPipe(audioSource, 0x10000);
|
||||
audioSource = new AudioPipe(audioSource, 0x10000, true);
|
||||
if (output_file == null)
|
||||
output_file = Path.ChangeExtension(input_file, "flac");
|
||||
FlakeWriter flake = new FlakeWriter((output_file == "-" || output_file == "nul") ? "" : output_file,
|
||||
|
||||
@@ -1680,6 +1680,8 @@ string status = processor.Go();
|
||||
cdInfo.Length = _toc.AudioLength * 588;
|
||||
_sources.Add(cdInfo);
|
||||
_ripper.ReadProgress += new EventHandler<ReadProgressArgs>(CDReadProgress);
|
||||
_padding += TrackCount * 200;
|
||||
_padding += _config.embedLog ? 500 + TrackCount * 200 : 0;
|
||||
}
|
||||
|
||||
public void Close()
|
||||
@@ -2281,14 +2283,12 @@ string status = processor.Go();
|
||||
{
|
||||
if (fileIsBinary)
|
||||
{
|
||||
// THIS CODE NEVER EXECUTES!!!
|
||||
|
||||
fileTimeLengthFrames = timeRelativeToFileStart + 150;
|
||||
sourceInfo.Path = null;
|
||||
sourceInfo.Offset = 0;
|
||||
sourceInfo.Length = 150 * 588;
|
||||
_sources.Add(sourceInfo);
|
||||
throw new Exception("unexpected BINARY directive");
|
||||
//throw new Exception("unexpected BINARY directive");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4257,6 +4257,8 @@ string status = processor.Go();
|
||||
if (style == CUEStyle.SingleFile || style == CUEStyle.SingleFileWithCUE)
|
||||
{
|
||||
iDest++;
|
||||
if (_isCD && style == CUEStyle.SingleFileWithCUE)
|
||||
_padding += Encoding.UTF8.GetByteCount(CUESheetContents(style));
|
||||
audioDest = GetAudioDest(_destPaths[iDest], destLengths[iDest], destBPS, _padding, noOutput);
|
||||
}
|
||||
|
||||
@@ -4559,6 +4561,26 @@ string status = processor.Go();
|
||||
}
|
||||
}
|
||||
|
||||
if (!foundAll && files == null)
|
||||
{
|
||||
List<FileGroupInfo> fileGroups = CUESheet.ScanFolder(_config, dir == "" ? "." : dir);
|
||||
foreach (FileGroupInfo fileGroup in fileGroups)
|
||||
{
|
||||
if (fileGroup.type == FileGroupInfoType.TrackFiles && fileGroup.files.Count == filePos.Count)
|
||||
{
|
||||
if (foundAll)
|
||||
{
|
||||
foundAll = false;
|
||||
break;
|
||||
}
|
||||
audioFiles = fileGroup.files.ConvertAll<string>(delegate(FileSystemInfo info) { return info.FullName; }).ToArray();
|
||||
Array.Sort(audioFiles);
|
||||
extension = fileGroup.main.Extension.ToLower().TrimStart('.');
|
||||
foundAll = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!foundAll)
|
||||
throw new Exception("unable to locate the audio files");
|
||||
|
||||
@@ -5162,6 +5184,7 @@ string status = processor.Go();
|
||||
if (ext.StartsWith(".") && _config.formats.TryGetValue(ext.Substring(1), out fmt) && fmt.allowLossless)
|
||||
{
|
||||
uint disc = 0;
|
||||
string album = null;
|
||||
bool cueFound = false;
|
||||
TagLib.UserDefined.AdditionalFileTypes.Config = _config;
|
||||
TagLib.File.IFileAbstraction fileAbsraction = new TagLib.File.LocalFileAbstraction(file.FullName);
|
||||
@@ -5169,6 +5192,7 @@ string status = processor.Go();
|
||||
{
|
||||
TagLib.File fileInfo = TagLib.File.Create(fileAbsraction);
|
||||
disc = fileInfo.Tag.Disc;
|
||||
album = fileInfo.Tag.Album;
|
||||
cueFound = fmt.allowEmbed && Tagging.Analyze(fileInfo).Get("CUESHEET") != null;
|
||||
}
|
||||
catch { }
|
||||
@@ -5181,7 +5205,10 @@ string status = processor.Go();
|
||||
FileGroupInfo groupFound = null;
|
||||
foreach (FileGroupInfo fileGroup in fileGroups)
|
||||
{
|
||||
if (fileGroup.type == FileGroupInfoType.TrackFiles && fileGroup.discNo == disc && fileGroup.main.Extension.ToLower() == ext)
|
||||
if (fileGroup.type == FileGroupInfoType.TrackFiles
|
||||
&& fileGroup.discNo == disc
|
||||
&& fileGroup.album == album
|
||||
&& fileGroup.main.Extension.ToLower() == ext)
|
||||
{
|
||||
groupFound = fileGroup;
|
||||
break;
|
||||
@@ -5195,6 +5222,7 @@ string status = processor.Go();
|
||||
{
|
||||
groupFound = new FileGroupInfo(file, FileGroupInfoType.TrackFiles);
|
||||
groupFound.discNo = disc;
|
||||
groupFound.album = album;
|
||||
groupFound.files.Add(file);
|
||||
fileGroups.Add(groupFound);
|
||||
// TODO: tracks must be sorted according to tracknumer (or filename if missing)
|
||||
@@ -5362,6 +5390,7 @@ string status = processor.Go();
|
||||
public FileSystemInfo main;
|
||||
public FileGroupInfoType type;
|
||||
public uint discNo;
|
||||
public string album;
|
||||
|
||||
public FileGroupInfo(FileSystemInfo _main, FileGroupInfoType _type)
|
||||
{
|
||||
|
||||
@@ -402,8 +402,11 @@ namespace CUETools.Ripper.SCSI
|
||||
_currentIndex = iIndex;
|
||||
if (_currentIndex == 1)
|
||||
{
|
||||
uint pregap = (uint)(sec - _currentTrackActualStart);
|
||||
_toc[iTrack][0].Start = _toc[iTrack].Start - pregap;
|
||||
if (iTrack != 1)
|
||||
{
|
||||
uint pregap = (uint)(sec - _currentTrackActualStart);
|
||||
_toc[iTrack][0].Start = _toc[iTrack].Start - pregap;
|
||||
}
|
||||
_currentTrackActualStart = sec;
|
||||
} else
|
||||
_toc[iTrack].AddIndex(new CDTrackIndex((uint)iIndex, (uint)(_toc[iTrack].Start + sec - _currentTrackActualStart)));
|
||||
|
||||
@@ -84,6 +84,11 @@ namespace CUETools.TestProcessor
|
||||
target.Open("Circuitry\\1.cue");
|
||||
Assert.AreEqual<string>("00078c13-001b4ab9-40086205", AccurateRipVerify.CalculateAccurateRipId(target.TOC), "Wrong TOC");
|
||||
|
||||
// test playstation-type CD-Extra with nonstandard pregap
|
||||
target = new CUESheet(config);
|
||||
target.Open("Headcandy\\Headcandy.cue");
|
||||
Assert.AreEqual<string>("0014fc22-0052b286-62104a06", AccurateRipVerify.CalculateAccurateRipId(target.TOC), "Wrong TOC");
|
||||
|
||||
// test Enhanced-CD
|
||||
target = new CUESheet(config);
|
||||
target.Open("No Man's Land\\1.cue");
|
||||
@@ -92,7 +97,7 @@ namespace CUETools.TestProcessor
|
||||
// test one-track CD
|
||||
target = new CUESheet(config);
|
||||
target.Open("Amarok\\Amarok.cue");
|
||||
Assert.AreEqual<string>("00041f6d-00083ece-020e1201", AccurateRipVerify.CalculateAccurateRipId(target.TOC), "Wrong TOC");
|
||||
Assert.AreEqual<string>("00041f6d-00083ece-020e1201", AccurateRipVerify.CalculateAccurateRipId(target.TOC), "Wrong TOC");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
5:55:14
|
||||
@@ -0,0 +1 @@
|
||||
12:14:14
|
||||
@@ -0,0 +1 @@
|
||||
5:34:04
|
||||
@@ -0,0 +1 @@
|
||||
6:51:51
|
||||
@@ -0,0 +1 @@
|
||||
7:23:24
|
||||
@@ -0,0 +1,36 @@
|
||||
REM DISCID 62104A06
|
||||
FILE "<Filename>.iso" BINARY
|
||||
TRACK 01 MODEx/2xxx
|
||||
TITLE "Computer Data"
|
||||
PERFORMER "Brian Eno"
|
||||
INDEX 01 00:00:00
|
||||
TRACK 02 AUDIO
|
||||
TITLE "Castro Haze"
|
||||
PERFORMER "Brian Eno"
|
||||
INDEX 00 31:29:42
|
||||
FILE "01.dummy" WAVE
|
||||
INDEX 01 00:00:00
|
||||
TRACK 03 AUDIO
|
||||
TITLE "Manila Envelope"
|
||||
PERFORMER "Brian Eno"
|
||||
INDEX 00 05:53:14
|
||||
FILE "02.dummy" WAVE
|
||||
INDEX 01 00:00:00
|
||||
TRACK 04 AUDIO
|
||||
TITLE "Spunk Worship"
|
||||
PERFORMER "Brian Eno"
|
||||
INDEX 00 12:12:14
|
||||
FILE "03.dummy" WAVE
|
||||
INDEX 01 00:00:00
|
||||
TRACK 05 AUDIO
|
||||
TITLE "Beast"
|
||||
PERFORMER "Brian Eno"
|
||||
INDEX 00 05:32:04
|
||||
FILE "04.dummy" WAVE
|
||||
INDEX 01 00:00:00
|
||||
TRACK 06 AUDIO
|
||||
TITLE "Alloy Balcony & Jets Overhead"
|
||||
PERFORMER "Brian Eno"
|
||||
INDEX 00 06:49:51
|
||||
FILE "05.dummy" WAVE
|
||||
INDEX 01 00:00:00
|
||||
@@ -0,0 +1,116 @@
|
||||
Exact Audio Copy V0.99 prebeta 4 from 23. January 2008
|
||||
|
||||
EAC extraction logfile from 2. January 2010, 21:12
|
||||
|
||||
Brian Eno / Headcandy
|
||||
|
||||
Used drive : HL-DT-STRW/DVD GCC-4244N Adapter: 1 ID: 0
|
||||
|
||||
Read mode : Secure
|
||||
Utilize accurate stream : Yes
|
||||
Defeat audio cache : No
|
||||
Make use of C2 pointers : No
|
||||
|
||||
Read offset correction : 102
|
||||
Overread into Lead-In and Lead-Out : No
|
||||
Fill up missing offset samples with silence : Yes
|
||||
Delete leading and trailing silent blocks : No
|
||||
Null samples used in CRC calculations : Yes
|
||||
Used interface : Native Win32 interface for Win NT & 2000
|
||||
Gap handling : Appended to previous track
|
||||
|
||||
Used output format : User Defined Encoder
|
||||
Selected bitrate : 128 kBit/s
|
||||
Quality : High
|
||||
Add ID3 tag : No
|
||||
Command line compressor : C:\Program Files\Exact Audio Copy\flac.exe
|
||||
Additional command line options : -V -8 -T "artist=%a" -T "title=%t" -T "album=%g" -T "date=%y" -T "tracknumber=%n" -T "genre=%m" %s
|
||||
|
||||
|
||||
TOC of the extracted CD
|
||||
|
||||
Track | Start | Length | Start sector | End sector
|
||||
---------------------------------------------------------
|
||||
1 | 0:00.00 | 31:32.42 | 0 | 141941
|
||||
2 | 31:32.42 | 5:55.14 | 141942 | 168580
|
||||
3 | 37:27.56 | 12:14.14 | 168581 | 223644
|
||||
4 | 49:41.70 | 5:34.04 | 223645 | 248698
|
||||
5 | 55:15.74 | 6:51.51 | 248699 | 279574
|
||||
6 | 62:07.50 | 7:23.24 | 279575 | 312823
|
||||
|
||||
|
||||
Track 2
|
||||
|
||||
Filename C:\MUSICS\Brian Eno - - Headcandy\02 - Castro Haze.wav
|
||||
|
||||
Pre-gap length 0:00:03.00
|
||||
|
||||
Peak level 72.3 %
|
||||
Track quality 100.0 %
|
||||
Test CRC F1AC5604
|
||||
Copy CRC F1AC5604
|
||||
Cannot be verified as accurate (confidence 1) [EBD1B9B4], AccurateRip returned [6150B79A]
|
||||
Copy OK
|
||||
|
||||
Track 3
|
||||
|
||||
Filename C:\MUSICS\Brian Eno - - Headcandy\03 - Manila Envelope.wav
|
||||
|
||||
Pre-gap length 0:00:02.00
|
||||
|
||||
Peak level 35.3 %
|
||||
Track quality 99.9 %
|
||||
Test CRC 9462FF86
|
||||
Copy CRC 9462FF86
|
||||
Accurately ripped (confidence 1) [F3A67506]
|
||||
Copy OK
|
||||
|
||||
Track 4
|
||||
|
||||
Filename C:\MUSICS\Brian Eno - - Headcandy\04 - Spunk Worship.wav
|
||||
|
||||
Pre-gap length 0:00:02.00
|
||||
|
||||
Peak level 66.9 %
|
||||
Track quality 99.9 %
|
||||
Test CRC 7120F46D
|
||||
Copy CRC 7120F46D
|
||||
Accurately ripped (confidence 1) [493F0AEB]
|
||||
Copy OK
|
||||
|
||||
Track 5
|
||||
|
||||
Filename C:\MUSICS\Brian Eno - - Headcandy\05 - Beast.wav
|
||||
|
||||
Pre-gap length 0:00:02.00
|
||||
|
||||
Peak level 100.0 %
|
||||
Track quality 100.0 %
|
||||
Test CRC EAF2BDBD
|
||||
Copy CRC EAF2BDBD
|
||||
Accurately ripped (confidence 1) [B8D7FDC4]
|
||||
Copy OK
|
||||
|
||||
Track 6
|
||||
|
||||
Filename C:\MUSICS\Brian Eno - - Headcandy\06 - Alloy Balcony & Jets Overhead.wav
|
||||
|
||||
Pre-gap length 0:00:02.00
|
||||
|
||||
Peak level 100.0 %
|
||||
Track quality 99.9 %
|
||||
Test CRC 9B7916AC
|
||||
Copy CRC 9B7916AC
|
||||
Track not present in AccurateRip database
|
||||
Copy OK
|
||||
|
||||
|
||||
3 track(s) accurately ripped
|
||||
1 track(s) could not be verified as accurate
|
||||
1 track(s) not present in the AccurateRip database
|
||||
|
||||
Some tracks could not be verified as accurate
|
||||
|
||||
No errors occurred
|
||||
|
||||
End of status report
|
||||
Reference in New Issue
Block a user