/* Emacs style mode select   -*- C++ -*- */
/*-----------------------------------------------------------------------------*/

/* $Id:$*/

/* Copyright (C) 1993-1996 by id Software, Inc.*/

/* This source is available for distribution and/or modification*/
/* only under the terms of the DOOM Source Code License as*/
/* published by id Software. All rights reserved.*/

/* The source is distributed in the hope that it will be useful,*/
/* but WITHOUT ANY WARRANTY; without even the implied warranty of*/
/* FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License*/
/* for more details.*/


/* DESCRIPTION:*/
/*	System interface, sound.*/

/*-----------------------------------------------------------------------------*/

#ifndef __I_SOUND__
#define __I_SOUND__

#include "doomdef.h"

#include "doomstat.h"
#include "sounds.h"


extern boolean force8bit;
extern boolean nosound;
extern boolean nomusic;

/* Define to load all sounds at startup */
#define SOUND_PRECACHE
/* If not, this controls how often the cache is cleaned */
#define SOUND_CLEAN 30 /* tics */

/*  SFX I/O
 */

void I_InitSound(void);				/* Init at program start */
void I_ClaimSound(void);			/* Take over hardware */
void I_ReleaseSound(void);			/* Restore hardware state */
void I_ShutdownSound(void);			/* Shut down and reverse anything done at init */
int  I_GetSfxLumpNum (sfxinfo_t* sfxinfo);	/* Get raw data lump index for sound descriptor.*/
int  I_StartSound(int id,int vol,int sep,int pitch);/* Starts a sound in any sound channel.*/
void I_StopSound(int ch);			/* Stops a sound channel.*/
int  I_SoundIsPlaying(int ch);			/* Returns 0 if no longer playing, 1 if playing.*/
void I_UpdateSoundParams
     (int ch,int vol,int sep,int pitch);	/* Updates the volume, pitch and pan */

/*  MUSIC I/O
 */

void I_InitMusic(void);
void I_ClaimMusic(void);			/* Take over hardware */
void I_ReleaseMusic(void);			/* Restore hardware state */
void I_ShutdownMusic(void);
void I_SetMusicVolume(int volume);
void I_PauseSong(int handle);
void I_ResumeSong(int handle);
int  I_RegisterSong(byte *data);		/* Registers a song to play */
void I_PlaySong(int handle,int looping);	/* Called by anything that wishes to start music.*/
						/*  plays a song, and when the song is done,*/
						/*  starts playing it again in an endless loop.*/
						/* Horrible thing to do, considering.*/
void I_FillMusBuffer(int handle);		/* Keep MIDI buffer filled */
void I_StopSong(int handle);			/* Stops a song over 3 seconds.*/
void I_UnRegisterSong(int handle);		/* See above (register), then think backwards*/



#endif
/*-----------------------------------------------------------------------------*/

/* $Log:$*/

/*-----------------------------------------------------------------------------*/
