Annotated edit history of
SDL_CDStatus(3) version 1, including all changes.
View license author blame.
| Rev |
Author |
# |
Line |
| 1 |
perry |
1 |
SDL_CDStatus |
| |
|
2 |
!!!SDL_CDStatus |
| |
|
3 |
NAME |
| |
|
4 |
SYNOPSIS |
| |
|
5 |
DESCRIPTION |
| |
|
6 |
EXAMPLE |
| |
|
7 |
SEE ALSO |
| |
|
8 |
---- |
| |
|
9 |
!!NAME |
| |
|
10 |
|
| |
|
11 |
|
| |
|
12 |
SDL_CDStatus- Returns the current status of the given drive. |
| |
|
13 |
!!SYNOPSIS |
| |
|
14 |
|
| |
|
15 |
|
| |
|
16 |
__#include __ |
| |
|
17 |
|
| |
|
18 |
|
| |
|
19 |
__CDstatus SDL_CDStatus__(__SDL_CD *cdrom__); __/* |
| |
|
20 |
Given a status, returns true if there's a disk in the drive |
| |
|
21 |
*/ #define CD_INDRIVE(status) ((int)status |
| |
|
22 |
__ |
| |
|
23 |
!!DESCRIPTION |
| |
|
24 |
|
| |
|
25 |
|
| |
|
26 |
This function returns the current status of the given drive. |
| |
|
27 |
Status is described like so: |
| |
|
28 |
|
| |
|
29 |
|
| |
|
30 |
typedef enum { |
| |
|
31 |
CD_TRAYEMPTY, |
| |
|
32 |
CD_STOPPED, |
| |
|
33 |
CD_PLAYING, |
| |
|
34 |
CD_PAUSED, |
| |
|
35 |
CD_ERROR = -1 |
| |
|
36 |
} CDstatus; |
| |
|
37 |
|
| |
|
38 |
|
| |
|
39 |
If the drive has a CD in it, the table of contents of the CD |
| |
|
40 |
and current play position of the CD will be stored in the |
| |
|
41 |
SDL_CD structure. |
| |
|
42 |
|
| |
|
43 |
|
| |
|
44 |
The macro __CD_INDRIVE__ is provided for convenience, and |
| |
|
45 |
given a status returns true if there's a disk in the |
| |
|
46 |
drive. |
| |
|
47 |
|
| |
|
48 |
|
| |
|
49 |
__Note:__ |
| |
|
50 |
|
| |
|
51 |
|
| |
|
52 |
__SDL_CDStatus__ also updates the __SDL_CD__ structure |
| |
|
53 |
passed to it. |
| |
|
54 |
!!EXAMPLE |
| |
|
55 |
|
| |
|
56 |
|
| |
|
57 |
int playTrack(int track) |
| |
|
58 |
{ |
| |
|
59 |
int playing = 0; |
| |
|
60 |
if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) { |
| |
|
61 |
/* clamp to the actual number of tracks on the CD */ |
| |
|
62 |
if (track |
| |
|
63 |
!!SEE ALSO |
| |
|
64 |
|
| |
|
65 |
|
| |
|
66 |
__SDL_CD__ |
| |
|
67 |
---- |
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.