From: Tobias Leich Date: Wed, 24 Feb 2010 22:14:37 +0000 (+0100) Subject: docs for SDL::Mixer::Channels X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=05971ac01a9556f7e769cda59ef5b419a60a0aa7;p=sdlgit%2FSDL-Site.git docs for SDL::Mixer::Channels --- diff --git a/pages/SDL-Mixer-Channels.html-inc b/pages/SDL-Mixer-Channels.html-inc index e6c9701..f254f2d 100644 --- a/pages/SDL-Mixer-Channels.html-inc +++ b/pages/SDL-Mixer-Channels.html-inc @@ -48,66 +48,168 @@

allocate_channels

+
 my $ret = SDL::Mixer::Channels::allocate_channels( $number_of_channels );
+
+
+

Dynamically change the number of channels managed by the mixer. If decreasing the number of channels, the upper channels arestopped. +This function returns the new number of allocated channels.

+

Example

+
 use SDL::Mixer::Channels;
+
+ printf("We got %d channels!\n", SDL::Mixer::Channels::allocate_channels( 8 ) );
+
+

volume

+
 my $prev_volume = SDL::Mixer::Channels::volume( $channel_number, $volume );
+
+
+

volume changes the volume of the channel specified in channel by the amount set in volume. The range of volume is from 0 to MIX_MAX_VOLUME +which is 128. Passing -1 to channel will change the volume of all channels. If the specified volume is -1, it will just return the +current volume.

+

Returns the previously set volume of the channel.

play_channel

+
 my $channel_number = SDL::Mixer::Channels::play_channel( $channel, $chunk, $loops );
+
+
+

play_channel will play the specified chunk over the specified channel. SDL_mixer will choose a channel for you if you pass -1 for +channel.

+

The chunk will be looped loops times, the total number of times played will be loops+1. Passing -1 will loop the chunk infinitely.

+

Returns the channel the chunk will be played on, or -1 on error.

+

Example:

+
 use SDL::Mixer;
+ use SDL::Mixer::Channels;
+ use SDL::Mixer::Samples;
+
+ SDL::init(SDL_INIT_AUDIO);
+ SDL::Mixer::open_audio( 44100, SDL::Constants::AUDIO_S16, 2, 4096 );
+
+ my $chunk = SDL::Mixer::Samples::load_WAV('sample.wav');
+
+ SDL::Mixer::Channels::play_channel( -1, $chunk, -1 );
+
+ SDL::delay(1000);
+ SDL::Mixer::close_audio();
+
+

play_channel_timed

+
 my $channel = SDL::Mixer::Channels::play_channel_timed( $channel, $chunk, $loops, $ticks );
+
+
+

Same as play_channel but you can specify the time it will play by $ticks.

fade_in_channel

+
 my $channel = SDL::Mixer::Channels::fade_in_channel( $channel, $chunk, $loops, $ms );
+
+
+

Same as play_channel but you can specify the fade-in time by $ms.

fade_in_channel_timed

+
 my $channel = SDL::Mixer::Channels::fade_in_channel_timed( $channel, $chunk, $loops, $ms, $ticks );
+
+
+

Same as fade_in_channel but you can specify the time how long the chunk will be played by $ticks.

pause

+
 SDL::Mixer::Channels::pause( $channel );
+
+
+

Pauses the given channel or all by passing -1.

resume

+
 SDL::Mixer::Channels::resume( $channel );
+
+
+

Resumes the given channel or all by passing -1.

halt_channel

+
 SDL::Mixer::Channels::halt_channel( $channel );
+
+
+

Stops the given channel or all by passing -1.

expire_channel

+
 my $channels = SDL::Mixer::Channels::expire_channel( $channel, $ticks );
+
+
+

Stops the given channel (or -1 for all) after the time specified by $ticks (in milliseconds).

+

Returns the number of affected channels.

fade_out_channel

+
 my $fading_channels = SDL::Mixer::Channels::fade_out_channel( $which, $ms );
+
+
+

fade_out_channel fades out a channel specified in which with a duration specified in ms in milliseconds.

+

Returns the the number of channels that will be faded out.

channel_finished

+

TODO

playing

+
 my $playing = SDL::Mixer::Channels::playing( $channel );
+
+
+

Returns 1 if the given channel is playing sound, otherwise 0. It does'nt check if the channel is paused.

+

Note: If you pass -1 you will get the number of playing channels.

paused

+
 my $paused = SDL::Mixer::Channels::paused( $channel );
+
+
+

Returns 1 if the given channel is paused, otherwise 0.

+

Note: If you pass -1 you will get the number of paused channels.

fading_channel

+
 my $fading_channel = SDL::Mixer::Channels::fading_channel( $channel );
+
+
+

Returns one of the following for the given channel:

+ + +

Note: Never pass -1 to this function!

get_chunk

+
 my $chunk = SDL::Mixer::Channels::get_chunk( $channel );
+
+
+

get_chunk gets the most recent sample chunk played on channel. This chunk may be currently playing, or just the last used.

+

Note: Never pass -1 to this function!

\ No newline at end of file diff --git a/pages/SDL-Mixer-Samples.html-inc b/pages/SDL-Mixer-Samples.html-inc new file mode 100644 index 0000000..b1950ec --- /dev/null +++ b/pages/SDL-Mixer-Samples.html-inc @@ -0,0 +1,135 @@ +
+ +

Index

+ +
+ + +

NAME

Top

+
+

SDL::Mixer::Samples - functions for loading sound samples

+ +
+

CATEGORY

Top

+
+

Mixer

+ +
+

DESCRIPTION

Top

+
+ +
+

METHODS

Top

+
+ +
+

int +mixsam_get_num_chunk_decoders () + CODE: + RETVAL = Mix_GetNumChunkDecoders(); + OUTPUT: + RETVAL

+
+

char* +mixsam_get_chunk_decoder (idecoder) + int idecoder + CODE: + RETVAL = (char *)Mix_GetChunkDecoder(idecoder); + OUTPUT: + RETVAL

+

#endif

+ + + + +

Mix_Chunk * +mixsam_load_WAV ( filename ) + char *filename + PREINIT: + char * CLASS = "SDL::Mixer::MixChunk"; + CODE: + Mix_Chunk * mixchunk; + mixchunk = Mix_LoadWAV(filename); + RETVAL = mixchunk; + OUTPUT: + RETVAL

+ + + + +

Mix_Chunk * +mixsam_load_WAV_RW ( src, freesrc) + SDL_RWops * src + int freesrc + PREINIT: + char * CLASS = "SDL::Mixer::MixChunk"; + CODE: + Mix_Chunk * mixchunk; + mixchunk = Mix_LoadWAV_RW(src, freesrc); + RETVAL = mixchunk; + OUTPUT: + RETVAL

+ + + + +

Mix_Chunk * +mixsam_quick_load_WAV ( buf ) + Uint8 *buf + PREINIT: + char * CLASS = "SDL::Mixer::MixChunk"; + CODE: + RETVAL = Mix_QuickLoad_WAV(buf); + OUTPUT: + RETVAL

+ + + + +

Mix_Chunk * +mixsam_quick_load_RAW ( buf , len) + Uint8 *buf + int len + PREINIT: + char * CLASS = "SDL::Mixer::MixChunk"; + CODE: + RETVAL = Mix_QuickLoad_RAW( buf, len ); + OUTPUT: + RETVAL

+ + + + +

int +mixsam_volume_chunk ( chunk, volume ) + Mix_Chunk *chunk + int volume + CODE: + RETVAL = Mix_VolumeChunk(chunk,volume); + OUTPUT: + RETVAL

+ + + + +

void +mixsam_free_chunk( chunk ) + Mix_Chunk *chunk + CODE: + Mix_FreeChunk(chunk);

+ +
+
\ No newline at end of file diff --git a/pages/documentation.html-inc b/pages/documentation.html-inc index f6a72ef..dfc854d 100644 --- a/pages/documentation.html-inc +++ b/pages/documentation.html-inc @@ -1,2 +1,2 @@
-

Documentation (latest development branch)

Core
thumbSDL- Simple DirectMedia Layer for Perl
thumbSDL::Time- a SDL perl extension for managing timers.
Audio
thumbSDL::Audio- SDL Bindings for Audio
Structure
thumbSDL::AudioCVT- Audio Conversion Structure
thumbSDL::AudioSpec- SDL Bindings for structure SDL::AudioSpec
CDROM
thumbSDL::CDROM- SDL Bindings for the CDROM device
Structure
thumbSDL::CD- SDL Bindings for structure SDL_CD
thumbSDL::CDTrack- SDL Bindings for structure SDL_CDTrack
Events
thumbSDL::Events- Bindings to the Events Category in SDL API
Structure
thumbSDL::Event- General event structure
Joystick
thumbSDL::Joystick- SDL Bindings for the Joystick device
Mouse
thumbSDL::Mouse- SDL Bindings for the Mouse device
Structure
thumbSDL::Cursor- Mouse cursor structure
Structure
thumbSDL::Version- SDL Bindings for structure SDL_Version
Video
thumbSDL::Video- Bindings to the video category in SDL API
Structure
thumbSDL::Color- Format independent color description
thumbSDL::Overlay- YUV Video overlay
thumbSDL::Palette- Color palette for 8-bit pixel formats
thumbSDL::PixelFormat- Stores surface format information
thumbSDL::Rect- Defines a rectangular area
thumbSDL::Surface- Graphic surface structure.
thumbSDL::VideoInfo- Video Target Information

Cookbook
thumbSDL::Cookbook
thumbSDL::Cookbook::PDL

Extension
thumbSDL::App- a SDL perl extension

GFX
thumbSDL::GFX::Framerate- framerate calculating functions
thumbSDL::GFX::Primitives- basic drawing functions
Structure
thumbSDL::GFX::FPSManager- data structure used by SDL::GFX::Framerate

Image
thumbSDL::Image- Bindings for the SDL_Image library

Mixer
thumbSDL::Mixer- Sound and music functions
thumbSDL::Mixer::Channels- SDL::Mixer channel functions and bindings
thumbSDL::Mixer::Effects- SDL_Mixer sound effect functions and bindings
thumbSDL::Mixer::Groups- SDL_Mixer groups functions and bindings
thumbSDL::Mixer::Music- SDL_Mixer music functions and bindings
Structure
thumbSDL::Mixer::MixChunk- SDL Bindings for structure SDL_MixChunk
thumbSDL::Mixer::MixMusic- SDL Bindings for structure SDL_MixMusic
TODO
Core
MultiThread
thumbSDL::MultiThread- Bindings to the MultiThread category in SDL API
Structure
thumbSDL::RWOps- SDL Bindings to SDL_RWOPs
GFX
thumbSDL::GFX::BlitFunc- blitting functions
thumbSDL::GFX::ImageFilter- image filtering functions
thumbSDL::GFX::Rotozoom- rotation and zooming functions for surfaces

Tutorials
thumbSDL::Tutorial- introduction to Perl SDL
thumbSDL::Tutorial::Animation
thumbSDL::Tutorial::Images
thumbSDL::Tutorial::LunarLander- a small tutorial on Perl SDL
thumbSDL::Tutorial::Pong- Get started pong
thumbSDL::Tutorial::Tetris- Let's Make Tetris

UNCATEGORIZED
thumbSDL::Font- a SDL perl extension
thumbSDL::Game::Palette- a perl extension
thumbSDL::MPEG- a SDL perl extension
thumbSDL::Music- a perl extension
thumbSDL::OpenGL- a perl extension
thumbSDL::SFont- a perl extension
thumbSDL::SMPEG- a SDL perl extension
thumbSDL::Sound- a perl extension
thumbSDL::TTFont- a SDL perl extension
thumbSDL::Tool::Font- a perl extension
thumbSDL::Tool::Graphic
+

Documentation (latest development branch)

Core
thumbSDL- Simple DirectMedia Layer for Perl
thumbSDL::Time- a SDL perl extension for managing timers.
Audio
thumbSDL::Audio- SDL Bindings for Audio
Structure
thumbSDL::AudioCVT- Audio Conversion Structure
thumbSDL::AudioSpec- SDL Bindings for structure SDL::AudioSpec
CDROM
thumbSDL::CDROM- SDL Bindings for the CDROM device
Structure
thumbSDL::CD- SDL Bindings for structure SDL_CD
thumbSDL::CDTrack- SDL Bindings for structure SDL_CDTrack
Events
thumbSDL::Events- Bindings to the Events Category in SDL API
Structure
thumbSDL::Event- General event structure
Joystick
thumbSDL::Joystick- SDL Bindings for the Joystick device
Mouse
thumbSDL::Mouse- SDL Bindings for the Mouse device
Structure
thumbSDL::Cursor- Mouse cursor structure
Structure
thumbSDL::Version- SDL Bindings for structure SDL_Version
Video
thumbSDL::Video- Bindings to the video category in SDL API
Structure
thumbSDL::Color- Format independent color description
thumbSDL::Overlay- YUV Video overlay
thumbSDL::Palette- Color palette for 8-bit pixel formats
thumbSDL::PixelFormat- Stores surface format information
thumbSDL::Rect- Defines a rectangular area
thumbSDL::Surface- Graphic surface structure.
thumbSDL::VideoInfo- Video Target Information

Cookbook
thumbSDL::Cookbook
thumbSDL::Cookbook::PDL

Extension
thumbSDL::App- a SDL perl extension

GFX
thumbSDL::GFX::Framerate- framerate calculating functions
thumbSDL::GFX::Primitives- basic drawing functions
Structure
thumbSDL::GFX::FPSManager- data structure used by SDL::GFX::Framerate

Image
thumbSDL::Image- Bindings for the SDL_Image library

Mixer
thumbSDL::Mixer- Sound and music functions
thumbSDL::Mixer::Channels- SDL::Mixer channel functions and bindings
thumbSDL::Mixer::Effects- SDL_Mixer sound effect functions and bindings
thumbSDL::Mixer::Groups- SDL_Mixer groups functions and bindings
thumbSDL::Mixer::Music- SDL_Mixer music functions and bindings
thumbSDL::Mixer::Samples- functions for loading sound samples
Structure
thumbSDL::Mixer::MixChunk- SDL Bindings for structure SDL_MixChunk
thumbSDL::Mixer::MixMusic- SDL Bindings for structure SDL_MixMusic
TODO
Core
MultiThread
thumbSDL::MultiThread- Bindings to the MultiThread category in SDL API
Structure
thumbSDL::RWOps- SDL Bindings to SDL_RWOPs
GFX
thumbSDL::GFX::BlitFunc- blitting functions
thumbSDL::GFX::ImageFilter- image filtering functions
thumbSDL::GFX::Rotozoom- rotation and zooming functions for surfaces

Tutorials
thumbSDL::Tutorial- introduction to Perl SDL
thumbSDL::Tutorial::Animation
thumbSDL::Tutorial::Images
thumbSDL::Tutorial::LunarLander- a small tutorial on Perl SDL
thumbSDL::Tutorial::Pong- Get started pong
thumbSDL::Tutorial::Tetris- Let's Make Tetris

UNCATEGORIZED
thumbSDL::Font- a SDL perl extension
thumbSDL::Game::Palette- a perl extension
thumbSDL::MPEG- a SDL perl extension
thumbSDL::Music- a perl extension
thumbSDL::OpenGL- a perl extension
thumbSDL::SFont- a perl extension
thumbSDL::SMPEG- a SDL perl extension
thumbSDL::Sound- a perl extension
thumbSDL::TTFont- a SDL perl extension
thumbSDL::Tool::Font- a perl extension
thumbSDL::Tool::Graphic