/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. =pod
  2. =head1 NAME
  3. SDL::Mixer::Groups - Audio channel group functions
  4. =head1 CATEGORY
  5. Mixer
  6. =head1 METHODS
  7. =head2 reserve_channels
  8. my $reserved = SDL::Mixer::Groups::reserve_channels( $num );
  9. C<$num> is the number of channels to reserve from default mixing. Zero removes all reservations.
  10. Reserve C<$num> channels from being used when playing samples when passing in C<-1> as a channel number to playback functions.
  11. The channels are reserved starting from channel C<0> to C<$num-1>. Passing in zero will unreserve all channels. Normally SDL_mixer starts
  12. without any channels reserved.
  13. The following functions are affected by this setting:
  14. =over 4
  15. =item *
  16. L<SDL::Mixer::Channels::play_channel|SDL::Mixer::Channels/"play_channel">
  17. =item *
  18. L<SDL::Mixer::Channels::play_channel_timed|SDL::Mixer::Channels/"play_channel_timed">
  19. =item *
  20. L<SDL::Mixer::Channels::fade_in_channel|SDL::Mixer::Channels/"fade_in_channel">
  21. =item *
  22. L<SDL::Mixer::Channels::fade_in_channel_timed|SDL::Mixer::Channels/"fade_in_channel_timed">
  23. =back
  24. Returns: The number of channels reserved. Never fails, but may return less channels than you ask for, depending on the number of channels
  25. previously allocated (see L<SDL::Mixer::Channels::allocate_channels|SDL::Mixer::Channels/"allocate_channels">).
  26. =head2 group_channel
  27. my $grouped = SDL::Mixer::Groups::group_channel( $channel, $group );
  28. Add a channel to group id (any positive integer), or reset it's group to the default group by passing (-1).
  29. Returns: True(1) on success. False(0) is returned when the channel specified is invalid.
  30. =head2 group_channels
  31. my $grouped = SDL::Mixer::Groups::group_channels( $from_channel, $to_channel, $group );
  32. Add a range of channels to group id (any positive integer), or reset their group to the default group by passing (-1).
  33. Returns: The number of affected channels.
  34. =head2 group_available
  35. my $channel = SDL::Mixer::Groups::group_count( $group );
  36. C<group_newer> returns the first available channel of this group.
  37. =head2 group_count
  38. my $channels = SDL::Mixer::Groups::group_count( $group );
  39. C<group_newer> returns the number of channels in this group.
  40. =head2 group_oldest
  41. my $channel = SDL::Mixer::Groups::group_oldest( $group );
  42. C<group_newer> returns the channel number which started to play at first.
  43. =head2 group_newer
  44. my $channel = SDL::Mixer::Groups::group_newer( $group );
  45. C<group_newer> returns the channel number which started to play at last.
  46. =head2 fade_out_group
  47. SDL::Mixer::Groups::fade_out_group( $group, $ms );
  48. Fades out the channels by the given group id. The fade-out-time is specified by C<$ms>.
  49. Returns the number of affected channels.
  50. =head2 halt_group
  51. SDL::Mixer::Groups::hals_group( $group );
  52. Halts the channels by the given group id.
  53. Returns C<0>.
  54. =head1 AUTHORS
  55. See L<SDL/AUTHORS>.
  56. =cut