SDL SPOOKY PLATFORMER ENGINE  0.2.0
An implementation of a platformer using sdl, implemented using an entity component system and efficient collision management.
Public Member Functions | Static Public Member Functions | List of all members
SoundManager Class Reference

#include <SoundManager.hpp>

Inheritance diagram for SoundManager:
ResourceManager< SoundManager, Mix_Chunk >

Public Member Functions

int shutDown ()
 
int startUp (int frequency, Uint16 format, int channels, int chunksize)
 
std::shared_ptr< Mix_Chunk > Load (const std::string &path)
 
- Public Member Functions inherited from ResourceManager< SoundManager, Mix_Chunk >
bool AddAllResource ()
 
bool AddResource (const std::string &resourceName)
 
std::shared_ptr< Mix_Chunk > GetResource (const std::string &resourceName)
 
std::shared_ptr< Mix_Chunk > Load (const std::string &path)
 
int shutDown ()
 

Static Public Member Functions

static SoundManager & instance ()
 

Additional Inherited Members

- Protected Member Functions inherited from ResourceManager< SoundManager, Mix_Chunk >
 ResourceManager ()
 
 ResourceManager (ResourceManager const &)
 Allow subclasses to create a resource manager, but subclasses must ensure singleton functionality. More...
 
void operator= (ResourceManager const &)
 Allow subclasses to assign to a resource manager, but subclasses must ensure singleton functionality. More...
 
- Protected Attributes inherited from ResourceManager< SoundManager, Mix_Chunk >
std::map< std::string, std::string > fileMap
 stores location of resources More...
 
std::map< std::string, std::pair< std::shared_ptr< Mix_Chunk >, int > > resourceMap
 Internal resource mapping inherited by manager implementations. More...
 

Detailed Description

Manages sound resources, using the SDL_mixer library.

Member Function Documentation

static SoundManager& SoundManager::instance ( )
inlinestatic

Retrieves a singleton instance

std::shared_ptr<Mix_Chunk> SoundManager::Load ( const std::string &  path)
inline

Loads a given sound file using the mixer engine.

Parameters
pathwhere to load it from.
int SoundManager::shutDown ( )
inline

Shuts down the sdl mixer engine and the resource manager.

int SoundManager::startUp ( int  frequency,
Uint16  format,
int  channels,
int  chunksize 
)
inline

Starts up the sdl_mixer engine.

Parameters
frequencysdl_mixer frequency
formatsdl_mixer format
channelssdl_mixer channels
chunksizesdl_mixer chunksize

For all params refer to the sdl_mixer Mix_OpenAudio documentation for more information.


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