#ifndef SNDINTRF_H
#define SNDINTRF_H


struct MachineSound
{
	int sound_type;
	void *sound_interface;
	const char *tag;
};


#include "sound/mixer.h"
#include "sound/streams.h"

#include "sound/ay8910.h"
#include "sound/2151intf.h"
#include "sound/2610intf.h"
#include "sound/adpcm.h"
#include "sound/qsound.h"


#define SOUND_YM2151_ALT SOUND_YM2151

/* the following list is automatically generated by makelist.pl - don't edit manually! */
enum
{
	SOUND_DUMMY,
	SOUND_AY8910,
	SOUND_YM2151_ALT,
	SOUND_YM2610,
	SOUND_OKIM6295,
	SOUND_QSOUND,
	SOUND_COUNT
};


/* structure for SOUND_CUSTOM sound drivers */
struct CustomSound_interface
{
	int (*sh_start)(const struct MachineSound *msound);
	void (*sh_stop)(void);
	void (*sh_update)(void);
};


int sound_start(void);
void sound_stop(void);
void sound_update(void);
void sound_reset(void);

/* returns name of the sound system */
const char *soundtype_name(int soundtype);
const char *sound_name(const struct MachineSound *msound);
/* returns number of chips, or 0 if the sound type doesn't support multiple instances */
int sound_num(const struct MachineSound *msound);
/* returns clock rate, or 0 if the sound type doesn't support a clock frequency */
int sound_clock(const struct MachineSound *msound);

int sound_scalebufferpos(int value);


READ_HANDLER( soundlatch_r );
READ_HANDLER( soundlatch2_r );
READ_HANDLER( soundlatch3_r );
READ_HANDLER( soundlatch4_r );
READ16_HANDLER( soundlatch_word_r );
READ16_HANDLER( soundlatch2_word_r );
READ16_HANDLER( soundlatch3_word_r );
READ16_HANDLER( soundlatch4_word_r );

WRITE_HANDLER( soundlatch_w );
WRITE_HANDLER( soundlatch2_w );
WRITE_HANDLER( soundlatch3_w );
WRITE_HANDLER( soundlatch4_w );
WRITE16_HANDLER( soundlatch_word_w );
WRITE16_HANDLER( soundlatch2_word_w );
WRITE16_HANDLER( soundlatch3_word_w );
WRITE16_HANDLER( soundlatch4_word_w );

WRITE_HANDLER( soundlatch_clear_w );
WRITE_HANDLER( soundlatch2_clear_w );
WRITE_HANDLER( soundlatch3_clear_w );
WRITE_HANDLER( soundlatch4_clear_w );


/* If you're going to use soundlatchX_clear_w, and the cleared value is
   something other than 0x00, use this function from machine_init. Note
   that this one call effects all 4 latches */
void soundlatch_setclearedvalue(int value);


#endif
