From: Leon Brocard Date: Sun, 11 Oct 2009 20:37:21 +0000 (+0100) Subject: Add left/right panning to the mixer X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ee72c5c60b346a75137b854de3461ec873f3eed5;p=sdlgit%2FSDL_perl.git Add left/right panning to the mixer --- diff --git a/CHANGELOG b/CHANGELOG index 4123d4e..2cd6d7f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,7 @@ Revision history for Perl extension SDL_perl. - Fix bug with TTFSizeText, it actually returns 0 on success [acme] - Add display_format_alpha [acme] - Add an example that plays a .WAV sound sample [acme] + - Add left/right panning to the mixer [acme] * v2.2.3.1 Sept 29 2009 Kartik Thakore - Critical Build.PL fix for META.yml diff --git a/lib/SDL/Mixer.pm b/lib/SDL/Mixer.pm index 593f47a..fdd3a54 100644 --- a/lib/SDL/Mixer.pm +++ b/lib/SDL/Mixer.pm @@ -234,6 +234,11 @@ sub playing_music () { return SDL::MixPlayingMusic(); } +sub set_panning { + my($self, $channel, $left, $right) = @_; + return SDL::MixSetPanning($channel, $left, $right); +} + 1; __END__; @@ -409,6 +414,12 @@ Return true when the channel is currently playing. Return true when the music is currently playing. +=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 David J. Goehrig, basic doc added by Tels . diff --git a/src/SDL.xs b/src/SDL.xs index 7f30468..9c26874 100644 --- a/src/SDL.xs +++ b/src/SDL.xs @@ -2201,6 +2201,15 @@ MixPlayingMusic() OUTPUT: RETVAL +int +MixSetPanning ( channel, left, right ) + int channel + int left + int right + CODE: + RETVAL = Mix_SetPanning(channel, left, right); + OUTPUT: + RETVAL void MixCloseAudio ()