d9b6f66fa06028dd2a905840872cfb77af1b28e3
[sdlgit/SDL_perl.git] / lib / SDL / Music.pm
1 #       Music.pm
2 #
3 #       a SDL_mixer data module
4 #
5 #       Copyright (C) 2000,2002 David J. Goehrig
6
7 package SDL::Music;
8 use strict;
9 use warnings;
10 use Carp;
11 use SDL;
12
13 sub 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
22 sub DESTROY {
23         my $self = shift;
24         SDL::MixFreeMusic($$self);
25 }
26
27 1;
28
29 __END__;
30
31 =pod
32
33 =head1 NAME
34
35 SDL::Music - a perl extension
36
37 =head1 DESCRIPTION
38
39 L<SDL::Music> is used to load music files for use with L<SDL::Mixer>.
40 To load a music file one simply creates a new object passing the filename 
41 to the constructor:
42
43         my $music = new SDL::Music 'my_song.ogg';
44
45
46 =head1 AUTHOR
47
48 David J. Goehrig
49
50 =head1 SEE ALSO
51
52 L<perl> L<SDL::Mixer>
53
54 =cut