#ifndef INC_SOUND
#define INC_SOUND
typedef enum
{
SONG1 = 0, WHOA_STRANGE, MAX_SOUND } songs;
#ifdef DX
#include <dsound.h>
typedef struct sound SOUND;
extern HMMIO wave;
extern bool stopped;
extern int volume;
extern int spause;
extern LPDIRECTSOUND ds;
extern HGLOBAL songmem;
extern HRSRC res;
extern SOUND *first_sound;
extern SOUND *last_sound;
extern LPDIRECTSOUNDBUFFER song;
extern int current_song;
#define BUFFER_SIZE 46756 #define STREAM_TIMER 99
struct sounds
{
char *fname;
char *name;
DWORD bytes;
};
const struct sounds sound_table[MAX_SOUND+1];
struct sound
{
SOUND *next;
SOUND *prev;
int index;
LPDIRECTSOUNDBUFFER sound; };
LPDIRECTSOUNDBUFFER load_wave_from_file( LPSTR file, DWORD bytes, int index );
LPDIRECTSOUNDBUFFER load_wave_from_resource( HGLOBAL mem, DWORD bytes, int index );
LPDIRECTSOUNDBUFFER init_buffer( DWORD bytes, int index );
bool init_dx( int song );
void set_volume( LPDIRECTSOUNDBUFFER buf, LONG amount );
void stop_wave( LPDIRECTSOUNDBUFFER buf );
void play_wave( LPDIRECTSOUNDBUFFER buf, bool loop );
void play_sound( int s );
void delete_wave( LPDIRECTSOUNDBUFFER buf );
void handle_dx( bool restart );
void close_dx( void );
void evaluate_waves( void );
int get_sound( char *name );
SOUND *get_sound_buf( LPDIRECTSOUNDBUFFER buf );
#endif
#endif