Backport from 1.3 branch: clean up opened joysticks in SDL_JoystickQuit().
[sdl_omap.git] / docs / html / sdlcdplaytracks.html
... / ...
CommitLineData
1<HTML
2><HEAD
3><TITLE
4>SDL_CDPlayTracks</TITLE
5><META
6NAME="GENERATOR"
7CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
8"><LINK
9REL="HOME"
10TITLE="SDL Library Documentation"
11HREF="index.html"><LINK
12REL="UP"
13TITLE="CD-ROM"
14HREF="cdrom.html"><LINK
15REL="PREVIOUS"
16TITLE="SDL_CDPlay"
17HREF="sdlcdplay.html"><LINK
18REL="NEXT"
19TITLE="SDL_CDPause"
20HREF="sdlcdpause.html"></HEAD
21><BODY
22CLASS="REFENTRY"
23BGCOLOR="#FFF8DC"
24TEXT="#000000"
25LINK="#0000ee"
26VLINK="#551a8b"
27ALINK="#ff0000"
28><DIV
29CLASS="NAVHEADER"
30><TABLE
31SUMMARY="Header navigation table"
32WIDTH="100%"
33BORDER="0"
34CELLPADDING="0"
35CELLSPACING="0"
36><TR
37><TH
38COLSPAN="3"
39ALIGN="center"
40>SDL Library Documentation</TH
41></TR
42><TR
43><TD
44WIDTH="10%"
45ALIGN="left"
46VALIGN="bottom"
47><A
48HREF="sdlcdplay.html"
49ACCESSKEY="P"
50>Prev</A
51></TD
52><TD
53WIDTH="80%"
54ALIGN="center"
55VALIGN="bottom"
56></TD
57><TD
58WIDTH="10%"
59ALIGN="right"
60VALIGN="bottom"
61><A
62HREF="sdlcdpause.html"
63ACCESSKEY="N"
64>Next</A
65></TD
66></TR
67></TABLE
68><HR
69ALIGN="LEFT"
70WIDTH="100%"></DIV
71><H1
72><A
73NAME="SDLCDPLAYTRACKS"
74></A
75>SDL_CDPlayTracks</H1
76><DIV
77CLASS="REFNAMEDIV"
78><A
79NAME="AEN7375"
80></A
81><H2
82>Name</H2
83>SDL_CDPlayTracks&nbsp;--&nbsp;Play the given CD track(s)</DIV
84><DIV
85CLASS="REFSYNOPSISDIV"
86><A
87NAME="AEN7378"
88></A
89><H2
90>Synopsis</H2
91><DIV
92CLASS="FUNCSYNOPSIS"
93><A
94NAME="AEN7379"
95></A
96><P
97></P
98><PRE
99CLASS="FUNCSYNOPSISINFO"
100>#include "SDL.h"</PRE
101><P
102><CODE
103><CODE
104CLASS="FUNCDEF"
105>int <B
106CLASS="FSFUNC"
107>SDL_CDPlayTracks</B
108></CODE
109>(SDL_CD *cdrom, int start_track, int start_frame, int ntracks, int nframes));</CODE
110></P
111><P
112></P
113></DIV
114></DIV
115><DIV
116CLASS="REFSECT1"
117><A
118NAME="AEN7385"
119></A
120><H2
121>Description</H2
122><P
123><TT
124CLASS="FUNCTION"
125>SDL_CDPlayTracks</TT
126> plays the given CD starting at track
127<TT
128CLASS="PARAMETER"
129><I
130>start_track</I
131></TT
132>, for <TT
133CLASS="PARAMETER"
134><I
135>ntracks</I
136></TT
137> tracks. </P
138><P
139><TT
140CLASS="PARAMETER"
141><I
142>start_frame</I
143></TT
144> is the frame offset, from the beginning of the <TT
145CLASS="PARAMETER"
146><I
147>start_track</I
148></TT
149>, at which to start. <TT
150CLASS="PARAMETER"
151><I
152>nframes</I
153></TT
154> is the frame offset, from the beginning of the last track (<TT
155CLASS="PARAMETER"
156><I
157>start_track</I
158></TT
159>+<TT
160CLASS="PARAMETER"
161><I
162>ntracks</I
163></TT
164>), at which to end playing.</P
165><P
166><TT
167CLASS="FUNCTION"
168>SDL_CDPlayTracks</TT
169> should only be called after calling
170<A
171HREF="sdlcdstatus.html"
172><TT
173CLASS="FUNCTION"
174>SDL_CDStatus</TT
175></A
176>
177to get track information about the CD.</P
178><DIV
179CLASS="NOTE"
180><BLOCKQUOTE
181CLASS="NOTE"
182><P
183><B
184>Note: </B
185>Data tracks are ignored.</P
186></BLOCKQUOTE
187></DIV
188></DIV
189><DIV
190CLASS="REFSECT1"
191><A
192NAME="AEN7403"
193></A
194><H2
195>Return Value</H2
196><P
197>Returns <SPAN
198CLASS="RETURNVALUE"
199>0</SPAN
200>, or <SPAN
201CLASS="RETURNVALUE"
202>-1</SPAN
203>
204if there was an error.</P
205></DIV
206><DIV
207CLASS="REFSECT1"
208><A
209NAME="AEN7408"
210></A
211><H2
212>Examples</H2
213><P
214><PRE
215CLASS="PROGRAMLISTING"
216>/* assuming cdrom is a previously opened device */
217/* Play the entire CD */
218if(CD_INDRIVE(SDL_CDStatus(cdrom)))
219 SDL_CDPlayTracks(cdrom, 0, 0, 0, 0);
220
221/* Play the first track */
222if(CD_INDRIVE(SDL_CDStatus(cdrom)))
223 SDL_CDPlayTracks(cdrom, 0, 0, 1, 0);
224
225/* Play first 15 seconds of the 2nd track */
226if(CD_INDRIVE(SDL_CDStatus(cdrom)))
227 SDL_CDPlayTracks(cdrom, 1, 0, 0, CD_FPS*15);</PRE
228>
229&#13;</P
230></DIV
231><DIV
232CLASS="REFSECT1"
233><A
234NAME="AEN7412"
235></A
236><H2
237>See Also</H2
238><P
239><A
240HREF="sdlcdplay.html"
241><TT
242CLASS="FUNCTION"
243>SDL_CDPlay</TT
244></A
245>,
246<A
247HREF="sdlcdstatus.html"
248><TT
249CLASS="FUNCTION"
250>SDL_CDStatus</TT
251></A
252>,
253<A
254HREF="sdlcd.html"
255><TT
256CLASS="FUNCTION"
257>SDL_CD</TT
258></A
259></P
260></DIV
261><DIV
262CLASS="NAVFOOTER"
263><HR
264ALIGN="LEFT"
265WIDTH="100%"><TABLE
266SUMMARY="Footer navigation table"
267WIDTH="100%"
268BORDER="0"
269CELLPADDING="0"
270CELLSPACING="0"
271><TR
272><TD
273WIDTH="33%"
274ALIGN="left"
275VALIGN="top"
276><A
277HREF="sdlcdplay.html"
278ACCESSKEY="P"
279>Prev</A
280></TD
281><TD
282WIDTH="34%"
283ALIGN="center"
284VALIGN="top"
285><A
286HREF="index.html"
287ACCESSKEY="H"
288>Home</A
289></TD
290><TD
291WIDTH="33%"
292ALIGN="right"
293VALIGN="top"
294><A
295HREF="sdlcdpause.html"
296ACCESSKEY="N"
297>Next</A
298></TD
299></TR
300><TR
301><TD
302WIDTH="33%"
303ALIGN="left"
304VALIGN="top"
305>SDL_CDPlay</TD
306><TD
307WIDTH="34%"
308ALIGN="center"
309VALIGN="top"
310><A
311HREF="cdrom.html"
312ACCESSKEY="U"
313>Up</A
314></TD
315><TD
316WIDTH="33%"
317ALIGN="right"
318VALIGN="top"
319>SDL_CDPause</TD
320></TR
321></TABLE
322></DIV
323></BODY
324></HTML
325>