< Continued from page 2
Drop a TMediaPlayer component on the form, with all the properties correctly set and bound to the CD player. Also, add "MMSystem" to the uses clause in the calling form. To complete, create a TTimer and put the code below in its OnTimer event:
~~~~~~~~~~~~~~~~~~~~~~~~~
uses MMSystem;
var
Trk, Min, Sec : word;
begin
with MediaPlayer1 do
begin
Trk := MCI_TMSF_TRACK(Position) ;
Min := MCI_TMSF_MINUTE(Position) ;
Sec := MCI_TMSF_SECOND(Position) ;
Label1.Caption := Format('%.2d',) ;
Label2.Caption := Format('%.2d:%.2d',[Min,Sec]) ;
end;
end;
~~~~~~~~~~~~~~~~~~~~~~~~~
Delphi tips navigator:
» TMemo printing
« Week number calculating
previous post