X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pages%2FSDL-Mixer.html-inc;fp=pages%2FSDL-Mixer.html-inc;h=70e4cd40d34d726d7f90a55f9d52d411e19818cd;hb=162a0989f2a1d33d50c8950709319df21973e7b7;hp=0000000000000000000000000000000000000000;hpb=a5a8391295e6649e157a85f9ec380ab62567d225;p=sdlgit%2FSDL-Site.git diff --git a/pages/SDL-Mixer.html-inc b/pages/SDL-Mixer.html-inc new file mode 100644 index 0000000..70e4cd4 --- /dev/null +++ b/pages/SDL-Mixer.html-inc @@ -0,0 +1,282 @@ +
SDL::Mixer - a SDL perl extension
+ +$mixer = new SDL::Mixer -frequency => MIX_DEFAULT_FREQUENCY, + -format => MIX_DEFAULT_FORMAT, + -channels => MIX_DEFAULT_CHANNELS, + -size => 4096; + ++ +
SDL::Mixer allows you access to the SDL mixer library, enablig sound and +music volume setting, playing, pausing and resuming, as well as fading +the sound and music in and out.
+ +$mixer = SDL::Mixer->new( -frequency => MIX_DEFAULT_FREQUENCY, + -format => MIX_DEFAULT_FORMAT, + -channels => MIX_DEFAULT_CHANNELS, + -size => 4096); + ++
Creates a new SDL::Mixer object. $size
is the buffer size in bytes.
my $specs = SDL::Mixer::query_spec(); + ++
Returns a hash reference, containing the following keys and their respective +values:
+-status + -frequency + -channels + -format + ++ +
$mixer->reserve_channels(4); + ++
Reserve so many channels.
+ +$mixer->reserve_channels(2); + ++
Allocate so many channels.
+ +Group the channel number $channel
into group $group
.
Groups a range of channels
+ +Return true when the group is available.
+ +Returns the number of channels in the group
+ +Play $music
$loop
times.
Fades a channel in
+ +Fades the music in over a number of ms, looping as it does
+ +Sets the volume for a single channel
+ +Set the volume for the music.
+ +Stops a specific channel
+ +Stops a group of channels
+ +Stops the music
+ +Ignores the channel after ticks
has expired
Fade the channel number $channel
in $ms
ms out.
Fade the channel group $group
in $ms
ms out.
Fade the music in $ms
ms out.
Return true when the music is currently fading in or out.
+ +Return true when the channel number $channel
is currently fading in or out.
Pause the channel $channel
.
Resume the channel $channel
.
Return true when the channel is currently paused.
+ +Pause the music play.
+ +Resume the music play.
+ +Resets the music file to the beginning
+ +Return true when the music is currently paused.
+ +Return true when the channel is currently playing.
+ +Return true when the music is currently playing.
+ +Sets the volume for the left or right channels. To do true panning:
+ +