123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
-
-
- #ifndef _SOUND_H_
- #define _SOUND_H_
-
- #include <vector>
-
-
- class Sound {
- public:
-
- typedef enum {
- SoundFlagsNone = 0,
- SoundFlagsLoop = (1 << 0)
- } SoundFlags;
-
-
-
- Sound();
-
-
-
- ~Sound();
-
-
-
- int initialize();
-
- void setEnabled(bool on);
-
-
-
- void setVolume(float vol);
-
-
-
- int registeredSources();
-
-
-
- void clear();
-
-
-
- void listenAt(float pos[3], float angle[3]);
-
-
-
- void sourceAt(int source, float pos[3]);
-
-
-
- int addFile(const char *filename, int *source, unsigned int flags);
-
-
-
- int addWave(unsigned char *wav, unsigned int length, int *source, unsigned int flags);
-
-
-
- void play(int source);
-
-
-
- void stop(int source);
-
- private:
-
- bool mEnabled;
- bool mInit;
- float mVolume;
- std::vector<unsigned int> mBuffer;
- std::vector<unsigned int> mSource;
- };
-
- #endif
|