62587358d66fa9d392418c5393f89086013df61c
[sdlgit/SDL-Site.git] / pages / SDL-Mixer-Groups.html-inc
1 <div class="pod">
2 <!-- INDEX START -->
3 <h3 id="TOP">Index</h3>
4
5 <ul><li><a href="#NAME">NAME</a></li>
6 <li><a href="#CATEGORY">CATEGORY</a></li>
7 <li><a href="#METHODS">METHODS</a>
8 <ul><li><a href="#reserve_channels">reserve_channels</a></li>
9 <li><a href="#group_channel">group_channel</a></li>
10 <li><a href="#group_channels">group_channels</a></li>
11 <li><a href="#group_available">group_available</a></li>
12 <li><a href="#group_count">group_count</a></li>
13 <li><a href="#group_oldest">group_oldest</a></li>
14 <li><a href="#group_newer">group_newer</a></li>
15 <li><a href="#fade_out_group">fade_out_group</a></li>
16 <li><a href="#halt_group">halt_group</a>
17 </li>
18 </ul>
19 </li>
20 </ul><hr />
21 <!-- INDEX END -->
22
23 <h1 id="NAME">NAME</h1><p><a href="#TOP" class="toplink">Top</a></p>
24 <div id="NAME_CONTENT">
25 <p>SDL::Mixer::Groups - Audio channel group functions</p>
26
27 </div>
28 <h1 id="CATEGORY">CATEGORY</h1><p><a href="#TOP" class="toplink">Top</a></p>
29 <div id="CATEGORY_CONTENT">
30 <p>Mixer</p>
31
32 </div>
33 <h1 id="METHODS">METHODS</h1><p><a href="#TOP" class="toplink">Top</a></p>
34 <div id="METHODS_CONTENT">
35
36 </div>
37 <h2 id="reserve_channels">reserve_channels</h2>
38 <div id="reserve_channels_CONTENT">
39 <pre> my $reserved = SDL::Mixer::Groups::reserve_channels( $num );
40
41 </pre>
42 <p><code>$num</code> is the number of channels to reserve from default mixing. Zero removes all reservations. </p>
43 <p>Reserve <code>$num</code> channels from being used when playing samples when passing in <code>-1</code> as a channel number to playback functions. 
44 The channels are reserved starting from channel <code>0</code> to <code>$num-1</code>. Passing in zero will unreserve all channels. Normally SDL_mixer starts 
45 without any channels reserved.</p>
46 <p>The following functions are affected by this setting: </p>
47 <ul>
48                 <li><a href="/SDL-Mixer-Channels.html#play_channel">SDL::Mixer::Channels::play_channel</a>      </li>
49                 <li><a href="/SDL-Mixer-Channels.html#play_channel_timed">SDL::Mixer::Channels::play_channel_timed</a>  </li>
50                 <li><a href="/SDL-Mixer-Channels.html#fade_in_channel">SDL::Mixer::Channels::fade_in_channel</a>        </li>
51                 <li><a href="/SDL-Mixer-Channels.html#fade_in_channel_timed">SDL::Mixer::Channels::fade_in_channel_timed</a></li>
52 </ul>
53
54 <p>Returns: The number of channels reserved. Never fails, but may return less channels than you ask for, depending on the number of channels 
55 previously allocated (see <a href="/SDL-Mixer-Channels.html#allocate_channels">SDL::Mixer::Channels::allocate_channels</a>).</p>
56
57 </div>
58 <h2 id="group_channel">group_channel</h2>
59 <div id="group_channel_CONTENT">
60 <pre> my $grouped = SDL::Mixer::Groups::group_channel( $channel, $group );
61
62 </pre>
63 <p>Add a channel to group id (any positive integer), or reset it's group to the default group by passing (-1).</p>
64 <p>Returns: True(1) on success. False(0) is returned when the channel specified is invalid.</p>
65
66 </div>
67 <h2 id="group_channels">group_channels</h2>
68 <div id="group_channels_CONTENT">
69 <pre> my $grouped = SDL::Mixer::Groups::group_channels( $from_channel, $to_channel, $group );
70
71 </pre>
72 <p>Add a range of channels to group id (any positive integer), or reset their group to the default group by passing (-1).</p>
73 <p>Returns: The number of affected channels.</p>
74
75 </div>
76 <h2 id="group_available">group_available</h2>
77 <div id="group_available_CONTENT">
78 <pre> my $channel = SDL::Mixer::Groups::group_count( $group );
79
80 </pre>
81 <p><code>group_newer</code> returns the first available channel of this group.</p>
82
83 </div>
84 <h2 id="group_count">group_count</h2>
85 <div id="group_count_CONTENT">
86 <pre> my $channels = SDL::Mixer::Groups::group_count( $group );
87
88 </pre>
89 <p><code>group_newer</code> returns the number of channels in this group.</p>
90
91 </div>
92 <h2 id="group_oldest">group_oldest</h2>
93 <div id="group_oldest_CONTENT">
94 <pre> my $channel = SDL::Mixer::Groups::group_oldest( $group );
95
96 </pre>
97 <p><code>group_newer</code> returns the channel number which started to play at first.</p>
98
99 </div>
100 <h2 id="group_newer">group_newer</h2>
101 <div id="group_newer_CONTENT">
102 <pre> my $channel = SDL::Mixer::Groups::group_newer( $group );
103
104 </pre>
105 <p><code>group_newer</code> returns the channel number which started to play at last.</p>
106
107 </div>
108 <h2 id="fade_out_group">fade_out_group</h2>
109 <div id="fade_out_group_CONTENT">
110 <pre> SDL::Mixer::Groups::fade_out_group( $group, $ms );
111
112 </pre>
113 <p>Fades out the channels by the given group id. The fade-out-time is specified by <code>$ms</code>.</p>
114 <p>Retuns the number of affected channels.</p>
115
116 </div>
117 <h2 id="halt_group">halt_group</h2>
118 <div id="halt_group_CONTENT">
119 <pre> SDL::Mixer::Groups::hals_group( $group );
120
121 </pre>
122 <p>Halts the channels by the given group id.</p>
123 <p>Retuns <code>0</code>.</p>
124
125 </div>
126 </div>