请问怎样能读取一张cd的曲目和曲子的时间?最好有源码。

解决方案 »

  1.   

    曲目时间
    设定MediaPlayer1.TimeFormat := tfHMS;type  HMSRec = record
        Hours: byte;
        Minutes: byte;
        Seconds: byte;
        NotUsed: byte;  end;procedure TForm1.Button1Click(Sender: TObject);var
      TheLength: LongInt;
    begin  { Set time format - note that some devices don’t support tfHMS }  MediaPlayer1.TimeFormat := tfHMS;
      { Store length of currently loaded media }
      TheLength := MediaPlayer1.Length;
      with HMSRec(TheLength) do { Typecast TheLength as a HMSRec record }
      begin
        Label1.Caption := IntToStr(Hours); { Display Hours in Label1 }
        Label2.Caption := IntToStr(Minutes); { Display Minutes in Label2 }
        Label3.Caption := IntToStr(Seconds); { Display Seconds in Label3 }
      end;
    end;