Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: left on Thu 07/04/2005 19:51:56

Title: CDaudio function parameters
Post by: left on Thu 07/04/2005 19:51:56
hi, ii am trying to use the cd audio(querie)  function, the command which checks for a cd in the drive which is supposed to return a value of either 1 or 0 depending on whether there is a cd in the drive or not

if have used the following code but it does not work, i gues the code i have written is wrong. How do i write it properly

CDAudio (0, 0);

if (CDAudio(0,0) == 0) {//do something
}

thanks
Title: Re: CDaudio function parameters
Post by: Pumaman on Thu 07/04/2005 20:01:13
Passing the parameter as 0 checks whether there is a CD-ROM drive, not whether a CD is actually in the drive or not.

Consequently, I'd expect it to return 1.

To check whether a CD is in the drive, use the Get Number Of Tracks feature (parameter 5):

if (CDAudio(5,0) == 0) {
  Display("No CD in the drive");
}