Author: Tomas Rutkauskas
How to determine which track the current CD is on
Answer:
Here's an easy way to do it: create a timer and put this code in the OnTimer event:
1 var2 Trk, Min, Sec: Word;
3 begin4 with MediaPlayer1 do5 begin6 Trk := MCI_TMSF_TRACK(Position);
7 Min := MCI_TMSF_MINUTE(Position);
8 Sec := MCI_TMSF_SECOND(Position);
9 Label1.Caption := Format('%.2d', [Trk]);
10 Label2.Caption := Format('%.2d:%.2d', [Min, Sec]);
11 end;
12 end;
Add MMSystem to the uses clause in Unit1. This will show current track and time.