3 # a SDL cdrom manipluation module
5 # Copyright (C) 2000,2002 David J. Goehrig
15 use vars qw(@ISA @EXPORT);
17 @EXPORT = qw/ &CD_NUM_DRIVES /;
22 my $class = ref($proto) || $proto;
25 $self = \SDL::CDOpen($number);
26 croak SDL::GetError() if ( SDL::CD_ERROR() eq SDL::CDStatus($$self));
37 return SDL::CDNumDrives();
42 return SDL::CDName($$self);
47 return SDL::CDstatus($$self);
51 my ($self,$start,$length,$fs,$fl) = @_;
52 return SDL::CDPlayTracks($$self,$start,$length,$fs,$fl);
57 return SDL::CDPause($$self);
62 return SDL::CDResume($$self);
67 return SDL::CDStop($$self);
72 return SDL::CDEject($$self);
77 return SDL::CDId($$self);
82 return SDL::CDNumTracks($$self);
85 my $buildtrack = sub {
88 $track{-id} = SDL::CDTrackId($ptr);
89 $track{-type} = SDL::CDTrackType($ptr);
90 $track{-length} = SDL::CDTrackLength($ptr);
91 $track{-offset} = SDL::CDTrackOffset($ptr);
98 return &$buildtrack(SDL::CDTrack($$self,$number));
103 return $self->track(SDL::CDCurTrack($$self));
108 return SDL::CDCurFrame($$self);
121 SDL::Cdrom - a SDL perl extension for managing CD-ROM drives
126 $cdrom = SDL::Cdrom->new(0);
141 Create a new SDL::Cdrom object. The passed $id is the number of the drive,
142 whereas 0 is the first drive etc.
145 my $drive => SDL::Cdrom->new($id);
149 =head2 CD_NUM_DRIVES()
151 Returns the number of CD-ROM drives present.
155 Returns the system dependent name of the CD-ROM device.
159 Return the status of the drive.
179 Eject the medium in the drive.
183 Return the ID of the drive.
187 Return the number of tracks on the medium.
191 Returns the track description
195 Return the current played track number.
197 =head2 current_frame()
199 Return the current frame.
204 Documentation by Tels <http://bloodgate.com/>.
208 L<perl> L<SDL::Mixer> L<SDL::App>.