//**************************************************************************
//**
//**	##   ##    ##    ##   ##   ####     ####   ###     ###
//**	##   ##  ##  ##  ##   ##  ##  ##   ##  ##  ####   ####
//**	 ## ##  ##    ##  ## ##  ##    ## ##    ## ## ## ## ##
//**	 ## ##  ########  ## ##  ##    ## ##    ## ##  ###  ##
//**	  ###   ##    ##   ###    ##  ##   ##  ##  ##       ##
//**	   #    ##    ##    #      ####     ####   ##       ##
//**
//**	$Id: sound.h,v 1.14 2005/11/20 12:38:50 dj_jl Exp $
//**
//**	Copyright (C) 1999-2002 JÆnis Legzdi·ý
//**
//**	This program is free software; you can redistribute it and/or
//**  modify it under the terms of the GNU General Public License
//**  as published by the Free Software Foundation; either version 2
//**  of the License, or (at your option) any later version.
//**
//**	This program is distributed in the hope that it will be useful,
//**  but WITHOUT ANY WARRANTY; without even the implied warranty of
//**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//**  GNU General Public License for more details.
//**
//**************************************************************************

// HEADER FILES ------------------------------------------------------------

// MACROS ------------------------------------------------------------------

#define S_StartSoundName(name)	S_StartSound(S_GetSoundID(name))

// TYPES -------------------------------------------------------------------

enum seqtype_t
{
	SEQ_Door,
	SEQ_Platform,
	SEQ_Environment,
};

// PUBLIC FUNCTION PROTOTYPES ----------------------------------------------

//
//	Main
//
void S_Init();
void S_InitScript();
void S_Start();
void S_MusicChanged();
void S_StartSong(FName name, int track, boolean loop);
void S_PauseSound();
void S_ResumeSound();
void S_UpdateSounds();
int S_GetSoundID(FName Name);
int S_GetSoundID(const char *name);
int S_ResolveEntitySound(FName, FName, FName);
void S_Shutdown();

//
//	Sound playback
//
void S_StartSound(int, const TVec&, const TVec&, int, int, int);
inline void S_StartSound(int sound_id)
{
	S_StartSound(sound_id, TVec(0, 0, 0), TVec(0, 0, 0), 0, 0, 127);
}
void S_StopSound(int, int);
void S_StopAllSound(void);
boolean S_GetSoundPlayingInfo(int origin_id, int sound_id);

//
//	Sound sequences
//
void SN_InitSequenceScript();
void SN_SetSeqTrans(FName Name, int Num, int SeqType);
FName SN_GetSeqTrans(int Num, int SeqType);
void SN_StartSequence(int origin_id, const TVec &origin, int sequence);
void SN_StartSequenceName(int origin_id, const TVec &origin, const char *name);
void SN_StopSequence(int origin_id);
void SN_UpdateActiveSequences();
void SN_StopAllSequences();
void SN_SerialiseSounds(FArchive& Ar);

// PUBLIC DATA DECLARATIONS ------------------------------------------------

//**************************************************************************
//
//	$Log: sound.h,v $
//	Revision 1.14  2005/11/20 12:38:50  dj_jl
//	Implemented support for sound sequence extensions.
//	
//	Revision 1.13  2005/11/17 18:53:21  dj_jl
//	Implemented support for sndinfo extensions.
//	
//	Revision 1.12  2005/11/13 14:36:22  dj_jl
//	Moved common sound functions to main sound module.
//	
//	Revision 1.11  2005/11/08 20:57:15  dj_jl
//	Removed playing sound till done.
//	
//	Revision 1.10  2005/11/05 15:50:07  dj_jl
//	Voices played as normal sounds.
//	
//	Revision 1.9  2004/12/27 12:23:16  dj_jl
//	Multiple small changes for version 1.16
//	
//	Revision 1.8  2004/11/30 07:17:17  dj_jl
//	Made string pointers const.
//	
//	Revision 1.7  2002/07/27 18:10:11  dj_jl
//	Implementing Strife conversations.
//	
//	Revision 1.6  2002/01/11 08:15:06  dj_jl
//	Sound index retrieval by FName
//	
//	Revision 1.5  2002/01/07 12:16:43  dj_jl
//	Changed copyright year
//	
//	Revision 1.4  2001/08/29 17:55:42  dj_jl
//	Added sound channels
//	
//	Revision 1.3  2001/07/31 17:16:31  dj_jl
//	Just moved Log to the end of file
//	
//	Revision 1.2  2001/07/27 14:27:54  dj_jl
//	Update with Id-s and Log-s, some fixes
//
//**************************************************************************
