From: Tobias Leich
TODO
+SDL::Mixer::Channels::channel_finished( $callback ); + ++
Add your own callback when a channel has finished playing. NULL
to disable callback. The callback may be called from the mixer's audio
+callback or it could be called as a result of halt_channel, etc. do not call lock_audio
from this callback; you will either be inside
+the audio callback, or SDL_mixer will explicitly lock the audio before calling your callback.
Example 1:
+my $callback = sub{ printf("[channel_finished] callback called for channel %d\n", shift); }; + + SDL::Mixer::Channels::channel_finished( $callback ); + ++
Example 2:
+sub callback + { + ... + } + + SDL::Mixer::Channels::channel_finished( \&callback ); + +
my $music = SDL::Mixer::Music::load_MUS( $file ); + ++
load_MUS
loads a music file into a SDL::Music::MixMusic
structure. This can be passed to play_music.
my $play_music = SDL::Mixer::Music::play_music( $mix_music, $repeats ); + ++
play_music
plays a given SDL::Mixer::MixMusic
.
+Passing -1 to $repeats
will loop the music infinitely.
Example:
+my $music = SDL::Mixer::Music::load_MUS( 'music.mp3' ); + + unless(SDL::Mixer::Music::play_music($sample_music, -1)) + { + print("Something went wrong!\n"); + } + + + + +
SDL::Mixer::Music::halt_music(); + ++
Halts the music.
my $fading_music = SDL::Mixer::Channels::fading_music(); + ++
Returns one of the following:
+SDL::Mixer::Music::pause_music(); + ++
Pauses the music.
+ + + SDL::Mixer::Music::resume_music(); + ++
Resumes the music.
+ + + SDL::Mixer::Music::rewind_music(); + ++
Rewinds the music.
my $paused = SDL::Mixer::Music::paused_music(); + ++
Returns 1
if the music is paused, otherwise 0
.
my $playing_music = SDL::Mixer::Music::playing_music(); + ++
Returns 1
if the music is playing sound, otherwise 0
. It does'nt check if the music is paused.
Core | ||
![]() | SDL | - Simple DirectMedia Layer for Perl |
![]() | SDL::Time | - a SDL perl extension for managing timers. |
Audio | ||
![]() | SDL::Audio | - SDL Bindings for Audio |
Structure | ||
![]() | SDL::AudioCVT | - Audio Conversion Structure |
![]() | SDL::AudioSpec | - SDL Bindings for structure SDL::AudioSpec |
CDROM | ||
![]() | SDL::CDROM | - SDL Bindings for the CDROM device |
Structure | ||
![]() | SDL::CD | - SDL Bindings for structure SDL_CD |
![]() | SDL::CDTrack | - SDL Bindings for structure SDL_CDTrack |
Events | ||
![]() | SDL::Events | - Bindings to the Events Category in SDL API |
Structure | ||
![]() | SDL::Event | - General event structure |
Joystick | ||
![]() | SDL::Joystick | - SDL Bindings for the Joystick device |
Mouse | ||
![]() | SDL::Mouse | - SDL Bindings for the Mouse device |
Structure | ||
![]() | SDL::Cursor | - Mouse cursor structure |
Structure | ||
![]() | SDL::Version | - SDL Bindings for structure SDL_Version |
Video | ||
![]() | SDL::Video | - Bindings to the video category in SDL API |
Structure | ||
![]() | SDL::Color | - Format independent color description |
![]() | SDL::Overlay | - YUV Video overlay |
![]() | SDL::Palette | - Color palette for 8-bit pixel formats |
![]() | SDL::PixelFormat | - Stores surface format information |
![]() | SDL::Rect | - Defines a rectangular area |
![]() | SDL::Surface | - Graphic surface structure. |
![]() | SDL::VideoInfo | - Video Target Information |
Cookbook | ||
![]() | SDL::Cookbook | |
![]() | SDL::Cookbook::PDL |
Extension | ||
![]() | SDL::App | - a SDL perl extension |
GFX | ||
![]() | SDL::GFX::Framerate | - framerate calculating functions |
![]() | SDL::GFX::Primitives | - basic drawing functions |
Structure | ||
![]() | SDL::GFX::FPSManager | - data structure used by SDL::GFX::Framerate |
Image | ||
![]() | SDL::Image | - Bindings for the SDL_Image library |
Mixer | ||
![]() | SDL::Mixer | - Sound and music functions |
![]() | SDL::Mixer::Channels | - SDL::Mixer channel functions and bindings |
![]() | SDL::Mixer::Effects | - SDL_Mixer sound effect functions and bindings |
![]() | SDL::Mixer::Groups | - SDL_Mixer groups functions and bindings |
![]() | SDL::Mixer::Music | - SDL_Mixer music functions and bindings |
![]() | SDL::Mixer::Samples | - functions for loading sound samples |
Structure | ||
![]() | SDL::Mixer::MixChunk | - SDL Bindings for structure SDL_MixChunk |
![]() | SDL::Mixer::MixMusic | - SDL Bindings for structure SDL_MixMusic |
TODO |
Core |
MultiThread | ||
![]() | SDL::MultiThread | - Bindings to the MultiThread category in SDL API |
Structure | ||
![]() | SDL::RWOps | - SDL Bindings to SDL_RWOPs |
GFX | ||
![]() | SDL::GFX::BlitFunc | - blitting functions |
![]() | SDL::GFX::ImageFilter | - image filtering functions |
![]() | SDL::GFX::Rotozoom | - rotation and zooming functions for surfaces |
Tutorials | ||
![]() | SDL::Tutorial | - introduction to Perl SDL |
![]() | SDL::Tutorial::Animation | |
![]() | SDL::Tutorial::Images | |
![]() | SDL::Tutorial::LunarLander | - a small tutorial on Perl SDL |
![]() | SDL::Tutorial::Pong | - Get started pong |
![]() | SDL::Tutorial::Tetris | - Let's Make Tetris |
UNCATEGORIZED | ||
![]() | SDL::Font | - a SDL perl extension |
![]() | SDL::Game::Palette | - a perl extension |
![]() | SDL::MPEG | - a SDL perl extension |
![]() | SDL::Music | - a perl extension |
![]() | SDL::OpenGL | - a perl extension |
![]() | SDL::SFont | - a perl extension |
![]() | SDL::SMPEG | - a SDL perl extension |
![]() | SDL::Sound | - a perl extension |
![]() | SDL::TTFont | - a SDL perl extension |
![]() | SDL::Tool::Font | - a perl extension |
![]() | SDL::Tool::Graphic |
Core | ||
![]() | SDL | - Simple DirectMedia Layer for Perl |
![]() | SDL::Time | - a SDL perl extension for managing timers. |
Audio | ||
![]() | SDL::Audio | - SDL Bindings for Audio |
Structure | ||
![]() | SDL::AudioCVT | - Audio Conversion Structure |
![]() | SDL::AudioSpec | - SDL Bindings for structure SDL::AudioSpec |
CDROM | ||
![]() | SDL::CDROM | - SDL Bindings for the CDROM device |
Structure | ||
![]() | SDL::CD | - SDL Bindings for structure SDL_CD |
![]() | SDL::CDTrack | - SDL Bindings for structure SDL_CDTrack |
Events | ||
![]() | SDL::Events | - Bindings to the Events Category in SDL API |
Structure | ||
![]() | SDL::Event | - General event structure |
Joystick | ||
![]() | SDL::Joystick | - SDL Bindings for the Joystick device |
Mouse | ||
![]() | SDL::Mouse | - SDL Bindings for the Mouse device |
Structure | ||
![]() | SDL::Cursor | - Mouse cursor structure |
Structure | ||
![]() | SDL::Version | - SDL Bindings for structure SDL_Version |
Video | ||
![]() | SDL::Video | - Bindings to the video category in SDL API |
Structure | ||
![]() | SDL::Color | - Format independent color description |
![]() | SDL::Overlay | - YUV Video overlay |
![]() | SDL::Palette | - Color palette for 8-bit pixel formats |
![]() | SDL::PixelFormat | - Stores surface format information |
![]() | SDL::Rect | - Defines a rectangular area |
![]() | SDL::Surface | - Graphic surface structure. |
![]() | SDL::VideoInfo | - Video Target Information |
Cookbook | ||
![]() | SDL::Cookbook | |
![]() | SDL::Cookbook::PDL |
Extension | ||
![]() | SDL::App | - a SDL perl extension |
GFX | ||
![]() | SDL::GFX::Framerate | - framerate calculating functions |
![]() | SDL::GFX::Primitives | - basic drawing functions |
Structure | ||
![]() | SDL::GFX::FPSManager | - data structure used by SDL::GFX::Framerate |
Image | ||
![]() | SDL::Image | - Bindings for the SDL_Image library |
Mixer | ||
![]() | SDL::Mixer | - Sound and music functions |
![]() | SDL::Mixer::Channels | - SDL::Mixer channel functions and bindings |
![]() | SDL::Mixer::Effects | - SDL_Mixer sound effect functions and bindings |
![]() | SDL::Mixer::Groups | - SDL_Mixer groups functions and bindings |
![]() | SDL::Mixer::Music | - SDL_Mixer music functions and bindings |
![]() | SDL::Mixer::Samples | - functions for loading sound samples |
Structure | ||
![]() | SDL::Mixer::MixChunk | - SDL Bindings for structure SDL_MixChunk |
![]() | SDL::Mixer::MixMusic | - SDL Bindings for structure SDL_MixMusic |
TODO |
Core |
MultiThread | ||
![]() | SDL::MultiThread | - Bindings to the MultiThread category in SDL API |
Structure | ||
![]() | SDL::RWOps | - SDL Bindings to SDL_RWOPs |
GFX | ||
![]() | SDL::GFX::BlitFunc | - blitting functions |
![]() | SDL::GFX::ImageFilter | - image filtering functions |
![]() | SDL::GFX::Rotozoom | - rotation and zooming functions for surfaces |
Tutorials | ||
![]() | SDL::Tutorial | - introduction to Perl SDL |
![]() | SDL::Tutorial::Animation | |
![]() | SDL::Tutorial::Images | |
![]() | SDL::Tutorial::LunarLander | - a small tutorial on Perl SDL |
![]() | SDL::Tutorial::Pong | - Get started pong |
![]() | SDL::Tutorial::Tetris | - Let's Make Tetris |
UNCATEGORIZED | ||
![]() | SDL::Font | - a SDL perl extension |
![]() | SDL::Game::Palette | - a perl extension |
![]() | SDL::MPEG | - a SDL perl extension |
![]() | SDL::Music | - a perl extension |
![]() | SDL::OpenGL | - a perl extension |
![]() | SDL::SFont | - a perl extension |
![]() | SDL::SMPEG | - a SDL perl extension |
![]() | SDL::Sound | - a perl extension |
![]() | SDL::TTFont | - a SDL perl extension |
![]() | SDL::Tool::Font | - a perl extension |
![]() | SDL::Tool::Graphic |