~ubuntu-branches/ubuntu/gutsy/pygame/gutsy

« back to all changes in this revision

Viewing changes to docs/ref/CD.html

  • Committer: Bazaar Package Importer
  • Author(s): Ed Boraas
  • Date: 2002-02-20 06:39:24 UTC
  • Revision ID: james.westby@ubuntu.com-20020220063924-amlzj7tqkeods4eq
Tags: upstream-1.4
ImportĀ upstreamĀ versionĀ 1.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html>
 
2
<title>CD</title>
 
3
<body bgcolor=#aaeebb text=#000000 link=#331111 vlink=#331111>
 
4
 
 
5
 
 
6
<table cellspacing=3 width=100%><tr><td bgcolor=#00000>
 
7
<table width=100%><tr><td bgcolor=c2fc20 align=center>
 
8
    <a href=http://www.pygame.org>
 
9
    <img src=../pygame_tiny.gif border=0 width=200 height=60></a><br>
 
10
    <b>pygame&nbsp;&nbsp;&nbsp;documentation</b>
 
11
</td><td bgcolor=6aee28 align=center valign=top width=100%>
 
12
 
 
13
        ||&nbsp;
 
14
        <a href=http://www.pygame.org>Home</a> &nbsp;||&nbsp;
 
15
        <a href=../index.html>Help Contents</a> &nbsp;||
 
16
        <br>&nbsp;<br>
 
17
 
 
18
|| <a href=pygame.html>pygame</a> || 
 
19
<a href=pygame_cdrom.html>cdrom</a> || 
 
20
<a href=pygame_constants.html>constants</a> || 
 
21
<a href=pygame_display.html>display</a> || 
 
22
<a href=pygame_draw.html>draw</a> || 
 
23
<a href=pygame_event.html>event</a> ||<br>
 
24
|| <a href=pygame_font.html>font</a> || 
 
25
<a href=pygame_image.html>image</a> || 
 
26
<a href=pygame_joystick.html>joystick</a> || 
 
27
<a href=pygame_key.html>key</a> || 
 
28
<a href=pygame_mixer.html>mixer</a> || 
 
29
<a href=pygame_mixer_music.html>mixer_music</a> ||<br>
 
30
|| <a href=pygame_mouse.html>mouse</a> || 
 
31
<a href=pygame_movie.html>movie</a> || 
 
32
<a href=pygame_surfarray.html>surfarray</a> || 
 
33
<a href=pygame_time.html>time</a> || 
 
34
<a href=pygame_transform.html>transform</a> ||<br>
 
35
&nbsp;<br>|| <a href=CD.html>CD</a> || 
 
36
<a href=Channel.html>Channel</a> || 
 
37
<a href=Clock.html>Clock</a> || 
 
38
<a href=Font.html>Font</a> || 
 
39
<a href=Joystick.html>Joystick</a> || 
 
40
<a href=Movie.html>Movie</a> ||<br>
 
41
|| <a href=Rect.html>Rect</a> || 
 
42
<a href=Sound.html>Sound</a> || 
 
43
<a href=Surface.html>Surface</a> ||<br>
 
44
&nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
 
45
<a href=pygame_sprite.html>sprite</a> || 
 
46
<a href=pygame_version.html>version</a> ||<br>
 
47
 
 
48
 
 
49
</td></tr></table></td></tr></table>
 
50
<br>
 
51
<h2 align=center>CD</h2>
 
52
The CD object represents a CDROM drive and allows you to
 
53
access the CD inside that drive. All functions (except <a href=#get_name>get_name()</a> and <a href=#get_id>get_id()</a>)
 
54
require the CD object to be initialized. This is done with the
 
55
<a href=#init>CD.init()</a> function.
 
56
<br>&nbsp;<br>
 
57
Be sure to understand there is a difference between the cdrom module
 
58
and the CD objects.
 
59
 
 
60
<hr>
 
61
 
 
62
<table>
 
63
<tr><td><a href=#eject>eject</a></td><td> -
 
64
ejects cdrom drive</td></tr>
 
65
 
 
66
 
 
67
<tr><td><a href=#get_all>get_all</a></td><td> -
 
68
get all track information for the cd</td></tr>
 
69
 
 
70
 
 
71
<tr><td><a href=#get_busy>get_busy</a></td><td> -
 
72
checks if the cd is currently playing</td></tr>
 
73
 
 
74
 
 
75
<tr><td><a href=#get_current>get_current</a></td><td> -
 
76
get current position of the cdrom</td></tr>
 
77
 
 
78
 
 
79
<tr><td><a href=#get_empty>get_empty</a></td><td> -
 
80
checks for a cd in the drive</td></tr>
 
81
 
 
82
 
 
83
<tr><td><a href=#get_id>get_id</a></td><td> -
 
84
get device id number for drive</td></tr>
 
85
 
 
86
 
 
87
<tr><td><a href=#get_init>get_init</a></td><td> -
 
88
check if cd is initialized</td></tr>
 
89
 
 
90
 
 
91
<tr><td><a href=#get_name>get_name</a></td><td> -
 
92
query name of cdrom drive</td></tr>
 
93
 
 
94
 
 
95
<tr><td><a href=#get_numtracks>get_numtracks</a></td><td> -
 
96
get number of tracks on cd</td></tr>
 
97
 
 
98
 
 
99
<tr><td><a href=#get_paused>get_paused</a></td><td> -
 
100
checks if the cd is currently paused</td></tr>
 
101
 
 
102
 
 
103
<tr><td><a href=#get_track_audio>get_track_audio</a></td><td> -
 
104
check if a track has audio data</td></tr>
 
105
 
 
106
 
 
107
<tr><td><a href=#get_track_length>get_track_length</a></td><td> -
 
108
check the length of an audio track</td></tr>
 
109
 
 
110
 
 
111
<tr><td><a href=#get_track_start>get_track_start</a></td><td> -
 
112
check the start of an audio track</td></tr>
 
113
 
 
114
 
 
115
<tr><td><a href=#init>init</a></td><td> -
 
116
initialize a cdrom device for use</td></tr>
 
117
 
 
118
 
 
119
<tr><td><a href=#pause>pause</a></td><td> -
 
120
pause playing cdrom</td></tr>
 
121
 
 
122
 
 
123
<tr><td><a href=#play>play</a></td><td> -
 
124
play music from cdrom</td></tr>
 
125
 
 
126
 
 
127
<tr><td><a href=#quit>quit</a></td><td> -
 
128
uninitialize a cdrom device for use</td></tr>
 
129
 
 
130
 
 
131
<tr><td><a href=#resume>resume</a></td><td> -
 
132
resume paused cdrom</td></tr>
 
133
 
 
134
 
 
135
<tr><td><a href=#stop>stop</a></td><td> -
 
136
stops playing cdrom</td></tr>
 
137
 
 
138
 
 
139
</table>
 
140
 
 
141
<hr>
 
142
 
 
143
<a name=eject><font size=+2><b>eject
 
144
</b></font><br><font size=+1><tt>
 
145
CD.eject() -> None
 
146
</tt></font><ul>
 
147
Ejects the media from the CDROM drive. If the drive is empty, this
 
148
will open the CDROM drive.
 
149
</ul><br>&nbsp;<br>
 
150
 
 
151
<a name=get_all><font size=+2><b>get_all
 
152
</b></font><br><font size=+1><tt>
 
153
CD.get_all() -> tuple
 
154
</tt></font><ul>
 
155
Returns a tuple with values for each track on the CD.
 
156
Each item in the tuple is a tuple with 4 values for each
 
157
track. First is a boolean set to true if this is an audio
 
158
track. The next 3 values are the start time, end time, and
 
159
length of the track.
 
160
</ul><br>&nbsp;<br>
 
161
 
 
162
<a name=get_busy><font size=+2><b>get_busy
 
163
</b></font><br><font size=+1><tt>
 
164
CD.get_busy() -> bool
 
165
</tt></font><ul>
 
166
Returns a true value if the cd drive is currently playing. If
 
167
the drive is paused, this will return false.
 
168
</ul><br>&nbsp;<br>
 
169
 
 
170
<a name=get_current><font size=+2><b>get_current
 
171
</b></font><br><font size=+1><tt>
 
172
CD.get_current() -> track, seconds
 
173
</tt></font><ul>
 
174
Returns the current track on the cdrom and the number of
 
175
seconds into that track.
 
176
</ul><br>&nbsp;<br>
 
177
 
 
178
<a name=get_empty><font size=+2><b>get_empty
 
179
</b></font><br><font size=+1><tt>
 
180
CD.get_empty() -> bool
 
181
</tt></font><ul>
 
182
Returns a true value if the cd drive is empty.
 
183
</ul><br>&nbsp;<br>
 
184
 
 
185
<a name=get_id><font size=+2><b>get_id
 
186
</b></font><br><font size=+1><tt>
 
187
CD.get_id() -> idnum
 
188
</tt></font><ul>
 
189
Returns the device id number for this cdrom drive. This is the
 
190
same number used in the call to <a href=pygame_cdrom.html#CD>pygame.cdrom.CD()</a> to create this
 
191
cd device. The CD object does not need to be initialized for this
 
192
function to work.
 
193
</ul><br>&nbsp;<br>
 
194
 
 
195
<a name=get_init><font size=+2><b>get_init
 
196
</b></font><br><font size=+1><tt>
 
197
CD.get_init() -> bool
 
198
</tt></font><ul>
 
199
Returns a true value if the CD is initialized.
 
200
</ul><br>&nbsp;<br>
 
201
 
 
202
<a name=get_name><font size=+2><b>get_name
 
203
</b></font><br><font size=+1><tt>
 
204
CD.get_name(id) -> string
 
205
</tt></font><ul>
 
206
Returns the name of the CDROM device, given by the
 
207
system. This function can be called before the drive
 
208
is initialized.
 
209
</ul><br>&nbsp;<br>
 
210
 
 
211
<a name=get_numtracks><font size=+2><b>get_numtracks
 
212
</b></font><br><font size=+1><tt>
 
213
CD.get_numtracks() -> numtracks
 
214
</tt></font><ul>
 
215
Returns the number of available tracks on the CD. Note that not
 
216
all of these tracks contain audio data. Use <a href=#get_track_audio>CD.get_track_audio()</a> to check
 
217
the track type before playing.
 
218
</ul><br>&nbsp;<br>
 
219
 
 
220
<a name=get_paused><font size=+2><b>get_paused
 
221
</b></font><br><font size=+1><tt>
 
222
CD.get_paused() -> bool
 
223
</tt></font><ul>
 
224
Returns a true value if the cd drive is currently paused.
 
225
</ul><br>&nbsp;<br>
 
226
 
 
227
<a name=get_track_audio><font size=+2><b>get_track_audio
 
228
</b></font><br><font size=+1><tt>
 
229
CD.get_track_audio(track) -> bool
 
230
</tt></font><ul>
 
231
Returns true if the cdrom track contains audio data.
 
232
</ul><br>&nbsp;<br>
 
233
 
 
234
<a name=get_track_length><font size=+2><b>get_track_length
 
235
</b></font><br><font size=+1><tt>
 
236
CD.get_track_length(track) -> seconds
 
237
</tt></font><ul>
 
238
Returns the number of seconds in an audio track. If the
 
239
track does not contain audio data, returns 0.0.
 
240
</ul><br>&nbsp;<br>
 
241
 
 
242
<a name=get_track_start><font size=+2><b>get_track_start
 
243
</b></font><br><font size=+1><tt>
 
244
CD.get_track_start(track) -> seconds
 
245
</tt></font><ul>
 
246
Returns the number of seconds an audio track starts
 
247
on the cd.
 
248
</ul><br>&nbsp;<br>
 
249
 
 
250
<a name=init><font size=+2><b>init
 
251
</b></font><br><font size=+1><tt>
 
252
CD.init() -> None
 
253
</tt></font><ul>
 
254
In order to call most members in the CD object, the
 
255
CD must be initialized. You can initialzie the CD object
 
256
at anytime, and it is ok to initialize more than once.
 
257
</ul><br>&nbsp;<br>
 
258
 
 
259
<a name=pause><font size=+2><b>pause
 
260
</b></font><br><font size=+1><tt>
 
261
CD.pause() -> None
 
262
</tt></font><ul>
 
263
Pauses the playing CD. If the CD is not playing, this will
 
264
do nothing.
 
265
</ul><br>&nbsp;<br>
 
266
 
 
267
<a name=play><font size=+2><b>play
 
268
</b></font><br><font size=+1><tt>
 
269
CD.play(track, [start, end]) -> None
 
270
</tt></font><ul>
 
271
Play an audio track on a cdrom disk.
 
272
You may also optionally pass a starting and ending
 
273
time to play of the song. If you pass the start end
 
274
end time in seconds, only that portion of the audio
 
275
track will be played
 
276
</ul><br>&nbsp;<br>
 
277
 
 
278
<a name=quit><font size=+2><b>quit
 
279
</b></font><br><font size=+1><tt>
 
280
CD.quit() -> None
 
281
</tt></font><ul>
 
282
After you are completely finished with a cdrom device, you
 
283
can use this <a href=pygame.html#quit>quit()</a> function to free access to the drive.
 
284
This will be cleaned up automatically when the cdrom module is.
 
285
uninitialized. It is safe to call this function on an uninitialized CD.
 
286
</ul><br>&nbsp;<br>
 
287
 
 
288
<a name=resume><font size=+2><b>resume
 
289
</b></font><br><font size=+1><tt>
 
290
CD.resume() -> int
 
291
</tt></font><ul>
 
292
Resumes playback of a paused CD. If the CD has not been
 
293
pause, this will do nothing.
 
294
</ul><br>&nbsp;<br>
 
295
 
 
296
<a name=stop><font size=+2><b>stop
 
297
</b></font><br><font size=+1><tt>
 
298
CD.stop() -> int
 
299
</tt></font><ul>
 
300
Stops the playing CD. If the CD is not playing, this will
 
301
do nothing.
 
302
</ul><br>&nbsp;<br>
 
303
 
 
304
 
 
305
<hr>
 
306
</body></html>