X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FSDL%2FMixer.pm;h=fdd3a54722c7a063cc3c423e27ad730eaea66b6e;hb=14158e5a367dee2f013905e5e2ee2bf3b33581b6;hp=94d0fb4dca38eebf1f3f792a084679a635959c89;hpb=084b921f85583af6a5b82572f6a561c94dd2fb5d;p=sdlgit%2FSDL_perl.git diff --git a/lib/SDL/Mixer.pm b/lib/SDL/Mixer.pm index 94d0fb4..fdd3a54 100644 --- a/lib/SDL/Mixer.pm +++ b/lib/SDL/Mixer.pm @@ -1,11 +1,35 @@ -# Mixer.pm +#!/usr/bin/env perl +# +# Mixer.pm +# +# Copyright (C) 2005 David J. Goehrig +# +# ------------------------------------------------------------------------------ +# +# 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; @@ -127,12 +151,6 @@ sub music_volume ($$) { 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); @@ -212,15 +230,15 @@ sub playing ($$) { return SDL::MixPlaying($channel); } -sub mix_volume_chunk($$$) { - my ($self, $chunk, $volume) = @_; - return SDL::MixVolumeChunk($chunk, $volume); -} - sub playing_music () { return SDL::MixPlayingMusic(); } +sub set_panning { + my($self, $channel, $left, $right) = @_; + return SDL::MixSetPanning($channel, $left, $right); +} + 1; __END__; @@ -396,17 +414,14 @@ Return true when the channel is currently playing. 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 set_panning($channel, $left, $right) + +Sets the volume for the left or right channels. To do true panning: + + $mixer->set_panning($channel, $left, 254 - $left); =head1 AUTHORS -Kartik Thakore David J. Goehrig, basic doc added by Tels . =head1 SEE ALSO