#ifndef __SNDDBG_H__
#define __SNDDBG_H__

#ifdef __cplusplus
extern "C" {
#endif

#include "snddll.h"

//#define SUPERVISATER

// ++++++++++++++++++++++++++++++++++++
// + Macro de compilation en mode DLL +  
// ++++++++++++++++++++++++++++++++++++

#ifdef SUPERVISATER
#undef DLL_IMPEXP
#define DLL_IMPEXP __declspec(dllexport)
#else
#undef DLL_IMPEXP
#define DLL_IMPEXP
#endif

//**************************************
#undef CPA_EXPORT
#if defined(CPA_WANTS_IMPORT)
#define CPA_EXPORT __declspec(dllimport)
#elif defined(CPA_WANTS_EXPORT)
#define CPA_EXPORT __declspec(dllexport)
#else
#define CPA_EXPORT
#endif
//**************************************

//versions statiques de dbgSND_fn_pstGetSelectedResource et dbgSND_fn_bDoesSupervisaterSelectResource
CPA_EXPORT tdstBlockResourceMem*	SND_fn_pstGetSelectedResource(void);
CPA_EXPORT SndBool					SND_fn_bDoesSupervisaterSelectResource(void);
CPA_EXPORT void						SND_fn_vRefreshSupervisater(void);

#if defined(_DLL_COMPILATION_MODE) && !defined(SNDDLL_MODULE)
//++++++++++++fonctions définies par SNDDBG.DLL
//fonctions générales
DLL_IMPEXP void SND_CALL SND_fn_vLaunchSupervisater(SND_tdstInitStruct *pInitStruct);
DLL_IMPEXP void SND_CALL SND_fn_vKillSupervisater();
DLL_IMPEXP void SND_CALL dbgSND_fn_vSetProjectTitleForSuperVisater(char* ProjectFilename);

DLL_IMPEXP void SND_CALL SND_fn_vSetSupervisaterActive(void);
DLL_IMPEXP SndBool SND_CALL SND_fn_bIsSupervisaterActive(void);

//suivi des objets
DLL_IMPEXP void SND_CALL dbgSND_fn_vAddEventToObject(long indice,long type,long asso,SND_tduRefEvt evt);
DLL_IMPEXP void SND_CALL dbgSND_fn_vKillEventToObject(long indice,long asso);
DLL_IMPEXP void SND_CALL dbgSND_fn_vSetPosObject(long indice,SoundParam* par);
//suivi des micros
DLL_IMPEXP void SND_CALL dbgSND_fn_vAddMicro(long indice);
DLL_IMPEXP void SND_CALL dbgSND_fn_vKillMicro(long indice);
DLL_IMPEXP void SND_CALL dbgSND_fn_vSetPosMicro(long indice,MicroParam* par);
//historique des events
DLL_IMPEXP void SND_CALL dbgSND_fn_vAddHistoric(SND_tduRefEvt evt,long indice,long obj_type,long asso,tdstBlockResourceMem* res);
//ligne de volume
DLL_IMPEXP void SND_CALL dbgSND_fn_vKillVolumeLine(long line);
DLL_IMPEXP void SND_CALL dbgSND_fn_vAddVolumeLine(long line);
DLL_IMPEXP void SND_CALL dbgSND_fn_vSetVolumeLine(long line,long vol);
//bank
DLL_IMPEXP void SND_CALL dbgSND_fn_vLoadBank(int iId);
DLL_IMPEXP void SND_CALL dbgSND_fn_vUnLoadBank(int iId);

DLL_IMPEXP void SND_CALL dbgSND_fn_vAddVoiceSample(long id,tduRefRes res,SampleParam *par);
DLL_IMPEXP void SND_CALL dbgSND_fn_vSetParVoiceSample(long id,SampleParam *par);
DLL_IMPEXP void SND_CALL dbgSND_fn_vDelVoiceSample(long id);
DLL_IMPEXP void SND_CALL dbgSND_fn_vPauseVoiceSample(long id);
DLL_IMPEXP void SND_CALL dbgSND_fn_vResumeVoiceSample(long id);
DLL_IMPEXP tdstBlockResourceMem*	SND_CALL dbgSND_fn_pstGetSelectedResource(void);
DLL_IMPEXP SndBool					SND_CALL dbgSND_fn_bDoesSupervisaterSelectResource(void);
DLL_IMPEXP void SND_CALL dbgSND_fn_vSetProcessTimeSample(float ratio);
//sndvirt
DLL_IMPEXP void SND_CALL dbgSND_fn_vRajListesSxdVirtual(void* VV,void* VA,void* VD);//obsolete
DLL_IMPEXP void SND_CALL dbgSND_fn_vRajListesSxdVirtual2(SND_tdhVirtualModule p_virtual_module);
DLL_IMPEXP void SND_CALL dbgSND_fn_vInitListesSxdVirtual(long p_virtual_module,char* descrpition);
DLL_IMPEXP void	SND_CALL dbgSND_fn_vRefreshSupervisater(void);
#else
//+++++++++fonctions définies par SNDxyuvw.LIB et utilisées par SNDDBG.DLL
DLL_IMPEXP SndBool	SND_CALL dbgSND_fn_bGetAskedTheme(tduRefRes*,SndBool*);
DLL_IMPEXP SndBool	SND_CALL dbgSND_fn_bGetThemePosition(tduRefRes*,long* ,long* );
DLL_IMPEXP void		SND_CALL dbgSND_fn_vGetInfoForObjectSound(long ,long ,char* ,long );
DLL_IMPEXP long		SND_CALL dbgSND_fn_lGetSizeOfSoundParam(SoundParam* );
DLL_IMPEXP void		SND_CALL SND_fn_vSetResNameCallback(tdpfnResNameCallback pfnResNameCallback);
DLL_IMPEXP const char* SND_CALL SND_fn_czGetResNameFromEdId(unsigned long ulId);
DLL_IMPEXP SndBool  SND_CALL dbgSND_fn_bSetResourceStaticVolume(unsigned long ulEdId,unsigned char ucVolume);
DLL_IMPEXP SndReal  SND_CALL dbgSND_fn_rGetDopplerFactor(void);
DLL_IMPEXP void  SND_CALL dbgSND_fn_vSendRequestSound(SND_tduRefEvt evt);




//to force symbols reference (fuction must be EXPORTable)
#if !defined(__WATCOMC__) && defined(SUPERVISATER)
#pragma comment(linker, "/INCLUDE:_dbgSND_fn_bGetAskedTheme@8")
#pragma comment(linker, "/INCLUDE:_dbgSND_fn_bGetThemePosition@12")
#pragma comment(linker, "/INCLUDE:_dbgSND_fn_vGetInfoForObjectSound@16")
#pragma comment(linker, "/INCLUDE:_dbgSND_fn_lGetSizeOfSoundParam@4")
#pragma comment(linker, "/INCLUDE:_SND_fn_vSetResNameCallback@4")
#pragma comment(linker, "/INCLUDE:_SND_fn_czGetResNameFromEdId@4")
#pragma comment(linker, "/INCLUDE:_dbgSND_fn_bSetResourceStaticVolume@8")
#pragma comment(linker, "/INCLUDE:_dbgSND_fn_rGetDopplerFactor@0")
#pragma comment(linker, "/INCLUDE:_dbgSND_fn_vSendRequestSound@4")
#endif

#endif

#ifdef __cplusplus
}
#endif

#endif //__SNDDBG_H__
