«« Site Rescued »»

While the site is still going to move from its current host, a new site will now take its place. More Info.

The new site may have less content, but the core will now remain. And it will now play nicely with phones! Keep an eye on the DelphiDabbler Blog for news.

» Help

How to determine the track of the current CD

   

Here's an easy way to do it: create a timer and put this code in the OnTimer event:

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', [Trk]);
    Label2.Caption := Format('%.2d:%.2d', [Min,Sec]);
  end;
end;

Add MMSystem to the uses clause of the unit. The code will show the current track and time.

Original resource: The Delphi Pool
Author: Unknown
Added: 2009-11-06
Last updated: 2009-11-06

« Return to contents »