1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
-
-
- #ifndef _SOUND_H_
- #define _SOUND_H_
-
-
- class Sound {
- public:
-
- typedef enum {
- SoundFlagsNone = 0,
- SoundFlagsLoop = 1
- } SoundFlags;
-
-
-
- Sound();
-
-
-
- ~Sound();
-
-
-
- int init();
-
-
-
- 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 mInit;
- unsigned int mBuffer[256];
- unsigned int mSource[256];
- unsigned int mNextBuffer;
- unsigned int mNextSource;
- };
-
- #endif
|