Brought all packages under eye of strict, warnings and love of Carp, For
[sdlgit/SDL_perl.git] / lib / SDL / Music.pm
CommitLineData
8fde61e3 1# Music.pm
2#
3# a SDL_mixer data module
4#
5# Copyright (C) 2000,2002 David J. Goehrig
6
7package SDL::Music;
8use strict;
084b921f 9use warnings;
10use Carp;
8fde61e3 11use SDL;
12
13sub new {
14 my $proto = shift;
15 my $class = ref($proto) || $proto;
16 my $filename = shift;
17 my $self = \SDL::MixLoadMusic($filename);
18 bless $self,$class;
19 return $self;
20}
21
22sub DESTROY {
23 my $self = shift;
24 SDL::MixFreeMusic($$self);
25}
26
271;
28
29__END__;
30
31=pod
32
33=head1 NAME
34
35SDL::Music - a perl extension
36
37=head1 DESCRIPTION
38
39L<SDL::Music> is used to load music files for use with L<SDL::Mixer>.
40To load a music file one simply creates a new object passing the filename
41to the constructor:
42
43 my $music = new SDL::Music 'my_song.ogg';
44
45
46=head1 AUTHOR
47
48David J. Goehrig
49
50=head1 SEE ALSO
51
52L<perl> L<SDL::Mixer>
53
54=cut