00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef __SOUNDMANAGER_H__
00017 #define __SOUNDMANAGER_H__
00018
00019
00020 #include "../dependencies.h"
00021 #ifdef __COMPILE_WITH_SFML_AUDIO__
00022 #include "../core/ReferenceCounted.h"
00023
00024 #include "../core/AssetGroup.h"
00025
00026
00027
00029 class SoundManager : public ReferenceCounted
00030 {
00031 public:
00032
00033
00035 SoundManager();
00037 ~SoundManager();
00038
00040 void init();
00042 void clear();
00043
00044
00047 void grab();
00050 void drop();
00051
00052
00054 f32 getGlobalVolume() const;
00058 sf::SoundBuffer* getSoundBuffer(const std::string &fileName);
00059
00062 bool loadSoundBuffer(const std::string &fileName);
00067 bool loadSoundBufferFromMemory(const std::string &name, c8 *buffer, long length);
00068
00070 void removeSoundBuffers();
00073 bool removeSoundBuffer(const std::string &fileName);
00074
00077 void setGlobalVolume(f32 volume);
00078
00079 private:
00080
00081 std::map<std::string, sf::SoundBuffer*> mSoundBuffers;
00082
00083 };
00084
00085 #endif // __COMPILE_WITH_SFML_AUDIO__
00086
00087 #endif