From: Tobias Leich Date: Sun, 28 Feb 2010 22:41:38 +0000 (+0100) Subject: updated docs for SDL::Mixer::Music X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=sdlgit%2FSDL-Site.git;a=commitdiff_plain;h=071b4b105ca82ffcb4914ea24dfd06d6069bd6df updated docs for SDL::Mixer::Music --- diff --git a/pages/SDL-Mixer-Channels.html-inc b/pages/SDL-Mixer-Channels.html-inc index f254f2d..0c8a0ff 100644 --- a/pages/SDL-Mixer-Channels.html-inc +++ b/pages/SDL-Mixer-Channels.html-inc @@ -167,7 +167,27 @@ current volume.

channel_finished

-

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 );
+
+

playing

diff --git a/pages/SDL-Mixer-Music.html-inc b/pages/SDL-Mixer-Music.html-inc index 678f82c..34be5d2 100644 --- a/pages/SDL-Mixer-Music.html-inc +++ b/pages/SDL-Mixer-Music.html-inc @@ -65,6 +65,10 @@

load_MUS

+
 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.

free_music

@@ -85,6 +89,23 @@

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");
+ }
+
+
+
+
+

fade_in_music

@@ -97,6 +118,10 @@

halt_music

+
 SDL::Mixer::Music::halt_music();
+
+
+

Halts the music.

fade_out_music

@@ -105,26 +130,62 @@

fading_music

+
 my $fading_music = SDL::Mixer::Channels::fading_music();
+
+
+

Returns one of the following:

+ +

pause_music

+
 SDL::Mixer::Music::pause_music();
+
+
+

Pauses the music.

resume_music

+
+
+
+ SDL::Mixer::Music::resume_music();
+
+
+

Resumes the music.

rewind_music

+
+
+
+ SDL::Mixer::Music::rewind_music();
+
+
+

Rewinds the music.

paused_music

+
 my $paused = SDL::Mixer::Music::paused_music();
+
+
+

Returns 1 if the music is paused, otherwise 0.

playing_music

+
 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.

\ No newline at end of file diff --git a/pages/documentation.html-inc b/pages/documentation.html-inc index dfc854d..1d9f600 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
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
+

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