/****************************************************************************
*
* SOUND.H
*
* PROGRAMMER : Chris
*    VERSION : 00.00
*    CREATED : 02/06/98
*   MODIFIED : 02/06/98
*       TABS : 5
*
* DESCRIPTION
*	Header file for SOUND.C
*
*****************************************************************************/

#ifndef _SOUND_H
#define _SOUND_H

#ifdef __cplusplus
extern "C" {
#endif

/*---------------------------------------------------------------------------
 *	Import Headers
\*--------------------------------------------------------------------------*/

#ifdef PSX_VERSION
#include "../spec_psx/typedefs.h"
#include "../spec_psx/3d_gen.h"
#else
#include "..\specific\stypes.h"
#endif

/*---------------------------------------------------------------------------
 *	Constants
\*--------------------------------------------------------------------------*/

#define MAX_SAMPLES 370	// Max number of sound fx types availabe

#define ERR_SOUND_NOT_ENABLED		(-3)
#define ERR_SOUND_FAILED			(-2)
#define ERR_SOUND_NO_FREE_SLOTS	(-1)

enum sfx_types {
	SFX_LANDANDWATER = 0<<14,
	SFX_LANDONLY     = 1<<14,
	SFX_WATERONLY    = 2<<14
};

/*---------------------------------------------------------------------------
 *	Type Definitions
\*--------------------------------------------------------------------------*/

typedef struct {
	sint16 number;			// base sound effect number
	unsigned char volume;	// default volume of sound
	char radius;			// radius of sound (#blocks)
	char randomness;		// Chance of playing sample 0-255  0=Always
	signed char pitch;		// pitch shift -128 to +127
	sint16 flags;			// Flags for all sorts of stuff
}SAMPLE_INFO;

/*---------------------------------------------------------------------------
 *	Prototypes
\*--------------------------------------------------------------------------*/

extern int num_samples;
extern int sound_active;
extern sint16 sample_lut[];
extern int num_sample_infos;
extern SAMPLE_INFO* sample_infos;

extern void SOUND_Init();
extern void SOUND_SetMasterVolume(int nVolume);
extern void SOUND_EndScene();
extern void SOUND_Stop();

extern int SoundEffect(int nSFX, PHD_3DPOS *pPos, int flags);
extern void StopSoundEffect(int nSFX);

extern int GetRealTrack(int track);


#ifdef PC_VERSION

extern void S_SoundStopAllSamples();





#endif









#ifdef __cplusplus
}
#endif

#endif
