Look at Position to figure out where you are on the disc. (But see also TimeFormat for gotchas with this.) Then roll through the TrackPosition array, from 0 to Tracks-1 (I think), looking for the track with the highest TrackPosition that is less than the current Position. That's the track you're in.
If you want to keep your code simple, you can assume that values in the TrackPosition array are in increasing order; but I don't know if that's always true. Or:
Code:
for i := 0 to Tracks - 1 do
if (Position > TrackPosition[i]) and (Position < TrackPosition[i] + TrackLength[i]) then
ShowMessage('We''re in track ' + IntToStr(i));
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.