pygame / docs / ref / CD.html

<body bgcolor=#dddddd text=#333377 link=#7777bb vlink=#7777bb>

<table border=0 width=100% cellpadding=0 cellspacing=0 bgcolor=#f5f5f5><tr valign=top>
<td rowspan=2><table border=0 cellpadding=5 cellspacing=0 bgcolor=#333377>
<tr height=86 align=left><td valign=middle><font color=#ffffff size=+5>
	<a href=../index.html><font size=+5 color=#ffffff><i><b>
<td valign=middle><tt><font color=#dddddd><br>
</td></tr></table></td><td width=100% align=center valign=middle>

	<a href=>Home</a> &nbsp;||&nbsp;
	<a href=../index.html>Help Contents</a> &nbsp;||

|| <a href=CD.html>CD</a> || 
<a href=Channel.html>Channel</a> || 
<a href=Font.html>Font</a> || 
<a href=Joystick.html>Joystick</a> || 
<a href=Rect.html>Rect</a> || 
<a href=Sound.html>Sound</a> || 
<a href=Surface.html>Surface</a> ||<br>
|| <a href=pygame.html>pygame</a> || 
<a href=pygame_cdrom.html>cdrom</a> || 
<a href=pygame_constants.html>constants</a> || 
<a href=pygame_display.html>display</a> || 
<a href=pygame_event.html>event</a> || 
<a href=pygame_font.html>font</a> || 
<a href=pygame_image.html>image</a> ||<br>
|| <a href=pygame_joystick.html>joystick</a> || 
<a href=pygame_key.html>key</a> || 
<a href=pygame_mixer.html>mixer</a> || 
<a href=pygame_mixer_music.html>mixer_music</a> || 
<a href=pygame_mouse.html>mouse</a> || 
<a href=pygame_surfarray.html>surfarray</a> || 
<a href=pygame_time.html>time</a> ||<br>

<h2 align=center>CD</h2>
The CD object represents a CDROM drive and allows you to
access the CD inside that drive. All functions (except get_name())
require the CD object to be initialized. This is done with the
CD.init() function.


<tr><td><a href=#eject>eject</a></td><td> -
ejects cdrom drive</td></tr>

<tr><td><a href=#get_busy>get_busy</a></td><td> -
checks if the cd is currently playing</td></tr>

<tr><td><a href=#get_current>get_current</a></td><td> -
get current position of the cdrom</td></tr>

<tr><td><a href=#get_empty>get_empty</a></td><td> -
checks for a cd in the drive</td></tr>

<tr><td><a href=#get_init>get_init</a></td><td> -
check if cd is initialized</td></tr>

<tr><td><a href=#get_name>get_name</a></td><td> -
query name of cdrom drive</td></tr>

<tr><td><a href=#get_paused>get_paused</a></td><td> -
checks if the cd is currently paused</td></tr>

<tr><td><a href=#get_track_audio>get_track_audio</a></td><td> -
check if a track has audio data</td></tr>

<tr><td><a href=#get_track_length>get_track_length</a></td><td> -
check the length of an audio track</td></tr>

<tr><td><a href=#get_track_start>get_track_start</a></td><td> -
check the start of an audio track</td></tr>

<tr><td><a href=#get_tracks>get_tracks</a></td><td> -
get number of tracks on cd</td></tr>

<tr><td><a href=#init>init</a></td><td> -
initialize a cdrom device for use</td></tr>

<tr><td><a href=#pause>pause</a></td><td> -
pause playing cdrom</td></tr>

<tr><td><a href=#play>play</a></td><td> -
play music from cdrom</td></tr>

<tr><td><a href=#quit>quit</a></td><td> -
uninitialize a cdrom device for use</td></tr>

<tr><td><a href=#resume>resume</a></td><td> -
resume paused cdrom</td></tr>

<tr><td><a href=#stop>stop</a></td><td> -
stops playing cdrom</td></tr>



<a name=eject><font size=+2><b>eject
</b></font><br><font size=+1><tt>
CD.eject() -> None
Ejects the media from the CDROM drive. If the drive is empty, this
will open the CDROM drive.

<a name=get_busy><font size=+2><b>get_busy
</b></font><br><font size=+1><tt>
CD.get_busy() -> bool
Returns a true value if the cd drive is currently playing. If
the drive is paused, this will return false.

<a name=get_current><font size=+2><b>get_current
</b></font><br><font size=+1><tt>
CD.get_current() -> track, seconds
Returns the current track on the cdrom and the number of
seconds into that track.

<a name=get_empty><font size=+2><b>get_empty
</b></font><br><font size=+1><tt>
CD.get_empty() -> bool
Returns a true value if the cd drive is empty.

<a name=get_init><font size=+2><b>get_init
</b></font><br><font size=+1><tt>
CD.get_init() -> bool
Returns a true value if the CD is initialized.

<a name=get_name><font size=+2><b>get_name
</b></font><br><font size=+1><tt>
CD.get_name(id) -> string
Returns the name of the CDROM device, given by the
system. This function can be called before the drive
is initialized.

<a name=get_paused><font size=+2><b>get_paused
</b></font><br><font size=+1><tt>
CD.get_paused() -> bool
Returns a true value if the cd drive is currently paused.

<a name=get_track_audio><font size=+2><b>get_track_audio
</b></font><br><font size=+1><tt>
CD.get_track_audio(track) -> bool
Returns true if the cdrom track contains audio data.

<a name=get_track_length><font size=+2><b>get_track_length
</b></font><br><font size=+1><tt>
CD.get_track_length(track) -> seconds
Returns the number of seconds in an audio track. If the
track does not contain audio data, returns 0.0.

<a name=get_track_start><font size=+2><b>get_track_start
</b></font><br><font size=+1><tt>
CD.get_track_start(track) -> seconds
Returns the number of seconds an audio track starts
on the cd.

<a name=get_tracks><font size=+2><b>get_tracks
</b></font><br><font size=+1><tt>
CD.get_tracks() -> numtracks
Returns the number of available tracks on the CD. Note that not
all of these tracks contain audio data. Use CD.get_audio() to check
the track type before playing.

<a name=init><font size=+2><b>init
</b></font><br><font size=+1><tt>
CD.init() -> None
In order to call most members in the CD object, the
CD must be initialized. You can initialzie the CD object
at anytime, and it is ok to initialize more than once.

<a name=pause><font size=+2><b>pause
</b></font><br><font size=+1><tt>
CD.pause() -> None
Pauses the playing CD. If the CD is not playing, this will
do nothing.

<a name=play><font size=+2><b>play
</b></font><br><font size=+1><tt> -> None
Play an audio track on a cdrom disk.

<a name=quit><font size=+2><b>quit
</b></font><br><font size=+1><tt>
CD.quit() -> None
After you are completely finished with a cdrom device, you
can use this <a href=pygame.html#quit>quit()</a> function to free access to the drive.
This will be cleaned up automatically when the cdrom module is.
uninitialized. It is safe to call this function on an uninitialized CD.

<a name=resume><font size=+2><b>resume
</b></font><br><font size=+1><tt>
CD.resume() -> int
Resumes playback of a paused CD. If the CD has not been
pause, this will do nothing.

<a name=stop><font size=+2><b>stop
</b></font><br><font size=+1><tt>
CD.stop() -> int
Stops the playing CD. If the CD is not playing, this will
do nothing.