Mercurial > sdl-ios-xcode
diff include/SDL_cdrom.h @ 1662:782fd950bd46 SDL-1.3
Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
WARNING: None of the video drivers have been updated for the new API yet! The API is still under design and very fluid.
The code is now run through a consistent indent format:
indent -i4 -nut -nsc -br -ce
The headers are being converted to automatically generate doxygen documentation.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 28 May 2006 13:04:16 +0000 |
parents | c71e05b4dc2e |
children | 4da1ee79c9af |
line wrap: on
line diff
--- a/include/SDL_cdrom.h Sun May 21 17:27:13 2006 +0000 +++ b/include/SDL_cdrom.h Sun May 28 13:04:16 2006 +0000 @@ -20,7 +20,11 @@ slouken@libsdl.org */ -/* This is the CD-audio control API for Simple DirectMedia Layer */ +/** + * \file SDL_cdrom.h + * + * This is the CD-audio control API for Simple DirectMedia Layer + */ #ifndef _SDL_cdrom_h #define _SDL_cdrom_h @@ -31,7 +35,9 @@ #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus +/* *INDENT-OFF* */ extern "C" { +/* *INDENT-ON* */ #endif /* In order to use these functions, SDL_Init() must have been called @@ -47,35 +53,38 @@ #define SDL_DATA_TRACK 0x04 /* The possible states which a CD-ROM drive can be in. */ -typedef enum { - CD_TRAYEMPTY, - CD_STOPPED, - CD_PLAYING, - CD_PAUSED, - CD_ERROR = -1 +typedef enum +{ + CD_TRAYEMPTY, + CD_STOPPED, + CD_PLAYING, + CD_PAUSED, + CD_ERROR = -1 } CDstatus; /* Given a status, returns true if there's a disk in the drive */ #define CD_INDRIVE(status) ((int)(status) > 0) -typedef struct SDL_CDtrack { - Uint8 id; /* Track number */ - Uint8 type; /* Data or audio track */ - Uint16 unused; - Uint32 length; /* Length, in frames, of this track */ - Uint32 offset; /* Offset, in frames, from start of disk */ +typedef struct SDL_CDtrack +{ + Uint8 id; /* Track number */ + Uint8 type; /* Data or audio track */ + Uint16 unused; + Uint32 length; /* Length, in frames, of this track */ + Uint32 offset; /* Offset, in frames, from start of disk */ } SDL_CDtrack; /* This structure is only current as of the last call to SDL_CDStatus() */ -typedef struct SDL_CD { - int id; /* Private drive identifier */ - CDstatus status; /* Current drive status */ +typedef struct SDL_CD +{ + int id; /* Private drive identifier */ + CDstatus status; /* Current drive status */ - /* The rest of this structure is only valid if there's a CD in drive */ - int numtracks; /* Number of tracks on disk */ - int cur_track; /* Current track position */ - int cur_frame; /* Current frame offset within current track */ - SDL_CDtrack track[SDL_MAX_TRACKS+1]; + /* The rest of this structure is only valid if there's a CD in drive */ + int numtracks; /* Number of tracks on disk */ + int cur_track; /* Current track position */ + int cur_frame; /* Current frame offset within current track */ + SDL_CDtrack track[SDL_MAX_TRACKS + 1]; } SDL_CD; /* Conversion functions from frames to Minute/Second/Frames and vice versa */ @@ -95,7 +104,7 @@ /* Returns the number of CD-ROM drives on the system, or -1 if SDL_Init() has not been called with the SDL_INIT_CDROM flag. */ -extern DECLSPEC int SDLCALL SDL_CDNumDrives(void); +extern DECLSPEC int SDLCALL SDL_CDNumDrives (void); /* Returns a human-readable, system-dependent identifier for the CD-ROM. Example: @@ -103,7 +112,7 @@ "E:" "/dev/disk/ide/1/master" */ -extern DECLSPEC const char * SDLCALL SDL_CDName(int drive); +extern DECLSPEC const char *SDLCALL SDL_CDName (int drive); /* Opens a CD-ROM drive for access. It returns a drive handle on success, or NULL if the drive was invalid or busy. This newly opened CD-ROM @@ -111,13 +120,13 @@ CD-ROM handle. Drives are numbered starting with 0. Drive 0 is the system default CD-ROM. */ -extern DECLSPEC SDL_CD * SDLCALL SDL_CDOpen(int drive); +extern DECLSPEC SDL_CD *SDLCALL SDL_CDOpen (int drive); /* This function returns the current status of the given drive. If the drive has a CD in it, the table of contents of the CD and current play position of the CD will be stored in the SDL_CD structure. */ -extern DECLSPEC CDstatus SDLCALL SDL_CDStatus(SDL_CD *cdrom); +extern DECLSPEC CDstatus SDLCALL SDL_CDStatus (SDL_CD * cdrom); /* Play the given CD starting at 'start_track' and 'start_frame' for 'ntracks' tracks and 'nframes' frames. If both 'ntrack' and 'nframe' are 0, play @@ -138,34 +147,41 @@ This function returns 0, or -1 if there was an error. */ -extern DECLSPEC int SDLCALL SDL_CDPlayTracks(SDL_CD *cdrom, - int start_track, int start_frame, int ntracks, int nframes); +extern DECLSPEC int SDLCALL SDL_CDPlayTracks (SDL_CD * cdrom, + int start_track, + int start_frame, int ntracks, + int nframes); /* Play the given CD starting at 'start' frame for 'length' frames. It returns 0, or -1 if there was an error. */ -extern DECLSPEC int SDLCALL SDL_CDPlay(SDL_CD *cdrom, int start, int length); +extern DECLSPEC int SDLCALL SDL_CDPlay (SDL_CD * cdrom, int start, + int length); /* Pause play -- returns 0, or -1 on error */ -extern DECLSPEC int SDLCALL SDL_CDPause(SDL_CD *cdrom); +extern DECLSPEC int SDLCALL SDL_CDPause (SDL_CD * cdrom); /* Resume play -- returns 0, or -1 on error */ -extern DECLSPEC int SDLCALL SDL_CDResume(SDL_CD *cdrom); +extern DECLSPEC int SDLCALL SDL_CDResume (SDL_CD * cdrom); /* Stop play -- returns 0, or -1 on error */ -extern DECLSPEC int SDLCALL SDL_CDStop(SDL_CD *cdrom); +extern DECLSPEC int SDLCALL SDL_CDStop (SDL_CD * cdrom); /* Eject CD-ROM -- returns 0, or -1 on error */ -extern DECLSPEC int SDLCALL SDL_CDEject(SDL_CD *cdrom); +extern DECLSPEC int SDLCALL SDL_CDEject (SDL_CD * cdrom); /* Closes the handle for the CD-ROM drive */ -extern DECLSPEC void SDLCALL SDL_CDClose(SDL_CD *cdrom); +extern DECLSPEC void SDLCALL SDL_CDClose (SDL_CD * cdrom); /* Ends C function definitions when using C++ */ #ifdef __cplusplus +/* *INDENT-OFF* */ } +/* *INDENT-ON* */ #endif #include "close_code.h" #endif /* _SDL_video_h */ + +/* vi: set ts=4 sw=4 expandtab: */