Commit | Line | Data |
d49f81db |
1 | <div class="pod"> |
2 | <!-- INDEX START --> |
3 | <h3 id="TOP">Index</h3> |
4 | |
5 | <ul><li><a href="#NAME">NAME</a></li> |
b5d537cc |
6 | <li><a href="#CATEGORY">CATEGORY</a></li> |
7 | <li><a href="#DESCRIPTION">DESCRIPTION</a></li> |
8 | <li><a href="#METHODS">METHODS</a> |
9 | <ul><li><a href="#PerlMixMusicHook">PerlMixMusicHook</a></li> |
10 | <li><a href="#mix_audio">mix_audio</a></li> |
11 | <li><a href="#load_WAV">load_WAV</a></li> |
12 | <li><a href="#load_MUS">load_MUS</a></li> |
13 | <li><a href="#free_music">free_music</a></li> |
14 | <li><a href="#hook_music">hook_music</a></li> |
15 | <li><a href="#hook_music_finished">hook_music_finished</a></li> |
16 | <li><a href="#get_music_hook_data">get_music_hook_data</a></li> |
17 | <li><a href="#play_music">play_music</a></li> |
18 | <li><a href="#fade_in_music">fade_in_music</a></li> |
b5d537cc |
19 | <li><a href="#fade_out_music">fade_out_music</a></li> |
20 | <li><a href="#fading_music">fading_music</a></li> |
e37eb258 |
21 | <li><a href="#volume_music">volume_music</a></li> |
22 | <li><a href="#halt_music">halt_music</a></li> |
b5d537cc |
23 | <li><a href="#pause_music">pause_music</a></li> |
24 | <li><a href="#resume_music">resume_music</a></li> |
25 | <li><a href="#rewind_music">rewind_music</a></li> |
e37eb258 |
26 | <li><a href="#set_music_position">set_music_position</a></li> |
b5d537cc |
27 | <li><a href="#paused_music">paused_music</a></li> |
28 | <li><a href="#playing_music">playing_music</a> |
29 | </li> |
30 | </ul> |
d49f81db |
31 | </li> |
32 | </ul><hr /> |
33 | <!-- INDEX END --> |
34 | |
35 | <h1 id="NAME">NAME</h1><p><a href="#TOP" class="toplink">Top</a></p> |
36 | <div id="NAME_CONTENT"> |
37 | <p>SDL::Mixer::Music -- SDL_Mixer music functions and bindings</p> |
38 | |
39 | </div> |
40 | <h1 id="CATEGORY">CATEGORY</h1><p><a href="#TOP" class="toplink">Top</a></p> |
41 | <div id="CATEGORY_CONTENT"> |
b5d537cc |
42 | <p>Mixer</p> |
43 | |
44 | </div> |
45 | <h1 id="DESCRIPTION">DESCRIPTION</h1><p><a href="#TOP" class="toplink">Top</a></p> |
46 | <div id="DESCRIPTION_CONTENT"> |
47 | |
48 | </div> |
49 | <h1 id="METHODS">METHODS</h1><p><a href="#TOP" class="toplink">Top</a></p> |
50 | <div id="METHODS_CONTENT"> |
51 | |
52 | </div> |
53 | <h2 id="PerlMixMusicHook">PerlMixMusicHook</h2> |
54 | <div id="PerlMixMusicHook_CONTENT"> |
55 | |
56 | </div> |
57 | <h2 id="mix_audio">mix_audio</h2> |
58 | <div id="mix_audio_CONTENT"> |
59 | <p>Same as SDL::Audio::mix()</p> |
60 | |
61 | </div> |
62 | <h2 id="load_WAV">load_WAV</h2> |
63 | <div id="load_WAV_CONTENT"> |
64 | <p>has to be implemented</p> |
65 | |
66 | </div> |
67 | <h2 id="load_MUS">load_MUS</h2> |
68 | <div id="load_MUS_CONTENT"> |
071b4b10 |
69 | <pre> my $music = SDL::Mixer::Music::load_MUS( $file ); |
70 | |
71 | </pre> |
72 | <p><code>load_MUS</code> loads a music file into a <code>SDL::Music::MixMusic</code> structure. This can be passed to <a href="http://search.cpan.org/perldoc?play_music">play_music</a>.</p> |
b5d537cc |
73 | |
74 | </div> |
75 | <h2 id="free_music">free_music</h2> |
76 | <div id="free_music_CONTENT"> |
77 | |
78 | </div> |
79 | <h2 id="hook_music">hook_music</h2> |
80 | <div id="hook_music_CONTENT"> |
81 | |
82 | </div> |
83 | <h2 id="hook_music_finished">hook_music_finished</h2> |
84 | <div id="hook_music_finished_CONTENT"> |
85 | |
86 | </div> |
87 | <h2 id="get_music_hook_data">get_music_hook_data</h2> |
88 | <div id="get_music_hook_data_CONTENT"> |
89 | |
90 | </div> |
91 | <h2 id="play_music">play_music</h2> |
92 | <div id="play_music_CONTENT"> |
e37eb258 |
93 | <pre> my $play_music = SDL::Mixer::Music::play_music( $mix_music, $loops ); |
071b4b10 |
94 | |
95 | </pre> |
96 | <p><code>play_music</code> plays a given <code>SDL::Mixer::MixMusic</code>. |
e37eb258 |
97 | Passing -1 to <code>$loops</code> will loop the music infinitely. </p> |
071b4b10 |
98 | <p>Example:</p> |
99 | <pre> my $music = SDL::Mixer::Music::load_MUS( 'music.mp3' ); |
100 | |
101 | unless(SDL::Mixer::Music::play_music($sample_music, -1)) |
102 | { |
103 | print("Something went wrong!\n"); |
104 | } |
105 | |
071b4b10 |
106 | </pre> |
b5d537cc |
107 | |
108 | </div> |
109 | <h2 id="fade_in_music">fade_in_music</h2> |
110 | <div id="fade_in_music_CONTENT"> |
e37eb258 |
111 | <pre> my $music = SDL::Mixer::Music::fade_in_music( $mix_music, $loops, $ms ); |
071b4b10 |
112 | |
113 | </pre> |
e37eb258 |
114 | <p>Same as <a href="http://search.cpan.org/perldoc?play_music">play_music</a> but you can specify the fade-in time by <code>$ms</code>.</p> |
b5d537cc |
115 | |
116 | </div> |
117 | <h2 id="fade_out_music">fade_out_music</h2> |
118 | <div id="fade_out_music_CONTENT"> |
e37eb258 |
119 | <pre> my $fading_music = SDL::Mixer::Music::fade_out_music( $ms ); |
120 | |
121 | </pre> |
122 | <p><code>fade_out_music</code> fades out the music with a duration specified in <code>ms</code> in milliseconds.</p> |
123 | <p>Returns the the number of channels that will be faded out.</p> |
b5d537cc |
124 | |
125 | </div> |
126 | <h2 id="fading_music">fading_music</h2> |
127 | <div id="fading_music_CONTENT"> |
e37eb258 |
128 | <pre> my $fading_music = SDL::Mixer::Music::fading_music(); |
071b4b10 |
129 | |
130 | </pre> |
131 | <p>Returns one of the following:</p> |
132 | <ul> |
133 | <li>MIX_NO_FADING </li> |
134 | <li>MIX_FADING_OUT </li> |
135 | <li>MIX_FADING_IN</li> |
136 | </ul> |
137 | |
b5d537cc |
138 | |
139 | </div> |
e37eb258 |
140 | <h2 id="volume_music">volume_music</h2> |
141 | <div id="volume_music_CONTENT"> |
142 | |
143 | </div> |
144 | <h2 id="halt_music">halt_music</h2> |
145 | <div id="halt_music_CONTENT"> |
146 | <pre> SDL::Mixer::Music::halt_music(); |
147 | |
148 | </pre> |
149 | <p>Halts the music.</p> |
150 | |
151 | </div> |
b5d537cc |
152 | <h2 id="pause_music">pause_music</h2> |
153 | <div id="pause_music_CONTENT"> |
071b4b10 |
154 | <pre> SDL::Mixer::Music::pause_music(); |
155 | |
156 | </pre> |
157 | <p>Pauses the music.</p> |
b5d537cc |
158 | |
159 | </div> |
160 | <h2 id="resume_music">resume_music</h2> |
161 | <div id="resume_music_CONTENT"> |
e37eb258 |
162 | <pre> SDL::Mixer::Music::resume_music(); |
071b4b10 |
163 | |
164 | </pre> |
165 | <p>Resumes the music.</p> |
b5d537cc |
166 | |
167 | </div> |
168 | <h2 id="rewind_music">rewind_music</h2> |
169 | <div id="rewind_music_CONTENT"> |
e37eb258 |
170 | <pre> SDL::Mixer::Music::rewind_music(); |
071b4b10 |
171 | |
e37eb258 |
172 | </pre> |
173 | <p>Rewinds the music.</p> |
071b4b10 |
174 | |
e37eb258 |
175 | </div> |
176 | <h2 id="set_music_position">set_music_position</h2> |
177 | <div id="set_music_position_CONTENT"> |
178 | <pre> SDL::Mixer::Music::set_music_position( $position ); |
071b4b10 |
179 | |
180 | </pre> |
e37eb258 |
181 | <p>Set the position of the currently playing music. The position takes different meanings for different music sources. It only works on the |
182 | music sources listed below.</p> |
183 | <dl> |
184 | <dt>MOD</dt> |
185 | <dd> |
186 | <p>The double is cast to Uint16 and used for a pattern number in the module. |
187 | Passing zero is similar to rewinding the song. </p> |
188 | </dd> |
189 | <dt>OGG</dt> |
190 | <dd> |
191 | <p>Jumps to position seconds from the beginning of the song. </p> |
192 | </dd> |
193 | <dt>MP3</dt> |
194 | <dd> |
195 | <p>Jumps to position seconds from the current position in the stream. |
196 | So you may want to call <a href="http://search.cpan.org/perldoc?rewind_music">rewind_music</a> before this. |
197 | Does not go in reverse... negative values do nothing. </p> |
198 | <p>Returns: <code>0</code> on success, or <code>-1</code> if the codec doesn't support this function. </p> |
b5d537cc |
199 | |
200 | </div> |
201 | <h2 id="paused_music">paused_music</h2> |
202 | <div id="paused_music_CONTENT"> |
071b4b10 |
203 | <pre> my $paused = SDL::Mixer::Music::paused_music(); |
204 | |
205 | </pre> |
e37eb258 |
206 | <p>Returns <code>1</code> if the music is paused, otherwise <code>0</code>.</p> |
b5d537cc |
207 | |
208 | </div> |
209 | <h2 id="playing_music">playing_music</h2> |
210 | <div id="playing_music_CONTENT"> |
071b4b10 |
211 | <pre> my $playing_music = SDL::Mixer::Music::playing_music(); |
212 | |
213 | </pre> |
e37eb258 |
214 | <p>Returns <code>1</code> if the music is playing sound, otherwise <code>0</code>. It does'nt check if the music is paused.</p> |
d49f81db |
215 | |
216 | </div> |
217 | </div> |