Solved

Select one from two CDRom drives

Posted on 2000-03-17
18
266 Views
Last Modified: 2010-04-04
Hy,
I have two CD-ROM drives : E:\ and F:\
My default drive is E:\ .
How can I select my second drive for open and close the door or play .
0
Comment
Question by:ginsonic
  • 6
  • 4
  • 4
  • +1
18 Comments
 
LVL 17

Expert Comment

by:inthe
ID: 2627142
Hi
look to this:
http://www.delphipages.com

and type tcdevents in the search box.
this is zifnabs cd component which you can use to change default drives .
(comes with full sources)


description:
This component will notify you when the user inserts/removes a CD from the CD-rom drive by pushing the eject button. Next to this some other usefull CD related options are available, like enabling/disabling autorun (CD & audio CD), changing the default cd-player, ...

Regards Barry
0
 
LVL 5

Expert Comment

by:TheNeil
ID: 2627189
Nick,

Just do this

MediaPlayer1.FileName := 'F:';

You can now just use the TMediaPlayer component like before. No extra components, no extra codes, no larger EXEs etc.

The Neil
0
 
LVL 9

Author Comment

by:ginsonic
ID: 2627246
Hy Inthe ,
I can't install CDEvents in my D4 .
I installed but I haven't the classes in my compiler. TCDEvents and .... I don't remember now .
I love ideea , but I can't use it .

Hello Neil ,
How do you do ? :)
I don't wish to use TMediaPlayer .

I wish to put a CD player in my new broadcasting scheduler and I want to use API functions .
0
 
LVL 5

Expert Comment

by:TheNeil
ID: 2627284
Nick,

I'm doing fine. You?

Oops, I assumed you were using the TMediaPlayer component. I've never gone down and used the API to do this kind of thing and using a TMediaPlayer is the way Borland suggest you open the CD drive (not that that makes it right). All I can suggest (if you don't (or can't) use Barry's component) is hunting through the MPlayer.PAS file and seeing how the TMediaPlayer component handles an eject. I've had a quick look and it's just an MCI call BUT I couldn't see how to set the 'active' drive - sorry. The TMediaplayer approach DOES work so it should just be a case of figuring out HOW it's doing it by looking at what gets set when you set the filename (as I suggested), and how that stored value is applied to an eject.

The Neil =:)
0
 
LVL 9

Author Comment

by:ginsonic
ID: 2627455
How I know the TMediaPlayer can only open the door .
0
 
LVL 17

Expert Comment

by:inthe
ID: 2627579
for mediaplayer set the filename as "the neil" said then something like

var
handle : thandle;
begin
handle := mediaplayer1.deviceid;

//To Open:
 mciSendString('Set cdaudio door open wait', nil, 0, handle);
//To Close:
 mciSendString('Set cdaudio door closed wait', nil, 0, handle);

Make sure to include the MMSystem unit in your uses clause.
thats untested  btw so may not work.

ps i email zifnab to look here as maybe he can help in install of his component..
i tried and too had problem(no component appeared on pallete?) , although i remember i had it installed no problem in d3.

0
 
LVL 5

Expert Comment

by:TheNeil
ID: 2627623
Barry,

You might not have tested it but it certainly works (I just gave it a try and it works on my machine)

The Neil =;)
0
 
LVL 17

Expert Comment

by:inthe
ID: 2627655
ahh great
i knew the open and close worked for me once but i couldnt remember what to use for handle and coulnt see any thing else from deviceid.
thanks for saying ,i can save this in my code snippet database.
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 2627811
Hi,

mmm, which version of TCDevents are you using? urgh, this is already a long time that I looked at this component... I think I should make a BIG update.

I know that from a certain version, you don't have to use the reg file, but the source-code files itself (register the products itself).  Does not use the seperate reg file to install the components

Tom.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 17

Expert Comment

by:inthe
ID: 2627854
1.41 was only version i could find
(delphipages and dsp)today but i was sure it was newer version i had installed in d3.
i wait for ginsonic see what he found,
0
 
LVL 9

Author Comment

by:ginsonic
ID: 2627974
I know the API commands to open or close the door . I see many tips on net .

I use :
mciSendString('Set cdaudio door open wait', nil, 0, 0);
My problem is how to open or close the second CDROM door .
With this command I close or open the default CDROM .
0
 
LVL 5

Expert Comment

by:TheNeil
ID: 2627993
Nick,

What you need to do is use a TMediaPlayer component (You don't have to open it or use it though). You set the drive as I described earlier THEN you can use mciSendString(...). If you want to get away from TMediaPlayer then try hunting through the TMediaPlayer source code and see what it does when you set the filename

The Neil
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 2628022
You can find the latest at Torries (1.44)
0
 
LVL 9

Author Comment

by:ginsonic
ID: 2628577
Hy ZifNab .
I try to find 1.44 on Torries , but...
Version 1.42 don't work for me . Can U send me a mail with this ?

Regards,
Nick
0
 
LVL 9

Author Comment

by:ginsonic
ID: 2628600
Hy ZifNab .
I try to find 1.44 on Torries , but...
Version 1.42 don't work for me . Can U send me a mail with this ?

Regards,
Nick
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 2631725
Hi ginsonic,

what is your e-mail address? I'll send you the latest version. (rather old)

zif.
0
 
LVL 9

Author Comment

by:ginsonic
ID: 2632833
Thanks Zifnab,
My email is nick@radioterra.ro .
0
 
LVL 8

Accepted Solution

by:
ZifNab earned 25 total points
ID: 2637262
you should reveive it very soon.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
proper way to parse url in delphi 2 163
Strange code, can use it, but i cant figure out what it does. 3 54
Delphi XE10 Round Image 2 77
Reconfigure Delphi Install? 2 46
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

920 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

13 Experts available now in Live!

Get 1:1 Help Now