1 // -----------------------------------------------
4 // Copyright (c) 2004, Kronoman
5 // In loving memory of my father
6 // -----------------------------------------------
8 // -----------------------------------------------
9 // This system wraps around Allegro and DUMB,
10 // so I can use the high level sound routines,
11 // global adjust volume, disable volume, etc
12 // -----------------------------------------------
13 #ifndef _KRONO_SOUND_H
14 #define _KRONO_SOUND_H
16 #include <allegro.h> // Allegro : http://alleg.sf.net/
17 #include <aldumb.h> // DUMB : http://dumb.sf.net/
26 int play_sample(const SAMPLE
*spl
, int vol
, int pan
, int freq
, int loop
); // digital sample playing
27 void set_volume_d(int v
); // volume digital
31 void music_load(DUH
*dat
); // call this before playing, dat should be a pointer to a music object of a datafile
33 void music_start(); // start playing
35 void music_pause(); // pause playback
36 void music_resume(); // pause playback
38 void music_poll(); // _must_ be called at regular intervals to hear the music
40 void music_stop(); // stop playing
42 void set_volume_m(int v
); // volume music
46 void set_enabled(bool s
);
50 static void global_set_volume(int v
);
51 static int global_get_volume();
53 static void global_set_enabled(bool s
);
54 static bool global_is_enabled();
58 bool enabled
; // enable this object player (if false, nothing will be played)
59 int volume_d
; // volume, 0 to 255
60 int volume_m
; // volume music, 0 to 255
63 static bool global_enabled
; // enables the sound system ?
64 static int global_volume
; // global volume, 0 to 255