X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pages%2FSDL-CDTrack.html-inc;h=e33fcb79deffa0ea4ca61cd546db4c6e8125e439;hb=ca0a3441dd72000cbbbb4be484b18d0d305fdb29;hp=28a7b13809761e19d16e9726bf534fc812e9d926;hpb=b82df1356a6be5ab828d198947fe0e5b76efd735;p=sdlgit%2FSDL-Site.git diff --git a/pages/SDL-CDTrack.html-inc b/pages/SDL-CDTrack.html-inc index 28a7b13..e33fcb7 100644 --- a/pages/SDL-CDTrack.html-inc +++ b/pages/SDL-CDTrack.html-inc @@ -3,7 +3,17 @@
TODO, Core, CDROM, Structure
+Core, CDROM, Structure
+ +use SDL; + use SDL::CDROM; + use SDL::CD ':status'; + use SDL::CDTrack; + + SDL::init( SDL_INIT_CDROM ); + + my $drives = SDL::CDROM::num_drives(); + + if( $drives > 0 ) + { + my $CD = SDL::CD->new(0); #first drive's CD + + if($CD) + { + if( $CD->status != CD_TRAYEMPTY ) + { + my $track = SDL::CD->track(0); + } + } + } + ++ +
The constants are exported by default. You can avoid this by doing:
+use SDL::CDTrack (); + ++
and access them directly:
+SDL::CDTrack::SDL_AUDIO_TRACK; + ++
or by choosing the export tags below:
+Export tag: ':type'
+SDL_AUDIO_TRACK + SDL_DATA_TRACK + ++ +
$track->id() # 0-99 + ++
Track number
+ +$track->type() # SDL_AUDIO_TRACK or SDL_DATA_TRACK + ++
Type of track
+ +$track->length() + ++
Length, in frames, of this track
+ +$track->offset() + ++
Frame offset to the beginning of this track
+ +