Board index » delphi » How to write a program to open and close the CD holder
liangg
![]() Delphi Developer |
Fri, 05 Oct 2001 03:00:00 GMT
|
liangg
![]() Delphi Developer |
Fri, 05 Oct 2001 03:00:00 GMT
How to write a program to open and close the CD holder
Hello,
Sorry if this is not the right place to pose this question, but I visit this How does one write code to open and close the CD holder of the CD Rom drive? Suggestions are most welcome! |
Mein Nam
![]() Delphi Developer |
Fri, 05 Oct 2001 03:00:00 GMT
Re:How to write a program to open and close the CD holderTake a hammer and throw it down at the CD-ROM Drive. Now it's open and could never be closed. Your problem is solved |
ROUX Stephe
![]() Delphi Developer |
Fri, 05 Oct 2001 03:00:00 GMT
Re:How to write a program to open and close the CD holderliangg <lia...@hkstar.com> a crit dans le message : Quote> Hello, Stephen |
Claus Ziegle
![]() Delphi Developer |
Fri, 05 Oct 2001 03:00:00 GMT
Re:How to write a program to open and close the CD holderliangg skrev i meddelelsen <7ff5bi$s...@forums.borland.com>... Quote>Hello, Take a look at the Tips'n'tricks section, on the Delphi part, of our Warmest Regards from Claus Ziegler, ZieglerSoft Email: cl...@zieglersoft.dk |
Andreas Pawli
![]() Delphi Developer |
Fri, 05 Oct 2001 03:00:00 GMT
Re:How to write a program to open and close the CD holderQuote> liangg wrote: your chances of not getting moronic answers (cf. 'MeinName') will rise. Quote> How does one write code to open and close the CD holder of the CD Rom > drive? |
David Ree
![]() Delphi Developer |
Fri, 05 Oct 2001 03:00:00 GMT
Re:How to write a program to open and close the CD holderQuote> Take a hammer and throw it down at the CD-ROM Drive. -- |
od
![]() Delphi Developer |
Sat, 06 Oct 2001 03:00:00 GMT
Re:How to write a program to open and close the CD holderi'm not sure this is the good forum (desktop.database) to speak about CD API... But, here is what you're looking for : { Quote> Are there anybody out there who has some routins to play CD Audio in a CD { Unit talking to a CD-Rom-Drive Interface Type Sector : LongInt; { Adresse des Lesekopfes } MedChg : Byte; { Disk gewechselt? } LoAuTr : Byte; { kleinste Audio-Track # } TrkNo : Byte; { Track #. Eingabe-Wert ! } CntAdr : Byte; { CONTROL und ADR, von LW } Qfrm : LongInt;{ start-frame address } Uctrl : Byte; { CONTROL und ADR Byte } Var CD : CD_Record; {===== allgemeine Funktionen ===================} Function CD_Reset : Boolean; {===== Tray/Caddy-Funktionen ===================} Function CD_Open: Boolean; {==== Audio-Funktionen =========================} Function CD_Play(no:Byte; len:Integer): Boolean; Procedure CD_Info; {==== Umwandlungen =============================} Function Red2Time( Var Inf:TrkInfo ):Word; Implementation Uses Dos; Const IOCtlRead = $4402; Var R : Registers; Tracks : Array[1..100] of TrkInfo; Procedure CD_Exit; { wird bei Programmende ausgefuehrt } Function CD_Init: Boolean; { Initialisierung beim Programmstart } Procedure CD_TrackInfo( Nr:Byte; Var T:TrkInfo ); Function OpenCDHandle:Word; Procedure CloseCDHandle; Function Red2HSG( Var Inf:TrkInfo ):LongInt; Red2HSG := l -2; Function Red2Time( Var Inf:TrkInfo ):Word; Function HSG2Red(L:LongInt):LongInt; Function CD_IOCtl( Func, Len : Word) : Boolean; Function CD_Reset: Boolean; Function DieTuer( AufZu:Byte ): Boolean; Function CD_Open: Boolean; Function CD_Close: Boolean; Function CD_Eject: Boolean; Function CD_Play(no:Byte; len:Integer): Boolean; FillChar(CtlBlk, SizeOf(CtlBlk), 0); CD.Sector := VtoC.Titles[no].Start; { ist im HSG-Format } Move( CD.Sector, CtlBlk[14], 4 ); { Start-Sector } CD.Status := CtlBlk[3] or CtlBlk[4] shl 8; end; Function CD_VtoC:Boolean; For i := CD.LoAuTr to CD.HiAuTr do With VtoC do read more » |
Abel F. de Angeli
![]() Delphi Developer |
Fri, 12 Oct 2001 03:00:00 GMT
Re:How to write a program to open and close the CD holderTo Open begin To Close begin |