Applied Magnet's Patch
[sdlgit/SDL_perl.git] / lib / SDL / Cdrom.pm
index 3f2dc36..3777bd6 100644 (file)
@@ -30,6 +30,8 @@
 
 package SDL::Cdrom;
 use strict;
+use warnings;
+use Carp;
 
 BEGIN {
        use Exporter();
@@ -44,7 +46,7 @@ sub new {
        my $self;
        my $number = shift;
        $self = \SDL::CDOpen($number);
-       die SDL::GetError() if ( SDL::CD_ERROR() eq SDL::CDStatus($$self));
+       croak SDL::GetError() if ( SDL::CD_ERROR() eq SDL::CDStatus($$self));
        bless $self,$class;
        return $self;
 }
@@ -54,7 +56,7 @@ sub DESTROY {
        SDL::CDClose($$self);
 }
 
-sub CD_NUM_DRIVES {
+sub cd_num_drives {
        return SDL::CDNumDrives();
 }
 
@@ -130,102 +132,3 @@ sub current_frame {
 }
 
 1;
-
-__END__;
-
-=pod
-
-
-
-=head1 NAME
-
-SDL::Cdrom - a SDL perl extension for managing CD-ROM drives
-
-=head1 SYNOPSIS
-
-       use SDL::Cdrom;
-       $cdrom = SDL::Cdrom->new(0);
-       $cdrom->play();
-
-=head1 EXPORTS
-
-=over 4
-
-=item *
-
-C<CD_NUM_DRIVES>.
-
-=back
-
-=head1 DESCRIPTION
-
-Create a new SDL::Cdrom object. The passed $id is the number of the drive,
-whereas 0 is the first drive etc.
-       
-       use SDL::Cdrom;
-       my $drive => SDL::Cdrom->new($id);
-
-=head1 METHODS
-
-=head2 CD_NUM_DRIVES()
-
-Returns the number of CD-ROM drives present.
-
-=head2 name()
-
-Returns the system dependent name of the CD-ROM device.
-
-=head2 status()
-
-Return the status of the drive.
-
-=head2 play()
-
-Play a track.
-
-=head2 pause()
-
-Pause the playing.
-
-=head2 resume()
-
-Resume the playing.
-
-=head2 stop()
-
-Stop the playing.
-
-=head2 eject()
-
-Eject the medium in the drive.
-
-=head2 id()
-
-Return the ID of the drive.
-
-=head2 num_tracks()
-
-Return the number of tracks on the medium.
-
-=head2 track()
-
-Returns the track description
-
-=head2 current()
-
-Return the current played track number.
-
-=head2 current_frame()
-
-Return the current frame.
-
-=head1 AUTHORS
-
-David J. Goehrig
-Documentation by Tels <http://bloodgate.com/>.
-
-=head1 SEE ALSO
-
-L<perl> L<SDL::Mixer> L<SDL::App>.
-
-=cut