BASS.NET API for the Un4seen BASS Audio Library

BassCdBASS_CD_StreamGetTrack Method

BASS.NET API for the Un4seen BASS Audio Library
Retrieves the drive and track number of a CD stream.

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

[DllImportAttribute("basscd")]
public static int BASS_CD_StreamGetTrack(
	int handle
)

Parameters

handle
Type: SystemInt32
The CD stream handle.

Return Value

Type: Int32
If an error occurs, -1 is returned, use BASS_ErrorGetCode to get the error code. If successful, the track number is returned in the low word (low 16-bits), and the drive is returned in the high word (high 16-bits).
Remarks

If the track has just changed, this function will give the new track number even if the old track is still being heard due to buffering. The BASS_POS_CD_TRACK 'mode' can be used with BASS_ChannelGetPosition(Int32, BASSMode) to get the track currently being heard.

ERROR CODEDescription
BASS_ERROR_HANDLEhandle is not valid.

Examples

Check if a channel is a CD stream, and then get it's drive and track number.
int track = BassCd.BASS_CD_StreamGetTrack(channel);
if (track != -1)
{
  int drive = Utils.HighWord32(track);
  track = Utils.LowWord32(track);
}
See Also

Reference