Mercurial > sdl-ios-xcode
annotate docs/man3/SDL_CDOpen.3 @ 1180:bdcb8bb4c831
From: Tyler Montbriand <tsm@accesscomm.ca>
To: sdl@libsdl.org
Date: Fri, 30 Sep 2005 02:24:50 -0600
Subject: [SDL] WinCE timers, continued
Here's a strange timer for Windows CE that doesn't ignore time across
suspends. It uses GetSystemTime to keep the time continuous, and GetTicks to
get finer-grained readings than 1 second. It detects the difference between
the GetTicks time and GetSystemTime time on power-on to keep the error within
one second max.
It's not a patch on the current win32 timer code -- took one look at that and
figured it had more than enough #ifdefs already. It's windows-ce specific.
Another thing I've noticed is that the Windows CE 4.0 and newer API has
functions warn processes about suspends. This is something SDL REALLY needs
for audio in particular, because turning it off while it's playing causes
anything that uses audio to hardlock the system on power-on. Unfortunately I
don't have 4.0 to play with. :(
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Tue, 22 Nov 2005 07:10:07 +0000 |
parents | e5bc29de3f0a |
children | 546f7c1eb755 |
rev | line source |
---|---|
181
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
1 .TH "SDL_CDOpen" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference" |
0 | 2 .SH "NAME" |
3 SDL_CDOpen\- Opens a CD-ROM drive for access\&. | |
4 .SH "SYNOPSIS" | |
5 .PP | |
6 \fB#include "SDL\&.h" | |
7 .sp | |
8 \fBSDL_CD *\fBSDL_CDOpen\fP\fR(\fBint drive\fR); | |
9 .SH "DESCRIPTION" | |
10 .PP | |
11 Opens a CD-ROM drive for access\&. It returns a \fI\fBSDL_CD\fR\fR structure on success, or \fBNULL\fP if the drive was invalid or busy\&. This newly opened CD-ROM becomes the default CD used when other CD functions are passed a \fBNULL\fP CD-ROM handle\&. | |
12 .PP | |
13 Drives are numbered starting with 0\&. Drive 0 is the system default CD-ROM\&. | |
14 .SH "EXAMPLES" | |
15 .PP | |
16 .nf | |
17 \f(CWSDL_CD *cdrom; | |
18 int cur_track; | |
19 int min, sec, frame; | |
20 SDL_Init(SDL_INIT_CDROM); | |
21 atexit(SDL_Quit); | |
22 | |
23 /* Check for CD drives */ | |
24 if(!SDL_CDNumDrives()){ | |
25 /* None found */ | |
26 fprintf(stderr, "No CDROM devices available | |
27 "); | |
28 exit(-1); | |
29 } | |
30 | |
31 /* Open the default drive */ | |
32 cdrom=SDL_CDOpen(0); | |
33 | |
34 /* Did if open? Check if cdrom is NULL */ | |
35 if(!cdrom){ | |
36 fprintf(stderr, "Couldn\&'t open drive: %s | |
37 ", SDL_GetError()); | |
38 exit(-1); | |
39 } | |
40 | |
41 /* Print Volume info */ | |
42 printf("Name: %s | |
43 ", SDL_CDName(0)); | |
44 printf("Tracks: %d | |
45 ", cdrom->numtracks); | |
46 for(cur_track=0;cur_track < cdrom->numtracks; cur_track++){ | |
47 FRAMES_TO_MSF(cdrom->track[cur_track]\&.length, &min, &sec, &frame); | |
48 printf(" Track %d: Length %d:%d | |
49 ", cur_track, min, sec); | |
50 } | |
51 | |
52 SDL_CDClose(cdrom);\fR | |
53 .fi | |
54 .PP | |
55 .SH "SEE ALSO" | |
56 .PP | |
57 \fI\fBSDL_CD\fR\fR, \fI\fBSDL_CDtrack\fR\fR, \fI\fBSDL_CDClose\fP\fR | |
181
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
58 ...\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58 |