home *** CD-ROM | disk | FTP | other *** search
/ CD-X 1 / cdx_01.iso / melyviz / cdrombol / pcxcdp7.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1995-01-29  |  1.4 KB  |  61 lines

  1. program pcxcdp7;
  2.  
  3. uses PCXCDU7;
  4.  
  5. {-------------------------------------------------------------------------}
  6.  
  7. function LZ (b,l : Byte) : String;
  8.  
  9. var
  10.    s : String;
  11.    i : Byte;
  12.  
  13. begin
  14.    Str(b:l,s);
  15.    for i:=1 to Length(s) do
  16.       if s[i]=' ' then
  17.          s[i]:='0';
  18.    LZ:=s;
  19. end;
  20.  
  21. {-------------------------------------------------------------------------}
  22.  
  23. var
  24.    i : Byte;
  25.  
  26. begin
  27.    if CD_Letters=0 then
  28.    begin
  29.       WriteLn;
  30.       WriteLn('Error: Unable to detect installed CD-ROM drives!');
  31.       WriteLn;
  32.       Halt(1);
  33.    end;
  34.    CDR_AudioDiskInfo(AudioCD);
  35.    if (CDR_Status AND $8000)=$8000 then
  36.    begin
  37.       WriteLn('> No disc in drive! Please insert one to continue!');
  38.       repeat
  39.          CDR_AudioDiskInfo(AudioCD);
  40.       until CDR_Status=$0100;
  41.    end;
  42.    CD_ReadToc;
  43.    for i:=1 to AudioCD.HiTrack do
  44.    begin
  45.       with CDTRack[i] do
  46.       begin
  47.          Write(LZ(TrackNo,2),':');
  48.          with TrackStart do
  49.             Write('    ',LZ(Min,2),':',LZ(Sec,2),'.',LZ(Frm,2));
  50.          with TrackEnd do
  51.             Write('    ',LZ(Min,2),':',LZ(Sec,2),'.',LZ(Frm,2));
  52.          with CDTRLen[i] do
  53.             Write('    (',LZ(Min,2),':',LZ(Sec,2),'.',LZ(Frm,2),')');
  54.          if odd(TrackInfo SHR 6) then
  55.             Write('    Data')
  56.          else
  57.             Write('    Audio');
  58.       end;
  59.       WriteLn;
  60.    end;
  61. end.