Last change
on this file since 494 was
494,
checked in by Sam Hocevar, 12 years ago
|
style: remove trailing spaces, fix copyright statements.
|
-
Property svn:keywords set to
Id
|
File size:
1.3 KB
|
Line | |
---|
1 | /* |
---|
2 | * Abuse - dark 2D side-scrolling platform game |
---|
3 | * Copyright (c) 1995 Crack dot Com |
---|
4 | * Copyright (c) 2005-2011 Sam Hocevar <sam@hocevar.net> |
---|
5 | * |
---|
6 | * This software was released into the Public Domain. As with most public |
---|
7 | * domain software, no warranty is made or implied by Crack dot Com or |
---|
8 | * Jonathan Clark. |
---|
9 | */ |
---|
10 | |
---|
11 | #ifndef __SOUND_HPP_ |
---|
12 | #define __SOUND_HPP_ |
---|
13 | |
---|
14 | #ifdef USE_SDL_MIXER |
---|
15 | #include <SDL/SDL_mixer.h> |
---|
16 | #endif |
---|
17 | |
---|
18 | /* options are passed via command line */ |
---|
19 | |
---|
20 | #define SFX_INITIALIZED 1 |
---|
21 | #define MUSIC_INITIALIZED 2 |
---|
22 | |
---|
23 | int sound_init(int argc, char **argv); |
---|
24 | void sound_uninit(); |
---|
25 | void print_sound_options(); // print the options avaible for sound |
---|
26 | |
---|
27 | class sound_effect |
---|
28 | { |
---|
29 | long size; |
---|
30 | void *data; |
---|
31 | #ifdef USE_SDL_MIXER |
---|
32 | Mix_Chunk* chunk; |
---|
33 | #endif |
---|
34 | public : |
---|
35 | sound_effect(char *filename); |
---|
36 | void play(int volume=127, int pitch=128, int panpot=128); |
---|
37 | ~sound_effect(); |
---|
38 | } ; |
---|
39 | |
---|
40 | |
---|
41 | class song |
---|
42 | { |
---|
43 | char *Name; |
---|
44 | unsigned char *data; |
---|
45 | unsigned long song_id; |
---|
46 | #ifdef USE_SDL_MIXER |
---|
47 | Mix_Music* music; |
---|
48 | SDL_RWops* rw; |
---|
49 | #endif |
---|
50 | public : |
---|
51 | char const *name() { return Name; } |
---|
52 | song(char const *filename); |
---|
53 | void play(unsigned char volume=127); |
---|
54 | void stop(long fadeout_time=0); // time in ms |
---|
55 | int playing(); |
---|
56 | void set_volume(int volume); |
---|
57 | ~song(); |
---|
58 | } ; |
---|
59 | #endif |
---|
60 | |
---|
61 | |
---|
62 | |
---|
63 | |
---|
64 | |
---|
65 | |
---|
66 | |
---|
67 | |
---|
68 | |
---|
69 | |
---|
70 | |
---|
Note: See
TracBrowser
for help on using the repository browser.