CCIMXDesktop
 
Loading...
Searching...
No Matches
SoundEffectPlayer Class Reference

Handles playback of sound effects. More...

#include <SoundEffectPlayer.h>

Inheritance diagram for SoundEffectPlayer:

Public Types

enum class  EffectIndex { JUMP , SCORE , DIE }
 Indexes for different sound effects. More...
 

Public Member Functions

 SoundEffectPlayer (QObject *parent)
 Constructs SoundEffectPlayer.
 
void play (EffectIndex index)
 Plays specified sound effect.
 

Static Public Member Functions

static constexpr int index (const EffectIndex &e)
 Converts EffectIndex to integer.
 
static constexpr EffectIndex index (const int e)
 Converts integer to EffectIndex.
 
static constexpr int max_cnt ()
 Gets total number of sound effects.
 

Detailed Description

Handles playback of sound effects.

Member Enumeration Documentation

◆ EffectIndex

enum class SoundEffectPlayer::EffectIndex
strong

Indexes for different sound effects.

Enumerator
JUMP 

Jump sound effect.

SCORE 

Score sound effect.

DIE 

Death sound effect.

Constructor & Destructor Documentation

◆ SoundEffectPlayer()

SoundEffectPlayer::SoundEffectPlayer ( QObject *  parent)
explicit

Constructs SoundEffectPlayer.

Parameters
parentParent QObject

Member Function Documentation

◆ index() [1/2]

static constexpr int SoundEffectPlayer::index ( const EffectIndex e)
inlinestaticconstexpr

Converts EffectIndex to integer.

Parameters
eEffect index to convert
Returns
Integer representation

◆ index() [2/2]

static constexpr EffectIndex SoundEffectPlayer::index ( const int  e)
inlinestaticconstexpr

Converts integer to EffectIndex.

Parameters
eInteger to convert
Returns
EffectIndex representation

◆ max_cnt()

static constexpr int SoundEffectPlayer::max_cnt ( )
inlinestaticconstexpr

Gets total number of sound effects.

Returns
Count of available effects

◆ play()

void SoundEffectPlayer::play ( EffectIndex  index)

Plays specified sound effect.

Parameters
indexIndex of effect to play

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