int main() { printf("testing 32-bit MSCDEX access...\n"); if (cd_installed() == 0) { printf("MSCDEX not found.\n"); return 1; } if (cd_getversion() < 0x020A) { printf("MSCDEX v2.10 required.\n"); return 2; } char drbuf[26]; cd_getdriveletters(drbuf); cd_driverinit(drbuf[0]); printf("CDROM is drive %c:\n", 'A' + drbuf[0]); printf("%d tracks.\n", cd_getlasttrack(drbuf[0])); printf("cd play status: %d\n", cd_isplayingaudio(drbuf[0])); long stats = cd_getstatus(drbuf[0]); printf("drive status: %08X\n", stats); if (stats & CDS_DRIVEOPEN) printf("drive is open\n"); if (stats & CDS_DRIVEEMPTY) printf("drive is empty\n"); printf("playing track...\n"); cd_playtrack(drbuf[0], 2); printf("Bye!\n"); cd_driverclose(drbuf[0]); return 0; }
int AGSDOS::CDPlayerCommand(int cmdd, int datt) { if (cmdd==1) // query if playing audio return cd_isplayingaudio(cddrive); else if (cmdd==6) cd_eject(cddrive); else if (cmdd==7) cd_uneject(cddrive); else if (cmdd==8) return numcddrives; else if (cmdd==9) { if ((datt<1) | (datt>numcddrives)) return 0; cddrive=cd_driveletters[datt-1]; } else if ((cd_getstatus(cddrive) & (CDS_DRIVEOPEN | CDS_DRIVEEMPTY))!=0) return 0; else if (cmdd==2) { // play track cd_playtrack(cddrive,datt); need_to_stop_cd=1; } else if (cmdd==3) // stop music cd_stopmusic(cddrive); else if (cmdd==4) // resume music cd_resumemusic(cddrive); else if (cmdd==5) // get num tracks return cd_getlasttrack(cddrive); else quit("unknown CD command"); return 0; }
void cd_playtoggle() { //added on 01/03/99 by Matt Mueller if (nocdaudio) return; //end addition -MM #ifdef __DJGPP__ if(bcd_now_playing()) #elif defined __SDL__ if(SDL_CDStatus(cdrom)==CD_PLAYING) #else if(0) #endif { cd_stop(); cd_playing=0; } else if(!cd_used) { cd_currenttrack = 0; cd_playtrack(cd_currenttrack); } else { cd_resume(); } cd_used = 1; }
void cd_playnext() { //added on 01/03/99 by Matt Mueller if (nocdaudio) return; //end addition -MM cd_currenttrack++; if(cd_currenttrack >= tracks_used) cd_currenttrack = 0; cd_playtrack(cd_currenttrack); cd_used = 1; }
void cd_playprev() { //added on 01/03/99 by Matt Mueller if (nocdaudio) return; //end addition -MM cd_currenttrack--; if(cd_currenttrack < 0) cd_currenttrack = tracks_used-1; cd_playtrack(cd_currenttrack); cd_used = 1; }