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