#ifndef _SNDADPCM_H_
#define _SNDADPCM_H_

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus*/

/*
//////////////////////////////////////////////////////////////
//	SNDADPCM.H												//
//////////////////////////////////////////////////////////////
//	Module d'exploitation des samples 2D en ADPCM			//
//////////////////////////////////////////////////////////////
*/

#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
/**************************************/

CPA_EXPORT long		SND_fn_lPlaySampleADPCM(tduRefRes res,SampleParam *par,long prio,SND_td_pfn_vSoundCallback fn_callback,long par_callback);
CPA_EXPORT void		SND_fn_vRemoveCallbackSampleADPCM(long voice);
CPA_EXPORT SndBool	SND_fn_bSetParamSampleADPCM(long voice,SampleParam *par);
CPA_EXPORT SndBool	SND_fn_bTestIsPlayingSampleADPCM(long voice);
CPA_EXPORT void		SND_fn_vStopSampleADPCM(long voice);
CPA_EXPORT void		SND_fn_vPauseSampleADPCM(long voice);
CPA_EXPORT void		SND_fn_vResumeSampleADPCM(long voice);

CPA_EXPORT SndBool	SND_fn_bIsResourceLoopingSampleADPCM(tduRefRes res);
CPA_EXPORT SndReal	SND_fn_rGetPosSampleADPCM(long voice);
CPA_EXPORT SndReal	SND_fn_rGetLengthSampleADPCM(long voice);
CPA_EXPORT void		SND_fn_vSetSoundVolumeSampleADPCM(unsigned char vol);

CPA_EXPORT unsigned char SND_fn_ucGetSoundVolumeSampleADPCM();
CPA_EXPORT void		SND_fn_vSetStereoSampleADPCM(SndBool active);
CPA_EXPORT SndBool	SND_fn_bGetStereoSampleADPCM(void);
CPA_EXPORT void		SND_fn_vSetReverseStereoSampleADPCM(SndBool active);
CPA_EXPORT SndBool	SND_fn_bGetReverseStereoSampleADPCM(void);

CPA_EXPORT int		SND_fn_iInitSampleADPCM(SND_tdstInitStruct *pInitStruct);
CPA_EXPORT SndBool	SND_fn_bTestInitSampleADPCM(void);
CPA_EXPORT void		SND_fn_vDesInitSampleADPCM(void);

CPA_EXPORT void		SND_fn_vSetEffectSampleADPCM(long num);

CPA_EXPORT void		SND_fn_vCreateMicroSampleADPCM(MicroParam* par,long id);
CPA_EXPORT void		SND_fn_vSetMicroParamSampleADPCM(long sxdId,MicroParam* par);
CPA_EXPORT void		SND_fn_vDestroyMicroSampleADPCM(long sxdId);

/*gestion de buffers*/
CPA_EXPORT long		SND_fn_lCreateNewBufferSampleADPCM(unsigned long nb_samples,unsigned short uwResolution,unsigned short uwNbChannels,unsigned long ulFreq,SampleParam* par,td_pfn_vRefreshBufferClient callback,long user_id);
CPA_EXPORT void		SND_fn_vSetParamBufferSampleADPCM(long id_buffer,SampleParam *par);
CPA_EXPORT void		SND_fn_vDeleteBufferSampleADPCM(long id_buffer);
CPA_EXPORT void		SND_fn_vPauseBufferSampleADPCM(long id_buffer);
CPA_EXPORT void		SND_fn_vResumeBufferSampleADPCM(long id_buffer);
CPA_EXPORT void*	SND_fn_pvGetPtrBufferSampleADPCM(long id_buffer);
CPA_EXPORT SndReal	SND_fn_rGetPosBufferSampleADPCM(long id_buffer);

CPA_EXPORT SndBool SND_fn_bLoadResScriptSampleADPCM(tdstBlockResourceDisk *disk,tdstBlockResourceMem *mem);
CPA_EXPORT SndBool SND_fn_bLoadResBinarySampleADPCM(tdstBlockResourceDisk *disk,tdstBlockResourceMem *mem,char *pDataBloc);
CPA_EXPORT SndBool SND_fn_bLoadResScriptAndConvertToWAVSampleADPCM(tdstBlockResourceDisk *disk,tdstBlockResourceMem *mem);
CPA_EXPORT SndBool SND_fn_bLoadResBinaryAndConvertToWAVSampleADPCM(tdstBlockResourceDisk *disk,tdstBlockResourceMem *mem,char *pDataBloc);

CPA_EXPORT void SND_fn_vUnLoadResSampleADPCM(tdstBlockResourceMem* mem);
CPA_EXPORT SndBool SND_fn_bIsResLoadedSampleADPCM(tdstBlockResourceMem *mem);

/*---themes*/
CPA_EXPORT long SND_fn_lPlayTransitionSampleADPCM(tduRefRes FirstRes,tduRefRes NextRes,SND_td_pfn_vSoundCallback transition_callback,long param_callback,SampleParam* par);
CPA_EXPORT SndBool SND_fn_bSetParamTransitionSampleADPCM(long voice,SampleParam *par);
CPA_EXPORT SndBool SND_fn_bSetNextTransitionSampleADPCM(long voice,tduRefRes new_res);
CPA_EXPORT SndBool SND_fn_bDoTransitionWithFadeSampleADPCM( long voice, tduRefRes new_res, SndReal rDuration );
CPA_EXPORT void SND_fn_vStopTransitionSampleADPCM(long voice);
CPA_EXPORT void SND_fn_vPauseTransitionSampleADPCM(long voice);
CPA_EXPORT void SND_fn_vResumeTransitionSampleADPCM(long voice);

#ifndef NO_ACP_LDBIN
CPA_EXPORT SndBool SND_fn_bCanFreeDataSampleADPCM(void);
#endif

/*--relache-reprise a chaud des drives*/
CPA_EXPORT void SND_fn_vReleaseDriverSampleADPCM(void);
CPA_EXPORT void SND_fn_vRestoreDriverSampleADPCM(void);

CPA_EXPORT void SND_fn_vGetTargetLabelSampleADPCM(char* name,int nb_char);
CPA_EXPORT void SND_fn_vSetupTargetSampleADPCM();
CPA_EXPORT SndBool SND_fn_bCanSetupTargetSampleADPCM();

CPA_EXPORT void SND_fn_vSynchroSampleADPCM();

CPA_EXPORT long SND_fn_lCreateNewBufferExSampleADPCM(SND_tdstFormat* pformat,SND_tdstCallback* pCallback,SoundParam* par,long user_id);
CPA_EXPORT long SND_fn_lGetPosBufferExSampleADPCM(long id_buffer);
CPA_EXPORT long SND_fn_lPushBufferExSampleADPCM(long id_buffer,SND_tdstStackBuffer* pStack);

CPA_EXPORT SndBool SND_fn_bCheckVersionResourceSampleADPCM(tdstBlockResourceDisk* disk);
CPA_EXPORT long SND_fn_lGetNbVoiceWishedSampleADPCM();
CPA_EXPORT SndBool SND_fn_bSetResourceStaticVolumeSampleADPCM(tdstBlockResourceMem* pstRes,unsigned char ucVolume);
#ifdef __cplusplus
}
#endif /* __cplusplus*/

#endif /*_SNDADPCM_H_*/

