Add subchannel reading helpers

This commit is contained in:
Matt Nadareski
2021-10-06 20:42:25 -07:00
parent 2b7084cd87
commit 43e1811349

View File

@@ -356,6 +356,13 @@ namespace RedBookPlayer.Models.Discs
/// <returns>Byte array representing the read sectors, if possible</returns>
public byte[] ReadSectors(uint sectorsToRead, DataPlayback dataPlayback) => ReadSectors(CurrentSector, sectorsToRead, dataPlayback);
/// <summary>
/// Read subchannel data from the base image starting from the specified sector
/// </summary>
/// <param name="sectorsToRead">Current number of sectors to read</param>
/// <returns>Byte array representing the read subchannels, if possible</returns>
public byte[] ReadSubchannels(uint sectorsToRead) => ReadSubchannels(CurrentSector, sectorsToRead);
/// <summary>
/// Read sector data from the base image starting from the specified sector
/// </summary>
@@ -381,6 +388,15 @@ namespace RedBookPlayer.Models.Discs
}
}
/// <summary>
/// Read subchannel data from the base image starting from the specified sector
/// </summary>
/// <param name="startSector">Sector to start at for reading</param>
/// <param name="sectorsToRead">Current number of sectors to read</param>
/// <returns>Byte array representing the read subchannels, if possible</returns>
private byte[] ReadSubchannels(ulong startSector, uint sectorsToRead)
=> _image.ReadSectorsTag(startSector, sectorsToRead, SectorTagType.CdSectorSubchannel);
/// <inheritdoc/>
public override void SetTotalIndexes()
{