Gem Illuminator
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Soundmanager Class Reference

The Soundmanager class provides several sounds which can be played. The Soundmanager is implemented as a singleton to manage the required resources. More...

#include <soundmanager.h>

Inheritance diagram for Soundmanager:

Public Member Functions

virtual ~Soundmanager ()
 
Q_INVOKABLE void playBackgroundMusic ()
 Starts playing our background music. More...
 
void playCollisionSound ()
 Plays a previously defined sound in order to indicate a collision. More...
 
void setCollisionSound (SoundEffects effect)
 Sets the collision sound that will be played next time playCollisionSound() is called. More...
 
Q_INVOKABLE void stopBackgroundMusic ()
 Stops playing our background music. More...
 

Static Public Member Functions

static void drop ()
 Drops current instance of Soundmanager. More...
 
static Soundmanagerinstance ()
 The instance of our Soundmanager. More...
 

Protected Member Functions

 Soundmanager ()
 
void loadSounds ()
 

Protected Attributes

QMediaPlayer * m_backgroundMusic
 
QMediaPlayer * m_collisionSound
 

Static Protected Attributes

static Soundmanagerm_instance = 0
 

Detailed Description

The Soundmanager class provides several sounds which can be played. The Soundmanager is implemented as a singleton to manage the required resources.

Constructor & Destructor Documentation

Soundmanager::~Soundmanager ( )
virtual
Soundmanager::Soundmanager ( )
protected

Member Function Documentation

void Soundmanager::drop ( )
static

Drops current instance of Soundmanager.

Soundmanager * Soundmanager::instance ( )
static

The instance of our Soundmanager.

Returns
void Soundmanager::loadSounds ( )
protected
void Soundmanager::playBackgroundMusic ( )

Starts playing our background music.

See also
stopBackgroundMusic()
void Soundmanager::playCollisionSound ( )

Plays a previously defined sound in order to indicate a collision.

See also
setCollisionSound()
void Soundmanager::setCollisionSound ( SoundEffects  effect)

Sets the collision sound that will be played next time playCollisionSound() is called.

Parameters
effectThe chosen SoundEffect
void Soundmanager::stopBackgroundMusic ( )

Stops playing our background music.

Member Data Documentation

QMediaPlayer* Soundmanager::m_backgroundMusic
protected
QMediaPlayer* Soundmanager::m_collisionSound
protected
Soundmanager * Soundmanager::m_instance = 0
staticprotected

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