Solved

DVD,VCD or audio CD ???

Posted on 2002-06-10
8
175 Views
Last Modified: 2010-04-04
Hello,

Is there a way to find out whether there is a DVD, VCD or audio CD in the CD drive by using delphi 5.0?

Thank you for your help.
Totok
0
Comment
Question by:totok
  • 5
  • 2
8 Comments
 
LVL 9

Expert Comment

by:ginsonic
ID: 7067029
For audio CD:

function IsAudioCD(CDDrive : Char) : boolean;

var
  VolumeName, DrivePath : string;
  MaximumComponentLength, FileSystemFlags : DWORD;

begin
  DrivePath := CDDrive + ':\';
  Result := FALSE;

  if (GetDriveType(PChar(DrivePath)) = DRIVE_CDROM) then
    begin
      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;
end;

0
 
LVL 9

Expert Comment

by:ginsonic
ID: 7067047
The VCD format requires specific folders and files and the DAT. So search if exist these folders and the DAT.
0
 

Accepted Solution

by:
KFZ earned 100 total points
ID: 7067924
the DVD cd's has a "Video_ts" and an "Audio_ts" folder in the root, so you can just search if these folders exists
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 9

Expert Comment

by:ginsonic
ID: 7068797
KFZ, we have here at Ex-Ex a golden 'rule' :) We don't put a directly answer, just comments . How you can see I answer to 2/3 from the question and I put just comments(your answer solve just 1/3).
This way let the asker to choice the better solution for him.

Totok can accept anytime a comment as answer.

Regards,
Nick
0
 

Expert Comment

by:KFZ
ID: 7069152
sorry im new as an expert, so i just wrote, and did'nt see that i should choose between answer or comment
0
 

Author Comment

by:totok
ID: 7069680
Thank you for the answers.

<KFZ, we have here at Ex-Ex a golden 'rule' :) We don't put <a directly answer, just comments . How you
<can see I answer to 2/3 from the question and I put just <comments(your answer solve just 1/3).
Ginsonic right about this. But I can not reject KFZ's answer, because he gave a valid answer too. Btw, since KFZ's is a new expert, I think I will give the point to him as a welcome.

Again thank you for your help.
0
 
LVL 9

Expert Comment

by:ginsonic
ID: 7070287
No problem for points :) I have a lots .
Hope to help you my comments, too.
0
 
LVL 9

Expert Comment

by:ginsonic
ID: 7070302
BTW, not particular for this case ... but when you wish ( multiple good answers ) you can split the points to experts number that you wish .
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
FMX enumerated colours 2 98
Delphi Mdi application Child forms get behind control 7 208
Delphi 2 59
Delphi Yen format 3 31
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now