BASS.NET API for the Un4seen BASS Audio Library

BassCdBASS_CD_GetTOC Method (Int32, BASSCDTOCMode)

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.17.5
Syntax

public static BASS_CD_TOC BASS_CD_GetTOC(
	int drive,
	BASSCDTOCMode mode
)

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.

Return Value

Type: BASS_CD_TOC
If successful, an instance of the BASS_CD_TOC class 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:
BASS_CD_TOC toc = BassCd.BASS_CD_GetTOC(0, BASSCDTOCMode.BASS_CD_TOC_TIME);
if (toc != null)
{
    Console.WriteLine(toc.ToString());
    // list the TOC_TRACKs
    foreach (BASS_CD_TOC_TRACK track in toc.tracks)
    {
        Console.WriteLine(track.ToString());
    }
}
See Also

Reference