5131 |
clevermous |
1 |
|
|
|
2 |
> |
|
|
3 |
> |
|
|
4 |
>CD-ROM |
|
|
5 |
> |
|
|
6 |
NAME="GENERATOR" |
|
|
7 |
CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
|
|
8 |
"> |
|
|
9 |
REL="HOME" |
|
|
10 |
TITLE="SDL Library Documentation" |
|
|
11 |
HREF="index.html"> |
|
|
12 |
REL="UP" |
|
|
13 |
TITLE="SDL Reference" |
|
|
14 |
HREF="reference.html"> |
|
|
15 |
REL="PREVIOUS" |
|
|
16 |
TITLE="SDL_CloseAudio" |
|
|
17 |
HREF="sdlcloseaudio.html"> |
|
|
18 |
REL="NEXT" |
|
|
19 |
TITLE="SDL_CDNumDrives" |
|
|
20 |
HREF="sdlcdnumdrives.html"> |
|
|
21 |
NAME="KEYWORD" |
|
|
22 |
CONTENT="cdrom"> |
|
|
23 |
NAME="KEYWORD" |
|
|
24 |
CONTENT="function"> |
|
|
25 |
> |
|
|
26 |
CLASS="CHAPTER" |
|
|
27 |
BGCOLOR="#FFF8DC" |
|
|
28 |
TEXT="#000000" |
|
|
29 |
LINK="#0000ee" |
|
|
30 |
VLINK="#551a8b" |
|
|
31 |
ALINK="#ff0000" |
|
|
32 |
> |
|
|
33 |
CLASS="NAVHEADER" |
|
|
34 |
>
|
|
35 |
WIDTH="100%" |
|
|
36 |
BORDER="0" |
|
|
37 |
CELLPADDING="0" |
|
|
38 |
CELLSPACING="0" |
|
|
39 |
>
|
|
40 |
> | |
|
|
41 |
COLSPAN="3" |
|
|
42 |
ALIGN="center" |
|
|
43 |
>SDL Library Documentation |
|
|
44 |
> | |
|
|
45 |
>
|
|
46 |
> |
|
|
|
47 |
WIDTH="10%" |
|
|
48 |
ALIGN="left" |
|
|
49 |
VALIGN="bottom" |
|
|
50 |
> |
|
|
51 |
HREF="sdlcloseaudio.html" |
|
|
52 |
>Prev |
|
|
53 |
> |
|
|
54 |
> |
|
|
|
55 |
WIDTH="80%" |
|
|
56 |
ALIGN="center" |
|
|
57 |
VALIGN="bottom" |
|
|
58 |
> |
|
|
59 |
> |
|
|
|
60 |
WIDTH="10%" |
|
|
61 |
ALIGN="right" |
|
|
62 |
VALIGN="bottom" |
|
|
63 |
> |
|
|
64 |
HREF="sdlcdnumdrives.html" |
|
|
65 |
>Next |
|
|
66 |
> |
|
|
67 |
> | |
|
|
68 |
> | |
|
|
69 |
>
|
|
|
70 |
ALIGN="LEFT" |
|
|
71 |
WIDTH="100%"> |
|
|
72 |
> |
|
|
73 |
CLASS="CHAPTER" |
|
|
74 |
> |
|
|
75 |
> |
|
|
76 |
NAME="CDROM" |
|
|
77 |
>Chapter 11. CD-ROM |
|
|
78 |
> |
|
|
79 |
> |
|
|
80 |
CLASS="TOC" |
|
|
81 |
>
|
|
|
82 |
> |
|
|
83 |
> |
|
|
84 |
>Table of Contents |
|
|
85 |
> |
|
|
86 |
> |
|
|
87 |
> |
|
|
88 |
HREF="sdlcdnumdrives.html" |
|
|
89 |
>SDL_CDNumDrives |
|
|
90 |
> — Returns the number of CD-ROM drives on the system. |
|
|
91 |
> |
|
|
92 |
> |
|
|
93 |
HREF="sdlcdname.html" |
|
|
94 |
>SDL_CDName |
|
|
95 |
> — Returns a human-readable, system-dependent identifier for the CD-ROM. |
|
|
96 |
> |
|
|
97 |
> |
|
|
98 |
HREF="sdlcdopen.html" |
|
|
99 |
>SDL_CDOpen |
|
|
100 |
> — Opens a CD-ROM drive for access. |
|
|
101 |
> |
|
|
102 |
> |
|
|
103 |
HREF="sdlcdstatus.html" |
|
|
104 |
>SDL_CDStatus |
|
|
105 |
> — Returns the current status of the given drive. |
|
|
106 |
> |
|
|
107 |
> |
|
|
108 |
HREF="sdlcdplay.html" |
|
|
109 |
>SDL_CDPlay |
|
|
110 |
> — Play a CD |
|
|
111 |
> |
|
|
112 |
> |
|
|
113 |
HREF="sdlcdplaytracks.html" |
|
|
114 |
>SDL_CDPlayTracks |
|
|
115 |
> — Play the given CD track(s) |
|
|
116 |
> |
|
|
117 |
> |
|
|
118 |
HREF="sdlcdpause.html" |
|
|
119 |
>SDL_CDPause |
|
|
120 |
> — Pauses a CDROM |
|
|
121 |
> |
|
|
122 |
> |
|
|
123 |
HREF="sdlcdresume.html" |
|
|
124 |
>SDL_CDResume |
|
|
125 |
> — Resumes a CDROM |
|
|
126 |
> |
|
|
127 |
> |
|
|
128 |
HREF="sdlcdstop.html" |
|
|
129 |
>SDL_CDStop |
|
|
130 |
> — Stops a CDROM |
|
|
131 |
> |
|
|
132 |
> |
|
|
133 |
HREF="sdlcdeject.html" |
|
|
134 |
>SDL_CDEject |
|
|
135 |
> — Ejects a CDROM |
|
|
136 |
> |
|
|
137 |
> |
|
|
138 |
HREF="sdlcdclose.html" |
|
|
139 |
>SDL_CDClose |
|
|
140 |
> — Closes a SDL_CD handle |
|
|
141 |
> |
|
|
142 |
> |
|
|
143 |
HREF="sdlcd.html" |
|
|
144 |
>SDL_CD |
|
|
145 |
> — CDROM Drive Information |
|
|
146 |
> |
|
|
147 |
> |
|
|
148 |
HREF="sdlcdtrack.html" |
|
|
149 |
>SDL_CDtrack |
|
|
150 |
> — CD Track Information Structure |
|
|
151 |
> |
|
|
152 |
> |
|
|
153 |
> |
|
|
154 |
>SDL supports audio control of up to 32 local CD-ROM drives at once. |
|
|
155 |
> |
|
|
156 |
>You use this API to perform all the basic functions of a CD player, |
|
|
157 |
including listing the tracks, playing, stopping, and ejecting the CD-ROM. |
|
|
158 |
(Currently, multi-changer CD drives are not supported.) |
|
|
159 |
> |
|
|
160 |
>Before you call any of the SDL CD-ROM functions, you must first call |
|
|
161 |
" |
|
|
162 |
CLASS="FUNCTION" |
|
|
163 |
>SDL_Init(SDL_INIT_CDROM) |
|
|
164 |
>", which scans the system for |
|
|
165 |
CD-ROM drives, and sets the program up for audio control. Check the |
|
|
166 |
return code, which should be |
|
|
167 |
CLASS="RETURNVALUE" |
|
|
168 |
>0 |
|
|
169 |
>, to see if there |
|
|
170 |
were any errors in starting up. |
|
|
171 |
> |
|
|
172 |
>After you have initialized the library, you can find out how many drives |
|
|
173 |
are available using the |
|
|
174 |
CLASS="FUNCTION" |
|
|
175 |
>SDL_CDNumDrives() |
|
|
176 |
> function. |
|
|
177 |
The first drive listed is the system default CD-ROM drive. After you have |
|
|
178 |
chosen a drive, and have opened it with |
|
|
179 |
CLASS="FUNCTION" |
|
|
180 |
>SDL_CDOpen() |
|
|
181 |
>, |
|
|
182 |
you can check the status and start playing if there's a CD in the drive. |
|
|
183 |
> |
|
|
184 |
>A CD-ROM is organized into one or more tracks, each consisting of a certain |
|
|
185 |
number of "frames". Each frame is ~2K in size, and at normal playing speed, |
|
|
186 |
a CD plays 75 frames per second. SDL works with the number of frames on a |
|
|
187 |
CD, but this can easily be converted to the more familiar minutes/seconds |
|
|
188 |
format by using the |
|
|
189 |
CLASS="FUNCTION" |
|
|
190 |
>FRAMES_TO_MSF() |
|
|
191 |
> macro. |
|
|
192 |
> |
|
|
193 |
> |
|
|
194 |
CLASS="NAVFOOTER" |
|
|
195 |
>
|
|
|
196 |
ALIGN="LEFT" |
|
|
197 |
WIDTH="100%"> |
|
|
249 |
> |
|
|
250 |
> |
|
|
251 |
> |
|
|
252 |
> |