Autor Beitrag
GSE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 740

Win 2k, Win XP Pro
D5 Prof, D6 Ent, D2k5 PE
BeitragVerfasst: Sa 10.05.03 11:38 
Hi Leutz,

Wie kann ich herausfinden ob eine CD eine Audio-CD ist und wieviele Titel sie hat? Danke schon im Vorraus.

mfg
GSE

_________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs
and the universe trying to produce bigger and better idiots. So far, the universe is winning. (Richard Cook)
Ex0rzist
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 550

Win XP Prof.
Mandrake 10.0

D6
BeitragVerfasst: Sa 10.05.03 15:25 
Hallo,

das sollte dir weiterhelfen. Bei funktioniert es wunderbar.

Zu Erstens:
www.swissdelphicenter.ch hat folgendes geschrieben:
ausblenden volle Höhe Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
function IsAudioCD(Drive: Char): Boolean; 
var 
  DrivePath: string; 
  MaximumComponentLength: DWORD; 
  FileSystemFlags: DWORD; 
  VolumeName: string; 
  OldErrorMode: UINT; 
  DriveType: UINT; 
begin 
  Result := False; 
  DrivePath := Drive + ':\'; 
  OldErrorMode := SetErrorMode(SEM_FAILCRITICALERRORS); 
  try 
    DriveType := GetDriveType(PChar(DrivePath)); 
  finally 
    SetErrorMode(OldErrorMode); 
  end; 
  if DriveType <> DRIVE_CDROM then 
    Exit; 
  SetLength(VolumeName, 64); 
  GetVolumeInformation(PChar(DrivePath), 
    PChar(VolumeName), 
    Length(VolumeName), 
    nil, 
    MaximumComponentLength, 
    FileSystemFlags, 
    nil, 
    0); 
  if lStrCmp(PChar(VolumeName), 'Audio-CD') = 0 then Result := True; 
end; 


procedure TForm1.Button1Click(Sender: TObject); 
begin 
  if IsAudioCD('D') then 
    ShowMessage('Audio-CD found in drive D.') 
  else 
    ShowMessage('No Audio-CD found in drive D.'); 
end;


Zu Zweitens:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
Function GetTracks(CDROM:string):String;  //GetTracks erwartet 
                                          //als Parameter den Pfad zum CD-ROM
var
 Anzahl:array[0..29]of char;
Begin
 mciSendString(pchar('open '+CDROM+' type cdaudio alias Laufwerk'),nil,0,0);
 mciSendString(pchar('status Laufwerk number of tracks wait'), Anzahl, 30, 0);
 mciSendString('close Laufwerk',nil,0,0);
 Result := Anzahl;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
Showmessage('Es sind '+GetTracks('F:\')+' auf der CD.');
end;

_________________
If accidentally read, induce vomitting.
GSE Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 740

Win 2k, Win XP Pro
D5 Prof, D6 Ent, D2k5 PE
BeitragVerfasst: So 11.05.03 18:48 
Vielen Dank, Ex0rzist! :D

Genau das was ich gesucht habe!

mfg
GSE

_________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs
and the universe trying to produce bigger and better idiots. So far, the universe is winning. (Richard Cook)