class FMOD::SoundGroup
Represents a logical grouping of {Sound} objects that can be manipulated as one.
Public Instance Methods
Retrieves a sound from within a sound group.
@param index [Integer] Index of the sound that is to be retrieved.
@return [Sound, nil] the desired Sound
object, or nil
if index was out
of range.
# File lib/fmod/sound_group.rb, line 106 def [](index) return nil unless FMOD.valid_range?(0, 0, count - 1, false) FMOD.invoke(:SoundGroup_GetSound, self, index, sound = int_ptr) Sound.new(sound) end
Enumerates the sounds contained within the sound group.
@overload each
When called with block, yields each {Sound within the object before returning self. @yield [sound] Yields a sound to the block. @yieldparam sound [Sound] The current enumerated polygon. @return [self]
@overload each
When no block specified, returns an Enumerator for the {SoundGroup}. @return [Enumerator]
# File lib/fmod/sound_group.rb, line 93 def each return to_enum(:each) unless block_given? (0...count).each { |i| yield self[i] } self end
@!attribute [r] name @return [String] the name of the sound group.
# File lib/fmod/sound_group.rb, line 75 def name buffer = "\0" * 512 FMOD.invoke(:SoundGroup_GetName, self, buffer, 512) buffer.delete("\0") end
@!attribute [r] parent @return [System] the parent {System} object that was used to create this
object.
# File lib/fmod/sound_group.rb, line 118 def parent FMOD.invoke(:SoundGroup_GetSystemObject, self, system = int_ptr) System.new(system) end
Stops all sounds within this sound group. @return [void]
# File lib/fmod/sound_group.rb, line 126 def stop FMOD.invoke(:SoundGroup_Stop, self) end
@!attribute max_audible Limits the number of concurrent playbacks of sounds in a sound group to the specified value.
After this, if the sounds in the sound group are playing this many times, any attempts to play more of the sounds in the sound group will by default fail an exception.
Use {#behavior} to change the way the sound playback behaves when too many sounds are playing. Muting, failing and stealing behaviors can be specified.
@return [Integer] the number of playbacks to be audible at once. -1 (the
default) denotes unlimited.
# File lib/fmod/sound_group.rb, line 27 integer_reader(:max_audible, :SoundGroup_GetMaxAudible)