template<UnsignedInt dimensions>
Magnum::Audio::PlayableGroup class

PlayableGroup.

Manages Audio::Playable features and provides means of setting gain or transformation of a group of Playables, aswell as the ability of playing, pausing, stopping or cleaning all sources of all Playables.

Usage

Object3D object;
Source source;
PlayableGroup3D group;
Playable3D playable{object, source, &group};

// ...

object.translate(offset);

// ... and every frame, update the sources positions:
group.setClean();

For two dimensional scenes simply replace 3D with 2D. When using a Listener, prefer Listener::update() over PlayableGroup::setClean().

Base classes

template<UnsignedInt dimensions, class Feature, class T>
class Magnum::SceneGraph::FeatureGroup
Group of features.

Constructors, destructors, conversion operators

PlayableGroup() explicit
Constructor.

Public functions

auto play() -> PlayableGroup<dimensions>&
Play all sound sources in this group.
auto pause() -> PlayableGroup&
Pause all sound sources in this group.
auto stop() -> PlayableGroup&
Stop all sound sources in this group.
auto gain() const -> Float
Gain.
auto setGain(const Float gain) -> PlayableGroup&
Set gain for all sound sources of Playables in this group.
auto soundTransformation() const -> const Matrix4&
Sound transformation.
auto setSoundTransformation(const Matrix4& matrix) -> PlayableGroup&
Set transformation of the sounds in this group.
void setClean()
Set all contained Playables clean.

Function documentation

template<UnsignedInt dimensions>
PlayableGroup<dimensions>& Magnum::Audio::PlayableGroup<dimensions>::play()

Play all sound sources in this group.

Returns Reference to self (for method chaining)

template<UnsignedInt dimensions>
PlayableGroup& Magnum::Audio::PlayableGroup<dimensions>::pause()

Pause all sound sources in this group.

Returns Reference to self (for method chaining)

template<UnsignedInt dimensions>
PlayableGroup& Magnum::Audio::PlayableGroup<dimensions>::stop()

Stop all sound sources in this group.

Returns Reference to self (for method chaining)

template<UnsignedInt dimensions>
PlayableGroup& Magnum::Audio::PlayableGroup<dimensions>::setGain(const Float gain)

Set gain for all sound sources of Playables in this group.

Parameters
gain Gain
Returns Reference to self (for method chaining)

Will calculate the sound sources gain relative to the gain of the Playable and this playable group. The sources gain is computed as sourceGain = playableGain*groupGain. Default of the groups gain is 1.0f.

template<UnsignedInt dimensions>
PlayableGroup& Magnum::Audio::PlayableGroup<dimensions>::setSoundTransformation(const Matrix4& matrix)

Set transformation of the sounds in this group.

Returns Reference to self (for method chaining)

template<UnsignedInt dimensions>
void Magnum::Audio::PlayableGroup<dimensions>::setClean()

Set all contained Playables clean.