| 1 |
#ifndef HEADER_SOUNDAGENT_H |
| 2 |
#define HEADER_SOUNDAGENT_H |
| 3 |
|
| 4 |
class Path; |
| 5 |
class BaseMsg; |
| 6 |
|
| 7 |
#include "BaseAgent.h" |
| 8 |
#include "Name.h" |
| 9 |
#include "IntMsg.h" |
| 10 |
|
| 11 |
#include "SDL.h" |
| 12 |
#include "SDL_mixer.h" |
| 13 |
#include <string> |
| 14 |
|
| 15 |
/** |
| 16 |
* Sound and music interface. |
| 17 |
*/ |
| 18 |
class SoundAgent : public BaseAgent { |
| 19 |
AGENT(SoundAgent, Name::SOUND_NAME); |
| 20 |
protected: |
| 21 |
virtual void own_init(); |
| 22 |
virtual void setSoundVolume(int volume) = 0; |
| 23 |
virtual void setMusicVolume(int volume) = 0; |
| 24 |
public: |
| 25 |
virtual void reinit(); |
| 26 |
virtual int playSound(Mix_Chunk *sound, int volume, |
| 27 |
int loops=0) = 0; |
| 28 |
|
| 29 |
virtual void playMusic(const Path &file, |
| 30 |
BaseMsg *finished) = 0; |
| 31 |
virtual void stopMusic() = 0; |
| 32 |
void receiveString(const StringMsg *msg); |
| 33 |
}; |
| 34 |
|
| 35 |
#endif |