SDL_CD: CD reading problem

Hallo everybody!
When I open my CD-Drive with a cd inserted with "cd = SDL_CDOpen(0)"
cd->status is alway CD_TRAYEMPTY! I tested other cds but there was no
change.
He gets the right drive because SDL_CDEject(cd) opens the tray.
In the help is an exampel program that displays all the tracks on the cd. I
tested that but it doesn’t work, too.
Here is the example:

SDL_CD *cdrom;
int cur_track;
int min, sec, frame;
SDL_Init(SDL_INIT_CDROM);
atexit(SDL_Quit);

/* Check for CD drives /
if(!SDL_CDNumDrives()){
/
None found */
fprintf(stderr, “No CDROM devices available\n”);
exit(-1);
}

/* Open the default drive */
cdrom=SDL_CDOpen(0);

/* Did if open? Check if cdrom is NULL */
if(!cdrom){
fprintf(stderr, “Couldn’t open drive: %s\n”, SDL_GetError());
exit(-1);
}

/* Print Volume info */
printf(“Name: %s\n”, SDL_CDName(0));
printf(“Tracks: %d\n”, cdrom->numtracks);
for(cur_track=0;cur_track < cdrom->numtracks; cur_track++){
FRAMES_TO_MSF(cdrom->track[cur_track].length, &min, &sec, &frame);
printf("\tTrack %d: Length %d:%d\n", cur_track, min, sec);
}

SDL_CDClose(cdrom);

Please tell me if you know what’s wrong.__
Greetings, DennisB

Hey, Dennis.

Add the following line of code just after "cdrom = SDL_CDOpen( 0 )"
SDL_CDStatus( cdrom );

Hope it helps.

Mario de SousaOn Tue, 30 Dec 2003 17:14:50 +0100 “Dennis” <kurzer_14 at web.de> wrote:

Hallo everybody!
When I open my CD-Drive with a cd inserted with "cd = SDL_CDOpen(0)"
cd->status is alway CD_TRAYEMPTY! I tested other cds but there was no
change.
He gets the right drive because SDL_CDEject(cd) opens the tray.
In the help is an exampel program that displays all the tracks on the
cd. I
tested that but it doesn’t work, too.
Here is the example:

SDL_CD *cdrom;
int cur_track;
int min, sec, frame;
SDL_Init(SDL_INIT_CDROM);
atexit(SDL_Quit);

/* Check for CD drives /
if(!SDL_CDNumDrives()){
/
None found */
fprintf(stderr, “No CDROM devices available\n”);
exit(-1);
}

/* Open the default drive */
cdrom=SDL_CDOpen(0);

/* Did if open? Check if cdrom is NULL */
if(!cdrom){
fprintf(stderr, “Couldn’t open drive: %s\n”, SDL_GetError());
exit(-1);
}

/* Print Volume info */
printf(“Name: %s\n”, SDL_CDName(0));
printf(“Tracks: %d\n”, cdrom->numtracks);
for(cur_track=0;cur_track < cdrom->numtracks; cur_track++){
FRAMES_TO_MSF(cdrom->track[cur_track].length, &min, &sec, &frame);
printf("\tTrack %d: Length %d:%d\n", cur_track, min, sec);
}

SDL_CDClose(cdrom);

Please tell me if you know what’s wrong.
__
Greetings, DennisB


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Hi Mario!
Thanks a lot! I didn’t expect a solution so simple.
I should read the documentation more carefully.__
Greetings, DennisB
http://borde.homeip.net/

“Mario de Sousa” schrieb im Newsbeitrag
news:20040102093748.4659f7b3.mcd at jhb.ucs.co.za

Hey, Dennis.

Add the following line of code just after "cdrom = SDL_CDOpen( 0 )"
SDL_CDStatus( cdrom );

Hope it helps.

Mario de Sousa

On Tue, 30 Dec 2003 17:14:50 +0100 “Dennis” <@DennisB> wrote:

Hallo everybody!
When I open my CD-Drive with a cd inserted with "cd = SDL_CDOpen(0)"
cd->status is alway CD_TRAYEMPTY! I tested other cds but there was no
change.
He gets the right drive because SDL_CDEject(cd) opens the tray.
In the help is an exampel program that displays all the tracks on the
cd. I
tested that but it doesn’t work, too.
Here is the example:

SDL_CD *cdrom;
int cur_track;
int min, sec, frame;
SDL_Init(SDL_INIT_CDROM);
atexit(SDL_Quit);

/* Check for CD drives /
if(!SDL_CDNumDrives()){
/
None found */
fprintf(stderr, “No CDROM devices available\n”);
exit(-1);
}

/* Open the default drive */
cdrom=SDL_CDOpen(0);

/* Did if open? Check if cdrom is NULL */
if(!cdrom){
fprintf(stderr, “Couldn’t open drive: %s\n”, SDL_GetError());
exit(-1);
}

/* Print Volume info */
printf(“Name: %s\n”, SDL_CDName(0));
printf(“Tracks: %d\n”, cdrom->numtracks);
for(cur_track=0;cur_track < cdrom->numtracks; cur_track++){
FRAMES_TO_MSF(cdrom->track[cur_track].length, &min, &sec, &frame);
printf("\tTrack %d: Length %d:%d\n", cur_track, min, sec);
}

SDL_CDClose(cdrom);

Please tell me if you know what’s wrong.
__
Greetings, DennisB


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

No problem.

Mario de SousaOn Fri, 2 Jan 2004 13:18:16 +0100 “DennisB” <kurzer_14 at web.de> wrote:

Hi Mario!
Thanks a lot! I didn’t expect a solution so simple.
I should read the documentation more carefully.
__
Greetings, DennisB
http://borde.homeip.net/

“Mario de Sousa” <@Mario_de_Sousa> schrieb im Newsbeitrag
news:20040102093748.4659f7b3.@Mario_de_Sousa

Hey, Dennis.

Add the following line of code just after "cdrom = SDL_CDOpen( 0 )"
SDL_CDStatus( cdrom );

Hope it helps.

Mario de Sousa

On Tue, 30 Dec 2003 17:14:50 +0100 “Dennis” <kurzer_14 at web.de> wrote:

Hallo everybody!
When I open my CD-Drive with a cd inserted with "cd = SDL_CDOpen(0)"
cd->status is alway CD_TRAYEMPTY! I tested other cds but there was
no

change.
He gets the right drive because SDL_CDEject(cd) opens the tray.
In the help is an exampel program that displays all the tracks on
the

cd. I
tested that but it doesn’t work, too.
Here is the example:

SDL_CD *cdrom;
int cur_track;
int min, sec, frame;
SDL_Init(SDL_INIT_CDROM);
atexit(SDL_Quit);

/* Check for CD drives /
if(!SDL_CDNumDrives()){
/
None found */
fprintf(stderr, “No CDROM devices available\n”);
exit(-1);
}

/* Open the default drive */
cdrom=SDL_CDOpen(0);

/* Did if open? Check if cdrom is NULL */
if(!cdrom){
fprintf(stderr, “Couldn’t open drive: %s\n”, SDL_GetError());
exit(-1);
}

/* Print Volume info */
printf(“Name: %s\n”, SDL_CDName(0));
printf(“Tracks: %d\n”, cdrom->numtracks);
for(cur_track=0;cur_track < cdrom->numtracks; cur_track++){
FRAMES_TO_MSF(cdrom->track[cur_track].length, &min, &sec, &frame);
printf("\tTrack %d: Length %d:%d\n", cur_track, min, sec);
}

SDL_CDClose(cdrom);

Please tell me if you know what’s wrong.
__
Greetings, DennisB


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl