author | andyq <andyq> | 2003-01-20 23:11:56 (UTC) |
---|---|---|
committer | andyq <andyq> | 2003-01-20 23:11:56 (UTC) |
commit | 92419b025aa5d82bb7592281af5505ff931c2e58 (patch) (unidiff) | |
tree | 374ee9ca86ef716ce388c8a28e38261f6a04ce7a /noncore/games/sfcave-sdl/sound.h | |
parent | 02090d2e63ad8398c0a8a9f1fb895a9c6e42514b (diff) | |
download | opie-92419b025aa5d82bb7592281af5505ff931c2e58.zip opie-92419b025aa5d82bb7592281af5505ff931c2e58.tar.gz opie-92419b025aa5d82bb7592281af5505ff931c2e58.tar.bz2 |
Initial Revision
Diffstat (limited to 'noncore/games/sfcave-sdl/sound.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/games/sfcave-sdl/sound.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/noncore/games/sfcave-sdl/sound.h b/noncore/games/sfcave-sdl/sound.h new file mode 100644 index 0000000..d46b5bc --- a/dev/null +++ b/noncore/games/sfcave-sdl/sound.h | |||
@@ -0,0 +1,35 @@ | |||
1 | #ifndef __SOUND_H | ||
2 | #define __SOUND_H | ||
3 | |||
4 | #include <SDL.h> | ||
5 | #include "SDL_mixer.h" | ||
6 | |||
7 | #define NR_SOUNDS 3 | ||
8 | |||
9 | class SoundHandler | ||
10 | { | ||
11 | public: | ||
12 | static bool init(); | ||
13 | static void cleanUp(); | ||
14 | |||
15 | static int playSound( int soundNr, int channel = -1, int nrLoops = 0, int playBeforeFinished = false ); | ||
16 | static void stopSound( int channel, bool fadeOut, int nrMilliSecs = 1000 ); | ||
17 | static void setSoundsOn( bool val ); | ||
18 | static void setMusicOn( bool val ); | ||
19 | static void playMusic( string musicFile ); | ||
20 | static void playMusic( bool fadeIn = false ); | ||
21 | static void stopMusic( bool fadeOut = false ); | ||
22 | static void setMusicVolume( int vol ); | ||
23 | |||
24 | |||
25 | private: | ||
26 | static Mix_Music *music; | ||
27 | static Mix_Chunk *sounds[NR_SOUNDS]; | ||
28 | static int soundChannels[NR_SOUNDS]; | ||
29 | static bool soundOn; | ||
30 | static bool musicOn; | ||
31 | |||
32 | SoundHandler() {} | ||
33 | }; | ||
34 | |||
35 | #endif | ||