3 # a SDL cdrom manipluation module
5 # Copyright (C) 2000,2002 David J. Goehrig
13 use vars qw(@ISA @EXPORT);
15 @EXPORT = qw/ &CD_NUM_DRIVES /;
20 my $class = ref($proto) || $proto;
23 $self = \SDL::CDOpen($number);
24 die SDL::GetError() if ( SDL::CD_ERROR() eq SDL::CDStatus($$self));
35 return SDL::CDNumDrives();
40 return SDL::CDName($$self);
45 return SDL::CDstatus($$self);
49 my ($self,$start,$length,$fs,$fl) = @_;
50 return SDL::CDPlayTracks($$self,$start,$length,$fs,$fl);
55 return SDL::CDPause($$self);
60 return SDL::CDResume($$self);
65 return SDL::CDStop($$self);
70 return SDL::CDEject($$self);
75 return SDL::CDId($$self);
80 return SDL::CDNumTracks($$self);
83 my $buildtrack = sub {
86 $track{-id} = SDL::CDTrackId($ptr);
87 $track{-type} = SDL::CDTrackType($ptr);
88 $track{-length} = SDL::CDTrackLength($ptr);
89 $track{-offset} = SDL::CDTrackOffset($ptr);
96 return &$buildtrack(SDL::CDTrack($$self,$number));
101 return $self->track(SDL::CDCurTrack($$self));
106 return SDL::CDCurFrame($$self);
119 SDL::Cdrom - a SDL perl extension for managing CD-ROM drives
124 $cdrom = SDL::Cdrom->new(0);
139 Create a new SDL::Cdrom object. The passed $id is the number of the drive,
140 whereas 0 is the first drive etc.
143 my $drive => SDL::Cdrom->new($id);
147 =head2 CD_NUM_DRIVES()
149 Returns the number of CD-ROM drives present.
153 Returns the system dependent name of the CD-ROM device.
157 Return the status of the drive.
177 Eject the medium in the drive.
181 Return the ID of the drive.
185 Return the number of tracks on the medium.
189 Returns the track description
193 Return the current played track number.
195 =head2 current_frame()
197 Return the current frame.
202 Documentation by Tels <http://bloodgate.com/>.
206 L<perl> L<SDL::Mixer> L<SDL::App>.