home *** CD-ROM | disk | FTP | other *** search
- on ECDCTRLInit deviceNum
- global cd, gDir, Vol
- if the platform contains "windows" then
- set xObj to "ECDCTRL.DLL"
- else
- set xObj to "ECDCTRL"
- end if
- if gDir <> EMPTY then
- openXLib(gDir & xObj)
- else
- openXLib(xObj)
- end if
- set cd to ECDCTRL(mnew, 0)
- if voidp(cd) or integerp(cd) then
- put "ECDXOBJ failed to initilize"
- else
- if cd(mTotalDevices) = 0 then
- put "The CD controller cannot detect a cd-rom device."
- end if
- end if
- return cd
- end
-
- on ECDCTRLDestroy
- global cd, gDir
- if not voidp(cd) and not integerp(cd) then
- cdStop()
- cd(mdispose)
- end if
- if the platform contains "windows" then
- set xObj to "ECDCTRL.DLL"
- else
- set xObj to "ECDCTRL"
- end if
- if gDir <> EMPTY then
- closeXLib(gDir & xObj)
- else
- closeXLib(xObj)
- end if
- end
-
- on cdStop
- global cd
- cd(mStop)
- end
-
- on cdGetMode
- global cd
- if not voidp(cd) then
- cd(mStatus, "mode")
- return the result
- end if
- end
-
- on cdEject
- global cd
- if voidp(cd) or integerp(cd) then
- alert("Unable to eject the CD from the CD-ROM drive. Please manually eject the CD.")
- return
- end if
- cd(mSet, "door open")
- end
-