Solved

DVD,VCD or audio CD ???

Posted on 2002-06-10
8
168 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 9

Expert Comment

by:ginsonic
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Expert Comment

by:KFZ
Comment Utility
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
Comment Utility
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
Comment Utility
No problem for points :) I have a lots .
Hope to help you my comments, too.
0
 
LVL 9

Expert Comment

by:ginsonic
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

771 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

8 Experts available now in Live!

Get 1:1 Help Now