00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00028 #ifndef _SDL_cdrom_h
00029 #define _SDL_cdrom_h
00030
00031 #include "SDL_stdinc.h"
00032 #include "SDL_error.h"
00033
00034 #include "begin_code.h"
00035
00036 #ifdef __cplusplus
00037 extern "C" {
00038 #endif
00039
00048 #define SDL_MAX_TRACKS 99
00049
00054 #define SDL_AUDIO_TRACK 0x00
00055 #define SDL_DATA_TRACK 0x04
00056
00059 typedef enum {
00060 CD_TRAYEMPTY,
00061 CD_STOPPED,
00062 CD_PLAYING,
00063 CD_PAUSED,
00064 CD_ERROR = -1
00065 } CDstatus;
00066
00068 #define CD_INDRIVE(status) ((int)(status) > 0)
00069
00070 typedef struct SDL_CDtrack {
00071 Uint8 id;
00072 Uint8 type;
00073 Uint16 unused;
00074 Uint32 length;
00075 Uint32 offset;
00076 } SDL_CDtrack;
00077
00079 typedef struct SDL_CD {
00080 int id;
00081 CDstatus status;
00085 int numtracks;
00086 int cur_track;
00087 int cur_frame;
00088 SDL_CDtrack track[SDL_MAX_TRACKS+1];
00090 } SDL_CD;
00091
00096 #define CD_FPS 75
00097 #define FRAMES_TO_MSF(f, M,S,F) { \
00098 int value = f; \
00099 *(F) = value%CD_FPS; \
00100 value /= CD_FPS; \
00101 *(S) = value%60; \
00102 value /= 60; \
00103 *(M) = value; \
00104 }
00105 #define MSF_TO_FRAMES(M, S, F) ((M)*60*CD_FPS+(S)*CD_FPS+(F))
00106
00108
00109
00114 extern DECLSPEC int SDLCALL SDL_CDNumDrives(void);
00115
00123 extern DECLSPEC const char * SDLCALL SDL_CDName(int drive);
00124
00132 extern DECLSPEC SDL_CD * SDLCALL SDL_CDOpen(int drive);
00133
00139 extern DECLSPEC CDstatus SDLCALL SDL_CDStatus(SDL_CD *cdrom);
00140
00163 extern DECLSPEC int SDLCALL SDL_CDPlayTracks(SDL_CD *cdrom,
00164 int start_track, int start_frame, int ntracks, int nframes);
00165
00170 extern DECLSPEC int SDLCALL SDL_CDPlay(SDL_CD *cdrom, int start, int length);
00171
00175 extern DECLSPEC int SDLCALL SDL_CDPause(SDL_CD *cdrom);
00176
00180 extern DECLSPEC int SDLCALL SDL_CDResume(SDL_CD *cdrom);
00181
00185 extern DECLSPEC int SDLCALL SDL_CDStop(SDL_CD *cdrom);
00186
00190 extern DECLSPEC int SDLCALL SDL_CDEject(SDL_CD *cdrom);
00191
00193 extern DECLSPEC void SDLCALL SDL_CDClose(SDL_CD *cdrom);
00194
00195
00196
00197 #ifdef __cplusplus
00198 }
00199 #endif
00200 #include "close_code.h"
00201
00202 #endif