Audaspace 1.5.0
A high level audio library.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
VolumeSound Class Reference

This class allows to create a sound with its own volume. More...

#include <VolumeSound.h>

Inheritance diagram for VolumeSound:
Inheritance graph
[legend]

Public Member Functions

 VolumeSound (std::shared_ptr< ISound > sound, std::shared_ptr< VolumeStorage > volumeStorage)
 Creates a new VolumeSound.
 
virtual std::shared_ptr< IReadercreateReader ()
 Creates a reader for playback of the sound source.
 
std::shared_ptr< VolumeStoragegetSharedVolume ()
 Retrieves the shared volume of this sound.
 
void setSharedVolume (std::shared_ptr< VolumeStorage > volumeStorage)
 Changes the shared volume of this sound, it'll only affect newly created readers.
 
- Public Member Functions inherited from ISound
virtual ~ISound ()
 Destroys the sound.
 

Detailed Description

This class allows to create a sound with its own volume.

Constructor & Destructor Documentation

◆ VolumeSound()

VolumeSound::VolumeSound ( std::shared_ptr< ISound > sound,
std::shared_ptr< VolumeStorage > volumeStorage )

Creates a new VolumeSound.

Parameters
soundThe sound in which shall have its own volume.
volumeStorageA shared pointer to a VolumeStorage object. It allows to change the volume of various sound in one go.

Member Function Documentation

◆ createReader()

virtual std::shared_ptr< IReader > VolumeSound::createReader ( )
virtual

Creates a reader for playback of the sound source.

Returns
A pointer to an IReader object or nullptr if there has been an error.
Exceptions
ExceptionAn exception may be thrown if there has been a more unexpected error during reader creation.

Implements ISound.

◆ getSharedVolume()

std::shared_ptr< VolumeStorage > VolumeSound::getSharedVolume ( )

Retrieves the shared volume of this sound.

Returns
A shared pointer to the VolumeStorage object that this sound is using.

◆ setSharedVolume()

void VolumeSound::setSharedVolume ( std::shared_ptr< VolumeStorage > volumeStorage)

Changes the shared volume of this sound, it'll only affect newly created readers.

Parameters
volumeStorageA shared pointer to the new VolumeStorage object.

The documentation for this class was generated from the following file: