BASS.NET API for the Un4seen BASS Audio LibraryBassCdBASS_CD_GetTOC Method (Int32, BASSCDTOCMode, BASS_CD_TOC)BASS.NET API for the Un4seen BASS Audio Library
Retrieves the TOC from the CD in a drive.

Namespace: Un4seen.Bass.AddOn.Cd
Assembly: Bass.Net (in Bass.Net.dll) Version: 2.4.12.0
Syntax

public static bool BASS_CD_GetTOC(
	int drive,
	BASSCDTOCMode mode,
	BASS_CD_TOC toc
)

Parameters

drive
Type: SystemInt32
The drive to get info on... 0 = the first drive.
mode
Type: Un4seen.Bass.AddOn.CdBASSCDTOCMode
Optionally, the following (see BASSCDTOCMode):
BASS_CD_TOC_LBAGet the track start address in LBA form.
BASS_CD_TOC_TIMEGet the track start address in time form.
BASS_CD_TOC_INDEX +track number (0=first)i>Get the position of a track's indexes.
toc
Type: Un4seen.Bass.AddOn.CdBASS_CD_TOC
An instance of the BASS_CD_TOC class to store the information at.

Return Value

Type: Boolean
If successful, is returned, else is returned. Use BASS_ErrorGetCode to get the error code.
Remarks

This function gives the TOC in the form that it is delivered by the drive, except that the byte order may be changed to match the system's native byte order (the TOC is originally big-endian).

ERROR CODEDescription
BASS_ERROR_DEVICEdrive is not valid.
BASS_ERROR_NOCDThere's no CD in the drive.

Examples

Get a CD's TOC:
VB
Dim toc As New BASS_CD_TOC()
If BassCd.BASS_CD_GetTOC(0, BASSCDTOCMode.BASS_CD_TOC_TIME, toc) Then
    Console.WriteLine(toc.ToString())
    ' list the TOC_TRACKs
    For Each track As BASS_CD_TOC_TRACK In toc.tracks
        Console.WriteLine(track.ToString())
    Next
End If
BASS_CD_TOC toc = new BASS_CD_TOC();
if (BassCd.BASS_CD_GetTOC(0, BASSCDTOCMode.BASS_CD_TOC_TIME, toc))
{
    Console.WriteLine(toc.ToString());
    // list the TOC_TRACKs
    foreach (BASS_CD_TOC_TRACK track in toc.tracks)
    {
        Console.WriteLine(track.ToString());
    }
}
See Also

Reference