X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=sdlgit%2FSDL-Site.git;a=blobdiff_plain;f=pages%2FSDL-CD.html-inc;h=fbcb7b543ab4e1924649c700a45cc7b84a69d1b5;hp=18cb0fd0ac34f7f13644adf90b138373bdb1b81f;hb=d0dca2000e72d938a89961edc199154d64d92cbc;hpb=3065276381925b3e87e7851f9a52df76064b9916 diff --git a/pages/SDL-CD.html-inc b/pages/SDL-CD.html-inc index 18cb0fd..fbcb7b5 100644 --- a/pages/SDL-CD.html-inc +++ b/pages/SDL-CD.html-inc @@ -5,40 +5,22 @@
use SDL; +use SDL ':init'; use SDL::CDROM; use SDL::CD; @@ -70,14 +52,38 @@ { my $CD = SDL::CD->new( 0 ); - if($CD != NULL) + if($CD) { ... } } - SDL::quit(); ++ +
The constants are not exported by default. You can export them into your namespace by doing:
+use SDL::CD ':all'; + ++
or access them directly:
+SDL::CD::CD_TRAYEMPTY; + ++
or by choosing the export tags below:
+Export tag: ':status'
+CD_TRAYEMPTY + CD_STOPPED + CD_PLAYING + CD_PAUSED + CD_ERROR + ++
Export tag: ':defaults'
+CD_FPS + SDL_MAX_TRACKS@@ -86,12 +92,12 @@
my $CD = SDL::CD->new( $drive ) +new
++my $CD = SDL::CD->new($drive)-Makes a new SDL::CD object. Returns NULL if the drive is busy or inaccessible.
+Makes a new SDL::CD object. Returns
undef
if the drive is busy or inaccessible.status
@@ -100,20 +106,14 @@
Returns the current status of the CD tray
- -Returns on of the following constants:
+Plays the given SDL::CD starting at track $start_track, for $ntracks tracks.
-$start_frame is the frame offset, from the beginning of the $start_track, at which to start. $nframes is the frame offset, from the beginning of the last track ($start_track+$ntracks), at which to end playing.
-play_tracks() should only be called after calling SDL_CDStatus to get track information about the CD use $CD->status().
+$start_frame is the frame offset, from the beginning of the $start_track, at which to start. $nframes is the frame offset, from the +beginning of the last track ($start_track+$ntracks), at which to end playing.
+play_tracks() should only be called after calling status to get information about the CD.
Note: Data tracks are ignored.
- -0, or -1 if there was an error.
+Returns 0
, or -1
if there was an error.
$CD->play($start, $length ); +$CD->play($start, $length);Plays the given SDL::CD , starting a frame $start for $length frames.
- -
0 on success, -1 on error
+Returns 0
on success, -1
on error
Pauses play on CD
- - -Returns 0 on success, or -1 on an error.
+Returns 0
on success, or -1
on an error.
$CD->resume();- - -
Returns 0 on success, or -1 on an error.
+Returns 0
on success, or -1
on an error.
Stops play on the CD.
- - -Returns 0 on success, or -1 on an error.
+Returns 0
on success, or -1
on an error.
Ejects the CD.
- - -Returns 0 on success, or -1 on an error.
+Returns 0
on success, or -1
on an error.
Retrives track description of track $number in CD. See SDL::CDTrack.
+ +my ($min, $sec, $fra) = FRAMES_TO_MSF($frames); ++
Conversion functions from frames to Minute/Second/Frames
+my $frames = MSF_TO_FRAMES($min, $sec, $fra); +