mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
DVD and BD discs also have a "disc information" structure from the drive.
This commit is contained in:
@@ -1101,35 +1101,6 @@ namespace Aaru.Core.Media.Info
|
||||
// We got a TOC, get information about a recorded/mastered CD
|
||||
if(!tocSense)
|
||||
{
|
||||
sense = dev.ReadDiscInformation(out cmdBuf, out senseBuf,
|
||||
MmcDiscInformationDataTypes.DiscInformation, dev.Timeout,
|
||||
out _);
|
||||
|
||||
if(sense)
|
||||
{
|
||||
AaruConsole.DebugWriteLine("Media-Info command", "READ DISC INFORMATION 000b\n{0}",
|
||||
Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
CompactDiscInformation = cmdBuf;
|
||||
DecodedCompactDiscInformation = DiscInformation.Decode000b(cmdBuf);
|
||||
|
||||
if(DecodedCompactDiscInformation.HasValue)
|
||||
if(MediaType == MediaType.CD)
|
||||
switch(DecodedCompactDiscInformation.Value.DiscType)
|
||||
{
|
||||
case 0x10:
|
||||
MediaType = MediaType.CDI;
|
||||
|
||||
break;
|
||||
case 0x20:
|
||||
MediaType = MediaType.CDROMXA;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
sense = dev.ReadSessionInfo(out cmdBuf, out senseBuf, dev.Timeout, out _);
|
||||
|
||||
if(sense)
|
||||
@@ -1435,6 +1406,34 @@ namespace Aaru.Core.Media.Info
|
||||
if(DeviceInfo.ScsiType != PeripheralDeviceTypes.MultiMediaDevice)
|
||||
return;
|
||||
|
||||
sense = dev.ReadDiscInformation(out cmdBuf, out senseBuf, MmcDiscInformationDataTypes.DiscInformation,
|
||||
dev.Timeout, out _);
|
||||
|
||||
if(sense)
|
||||
{
|
||||
AaruConsole.DebugWriteLine("Media-Info command", "READ DISC INFORMATION 000b\n{0}",
|
||||
Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DiscInformation = cmdBuf;
|
||||
DecodedDiscInformation = Decoders.SCSI.MMC.DiscInformation.Decode000b(cmdBuf);
|
||||
|
||||
if(DecodedDiscInformation.HasValue)
|
||||
if(MediaType == MediaType.CD)
|
||||
switch(DecodedDiscInformation.Value.DiscType)
|
||||
{
|
||||
case 0x10:
|
||||
MediaType = MediaType.CDI;
|
||||
|
||||
break;
|
||||
case 0x20:
|
||||
MediaType = MediaType.CDROMXA;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
MediaType tmpType = MediaType;
|
||||
MMC.DetectDiscType(ref tmpType, sessions, FullToc, dev, out _, out _, firstTrackLastSession);
|
||||
|
||||
@@ -1481,7 +1480,7 @@ namespace Aaru.Core.Media.Info
|
||||
public byte[] BlurayPowResources { get; }
|
||||
public byte[] Toc { get; }
|
||||
public byte[] Atip { get; }
|
||||
public byte[] CompactDiscInformation { get; }
|
||||
public byte[] DiscInformation { get; }
|
||||
public byte[] Session { get; }
|
||||
public byte[] RawToc { get; }
|
||||
public byte[] Pma { get; }
|
||||
@@ -1492,7 +1491,7 @@ namespace Aaru.Core.Media.Info
|
||||
public FullTOC.CDFullTOC? FullToc { get; }
|
||||
public CDTextOnLeadIn.CDText? DecodedCdTextLeadIn { get; }
|
||||
public byte[] BlurayTrackResources { get; }
|
||||
public DiscInformation.StandardDiscInformation? DecodedCompactDiscInformation { get; }
|
||||
public DiscInformation.StandardDiscInformation? DecodedDiscInformation { get; }
|
||||
public string Mcn { get; }
|
||||
public Dictionary<byte, string> Isrcs { get; }
|
||||
public bool MediaInserted { get; }
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace Aaru.Gui.ViewModels.Panels
|
||||
|
||||
MediaType = scsiInfo.MediaType.ToString();
|
||||
|
||||
if(scsiInfo.Blocks != 0 &&
|
||||
if(scsiInfo.Blocks != 0 &&
|
||||
scsiInfo.BlockSize != 0)
|
||||
MediaSize =
|
||||
$"Media has {scsiInfo.Blocks} blocks of {scsiInfo.BlockSize} bytes/each. (for a total of {scsiInfo.Blocks * scsiInfo.BlockSize} bytes)";
|
||||
@@ -140,12 +140,12 @@ namespace Aaru.Gui.ViewModels.Panels
|
||||
|
||||
CompactDiscInfo = new CompactDiscInfo
|
||||
{
|
||||
DataContext = new CompactDiscInfoViewModel(scsiInfo.Toc, scsiInfo.Atip, scsiInfo.CompactDiscInformation,
|
||||
DataContext = new CompactDiscInfoViewModel(scsiInfo.Toc, scsiInfo.Atip, scsiInfo.DiscInformation,
|
||||
scsiInfo.Session, scsiInfo.RawToc, scsiInfo.Pma,
|
||||
scsiInfo.CdTextLeadIn, scsiInfo.DecodedToc,
|
||||
scsiInfo.DecodedAtip, scsiInfo.DecodedSession,
|
||||
scsiInfo.FullToc, scsiInfo.DecodedCdTextLeadIn,
|
||||
scsiInfo.DecodedCompactDiscInformation, scsiInfo.Mcn,
|
||||
scsiInfo.DecodedDiscInformation, scsiInfo.Mcn,
|
||||
scsiInfo.Isrcs, _view)
|
||||
};
|
||||
|
||||
|
||||
@@ -454,14 +454,14 @@ namespace Aaru.Commands.Media
|
||||
AaruConsole.WriteLine("ATIP:\n{0}", ATIP.Prettify(scsiInfo.DecodedAtip));
|
||||
}
|
||||
|
||||
if(scsiInfo.CompactDiscInformation != null)
|
||||
if(scsiInfo.DiscInformation != null)
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscinformation_000b.bin",
|
||||
"SCSI READ DISC INFORMATION", scsiInfo.CompactDiscInformation);
|
||||
"SCSI READ DISC INFORMATION", scsiInfo.DiscInformation);
|
||||
|
||||
if(scsiInfo.DecodedCompactDiscInformation.HasValue)
|
||||
if(scsiInfo.DecodedDiscInformation.HasValue)
|
||||
AaruConsole.WriteLine("Standard Disc Information:\n{0}",
|
||||
DiscInformation.Prettify000b(scsiInfo.DecodedCompactDiscInformation));
|
||||
DiscInformation.Prettify000b(scsiInfo.DecodedDiscInformation));
|
||||
}
|
||||
|
||||
if(scsiInfo.Session != null)
|
||||
|
||||
Reference in New Issue
Block a user