-# Mixer.pm
+#!/usr/bin/env perl
+#
+# Mixer.pm
+#
+# Copyright (C) 2005 David J. Goehrig <dgoehrig@cpan.org>
+#
+# ------------------------------------------------------------------------------
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# ------------------------------------------------------------------------------
+#
+# Please feel free to send questions, suggestions or improvements to:
+#
+# David J. Goehrig
+# dgoehrig@cpan.org
#
-# a SDL module for manipulating the SDL_mixer lib.
-#
-# Copyright (C) 2000,2002 David J. Goehrig
-# Copyright (C) 2009 Kartik Thakore
package SDL::Mixer;
+
use strict;
+use warnings;
+use Carp;
+
use SDL;
use SDL::Sound;
use SDL::Music;
my $size = $options{-size} || 4096;
unless ( $SDL::Mixer::initialized ) {
SDL::MixOpenAudio($frequency,$format,$channels,$size ) &&
- die SDL::GetError();
+ croak SDL::GetError();
$SDL::Mixer::initialized = 1;
} else {
++$SDL::Mixer::initialized;
return SDL::MixVolumeMusic($volume);
}
-sub mix_set_panning($$$$) {
- my ($self,$channel,$left,$right) = @_;
- return SDL::MixSetPanning($channel,$left,$right);
- }
-
-
sub halt_channel ($$) {
my ($self,$channel) = @_;
return SDL::MixHaltChannel($channel);
return SDL::MixPlaying($channel);
}
-sub mix_volume_chunk($$$) {
- my ($self, $chunk, $volume) = @_;
- return SDL::MixVolumeChunk($chunk, $volume);
-}
-
sub playing_music () {
return SDL::MixPlayingMusic();
}
Return true when the music is currently playing.
-=head2 sub mix_set_panning(channel,left,right)
-
-Set panning for mixer, Use MIX_CHANNEL_POST to process the postmix stream
-
-Volume for the left channel, range is 0(silence) to 255(loud)
-
-Volume for the right channel, range is 0(silence) to 255(loud)
-
=head1 AUTHORS
-Kartik Thakore
David J. Goehrig, basic doc added by Tels <http://bloodgate.com>.
=head1 SEE ALSO