Skip to content
Browse files

Add left/right panning to the mixer

  • Loading branch information...
1 parent 9f6a22d commit ee72c5c60b346a75137b854de3461ec873f3eed5 @acme acme committed Oct 11, 2009
Showing with 21 additions and 0 deletions.
  1. +1 −0 CHANGELOG
  2. +11 −0 lib/SDL/Mixer.pm
  3. +9 −0 src/SDL.xs
View
1 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 <thakore.kartik@gmail.com>
- Critical Build.PL fix for META.yml
View
11 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 <http://bloodgate.com>.
View
9 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 ()

0 comments on commit ee72c5c

Please sign in to comment.
Something went wrong with that request. Please try again.