PageRenderTime 9ms CodeModel.GetById 1ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/lib/pods/SDL/Mixer/Groups.pod

http://github.com/PerlGameDev/SDL
Unknown | 109 lines | 56 code | 53 blank | 0 comment | 0 complexity | 173df4302e5b5e50c3404eb105466623 MD5 | raw file
  1
  2=pod
  3
  4=head1 NAME
  5
  6SDL::Mixer::Groups - Audio channel group functions
  7
  8=head1 CATEGORY
  9
 10Mixer
 11
 12=head1 METHODS
 13
 14=head2 reserve_channels
 15
 16 my $reserved = SDL::Mixer::Groups::reserve_channels( $num );
 17
 18C<$num> is the number of channels to reserve from default mixing. Zero removes all reservations. 
 19
 20Reserve C<$num> channels from being used when playing samples when passing in C<-1> as a channel number to playback functions. 
 21The channels are reserved starting from channel C<0> to C<$num-1>. Passing in zero will unreserve all channels. Normally SDL_mixer starts 
 22without any channels reserved.
 23
 24The following functions are affected by this setting: 
 25
 26=over 4
 27
 28=item *
 29
 30L<SDL::Mixer::Channels::play_channel|SDL::Mixer::Channels/"play_channel">
 31
 32=item *
 33
 34L<SDL::Mixer::Channels::play_channel_timed|SDL::Mixer::Channels/"play_channel_timed">
 35
 36=item *
 37
 38L<SDL::Mixer::Channels::fade_in_channel|SDL::Mixer::Channels/"fade_in_channel">
 39
 40=item *
 41
 42L<SDL::Mixer::Channels::fade_in_channel_timed|SDL::Mixer::Channels/"fade_in_channel_timed">
 43
 44=back
 45
 46Returns: The number of channels reserved. Never fails, but may return less channels than you ask for, depending on the number of channels 
 47previously allocated (see L<SDL::Mixer::Channels::allocate_channels|SDL::Mixer::Channels/"allocate_channels">).
 48
 49=head2 group_channel
 50
 51 my $grouped = SDL::Mixer::Groups::group_channel( $channel, $group );
 52
 53Add a channel to group id (any positive integer), or reset it's group to the default group by passing (-1).
 54
 55Returns: True(1) on success. False(0) is returned when the channel specified is invalid.
 56
 57=head2 group_channels
 58
 59 my $grouped = SDL::Mixer::Groups::group_channels( $from_channel, $to_channel, $group );
 60
 61Add a range of channels to group id (any positive integer), or reset their group to the default group by passing (-1).
 62
 63Returns: The number of affected channels.
 64
 65=head2 group_available
 66
 67 my $channel = SDL::Mixer::Groups::group_count( $group );
 68
 69C<group_newer> returns the first available channel of this group.
 70
 71=head2 group_count
 72
 73 my $channels = SDL::Mixer::Groups::group_count( $group );
 74
 75C<group_newer> returns the number of channels in this group.
 76
 77=head2 group_oldest
 78
 79 my $channel = SDL::Mixer::Groups::group_oldest( $group );
 80
 81C<group_newer> returns the channel number which started to play at first.
 82
 83=head2 group_newer
 84
 85 my $channel = SDL::Mixer::Groups::group_newer( $group );
 86
 87C<group_newer> returns the channel number which started to play at last.
 88
 89=head2 fade_out_group
 90
 91 SDL::Mixer::Groups::fade_out_group( $group, $ms );
 92
 93Fades out the channels by the given group id. The fade-out-time is specified by C<$ms>.
 94
 95Returns the number of affected channels.
 96
 97=head2 halt_group
 98
 99 SDL::Mixer::Groups::hals_group( $group );
100
101Halts the channels by the given group id.
102
103Returns C<0>.
104
105=head1 AUTHORS
106
107See L<SDL/AUTHORS>.
108
109=cut