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

This class represents a category of related sounds which are currently playing and allows to control them easily. More...

#include <PlaybackCategory.h>

Public Member Functions

 PlaybackCategory (std::shared_ptr< IDevice > device)
 Creates a new PlaybackCategory.
 
std::shared_ptr< IHandleplay (std::shared_ptr< ISound > sound)
 Plays a new sound in the category.
 
void resume ()
 Resumes all the paused sounds of the category.
 
void pause ()
 Pauses all current played back sounds of the category.
 
float getVolume ()
 Retrieves the volume of the category.
 
void setVolume (float volume)
 Sets the volume for the category.
 
void stop ()
 Stops all the playing back or paused sounds.
 
std::shared_ptr< VolumeStoragegetSharedVolume ()
 Retrieves the shared volume of the category.
 
void cleanHandles ()
 Cleans the category erasing all the invalid handles.
 

Detailed Description

This class represents a category of related sounds which are currently playing and allows to control them easily.

Constructor & Destructor Documentation

◆ PlaybackCategory()

PlaybackCategory::PlaybackCategory ( std::shared_ptr< IDevice > device)

Creates a new PlaybackCategory.

Parameters
deviceA shared pointer to the device which will be used for playback.

Member Function Documentation

◆ cleanHandles()

void PlaybackCategory::cleanHandles ( )

Cleans the category erasing all the invalid handles.

Only needed if individual sounds are stopped with their handles.

◆ getSharedVolume()

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

Retrieves the shared volume of the category.

Returns
A shared pointer to the VolumeStorage object that represents the shared volume of the category.

◆ getVolume()

float PlaybackCategory::getVolume ( )

Retrieves the volume of the category.

Returns
The volume.

◆ play()

std::shared_ptr< IHandle > PlaybackCategory::play ( std::shared_ptr< ISound > sound)

Plays a new sound in the category.

Parameters
soundThe sound to be played.
Returns
A handle for the playback. If the playback failed, nullptr will be returned.

◆ setVolume()

void PlaybackCategory::setVolume ( float volume)

Sets the volume for the category.

Parameters
volumeThe volume.

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