From: Kartik Thakore Date: Mon, 3 Aug 2009 13:02:38 +0000 (-0400) Subject: Added SDL::Mixer::mix_set_panning support X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ae1cb2f6c6127b1869aff7e47a6f2e7180a5375f;p=sdlgit%2FSDL_perl.git Added SDL::Mixer::mix_set_panning support --- diff --git a/lib/SDL/Constants.pm b/lib/SDL/Constants.pm index 1201720..2ddc6dc 100644 --- a/lib/SDL/Constants.pm +++ b/lib/SDL/Constants.pm @@ -60,6 +60,7 @@ use vars qw( MIX_FADING_OUT MIX_MAX_VOLUME MIX_NO_FADING + MIX_CHANNEL_POST SDLK_0 SDLK_1 SDLK_2 @@ -329,6 +330,7 @@ sub MIX_FADING_IN {2} sub MIX_FADING_OUT {1} sub MIX_MAX_VOLUME {128} sub MIX_NO_FADING {0} +sub MIX_CHANNEL_POST {-2} sub SDLK_0 {48} sub SDLK_1 {49} sub SDLK_2 {50} diff --git a/lib/SDL/Mixer.pm b/lib/SDL/Mixer.pm index a578126..ff9a29e 100644 --- a/lib/SDL/Mixer.pm +++ b/lib/SDL/Mixer.pm @@ -124,6 +124,11 @@ 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) = @_; @@ -388,8 +393,17 @@ 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 AUTHORS +Kartik Thakore David J. Goehrig, basic doc added by Tels . =head1 SEE ALSO diff --git a/src/SDL.xs b/src/SDL.xs index f04ad58..cff7e36 100644 --- a/src/SDL.xs +++ b/src/SDL.xs @@ -1938,6 +1938,17 @@ MixPlayChannel ( channel, chunk, loops ) RETVAL int +MixSetPanning ( channel, left, right ) + int channel + Uint8 left + Uint8 right + CODE: + RETVAL = Mix_SetPanning(channel,left, right); + OUTPUT: + RETVAL + + +int MixPlayChannelTimed ( channel, chunk, loops, ticks ) int channel Mix_Chunk *chunk diff --git a/t/mixerpm.t b/t/mixerpm.t index fca1fc3..39146da 100644 --- a/t/mixerpm.t +++ b/t/mixerpm.t @@ -59,6 +59,7 @@ can_ok ('SDL::Mixer', qw/ playing playing_music mix_volume_chunk + mix_set_panning /); # these are exported by default, so main:: should know them: