00001 #ifndef HEADER_SDLSOUNDAGENT_H
00002 #define HEADER_SDLSOUNDAGENT_H
00003
00004 #include "SoundAgent.h"
00005
00006 #include "SDL.h"
00007 #include "SDL_mixer.h"
00008 #include <string>
00009
00010
00011
00012
00013 class SDLSoundAgent : public SoundAgent {
00014 private:
00015 static BaseMsg *ms_finished;
00016 Mix_Music *m_music;
00017 int m_soundVolume;
00018
00019 private:
00020 std::string generateIdName(const Path &file);
00021 Mix_Chunk *findChunk(const std::string &name);
00022
00023 static void musicFinished();
00024 protected:
00025 virtual void own_init();
00026 virtual void own_shutdown();
00027
00028 virtual void setSoundVolume(int volume);
00029 virtual void setMusicVolume(int volume);
00030 public:
00031 virtual int playSound(Mix_Chunk *sound, int volume, int loops=0);
00032
00033 virtual void playMusic(const Path &file,
00034 BaseMsg *finished);
00035 virtual void stopMusic();
00036 };
00037
00038 #endif